From e9ccb4e5be0791435dbed85162ce8d44183e957d Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Wed, 27 Nov 2024 11:28:27 +0800 Subject: [PATCH 01/24] feat: add @visactor/vtable-plugins --- common/config/rush/pnpm-lock.yaml | 342 +++++++----- packages/vtable-plugins/.eslintrc.js | 273 ++++++++++ packages/vtable-plugins/README.md | 59 ++ packages/vtable-plugins/bundler.config.js | 17 + packages/vtable-plugins/demo/index.html | 36 ++ packages/vtable-plugins/demo/list/list.ts | 120 +++++ packages/vtable-plugins/demo/main.ts | 164 ++++++ packages/vtable-plugins/demo/menu.ts | 20 + .../vtable-plugins/demo/pivot/pivot-basic.ts | 510 ++++++++++++++++++ packages/vtable-plugins/demo/style.css | 100 ++++ packages/vtable-plugins/demo/vite.config.js | 37 ++ packages/vtable-plugins/package.json | 86 +++ packages/vtable-plugins/setup-mock.js | 2 + .../src}/carousel-animation.ts | 4 +- .../src}/custom-cell-style.ts | 13 +- .../src}/header-highlight.ts | 4 +- packages/vtable-plugins/src/index.ts | 5 + .../src}/invert-highlight.ts | 14 +- .../src}/list-tree-stick-cell.ts | 12 +- packages/vtable-plugins/tscofig.eslint.json | 25 + packages/vtable-plugins/tsconfig.json | 24 + packages/vtable-search/README.md | 2 +- packages/vtable/examples/vite.config.js | 1 + packages/vtable/jest.config.js | 6 +- packages/vtable/package.json | 3 +- packages/vtable/src/ListTable-all.ts | 3 +- packages/vtable/src/ListTable.ts | 2 +- packages/vtable/src/core/BaseTable.ts | 26 +- packages/vtable/src/core/style-helper.ts | 4 +- packages/vtable/src/index.ts | 17 +- .../scenegraph/group-creater/cell-helper.ts | 2 +- packages/vtable/src/ts-types/base-table.ts | 4 +- packages/vtable/tsconfig.eslint.json | 3 + rush.json | 9 + 34 files changed, 1781 insertions(+), 168 deletions(-) create mode 100644 packages/vtable-plugins/.eslintrc.js create mode 100644 packages/vtable-plugins/README.md create mode 100644 packages/vtable-plugins/bundler.config.js create mode 100644 packages/vtable-plugins/demo/index.html create mode 100644 packages/vtable-plugins/demo/list/list.ts create mode 100644 packages/vtable-plugins/demo/main.ts create mode 100644 packages/vtable-plugins/demo/menu.ts create mode 100644 packages/vtable-plugins/demo/pivot/pivot-basic.ts create mode 100644 packages/vtable-plugins/demo/style.css create mode 100644 packages/vtable-plugins/demo/vite.config.js create mode 100644 packages/vtable-plugins/package.json create mode 100644 packages/vtable-plugins/setup-mock.js rename packages/{vtable/src/plugins => vtable-plugins/src}/carousel-animation.ts (97%) rename packages/{vtable/src/plugins => vtable-plugins/src}/custom-cell-style.ts (93%) rename packages/{vtable/src/plugins => vtable-plugins/src}/header-highlight.ts (97%) create mode 100644 packages/vtable-plugins/src/index.ts rename packages/{vtable/src/plugins => vtable-plugins/src}/invert-highlight.ts (88%) rename packages/{vtable/src/plugins => vtable-plugins/src}/list-tree-stick-cell.ts (95%) create mode 100644 packages/vtable-plugins/tscofig.eslint.json create mode 100644 packages/vtable-plugins/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 42337abd7..3cd0bb131 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -59,7 +59,7 @@ importers: '@visactor/vue-vtable': link:../packages/vue-vtable '@visactor/vutils': 0.18.18 '@vue/compiler-dom': 3.5.13 - axios: 1.7.7 + axios: 1.7.8 buble: 0.20.0 highlight.js: 11.10.0 lodash: 4.17.21 @@ -143,10 +143,10 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@visactor/vchart': 1.12.12 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -165,12 +165,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/react-vtable: @@ -240,7 +240,7 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 @@ -248,7 +248,7 @@ importers: '@types/react-reconciler': 0.28.8 '@visactor/vchart': 1.12.12 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -268,12 +268,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable: @@ -299,6 +299,7 @@ importers: '@visactor/vrender-kits': 0.21.0-alpha.4 '@visactor/vscale': ~0.18.1 '@visactor/vtable-editors': workspace:* + '@visactor/vtable-plugins': workspace:* '@visactor/vutils': ~0.18.14 '@visactor/vutils-extension': ~1.11.5 '@vitejs/plugin-react': 3.1.0 @@ -345,6 +346,7 @@ importers: '@visactor/vrender-kits': 0.21.0-alpha.4 '@visactor/vscale': 0.18.18 '@visactor/vtable-editors': link:../vtable-editors + '@visactor/vtable-plugins': link:../vtable-plugins '@visactor/vutils': 0.18.18 '@visactor/vutils-extension': 1.11.14 cssfontparser: 1.2.1 @@ -360,13 +362,13 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@visactor/vchart': 1.12.12 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 d3-array: 3.2.3 d3-dsv: 3.0.1 @@ -393,12 +395,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable-calendar: @@ -463,13 +465,13 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@types/react-is': 17.0.7 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -490,12 +492,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable-editors: @@ -527,7 +529,7 @@ importers: '@internal/ts-config': link:../../share/ts-config '@rushstack/eslint-patch': 1.1.4 '@types/jest': 26.0.24 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 eslint: 8.18.0 husky: 7.0.4 @@ -538,11 +540,11 @@ importers: react-device-detect: 2.2.3 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 tslint: 5.12.1_typescript@4.9.5 typescript: 4.9.5 - vite: 3.2.6_@types+node@22.9.3 + vite: 3.2.6_@types+node@22.10.0 ../../packages/vtable-export: specifiers: @@ -611,14 +613,14 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@types/react-is': 17.0.7 '@visactor/vchart': 1.12.12 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -639,12 +641,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable-gantt: @@ -722,12 +724,12 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 d3-array: 3.2.3 d3-dsv: 3.0.1 @@ -754,12 +756,109 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 + vite-plugin-markdown: 2.2.0_vite@3.2.6 + + ../../packages/vtable-plugins: + specifiers: + '@babel/core': 7.20.12 + '@babel/preset-env': 7.20.2 + '@internal/bundler': workspace:* + '@internal/eslint-config': workspace:* + '@internal/ts-config': workspace:* + '@rushstack/eslint-patch': ~1.1.4 + '@types/chai': 4.2.22 + '@types/jest': ^26.0.0 + '@types/mocha': 9.0.0 + '@types/node': '*' + '@types/offscreencanvas': 2019.6.4 + '@types/react': ^18.0.0 + '@types/react-dom': ^18.0.0 + '@types/react-is': ^17.0.3 + '@visactor/vchart': 1.12.12 + '@visactor/vtable': workspace:* + '@visactor/vutils': ~0.18.14 + '@vitejs/plugin-react': 3.1.0 + axios: ^1.4.0 + chai: 4.3.4 + eslint: ~8.18.0 + form-data: ~4.0.0 + inversify: 6.0.1 + jest: ^26.0.0 + jest-electron: ^0.1.12 + jest-transform-stub: ^2.0.0 + json-formatter-js: ^2.3.4 + magic-string: ^0.25.7 + markdown-it: ^13.0.0 + mocha: 9.1.3 + node-fetch: 2.6.7 + postcss: 8.4.21 + react: ^18.0.0 + react-dom: ^18.0.0 + rimraf: 3.0.2 + rollup-plugin-node-resolve: 5.2.0 + sass: 1.43.5 + ts-jest: ^26.0.0 + ts-loader: 9.2.6 + ts-node: 10.9.0 + tslib: 2.3.1 + ttypescript: 1.5.13 + typescript: 4.9.5 + typescript-transform-paths: 3.3.1 + vite: 3.2.6 + vite-plugin-markdown: ^2.1.0 + dependencies: + '@visactor/vtable': link:../vtable + '@visactor/vutils': 0.18.18 + devDependencies: + '@babel/core': 7.20.12 + '@babel/preset-env': 7.20.2_@babel+core@7.20.12 + '@internal/bundler': link:../../tools/bundler + '@internal/eslint-config': link:../../share/eslint-config + '@internal/ts-config': link:../../share/ts-config + '@rushstack/eslint-patch': 1.1.4 + '@types/chai': 4.2.22 + '@types/jest': 26.0.24 + '@types/mocha': 9.0.0 + '@types/node': 22.10.0 + '@types/offscreencanvas': 2019.6.4 + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 + '@types/react-is': 17.0.7 + '@visactor/vchart': 1.12.12 + '@vitejs/plugin-react': 3.1.0_vite@3.2.6 + axios: 1.7.8 + chai: 4.3.4 + eslint: 8.18.0 + form-data: 4.0.1 + inversify: 6.0.1 + jest: 26.6.3_ts-node@10.9.0 + jest-electron: 0.1.12_jest@26.6.3 + jest-transform-stub: 2.0.0 + json-formatter-js: 2.5.18 + magic-string: 0.25.9 + markdown-it: 13.0.2 + mocha: 9.1.3 + node-fetch: 2.6.7 + postcss: 8.4.21 + react: 18.3.1 + react-dom: 18.3.1_react@18.3.1 + rimraf: 3.0.2 + rollup-plugin-node-resolve: 5.2.0 + sass: 1.43.5 + ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai + ts-loader: 9.2.6_typescript@4.9.5 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui + tslib: 2.3.1 + ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m + typescript: 4.9.5 + typescript-transform-paths: 3.3.1_typescript@4.9.5 + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable-search: @@ -823,14 +922,14 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@types/react-is': 17.0.7 '@visactor/vchart': 1.12.12 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -851,12 +950,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vue-vtable: @@ -920,11 +1019,11 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@visactor/vchart': 1.12.12 - '@vitejs/plugin-vue': 5.2.0_vite@3.2.6+vue@3.5.13 - axios: 1.7.7 + '@vitejs/plugin-vue': 5.2.1_vite@3.2.6+vue@3.5.13 + axios: 1.7.8 chai: 4.3.4 cross-env: 7.0.3 eslint: 8.18.0 @@ -944,12 +1043,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 vue: 3.5.13_typescript@4.9.5 vue-eslint-parser: 9.4.3_eslint@8.18.0 @@ -1010,13 +1109,13 @@ importers: '@internal/eslint-config': link:../../share/eslint-config '@internal/ts-config': link:../../share/ts-config '@rushstack/eslint-patch': 1.1.4 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/node-fetch': 2.6.4 cross-env: 7.0.3 eslint: 8.18.0 form-data: 4.0.1 node-fetch: 2.6.7 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui typescript: 4.9.5 ../../tools/bundler: @@ -1118,7 +1217,7 @@ importers: '@rollup/plugin-typescript': 11.1.0_ivokygnvpraqsbyfg47pib5bri '@rollup/plugin-url': 8.0.1_rollup@3.20.5 '@trufflesuite/spinnies': 0.1.1 - '@vitejs/plugin-vue': 5.2.0 + '@vitejs/plugin-vue': 5.2.1 autoprefixer: 10.4.13_postcss@8.4.21 babel-plugin-import: 1.13.6 clean-css: 5.3.2 @@ -1165,7 +1264,7 @@ importers: '@types/merge2': 1.4.0 '@types/minimist': 1.2.2 '@types/ms': 0.7.31 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/semver': 7.3.12 '@types/terser': 3.12.0 '@types/through2': 2.0.38 @@ -1174,7 +1273,7 @@ importers: '@types/yargs-parser': 21.0.0 eslint: 8.18.0 rimraf: 3.0.2 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui typescript: 4.9.5 vitest: 0.30.1_less@4.1.3+terser@5.17.1 @@ -2660,7 +2759,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 chalk: 4.1.2 jest-message-util: 26.6.2 jest-util: 26.6.2 @@ -2676,7 +2775,7 @@ packages: '@jest/test-result': 26.6.2 '@jest/transform': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 ansi-escapes: 4.3.2 chalk: 4.1.2 exit: 0.1.2 @@ -2725,7 +2824,7 @@ packages: dependencies: '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 jest-mock: 26.6.2 dev: true @@ -2744,7 +2843,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@sinonjs/fake-timers': 6.0.1 - '@types/node': 22.9.3 + '@types/node': 22.10.0 jest-message-util: 26.6.2 jest-mock: 26.6.2 jest-util: 26.6.2 @@ -2921,7 +3020,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/yargs': 15.0.19 chalk: 4.1.2 dev: true @@ -3566,7 +3665,7 @@ packages: /@types/clean-css/4.2.6: resolution: {integrity: sha512-Ze1tf+LnGPmG6hBFMi0B4TEB0mhF7EiMM5oyjLDNPE9hxrPU0W+5+bHvO+eFPA+bt0iC1zkQMoU/iGdRVjcRbw==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 source-map: 0.6.1 dev: true @@ -3594,13 +3693,13 @@ packages: /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/glob-stream/8.0.2: resolution: {integrity: sha512-kyuRfGE+yiSJWzSO3t74rXxdZNdYfLcllO0IUha4eX1fl40pm9L02Q/TEc3mykTLjoWz4STBNwYnUWdFu3I0DA==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/picomatch': 3.0.1 '@types/streamx': 2.9.5 dev: true @@ -3608,19 +3707,19 @@ packages: /@types/glob-watcher/5.0.2: resolution: {integrity: sha512-MZeh2nIzibl/euv5UV0femkGzcKTSE4G2+zv48d6ymeitWwCx52+4X+FqzML9oH2mQnPs+N/JHp3CsBPj1x1Ug==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/graceful-fs/4.1.9: resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/gulp-if/0.0.34: resolution: {integrity: sha512-r2A04hHDC+ZWMRAm+3q6/UeC3ggvl+TZm9P1+2umnp4q9bOlBmUQnR178Io3c0DkZPQAwup8VNtOvmvaWCpP5w==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/vinyl': 2.0.7 dev: true @@ -3634,7 +3733,7 @@ packages: /@types/gulp-sourcemaps/0.0.35: resolution: {integrity: sha512-vUBuizwA4CAV3Mke0DJYHQxyN4YOB1aAql284qAO7Et7fe0hmnPi/R9Fhu2UhxMuSxAwFktsJUOQk5dJHOU1eA==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/vinyl': 2.0.7 dev: true @@ -3710,7 +3809,7 @@ packages: /@types/merge2/1.4.0: resolution: {integrity: sha512-MRHDvln2ldZELrUC8n1PGaQzZ33aNh8uDcsGehREW0zR1Fr818a4/JTZjO9eloHPPxnpUp8fz/YFTRc5CWm7Xw==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/minimatch/5.1.2: @@ -3732,7 +3831,7 @@ packages: /@types/node-fetch/2.6.4: resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 form-data: 3.0.2 dev: true @@ -3744,10 +3843,10 @@ packages: resolution: {integrity: sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==} dev: false - /@types/node/22.9.3: - resolution: {integrity: sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==} + /@types/node/22.10.0: + resolution: {integrity: sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==} dependencies: - undici-types: 6.19.8 + undici-types: 6.20.0 /@types/normalize-package-data/2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -3803,7 +3902,7 @@ packages: /@types/resolve/0.0.8: resolution: {integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/resolve/1.20.2: @@ -3829,7 +3928,7 @@ packages: /@types/streamx/2.9.5: resolution: {integrity: sha512-IHYsa6jYrck8VEdSwpY141FTTf6D7boPeMq9jy4qazNrFMA4VbRz/sw5LSsfR7jwdDcx0QKWkUexZvsWBC2eIQ==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/terser/3.12.0: @@ -3842,7 +3941,7 @@ packages: /@types/through2/2.0.38: resolution: {integrity: sha512-YFu+nHmjxMurkH1BSzA0Z1WrKDAY8jUKPZctNQn7mc+/KKtp2XxnclHFXxdB1m7Iqnzb5aywgP8TMK283LezGQ==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/undertaker-registry/1.0.4: @@ -3852,7 +3951,7 @@ packages: /@types/undertaker/1.2.8: resolution: {integrity: sha512-gW3PRqCHYpo45XFQHJBhch7L6hytPsIe0QeLujlnFsjHPnXLhJcPdN6a9368d7aIQgH2I/dUTPFBlGeSNA3qOg==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/undertaker-registry': 1.0.4 async-done: 1.3.2 dev: true @@ -3861,7 +3960,7 @@ packages: resolution: {integrity: sha512-ckYz9giHgV6U10RFuf9WsDQ3X86EFougapxHmmoxLK7e6ICQqO8CE+4V/3lBN148V5N1pb4nQMmMjyScleVsig==} dependencies: '@types/glob-stream': 8.0.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/vinyl': 2.0.7 dev: true @@ -3869,7 +3968,7 @@ packages: resolution: {integrity: sha512-4UqPv+2567NhMQuMLdKAyK4yzrfCqwaTt6bLhHEs8PFcxbHILsrxaY63n4wgE/BRLDWDQeI+WcTmkXKExh9hQg==} dependencies: '@types/expect': 1.20.4 - '@types/node': 22.9.3 + '@types/node': 22.10.0 /@types/yargs-parser/21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} @@ -4224,22 +4323,22 @@ packages: - supports-color dev: true - /@vitejs/plugin-vue/5.2.0: - resolution: {integrity: sha512-7n7KdUEtx/7Yl7I/WVAMZ1bEb0eVvXF3ummWTeLcs/9gvo9pJhuLdouSXGjdZ/MKD1acf1I272+X0RMua4/R3g==} + /@vitejs/plugin-vue/5.2.1: + resolution: {integrity: sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: ^5.0.0 + vite: ^5.0.0 || ^6.0.0 vue: ^3.2.25 dev: false - /@vitejs/plugin-vue/5.2.0_vite@3.2.6+vue@3.5.13: - resolution: {integrity: sha512-7n7KdUEtx/7Yl7I/WVAMZ1bEb0eVvXF3ummWTeLcs/9gvo9pJhuLdouSXGjdZ/MKD1acf1I272+X0RMua4/R3g==} + /@vitejs/plugin-vue/5.2.1_vite@3.2.6+vue@3.5.13: + resolution: {integrity: sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: ^5.0.0 + vite: ^5.0.0 || ^6.0.0 vue: ^3.2.25 dependencies: - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vue: 3.5.13_typescript@4.9.5 dev: true @@ -4263,7 +4362,7 @@ packages: /@vitest/snapshot/0.30.1: resolution: {integrity: sha512-fJZqKrE99zo27uoZA/azgWyWbFvM1rw2APS05yB0JaLwUIg9aUtvvnBf4q7JWhEcAHmSwbrxKFgyBUga6tq9Tw==} dependencies: - magic-string: 0.30.13 + magic-string: 0.30.14 pathe: 1.1.2 pretty-format: 27.5.1 dev: true @@ -4306,7 +4405,7 @@ packages: '@vue/compiler-ssr': 3.5.13 '@vue/shared': 3.5.13 estree-walker: 2.0.2 - magic-string: 0.30.13 + magic-string: 0.30.14 postcss: 8.4.49 source-map-js: 1.2.1 @@ -4881,8 +4980,8 @@ packages: resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==} dev: true - /axios/1.7.7: - resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} + /axios/1.7.8: + resolution: {integrity: sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==} dependencies: follow-redirects: 1.15.9 form-data: 4.0.1 @@ -5220,7 +5319,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001684 - electron-to-chromium: 1.5.64 + electron-to-chromium: 1.5.65 node-releases: 2.0.18 update-browserslist-db: 1.1.1_browserslist@4.24.2 @@ -6438,8 +6537,8 @@ packages: safer-buffer: 2.1.2 dev: true - /electron-to-chromium/1.5.64: - resolution: {integrity: sha512-IXEuxU+5ClW2IGEYFC2T7szbyVgehupCWQe5GNh+H065CD6U6IFN0s4KeAMFGNmQolRU4IV7zGBWSYMmZ8uuqQ==} + /electron-to-chromium/1.5.65: + resolution: {integrity: sha512-PWVzBjghx7/wop6n22vS2MLU8tKGd4Q91aCEGhG/TYmW6PP5OcSXcdnxTe1NNt0T66N8D6jxh4kC8UsdzOGaIw==} /electron/11.5.0: resolution: {integrity: sha512-WjNDd6lGpxyiNjE3LhnFCAk/D9GIj1rU3GSDealVShhkkkPR3Vh4q8ErXGDl1OAO/faomVa10KoFPUN/pLbNxg==} @@ -8023,7 +8122,7 @@ packages: resolution: {integrity: sha512-SVSF7ikuWKhpAW4l4wapAqPPSToJoiNKsbDoUnRrSgwZHH7lH8pbPeQj1aOVYQrbZKhfSVBxVW+Py7vtulRktw==} engines: {node: '>=10'} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/vinyl': 2.0.7 istextorbinary: 3.3.0 replacestream: 4.0.3 @@ -8962,7 +9061,7 @@ packages: jest-validate: 26.6.2 micromatch: 4.0.8 pretty-format: 26.6.2 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui transitivePeerDependencies: - bufferutil - canvas @@ -9067,7 +9166,7 @@ packages: '@jest/environment': 26.6.2 '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 jest-mock: 26.6.2 jest-util: 26.6.2 jsdom: 16.7.0 @@ -9098,7 +9197,7 @@ packages: '@jest/environment': 26.6.2 '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 jest-mock: 26.6.2 jest-util: 26.6.2 dev: true @@ -9138,7 +9237,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@types/graceful-fs': 4.1.9 - '@types/node': 22.9.3 + '@types/node': 22.10.0 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -9186,7 +9285,7 @@ packages: '@jest/source-map': 26.6.2 '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 chalk: 4.1.2 co: 4.6.0 expect: 26.6.2 @@ -9284,7 +9383,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /jest-pnp-resolver/1.2.3_jest-resolve@24.9.0: @@ -9390,7 +9489,7 @@ packages: '@jest/environment': 26.6.2 '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 chalk: 4.1.2 emittery: 0.7.2 exit: 0.1.2 @@ -9531,7 +9630,7 @@ packages: resolution: {integrity: sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==} engines: {node: '>= 10.14.2'} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 graceful-fs: 4.2.11 dev: true @@ -9603,7 +9702,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 chalk: 4.1.2 graceful-fs: 4.2.11 is-ci: 2.0.0 @@ -9640,7 +9739,7 @@ packages: dependencies: '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 ansi-escapes: 4.3.2 chalk: 4.1.2 jest-util: 26.6.2 @@ -9659,7 +9758,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -10288,8 +10387,8 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 - /magic-string/0.30.13: - resolution: {integrity: sha512-8rYBO+MsWkgjDSOvLomYnzhdwEG51olQ4zL5KXnNJWV5MNmrb4rTZdrtkhxjnD/QyZUqR/Z/XDsUs/4ej2nx0g==} + /magic-string/0.30.14: + resolution: {integrity: sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==} dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -10589,8 +10688,8 @@ packages: hasBin: true dev: true - /nanoid/3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + /nanoid/3.3.8: + resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -11376,7 +11475,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.21 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui yaml: 1.10.2 dev: false @@ -11680,7 +11779,7 @@ packages: resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.7 + nanoid: 3.3.8 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -11688,7 +11787,7 @@ packages: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.7 + nanoid: 3.3.8 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -13529,7 +13628,7 @@ packages: mkdirp: 1.0.4 semver: 7.3.4 typescript: 4.9.5 - yargs-parser: 20.2.9 + yargs-parser: 20.2.4 dev: true /ts-loader/9.2.6_typescript@4.9.5: @@ -13546,7 +13645,7 @@ packages: typescript: 4.9.5 dev: true - /ts-node/10.9.0_oi3tcmo2siqwex47lqfbz2rfz4: + /ts-node/10.9.0_gvyh6auciohtph3635nyjnikui: resolution: {integrity: sha512-bunW18GUyaCSYRev4DPf4SQpom3pWH29wKl0sDk5zE7ze19RImEVhCW7K4v3hHKkUyfWotU08ToE2RS+Y49aug==} hasBin: true peerDependencies: @@ -13565,7 +13664,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.9.3 + '@types/node': 22.10.0 acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 @@ -13635,7 +13734,7 @@ packages: typescript: '>=3.2.2' dependencies: resolve: 1.22.8 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui typescript: 4.9.5 dev: true @@ -13820,8 +13919,8 @@ packages: undertaker-registry: 1.0.1 dev: false - /undici-types/6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + /undici-types/6.20.0: + resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} /unicode-canonical-property-names-ecmascript/1.0.4: resolution: {integrity: sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==} @@ -14103,7 +14202,7 @@ packages: replace-ext: 1.0.1 dev: false - /vite-node/0.30.1_ilu4heox2xruf77sidg3lidnqi: + /vite-node/0.30.1_bynzxunm26yds2qzned2henjoq: resolution: {integrity: sha512-vTikpU/J7e6LU/8iM3dzBo8ZhEiKZEKRznEMm+mJh95XhWaPrJQraT/QsT2NWmuEf+zgAoMe64PKT7hfZ1Njmg==} engines: {node: '>=v14.18.0'} hasBin: true @@ -14113,7 +14212,7 @@ packages: mlly: 1.7.3 pathe: 1.1.2 picocolors: 1.1.1 - vite: 3.2.6_ilu4heox2xruf77sidg3lidnqi + vite: 3.2.6_bynzxunm26yds2qzned2henjoq transitivePeerDependencies: - '@types/node' - less @@ -14133,7 +14232,7 @@ packages: front-matter: 4.0.2 htmlparser2: 6.1.0 markdown-it: 12.3.2 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 dev: true /vite/3.2.6: @@ -14169,7 +14268,7 @@ packages: fsevents: 2.3.3 dev: true - /vite/3.2.6_@types+node@22.9.3: + /vite/3.2.6_3fcrixghlk5j7efp7olgstdjb4: resolution: {integrity: sha512-nTXTxYVvaQNLoW5BQ8PNNQ3lPia57gzsQU/Khv+JvzKPku8kNZL6NMUR/qwXhMG6E+g1idqEPanomJ+VZgixEg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -14194,16 +14293,17 @@ packages: terser: optional: true dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 esbuild: 0.15.18 postcss: 8.4.21 resolve: 1.22.8 rollup: 2.79.2 + sass: 1.43.5 optionalDependencies: fsevents: 2.3.3 dev: true - /vite/3.2.6_bllobutr3eoehqzbz4ic735l7m: + /vite/3.2.6_@types+node@22.10.0: resolution: {integrity: sha512-nTXTxYVvaQNLoW5BQ8PNNQ3lPia57gzsQU/Khv+JvzKPku8kNZL6NMUR/qwXhMG6E+g1idqEPanomJ+VZgixEg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -14228,17 +14328,16 @@ packages: terser: optional: true dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 esbuild: 0.15.18 postcss: 8.4.21 resolve: 1.22.8 rollup: 2.79.2 - sass: 1.43.5 optionalDependencies: fsevents: 2.3.3 dev: true - /vite/3.2.6_ilu4heox2xruf77sidg3lidnqi: + /vite/3.2.6_bynzxunm26yds2qzned2henjoq: resolution: {integrity: sha512-nTXTxYVvaQNLoW5BQ8PNNQ3lPia57gzsQU/Khv+JvzKPku8kNZL6NMUR/qwXhMG6E+g1idqEPanomJ+VZgixEg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -14263,7 +14362,7 @@ packages: terser: optional: true dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 esbuild: 0.15.18 less: 4.1.3 postcss: 8.4.21 @@ -14307,7 +14406,7 @@ packages: dependencies: '@types/chai': 4.3.20 '@types/chai-subset': 1.3.5 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@vitest/expect': 0.30.1 '@vitest/runner': 0.30.1 '@vitest/snapshot': 0.30.1 @@ -14320,7 +14419,7 @@ packages: concordance: 5.0.4 debug: 4.3.4 local-pkg: 0.4.3 - magic-string: 0.30.13 + magic-string: 0.30.14 pathe: 1.1.2 picocolors: 1.1.1 source-map: 0.6.1 @@ -14328,8 +14427,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.9.0 tinypool: 0.4.0 - vite: 3.2.6_ilu4heox2xruf77sidg3lidnqi - vite-node: 0.30.1_ilu4heox2xruf77sidg3lidnqi + vite: 3.2.6_bynzxunm26yds2qzned2henjoq + vite-node: 0.30.1_bynzxunm26yds2qzned2henjoq why-is-node-running: 2.3.0 transitivePeerDependencies: - less @@ -14674,11 +14773,6 @@ packages: engines: {node: '>=10'} dev: true - /yargs-parser/20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - dev: true - /yargs-parser/21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -14742,7 +14836,7 @@ packages: require-directory: 2.1.1 string-width: 4.2.3 y18n: 5.0.8 - yargs-parser: 20.2.9 + yargs-parser: 20.2.4 dev: true /yargs/17.7.2: diff --git a/packages/vtable-plugins/.eslintrc.js b/packages/vtable-plugins/.eslintrc.js new file mode 100644 index 000000000..8023127bc --- /dev/null +++ b/packages/vtable-plugins/.eslintrc.js @@ -0,0 +1,273 @@ +/* eslint-disable no-undef */ +require('@rushstack/eslint-patch/modern-module-resolution'); + +module.exports = { + extends: ['@internal/eslint-config/profile/lib'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tscofig.eslint.json' + }, + env: { + browser: true, + es2021: true, + node: true, + jest: true + }, + globals: { + __DEV__: 'readonly', + __VERSION__: 'readonly', + NodeJS: true + }, + overrides: [ + { + files: ['**/__tests__/**', '**/*.test.ts'], + // 测试文件允许以下规则 + rules: { + '@typescript-eslint/no-empty-function': 'off', + 'no-console': 'off', + 'dot-notation': 'off' + } + } + ], + rules: { + 'prettier/prettier': ['warn'], + 'linebreak-style': [0, 'error', 'windows'], + // 强制换行时操作符在行首 + // 与prettier冲突 + // "operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }], + // 允许给能自动推断出类型的primitive类型变量额外添加类型声明 + '@typescript-eslint/no-inferrable-types': 'off', + // 在类型导入时推荐import type写法 + '@typescript-eslint/consistent-type-imports': 'warn', + // 禁止出现空接口定义 + '@typescript-eslint/no-empty-interface': 'error', + // 禁止出现空函数 + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-this-alias': 'off', + // 禁止使用namespace + '@typescript-eslint/no-namespace': 'error', + // 禁止使用for-in Array + '@typescript-eslint/no-for-in-array': 'error', + // 禁止在optional chain语句后加非空断言 + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + // 接口定义中使用函数属性而不是对象方法声明 + '@typescript-eslint/method-signature-style': 'error', + // 默认省略除属性以外的public修饰符 + '@typescript-eslint/explicit-member-accessibility': [ + 'warn', + { + overrides: { + accessors: 'off', + constructors: 'no-public', + methods: 'no-public', + properties: 'no-public', + parameterProperties: 'explicit' + } + } + ], + 'no-console': [ + 1, // 开发期间先关闭 + { + // allow: ["warn", "error"] + allow: ['warn', 'error'] + } + ], + // 如果一个变量不会被重新赋值,最好使用const进行声明 + 'prefer-const': 2, + // 禁止在条件中使用常量表达式 + 'no-constant-condition': 0, + 'no-debugger': 2, + // 禁止对象字面量中出现重复的 key + 'no-dupe-keys': 2, + // 禁止在正则表达式中使用空字符集 + 'no-empty-character-class': 2, + // 禁止对 catch 子句的参数重新赋值 + 'no-ex-assign': 2, + 'no-extra-boolean-cast': 0, + // 禁止对 function 声明重新赋值 + 'no-func-assign': 2, + // 禁止在嵌套的块中出现变量声明或 function 声明 + 'no-inner-declarations': 2, + // 禁止 RegExp 构造函数中存在无效的正则表达式字符串 + 'no-invalid-regexp': 2, + // 禁止对关系运算符的左操作数使用否定操作符 + 'no-unsafe-negation': 2, + // 禁止把全局对象作为函数调用 + 'no-obj-calls': 2, + // 禁用稀疏数组 + 'no-sparse-arrays': 2, + // 禁止在 return、throw、continue 和 break 语句之后出现不可达代码 + 'no-unreachable': 2, + // 要求使用 isNaN() 检查 NaN + 'use-isnan': 2, + // 强制 typeof 表达式与有效的字符串进行比较 + 'valid-typeof': 2, + // 要求使用 === 和 !==,除了与 null 字面量进行比较时 + eqeqeq: [ + 'error', + 'always', + { + null: 'ignore' + } + ], + // 允许 if 语句中 return 语句之后有 else 块 + 'no-else-return': 1, + // 禁用标签语句 + 'no-labels': [ + 2, + { + // 忽略循环语句中的标签 + allowLoop: true + } + ], + // 禁用 eval() + 'no-eval': 2, + // 禁止扩展原生类型 + 'no-extend-native': 2, + // 禁止不必要的 .bind() 调用 + 'no-extra-bind': 0, + // 禁止使用类似 eval() 的方法 + 'no-implied-eval': 2, + // 禁用 __iterator__ 属性 + 'no-iterator': 2, + // 禁止不规则的空白 + 'no-irregular-whitespace': 2, + // 禁用不必要的嵌套块 + 'no-lone-blocks': 2, + // 禁止循环中存在函数 + 'no-loop-func': 2, + // 禁止多行字符串 + 'no-multi-str': 2, + // 禁止对原生对象或只读的全局对象进行赋值 + 'no-global-assign': 2, + // 禁止对 String,Number 和 Boolean 使用 new 操作符 + 'no-new-wrappers': 2, + // 禁用八进制字面量 + 'no-octal': 2, + // 禁止在字符串中使用八进制转义序列 + 'no-octal-escape': 2, + // 禁用 __proto__ 属性 + 'no-proto': 2, + // 禁止自身比较 + 'no-self-compare': 2, + // 禁止可以在有更简单的可替代的表达式时使用三元操作符 + 'no-unneeded-ternary': 2, + // 禁用 with 语句 + 'no-with': 2, + // 强制在 parseInt() 使用基数参数 + radix: 2, + // 要求 IIFE 使用括号括起来 + 'wrap-iife': [2, 'any'], + // 禁止删除变量 + 'no-delete-var': 2, + // 禁止 function 定义中出现重名参数 + 'no-dupe-args': 2, + // 禁止出现重复的 case 标签 + 'no-duplicate-case': 2, + // 不允许标签与变量同名 + 'no-label-var': 2, + // 禁止将标识符定义为受限的名字 + 'no-shadow-restricted-names': 2, + // 禁用未声明的变量,除非它们在 /*global */ 注释中被提到 + 'no-undef': 2, + // 禁止将变量初始化为 undefined + 'no-undef-init': 2, + // 允许在变量定义之前使用它们 + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 0, + // 强制或禁止调用无参构造函数时有圆括号 + 'new-parens': 2, + // 禁用 Array 构造函数 + 'no-array-constructor': 2, + // 禁用 Object 的构造函数 + 'no-new-object': 2, + // 禁止不必要的括号 + 'no-extra-parens': [2, 'functions'], + // 禁止使用 空格 和 tab 混合缩进 + 'no-mixed-spaces-and-tabs': 2, + // 强制函数中的变量在分开声明 + 'one-var': [2, 'never'], + // 建议回调函数最大嵌套深度不超过5 + 'max-nested-callbacks': [1, 5], + // 建议可嵌套的块的最大深度不超过6 + 'max-depth': [1, 6], + // 强制一行的最大长度不超过120,不包括注释和url + 'max-len': [ + 'error', + { + code: 120, + ignoreUrls: true, + ignoreComments: true + } + ], + // 建议函数定义中最多允许的参数数量不超过15个 + 'max-params': [1, 15], + // 强制非一元操作符周围有空格 + 'space-infix-ops': 2, + // 强制尽可能地使用点号 + 'dot-notation': [ + 2, + { + // 避免对是保留字的属性使用点号 + allowKeywords: true, + allowPattern: '^catch$' + } + ], + // 强制箭头函数的箭头前后使用一致的空格 + 'arrow-spacing': 2, + // 要求在构造函数中有 super() 的调用 + 'constructor-super': 2, + // 禁止在可能与比较操作符相混淆的地方使用箭头函数 + // 与prettier冲突 + // "no-confusing-arrow": [ + // 2, + // { + // // 该规则不那么严格,将括号作为有效防止混淆的语法。 + // "allowParens": true + // } + // ], + // 禁止修改类声明的变量 + 'no-class-assign': 2, + // 禁止修改 const 声明的变量 + 'no-const-assign': 2, + // 允许在构造函数中,在调用 super() 之前使用 this 或 super + 'no-this-before-super': 0, + // 要求使用 let 或 const 而不是 var + 'no-var': 2, + // 重复模块导入 + // "no-duplicate-imports": 1, + '@typescript-eslint/no-duplicate-imports': 1, + // 建议使用剩余参数而不是 arguments + 'prefer-rest-params': 1, + // 禁止 Unicode 字节顺序标记 (BOM) + 'unicode-bom': 2, + // 强制每一行中所允许的最大语句数量为2 + 'max-statements-per-line': 2, + // 允许不必要的构造函数 + 'no-useless-constructor': 0, + // 允许在函数标识符和其调用之间有空格 + 'func-call-spacing': 'off', + '@typescript-eslint/func-call-spacing': 'error', + // 允许出现未使用过的变量 + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ + 1, + { + // 仅仅检测本作用域中声明的变量是否使用,允许不使用全局环境中的变量。 + vars: 'local', + // 不检查参数 + args: 'none' + } + ], + // 禁用特定的全局变量 + 'no-restricted-globals': [2, 'event', 'name', 'length', 'orientation', 'top', 'parent', 'location', 'closed'], + // 不允许省略大括号 + curly: 'error', + 'promise/catch-or-return': 'warn', + // indent: [1, 2], + 'no-multi-spaces': 1, + 'no-multiple-empty-lines': [1, { max: 1 }], + 'no-trailing-spaces': 1 + }, + ignorePatterns: ['*.config.ts'] +}; diff --git a/packages/vtable-plugins/README.md b/packages/vtable-plugins/README.md new file mode 100644 index 000000000..7dbd61280 --- /dev/null +++ b/packages/vtable-plugins/README.md @@ -0,0 +1,59 @@ +
+ + VisActor Logo + +
+ +
+

VTable-Plugins

+
+ +
+ +VTable is not just a high-performance multidimensional data analysis table, but also a grid artist that creates art between rows and columns.React-VTable is a React wrapper of VTable. + +[![npm Version](https://img.shields.io/npm/v/@visactor/vtable.svg)](https://www.npmjs.com/package/@visactor/react-vtable) +[![npm Download](https://img.shields.io/npm/dm/@visactor/vtable.svg)](https://www.npmjs.com/package/@visactor/react-vvtable) +[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/visactor/vtable/blob/main/LICENSE) + +
+ +# Usage + +## Installation + +[npm package](https://www.npmjs.com/package/@visactor/vtable-search) + +```bash +// npm +npm install @visactor/vtable-plugins + +// yarn +yarn add @visactor/vtable-plugins +``` + +## + +[More demos and detailed tutorials](https://visactor.io/vtable) + +# Related Links + +- [Official website](https://visactor.io/vtable) + +# Ecosystem + +| Project | Description | +| ----------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| [AI-generated Components](https://visactor.io/ai-vtable) | AI-generated table component. | + +# Contribution + +If you would like to contribute, please read the [Code of Conduct ](./CODE_OF_CONDUCT.md) 和 [ Guide](./CONTRIBUTING.zh-CN.md) first。 + +Small streams converge to make great rivers and seas! + + + +# License + +[MIT License](./LICENSE) diff --git a/packages/vtable-plugins/bundler.config.js b/packages/vtable-plugins/bundler.config.js new file mode 100644 index 000000000..4b43455e1 --- /dev/null +++ b/packages/vtable-plugins/bundler.config.js @@ -0,0 +1,17 @@ +/** + * @type {Partial} + */ +const resolve = require('rollup-plugin-node-resolve'); + +module.exports = { + formats: ['cjs', 'es', 'umd'], + noEmitOnError: false, + copy: ['css'], + name: 'VTable.plugins', + umdOutputFilename: 'vtable-plugins', + rollupOptions: {}, + globals: { + '@visactor/vtable': 'VTable' + }, + external: ['@visactor/vtable'] +}; diff --git a/packages/vtable-plugins/demo/index.html b/packages/vtable-plugins/demo/index.html new file mode 100644 index 000000000..922a54969 --- /dev/null +++ b/packages/vtable-plugins/demo/index.html @@ -0,0 +1,36 @@ + + + + + + + + + + VTable demos + + + +
+ +
+
+ + 0/0 + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/packages/vtable-plugins/demo/list/list.ts b/packages/vtable-plugins/demo/list/list.ts new file mode 100644 index 000000000..3d4cf978f --- /dev/null +++ b/packages/vtable-plugins/demo/list/list.ts @@ -0,0 +1,120 @@ +import * as VTable from '@visactor/vtable'; +import { SearchComponent } from '../../src'; +const CONTAINER_ID = 'vTable'; +const generatePersons = count => { + return Array.from(new Array(count)).map((_, i) => ({ + id: i + 1, + email1: `${i + 1}@xxx.com`, + name: `小明${i + 1}`, + lastName: '王', + date1: '2022年9月1日', + tel: '000-0000-0000', + sex: i % 2 === 0 ? 'boy' : 'girl', + work: i % 2 === 0 ? 'back-end engineer' : 'front-end engineer', + city: 'beijing' + })); +}; + +export function createTable() { + const records = generatePersons(100); + const columns: VTable.ColumnsDefine = [ + { + field: '', + title: '行号', + width: 80, + fieldFormat(data, col, row, table) { + return row - 1; + } + }, + { + field: 'id', + title: 'ID', + width: '1%', + minWidth: 200, + sort: true + }, + { + field: 'email1', + title: 'email', + width: 200, + sort: true + }, + { + title: 'full name', + columns: [ + { + field: 'name', + title: 'First Name', + width: 200 + }, + { + field: 'name', + title: 'Last Name', + width: 200 + } + ] + }, + { + field: 'date1', + title: 'birthday', + width: 200 + }, + { + field: 'sex', + title: 'sex', + width: 100 + }, + { + field: 'tel', + title: 'telephone', + width: 150 + }, + { + field: 'work', + title: 'job', + width: 200 + }, + { + field: 'city', + title: 'city', + width: 150 + } + ]; + const option = { + container: document.getElementById(CONTAINER_ID), + records, + columns, + tooltip: { + isShowOverflowTextTooltip: true + } + // frozenColCount: 1, + // bottomFrozenRowCount: 2, + // rightFrozenColCount: 2, + // overscrollBehavior: 'none' + // autoWrapText: true, + // heightMode: 'autoHeight', + // widthMode: 'adaptive' + }; + const tableInstance = new VTable.ListTable(option); + window.tableInstance = tableInstance; + + const search = new SearchComponent({ + table: tableInstance, + autoJump: true + }); + window.search = search; + // tableInstance.on('sort_click', args => { + // tableInstance.updateSortState( + // { + // field: args.field, + // order: Date.now() % 3 === 0 ? 'desc' : Date.now() % 3 === 1 ? 'asc' : 'normal' + // }, + // false + // ); + // return false; //return false代表不执行内部排序逻辑 + // }); + + setTimeout(() => { + tableInstance.updateOption(option); + }, 2000); +} diff --git a/packages/vtable-plugins/demo/main.ts b/packages/vtable-plugins/demo/main.ts new file mode 100644 index 000000000..334ab9ec9 --- /dev/null +++ b/packages/vtable-plugins/demo/main.ts @@ -0,0 +1,164 @@ +import { menus } from './menu'; +// import * as VTable from '../src'; +import { default as MarkdownIt } from 'markdown-it'; +// window.VTable = VTable; +// window.PivotTable = PivotTable; +// window.PivotTable = PivotTable; +// window.CONTAINER_ID = 'vTable'; + +const md = new MarkdownIt(); + +const ACTIVE_ITEM_CLS = 'menu-item-active'; +const MENU_TITLE_CLS = 'menu-title'; +const LOCAL_STORAGE_KEY = 'VTABLE_DEMO'; + +const evaluateCode = (code: string) => { + // eslint-disable-next-line no-console + if (!code) { + return; + } + try { + Function(code)(window); + } catch (err) { + // eslint-disable-next-line no-console + console.error(err); + } +}; + +const handleClick = (e: { target: any }, isInit?: boolean) => { + const triggerNode = e.target; + + if (!triggerNode || triggerNode.classList.contains(MENU_TITLE_CLS)) { + return; + } + + if (triggerNode) { + const path = triggerNode.dataset.path; + const name = triggerNode.dataset.name; + + if (path && name) { + const prevActiveItems = document.getElementsByClassName(ACTIVE_ITEM_CLS); + + if (prevActiveItems && prevActiveItems.length) { + for (let i = 0; i < prevActiveItems.length; i++) { + const element = prevActiveItems[i]; + + element.classList.remove(ACTIVE_ITEM_CLS); + } + } + triggerNode.classList.add(ACTIVE_ITEM_CLS); + if (!isInit) { + localStorage.setItem(LOCAL_STORAGE_KEY, name); + } + + if (window.tableInstance) { + window.tableInstance.release(); + document.getElementById('vTable').innerHTML = null; + } + + let fileType = 'ts'; + if (path === 'custom-layout-jsx') { + fileType = 'tsx'; + } + import(`./${path}/${name}.${fileType}`) + .then(module => { + // eslint-disable-next-line no-console + console.info('%c %s', 'color: #1890ff;font-weight: bold', `当前 demo 路径:./examples/${path}/${name}.md`); + // document.getElementById('article').innerHTML = module.html; + // const jsCode = document.getElementsByClassName('language-ts')[0].innerHTML; + // evaluateCode(md.utils.unescapeAll(jsCode)); + + if (module.createTable) { + module.createTable(); + } + }) + .catch(err => { + // eslint-disable-next-line no-console + console.log(err); + }); + } + } +}; + +const initSidebarEvent = (node: HTMLDivElement) => { + node.addEventListener('click', handleClick); +}; + +const createSidebar = (node: HTMLDivElement) => { + const specsHtml = menus.map(entry => { + if (entry.menu && entry.children && entry.children.length) { + const childrenItems = entry.children.map(child => { + return ``; + }); + + return `${childrenItems.join('')}`; + } + + return ``; + }); + + node.innerHTML = ` +
+ + +
+ `; +}; + +const run = () => { + const sidebarNode = document.querySelector('#sidebar')!; + const prevActivePath = localStorage.getItem(LOCAL_STORAGE_KEY); + + createSidebar(sidebarNode); + initSidebarEvent(sidebarNode); + + const menuItemNodes = document.getElementsByClassName('menu-item'); + + handleClick( + { + target: + menuItemNodes && + menuItemNodes.length && + ([...menuItemNodes].find(node => { + return prevActivePath && node.dataset.name === prevActivePath; + }) || + menuItemNodes[0]) + }, + true + ); +}; + +function bindSearch() { + const searchInput = document.getElementById('search-component-input') as HTMLInputElement; + const searchBtn = document.getElementById('search-component-search') as HTMLButtonElement; + const searchResult = document.getElementById('search-component-result') as HTMLSpanElement; + const searchPrevBtn = document.getElementById('search-component-prev') as HTMLButtonElement; + const searchNextBtn = document.getElementById('search-component-next') as HTMLButtonElement; + + searchBtn.addEventListener('click', () => { + if (window.search) { + const result = window.search.search(searchInput.value); + searchResult.innerText = `${result.index + 1}/${result.results.length}`; + } + }); + + searchPrevBtn.addEventListener('click', () => { + if (window.search) { + const result = window.search.prev(); + searchResult.innerText = `${result.index + 1}/${result.results.length}`; + } + }); + + searchNextBtn.addEventListener('click', () => { + if (window.search) { + const result = window.search.next(); + searchResult.innerText = `${result.index + 1}/${result.results.length}`; + } + }); +} + +run(); + +bindSearch(); diff --git a/packages/vtable-plugins/demo/menu.ts b/packages/vtable-plugins/demo/menu.ts new file mode 100644 index 000000000..0efaad87d --- /dev/null +++ b/packages/vtable-plugins/demo/menu.ts @@ -0,0 +1,20 @@ +export const menus = [ + { + menu: 'listTable', + children: [ + { + path: 'list', + name: 'list' + } + ] + }, + { + menu: 'pivotTable', + children: [ + { + path: 'pivot', + name: 'pivot-basic' + } + ] + } +]; diff --git a/packages/vtable-plugins/demo/pivot/pivot-basic.ts b/packages/vtable-plugins/demo/pivot/pivot-basic.ts new file mode 100644 index 000000000..22a378419 --- /dev/null +++ b/packages/vtable-plugins/demo/pivot/pivot-basic.ts @@ -0,0 +1,510 @@ +import * as VTable from '@visactor/vtable'; +import { SearchComponent } from '../../src'; +// import { bindDebugTool } from '../../src/scenegraph/debug-tool'; +const PivotTable = VTable.PivotTable; +const CONTAINER_ID = 'vTable'; + +function generatePivotDataSource(num, colCount) { + const array = new Array(num); + for (let i = 0; i < num; i++) { + const data = new Array(colCount); + for (let j = 0; j < colCount; j++) { + data[j] = i + j; + } + array[i] = data; + } + return array; +} +const DEFAULT_BAR_COLOR = data => { + const num = (data.percentile ?? 0) * 100; + if (num > 80) { + return '#20a8d8'; + } + if (num > 50) { + return '#4dbd74'; + } + if (num > 20) { + return '#ffc107'; + } + return '#f86c6b'; +}; + +export function createTable() { + const records = generatePivotDataSource(19, 18); + const theme: VTable.TYPES.ITableThemeDefine = { + underlayBackgroundColor: '#F6F6F6', + defaultStyle: { + borderColor: '#000', + color: '#000', + bgColor: '#F6F6F6' + }, + headerStyle: { + bgColor: '#F5F6FA', + frameStyle: { + borderColor: '#00ffff', + borderLineWidth: 2 + } + }, + selectionStyle: { + cellBgColor: 'rgba(130,178,245, 0.2)', + cellBorderColor: '#003fff', + cellBorderLineWidth: 2 + }, + rowHeaderStyle: { + bgColor: '#F3F8FF', + frameStyle: { + borderColor: '#ff00ff', + borderLineWidth: 2 + } + }, + cornerHeaderStyle: { + bgColor: '#CCE0FF', + fontSize: 20, + fontFamily: 'sans-serif', + frameStyle: { + borderColor: '#00ff00', + borderLineWidth: 2 + } + }, + bodyStyle: { + hover: { + cellBgColor: '#CCE0FF', + inlineRowBgColor: '#F3F8FF', + inlineColumnBgColor: '#F3F8FF' + }, + frameStyle: { + borderColor: '#ffff00', + borderLineWidth: 5 + } + }, + frameStyle: { + borderColor: '#000', + borderLineWidth: 1, + borderLineDash: [] + }, + columnResize: { + lineWidth: 1, + lineColor: '#416EFF', + bgColor: '#D9E2FF', + width: 3 + }, + frozenColumnLine: { + shadow: { + width: 24, + startColor: 'rgba(00, 24, 47, 0.06)', + endColor: 'rgba(00, 24, 47, 0)' + } + } + // menuStyle: { + // color: '#000', + // highlightColor: '#2E68CF', + // font: '12px sans-serif', + // highlightFont: '12px sans-serif', + // hoverBgColor: '#EEE' + // } + }; + const option: VTable.PivotTableConstructorOptions = { + columnHeaderTitle: { + title: true, + headerStyle: { + textStick: true + } + }, + columns: [ + { + dimensionKey: '地区', + title: '地区', + headerFormat(value) { + return `${value}地区`; + }, + description(args) { + return args.value; + }, + cornerDescription: '地区维度', + headerStyle: { + textAlign: 'center', + borderColor: 'blue', + color: 'pink', + textStick: true, + bgColor(arg) { + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { + return '#bd422a'; + } + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { + return '#ff9900'; + } + return 'gray'; + } + }, + // 指标菜单 + dropDownMenu: ['升序排序I', '降序排序I', '冻结列I'], + // corner菜单 + cornerDropDownMenu: ['升序排序C', '降序排序C', '冻结列C'], + drillDown: true + }, + { + dimensionKey: '邮寄方式', + title: '邮寄方式11', + headerFormat(value) { + return `${value}邮寄方式`; + }, + headerStyle: { + textAlign: 'left', + borderColor: 'blue', + color: 'pink', + // lineHeight: '2em', + fontSize: 16, + fontStyle: 'bold', + fontFamily: 'sans-serif', + underline: true, + textStick: true, + bgColor(arg) { + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { + return '#bd422a'; + } + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { + return '#ff9900'; + } + return 'gray'; + } + }, + drillUp: false + } + ], + rows: [ + { + dimensionKey: '类别', + title: '类别', + drillUp: true, + width: 'auto', + headerStyle: { + textAlign: 'center', + borderColor: 'blue', + color: 'purple', + textBaseline: 'top', + textStick: true, + bgColor: '#6cd26f' + } + }, + { + dimensionKey: '子类别', + title: '子类别', + headerStyle: { + textAlign: 'center', + color: 'blue', + bgColor: '#45b89f' + }, + width: 'auto', + dropDownMenu: ['升序排序I', '降序排序I', '冻结列I'] + // headerType: 'MULTILINETEXT', + } + ], + indicators: [ + { + indicatorKey: '1', + title: '销售额', + // format(rec) { + // return `${rec.dataValue}%`; + // }, + headerStyle: { + color: 'red', + bgColor(arg) { + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { + return '#bd422a'; + } + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { + return '#ff9900'; + } + return 'gray'; + } + }, + // style: { + // barHeight: '100%', + // // barBgColor: '#aaa', + // // barColor: '#444', + // barBgColor: data => { + // return `rgb(${100 + 100 * (1 - (data.percentile ?? 0))},${100 + 100 * (1 - (data.percentile ?? 0))},${ + // 255 * (1 - (data.percentile ?? 0)) + // })`; + // }, + // barColor: 'transparent' + // }, + // cellType: 'progressbar', + showSort: true + // headerType: 'MULTILINETEXT', + }, + { + indicatorKey: '2', + title: '利润', + // format(rec) { + // // if (rec.rowDimensions[0].value === '东北') return `${rec.dataValue}%`; + // return rec.dataValue; + // }, + // cellType: 'progressbar', + // style: { + // barHeight: '50%', + // barBottom: 20, + // barColor: DEFAULT_BAR_COLOR + // }, + showSort: true, + dropDownMenu: ['利润升序排序I', '利润降序排序I', '利润冻结列I'] + } + ], + columnTree: [ + { + dimensionKey: '地区', + value: '东北', + children: [ + { + dimensionKey: '邮寄方式', + value: '一级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '二级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '三级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + } + ] + }, + { + dimensionKey: '地区', + value: '华北', + children: [ + { + dimensionKey: '邮寄方式', + value: '一级', + children: [ + { + indicatorKey: '1', + value: '销售额' + }, + { + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '二级', + children: [ + { + indicatorKey: '1', + value: '销售额' + }, + { + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '三级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + } + ] + }, + { + dimensionKey: '地区', + value: '中南', + children: [ + { + dimensionKey: '邮寄方式', + value: '一级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '二级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '三级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + } + ] + } + ], + rowTree: [ + { + dimensionKey: '类别', + value: '办公用品', + children: [ + { dimensionKey: '子类别', value: '电脑' }, + { dimensionKey: '子类别', value: '装订机' }, + { dimensionKey: '子类别', value: '签字笔' }, + { dimensionKey: '子类别', value: '标签' }, + { dimensionKey: '子类别', value: '收纳柜' }, + { dimensionKey: '子类别', value: '纸张' }, + { dimensionKey: '子类别', value: '电灯' } + ] + }, + { + dimensionKey: '类别', + value: '家具', + children: [ + { dimensionKey: '子类别', value: '衣柜' }, + { dimensionKey: '子类别', value: '沙发' }, + { dimensionKey: '子类别', value: '餐桌' }, + { dimensionKey: '子类别', value: '椅子' }, + { dimensionKey: '子类别', value: '桌子' } + ] + }, + { + dimensionKey: '类别', + value: '餐饮', + children: [ + { dimensionKey: '子类别', value: '锅具' }, + { + dimensionKey: '子类别', + value: '油盐酱醋' + }, + { dimensionKey: '子类别', value: '米面' } + ] + }, + { + dimensionKey: '类别', + value: '技术', + children: [ + { dimensionKey: '子类别', value: '设备' }, + { dimensionKey: '子类别', value: '配件' }, + { dimensionKey: '子类别', value: '电话' }, + { dimensionKey: '子类别', value: '复印机' } + ] + } + ], + corner: { + titleOnDimension: 'column', + headerStyle: { + textAlign: 'center', + borderColor: 'red', + color: 'yellow', + underline: true, + fontSize: 16, + fontStyle: 'bold', + fontFamily: 'sans-serif' + // lineHeight: '20px' + } + }, + indicatorTitle: '指标名称', + // indicatorsAsCol: false, + container: document.getElementById(CONTAINER_ID), + records, + theme, + showFrozenIcon: false, //显示VTable内置冻结列图标 + allowFrozenColCount: 2, + widthMode: 'autoWidth', // 宽度模式:standard 标准模式; adaptive 自动填满容器 + defaultRowHeight: 80, + columnResizeType: 'indicator', // 'column' | 'indicator' | 'all' + tooltip: { + isShowOverflowTextTooltip: true + } + }; + + const instance = new PivotTable(option); + window.tableInstance = instance; + + const search = new SearchComponent({ + table: instance, + autoJump: true + }); + window.search = search; + + const { PIVOT_SORT_CLICK } = VTable.PivotTable.EVENT_TYPE; + instance.on(PIVOT_SORT_CLICK, e => { + const order = e.order === 'asc' ? 'desc' : e.order === 'desc' ? 'normal' : 'asc'; + instance.updatePivotSortState([{ dimensions: e.dimensionInfo, order }]); + }); + + // bindDebugTool(instance.scenegraph.stage as any, { + // customGrapicKeys: ['role', '_updateTag'] + // }); + + // 只为了方便控制太调试用,不要拷贝 + window.tableInstance = instance; +} diff --git a/packages/vtable-plugins/demo/style.css b/packages/vtable-plugins/demo/style.css new file mode 100644 index 000000000..1ac1b4833 --- /dev/null +++ b/packages/vtable-plugins/demo/style.css @@ -0,0 +1,100 @@ +body { + margin: 0; + + --primary-color: #1890ff; + --primary-color-hover: #40a9ff; + --primary-color-active: #096dd9; + --primary-color-outline: rgba(24, 144, 255, 0.2); + --primary-1: #e6f7ff; + --primary-2: #bae7ff; + --primary-3: #91d5ff; + --primary-4: #69c0ff; + --primary-5: #40a9ff; + --primary-6: #1890ff; + --primary-7: #096dd9; +} +body p { + margin: 0; +} +.container { + font-family: Avenir, Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + /* text-align: center; */ + color: #2c3e50; + display: flex; + height: 100vh; +} + +.container .sidebar { + width: 200px; + /* height: 100%; */ + /* border-right: 1px solid rgba(0, 0, 0, 0.06); */ +} + +.container .sidebar > div { + height: 100%; +} + +.container .sidebar .sidebar-title { + font-weight: 700; + line-height: 5em; +} + +.container .sidebar .menu-list { + height: calc(100% - 5em); + overflow-y: scroll; +} + +.container .sidebar .menu-item { + line-height: 3em; + text-align: left; + padding: 0 1em; + cursor: pointer; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.container .sidebar .menu-item.menu-title { + line-height: 1.4em; + margin-left: -0.5em; + color: #999; + cursor: default; +} + +.container .sidebar .menu-item.menu-item-active { + background-color: var(--primary-1); + color: var(--primary-color); + font-weight: 700; +} + +.container .content { + flex: 1; + /* margin: 0 1em; */ + /* height: 100%; */ + min-width: 500px; +} + +#header { + height: 40px; + line-height: 40px; + border-bottom: 1px solid #d7d7d7; + margin-bottom: 20px; +} + +#chartContainer { + /* height: 500px; */ + height: calc(100% - 2em); + width: 100%; + /* margin: 1em 0em; */ +} + +pre { + border: 1px solid var(--primary-3); + padding: 1em; +} + +.language-ts { + color: var(--primary-6); +} diff --git a/packages/vtable-plugins/demo/vite.config.js b/packages/vtable-plugins/demo/vite.config.js new file mode 100644 index 000000000..0dd0c01ed --- /dev/null +++ b/packages/vtable-plugins/demo/vite.config.js @@ -0,0 +1,37 @@ +const { plugin: mdPlugin, Mode } = require('vite-plugin-markdown'); +const react = require('@vitejs/plugin-react'); +const path = require('path'); +module.exports = { + server: { + host: '0.0.0.0', + port: 3013, + https: !!process.env.HTTPS + }, + define: { + __DEV__: true, + __VERSION__: JSON.stringify(require('../package.json').version) + }, + resolve: { + alias: { + '@visactor/vtable/es/': path.resolve(__dirname, '../../vtable/src/es/'), + '@visactor/vtable': path.resolve(__dirname, '../../vtable/src/index.ts'), + '@vutils-extension': path.resolve(__dirname, '../../vtable/src/vutil-extension-temp') + } + }, + plugins: [ + mdPlugin({ mode: [Mode.HTML, Mode.MARKDOWN, Mode.TOC, Mode.REACT] }), + react({ + babel: { + plugins: [ + [ + '@babel/plugin-transform-react-jsx', + { + pragma: 'jsx', + pragmaFrag: 'Fragment' + } + ] + ] + } + }) + ] +}; diff --git a/packages/vtable-plugins/package.json b/packages/vtable-plugins/package.json new file mode 100644 index 000000000..9037b0b22 --- /dev/null +++ b/packages/vtable-plugins/package.json @@ -0,0 +1,86 @@ +{ + "name": "@visactor/vtable-plugins", + "version": "1.11.1", + "description": "The search util of VTable", + "author": { + "name": "VisActor", + "url": "https://VisActor.io/" + }, + "license": "MIT", + "sideEffects": false, + "main": "cjs/index.js", + "module": "es/index.js", + "types": "es/index.d.ts", + "files": [ + "cjs", + "es", + "dist" + ], + "exports": { + ".": { + "require": "./cjs/index.js", + "import": "./es/index.js" + } + }, + "scripts": { + "start": "vite ./demo", + "build": "bundle --clean" + }, + "unpkg": "latest", + "unpkgFiles": [ + "dist/vtable-exporter.js" + ], + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@visactor/vtable": "workspace:*", + "@visactor/vutils": "~0.18.14" + }, + "devDependencies": { + "@visactor/vchart": "1.12.12", + "@internal/bundler": "workspace:*", + "@internal/eslint-config": "workspace:*", + "@internal/ts-config": "workspace:*", + "@rushstack/eslint-patch": "~1.1.4", + "react": "^18.0.0", + "react-dom": "^18.0.0", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", + "@vitejs/plugin-react": "3.1.0", + "eslint": "~8.18.0", + "vite": "3.2.6", + "typescript": "4.9.5", + "@babel/core": "7.20.12", + "@babel/preset-env": "7.20.2", + "@types/chai": "4.2.22", + "@types/jest": "^26.0.0", + "@types/mocha": "9.0.0", + "@types/node": "*", + "@types/offscreencanvas": "2019.6.4", + "chai": "4.3.4", + "jest": "^26.0.0", + "jest-electron": "^0.1.12", + "jest-transform-stub": "^2.0.0", + "magic-string": "^0.25.7", + "mocha": "9.1.3", + "postcss": "8.4.21", + "rimraf": "3.0.2", + "sass": "1.43.5", + "ts-jest": "^26.0.0", + "ts-loader": "9.2.6", + "ts-node": "10.9.0", + "tslib": "2.3.1", + "ttypescript": "1.5.13", + "typescript-transform-paths": "3.3.1", + "json-formatter-js": "^2.3.4", + "inversify": "6.0.1", + "vite-plugin-markdown": "^2.1.0", + "markdown-it": "^13.0.0", + "node-fetch": "2.6.7", + "form-data": "~4.0.0", + "axios": "^1.4.0", + "@types/react-is": "^17.0.3", + "rollup-plugin-node-resolve": "5.2.0" + } +} \ No newline at end of file diff --git a/packages/vtable-plugins/setup-mock.js b/packages/vtable-plugins/setup-mock.js new file mode 100644 index 000000000..b0df380be --- /dev/null +++ b/packages/vtable-plugins/setup-mock.js @@ -0,0 +1,2 @@ +global.__DEV__ = true; +global.__VERSION__ = true; diff --git a/packages/vtable/src/plugins/carousel-animation.ts b/packages/vtable-plugins/src/carousel-animation.ts similarity index 97% rename from packages/vtable/src/plugins/carousel-animation.ts rename to packages/vtable-plugins/src/carousel-animation.ts index 14bd94d93..2fb4bc5a4 100644 --- a/packages/vtable/src/plugins/carousel-animation.ts +++ b/packages/vtable-plugins/src/carousel-animation.ts @@ -1,5 +1,5 @@ -import type { EasingType } from '@src/vrender'; -import type { BaseTableAPI } from '../ts-types/base-table'; +import type { EasingType } from '@visactor/vtable/es/vrender'; +import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; export interface ICarouselAnimationPluginOptions { rowCount?: number; diff --git a/packages/vtable/src/plugins/custom-cell-style.ts b/packages/vtable-plugins/src/custom-cell-style.ts similarity index 93% rename from packages/vtable/src/plugins/custom-cell-style.ts rename to packages/vtable-plugins/src/custom-cell-style.ts index 2deee186e..94050cd53 100644 --- a/packages/vtable/src/plugins/custom-cell-style.ts +++ b/packages/vtable-plugins/src/custom-cell-style.ts @@ -1,13 +1,14 @@ import { merge } from '@visactor/vutils'; -import type { Style } from '../body-helper/style'; import type { CellRange, ColumnStyleOption, CustomCellStyle, CustomCellStyleArrangement, FullExtendStyle -} from '../ts-types'; -import type { BaseTableAPI } from '../ts-types/base-table'; +} from '@visactor/vtable/es/ts-types'; +import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; +import type { Style } from '@visactor/vtable/src/body-helper/style'; +import { Factory } from '@visactor/vtable/src/core/factory'; export class CustomCellStylePlugin { table: BaseTableAPI; @@ -200,3 +201,9 @@ export function mergeStyle(cacheStyle: Style, customCellStyle: ColumnStyleOption return cacheStyle; } + +export const registerCustomCellStylePlugin = () => { + Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin); +}; + +export type ICustomCellStylePlugin = typeof CustomCellStylePlugin; diff --git a/packages/vtable/src/plugins/header-highlight.ts b/packages/vtable-plugins/src/header-highlight.ts similarity index 97% rename from packages/vtable/src/plugins/header-highlight.ts rename to packages/vtable-plugins/src/header-highlight.ts index a3603301b..ba2c3eb20 100644 --- a/packages/vtable/src/plugins/header-highlight.ts +++ b/packages/vtable-plugins/src/header-highlight.ts @@ -1,5 +1,5 @@ -import type { CellRange } from '../ts-types'; -import type { BaseTableAPI } from '../ts-types/base-table'; +import type { CellRange } from '@visactor/vtable/es/ts-types'; +import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; export interface IHeaderHighlightPluginOptions { rowHighlight?: boolean; diff --git a/packages/vtable-plugins/src/index.ts b/packages/vtable-plugins/src/index.ts new file mode 100644 index 000000000..fcc0da94c --- /dev/null +++ b/packages/vtable-plugins/src/index.ts @@ -0,0 +1,5 @@ +export * from './carousel-animation'; +export * from './invert-highlight'; +export * from './list-tree-stick-cell'; +export * from './custom-cell-style'; +export * from './header-highlight'; diff --git a/packages/vtable/src/plugins/invert-highlight.ts b/packages/vtable-plugins/src/invert-highlight.ts similarity index 88% rename from packages/vtable/src/plugins/invert-highlight.ts rename to packages/vtable-plugins/src/invert-highlight.ts index 2dcabf4b2..cbc7b9a25 100644 --- a/packages/vtable/src/plugins/invert-highlight.ts +++ b/packages/vtable-plugins/src/invert-highlight.ts @@ -1,10 +1,10 @@ -import type { Rect } from '@src/vrender'; -import { createRect } from '@src/vrender'; -import type { Group } from '../scenegraph/graphic/group'; -import { isSameRange } from '../tools/cell-range'; -import type { CellRange } from '../ts-types'; -import type { BaseTableAPI } from '../ts-types/base-table'; -import { cellInRange } from '../tools/helper'; +import type { Rect } from '@visactor/vtable/es/vrender'; +import { createRect } from '@visactor/vtable/es/vrender'; +import type { Group } from '@visactor/vtable/es/scenegraph/graphic/group'; +import { isSameRange } from '@visactor/vtable/es/tools/cell-range'; +import type { CellRange } from '@visactor/vtable/es/ts-types'; +import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; +import { cellInRange } from '@visactor/vtable/es/tools/helper'; import { isValid } from '@visactor/vutils'; export interface InvertHighlightPluginOptions { diff --git a/packages/vtable/src/plugins/list-tree-stick-cell.ts b/packages/vtable-plugins/src/list-tree-stick-cell.ts similarity index 95% rename from packages/vtable/src/plugins/list-tree-stick-cell.ts rename to packages/vtable-plugins/src/list-tree-stick-cell.ts index 367ee8f64..7bb935437 100644 --- a/packages/vtable/src/plugins/list-tree-stick-cell.ts +++ b/packages/vtable-plugins/src/list-tree-stick-cell.ts @@ -1,10 +1,10 @@ import { isArray, isValid } from '@visactor/vutils'; -import type { ListTable } from '../ListTable'; -import { Factory } from '../core/factory'; -import { Group } from '../scenegraph/graphic/group'; -import { createRect, type Graphic } from '../vrender'; -import { updateCell } from '../scenegraph/group-creater/cell-helper'; -import { getTargetCell } from '../event/util'; +import type { ListTable } from '@visactor/vtable/es/ListTable'; +import { Factory } from '@visactor/vtable/es/core/factory'; +import { Group } from '@visactor/vtable/es/scenegraph/graphic/group'; +import { createRect, type Graphic } from '@visactor/vtable/es/vrender'; +import { updateCell } from '@visactor/vtable/es/scenegraph/group-creater/cell-helper'; +import { getTargetCell } from '@visactor/vtable/es/event/util'; export class ListTreeStickCellPlugin { table: ListTable; diff --git a/packages/vtable-plugins/tscofig.eslint.json b/packages/vtable-plugins/tscofig.eslint.json new file mode 100644 index 000000000..22e7ab7f7 --- /dev/null +++ b/packages/vtable-plugins/tscofig.eslint.json @@ -0,0 +1,25 @@ +{ + "extends": "@internal/ts-config/tsconfig.base.json", + "compilerOptions": { + "types": [ + "jest", + "offscreencanvas", + "node" + ], + "lib": [ + "DOM", + "ESNext" + ], + "baseUrl": "./", + "rootDir": "./", + "paths": { + "@visactor/vtable/es": [ + "../vtable/src" + ] + } + }, + "include": [ + "src", + "demo" + ] +} \ No newline at end of file diff --git a/packages/vtable-plugins/tsconfig.json b/packages/vtable-plugins/tsconfig.json new file mode 100644 index 000000000..75891b766 --- /dev/null +++ b/packages/vtable-plugins/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "@internal/ts-config/tsconfig.base.json", + "compilerOptions": { + "jsx": "react", + "types": ["jest", "offscreencanvas", "node"], + "lib": ["DOM", "ESNext"], + "baseUrl": "./", + "rootDir": "./src", + "paths": { + } + }, + "ts-node": { + "transpileOnly": true, + "compilerOptions": { + "module": "commonjs" + } + }, + "references": [ + { + "path": "../vtable" + } + ], + "include": ["src"] +} \ No newline at end of file diff --git a/packages/vtable-search/README.md b/packages/vtable-search/README.md index 456ef1467..6d9bc9d6d 100644 --- a/packages/vtable-search/README.md +++ b/packages/vtable-search/README.md @@ -5,7 +5,7 @@
-

VTable-Export

+

VTable-Search

diff --git a/packages/vtable/examples/vite.config.js b/packages/vtable/examples/vite.config.js index 76ef2e26b..18c0355e6 100644 --- a/packages/vtable/examples/vite.config.js +++ b/packages/vtable/examples/vite.config.js @@ -14,6 +14,7 @@ module.exports = { resolve: { alias: { '@visactor/vtable-editors': path.resolve(__dirname, '../../vtable-editors/src/index.ts'), + '@visactor/vtable-plugins': path.resolve(__dirname, '../../vtable-plugins/src/index.ts'), '@src': path.resolve(__dirname, '../src/'), '@vutils-extension': path.resolve(__dirname, '../src/vutil-extension-temp') } diff --git a/packages/vtable/jest.config.js b/packages/vtable/jest.config.js index 448cd9c44..adea01032 100644 --- a/packages/vtable/jest.config.js +++ b/packages/vtable/jest.config.js @@ -47,8 +47,12 @@ module.exports = { 'd3-dsv': path.resolve(__dirname, './node_modules/d3-dsv/dist/d3-dsv.min.js'), 'd3-hexbin': path.resolve(__dirname, './node_modules/d3-hexbin/build/d3-hexbin.min.js'), 'd3-hierarchy': path.resolve(__dirname, './node_modules/d3-hierarchy/dist/d3-hierarchy.min.js'), - '@visactor/vtable-editors': path.resolve(__dirname, '../vtable-editors/src/index.ts'), + // '@visactor/vtable-editors': path.resolve(__dirname, '../vtable-editors/src/index.ts'), + // '@visactor/vtable-plugins': path.resolve(__dirname, '../vtable-plugins/src/index.ts'), + '@visactor/vtable-editors': '/../vtable-editors/src/index.ts', + '@visactor/vtable-plugins': '/../vtable-plugins/src/index.ts', '@src/vrender': path.resolve(__dirname, './src/vrender.ts'), + '@visactor/vtable/es/(.*)': '/src/$1', '@vutils-extension': path.resolve(__dirname, './src/vutil-extension-temp/index.ts') }, setupFiles: ['./setup-mock.js'] diff --git a/packages/vtable/package.json b/packages/vtable/package.json index 38b01e1f4..f8cbbb09a 100644 --- a/packages/vtable/package.json +++ b/packages/vtable/package.json @@ -52,6 +52,7 @@ }, "dependencies": { "@visactor/vtable-editors": "workspace:*", + "@visactor/vtable-plugins": "workspace:*", "@visactor/vrender-core": "0.21.0-alpha.4", "@visactor/vrender-kits": "0.21.0-alpha.4", "@visactor/vrender-components": "0.21.0-alpha.4", @@ -127,4 +128,4 @@ "url": "https://github.com/VisActor/VTable.git", "directory": "packages/vtable" } -} +} \ No newline at end of file diff --git a/packages/vtable/src/ListTable-all.ts b/packages/vtable/src/ListTable-all.ts index 12cea5d4f..6de5e57f2 100644 --- a/packages/vtable/src/ListTable-all.ts +++ b/packages/vtable/src/ListTable-all.ts @@ -7,7 +7,7 @@ import { registerTitle, registerTooltip } from './components'; -import { registerListTreeStickCellPlugin } from './plugins/list-tree-stick-cell'; +import { registerListTreeStickCellPlugin, registerCustomCellStylePlugin } from '@visactor/vtable-plugins'; import { registerChartCell, registerCheckboxCell, @@ -26,6 +26,7 @@ registerMenu(); registerTitle(); registerTooltip(); registerListTreeStickCellPlugin(); +registerCustomCellStylePlugin(); registerChartCell(); registerCheckboxCell(); diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts index 851f3cd46..b13623737 100644 --- a/packages/vtable/src/ListTable.ts +++ b/packages/vtable/src/ListTable.ts @@ -53,7 +53,7 @@ import { listTableUpdateRecords, sortRecords } from './core/record-helper'; -import type { IListTreeStickCellPlugin, ListTreeStickCellPlugin } from './plugins/list-tree-stick-cell'; +import type { IListTreeStickCellPlugin, ListTreeStickCellPlugin } from '@visactor/vtable-plugins'; // import { // registerAxis, // registerEmptyTip, diff --git a/packages/vtable/src/core/BaseTable.ts b/packages/vtable/src/core/BaseTable.ts index f719dd83a..1ca76e747 100644 --- a/packages/vtable/src/core/BaseTable.ts +++ b/packages/vtable/src/core/BaseTable.ts @@ -126,7 +126,8 @@ import { NumberRangeMap } from '../layout/row-height-map'; import { ListTable } from '../ListTable'; import type { SimpleHeaderLayoutMap } from '../layout'; import { RowSeriesNumberHelper } from './row-series-number-helper'; -import { CustomCellStylePlugin, mergeStyle } from '../plugins/custom-cell-style'; +import type { ICustomCellStylePlugin } from '@visactor/vtable-plugins'; +import { mergeStyle } from '@visactor/vtable-plugins'; import { hideCellSelectBorder, restoreCellSelectBorder } from '../scenegraph/select/update-select-border'; import type { ITextGraphicAttribute } from '@src/vrender'; import { ReactCustomLayout } from '../components/react/react-custom-layout'; @@ -218,7 +219,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { isReleased: boolean = false; _chartEventMap: Record = {}; - customCellStylePlugin: CustomCellStylePlugin; + customCellStylePlugin?: ICustomCellStylePlugin; columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body'; @@ -499,11 +500,14 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { internalProps.customMergeCell = options.customMergeCell; - this.customCellStylePlugin = new CustomCellStylePlugin( - this, - options.customCellStyle ?? [], - options.customCellStyleArrangement ?? [] - ); + const CustomCellStylePlugin = Factory.getComponent('customCellStylePlugin') as ICustomCellStylePlugin; + if (CustomCellStylePlugin) { + this.customCellStylePlugin = new CustomCellStylePlugin( + this, + options.customCellStyle ?? [], + options.customCellStyleArrangement ?? [] + ); + } } /** 节流绘制 */ throttleInvalidate = throttle2(this.render.bind(this), 200); @@ -2412,7 +2416,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { internalProps.customMergeCell = options.customMergeCell; - this.customCellStylePlugin.updateCustomCell( + this.customCellStylePlugin?.updateCustomCell( options.customCellStyle ?? [], options.customCellStyleArrangement ?? [] ); @@ -4110,14 +4114,14 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { // } hasCustomCellStyle(customStyleId: string): boolean { - return this.customCellStylePlugin.hasCustomCellStyle(customStyleId); + return this.customCellStylePlugin?.hasCustomCellStyle(customStyleId); } registerCustomCellStyle(customStyleId: string, customStyle: ColumnStyleOption | undefined | null) { - this.customCellStylePlugin.registerCustomCellStyle(customStyleId, customStyle); + this.customCellStylePlugin?.registerCustomCellStyle(customStyleId, customStyle); } arrangeCustomCellStyle(cellPos: { col?: number; row?: number; range?: CellRange }, customStyleId: string) { - this.customCellStylePlugin.arrangeCustomCellStyle(cellPos, customStyleId); + this.customCellStylePlugin?.arrangeCustomCellStyle(cellPos, customStyleId); } isSeriesNumber(col: number, row: number): boolean { return this.internalProps.layoutMap.isSeriesNumber(col, row); diff --git a/packages/vtable/src/core/style-helper.ts b/packages/vtable/src/core/style-helper.ts index 5fab420ea..f738c00f1 100644 --- a/packages/vtable/src/core/style-helper.ts +++ b/packages/vtable/src/core/style-helper.ts @@ -1,4 +1,4 @@ -import { mergeStyle } from '../plugins/custom-cell-style'; +import { mergeStyle } from '@visactor/vtable-plugins'; import type { PivotHeaderLayoutMap } from '../layout/pivot-header-layout'; import { isLeftOrRightAxis, isTopOrBottomAxis } from '../layout/chart-helper/get-axis-config'; import { isFunction } from '@visactor/vutils'; @@ -16,7 +16,7 @@ const EMPTY_STYLE = {}; * @returns */ export function getCellStyle(col: number, row: number, table: BaseTableAPI): FullExtendStyle { - const customCellStyle = table.customCellStylePlugin.getCustomCellStyle(col, row); + const customCellStyle = table.customCellStylePlugin?.getCustomCellStyle(col, row); const { layoutMap } = table.internalProps; const isHeader = layoutMap.isHeader(col, row); if (isHeader) { diff --git a/packages/vtable/src/index.ts b/packages/vtable/src/index.ts index 7c0b9bb25..5df5ae0d0 100644 --- a/packages/vtable/src/index.ts +++ b/packages/vtable/src/index.ts @@ -131,6 +131,17 @@ export { TABLE_EVENT_TYPE } from './core/TABLE_EVENT_TYPE'; export { PIVOT_CHART_EVENT_TYPE, PIVOT_TABLE_EVENT_TYPE } from './ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE'; export { EventTarget } from './event/EventTarget'; -export * from './plugins/invert-highlight'; -export * from './plugins/carousel-animation'; -export * from './plugins/header-highlight'; + +export type { + ICarouselAnimationPluginOptions, + IHeaderHighlightPluginOptions, + InvertHighlightPluginOptions +} from '@visactor/vtable-plugins'; + +export { + CarouselAnimationPlugin, + HeaderHighlightPlugin, + InvertHighlightPlugin, + registerListTreeStickCellPlugin, + registerCustomCellStylePlugin +} from '@visactor/vtable-plugins'; diff --git a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts index 5bdf39a01..10f5e8775 100644 --- a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts +++ b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts @@ -36,7 +36,7 @@ import { updateCellContentHeight, updateCellContentWidth } from '../utils/text-i import { isArray, isValid } from '@visactor/vutils'; import { breakString } from '../utils/break-string'; import type { CreateRadioCellGroup } from './cell-type/radio-cell'; -import { onBeforeAttributeUpdateForInvertHighlight } from '../../plugins/invert-highlight'; +import { onBeforeAttributeUpdateForInvertHighlight } from '@visactor/vtable-plugins'; export function createCell( type: ColumnTypeOption, diff --git a/packages/vtable/src/ts-types/base-table.ts b/packages/vtable/src/ts-types/base-table.ts index 7d49daa2c..b7bf04d07 100644 --- a/packages/vtable/src/ts-types/base-table.ts +++ b/packages/vtable/src/ts-types/base-table.ts @@ -100,7 +100,7 @@ import type { ISortedMapItem } from '../data/DataSource'; import type { IAnimationAppear } from './animation/appear'; import type { IEmptyTip } from './component/empty-tip'; import type { EmptyTip } from '../components/empty-tip/empty-tip'; -import type { CustomCellStylePlugin } from '../plugins/custom-cell-style'; +import type { ICustomCellStylePlugin } from '@visactor/vtable-plugins'; import type { EditManeger } from '../edit/edit-manager'; import type { ITableAnimationOption, TableAnimationManager } from '../core/animation'; @@ -924,7 +924,7 @@ export interface BaseTableAPI { /** 开启表格的滚动 */ enableScroll: () => void; - customCellStylePlugin: CustomCellStylePlugin; + customCellStylePlugin: ICustomCellStylePlugin; headerStyleCache: Map; bodyBottomStyleCache: Map; bodyStyleCache: Map; diff --git a/packages/vtable/tsconfig.eslint.json b/packages/vtable/tsconfig.eslint.json index 2017a9210..cbfa15726 100644 --- a/packages/vtable/tsconfig.eslint.json +++ b/packages/vtable/tsconfig.eslint.json @@ -8,6 +8,9 @@ "paths": { "@visactor/vtable-editors": [ "../vtable-editors/src" + ], + "@visactor/vtable-plugins": [ + "../vtable-plugins/src" ] } }, diff --git a/rush.json b/rush.json index 6516738f5..20ae89162 100644 --- a/rush.json +++ b/rush.json @@ -137,6 +137,15 @@ "shouldPublish": true, "versionPolicyName": "vtableMain" }, + { + "packageName": "@visactor/vtable-plugins", + "projectFolder": "packages/vtable-plugins", + "tags": [ + "package" + ], + "shouldPublish": true, + "versionPolicyName": "vtableMain" + }, { "packageName": "@internal/bugserver-trigger", "projectFolder": "tools/bugserver-trigger", From 41bc0a487a75ca2d2a4ce25d202a128bbe61893b Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 11:38:27 +0800 Subject: [PATCH 02/24] fix: fix src package name of vtable --- packages/react-vtable/demo/vite.config.ts | 2 ++ packages/react-vtable/src/components/radio/radio.tsx | 2 +- packages/react-vtable/src/table-components/component/menu.tsx | 2 +- packages/vtable-calendar/src/event/type.ts | 2 +- packages/vtable-calendar/src/month-calendar.ts | 2 +- packages/vtable-export/src/excel/index.ts | 2 +- packages/vtable-plugins/src/custom-cell-style.ts | 4 ++-- packages/vtable/examples/vite.config.js | 3 ++- 8 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/react-vtable/demo/vite.config.ts b/packages/react-vtable/demo/vite.config.ts index e69f89ea4..602881721 100644 --- a/packages/react-vtable/demo/vite.config.ts +++ b/packages/react-vtable/demo/vite.config.ts @@ -26,7 +26,9 @@ export default defineConfig({ resolve: { alias: { '@visactor/vtable/es/vrender': path.resolve(__dirname, '../../vtable/src/vrender.ts'), + '@visactor/vtable/es': path.resolve(__dirname, '../../vtable/src/'), '@visactor/vtable': path.resolve(__dirname, '../../vtable/src/index.ts'), + '@visactor/vtable-plugins': path.resolve(__dirname, '../../vtable-plugins/src/index.ts'), '@src': path.resolve(__dirname, '../../vtable/src/'), '@vutils-extension': path.resolve(__dirname, '../../vtable/src/vutil-extension-temp') // ...localConf.resolve?.alias diff --git a/packages/react-vtable/src/components/radio/radio.tsx b/packages/react-vtable/src/components/radio/radio.tsx index f6c72286b..ddc53666c 100644 --- a/packages/react-vtable/src/components/radio/radio.tsx +++ b/packages/react-vtable/src/components/radio/radio.tsx @@ -39,7 +39,7 @@ function RadioComponent(baseProps: RadioProps, ref: React.Ref) { useEffect(() => { radioRef.current.addEventListener('radio_checked', handleChange); return () => { - radioRef.current.removeEventListener('radio_checked', handleChange); + radioRef.current?.removeEventListener('radio_checked', handleChange); }; }, []); diff --git a/packages/react-vtable/src/table-components/component/menu.tsx b/packages/react-vtable/src/table-components/component/menu.tsx index af27cad71..99a2fd8f8 100644 --- a/packages/react-vtable/src/table-components/component/menu.tsx +++ b/packages/react-vtable/src/table-components/component/menu.tsx @@ -1,4 +1,4 @@ -import type { BaseTable } from '@visactor/vtable/src/core'; +import type { BaseTable } from '@visactor/vtable/es/core'; import type { BaseComponentProps } from '../base-component'; import { createComponent } from '../base-component'; import type { TYPES } from '@visactor/vtable'; diff --git a/packages/vtable-calendar/src/event/type.ts b/packages/vtable-calendar/src/event/type.ts index b6c4609e3..f070a68c1 100644 --- a/packages/vtable-calendar/src/event/type.ts +++ b/packages/vtable-calendar/src/event/type.ts @@ -1,6 +1,6 @@ import type { MousePointerCellEvent } from '@visactor/vtable'; import type { IEventData } from '../custom/custom-handler'; -import type { SelectedCellEvent } from '@visactor/vtable/src/ts-types'; +import type { SelectedCellEvent } from '@visactor/vtable/es/ts-types'; export interface CalendarEvents { /** diff --git a/packages/vtable-calendar/src/month-calendar.ts b/packages/vtable-calendar/src/month-calendar.ts index 4a034c9b3..23c7b3d1c 100644 --- a/packages/vtable-calendar/src/month-calendar.ts +++ b/packages/vtable-calendar/src/month-calendar.ts @@ -14,7 +14,7 @@ import type { CalendarEventListener } from './event/type'; import { CALENDAR_EVENT_TYPE } from './event/type'; -import type { EventListenerId } from '@visactor/vtable/src/ts-types'; +import type { EventListenerId } from '@visactor/vtable/es/ts-types'; import { isArray } from '@visactor/vutils'; export interface CalendarConstructorOptions { diff --git a/packages/vtable-export/src/excel/index.ts b/packages/vtable-export/src/excel/index.ts index 3b4a58ee9..18fb76694 100644 --- a/packages/vtable-export/src/excel/index.ts +++ b/packages/vtable-export/src/excel/index.ts @@ -4,7 +4,7 @@ import type { CellType, IVTable } from '../util/type'; import { getCellAlignment, getCellBorder, getCellFill, getCellFont } from './style'; import { updateCell, renderChart, graphicUtil } from '@visactor/vtable'; import { isArray } from '@visactor/vutils'; -import type { ColumnDefine, IRowSeriesNumber } from '@visactor/vtable/src/ts-types'; +import type { ColumnDefine, IRowSeriesNumber } from '@visactor/vtable/es/ts-types'; import { getHierarchyOffset } from '../util/indent'; import { isPromise } from '../util/promise'; diff --git a/packages/vtable-plugins/src/custom-cell-style.ts b/packages/vtable-plugins/src/custom-cell-style.ts index 94050cd53..9c2f25fe0 100644 --- a/packages/vtable-plugins/src/custom-cell-style.ts +++ b/packages/vtable-plugins/src/custom-cell-style.ts @@ -7,8 +7,8 @@ import type { FullExtendStyle } from '@visactor/vtable/es/ts-types'; import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; -import type { Style } from '@visactor/vtable/src/body-helper/style'; -import { Factory } from '@visactor/vtable/src/core/factory'; +import type { Style } from '@visactor/vtable/es/body-helper/style'; +import { Factory } from '@visactor/vtable/es/core/factory'; export class CustomCellStylePlugin { table: BaseTableAPI; diff --git a/packages/vtable/examples/vite.config.js b/packages/vtable/examples/vite.config.js index 18c0355e6..46c0a3f27 100644 --- a/packages/vtable/examples/vite.config.js +++ b/packages/vtable/examples/vite.config.js @@ -16,7 +16,8 @@ module.exports = { '@visactor/vtable-editors': path.resolve(__dirname, '../../vtable-editors/src/index.ts'), '@visactor/vtable-plugins': path.resolve(__dirname, '../../vtable-plugins/src/index.ts'), '@src': path.resolve(__dirname, '../src/'), - '@vutils-extension': path.resolve(__dirname, '../src/vutil-extension-temp') + '@vutils-extension': path.resolve(__dirname, '../src/vutil-extension-temp'), + '@visactor/vtable/es': path.resolve(__dirname, '../src/') } }, plugins: [ From 74b4a3f98981102498882016a280b2f1e5636e34 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 17:24:24 +0800 Subject: [PATCH 03/24] docs: add contributing docs --- ...-Setting-Up-the-Development-Environment.md | 119 +++++++ .../en/2-Howto Submit an Issue.md | 59 ++++ .../en/3-How to Contribute Documentation.md | 258 +++++++++++++++ .../en/4-How to Contribute to a Demo.md | 246 +++++++++++++++ .../en/5-How to Contribute Code.md | 244 ++++++++++++++ docs/assets/contributing/menu.json | 40 +++ ...-Setting-Up-the-Development-Environment.md | 129 ++++++++ .../zh/2-Howto Submit an Issue.md | 69 ++++ .../zh/3-How to Contribute Documentation.md | 297 ++++++++++++++++++ .../zh/4-How to Contribute to a Demo.md | 256 +++++++++++++++ .../zh/5-How to Contribute Code.md | 270 ++++++++++++++++ docs/menu.json | 4 + docs/vite.config.js | 2 + 13 files changed, 1993 insertions(+) create mode 100644 docs/assets/contributing/en/1-Setting-Up-the-Development-Environment.md create mode 100644 docs/assets/contributing/en/2-Howto Submit an Issue.md create mode 100644 docs/assets/contributing/en/3-How to Contribute Documentation.md create mode 100644 docs/assets/contributing/en/4-How to Contribute to a Demo.md create mode 100644 docs/assets/contributing/en/5-How to Contribute Code.md create mode 100644 docs/assets/contributing/menu.json create mode 100644 docs/assets/contributing/zh/1-Setting-Up-the-Development-Environment.md create mode 100644 docs/assets/contributing/zh/2-Howto Submit an Issue.md create mode 100644 docs/assets/contributing/zh/3-How to Contribute Documentation.md create mode 100644 docs/assets/contributing/zh/4-How to Contribute to a Demo.md create mode 100644 docs/assets/contributing/zh/5-How to Contribute Code.md diff --git a/docs/assets/contributing/en/1-Setting-Up-the-Development-Environment.md b/docs/assets/contributing/en/1-Setting-Up-the-Development-Environment.md new file mode 100644 index 000000000..b05c184af --- /dev/null +++ b/docs/assets/contributing/en/1-Setting-Up-the-Development-Environment.md @@ -0,0 +1,119 @@ +--- +title: 1-Setting-Up-the-Development-Environment + +key words: VisActor, VChart, VTable, VStory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, GIS, LLM +--- +# Github + +## 1.1 Register an Account + +The VisActor team usually develops and maintains issues on GitHub. Please visit [GitHub](https://github.com/), click the `Sign up` button on the top right to register your account, and start your journey into open source. + +If you are unable to access GitHub due to certain restrictions, please let us know and use [Gitee](https://gitee.com/VisActor/VTable) for project development. + +## 1.2 Fork the Project + +First, you need to fork this project. Go to the [VTable project page](https://github.com/VisActor/VTable) and click the Fork button on the top right. + + + +The project will appear as xxxx (your GitHub username)/vtable in your GitHub account. + + + +# Local Development Environment + +## 2.1 Install Git + +Since the code is hosted on GitHub, we use git for version control. + +Git is a version control system that helps track and manage code changes in software development projects. It aids developers in recording and managing code history, making team collaboration, code version control, and code merging easier. With Git, you can track each version of every file, switching and comparing between different versions easily. Git also offers branch management features, enabling simultaneous multiple parallel development tasks. + +* Visit the Git official website: [https://git-scm.com/](https://git-scm.com/) + +* Download the latest version of the Git installer. + +* Run the downloaded installer and follow the prompts in the installation wizard. + +* After installation, you can verify the installation by using `git version` in the command line. + +``` +HM4G2J09L6:~ xuanhun$ git version +**git version 2.39.2 (Apple Git-143)** +``` + +## 2.2 Install a Development Tool (Recommended: VSCode) + +VisActor predominantly uses a frontend tech stack. There are many tools available for frontend development, but we recommend using VSCode. Of course, you can use any development tool you prefer. + +If you're not familiar with VSCode, it might be helpful to read the official documentation: https://vscode.js.cn/docs/setup/setup-overview + +## 2.3 Install Doubao Marscode AI Programming Assistant + + +[Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + + +Doubao MarsCode Programming Assistant is an AI coding assistant from Doubao that provides AI features represented by intelligent code completion. It supports mainstream programming languages and IDEs, offering suggestions for writing a single line of code or an entire function during development. In addition, it offers features like code explanation, unit test generation, and problem fixing, improving development efficiency and quality. For more information, please refer to the [Doubao MarsCode Programming Assistant documentation](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a). + + + +With Marscode, VisActor developers can more easily understand code, write documentation, develop features, and perform unit testing. Detailed examples will be provided in specific task contribution guides. + + + +## 2.4 Clone the Code to Local + +Enter the VTable folder and add the remote address for VTable. + +``` +git remote add upstream https://github.com/VisActor/VTable.git +``` + +Get the latest source code for VTable. + +``` +git pull upstream develop +``` + +# Initialize the Project + +First, globally install [@microsoft/rush](https://rushjs.io/pages/intro/get_started/) + +``` +$ npm i --global @microsoft/rush +``` + +Then, execute the command to view the demo + +``` +# Install dependencies +$ rush update +# Start the demo page for vtable +$ cd ./packages/vtable && rushx demo +# Start the demo page for react-vtable +$ cd ./packages/react-vtable && rushx start +# Start the local documentation site +$ rush docs +``` + +# Next Steps + +At this point, you have completed the preparations for developing the code. Please continue reading the next tutorial to begin working on different types of tasks. + +github: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor WeChat subscription message (you can join the WeChat group via the subscription menu): + + + +VisActor official website: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu group: + + + +discord: https://discord.com/invite/3wPyxVyH6m + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/en/2-Howto Submit an Issue.md b/docs/assets/contributing/en/2-Howto Submit an Issue.md new file mode 100644 index 000000000..073f6353c --- /dev/null +++ b/docs/assets/contributing/en/2-Howto Submit an Issue.md @@ -0,0 +1,59 @@ +--- +title: 2. How to Submit an Issue + +key words: VisActor, VChart, VTable, VStrory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, Gis, LLM +--- +In each project's issues section, you can create, search, and manage issues. + +For example, VTable issues: [https://github.com/VisActor/VTable/issues](https://github.com/VisActor/VTable/issues) + + + +# Check for Existing Issues + +You can determine if an issue already exists by using search filters and reviewing issue details. + +# Create a New Issue + +If no similar issue is found, you can click the "New issue" button. + + + +Select "**Documentation Request**", click the "Get Start" button, and fill out the issue form. + + + +# **Submit the Issue** + +Once the issue form is completed, click the "Submit new issue" button to submit your issue. + +# **Follow Up on the Issue** + +After submission, you can monitor the status of your issue in the repository's "Issues" tab. The project developers might ask for more information or inform you that they are addressing the issue. + +# **Close the Issue** + +If your problem has been resolved or your request has been fulfilled, the project developers will close the issue. You may also close the issue yourself if you believe it has been resolved or if further assistance is no longer needed. + +By following these steps, you can successfully submit an issue for an open-source project on GitHub. Remember to be as detailed and clear as possible when describing your issue, as this helps project developers understand and resolve your problem more quickly. + +# Next Steps + +By now, you should be familiar with the concept of issues. Please continue reading the next section of the tutorial to start on different types of tasks. + +GitHub: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor WeChat Subscription (You can join the WeChat group via the subscription menu): + + + +VisActor Official Website: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu Group: + + + +Discord: [https://discord.com/invite/3wPyxVyH6m](https://discord.com/invite/3wPyxVyH6m) + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/en/3-How to Contribute Documentation.md b/docs/assets/contributing/en/3-How to Contribute Documentation.md new file mode 100644 index 000000000..a4b1af0b6 --- /dev/null +++ b/docs/assets/contributing/en/3-How to Contribute Documentation.md @@ -0,0 +1,258 @@ +--- +title: 3-How to Contribute Documentation + +keywords: VisActor, VChart, VTable, VStory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, Gis, LLM +--- +# Create a Branch + +The default branch for VTable is the develop branch. Whether it is for feature development, bug fixes, or documentation writing, please create a new branch and then merge it into the develop branch. Use the following command to create a branch: + +```bash +// Create a documentation/demo branch +git checkout -b docs/add-funnel-demo +``` + +# Find or Create an Issue + +In principle, we require each PR to have a corresponding issue. Before starting development, please confirm whether there is a corresponding issue, and that the issue has not been claimed. + +## Search for Documentation Issues + +You can search for documentation-related issues using the following filter: + +``` +is:open label:docs +``` + + + +Some features may be associated with the doc label, so check if the issue is purely a documentation task. + +## Create a Documentation Issue + +Click "NEW ISSUE" to open the issue selection page, then select “**Documentation Request**.” + + + +Fill out the relevant information for the documentation issue you want to submit. + + + +# Claim an Issue + +If you want to write or edit documentation bugs, you can leave a comment on the issue to claim it. An administrator will contact you, and after confirmation, the issue will be assigned to you. + +For example: + + + +# Create or Modify Documentation + +The locations of VTable documentation and demos in the project are as follows: + + + +The current documentation types are as follows: + +* api: Interface documentation, corresponding site: https://www.visactor.io/vtable/api/API/vtable +* changelog: Log, corresponding site: https://www.visactor.io/vtable/changelog/release +* demos: Independent running demos for debugging purposes +* examples: Graph examples, corresponding sites: +https://www.visactor.io/vtable/example +https://www.visactor.io/vtable/example-react +https://www.visactor.io/vtable/example-openinula +https://www.visactor.io/vtable/example-vue +* faq: FAQs, corresponding site: https://www.visactor.io/vtable/faq/1-How%20to%20implement%20multi-level%20headers%20in%20a%20basic%20table +* guide: Tutorials, corresponding site: https://www.visactor.io/vtable/guide/Getting_Started/Getting_Started +* option: Specification descriptions, corresponding site: https://www.visactor.io/vtable/option/ListTable +* contributing: Community contributor documentation, corresponding site: https://www.visactor.io/vtable/guide/contributing_docs/Contribution_Guide + +Find the corresponding location to add or modify the document. Note that some documents need to maintain the “menu.json” file as well. + + + +This file corresponds to the final position and name of the document displayed on the site. For example: + + + +# Use Doubao Marscode AI Programming Assistant + +[Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + +Using Doubao [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) can provide comprehensive assistance throughout the entire process of document creation. + +If you haven't installed the [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a), please download it from the following link: https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + +In document writing, using context commands appropriately can improve content accuracy. + +`**⭐️ #Workspace**` + +Select the global code from Workspace as context, and the AI will automatically find related code context based on user queries. + + + +`**⭐️ #Files**` + +Search and select files from the code repository as context + + + +`**⭐️ #Code**` + +Search and select functions or classes from the code repository as context + + + +Below is an example of how to use the [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) for document writing. + +## 5.1 Provide Document Writing Ideas + +Here, **by invoking #Workspace** and then asking it to help generate an outline for a developer document. + + + +## 5.2 Generate Project Structure Description + +Here, **by invoking #Workspace** and then asking it to help generate a project structure description document. + + + +We can still ask further questions about subfolders. + + + +## 5.3 Generate File or Code Details + +### 5.3.1 Generate Code Explanation + +When we select a piece of code in a file, we can choose the Explain command from the floating menu, and [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will generate a detailed code explanation for us. We can use this as a basis for proofreading and adaptation. + + + +You can also directly input the Explain command in the dialogue box. + + + +Here you can also directly use the previously mentioned #Code context to combine Explain with your instructions for more detailed tasks. + +### 5.3.2 Generate Explanations for Entire Files + +Explain can be used in conjunction with Context or Files commands to generate explanations for entire files. + + + +## 5.4 Generate Sample Code + +To better explain principles and usage, it is often necessary to provide a demo that can be practically run. You can use [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a)'s code generation capabilities to generate sample code for us. However, currently the code generation capabilities of various AIs cannot guarantee accuracy and require further verification. + +## 5.5 Content Search + +For each Q&A, [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will usually provide reference documentation, which can offer more contextual references for further analysis. + + + +You can also directly perform file searches: + + + +## 5.6 Translate Documents + +VisActor's documentation needs to be provided in both Chinese and English, and Marscode can assist in translation. + +# Submit Code + +After completing the documentation, first push the code to your remote branch. For example: + +```bash +git commit -a -m "docs: add custom funnel demo and related docs" +``` + +VisActor follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for commit messages: + +`[optional scope]: ` + +Common `type`s include docs (documentation, log changes), feat (new features), fix (bug fixes), refactor (code refactoring), and others. Please choose according to the actual situation. + +Write the description in concise and accurate English. + +Before submitting a commit, we will conduct a commit lint check. You can view the [rules for checking](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js). + +A common issue is when the remote upstream (@visactor/vtable) has new updates, leading to conflicts when submitting a Pull Request. Therefore, before submission, we can merge other developers' remote commits into ours. Use the following command to switch to the develop branch: + +```bash +git checkout develop +``` + +Use the following command to pull the latest code from upstream: + +```bash +git pull upstream develop +``` + +Switch back to your development branch: + +```bash +git checkout docs/add-funnel-demo +``` + +Merge the develop branch's commits into your branch: + +```bash +git rebase develop +``` + +Push the updated code to your branch: + +```bash +git push origin docs/add-funnel-demo +``` + +# Submit a PR + +You can click the `Compare & pull request` button on your GitHub repository page. + + + +Or create it through the `contribute` button: + +Fill out the template with the changes submitted: + +* Check the type of modification + + + +* Fill in the associated issue + + + +* If there are complex changes, please explain the background and solution + + + +Once the relevant information is filled in, click Create pull request to submit. + +The administrator will review the PR to decide whether to approve it. If not approved, modifications are needed and it must be resubmitted. + +# Next Steps + +Among different documentation types, demo documents have some special requirements, which can be referenced in the "How to Contribute a Demo" section. + +You can then continue to attempt different types of tasks. + +GitHub: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +Leave a message on the VisActor WeChat public account (you can join the WeChat group through the public account menu): + + + +Official website of VisActor: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu group: + + + +Discord: https://discord.com/invite/3wPyxVyH6m +``` + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/en/4-How to Contribute to a Demo.md b/docs/assets/contributing/en/4-How to Contribute to a Demo.md new file mode 100644 index 000000000..a8b7c877f --- /dev/null +++ b/docs/assets/contributing/en/4-How to Contribute to a Demo.md @@ -0,0 +1,246 @@ +--- +title: 4. How to Contribute to a Demo + +key words: VisActor, VChart, VTable, VStory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, GIS, LLM +--- + +# Creating a Branch + +The default branch for VTable is the develop branch. Whether it's for feature development, bug fixes, or documentation writing, please create a new branch before merging it into the develop branch. Use the following code to create a branch: + +``` +// Create a documentation/demo branch +git checkout -b docs/add-funnel-demo + +``` + +# Finding or Creating an Issue + +In principle, we require that each PR must have a corresponding issue. Before starting development, please ensure there is a corresponding issue, and that the issue is not already claimed. + +## Searching for Demo Issues + +You can search for demo-related issues using the following method: + +``` + label:demos + +``` + + +Some features may have the doc label associated with them. Check further if the issue is purely a demo task. + +## Creating a Demo Issue + +Click "NEW ISSUE" to open the issue selection page and choose "**Others**." + + + +Fill in the information related to the document issue you want to submit, and tag it with "demos." + + + +# Claiming an Issue + +If you want to submit a demo or fix a demo bug, you can leave a message in the issue to claim it. The administrator will contact you, and after confirmation, assign the issue to you. + +For example: + + + +# Creating or Modifying a Demo + +The location of VTable documentation and demos within the project is as follows (examples): + + + +Taking the example document of a basic area chart as an example (currently, a single example contains both Chinese and English versions, located under the paths zh & en respectively): + + + +Example Markdown content is divided into several parts: + +* Metadata: Attribute definitions of the example content, including chart category, cover image, keywords, etc. + +* Title: The main content under the first-level title corresponds to the description information of the example. + +* Key Configuration: Explanation of the key configurations included in the example, which will be displayed in the "Key Configuration" section on the right side of the example page. + +* Code Demonstration: The specific code content executed in the example; currently only native JavaScript code is supported. + +The field definitions of Markdown metadata are: + +* group: The classification information of the example, describing which chart category the current example belongs to. + +* title: The example title + +* keywords: Keywords of the example + +* order: The order criterion of the example within the same group + +* cover: The cover image of the example + +* tutorial: The tutorial link to jump to (the default example tutorial will jump to the tutorial corresponding to the example group) + +Currently, chart examples in the group include multiple categories such as area chart, bar chart, combination, storytelling, etc., corresponding to all categories under the vtable example gallery. Refer to existing example documents for specific classification fields. + + + +# Writing Demos with the Help of Doubao Marscode AI Programming Assistant +[Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + +With the help of Doubao [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a), you can get comprehensive assistance throughout the document creation process. + +If you haven't installed the [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a), please download it from this link: https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + +During demo writing, using context instructions reasonably can improve content accuracy. + +`**⭐️ #Workspace**` + +Select global code in the Workspace as context; AI will automatically find related code Context according to user Query. + + + +`**⭐️ #Files**` + +Search and select files in the code repository as context + + + +`**⭐️ #Code**` + +Search and select functions or classes in the code repository as context + + + +Below is an example of how to use the [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) for demo writing. + +## 5.1 Providing a Document Framework + +Here **invoke #Workspace**, then ask a question, select a document content of an example and hope it generates a new example document in the same manner. + + + +We can continue to make adjustments on this basis. + +## 5.2 Generating Descriptive Text + +The description text for each demo can be initially generated using [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a), and then proofread and adjusted. For example: + + + +## 5.3 Generating Example Code + +To better explain principles and usage, it is usually necessary to provide a runnable demo. The code generation capability of [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) can be used to generate example code. However, the current code generation capabilities of various AIs cannot guarantee accuracy and require further verification. + +## 5.4 Content Retrieval + +Usually, in each Q&A, [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will provide reference documents, which can offer more contextual references for further analysis. + + + +You can also perform file retrieval directly: + + + +# Submitting Code + +After the document is completed, push the code to your remote branch, for example: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + +The commit message for VisActor follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) convention. **For demo, use docs** + +`[optional scope]: ` + +Common `type` includes docs (documentation/log modifications), feat (new feature), fix (bug fix), refactor (code restructuring), etc., please choose based on the actual situation. + +Please write the description in brief and precise English. + +Before submitting a commit, we perform a commit lint check, which you can check in the [check rules](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js). + +A common issue is that the remote upstream (@visactor/vtable) has new updates, which can lead to conflicts during the submission of a Pull Request. Thus, before submission, you can merge the commits from other developers remotely into your commit. Use the following code to switch to the develop branch: + +``` +git checkout develop + +``` + +Use the following code to pull the latest remote code: + +``` +git pull upstream develop + +``` + +Switch back to your development branch: + +``` +git checkout docs/add-funnel-demo + +``` + +Merge the develop commits into your branch: + +``` +git rebase develop + +``` + +Push the updated code to your branch: + +``` +git push origin docs/add-funnel-demo + +``` + +# Submitting a PR + +You can click the `Compare & pull request` button on your GitHub repository page. + + + +Or create via the `contribute` button: + +Fill in the modified content of this submission according to the template: + +* Check what type of modification this is + + + +* Fill in the associated issue + + + +* If there are complex changes, explain the background and solution + + + +After filling in the relevant information, click Create pull request to submit. + +The administrator will review the PR to decide whether to approve it; if not, modifications need to be made, and a resubmission is required. + +# Next Step + +Next, you can continue to explore different types of tasks. + +GitHub: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor WeChat subscription account message (you can join the WeChat group through the subscription account menu): + + + +VisActor Official Website: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu Group: + + + +Discord: https://discord.com/invite/3wPyxVyH6m + + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/en/5-How to Contribute Code.md b/docs/assets/contributing/en/5-How to Contribute Code.md new file mode 100644 index 000000000..edaf41203 --- /dev/null +++ b/docs/assets/contributing/en/5-How to Contribute Code.md @@ -0,0 +1,244 @@ +--- +title: 5. How to Contribute Code + +key words: VisActor, VChart, VTable, VStory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, GIS, LLM +--- +# Creating a Branch + +The default branch for VTable is the develop branch. For any feature development, bug fixes, or documentation writing, please create a new branch and then merge it into the develop branch. Use the following code to create a branch: + +``` +// Create a documentation, demo branch +git checkout -b docs/add-funnel-demo + +``` + +# Finding or Creating an Issue + +In principle, we require every PR to have a corresponding issue. Before starting development, please confirm whether there is a corresponding issue, and the issue has not been claimed. + +## Search for Issues + +You can search for bug or feature-related issues in the following way: + + + +## Create Code-Related Issues + +Click "NEW ISSUE" to open the issue selection page, and choose "**Bug Report" or "Feature Request".** + + + +Fill in the relevant information for the document issue you want to submit and apply the appropriate tags. + + + +# Claiming an Issue + +If you want to contribute code, you can leave a message to claim the issue. An administrator will contact you and, upon confirmation, assign the issue to you. + +For example: + + + +# Writing Code + +The source code for VTable is located in the following way within the project: + + + +All the components of the VTable ecosystem are in the same directory, split by package name. Developers need to develop code in their own code branch and then submit it. + +# Writing Code with Marscode AI Programming Assistant + +With the help of the Marscode AI Programming Assistant, comprehensive assistance can be provided throughout the coding process. + +If you have not installed the Marscode AI Programming Assistant, please download it from this link: https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + +When writing code, using context commands appropriately can improve the accuracy of content. + +`**⭐️ #Workspace**` + +Select global code from Workspace as context, and AI will automatically find relevant code context based on the user's Query. + + + +`**⭐️ #Files**` + +Search and select files in the code repository as context. + + + +`**⭐️ #Code**` + +Search and select functions and classes in the code repository as context. + + + +Below is an example of how to use the Marscode AI Programming Assistant for coding. + +## 5.1 Quickly Familiarize with the Entire Repository + +Here, use ** # to summon #Workspace ** and then ask it to help generate a project structure description document. + + + +We can still ask further questions about subfolders. + + + +## 5.2 Explaining Code + +### 5.2.1 Generate Code Descriptions + +When we select a piece of code in a file, we can choose the Explain command from the floating menu, and [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will generate a detailed code explanation for us, which we can proofread and adapt. + + + +You can also directly enter the Explain command in the dialog box. + + + +Here, you can also directly use the #Code context mentioned above to combine Explain with your instructions for more detailed tasks. + +### 5.2.2 Generate Explanation for the Entire File + +Explain can be used with Context or Files commands to generate explanations for the entire file. + + + + +## 5.3 Content Retrieval + +Usually, for each Q&A session, [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will provide reference documents, which can offer more contextual reference for further analysis. + + + +You can also directly perform file retrieval: + + + +## 5.4 Code Generation + +In daily coding, we often encounter scenarios where repetitive code is used. Sometimes you may not know if a certain function has already been implemented. At this time, use `#Workspace` to ask questions. For example: + + + +## 5.5 Adding Comments + +Use the "/doc" command to generate code comments. + + + +## 5.6 Generating Unit Tests + +The unit test code for VTable is located in the “__**tests**” directory of each package. + + + +Use the [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) "/test" command to quickly generate unit test code. + + + +## 5.7 Intelligent Suggestions + +During writing, the intelligent generation of optional code is a standard feature of the programming assistant. Please feel free to explore this feature. + +# Submitting Code + +After completing the documentation, first push the code to your remote branch. For example: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + +The commit message for VisActor follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification, **demo uses docs** + +`[optional scope]: ` + +Common types include docs (documentation, log changes), feat (new features), fix (problem fixes), refactor (code refactoring), etc. Please choose based on the actual situation. + +Please write the description with a concise and accurate English description. + +Before submitting a commit, we will conduct commit lint checks. For more details, please see [check rules](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js). + +A common issue is that the remote upstream (@visactor/vtable) has new updates, which may cause conflicts when you submit a Pull Request. Therefore, you can merge the commits from other developers with your commits before submitting. Use the following code to switch to the develop branch: + +``` +git checkout develop + +``` +Use the following code to pull out the latest code from upstream: + +``` +git pull upstream develop + +``` +Switch back to your development branch: + +``` +git checkout docs/add-funnel-demo + +``` +Merge the commits from develop into your branch: + +``` +git rebase develop + +``` +Submit the updated code to your branch: + +``` +git push origin docs/add-funnel-demo + +``` +# Submitting a PR + +You can click the `Compare & pull request` button on your GitHub code repository page. + + + +Or create one through the `contribute` button: + +Fill in the modification details of this submission according to the template: + +* Check what type of modification this is + + + +* Fill in the associated issue + + + +* If there are complex changes, please explain the background and solution + + + +After filling in the relevant information, click Create pull request to submit. + +An administrator will review the PR to decide whether to approve it. If not approved, modifications will be needed before resubmitting. + +# Next Step + +Next, you can read the implementation principles and source code explanations of each module, or join in contributing to these documents. + +Please join the VisActor family and contribute your efforts! + +GitHub: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor WeChat Subscription (you can join the WeChat group through the subscription menu): + + + +VisActor Official Website: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu Group: + + + +Discord: https://discord.com/invite/3wPyxVyH6m + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) + diff --git a/docs/assets/contributing/menu.json b/docs/assets/contributing/menu.json new file mode 100644 index 000000000..c5d5bb185 --- /dev/null +++ b/docs/assets/contributing/menu.json @@ -0,0 +1,40 @@ +{ + "menu": "contributing", + "children": [ + { + "path": "1-Setting-Up-the-Development-Environment", + "title": { + "zh": "1.搭建开发环境", + "en": "1-Setting-Up-the-Development-Environment" + } + }, + { + "path": "2-Howto Submit an Issue", + "title": { + "zh": "2.如何提issue", + "en": "2-Howto Submit an Issue" + } + }, + { + "path": "3-How to Contribute Documentation", + "title": { + "zh": "3.如何贡献文档", + "en": "3-How to Contribute Documentation" + } + }, + { + "path": "4-How to Contribute to a Demo", + "title": { + "zh": "4.如何贡献demo", + "en": "4-How to Contribute to a Demo" + } + }, + { + "path": "5-How to Contribute Code", + "title": { + "zh": "5.如何贡献代码", + "en": "5-How to Contribute Code" + } + } + ] +} \ No newline at end of file diff --git a/docs/assets/contributing/zh/1-Setting-Up-the-Development-Environment.md b/docs/assets/contributing/zh/1-Setting-Up-the-Development-Environment.md new file mode 100644 index 000000000..487c65158 --- /dev/null +++ b/docs/assets/contributing/zh/1-Setting-Up-the-Development-Environment.md @@ -0,0 +1,129 @@ +--- +title: 1.搭建开发环境 + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +# Github + +## 1.1 注册账号 + +VisActor 团队通常在 github 上进行开发和 issue 维护,请打开 [Github 网站](https://github.com/),点击右上角 `Sign up` 按钮,注册一个自己的账号,开启你开源之旅的第一步。 + +如果因为特殊情况,你无法打开 Github 站点,请告知我们并通过 [Gitee](https://gitee.com/VisActor/VTable) 进行项目开发。 + +## 1.2 Fork 项目 + +首先需要 fork 这个项目,进入[VTable 项目页面](https://github.com/VisActor/VTable),点击右上角的 Fork 按钮 + + + + + + + +你的 github 帐号中会出现 xxxx(你的 github 用户名)/vtable 这个项目 + + + +# 本地开发环境 + +## 2.1 安装 git + +由于代码托管在 github 上,我们使用git做版本控制。 + +Git 是一种版本控制系统,用于跟踪和管理软件开发项目中的代码变更。它帮助开发者记录和管理代码的历史记录,方便团队协作、代码版本控制、合并代码等操作。通过 Git,您可以追踪每个文件的每个版本,并轻松地在不同版本之间进行切换和比较。Git 还提供了分支管理功能,使得可以同时进行多个并行开发任务。 + +* 访问 Git 官方网站:[https://git-scm.com/](https://git-scm.com/) + +* 下载最新版本的 Git 安装程序。 + +* 运行下载的安装程序,按照安装向导的提示进行安装。 + +* 安装完成后,你可以通过命令行使用 `git version` 命令确认安装成功。 + +``` +HM4G2J09L6:~ xuanhun$ git version +**git version 2.39.2 (Apple Git-143)** + +``` +## 2.2 安装开发工具(推荐VSCode) + +VisActor 整体上属于前端技术栈,能进行前端开发的工具很多,我们推荐使用VScode。当然,你也可以使用你喜欢的开发工具。 + +如果你对VSCode 不是很熟悉的话,建议阅读官方文档:https://vscode.js.cn/docs/setup/setup-overview + +## 2.3 安装 豆包 Marscode AI编程助手 + +[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + +豆包 MarsCode 编程助手是豆包旗下的 AI 编程助手,提供以智能代码补全为代表的 AI 功能。它支持主流的编程语言和 IDE,在开发过程中提供单行代码或整个函数的编写建议。此外,它还支持代码解释、单测生成和问题修复等功能,提高了开发效率和质量。 更多信息,请参考[豆包 MarsCode 编程助手的文档](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a)。 + + + +借助Marscode,VisActor 开发者可以更方便的进行代码理解、文档撰写、功能开发、单元测试等多项任务。在详细的各项任务贡献指南中,会有更详细的案例说明。 + + + + + +## 2.4 Clone 代码到本地 + +进入 VTable 文件夹,添加 VTable 的远程地址 + +``` +git remote add upstream https://github.com/VisActor/VTable.git + +``` +获取 VTable 最新源码 + +``` +git pull upstream develop + +``` +# 初始化项目 + +首先,全局安装 [@microsoft/rush](https://rushjs.io/pages/intro/get_started/) + +``` +$ npm i --global @microsoft/rush + +``` +接下来执行命令查看demo + +``` +# 安装依赖 +$ rush update +# 启动 vtable 的demo页 +$ cd ./packages/vtable && rushx demo +# 启动 react-vtable 的demo页 +$ cd ./packages/react-vtable && rushx start +# 启动本地文档站点 +$ rush docs + +``` +# 下一步 + +到目前为止,你已经做好了开发代码的准备了。接下来请继续阅读下一节教程,开始不同类型的任务。 + + + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号留言(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/zh/2-Howto Submit an Issue.md b/docs/assets/contributing/zh/2-Howto Submit an Issue.md new file mode 100644 index 000000000..7202c1903 --- /dev/null +++ b/docs/assets/contributing/zh/2-Howto Submit an Issue.md @@ -0,0 +1,69 @@ +--- +title: 2.如何提issue + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +每个项目的issues栏目下面,可以进行issue 的创建、搜索等工作。 + +比如VTable issues:https://github.com/VisActor/VTable/issues + + + +# 确定是否存在同样的issue + +可以通过搜索过滤,查看issue细节的方式确定是否已经存在相同的issue。 + +# 创建issue + +如果没有找到类似的issue,你可以点击"New issue"按钮。 + + + +以“**Documentation Request”,**点击“Get Start”按钮,**填写issue表单。** + + + + + +# **提交issue** + +填写完issue表单后,点击"Submit new issue"按钮提交你的issue。 + +# **跟进issue** + +提交issue后,你可以在仓库的"Issues"选项卡中查看你的issue状态。项目开发者可能会要求你提供更多的信息或者告诉你他们正在处理这个issue。 + +# **关闭issue** + +如果你的问题得到了解决或者你的需求得到了满足,项目开发者会关闭这个issue。你也可以自己关闭issue,如果你认为问题已经解决或者不再需要进一步的帮助。 + + + +通过以上步骤,你可以在GitHub上成功地为开源项目提issue。记得在描述问题时尽量详细和清晰,这样有助于项目开发者更快地理解和解决你的问题。 + +# 下一步 + +到目前为止,你已经熟悉了issue 的概念。接下来请继续阅读下一节教程,开始不同类型的任务。 + + + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号留言(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/zh/3-How to Contribute Documentation.md b/docs/assets/contributing/zh/3-How to Contribute Documentation.md new file mode 100644 index 000000000..bed1ed128 --- /dev/null +++ b/docs/assets/contributing/zh/3-How to Contribute Documentation.md @@ -0,0 +1,297 @@ +--- +title: 3.如何贡献文档 + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +# 创建分支 + +VTable 默认分支为 develop 分支。无论是功能开发、bug 修复、文档编写,都请新建立一个分支,再合并到 develop 分支上。使用以下代码创建分支: + +``` +// 创建文档、demo分支 +git checkout -b docs/add-funnel-demo + +``` + + +# 寻找或者创建issue + +原则上,我们规定每一个pr都要有对应的issue。在开始开发之前,请确认是否有对应的issue,且issue没有被认领。 + +## 搜索文档issue + +可以通过如下方式搜索文档相关的issue: + +``` +is:open label:docs + +``` + + + + +其中他有些 feature 会关联doc标签,可以进一步看一下该issue 是不是纯文档任务。 + +## 创建文档issue + +点击 “NEW ISSUE”,打开issue 选择页面,选择“**Documentation Request”。** + + + +填写你要提交的文档 issue 相关信息即可。 + + + +# 认领issue + +如果你想撰写文档或者修改文档bug,可以在该issue下留言认领。管理员会联系你,确认后将issue assign 给你。 + +例如: + + + + + +# 创建或者修改文档 + +VTable 文档和demo在项目的中的位置如下: + + + +目前文档类型如下: + +* api:接口文档,对应站点 https://www.visactor.io/vtable/api/API/vtable + +* changelog:日志,对应站点:https://www.visactor.io/vtable/changelog/release + +* demos:一些可以独立运行的demo,供调试用 + +* examples:图表示例,对应站点: + +https://www.visactor.io/vtable/example + +https://www.visactor.io/vtable/example-react + +https://www.visactor.io/vtable/example-openinula + +https://www.visactor.io/vtable/example-vue + +* faq:faq 文档,对应站点:https://www.visactor.io/vtable/faq/1-How%20to%20implement%20multi-level%20headers%20in%20a%20basic%20table + +* guide:教程,对应站点:https://www.visactor.io/vtable/guide/Getting_Started/Getting_Started + +* option:option 说明,对应站点:https://www.visactor.io/vtable/option/ListTable + +* contributing:社区贡献者文档,对应站点:https://www.visactor.io/vtable/guide/contributing_docs/Contribution_Guide + + + +找到对应的文档位置进行新增或者修改。这里需要注意的是部分文档需要同时维护 “menu.json” 文件。 + + + +该文件对应文档最后在站点上显示的位置和名称等。例如 + + + +# 借助豆包 Marscode AI编程助手 进行文档写作 + +[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + +借助豆包[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),可以在文档创作的整个流程中提供全方面的帮助。 + +如果你还没有安装[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),请从该链接进入下载页面:https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + + + +在文档写作中,合理使用 context 指令,可以提升内容的准确性。 + +`**⭐️ #Workspace**` + +选择 Workspace 中的全局代码作为上下文,AI 将根据用户 Query 自动寻找相关代码 Context + + + +`**⭐️ #Files**` + +搜索选择代码仓库中的文件作为上下文 + + + +`**⭐️ #Code**` + +搜索选择代码仓库中的函数、类作为上下文 + + + + + + + +下面举例说明,如何使用[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 进行文档写作。 + +## 5.1 提供文档写作思路 + +这里 **通过 # 唤起 #Workspace ,**然后进行提问,希望它帮忙生成一份开发者文档大纲。 + + + +## 5.2 生成项目结构说明 + +这里 **通过 # 唤起 #Workspace ,**然后进行提问,希望它帮忙生成一份项目结构说明文档。 + + + +我们仍然可以针对子文件夹,进行进一步的提问。 + + + +## 5.3 生成文件或代码详解 + +### 5.3.1 生成代码说明 + +当我们在文件中选择一段代码,可以从悬浮菜单中选择 Explain 命令,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 会为我们生成详细的代码解释。我们可以在此基础上,进行校对和改编。 + + + +也可以直接在对话框中输入Explain 命令。 + + + +这里也可以直接使用上面提到的 #Code context 来结合Explain 和你的指令来进行更细节的任务。 + +### 5.3.2 生成针对整个文件的说明 + +Explain 可以和 Context 或者 Files 命令搭配使用,用来生成针对整个文件的说明文档。 + + + + + +## 5.4 生成示例代码 + +为了更好的解释说明原理和用法,通常需要给出可以实际运行的demo,可以利用 [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 的代码生成能力为我们生成示例代码。不过目前各种AI 的代码生成能力都不能保证准确,还需要进一步的进行验证。 + + + + + +## 5.5 内容检索 + +通常我们的每个问答,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 都会给出参考文档,这些文档可以给我们提供更多参考上下文,供进一步分析。 + + + + + +也可以直接进行文件检索: + + + +## 5.6 翻译文档 +VisActor 的文档需要同时提供中英文,Marscode可以辅助用来进行翻译。 + +# 提交代码 + +文档完成之后,先把代码push到你的远程分支。例如: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + + +VisActor 的 commit 提交信息遵循 [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 规范 + +`[optional scope]: ` + +其中常用的`type`包括 docs(文档、日志修改)、feat(新功能)、fix(问题修复)、refactor(代码重构)等,请根据实际情况选择。 + +请用简短精确的英文描述编写 description + +提交 commit 之前,我们会进行 commit lint 检查,具体可以查看[检查规则](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js)。 + +一个常见的问题是远程的 upstream (@visactor/vtable) 有了新的更新, 从而会导致我们提交的 Pull Request 时会导致冲突。 因此我们可以在提交前先把远程其他开发者的 commit 和我们的 commit 合并。使用以下代码切换到 develop 分支: + +``` +git checkout develop + +``` +使用以下代码拉出远程的最新代码: + +``` +git pull upstream develop + +``` +切换回自己的开发分支: + +``` +git checkout docs/add-funnel-demo + +``` +把 develop 的 commit 合并到自己分支: + +``` +git rebase develop + +``` +把更新代码提交到自己的分支中: + +``` +git push origin docs/add-funnel-demo + +``` +# 提交PR + +你可以在你的 github 代码仓库页面点击 `Compare & pull request` 按钮。 + + + +或通过 `contribute` 按钮创建: + +按照模板填写本次提交的修改内容: + +* 勾选这是什么类型的修改 + + + +* 填写关联的 issue + + + +* 若有复杂变更,请说明背景和解决方案 + + + +相关信息填写完成后,点击 Create pull request 提交。 + +管理员会review pr 决定是否通过,如果不通过需要进行修改然后重新提交。 + +# 下一步 + +不同的文档类型中,demo 文档有一些特殊要求,可以参考“如何贡献demo”一节。 + +接下来可以继续尝试不同类型的任务。 + + + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号留言(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/zh/4-How to Contribute to a Demo.md b/docs/assets/contributing/zh/4-How to Contribute to a Demo.md new file mode 100644 index 000000000..22884e183 --- /dev/null +++ b/docs/assets/contributing/zh/4-How to Contribute to a Demo.md @@ -0,0 +1,256 @@ +--- +title: 4.如何贡献demo + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +# 创建分支 + +VTable 默认分支为 develop 分支。无论是功能开发、bug 修复、文档编写,都请新建立一个分支,再合并到 develop 分支上。使用以下代码创建分支: + +``` +// 创建文档、demo分支 +git checkout -b docs/add-funnel-demo + +``` + + +# 寻找或者创建issue + +原则上,我们规定每一个pr都要有对应的issue。在开始开发之前,请确认是否有对应的issue,且issue没有被认领。 + +## 搜索demo issue + +可以通过如下方式搜索 demo 相关的issue: + +``` + label:demos + +``` + + +其中他有些 feature 会关联doc标签,可以进一步看一下该issue 是不是纯 demo 任务。 + +## 创建demo issue + +点击 “NEW ISSUE”,打开issue 选择页面,选择“**Others”。** + + + +填写你要提交的文档 issue 相关信息,并打上“demos”标签即可。 + + + +# 认领issue + +如果你想提交 demo 或者修改demo bug,可以在该issue下留言认领。管理员会联系你,确认后将issue assign 给你。 + +例如: + + + + + +# 创建或者修改 demo + +VTable 文档和demo在项目的中的位置如下(demos): + + + +以基础面积图的示例文档为例(目前一份示例同时包含中英文版本,分别在 zh & en 的路径下): + + + +示例 Markdown 内容分为几个部分: + +* 元信息:示例内容的属性定义,包括图表分类、封面图、关键词等; + +* 标题:一级标题下的正文内容对应了示例的描述信息; + +* 关键配置:示例中所包含的关键配置说明,这一部分将在示例页面右侧的“关键配置”中呈现; + +* 代码演示:示例执行的具体代码内容,目前只支持原生的 JavaScript 代码。 + +其中 Markdown 的元信息的字段定义为: + +* group:示例的分类信息,描述了当前示例属于什么图表类别 + +* title:示例的标 + +* keywords:示例的关键词 + +* order:示例在同个分组下的排序依据 + +* cover:示例的封面图 + +* tutorial:跳转的教程链接(默认的示例教程将会跳转到示例分组所对应的教程) + +目前图表示例的 group 包含多个分类,对应到 vtable 示例画廊中全部图表下的分类。具体的分类字段可以参照已有的示例文档进行填写。 + + + + + +# 借助豆包 Marscode AI编程助手进行demo编写 + +借助豆包[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),可以在文档创作的整个流程中提供全方面的帮助。 + +如果你还没有安装[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),请从该链接进入下载页面:https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + + + +在demo编写中,合理使用 context 指令,可以提升内容的准确性。 + +`**⭐️ #Workspace**` + +选择 Workspace 中的全局代码作为上下文,AI 将根据用户 Query 自动寻找相关代码 Context + + + +`**⭐️ #Files**` + +搜索选择代码仓库中的文件作为上下文 + + + +`**⭐️ #Code**` + +搜索选择代码仓库中的函数、类作为上下文 + + + + + +下面举例说明,如何使用[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 进行demo编写。 + +## 5.1 提供文档框架 + +这里 **通过 # 唤起 #Workspace ,**然后进行提问,选中一份example 的文档内容,希望它仿照生成一份新的 example 文档。 + + + +我们可以在此基础上继续细节的调整。 + +## 5.2 生成说明文字 + +每个demo的说明文字可以先用 [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 生成,然后再做校对和调整。比如: + + + +## 5.3 生成示例代码 + +为了更好的解释说明原理和用法,通常需要给出可以实际运行的demo,可以利用 [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 的代码生成能力为我们生成示例代码。不过目前各种AI 的代码生成能力都不能保证准确,还需要进一步的进行验证。 + +## 5.4 内容检索 + +通常我们的每个问答,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 都会给出参考文档,这些文档可以给我们提供更多参考上下文,供进一步分析。 + + + + + +也可以直接进行文件检索: + + + +# 提交代码 + +文档完成之后,先把代码push到你的远程分支。例如: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + + +VisActor 的 commit 提交信息遵循 [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 规范,**demo 使用docs** + +`[optional scope]: ` + +其中常用的`type`包括 docs(文档、日志修改)、feat(新功能)、fix(问题修复)、refactor(代码重构)等,请根据实际情况选择。 + +请用简短精确的英文描述编写 description + +提交 commit 之前,我们会进行 commit lint 检查,具体可以查看[检查规则](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js)。 + +一个常见的问题是远程的 upstream (@visactor/vtable) 有了新的更新, 从而会导致我们提交的 Pull Request 时会导致冲突。 因此我们可以在提交前先把远程其他开发者的 commit 和我们的 commit 合并。使用以下代码切换到 develop 分支: + +``` +git checkout develop + +``` +使用以下代码拉出远程的最新代码: + +``` +git pull upstream develop + +``` +切换回自己的开发分支: + +``` +git checkout docs/add-funnel-demo + +``` +把 develop 的 commit 合并到自己分支: + +``` +git rebase develop + +``` +把更新代码提交到自己的分支中: + +``` +git push origin docs/add-funnel-demo + +``` +# 提交PR + +你可以在你的 github 代码仓库页面点击 `Compare & pull request` 按钮。 + + + +或通过 `contribute` 按钮创建: + +按照模板填写本次提交的修改内容: + +* 勾选这是什么类型的修改 + + + +* 填写关联的 issue + + + +* 若有复杂变更,请说明背景和解决方案 + + + +相关信息填写完成后,点击 Create pull request 提交。 + +管理员会review pr 决定是否通过,如果不通过需要进行修改然后重新提交。 + +# 下一步 + +接下来可以继续尝试不同类型的任务。 + + + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号留言(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/zh/5-How to Contribute Code.md b/docs/assets/contributing/zh/5-How to Contribute Code.md new file mode 100644 index 000000000..e1f7c965d --- /dev/null +++ b/docs/assets/contributing/zh/5-How to Contribute Code.md @@ -0,0 +1,270 @@ +--- +title: 5.如何贡献代码 + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +# 创建分支 + +VTable 默认分支为 develop 分支。无论是功能开发、bug 修复、文档编写,都请新建立一个分支,再合并到 develop 分支上。使用以下代码创建分支: + +``` +// 创建文档、demo分支 +git checkout -b docs/add-funnel-demo + +``` + + +# 寻找或者创建issue + +原则上,我们规定每一个pr都要有对应的issue。在开始开发之前,请确认是否有对应的issue,且issue没有被认领。 + +## 搜索 issue + +可以通过如下方式搜索 bug 或者 feature 相关的issue: + + + +## 创建代码相关 issue + +点击 “NEW ISSUE”,打开issue 选择页面,选择“**Bug Report” 或者 “Feature Request”。** + + + +填写你要提交的文档 issue 相关信息,并打上合适的标签即可。 + + + +# 认领issue + +如果你想贡献代码,可以在该issue下留言认领。管理员会联系你,确认后将issue assign 给你。 + +例如: + + + + + +# 编写代码 + +VTable 源码在项目的中的位置如下: + + + +VTable 生态所有的组件都在同一目录下,按包名进行拆分,开发者需要在自己的代码分支上开发代码,然后进行提交。 + +# 借助豆包 Marscode AI编程助手 进行代码编写 + +借助豆包[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),可以在代码编写的整个流程中提供全方面的帮助。 + +如果你还没有安装[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),请从该链接进入下载页面:https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + + + +在代码编写中,合理使用 context 指令,可以提升内容的准确性。 + +`**⭐️ #Workspace**` + +选择 Workspace 中的全局代码作为上下文,AI 将根据用户 Query 自动寻找相关代码 Context + + + +`**⭐️ #Files**` + +搜索选择代码仓库中的文件作为上下文 + + + +`**⭐️ #Code**` + +搜索选择代码仓库中的函数、类作为上下文 + + + + + +下面举例说明,如何使用[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 进行代码编写。 + +## 5.1 快速熟悉整个仓库 + +这里 **通过 # 唤起 #Workspace ,**然后进行提问,希望它帮忙生成一份项目结构说明文档。 + + + +我们仍然可以针对子文件夹,进行进一步的提问。 + + + +## 5.2 解释代码 + +### 5.2.1 生成代码说明 + +当我们在文件中选择一段代码,可以从悬浮菜单中选择 Explain 命令,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 会为我们生成详细的代码解释。我们可以在此基础上,进行校对和改编。 + + + +也可以直接在对话框中输入Explain 命令。 + + + +这里也可以直接使用上面提到的 #Code context 来结合Explain 和你的指令来进行更细节的任务。 + +### 5.2.2 生成针对整个文件的说明 + +Explain 可以和 Context 或者 Files 命令搭配使用,用来生成针对整个文件的说明文档。 + + + + + + + +## 5.3 内容检索 + +通常我们的每个问答,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 都会给出参考文档,这些文档可以给我们提供更多参考上下文,供进一步分析。 + + + + + +也可以直接进行文件检索: + + + +## 5.4 代码生成 + +在日常编码中经常会碰到使用重复代码的场景,有时候可能并不知道某个功能是否有现成的函数已实现,此时用 `#Workspace` 来进行提问。例如: + + + +## 5.5 添加注释 + +使用 "/doc"命令生成代码注释。 + + + + + +## 5.6 生成单测 + +VTable 单元测试代码在每个 package 的 “__**tests**__” 目录下。 + + + +使用 [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) “/test” 指令可以快速的生成单测代码。 + + + + + +## 5.7 智能提示 + +编写过程中,智能生成可选代码是编程助手的标配功能,大家自行体验吧。 + + + +# 提交代码 + +文档完成之后,先把代码push到你的远程分支。例如: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + + +VisActor 的 commit 提交信息遵循 [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 规范,**demo 使用docs** + +`[optional scope]: ` + +其中常用的`type`包括 docs(文档、日志修改)、feat(新功能)、fix(问题修复)、refactor(代码重构)等,请根据实际情况选择。 + +请用简短精确的英文描述编写 description + +提交 commit 之前,我们会进行 commit lint 检查,具体可以查看[检查规则](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js)。 + +一个常见的问题是远程的 upstream (@visactor/vtable) 有了新的更新, 从而会导致我们提交的 Pull Request 时会导致冲突。 因此我们可以在提交前先把远程其他开发者的 commit 和我们的 commit 合并。使用以下代码切换到 develop 分支: + +``` +git checkout develop + +``` +使用以下代码拉出远程的最新代码: + +``` +git pull upstream develop + +``` +切换回自己的开发分支: + +``` +git checkout docs/add-funnel-demo + +``` +把 develop 的 commit 合并到自己分支: + +``` +git rebase develop + +``` +把更新代码提交到自己的分支中: + +``` +git push origin docs/add-funnel-demo + +``` +# 提交PR + +你可以在你的 github 代码仓库页面点击 `Compare & pull request` 按钮。 + + + +或通过 `contribute` 按钮创建: + +按照模板填写本次提交的修改内容: + +* 勾选这是什么类型的修改 + + + +* 填写关联的 issue + + + +* 若有复杂变更,请说明背景和解决方案 + + + +相关信息填写完成后,点击 Create pull request 提交。 + +管理员会review pr 决定是否通过,如果不通过需要进行修改然后重新提交。 + +# 下一步 + +接下来你可以阅读每一个模块的实现原理及源码详解,也可以加入贡献这些文档。 + +请加入VisActor 大家庭,贡献你的力量吧! + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/menu.json b/docs/menu.json index 20ca3e9bb..1cf8f0f49 100644 --- a/docs/menu.json +++ b/docs/menu.json @@ -19,6 +19,10 @@ "menu": "guide", "type": "markdown" }, + { + "menu": "contributing", + "type": "markdown" + }, { "menu": "option", "type": "markdown-template", diff --git a/docs/vite.config.js b/docs/vite.config.js index 23186da7e..8c79ee555 100644 --- a/docs/vite.config.js +++ b/docs/vite.config.js @@ -18,12 +18,14 @@ export default { resolve: { alias: { '@visactor/vtable/es/vrender': path.resolve('../packages/vtable/src/vrender.ts'), + '@visactor/vtable/es': path.resolve(__dirname, '../packages/vtable/src/'), '@visactor/vtable': path.resolve('../packages/vtable/src/index.ts'), '@visactor/vtable-gantt': path.resolve('../packages/vtable-gantt/src/index.ts'), '@visactor/vtable-calendar': path.resolve('../packages/vtable-calendar/src/index.ts'), '@visactor/vtable-editors': path.resolve('../packages/vtable-editors/src/index.ts'), '@visactor/vtable-export': path.resolve('../packages/vtable-export/src/index.ts'), '@visactor/vtable-search': path.resolve('../packages/vtable-search/src/index.ts'), + '@visactor/vtable-plugins': path.resolve('../packages/vtable-plugins/src/index.ts'), '@visactor/react-vtable': path.resolve('../packages/react-vtable/src/index.ts'), '@visactor/vue-vtable': path.resolve('../packages/vue-vtable/src/index.ts'), '@visactor/openinula-vtable': path.resolve('../packages/openinula-vtable/src/index.ts'), From f52360a605fe17a03f36ecaa0cbdad78215cae71 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 17:30:16 +0800 Subject: [PATCH 04/24] fix: set vtable peerDependencies in vtable-plugins --- common/config/rush/pnpm-lock.yaml | 46 +++------------------------- packages/vtable-plugins/package.json | 4 ++- 2 files changed, 7 insertions(+), 43 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3cd0bb131..dbbcc8db0 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -781,7 +781,6 @@ importers: '@types/react-dom': ^18.0.0 '@types/react-is': ^17.0.3 '@visactor/vchart': 1.12.12 - '@visactor/vtable': workspace:* '@visactor/vutils': ~0.18.14 '@vitejs/plugin-react': 3.1.0 axios: ^1.4.0 @@ -813,7 +812,6 @@ importers: vite: 3.2.6 vite-plugin-markdown: ^2.1.0 dependencies: - '@visactor/vtable': link:../vtable '@visactor/vutils': 0.18.18 devDependencies: '@babel/core': 7.20.12 @@ -2788,7 +2786,7 @@ packages: jest-resolve: 26.6.2 jest-resolve-dependencies: 26.6.3 jest-runner: 26.6.3_ts-node@10.9.0 - jest-runtime: 26.6.3 + jest-runtime: 26.6.3_ts-node@10.9.0 jest-snapshot: 26.6.2 jest-util: 26.6.2 jest-validate: 26.6.2 @@ -2949,7 +2947,7 @@ packages: graceful-fs: 4.2.11 jest-haste-map: 26.6.2 jest-runner: 26.6.3_ts-node@10.9.0 - jest-runtime: 26.6.3 + jest-runtime: 26.6.3_ts-node@10.9.0 transitivePeerDependencies: - bufferutil - canvas @@ -4318,7 +4316,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.25.9_@babel+core@7.20.12 magic-string: 0.27.0 react-refresh: 0.14.2 - vite: 3.2.6 + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 transitivePeerDependencies: - supports-color dev: true @@ -9500,7 +9498,7 @@ packages: jest-leak-detector: 26.6.2 jest-message-util: 26.6.2 jest-resolve: 26.6.2 - jest-runtime: 26.6.3 + jest-runtime: 26.6.3_ts-node@10.9.0 jest-util: 26.6.2 jest-worker: 26.6.2 source-map-support: 0.5.21 @@ -9545,42 +9543,6 @@ packages: - supports-color dev: true - /jest-runtime/26.6.3: - resolution: {integrity: sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==} - engines: {node: '>= 10.14.2'} - hasBin: true - dependencies: - '@jest/console': 26.6.2 - '@jest/environment': 26.6.2 - '@jest/fake-timers': 26.6.2 - '@jest/globals': 26.6.2 - '@jest/source-map': 26.6.2 - '@jest/test-result': 26.6.2 - '@jest/transform': 26.6.2 - '@jest/types': 26.6.2 - '@types/yargs': 15.0.19 - chalk: 4.1.2 - cjs-module-lexer: 0.6.0 - collect-v8-coverage: 1.0.2 - exit: 0.1.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-config: 26.6.3_ts-node@10.9.0 - jest-haste-map: 26.6.2 - jest-message-util: 26.6.2 - jest-mock: 26.6.2 - jest-regex-util: 26.0.0 - jest-resolve: 26.6.2 - jest-snapshot: 26.6.2 - jest-util: 26.6.2 - jest-validate: 26.6.2 - slash: 3.0.0 - strip-bom: 4.0.0 - yargs: 15.4.1 - transitivePeerDependencies: - - supports-color - dev: true - /jest-runtime/26.6.3_ts-node@10.9.0: resolution: {integrity: sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==} engines: {node: '>= 10.14.2'} diff --git a/packages/vtable-plugins/package.json b/packages/vtable-plugins/package.json index 9037b0b22..f84a464ca 100644 --- a/packages/vtable-plugins/package.json +++ b/packages/vtable-plugins/package.json @@ -34,9 +34,11 @@ "access": "public" }, "dependencies": { - "@visactor/vtable": "workspace:*", "@visactor/vutils": "~0.18.14" }, + "peerDependencies": { + "@visactor/vtable": "workspace:*" + }, "devDependencies": { "@visactor/vchart": "1.12.12", "@internal/bundler": "workspace:*", From 24c1a2b8f44e76ae678b1277fd594db81c61fc15 Mon Sep 17 00:00:00 2001 From: LIANG OU Date: Thu, 28 Nov 2024 19:54:31 +0800 Subject: [PATCH 05/24] =?UTF-8?q?feat:=20=E5=BD=93=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E6=88=96=E7=A6=BB=E5=BC=80taskBar=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=9A=B4=E9=9C=B2=E5=87=BA=E5=BD=93=E5=89=8Dtaskbar?= =?UTF-8?q?=E7=9A=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vtable-gantt/src/event/event-manager.ts | 2 ++ packages/vtable-gantt/src/ts-types/events.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/packages/vtable-gantt/src/event/event-manager.ts b/packages/vtable-gantt/src/event/event-manager.ts index 0fd516318..be4317488 100644 --- a/packages/vtable-gantt/src/event/event-manager.ts +++ b/packages/vtable-gantt/src/event/event-manager.ts @@ -143,6 +143,7 @@ function bindTableGroupListener(event: EventManager) { const taskIndex = getTaskIndexByY(e.offset.y, scene._gantt); const record = scene._gantt.getRecordByIndex(taskIndex); scene._gantt.fireListeners(GANTT_EVENT_TYPE.MOUSEENTER_TASK_BAR, { + target: taskBarTarget, event: e.nativeEvent, index: taskIndex, record @@ -156,6 +157,7 @@ function bindTableGroupListener(event: EventManager) { const taskIndex = getTaskIndexByY(e.offset.y, scene._gantt); const record = scene._gantt.getRecordByIndex(taskIndex); scene._gantt.fireListeners(GANTT_EVENT_TYPE.MOUSELEAVE_TASK_BAR, { + target: scene._gantt.stateManager.hoverTaskBar.target, event: e.nativeEvent, index: taskIndex, record diff --git a/packages/vtable-gantt/src/ts-types/events.ts b/packages/vtable-gantt/src/ts-types/events.ts index 4e1c3f4bd..514e9f185 100644 --- a/packages/vtable-gantt/src/ts-types/events.ts +++ b/packages/vtable-gantt/src/ts-types/events.ts @@ -1,3 +1,4 @@ +import type { GanttTaskBarNode } from '../scenegraph/gantt-node'; import type { ITaskLink } from './gantt-engine'; export type TableEventListener = ( @@ -18,12 +19,16 @@ export interface TableEventHandlersEventArgumentMap { index: number; record: any; event: Event; + /** 进入的taskbar节点信息 */ + target: GanttTaskBarNode; }; mouseleave_task_bar: { /** 第几条数据 */ index: number; record: any; event: Event; + /** 离开的taskbar节点信息 */ + target: GanttTaskBarNode; }; click_task_bar: { /** 第几条数据 */ From e95d28e7f4824c5da2eebe3a747de0f11aa1ebd6 Mon Sep 17 00:00:00 2001 From: LIANG OU Date: Thu, 28 Nov 2024 19:56:36 +0800 Subject: [PATCH 06/24] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E6=88=96=E7=A6=BB=E5=BC=80=E8=8A=82=E7=82=B9=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E4=BB=B6=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/assets/api/en/GanttAPI.md | 2 ++ docs/assets/api/zh/GanttAPI.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/assets/api/en/GanttAPI.md b/docs/assets/api/en/GanttAPI.md index 3d201e6b6..a9510d632 100644 --- a/docs/assets/api/en/GanttAPI.md +++ b/docs/assets/api/en/GanttAPI.md @@ -200,6 +200,7 @@ Event callback parameters: index: number; record: any; event: Event; + target: GanttTaskBarNode; // The task bar node that triggered the event } ``` @@ -214,6 +215,7 @@ Event callback parameters: index: number; record: any; event: Event; + target: GanttTaskBarNode; // The task bar node that triggered the event } ``` diff --git a/docs/assets/api/zh/GanttAPI.md b/docs/assets/api/zh/GanttAPI.md index fe19235ac..f369b9fae 100644 --- a/docs/assets/api/zh/GanttAPI.md +++ b/docs/assets/api/zh/GanttAPI.md @@ -201,6 +201,7 @@ MOUSEENTER_TASK_BAR index: number; record: any; event: Event; + target: GanttTaskBarNode; // 触发事件的任务条节点 } ``` @@ -215,6 +216,7 @@ MOUSEENTER_TASK_BAR index: number; record: any; event: Event; + target: GanttTaskBarNode; // 触发事件的任务条节点 } ``` From c7cc8a687de46d0a00eaf7615a0aabb75d64724a Mon Sep 17 00:00:00 2001 From: LIANG OU Date: Thu, 28 Nov 2024 19:56:55 +0800 Subject: [PATCH 07/24] docs: update changlog of rush --- ...reTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json diff --git a/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json b/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json new file mode 100644 index 000000000..909e5815a --- /dev/null +++ b/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "docs: 更新进入或离开节点时的事件文档\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "lou@trip.com" +} \ No newline at end of file From a6875b272b55e1a611ddc4bd316a0a56f1d69872 Mon Sep 17 00:00:00 2001 From: LIANG OU Date: Thu, 28 Nov 2024 20:26:08 +0800 Subject: [PATCH 08/24] =?UTF-8?q?feat:=20=E5=B0=86=E6=95=B4=E4=B8=AAevent?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=9A=B4=E9=9C=B2=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vtable-gantt/src/event/event-manager.ts | 8 ++++++-- packages/vtable-gantt/src/ts-types/events.ts | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/vtable-gantt/src/event/event-manager.ts b/packages/vtable-gantt/src/event/event-manager.ts index be4317488..c976217c8 100644 --- a/packages/vtable-gantt/src/event/event-manager.ts +++ b/packages/vtable-gantt/src/event/event-manager.ts @@ -143,7 +143,7 @@ function bindTableGroupListener(event: EventManager) { const taskIndex = getTaskIndexByY(e.offset.y, scene._gantt); const record = scene._gantt.getRecordByIndex(taskIndex); scene._gantt.fireListeners(GANTT_EVENT_TYPE.MOUSEENTER_TASK_BAR, { - target: taskBarTarget, + federatedEvent: e, event: e.nativeEvent, index: taskIndex, record @@ -157,7 +157,7 @@ function bindTableGroupListener(event: EventManager) { const taskIndex = getTaskIndexByY(e.offset.y, scene._gantt); const record = scene._gantt.getRecordByIndex(taskIndex); scene._gantt.fireListeners(GANTT_EVENT_TYPE.MOUSELEAVE_TASK_BAR, { - target: scene._gantt.stateManager.hoverTaskBar.target, + federatedEvent: e, event: e.nativeEvent, index: taskIndex, record @@ -303,6 +303,7 @@ function bindTableGroupListener(event: EventManager) { const taskIndex = getTaskIndexByY(e.offset.y, gantt); const record = gantt.getRecordByIndex(taskIndex); gantt.fireListeners(GANTT_EVENT_TYPE.CLICK_TASK_BAR, { + federatedEvent: e, event: e.nativeEvent, index: taskIndex, record @@ -331,6 +332,7 @@ function bindTableGroupListener(event: EventManager) { gantt.updateTaskRecord(recordTaskInfo.taskRecord, taskIndex); if (gantt.hasListeners(GANTT_EVENT_TYPE.CREATE_TASK_SCHEDULE)) { gantt.fireListeners(GANTT_EVENT_TYPE.CREATE_TASK_SCHEDULE, { + federatedEvent: e, event: e.nativeEvent, index: taskIndex, startDate: recordTaskInfo.taskRecord[gantt.parsedOptions.startDateField], @@ -353,6 +355,7 @@ function bindTableGroupListener(event: EventManager) { const link = stateManager.endCreateDependencyLine(e.offset.y); if (gantt.hasListeners(GANTT_EVENT_TYPE.CREATE_DEPENDENCY_LINK)) { gantt.fireListeners(GANTT_EVENT_TYPE.CREATE_DEPENDENCY_LINK, { + federatedEvent: e, event: e.nativeEvent, link }); @@ -363,6 +366,7 @@ function bindTableGroupListener(event: EventManager) { const link = stateManager.endCreateDependencyLine(e.offset.y); if (gantt.hasListeners(GANTT_EVENT_TYPE.CREATE_DEPENDENCY_LINK)) { gantt.fireListeners(GANTT_EVENT_TYPE.CREATE_DEPENDENCY_LINK, { + federatedEvent: e, event: e.nativeEvent, link }); diff --git a/packages/vtable-gantt/src/ts-types/events.ts b/packages/vtable-gantt/src/ts-types/events.ts index 514e9f185..8b74d92f4 100644 --- a/packages/vtable-gantt/src/ts-types/events.ts +++ b/packages/vtable-gantt/src/ts-types/events.ts @@ -1,4 +1,4 @@ -import type { GanttTaskBarNode } from '../scenegraph/gantt-node'; +import type { FederatedPointerEvent } from '@visactor/vtable/es/vrender'; import type { ITaskLink } from './gantt-engine'; export type TableEventListener = ( @@ -19,22 +19,21 @@ export interface TableEventHandlersEventArgumentMap { index: number; record: any; event: Event; - /** 进入的taskbar节点信息 */ - target: GanttTaskBarNode; + federatedEvent: FederatedPointerEvent; }; mouseleave_task_bar: { /** 第几条数据 */ index: number; record: any; event: Event; - /** 离开的taskbar节点信息 */ - target: GanttTaskBarNode; + federatedEvent: FederatedPointerEvent; }; click_task_bar: { /** 第几条数据 */ index: number; record: any; event: Event; + federatedEvent: FederatedPointerEvent; }; change_date_range: { /** 第几条数据 */ @@ -51,6 +50,7 @@ export interface TableEventHandlersEventArgumentMap { record: any; }; create_task_schedule: { + federatedEvent: FederatedPointerEvent; event: Event; /** 第几条数据 */ index: number; @@ -62,6 +62,7 @@ export interface TableEventHandlersEventArgumentMap { record: any; }; create_dependency_link: { + federatedEvent: FederatedPointerEvent; event: Event; /** 依赖信息 */ link: ITaskLink; From 8f278bff2fea82617ea1662f97a31bf70a8a33ce Mon Sep 17 00:00:00 2001 From: LIANG OU Date: Thu, 28 Nov 2024 20:31:23 +0800 Subject: [PATCH 09/24] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E7=94=98?= =?UTF-8?q?=E7=89=B9=E5=9B=BE=E4=BA=8B=E4=BB=B6=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E6=9A=B4=E9=9C=B2=E6=95=B4=E4=B8=AAe=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/assets/api/en/GanttAPI.md | 9 ++++++--- docs/assets/api/zh/GanttAPI.md | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/assets/api/en/GanttAPI.md b/docs/assets/api/en/GanttAPI.md index a9510d632..b2b49018c 100644 --- a/docs/assets/api/en/GanttAPI.md +++ b/docs/assets/api/en/GanttAPI.md @@ -186,6 +186,7 @@ Event callback parameters: index: number; record: any; event: Event; + federatedEvent: FederatedPointerEvent; } ``` @@ -200,7 +201,7 @@ Event callback parameters: index: number; record: any; event: Event; - target: GanttTaskBarNode; // The task bar node that triggered the event + federatedEvent: FederatedPointerEvent; } ``` @@ -215,7 +216,7 @@ Event callback parameters: index: number; record: any; event: Event; - target: GanttTaskBarNode; // The task bar node that triggered the event + federatedEvent: FederatedPointerEvent; } ``` @@ -227,6 +228,7 @@ Event return parameters: ``` { +federatedEvent: FederatedPointerEvent; event: Event; /** The first data */ index: number; @@ -246,7 +248,8 @@ Event return parameters: ``` { - event: Event; + federatedEvent: FederatedPointerEvent; + event: Event; /** dependency link */ link: ITaskLink; }; diff --git a/docs/assets/api/zh/GanttAPI.md b/docs/assets/api/zh/GanttAPI.md index f369b9fae..bcf32cc64 100644 --- a/docs/assets/api/zh/GanttAPI.md +++ b/docs/assets/api/zh/GanttAPI.md @@ -186,6 +186,7 @@ export interface EVENT_TYPES { index: number; record: any; event: Event; + federatedEvent: FederatedPointerEvent; } ``` @@ -201,7 +202,7 @@ MOUSEENTER_TASK_BAR index: number; record: any; event: Event; - target: GanttTaskBarNode; // 触发事件的任务条节点 + federatedEvent: FederatedPointerEvent; } ``` @@ -216,7 +217,7 @@ MOUSEENTER_TASK_BAR index: number; record: any; event: Event; - target: GanttTaskBarNode; // 触发事件的任务条节点 + federatedEvent: FederatedPointerEvent; } ``` @@ -228,6 +229,7 @@ MOUSEENTER_TASK_BAR ``` { + federatedEvent: FederatedPointerEvent; event: Event; /** 第几条数据 */ index: number; @@ -247,7 +249,8 @@ MOUSEENTER_TASK_BAR ``` { - event: Event; + federatedEvent: FederatedPointerEvent; + event: Event; /** 依赖信息 */ link: ITaskLink; }; From 8ae86f02e9d817b9d8baf3d4a8339c30d617615a Mon Sep 17 00:00:00 2001 From: LIANG OU Date: Thu, 28 Nov 2024 20:31:51 +0800 Subject: [PATCH 10/24] docs: update changlog of rush --- ...reTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json diff --git a/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json b/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json new file mode 100644 index 000000000..5e3c158a3 --- /dev/null +++ b/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "docs: 更新甘特图事件文档,暴露整个e的信息\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "lou@trip.com" +} \ No newline at end of file From 9245016ae9838bd0fe4fe8c58e032de9461e58d3 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 20:44:08 +0800 Subject: [PATCH 11/24] fix: change vtable-plugins files --- common/config/rush/pnpm-lock.yaml | 4 +- .../carousel-animation/carousel-animation.ts | 98 ++++ .../header-highlight/header-highlight.ts} | 7 +- .../invert-highlight/invert-highlight.ts} | 15 +- packages/vtable-plugins/demo/list/list.ts | 120 ----- packages/vtable-plugins/demo/menu.ts | 21 +- .../vtable-plugins/demo/pivot/pivot-basic.ts | 510 ------------------ packages/vtable-plugins/demo/vite.config.js | 3 +- packages/vtable-plugins/src/index.ts | 2 - .../vtable-plugins/src/invert-highlight.ts | 23 +- packages/vtable/package.json | 1 - packages/vtable/src/ListTable-all.ts | 3 +- packages/vtable/src/ListTable.ts | 2 +- packages/vtable/src/core/BaseTable.ts | 5 +- packages/vtable/src/core/style-helper.ts | 2 +- packages/vtable/src/index.ts | 14 - .../src/plugins}/custom-cell-style.ts | 24 +- .../vtable/src/plugins/invert-highlight.ts | 16 + .../src/plugins}/list-tree-stick-cell.ts | 19 +- .../scenegraph/group-creater/cell-helper.ts | 2 +- packages/vtable/src/ts-types/base-table.ts | 9 +- 21 files changed, 186 insertions(+), 714 deletions(-) create mode 100644 packages/vtable-plugins/demo/carousel-animation/carousel-animation.ts rename packages/{vtable/examples/interactive/highlight-color.ts => vtable-plugins/demo/header-highlight/header-highlight.ts} (91%) rename packages/{vtable/examples/interactive/mask.ts => vtable-plugins/demo/invert-highlight/invert-highlight.ts} (88%) delete mode 100644 packages/vtable-plugins/demo/list/list.ts delete mode 100644 packages/vtable-plugins/demo/pivot/pivot-basic.ts rename packages/{vtable-plugins/src => vtable/src/plugins}/custom-cell-style.ts (92%) create mode 100644 packages/vtable/src/plugins/invert-highlight.ts rename packages/{vtable-plugins/src => vtable/src/plugins}/list-tree-stick-cell.ts (94%) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index dbbcc8db0..d2d5060c0 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -299,7 +299,6 @@ importers: '@visactor/vrender-kits': 0.21.0-alpha.4 '@visactor/vscale': ~0.18.1 '@visactor/vtable-editors': workspace:* - '@visactor/vtable-plugins': workspace:* '@visactor/vutils': ~0.18.14 '@visactor/vutils-extension': ~1.11.5 '@vitejs/plugin-react': 3.1.0 @@ -346,7 +345,6 @@ importers: '@visactor/vrender-kits': 0.21.0-alpha.4 '@visactor/vscale': 0.18.18 '@visactor/vtable-editors': link:../vtable-editors - '@visactor/vtable-plugins': link:../vtable-plugins '@visactor/vutils': 0.18.18 '@visactor/vutils-extension': 1.11.14 cssfontparser: 1.2.1 @@ -4316,7 +4314,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.25.9_@babel+core@7.20.12 magic-string: 0.27.0 react-refresh: 0.14.2 - vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 + vite: 3.2.6 transitivePeerDependencies: - supports-color dev: true diff --git a/packages/vtable-plugins/demo/carousel-animation/carousel-animation.ts b/packages/vtable-plugins/demo/carousel-animation/carousel-animation.ts new file mode 100644 index 000000000..c9108ce29 --- /dev/null +++ b/packages/vtable-plugins/demo/carousel-animation/carousel-animation.ts @@ -0,0 +1,98 @@ +import * as VTable from '@visactor/vtable'; +import { bindDebugTool } from '@visactor/vtable/es/scenegraph/debug-tool'; +import { InvertHighlightPlugin, CarouselAnimationPlugin } from '../../src'; +const CONTAINER_ID = 'vTable'; +const generatePersons = count => { + return Array.from(new Array(count)).map((_, i) => ({ + id: i + 1, + email1: `${i + 1}@xxx.com`, + name: `小明${i + 1}`, + lastName: '王', + date1: '2022年9月1日', + tel: '000-0000-0000', + sex: i % 2 === 0 ? 'boy' : 'girl', + work: i % 2 === 0 ? 'back-end engineer' + (i + 1) : 'front-end engineer' + (i + 1), + city: 'beijing', + image: + '' + })); +}; + +export function createTable() { + const records = generatePersons(20); + const columns: VTable.ColumnsDefine = [ + { + field: 'image', + title: '行号', + width: 80, + cellType: 'image', + keepAspectRatio: true + }, + { + field: 'id', + title: 'ID', + width: 'auto', + minWidth: 50, + sort: true + }, + { + field: 'email1', + title: 'email', + width: 200, + sort: true, + style: { + underline: true, + underlineDash: [2, 0], + underlineOffset: 3 + } + }, + { + title: 'full name', + columns: [ + { + field: 'name', + title: 'First Name', + width: 200 + }, + { + field: 'name', + title: 'Last Name', + width: 200 + } + ] + }, + { + field: 'date1', + title: 'birthday', + width: 200 + }, + { + field: 'sex', + title: 'sex', + width: 100 + } + ]; + const option: VTable.ListTableConstructorOptions = { + container: document.getElementById(CONTAINER_ID), + records, + columns, + theme: VTable.themes.DARK, + // heightMode: 'adaptive', + select: { + disableSelect: true + } + }; + const tableInstance = new VTable.ListTable(option); + window.tableInstance = tableInstance; + + bindDebugTool(tableInstance.scenegraph.stage, { + customGrapicKeys: ['col', 'row'] + }); + + const ca = new CarouselAnimationPlugin(tableInstance, { + rowCount: 2, + replaceScrollAction: true + }); + + ca.play(); +} diff --git a/packages/vtable/examples/interactive/highlight-color.ts b/packages/vtable-plugins/demo/header-highlight/header-highlight.ts similarity index 91% rename from packages/vtable/examples/interactive/highlight-color.ts rename to packages/vtable-plugins/demo/header-highlight/header-highlight.ts index 413107d71..88d852bb3 100644 --- a/packages/vtable/examples/interactive/highlight-color.ts +++ b/packages/vtable-plugins/demo/header-highlight/header-highlight.ts @@ -1,5 +1,6 @@ -import * as VTable from '../../src'; -import { bindDebugTool } from '../../src/scenegraph/debug-tool'; +import * as VTable from '@visactor/vtable'; +import { bindDebugTool } from '@visactor/vtable/es/scenegraph/debug-tool'; +import { HeaderHighlightPlugin } from '../../src'; const CONTAINER_ID = 'vTable'; const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ @@ -97,7 +98,7 @@ export function createTable() { } ]); - const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance); + const highlightPlugin = new HeaderHighlightPlugin(tableInstance); window.highlightPlugin = highlightPlugin; // tableInstance.scenegraph.temporarilyUpdateSelectRectStyle({stroke: false}) diff --git a/packages/vtable/examples/interactive/mask.ts b/packages/vtable-plugins/demo/invert-highlight/invert-highlight.ts similarity index 88% rename from packages/vtable/examples/interactive/mask.ts rename to packages/vtable-plugins/demo/invert-highlight/invert-highlight.ts index 49eba6c4c..fa119406c 100644 --- a/packages/vtable/examples/interactive/mask.ts +++ b/packages/vtable-plugins/demo/invert-highlight/invert-highlight.ts @@ -1,5 +1,6 @@ -import * as VTable from '../../src'; -import { bindDebugTool } from '../../src/scenegraph/debug-tool'; +import * as VTable from '@visactor/vtable'; +import { bindDebugTool } from '@visactor/vtable/es/scenegraph/debug-tool'; +import { InvertHighlightPlugin, CarouselAnimationPlugin } from '../../src'; const CONTAINER_ID = 'vTable'; const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ @@ -88,7 +89,7 @@ export function createTable() { customGrapicKeys: ['col', 'row'] }); - const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance); + const highlightPlugin = new InvertHighlightPlugin(tableInstance); // highlightPlugin.setInvertHighlightRange({ // start: { // col: 0, @@ -118,10 +119,10 @@ export function createTable() { } }); - const ca = new VTable.CarouselAnimationPlugin(tableInstance, { - rowCount: 2, - replaceScrollAction: true - }); + // const ca = new CarouselAnimationPlugin(tableInstance, { + // rowCount: 2, + // replaceScrollAction: true + // }); // ca.play(); diff --git a/packages/vtable-plugins/demo/list/list.ts b/packages/vtable-plugins/demo/list/list.ts deleted file mode 100644 index 3d4cf978f..000000000 --- a/packages/vtable-plugins/demo/list/list.ts +++ /dev/null @@ -1,120 +0,0 @@ -import * as VTable from '@visactor/vtable'; -import { SearchComponent } from '../../src'; -const CONTAINER_ID = 'vTable'; -const generatePersons = count => { - return Array.from(new Array(count)).map((_, i) => ({ - id: i + 1, - email1: `${i + 1}@xxx.com`, - name: `小明${i + 1}`, - lastName: '王', - date1: '2022年9月1日', - tel: '000-0000-0000', - sex: i % 2 === 0 ? 'boy' : 'girl', - work: i % 2 === 0 ? 'back-end engineer' : 'front-end engineer', - city: 'beijing' - })); -}; - -export function createTable() { - const records = generatePersons(100); - const columns: VTable.ColumnsDefine = [ - { - field: '', - title: '行号', - width: 80, - fieldFormat(data, col, row, table) { - return row - 1; - } - }, - { - field: 'id', - title: 'ID', - width: '1%', - minWidth: 200, - sort: true - }, - { - field: 'email1', - title: 'email', - width: 200, - sort: true - }, - { - title: 'full name', - columns: [ - { - field: 'name', - title: 'First Name', - width: 200 - }, - { - field: 'name', - title: 'Last Name', - width: 200 - } - ] - }, - { - field: 'date1', - title: 'birthday', - width: 200 - }, - { - field: 'sex', - title: 'sex', - width: 100 - }, - { - field: 'tel', - title: 'telephone', - width: 150 - }, - { - field: 'work', - title: 'job', - width: 200 - }, - { - field: 'city', - title: 'city', - width: 150 - } - ]; - const option = { - container: document.getElementById(CONTAINER_ID), - records, - columns, - tooltip: { - isShowOverflowTextTooltip: true - } - // frozenColCount: 1, - // bottomFrozenRowCount: 2, - // rightFrozenColCount: 2, - // overscrollBehavior: 'none' - // autoWrapText: true, - // heightMode: 'autoHeight', - // widthMode: 'adaptive' - }; - const tableInstance = new VTable.ListTable(option); - window.tableInstance = tableInstance; - - const search = new SearchComponent({ - table: tableInstance, - autoJump: true - }); - window.search = search; - // tableInstance.on('sort_click', args => { - // tableInstance.updateSortState( - // { - // field: args.field, - // order: Date.now() % 3 === 0 ? 'desc' : Date.now() % 3 === 1 ? 'asc' : 'normal' - // }, - // false - // ); - // return false; //return false代表不执行内部排序逻辑 - // }); - - setTimeout(() => { - tableInstance.updateOption(option); - }, 2000); -} diff --git a/packages/vtable-plugins/demo/menu.ts b/packages/vtable-plugins/demo/menu.ts index 0efaad87d..269806252 100644 --- a/packages/vtable-plugins/demo/menu.ts +++ b/packages/vtable-plugins/demo/menu.ts @@ -1,19 +1,28 @@ export const menus = [ { - menu: 'listTable', + menu: 'carousel-animation', children: [ { - path: 'list', - name: 'list' + path: 'carousel-animation', + name: 'carousel-animation' } ] }, { - menu: 'pivotTable', + menu: 'header-highlight', children: [ { - path: 'pivot', - name: 'pivot-basic' + path: 'header-highlight', + name: 'header-highlight' + } + ] + }, + { + menu: 'invert-highlight', + children: [ + { + path: 'invert-highlight', + name: 'invert-highlight' } ] } diff --git a/packages/vtable-plugins/demo/pivot/pivot-basic.ts b/packages/vtable-plugins/demo/pivot/pivot-basic.ts deleted file mode 100644 index 22a378419..000000000 --- a/packages/vtable-plugins/demo/pivot/pivot-basic.ts +++ /dev/null @@ -1,510 +0,0 @@ -import * as VTable from '@visactor/vtable'; -import { SearchComponent } from '../../src'; -// import { bindDebugTool } from '../../src/scenegraph/debug-tool'; -const PivotTable = VTable.PivotTable; -const CONTAINER_ID = 'vTable'; - -function generatePivotDataSource(num, colCount) { - const array = new Array(num); - for (let i = 0; i < num; i++) { - const data = new Array(colCount); - for (let j = 0; j < colCount; j++) { - data[j] = i + j; - } - array[i] = data; - } - return array; -} -const DEFAULT_BAR_COLOR = data => { - const num = (data.percentile ?? 0) * 100; - if (num > 80) { - return '#20a8d8'; - } - if (num > 50) { - return '#4dbd74'; - } - if (num > 20) { - return '#ffc107'; - } - return '#f86c6b'; -}; - -export function createTable() { - const records = generatePivotDataSource(19, 18); - const theme: VTable.TYPES.ITableThemeDefine = { - underlayBackgroundColor: '#F6F6F6', - defaultStyle: { - borderColor: '#000', - color: '#000', - bgColor: '#F6F6F6' - }, - headerStyle: { - bgColor: '#F5F6FA', - frameStyle: { - borderColor: '#00ffff', - borderLineWidth: 2 - } - }, - selectionStyle: { - cellBgColor: 'rgba(130,178,245, 0.2)', - cellBorderColor: '#003fff', - cellBorderLineWidth: 2 - }, - rowHeaderStyle: { - bgColor: '#F3F8FF', - frameStyle: { - borderColor: '#ff00ff', - borderLineWidth: 2 - } - }, - cornerHeaderStyle: { - bgColor: '#CCE0FF', - fontSize: 20, - fontFamily: 'sans-serif', - frameStyle: { - borderColor: '#00ff00', - borderLineWidth: 2 - } - }, - bodyStyle: { - hover: { - cellBgColor: '#CCE0FF', - inlineRowBgColor: '#F3F8FF', - inlineColumnBgColor: '#F3F8FF' - }, - frameStyle: { - borderColor: '#ffff00', - borderLineWidth: 5 - } - }, - frameStyle: { - borderColor: '#000', - borderLineWidth: 1, - borderLineDash: [] - }, - columnResize: { - lineWidth: 1, - lineColor: '#416EFF', - bgColor: '#D9E2FF', - width: 3 - }, - frozenColumnLine: { - shadow: { - width: 24, - startColor: 'rgba(00, 24, 47, 0.06)', - endColor: 'rgba(00, 24, 47, 0)' - } - } - // menuStyle: { - // color: '#000', - // highlightColor: '#2E68CF', - // font: '12px sans-serif', - // highlightFont: '12px sans-serif', - // hoverBgColor: '#EEE' - // } - }; - const option: VTable.PivotTableConstructorOptions = { - columnHeaderTitle: { - title: true, - headerStyle: { - textStick: true - } - }, - columns: [ - { - dimensionKey: '地区', - title: '地区', - headerFormat(value) { - return `${value}地区`; - }, - description(args) { - return args.value; - }, - cornerDescription: '地区维度', - headerStyle: { - textAlign: 'center', - borderColor: 'blue', - color: 'pink', - textStick: true, - bgColor(arg) { - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { - return '#bd422a'; - } - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { - return '#ff9900'; - } - return 'gray'; - } - }, - // 指标菜单 - dropDownMenu: ['升序排序I', '降序排序I', '冻结列I'], - // corner菜单 - cornerDropDownMenu: ['升序排序C', '降序排序C', '冻结列C'], - drillDown: true - }, - { - dimensionKey: '邮寄方式', - title: '邮寄方式11', - headerFormat(value) { - return `${value}邮寄方式`; - }, - headerStyle: { - textAlign: 'left', - borderColor: 'blue', - color: 'pink', - // lineHeight: '2em', - fontSize: 16, - fontStyle: 'bold', - fontFamily: 'sans-serif', - underline: true, - textStick: true, - bgColor(arg) { - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { - return '#bd422a'; - } - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { - return '#ff9900'; - } - return 'gray'; - } - }, - drillUp: false - } - ], - rows: [ - { - dimensionKey: '类别', - title: '类别', - drillUp: true, - width: 'auto', - headerStyle: { - textAlign: 'center', - borderColor: 'blue', - color: 'purple', - textBaseline: 'top', - textStick: true, - bgColor: '#6cd26f' - } - }, - { - dimensionKey: '子类别', - title: '子类别', - headerStyle: { - textAlign: 'center', - color: 'blue', - bgColor: '#45b89f' - }, - width: 'auto', - dropDownMenu: ['升序排序I', '降序排序I', '冻结列I'] - // headerType: 'MULTILINETEXT', - } - ], - indicators: [ - { - indicatorKey: '1', - title: '销售额', - // format(rec) { - // return `${rec.dataValue}%`; - // }, - headerStyle: { - color: 'red', - bgColor(arg) { - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { - return '#bd422a'; - } - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { - return '#ff9900'; - } - return 'gray'; - } - }, - // style: { - // barHeight: '100%', - // // barBgColor: '#aaa', - // // barColor: '#444', - // barBgColor: data => { - // return `rgb(${100 + 100 * (1 - (data.percentile ?? 0))},${100 + 100 * (1 - (data.percentile ?? 0))},${ - // 255 * (1 - (data.percentile ?? 0)) - // })`; - // }, - // barColor: 'transparent' - // }, - // cellType: 'progressbar', - showSort: true - // headerType: 'MULTILINETEXT', - }, - { - indicatorKey: '2', - title: '利润', - // format(rec) { - // // if (rec.rowDimensions[0].value === '东北') return `${rec.dataValue}%`; - // return rec.dataValue; - // }, - // cellType: 'progressbar', - // style: { - // barHeight: '50%', - // barBottom: 20, - // barColor: DEFAULT_BAR_COLOR - // }, - showSort: true, - dropDownMenu: ['利润升序排序I', '利润降序排序I', '利润冻结列I'] - } - ], - columnTree: [ - { - dimensionKey: '地区', - value: '东北', - children: [ - { - dimensionKey: '邮寄方式', - value: '一级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '二级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '三级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - } - ] - }, - { - dimensionKey: '地区', - value: '华北', - children: [ - { - dimensionKey: '邮寄方式', - value: '一级', - children: [ - { - indicatorKey: '1', - value: '销售额' - }, - { - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '二级', - children: [ - { - indicatorKey: '1', - value: '销售额' - }, - { - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '三级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - } - ] - }, - { - dimensionKey: '地区', - value: '中南', - children: [ - { - dimensionKey: '邮寄方式', - value: '一级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '二级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '三级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - } - ] - } - ], - rowTree: [ - { - dimensionKey: '类别', - value: '办公用品', - children: [ - { dimensionKey: '子类别', value: '电脑' }, - { dimensionKey: '子类别', value: '装订机' }, - { dimensionKey: '子类别', value: '签字笔' }, - { dimensionKey: '子类别', value: '标签' }, - { dimensionKey: '子类别', value: '收纳柜' }, - { dimensionKey: '子类别', value: '纸张' }, - { dimensionKey: '子类别', value: '电灯' } - ] - }, - { - dimensionKey: '类别', - value: '家具', - children: [ - { dimensionKey: '子类别', value: '衣柜' }, - { dimensionKey: '子类别', value: '沙发' }, - { dimensionKey: '子类别', value: '餐桌' }, - { dimensionKey: '子类别', value: '椅子' }, - { dimensionKey: '子类别', value: '桌子' } - ] - }, - { - dimensionKey: '类别', - value: '餐饮', - children: [ - { dimensionKey: '子类别', value: '锅具' }, - { - dimensionKey: '子类别', - value: '油盐酱醋' - }, - { dimensionKey: '子类别', value: '米面' } - ] - }, - { - dimensionKey: '类别', - value: '技术', - children: [ - { dimensionKey: '子类别', value: '设备' }, - { dimensionKey: '子类别', value: '配件' }, - { dimensionKey: '子类别', value: '电话' }, - { dimensionKey: '子类别', value: '复印机' } - ] - } - ], - corner: { - titleOnDimension: 'column', - headerStyle: { - textAlign: 'center', - borderColor: 'red', - color: 'yellow', - underline: true, - fontSize: 16, - fontStyle: 'bold', - fontFamily: 'sans-serif' - // lineHeight: '20px' - } - }, - indicatorTitle: '指标名称', - // indicatorsAsCol: false, - container: document.getElementById(CONTAINER_ID), - records, - theme, - showFrozenIcon: false, //显示VTable内置冻结列图标 - allowFrozenColCount: 2, - widthMode: 'autoWidth', // 宽度模式:standard 标准模式; adaptive 自动填满容器 - defaultRowHeight: 80, - columnResizeType: 'indicator', // 'column' | 'indicator' | 'all' - tooltip: { - isShowOverflowTextTooltip: true - } - }; - - const instance = new PivotTable(option); - window.tableInstance = instance; - - const search = new SearchComponent({ - table: instance, - autoJump: true - }); - window.search = search; - - const { PIVOT_SORT_CLICK } = VTable.PivotTable.EVENT_TYPE; - instance.on(PIVOT_SORT_CLICK, e => { - const order = e.order === 'asc' ? 'desc' : e.order === 'desc' ? 'normal' : 'asc'; - instance.updatePivotSortState([{ dimensions: e.dimensionInfo, order }]); - }); - - // bindDebugTool(instance.scenegraph.stage as any, { - // customGrapicKeys: ['role', '_updateTag'] - // }); - - // 只为了方便控制太调试用,不要拷贝 - window.tableInstance = instance; -} diff --git a/packages/vtable-plugins/demo/vite.config.js b/packages/vtable-plugins/demo/vite.config.js index 0dd0c01ed..c2bf7e972 100644 --- a/packages/vtable-plugins/demo/vite.config.js +++ b/packages/vtable-plugins/demo/vite.config.js @@ -13,8 +13,9 @@ module.exports = { }, resolve: { alias: { - '@visactor/vtable/es/': path.resolve(__dirname, '../../vtable/src/es/'), + '@visactor/vtable/es': path.resolve(__dirname, '../../vtable/src/'), '@visactor/vtable': path.resolve(__dirname, '../../vtable/src/index.ts'), + '@src': path.resolve(__dirname, '../../vtable/src/'), '@vutils-extension': path.resolve(__dirname, '../../vtable/src/vutil-extension-temp') } }, diff --git a/packages/vtable-plugins/src/index.ts b/packages/vtable-plugins/src/index.ts index fcc0da94c..dfb38a632 100644 --- a/packages/vtable-plugins/src/index.ts +++ b/packages/vtable-plugins/src/index.ts @@ -1,5 +1,3 @@ export * from './carousel-animation'; export * from './invert-highlight'; -export * from './list-tree-stick-cell'; -export * from './custom-cell-style'; export * from './header-highlight'; diff --git a/packages/vtable-plugins/src/invert-highlight.ts b/packages/vtable-plugins/src/invert-highlight.ts index cbc7b9a25..c5f5fd13b 100644 --- a/packages/vtable-plugins/src/invert-highlight.ts +++ b/packages/vtable-plugins/src/invert-highlight.ts @@ -1,11 +1,10 @@ -import type { Rect } from '@visactor/vtable/es/vrender'; +import type { INode } from '@visactor/vtable/es/vrender'; import { createRect } from '@visactor/vtable/es/vrender'; import type { Group } from '@visactor/vtable/es/scenegraph/graphic/group'; import { isSameRange } from '@visactor/vtable/es/tools/cell-range'; import type { CellRange } from '@visactor/vtable/es/ts-types'; import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; import { cellInRange } from '@visactor/vtable/es/tools/helper'; -import { isValid } from '@visactor/vutils'; export interface InvertHighlightPluginOptions { fill?: string; @@ -64,9 +63,11 @@ export class InvertHighlightPlugin { this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup, this.range); } updateCellGroupShadowInContainer(container: Group, range?: CellRange) { - container.forEachChildrenSkipChild((column: Group) => { + container.forEachChildrenSkipChild((item: INode) => { + const column = item as unknown as Group; if (column.role === 'column') { - column.forEachChildrenSkipChild((cell: Group) => { + column.forEachChildrenSkipChild((item: INode) => { + const cell = item as unknown as Group; if (cell.role !== 'cell') { return; } @@ -96,17 +97,3 @@ export class InvertHighlightPlugin { }); } } - -export function onBeforeAttributeUpdateForInvertHighlight(val: Record, attribute: any) { - // @ts-ignore - const graphic = this as any; - if (graphic.shadowRoot && graphic.shadowRoot.childrenCount && (isValid(val.width) || isValid(val.height))) { - const shadowRect = (graphic.shadowRoot as Group).findChildrenByName('shadow-rect')[0] as Rect; - if (shadowRect) { - shadowRect.setAttributes({ - width: val.width ?? shadowRect.attribute.width, - height: val.height ?? shadowRect.attribute.height - }); - } - } -} diff --git a/packages/vtable/package.json b/packages/vtable/package.json index f8cbbb09a..efe1dac87 100644 --- a/packages/vtable/package.json +++ b/packages/vtable/package.json @@ -52,7 +52,6 @@ }, "dependencies": { "@visactor/vtable-editors": "workspace:*", - "@visactor/vtable-plugins": "workspace:*", "@visactor/vrender-core": "0.21.0-alpha.4", "@visactor/vrender-kits": "0.21.0-alpha.4", "@visactor/vrender-components": "0.21.0-alpha.4", diff --git a/packages/vtable/src/ListTable-all.ts b/packages/vtable/src/ListTable-all.ts index 6de5e57f2..2b94e88c2 100644 --- a/packages/vtable/src/ListTable-all.ts +++ b/packages/vtable/src/ListTable-all.ts @@ -7,7 +7,8 @@ import { registerTitle, registerTooltip } from './components'; -import { registerListTreeStickCellPlugin, registerCustomCellStylePlugin } from '@visactor/vtable-plugins'; +import { registerCustomCellStylePlugin } from './plugins/custom-cell-style'; +import { registerListTreeStickCellPlugin } from './plugins/list-tree-stick-cell'; import { registerChartCell, registerCheckboxCell, diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts index b13623737..851f3cd46 100644 --- a/packages/vtable/src/ListTable.ts +++ b/packages/vtable/src/ListTable.ts @@ -53,7 +53,7 @@ import { listTableUpdateRecords, sortRecords } from './core/record-helper'; -import type { IListTreeStickCellPlugin, ListTreeStickCellPlugin } from '@visactor/vtable-plugins'; +import type { IListTreeStickCellPlugin, ListTreeStickCellPlugin } from './plugins/list-tree-stick-cell'; // import { // registerAxis, // registerEmptyTip, diff --git a/packages/vtable/src/core/BaseTable.ts b/packages/vtable/src/core/BaseTable.ts index 1ca76e747..fd884af7a 100644 --- a/packages/vtable/src/core/BaseTable.ts +++ b/packages/vtable/src/core/BaseTable.ts @@ -126,8 +126,6 @@ import { NumberRangeMap } from '../layout/row-height-map'; import { ListTable } from '../ListTable'; import type { SimpleHeaderLayoutMap } from '../layout'; import { RowSeriesNumberHelper } from './row-series-number-helper'; -import type { ICustomCellStylePlugin } from '@visactor/vtable-plugins'; -import { mergeStyle } from '@visactor/vtable-plugins'; import { hideCellSelectBorder, restoreCellSelectBorder } from '../scenegraph/select/update-select-border'; import type { ITextGraphicAttribute } from '@src/vrender'; import { ReactCustomLayout } from '../components/react/react-custom-layout'; @@ -151,6 +149,7 @@ import { setIconColor } from '../icons'; import { TableAnimationManager } from './animation'; import type { ITableAnimationOption } from '../ts-types/animation/appear'; import { checkCellInSelect } from '../state/common/check-in-select'; +import type { CustomCellStylePlugin, ICustomCellStylePlugin } from '../plugins/custom-cell-style'; const { toBoxArray } = utilStyle; const { isTouchEvent } = event; @@ -219,7 +218,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { isReleased: boolean = false; _chartEventMap: Record = {}; - customCellStylePlugin?: ICustomCellStylePlugin; + customCellStylePlugin?: CustomCellStylePlugin; columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body'; diff --git a/packages/vtable/src/core/style-helper.ts b/packages/vtable/src/core/style-helper.ts index f738c00f1..184b375c6 100644 --- a/packages/vtable/src/core/style-helper.ts +++ b/packages/vtable/src/core/style-helper.ts @@ -1,4 +1,3 @@ -import { mergeStyle } from '@visactor/vtable-plugins'; import type { PivotHeaderLayoutMap } from '../layout/pivot-header-layout'; import { isLeftOrRightAxis, isTopOrBottomAxis } from '../layout/chart-helper/get-axis-config'; import { isFunction } from '@visactor/vutils'; @@ -6,6 +5,7 @@ import * as headerStyleContents from '../header-helper/style'; import * as columnStyleContents from '../body-helper/style'; import type { BaseTableAPI, HeaderData, PivotTableProtected } from '../ts-types/base-table'; import type { ColorPropertyDefine, FullExtendStyle, MappingRule } from '../ts-types'; +import { mergeStyle } from '../plugins/custom-cell-style'; const EMPTY_STYLE = {}; diff --git a/packages/vtable/src/index.ts b/packages/vtable/src/index.ts index 5df5ae0d0..384c6ad15 100644 --- a/packages/vtable/src/index.ts +++ b/packages/vtable/src/index.ts @@ -131,17 +131,3 @@ export { TABLE_EVENT_TYPE } from './core/TABLE_EVENT_TYPE'; export { PIVOT_CHART_EVENT_TYPE, PIVOT_TABLE_EVENT_TYPE } from './ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE'; export { EventTarget } from './event/EventTarget'; - -export type { - ICarouselAnimationPluginOptions, - IHeaderHighlightPluginOptions, - InvertHighlightPluginOptions -} from '@visactor/vtable-plugins'; - -export { - CarouselAnimationPlugin, - HeaderHighlightPlugin, - InvertHighlightPlugin, - registerListTreeStickCellPlugin, - registerCustomCellStylePlugin -} from '@visactor/vtable-plugins'; diff --git a/packages/vtable-plugins/src/custom-cell-style.ts b/packages/vtable/src/plugins/custom-cell-style.ts similarity index 92% rename from packages/vtable-plugins/src/custom-cell-style.ts rename to packages/vtable/src/plugins/custom-cell-style.ts index 9c2f25fe0..6ebf939a3 100644 --- a/packages/vtable-plugins/src/custom-cell-style.ts +++ b/packages/vtable/src/plugins/custom-cell-style.ts @@ -1,14 +1,16 @@ import { merge } from '@visactor/vutils'; -import type { - CellRange, - ColumnStyleOption, - CustomCellStyle, - CustomCellStyleArrangement, - FullExtendStyle -} from '@visactor/vtable/es/ts-types'; -import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; -import type { Style } from '@visactor/vtable/es/body-helper/style'; -import { Factory } from '@visactor/vtable/es/core/factory'; +import type { BaseTableAPI } from '../ts-types/base-table'; +import type { CellRange, ColumnStyleOption, CustomCellStyle, CustomCellStyleArrangement } from '../ts-types'; +import type { Style } from '../body-helper/style'; +import { Factory } from '../core/factory'; + +export interface ICustomCellStylePlugin { + new ( + table: BaseTableAPI, + customCellStyle: CustomCellStyle[], + customCellStyleArrangement: CustomCellStyleArrangement[] + ): CustomCellStylePlugin; +} export class CustomCellStylePlugin { table: BaseTableAPI; @@ -206,4 +208,4 @@ export const registerCustomCellStylePlugin = () => { Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin); }; -export type ICustomCellStylePlugin = typeof CustomCellStylePlugin; +// export type ICustomCellStylePlugin = typeof CustomCellStylePlugin; diff --git a/packages/vtable/src/plugins/invert-highlight.ts b/packages/vtable/src/plugins/invert-highlight.ts new file mode 100644 index 000000000..d6525ac35 --- /dev/null +++ b/packages/vtable/src/plugins/invert-highlight.ts @@ -0,0 +1,16 @@ +import type { Group, Rect } from '@src/vrender'; +import { isValid } from '@visactor/vutils'; + +export function onBeforeAttributeUpdateForInvertHighlight(val: Record, attribute: any) { + // @ts-ignore + const graphic = this as any; + if (graphic.shadowRoot && graphic.shadowRoot.childrenCount && (isValid(val.width) || isValid(val.height))) { + const shadowRect = (graphic.shadowRoot as Group).findChildrenByName('shadow-rect')[0] as Rect; + if (shadowRect) { + shadowRect.setAttributes({ + width: val.width ?? shadowRect.attribute.width, + height: val.height ?? shadowRect.attribute.height + }); + } + } +} diff --git a/packages/vtable-plugins/src/list-tree-stick-cell.ts b/packages/vtable/src/plugins/list-tree-stick-cell.ts similarity index 94% rename from packages/vtable-plugins/src/list-tree-stick-cell.ts rename to packages/vtable/src/plugins/list-tree-stick-cell.ts index 7bb935437..a5c0bc623 100644 --- a/packages/vtable-plugins/src/list-tree-stick-cell.ts +++ b/packages/vtable/src/plugins/list-tree-stick-cell.ts @@ -1,10 +1,15 @@ import { isArray, isValid } from '@visactor/vutils'; -import type { ListTable } from '@visactor/vtable/es/ListTable'; -import { Factory } from '@visactor/vtable/es/core/factory'; -import { Group } from '@visactor/vtable/es/scenegraph/graphic/group'; -import { createRect, type Graphic } from '@visactor/vtable/es/vrender'; -import { updateCell } from '@visactor/vtable/es/scenegraph/group-creater/cell-helper'; -import { getTargetCell } from '@visactor/vtable/es/event/util'; +import type { ListTable } from '../ListTable'; +import { Group } from '../scenegraph/graphic/group'; +import { updateCell } from '../scenegraph/group-creater/cell-helper'; +import type { Graphic } from '@src/vrender'; +import { createRect } from '@src/vrender'; +import { Factory } from '../core/factory'; +import { getTargetCell } from '../event/util'; + +export interface IListTreeStickCellPlugin { + new (table: ListTable): ListTreeStickCellPlugin; +} export class ListTreeStickCellPlugin { table: ListTable; @@ -292,4 +297,4 @@ export const registerListTreeStickCellPlugin = () => { Factory.registerComponent('listTreeStickCellPlugin', ListTreeStickCellPlugin); }; -export type IListTreeStickCellPlugin = typeof ListTreeStickCellPlugin; +// export type IListTreeStickCellPlugin = typeof ListTreeStickCellPlugin; diff --git a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts index 10f5e8775..5bdf39a01 100644 --- a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts +++ b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts @@ -36,7 +36,7 @@ import { updateCellContentHeight, updateCellContentWidth } from '../utils/text-i import { isArray, isValid } from '@visactor/vutils'; import { breakString } from '../utils/break-string'; import type { CreateRadioCellGroup } from './cell-type/radio-cell'; -import { onBeforeAttributeUpdateForInvertHighlight } from '@visactor/vtable-plugins'; +import { onBeforeAttributeUpdateForInvertHighlight } from '../../plugins/invert-highlight'; export function createCell( type: ColumnTypeOption, diff --git a/packages/vtable/src/ts-types/base-table.ts b/packages/vtable/src/ts-types/base-table.ts index b7bf04d07..3b38b5537 100644 --- a/packages/vtable/src/ts-types/base-table.ts +++ b/packages/vtable/src/ts-types/base-table.ts @@ -97,12 +97,12 @@ import type { NumberRangeMap } from '../layout/row-height-map'; import type { RowSeriesNumberHelper } from '../core/row-series-number-helper'; import type { ReactCustomLayout } from '../components/react/react-custom-layout'; import type { ISortedMapItem } from '../data/DataSource'; -import type { IAnimationAppear } from './animation/appear'; +import type { IAnimationAppear, ITableAnimationOption } from './animation/appear'; import type { IEmptyTip } from './component/empty-tip'; import type { EmptyTip } from '../components/empty-tip/empty-tip'; -import type { ICustomCellStylePlugin } from '@visactor/vtable-plugins'; import type { EditManeger } from '../edit/edit-manager'; -import type { ITableAnimationOption, TableAnimationManager } from '../core/animation'; +import type { TableAnimationManager } from '../core/animation'; +import type { CustomCellStylePlugin } from '../plugins/custom-cell-style'; export interface IBaseTableProtected { element: HTMLElement; @@ -643,6 +643,7 @@ export interface BaseTableAPI { _rowRangeHeightsMap: Map; _colRangeWidthsMap: Map; canvasSizeSeted?: boolean; + /** 获取表格绘制的范围 不包括frame的宽度 */ getDrawRange: () => Rect; /** 将鼠标坐标值 转换成表格坐标系中的坐标位置 */ @@ -924,7 +925,7 @@ export interface BaseTableAPI { /** 开启表格的滚动 */ enableScroll: () => void; - customCellStylePlugin: ICustomCellStylePlugin; + customCellStylePlugin?: CustomCellStylePlugin; headerStyleCache: Map; bodyBottomStyleCache: Map; bodyStyleCache: Map; From 3a87938e8f5a863d1a950dc2b3cbe28ee3c3537b Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 21:04:02 +0800 Subject: [PATCH 12/24] docs: change docs about vtable-plugins --- docs/assets/demo/en/animation/carousel-animation.md | 7 +++++-- docs/assets/demo/en/interaction/head-highlight.md | 8 ++++++-- docs/assets/demo/en/interaction/invert-highlight.md | 8 ++++++-- docs/assets/demo/zh/animation/carousel-animation.md | 7 +++++-- docs/assets/demo/zh/interaction/head-highlight.md | 8 ++++++-- docs/assets/demo/zh/interaction/invert-highlight.md | 8 ++++++-- docs/assets/guide/en/animation/carousel_animation.md | 4 ++-- docs/assets/guide/en/plugin/header-highlight.md | 4 ++-- docs/assets/guide/en/plugin/invert-highlight.md | 4 ++-- docs/assets/guide/zh/animation/carousel_animation.md | 4 ++-- docs/assets/guide/zh/plugin/header-highlight.md | 4 ++-- docs/assets/guide/zh/plugin/invert-highlight.md | 4 ++-- docs/src/main.tsx | 2 ++ 13 files changed, 48 insertions(+), 24 deletions(-) diff --git a/docs/assets/demo/en/animation/carousel-animation.md b/docs/assets/demo/en/animation/carousel-animation.md index 35eacb17e..0e85b6bb7 100644 --- a/docs/assets/demo/en/animation/carousel-animation.md +++ b/docs/assets/demo/en/animation/carousel-animation.md @@ -12,7 +12,7 @@ Carousel animation in VTable ## Key configuration -- `VTable.CarouselAnimationPlugin` carousel animation plugin +- `CarouselAnimationPlugin` carousel animation plugin - `rowCount` scroll row count in a carousel animation - `colCount` scroll column count in a carousel animation - `animationDuration` The duration of a single carousel animation, in milliseconds @@ -23,6 +23,9 @@ Carousel animation in VTable ## Code demonstration ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; let tableInstance; fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_data100.json') @@ -95,7 +98,7 @@ const option = { tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const ca = new VTable.CarouselAnimationPlugin(tableInstance, { +const ca = new VTablePlugins.CarouselAnimationPlugin(tableInstance, { rowCount: 2, replaceScrollAction: true }); diff --git a/docs/assets/demo/en/interaction/head-highlight.md b/docs/assets/demo/en/interaction/head-highlight.md index 6aeac93ab..f6151cc1c 100644 --- a/docs/assets/demo/en/interaction/head-highlight.md +++ b/docs/assets/demo/en/interaction/head-highlight.md @@ -12,7 +12,7 @@ Highlight the header when selecting the cell. ## Key Configurations -- `VTable.HeaderHighlightPlugin` highlight plugin +- `HeaderHighlightPlugin` highlight plugin - `columnHighlight` whether highlight the column - `rowHighlight` whether highlight the row - `colHighlightBGColor` the background color of the column highlight @@ -23,6 +23,10 @@ Highlight the header when selecting the cell. ## Code demo ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; + const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ id: i + 1, @@ -95,6 +99,6 @@ const option = { const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance, {}); +const highlightPlugin = new VTablePlugins.HeaderHighlightPlugin(tableInstance, {}); ``` diff --git a/docs/assets/demo/en/interaction/invert-highlight.md b/docs/assets/demo/en/interaction/invert-highlight.md index 25a918fae..d9edfca36 100644 --- a/docs/assets/demo/en/interaction/invert-highlight.md +++ b/docs/assets/demo/en/interaction/invert-highlight.md @@ -12,7 +12,7 @@ Show the highlight effect when set highlight range. ## Key Configurations -- `VTable.InvertHighlightPlugin` invert highlight plugin +- `InvertHighlightPlugin` invert highlight plugin - `fill` invert highlight background color - `opacity` invert highlight opacity - `setInvertHighlightRange` set highlight range @@ -20,6 +20,10 @@ Show the highlight effect when set highlight range. ## Code demo ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; + const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ id: i + 1, @@ -92,7 +96,7 @@ const option = { const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance, {}); +const highlightPlugin = new VTablePlugins.InvertHighlightPlugin(tableInstance, {}); highlightPlugin.setInvertHighlightRange({ start: { diff --git a/docs/assets/demo/zh/animation/carousel-animation.md b/docs/assets/demo/zh/animation/carousel-animation.md index ad853e419..aba46b3a1 100644 --- a/docs/assets/demo/zh/animation/carousel-animation.md +++ b/docs/assets/demo/zh/animation/carousel-animation.md @@ -12,7 +12,7 @@ link: '../guide/animation/carousel_animation' ## 关键配置 -- `VTable.CarouselAnimationPlugin` 轮播动画插件 +- `CarouselAnimationPlugin` 轮播动画插件 - `rowCount` 一次动画滚动的行数 - `colCount` 一次动画滚动的列数 - `animationDuration` 一次滚动动画的时间 @@ -23,6 +23,9 @@ link: '../guide/animation/carousel_animation' ## 代码演示 ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; let tableInstance; fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_data100.json') @@ -95,7 +98,7 @@ const option = { tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const ca = new VTable.CarouselAnimationPlugin(tableInstance, { +const ca = new VTablePlugins.CarouselAnimationPlugin(tableInstance, { rowCount: 2, replaceScrollAction: true }); diff --git a/docs/assets/demo/zh/interaction/head-highlight.md b/docs/assets/demo/zh/interaction/head-highlight.md index ad6dfe65a..78288cbdd 100644 --- a/docs/assets/demo/zh/interaction/head-highlight.md +++ b/docs/assets/demo/zh/interaction/head-highlight.md @@ -12,7 +12,7 @@ link: '../guide/plugin/header-highlight' ## 关键配置 -- `VTable.HeaderHighlightPlugin` 高亮表头插件 +- `HeaderHighlightPlugin` 高亮表头插件 - `columnHighlight` 是否高亮列头 - `rowHighlight` 是否高亮行头 - `colHighlightBGColor` 列头高亮背景色 @@ -23,6 +23,10 @@ link: '../guide/plugin/header-highlight' ## 代码演示 ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; + const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ id: i + 1, @@ -95,6 +99,6 @@ const option = { const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance, {}); +const highlightPlugin = new VTablePlugins.HeaderHighlightPlugin(tableInstance, {}); ``` diff --git a/docs/assets/demo/zh/interaction/invert-highlight.md b/docs/assets/demo/zh/interaction/invert-highlight.md index eb8902f39..7b5508899 100644 --- a/docs/assets/demo/zh/interaction/invert-highlight.md +++ b/docs/assets/demo/zh/interaction/invert-highlight.md @@ -12,7 +12,7 @@ link: '../guide/plugin/invert-highlight' ## 关键配置 -- `VTable.InvertHighlightPlugin` 反选高亮插件 +- `InvertHighlightPlugin` 反选高亮插件 - `fill` 反选高亮背景色 - `opacity` 反选高亮透明度 - `setInvertHighlightRange` 设置反选高亮范围 @@ -20,6 +20,10 @@ link: '../guide/plugin/invert-highlight' ## 代码演示 ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; + const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ id: i + 1, @@ -92,7 +96,7 @@ const option = { const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance, {}); +const highlightPlugin = new VTablePlugins.InvertHighlightPlugin(tableInstance, {}); highlightPlugin.setInvertHighlightRange({ start: { diff --git a/docs/assets/guide/en/animation/carousel_animation.md b/docs/assets/guide/en/animation/carousel_animation.md index 9ae1533ae..796799d66 100644 --- a/docs/assets/guide/en/animation/carousel_animation.md +++ b/docs/assets/guide/en/animation/carousel_animation.md @@ -8,7 +8,7 @@ VTable provides carousel animation plugin, which can implement the carousel scro ## Carousel Animation Configuration -- `VTable.CarouselAnimationPlugin` carousel animation plugin, can configure the following parameters: +- `CarouselAnimationPlugin` carousel animation plugin, can configure the following parameters: - `rowCount` scroll row count in a carousel animation - `colCount` scroll column count in a carousel animation - `animationDuration` The duration of a single carousel animation, in milliseconds @@ -17,7 +17,7 @@ VTable provides carousel animation plugin, which can implement the carousel scro - `replaceScrollAction` Whether to replace the scroll action, if true, the scroll action will be replaced by the carousel animation ```js -const carouselAnimationPlugin = new VTable.CarouselAnimationPlugin(tableInstance, { +const carouselAnimationPlugin = new CarouselAnimationPlugin(tableInstance, { rowCount: 2, replaceScrollAction: true }); diff --git a/docs/assets/guide/en/plugin/header-highlight.md b/docs/assets/guide/en/plugin/header-highlight.md index 550b6e2de..4e73715f3 100644 --- a/docs/assets/guide/en/plugin/header-highlight.md +++ b/docs/assets/guide/en/plugin/header-highlight.md @@ -8,7 +8,7 @@ VTable provides Header Highlight plugin, which can highlight the corresponding h ## Header Highlight Plugin Configuration -- `VTable.HeaderHighlightPlugin` Header Highlight, can configure the following parameters: +- `HeaderHighlightPlugin` Header Highlight, can configure the following parameters: - `columnHighlight` whether highlight the column - `rowHighlight` whether highlight the row - `colHighlightBGColor` the background color of the column highlight @@ -17,7 +17,7 @@ VTable provides Header Highlight plugin, which can highlight the corresponding h - `rowHighlightColor` the color of the row highlight ```js -const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance, {}); +const highlightPlugin = new HeaderHighlightPlugin(tableInstance, {}); ``` For specific usage, please refer to [demo](../../demo/interaction/head-highlight) diff --git a/docs/assets/guide/en/plugin/invert-highlight.md b/docs/assets/guide/en/plugin/invert-highlight.md index 6fc59ad1e..6b26c31a0 100644 --- a/docs/assets/guide/en/plugin/invert-highlight.md +++ b/docs/assets/guide/en/plugin/invert-highlight.md @@ -8,13 +8,13 @@ VTable provides Invert Highlight plugin, which can highlight the specified area ## Invert Highlight Plugin Configuration -- `VTable.InvertHighlightPlugin` Invert Highlight Plugin, can configure the following parameters: +- `InvertHighlightPlugin` Invert Highlight Plugin, can configure the following parameters: - `fill` invert highlight background color - `opacity` invert highlight opacity - `setInvertHighlightRange` set highlight range ```js -const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance, {}); +const highlightPlugin = new InvertHighlightPlugin(tableInstance, {}); highlightPlugin.setInvertHighlightRange({ start: { diff --git a/docs/assets/guide/zh/animation/carousel_animation.md b/docs/assets/guide/zh/animation/carousel_animation.md index 9d3252998..4d3aa22fb 100644 --- a/docs/assets/guide/zh/animation/carousel_animation.md +++ b/docs/assets/guide/zh/animation/carousel_animation.md @@ -8,7 +8,7 @@ VTable 提供轮播动画插件,可以实现表格的轮播滚动动画效果 ## 轮播动画配置项 -- `VTable.CarouselAnimationPlugin` 轮播动画插件,可以配置以下参数: +- `CarouselAnimationPlugin` 轮播动画插件,可以配置以下参数: - `rowCount` 一次动画滚动的行数 - `colCount` 一次动画滚动的列数 - `animationDuration` 一次滚动动画的时间 @@ -17,7 +17,7 @@ VTable 提供轮播动画插件,可以实现表格的轮播滚动动画效果 - `replaceScrollAction` 是否替换滚动行为,如果为 true ,每次滚动操作会移动对于的行数/列数 ```js -const carouselAnimationPlugin = new VTable.CarouselAnimationPlugin(tableInstance, { +const carouselAnimationPlugin = new CarouselAnimationPlugin(tableInstance, { rowCount: 2, replaceScrollAction: true }); diff --git a/docs/assets/guide/zh/plugin/header-highlight.md b/docs/assets/guide/zh/plugin/header-highlight.md index 29652ab54..a01781045 100644 --- a/docs/assets/guide/zh/plugin/header-highlight.md +++ b/docs/assets/guide/zh/plugin/header-highlight.md @@ -8,7 +8,7 @@ VTable 提供表头高亮插件,支持选中单元格后,高亮对应的表 ## 表头高亮插件配置项 -- `VTable.HeaderHighlightPlugin` 表头高亮插件,可以配置以下参数: +- `HeaderHighlightPlugin` 表头高亮插件,可以配置以下参数: - `columnHighlight` 是否高亮列头 - `rowHighlight` 是否高亮行头 - `colHighlightBGColor` 列头高亮背景色 @@ -17,7 +17,7 @@ VTable 提供表头高亮插件,支持选中单元格后,高亮对应的表 - `rowHighlightColor` 行头高亮字体色 ```js -const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance, {}); +const highlightPlugin = new HeaderHighlightPlugin(tableInstance, {}); ``` 具体使用参考[demo](../../demo/interaction/head-highlight) diff --git a/docs/assets/guide/zh/plugin/invert-highlight.md b/docs/assets/guide/zh/plugin/invert-highlight.md index fa30fd2bd..1be1fee5b 100644 --- a/docs/assets/guide/zh/plugin/invert-highlight.md +++ b/docs/assets/guide/zh/plugin/invert-highlight.md @@ -8,12 +8,12 @@ VTable 提供反选高亮插件,支持反选高亮指定区域。 ## 反选高亮插件配置项 -- `VTable.InvertHighlightPlugin` 反选高亮插件,可以配置以下参数: +- `InvertHighlightPlugin` 反选高亮插件,可以配置以下参数: - `fill` 反选高亮背景色 - `opacity` 反选高亮透明度 ```js -const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance, {}); +const highlightPlugin = new InvertHighlightPlugin(tableInstance, {}); highlightPlugin.setInvertHighlightRange({ start: { diff --git a/docs/src/main.tsx b/docs/src/main.tsx index f431fdf07..8a0817842 100644 --- a/docs/src/main.tsx +++ b/docs/src/main.tsx @@ -12,6 +12,7 @@ import { SearchComponent } from '@visactor/vtable-search'; import * as ReactVTable from '@visactor/react-vtable'; import * as VueVTable from '@visactor/vue-vtable'; import * as InulaVTable from '@visactor/openinula-vtable'; +import * as VTablePlugins from '@visactor/vtable-plugins'; import { App } from './app'; import * as ArcoDesign from '@arco-design/web-react'; import * as ArcoDesignVue from '@arco-design/web-vue'; @@ -28,6 +29,7 @@ import { createApp, ref, onMounted, h } from 'vue'; (window as any).VTableGantt = VTableGantt; (window as any).VTableCalendar = VTableCalendar; (window as any).VTable_editors = VTableEditors; +(window as any).VTablePlugins = VTablePlugins; (window as any).VChart = VChart.VChart; (window as any).downloadCsv = downloadCsv; From 9581700a581f1c4946a91f5653c60ef21eb04084 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Fri, 29 Nov 2024 14:18:08 +0800 Subject: [PATCH 13/24] fix: parseColumnWidthConfig occor error when argument is error --- packages/vtable/src/PivotTable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vtable/src/PivotTable.ts b/packages/vtable/src/PivotTable.ts index 431e54cf1..6c6d0c9bc 100644 --- a/packages/vtable/src/PivotTable.ts +++ b/packages/vtable/src/PivotTable.ts @@ -1112,7 +1112,7 @@ export class PivotTable extends BaseTable implements PivotTableAPI { const dimensions = item.dimensions; const width = item.width; const cell = this.getCellAddressByHeaderPaths(dimensions); - if (cell.col >= this.rowHeaderLevelCount) { + if (cell && cell.col >= this.rowHeaderLevelCount) { const cellPath = this.getCellHeaderPaths(cell.col, this.columnHeaderLevelCount); //如单指标隐藏指标情况,从body行去取headerPath才会包括指标维度 if (cellPath.colHeaderPaths.length === dimensions.length) { let match = true; From 9ddbf890c3f1cc166d1fdec555d53e2d1802e70a Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Fri, 29 Nov 2024 14:42:34 +0800 Subject: [PATCH 14/24] chore: add rush change --- .../vtable/feat-vtable-plugins_2024-11-29-06-41.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json diff --git a/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json b/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json new file mode 100644 index 000000000..b1fbf7450 --- /dev/null +++ b/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vtable", + "comment": "feat: add @visactor/vtable-plugins package", + "type": "none" + } + ], + "packageName": "@visactor/vtable" +} \ No newline at end of file From df5a2a4e3fa9e3f33866a53a0ed676a5ecb56edb Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Fri, 29 Nov 2024 14:46:19 +0800 Subject: [PATCH 15/24] docs: fix gantt api tutorial error --- docs/assets/api/en/GanttAPI.md | 4 ++-- docs/assets/api/zh/GanttAPI.md | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/assets/api/en/GanttAPI.md b/docs/assets/api/en/GanttAPI.md index 233695a55..43d360b99 100644 --- a/docs/assets/api/en/GanttAPI.md +++ b/docs/assets/api/en/GanttAPI.md @@ -62,12 +62,12 @@ Add Dependencies addLink: (link: ITaskLink) => void ``` -### removeLink(Function) +### deleteLink(Function) Removing Dependencies ``` -removeLink: (link: ITaskLink) => void +deleteLink: (link: ITaskLink) => void ``` diff --git a/docs/assets/api/zh/GanttAPI.md b/docs/assets/api/zh/GanttAPI.md index 5b1ee373c..e6694bd65 100644 --- a/docs/assets/api/zh/GanttAPI.md +++ b/docs/assets/api/zh/GanttAPI.md @@ -62,12 +62,12 @@ addLink: (link: ITaskLink) => void ``` -### removeLink(Function) +### deleteLink(Function) 删除依赖关系 ``` - removeLink: (link: ITaskLink) => void + deleteLink: (link: ITaskLink) => void ``` @@ -189,8 +189,7 @@ export interface EVENT_TYPES { } ``` -MOUSEENTER_TASK_BAR -MOUSEENTER_TASK_BAR +### MOUSEENTER_TASK_BAR 鼠标移入任务条事件 From 37d4e384c3efae8f4ab4af7911dfd99ef47c27eb Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Wed, 27 Nov 2024 11:28:27 +0800 Subject: [PATCH 16/24] feat: add @visactor/vtable-plugins --- common/config/rush/pnpm-lock.yaml | 342 +++++++----- packages/vtable-plugins/.eslintrc.js | 273 ++++++++++ packages/vtable-plugins/README.md | 59 ++ packages/vtable-plugins/bundler.config.js | 17 + packages/vtable-plugins/demo/index.html | 36 ++ packages/vtable-plugins/demo/list/list.ts | 120 +++++ packages/vtable-plugins/demo/main.ts | 164 ++++++ packages/vtable-plugins/demo/menu.ts | 20 + .../vtable-plugins/demo/pivot/pivot-basic.ts | 510 ++++++++++++++++++ packages/vtable-plugins/demo/style.css | 100 ++++ packages/vtable-plugins/demo/vite.config.js | 37 ++ packages/vtable-plugins/package.json | 86 +++ packages/vtable-plugins/setup-mock.js | 2 + .../src}/carousel-animation.ts | 4 +- .../src}/custom-cell-style.ts | 13 +- .../src}/header-highlight.ts | 4 +- packages/vtable-plugins/src/index.ts | 5 + .../src}/invert-highlight.ts | 14 +- .../src}/list-tree-stick-cell.ts | 12 +- packages/vtable-plugins/tscofig.eslint.json | 25 + packages/vtable-plugins/tsconfig.json | 24 + packages/vtable-search/README.md | 2 +- packages/vtable/examples/vite.config.js | 1 + packages/vtable/jest.config.js | 6 +- packages/vtable/package.json | 3 +- packages/vtable/src/ListTable-all.ts | 3 +- packages/vtable/src/ListTable.ts | 2 +- packages/vtable/src/core/BaseTable.ts | 26 +- packages/vtable/src/core/style-helper.ts | 4 +- packages/vtable/src/index.ts | 17 +- .../scenegraph/group-creater/cell-helper.ts | 2 +- packages/vtable/src/ts-types/base-table.ts | 4 +- packages/vtable/tsconfig.eslint.json | 3 + rush.json | 9 + 34 files changed, 1781 insertions(+), 168 deletions(-) create mode 100644 packages/vtable-plugins/.eslintrc.js create mode 100644 packages/vtable-plugins/README.md create mode 100644 packages/vtable-plugins/bundler.config.js create mode 100644 packages/vtable-plugins/demo/index.html create mode 100644 packages/vtable-plugins/demo/list/list.ts create mode 100644 packages/vtable-plugins/demo/main.ts create mode 100644 packages/vtable-plugins/demo/menu.ts create mode 100644 packages/vtable-plugins/demo/pivot/pivot-basic.ts create mode 100644 packages/vtable-plugins/demo/style.css create mode 100644 packages/vtable-plugins/demo/vite.config.js create mode 100644 packages/vtable-plugins/package.json create mode 100644 packages/vtable-plugins/setup-mock.js rename packages/{vtable/src/plugins => vtable-plugins/src}/carousel-animation.ts (97%) rename packages/{vtable/src/plugins => vtable-plugins/src}/custom-cell-style.ts (93%) rename packages/{vtable/src/plugins => vtable-plugins/src}/header-highlight.ts (97%) create mode 100644 packages/vtable-plugins/src/index.ts rename packages/{vtable/src/plugins => vtable-plugins/src}/invert-highlight.ts (88%) rename packages/{vtable/src/plugins => vtable-plugins/src}/list-tree-stick-cell.ts (95%) create mode 100644 packages/vtable-plugins/tscofig.eslint.json create mode 100644 packages/vtable-plugins/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 42337abd7..3cd0bb131 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -59,7 +59,7 @@ importers: '@visactor/vue-vtable': link:../packages/vue-vtable '@visactor/vutils': 0.18.18 '@vue/compiler-dom': 3.5.13 - axios: 1.7.7 + axios: 1.7.8 buble: 0.20.0 highlight.js: 11.10.0 lodash: 4.17.21 @@ -143,10 +143,10 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@visactor/vchart': 1.12.12 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -165,12 +165,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/react-vtable: @@ -240,7 +240,7 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 @@ -248,7 +248,7 @@ importers: '@types/react-reconciler': 0.28.8 '@visactor/vchart': 1.12.12 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -268,12 +268,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable: @@ -299,6 +299,7 @@ importers: '@visactor/vrender-kits': 0.21.0-alpha.4 '@visactor/vscale': ~0.18.1 '@visactor/vtable-editors': workspace:* + '@visactor/vtable-plugins': workspace:* '@visactor/vutils': ~0.18.14 '@visactor/vutils-extension': ~1.11.5 '@vitejs/plugin-react': 3.1.0 @@ -345,6 +346,7 @@ importers: '@visactor/vrender-kits': 0.21.0-alpha.4 '@visactor/vscale': 0.18.18 '@visactor/vtable-editors': link:../vtable-editors + '@visactor/vtable-plugins': link:../vtable-plugins '@visactor/vutils': 0.18.18 '@visactor/vutils-extension': 1.11.14 cssfontparser: 1.2.1 @@ -360,13 +362,13 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@visactor/vchart': 1.12.12 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 d3-array: 3.2.3 d3-dsv: 3.0.1 @@ -393,12 +395,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable-calendar: @@ -463,13 +465,13 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@types/react-is': 17.0.7 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -490,12 +492,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable-editors: @@ -527,7 +529,7 @@ importers: '@internal/ts-config': link:../../share/ts-config '@rushstack/eslint-patch': 1.1.4 '@types/jest': 26.0.24 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 eslint: 8.18.0 husky: 7.0.4 @@ -538,11 +540,11 @@ importers: react-device-detect: 2.2.3 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 tslint: 5.12.1_typescript@4.9.5 typescript: 4.9.5 - vite: 3.2.6_@types+node@22.9.3 + vite: 3.2.6_@types+node@22.10.0 ../../packages/vtable-export: specifiers: @@ -611,14 +613,14 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@types/react-is': 17.0.7 '@visactor/vchart': 1.12.12 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -639,12 +641,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable-gantt: @@ -722,12 +724,12 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 d3-array: 3.2.3 d3-dsv: 3.0.1 @@ -754,12 +756,109 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 + vite-plugin-markdown: 2.2.0_vite@3.2.6 + + ../../packages/vtable-plugins: + specifiers: + '@babel/core': 7.20.12 + '@babel/preset-env': 7.20.2 + '@internal/bundler': workspace:* + '@internal/eslint-config': workspace:* + '@internal/ts-config': workspace:* + '@rushstack/eslint-patch': ~1.1.4 + '@types/chai': 4.2.22 + '@types/jest': ^26.0.0 + '@types/mocha': 9.0.0 + '@types/node': '*' + '@types/offscreencanvas': 2019.6.4 + '@types/react': ^18.0.0 + '@types/react-dom': ^18.0.0 + '@types/react-is': ^17.0.3 + '@visactor/vchart': 1.12.12 + '@visactor/vtable': workspace:* + '@visactor/vutils': ~0.18.14 + '@vitejs/plugin-react': 3.1.0 + axios: ^1.4.0 + chai: 4.3.4 + eslint: ~8.18.0 + form-data: ~4.0.0 + inversify: 6.0.1 + jest: ^26.0.0 + jest-electron: ^0.1.12 + jest-transform-stub: ^2.0.0 + json-formatter-js: ^2.3.4 + magic-string: ^0.25.7 + markdown-it: ^13.0.0 + mocha: 9.1.3 + node-fetch: 2.6.7 + postcss: 8.4.21 + react: ^18.0.0 + react-dom: ^18.0.0 + rimraf: 3.0.2 + rollup-plugin-node-resolve: 5.2.0 + sass: 1.43.5 + ts-jest: ^26.0.0 + ts-loader: 9.2.6 + ts-node: 10.9.0 + tslib: 2.3.1 + ttypescript: 1.5.13 + typescript: 4.9.5 + typescript-transform-paths: 3.3.1 + vite: 3.2.6 + vite-plugin-markdown: ^2.1.0 + dependencies: + '@visactor/vtable': link:../vtable + '@visactor/vutils': 0.18.18 + devDependencies: + '@babel/core': 7.20.12 + '@babel/preset-env': 7.20.2_@babel+core@7.20.12 + '@internal/bundler': link:../../tools/bundler + '@internal/eslint-config': link:../../share/eslint-config + '@internal/ts-config': link:../../share/ts-config + '@rushstack/eslint-patch': 1.1.4 + '@types/chai': 4.2.22 + '@types/jest': 26.0.24 + '@types/mocha': 9.0.0 + '@types/node': 22.10.0 + '@types/offscreencanvas': 2019.6.4 + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 + '@types/react-is': 17.0.7 + '@visactor/vchart': 1.12.12 + '@vitejs/plugin-react': 3.1.0_vite@3.2.6 + axios: 1.7.8 + chai: 4.3.4 + eslint: 8.18.0 + form-data: 4.0.1 + inversify: 6.0.1 + jest: 26.6.3_ts-node@10.9.0 + jest-electron: 0.1.12_jest@26.6.3 + jest-transform-stub: 2.0.0 + json-formatter-js: 2.5.18 + magic-string: 0.25.9 + markdown-it: 13.0.2 + mocha: 9.1.3 + node-fetch: 2.6.7 + postcss: 8.4.21 + react: 18.3.1 + react-dom: 18.3.1_react@18.3.1 + rimraf: 3.0.2 + rollup-plugin-node-resolve: 5.2.0 + sass: 1.43.5 + ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai + ts-loader: 9.2.6_typescript@4.9.5 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui + tslib: 2.3.1 + ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m + typescript: 4.9.5 + typescript-transform-paths: 3.3.1_typescript@4.9.5 + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vtable-search: @@ -823,14 +922,14 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@types/react': 18.3.12 '@types/react-dom': 18.3.1 '@types/react-is': 17.0.7 '@visactor/vchart': 1.12.12 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 - axios: 1.7.7 + axios: 1.7.8 chai: 4.3.4 eslint: 8.18.0 form-data: 4.0.1 @@ -851,12 +950,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 ../../packages/vue-vtable: @@ -920,11 +1019,11 @@ importers: '@types/chai': 4.2.22 '@types/jest': 26.0.24 '@types/mocha': 9.0.0 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/offscreencanvas': 2019.6.4 '@visactor/vchart': 1.12.12 - '@vitejs/plugin-vue': 5.2.0_vite@3.2.6+vue@3.5.13 - axios: 1.7.7 + '@vitejs/plugin-vue': 5.2.1_vite@3.2.6+vue@3.5.13 + axios: 1.7.8 chai: 4.3.4 cross-env: 7.0.3 eslint: 8.18.0 @@ -944,12 +1043,12 @@ importers: sass: 1.43.5 ts-jest: 26.5.6_xuote2qreek47x2di7kesslrai ts-loader: 9.2.6_typescript@4.9.5 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui tslib: 2.3.1 ttypescript: 1.5.13_fxi2xlggroal5l3a4znftvxz2m typescript: 4.9.5 typescript-transform-paths: 3.3.1_typescript@4.9.5 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vite-plugin-markdown: 2.2.0_vite@3.2.6 vue: 3.5.13_typescript@4.9.5 vue-eslint-parser: 9.4.3_eslint@8.18.0 @@ -1010,13 +1109,13 @@ importers: '@internal/eslint-config': link:../../share/eslint-config '@internal/ts-config': link:../../share/ts-config '@rushstack/eslint-patch': 1.1.4 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/node-fetch': 2.6.4 cross-env: 7.0.3 eslint: 8.18.0 form-data: 4.0.1 node-fetch: 2.6.7 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui typescript: 4.9.5 ../../tools/bundler: @@ -1118,7 +1217,7 @@ importers: '@rollup/plugin-typescript': 11.1.0_ivokygnvpraqsbyfg47pib5bri '@rollup/plugin-url': 8.0.1_rollup@3.20.5 '@trufflesuite/spinnies': 0.1.1 - '@vitejs/plugin-vue': 5.2.0 + '@vitejs/plugin-vue': 5.2.1 autoprefixer: 10.4.13_postcss@8.4.21 babel-plugin-import: 1.13.6 clean-css: 5.3.2 @@ -1165,7 +1264,7 @@ importers: '@types/merge2': 1.4.0 '@types/minimist': 1.2.2 '@types/ms': 0.7.31 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/semver': 7.3.12 '@types/terser': 3.12.0 '@types/through2': 2.0.38 @@ -1174,7 +1273,7 @@ importers: '@types/yargs-parser': 21.0.0 eslint: 8.18.0 rimraf: 3.0.2 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui typescript: 4.9.5 vitest: 0.30.1_less@4.1.3+terser@5.17.1 @@ -2660,7 +2759,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 chalk: 4.1.2 jest-message-util: 26.6.2 jest-util: 26.6.2 @@ -2676,7 +2775,7 @@ packages: '@jest/test-result': 26.6.2 '@jest/transform': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 ansi-escapes: 4.3.2 chalk: 4.1.2 exit: 0.1.2 @@ -2725,7 +2824,7 @@ packages: dependencies: '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 jest-mock: 26.6.2 dev: true @@ -2744,7 +2843,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@sinonjs/fake-timers': 6.0.1 - '@types/node': 22.9.3 + '@types/node': 22.10.0 jest-message-util: 26.6.2 jest-mock: 26.6.2 jest-util: 26.6.2 @@ -2921,7 +3020,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/yargs': 15.0.19 chalk: 4.1.2 dev: true @@ -3566,7 +3665,7 @@ packages: /@types/clean-css/4.2.6: resolution: {integrity: sha512-Ze1tf+LnGPmG6hBFMi0B4TEB0mhF7EiMM5oyjLDNPE9hxrPU0W+5+bHvO+eFPA+bt0iC1zkQMoU/iGdRVjcRbw==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 source-map: 0.6.1 dev: true @@ -3594,13 +3693,13 @@ packages: /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/glob-stream/8.0.2: resolution: {integrity: sha512-kyuRfGE+yiSJWzSO3t74rXxdZNdYfLcllO0IUha4eX1fl40pm9L02Q/TEc3mykTLjoWz4STBNwYnUWdFu3I0DA==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/picomatch': 3.0.1 '@types/streamx': 2.9.5 dev: true @@ -3608,19 +3707,19 @@ packages: /@types/glob-watcher/5.0.2: resolution: {integrity: sha512-MZeh2nIzibl/euv5UV0femkGzcKTSE4G2+zv48d6ymeitWwCx52+4X+FqzML9oH2mQnPs+N/JHp3CsBPj1x1Ug==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/graceful-fs/4.1.9: resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/gulp-if/0.0.34: resolution: {integrity: sha512-r2A04hHDC+ZWMRAm+3q6/UeC3ggvl+TZm9P1+2umnp4q9bOlBmUQnR178Io3c0DkZPQAwup8VNtOvmvaWCpP5w==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/vinyl': 2.0.7 dev: true @@ -3634,7 +3733,7 @@ packages: /@types/gulp-sourcemaps/0.0.35: resolution: {integrity: sha512-vUBuizwA4CAV3Mke0DJYHQxyN4YOB1aAql284qAO7Et7fe0hmnPi/R9Fhu2UhxMuSxAwFktsJUOQk5dJHOU1eA==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/vinyl': 2.0.7 dev: true @@ -3710,7 +3809,7 @@ packages: /@types/merge2/1.4.0: resolution: {integrity: sha512-MRHDvln2ldZELrUC8n1PGaQzZ33aNh8uDcsGehREW0zR1Fr818a4/JTZjO9eloHPPxnpUp8fz/YFTRc5CWm7Xw==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/minimatch/5.1.2: @@ -3732,7 +3831,7 @@ packages: /@types/node-fetch/2.6.4: resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 form-data: 3.0.2 dev: true @@ -3744,10 +3843,10 @@ packages: resolution: {integrity: sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==} dev: false - /@types/node/22.9.3: - resolution: {integrity: sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==} + /@types/node/22.10.0: + resolution: {integrity: sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==} dependencies: - undici-types: 6.19.8 + undici-types: 6.20.0 /@types/normalize-package-data/2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -3803,7 +3902,7 @@ packages: /@types/resolve/0.0.8: resolution: {integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/resolve/1.20.2: @@ -3829,7 +3928,7 @@ packages: /@types/streamx/2.9.5: resolution: {integrity: sha512-IHYsa6jYrck8VEdSwpY141FTTf6D7boPeMq9jy4qazNrFMA4VbRz/sw5LSsfR7jwdDcx0QKWkUexZvsWBC2eIQ==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/terser/3.12.0: @@ -3842,7 +3941,7 @@ packages: /@types/through2/2.0.38: resolution: {integrity: sha512-YFu+nHmjxMurkH1BSzA0Z1WrKDAY8jUKPZctNQn7mc+/KKtp2XxnclHFXxdB1m7Iqnzb5aywgP8TMK283LezGQ==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /@types/undertaker-registry/1.0.4: @@ -3852,7 +3951,7 @@ packages: /@types/undertaker/1.2.8: resolution: {integrity: sha512-gW3PRqCHYpo45XFQHJBhch7L6hytPsIe0QeLujlnFsjHPnXLhJcPdN6a9368d7aIQgH2I/dUTPFBlGeSNA3qOg==} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/undertaker-registry': 1.0.4 async-done: 1.3.2 dev: true @@ -3861,7 +3960,7 @@ packages: resolution: {integrity: sha512-ckYz9giHgV6U10RFuf9WsDQ3X86EFougapxHmmoxLK7e6ICQqO8CE+4V/3lBN148V5N1pb4nQMmMjyScleVsig==} dependencies: '@types/glob-stream': 8.0.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/vinyl': 2.0.7 dev: true @@ -3869,7 +3968,7 @@ packages: resolution: {integrity: sha512-4UqPv+2567NhMQuMLdKAyK4yzrfCqwaTt6bLhHEs8PFcxbHILsrxaY63n4wgE/BRLDWDQeI+WcTmkXKExh9hQg==} dependencies: '@types/expect': 1.20.4 - '@types/node': 22.9.3 + '@types/node': 22.10.0 /@types/yargs-parser/21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} @@ -4224,22 +4323,22 @@ packages: - supports-color dev: true - /@vitejs/plugin-vue/5.2.0: - resolution: {integrity: sha512-7n7KdUEtx/7Yl7I/WVAMZ1bEb0eVvXF3ummWTeLcs/9gvo9pJhuLdouSXGjdZ/MKD1acf1I272+X0RMua4/R3g==} + /@vitejs/plugin-vue/5.2.1: + resolution: {integrity: sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: ^5.0.0 + vite: ^5.0.0 || ^6.0.0 vue: ^3.2.25 dev: false - /@vitejs/plugin-vue/5.2.0_vite@3.2.6+vue@3.5.13: - resolution: {integrity: sha512-7n7KdUEtx/7Yl7I/WVAMZ1bEb0eVvXF3ummWTeLcs/9gvo9pJhuLdouSXGjdZ/MKD1acf1I272+X0RMua4/R3g==} + /@vitejs/plugin-vue/5.2.1_vite@3.2.6+vue@3.5.13: + resolution: {integrity: sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: ^5.0.0 + vite: ^5.0.0 || ^6.0.0 vue: ^3.2.25 dependencies: - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 vue: 3.5.13_typescript@4.9.5 dev: true @@ -4263,7 +4362,7 @@ packages: /@vitest/snapshot/0.30.1: resolution: {integrity: sha512-fJZqKrE99zo27uoZA/azgWyWbFvM1rw2APS05yB0JaLwUIg9aUtvvnBf4q7JWhEcAHmSwbrxKFgyBUga6tq9Tw==} dependencies: - magic-string: 0.30.13 + magic-string: 0.30.14 pathe: 1.1.2 pretty-format: 27.5.1 dev: true @@ -4306,7 +4405,7 @@ packages: '@vue/compiler-ssr': 3.5.13 '@vue/shared': 3.5.13 estree-walker: 2.0.2 - magic-string: 0.30.13 + magic-string: 0.30.14 postcss: 8.4.49 source-map-js: 1.2.1 @@ -4881,8 +4980,8 @@ packages: resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==} dev: true - /axios/1.7.7: - resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} + /axios/1.7.8: + resolution: {integrity: sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==} dependencies: follow-redirects: 1.15.9 form-data: 4.0.1 @@ -5220,7 +5319,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001684 - electron-to-chromium: 1.5.64 + electron-to-chromium: 1.5.65 node-releases: 2.0.18 update-browserslist-db: 1.1.1_browserslist@4.24.2 @@ -6438,8 +6537,8 @@ packages: safer-buffer: 2.1.2 dev: true - /electron-to-chromium/1.5.64: - resolution: {integrity: sha512-IXEuxU+5ClW2IGEYFC2T7szbyVgehupCWQe5GNh+H065CD6U6IFN0s4KeAMFGNmQolRU4IV7zGBWSYMmZ8uuqQ==} + /electron-to-chromium/1.5.65: + resolution: {integrity: sha512-PWVzBjghx7/wop6n22vS2MLU8tKGd4Q91aCEGhG/TYmW6PP5OcSXcdnxTe1NNt0T66N8D6jxh4kC8UsdzOGaIw==} /electron/11.5.0: resolution: {integrity: sha512-WjNDd6lGpxyiNjE3LhnFCAk/D9GIj1rU3GSDealVShhkkkPR3Vh4q8ErXGDl1OAO/faomVa10KoFPUN/pLbNxg==} @@ -8023,7 +8122,7 @@ packages: resolution: {integrity: sha512-SVSF7ikuWKhpAW4l4wapAqPPSToJoiNKsbDoUnRrSgwZHH7lH8pbPeQj1aOVYQrbZKhfSVBxVW+Py7vtulRktw==} engines: {node: '>=10'} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@types/vinyl': 2.0.7 istextorbinary: 3.3.0 replacestream: 4.0.3 @@ -8962,7 +9061,7 @@ packages: jest-validate: 26.6.2 micromatch: 4.0.8 pretty-format: 26.6.2 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui transitivePeerDependencies: - bufferutil - canvas @@ -9067,7 +9166,7 @@ packages: '@jest/environment': 26.6.2 '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 jest-mock: 26.6.2 jest-util: 26.6.2 jsdom: 16.7.0 @@ -9098,7 +9197,7 @@ packages: '@jest/environment': 26.6.2 '@jest/fake-timers': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 jest-mock: 26.6.2 jest-util: 26.6.2 dev: true @@ -9138,7 +9237,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@types/graceful-fs': 4.1.9 - '@types/node': 22.9.3 + '@types/node': 22.10.0 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -9186,7 +9285,7 @@ packages: '@jest/source-map': 26.6.2 '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 chalk: 4.1.2 co: 4.6.0 expect: 26.6.2 @@ -9284,7 +9383,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 dev: true /jest-pnp-resolver/1.2.3_jest-resolve@24.9.0: @@ -9390,7 +9489,7 @@ packages: '@jest/environment': 26.6.2 '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 chalk: 4.1.2 emittery: 0.7.2 exit: 0.1.2 @@ -9531,7 +9630,7 @@ packages: resolution: {integrity: sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==} engines: {node: '>= 10.14.2'} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 graceful-fs: 4.2.11 dev: true @@ -9603,7 +9702,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 chalk: 4.1.2 graceful-fs: 4.2.11 is-ci: 2.0.0 @@ -9640,7 +9739,7 @@ packages: dependencies: '@jest/test-result': 26.6.2 '@jest/types': 26.6.2 - '@types/node': 22.9.3 + '@types/node': 22.10.0 ansi-escapes: 4.3.2 chalk: 4.1.2 jest-util: 26.6.2 @@ -9659,7 +9758,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -10288,8 +10387,8 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 - /magic-string/0.30.13: - resolution: {integrity: sha512-8rYBO+MsWkgjDSOvLomYnzhdwEG51olQ4zL5KXnNJWV5MNmrb4rTZdrtkhxjnD/QyZUqR/Z/XDsUs/4ej2nx0g==} + /magic-string/0.30.14: + resolution: {integrity: sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==} dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -10589,8 +10688,8 @@ packages: hasBin: true dev: true - /nanoid/3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + /nanoid/3.3.8: + resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -11376,7 +11475,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.21 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui yaml: 1.10.2 dev: false @@ -11680,7 +11779,7 @@ packages: resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.7 + nanoid: 3.3.8 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -11688,7 +11787,7 @@ packages: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.7 + nanoid: 3.3.8 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -13529,7 +13628,7 @@ packages: mkdirp: 1.0.4 semver: 7.3.4 typescript: 4.9.5 - yargs-parser: 20.2.9 + yargs-parser: 20.2.4 dev: true /ts-loader/9.2.6_typescript@4.9.5: @@ -13546,7 +13645,7 @@ packages: typescript: 4.9.5 dev: true - /ts-node/10.9.0_oi3tcmo2siqwex47lqfbz2rfz4: + /ts-node/10.9.0_gvyh6auciohtph3635nyjnikui: resolution: {integrity: sha512-bunW18GUyaCSYRev4DPf4SQpom3pWH29wKl0sDk5zE7ze19RImEVhCW7K4v3hHKkUyfWotU08ToE2RS+Y49aug==} hasBin: true peerDependencies: @@ -13565,7 +13664,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.9.3 + '@types/node': 22.10.0 acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 @@ -13635,7 +13734,7 @@ packages: typescript: '>=3.2.2' dependencies: resolve: 1.22.8 - ts-node: 10.9.0_oi3tcmo2siqwex47lqfbz2rfz4 + ts-node: 10.9.0_gvyh6auciohtph3635nyjnikui typescript: 4.9.5 dev: true @@ -13820,8 +13919,8 @@ packages: undertaker-registry: 1.0.1 dev: false - /undici-types/6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + /undici-types/6.20.0: + resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} /unicode-canonical-property-names-ecmascript/1.0.4: resolution: {integrity: sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==} @@ -14103,7 +14202,7 @@ packages: replace-ext: 1.0.1 dev: false - /vite-node/0.30.1_ilu4heox2xruf77sidg3lidnqi: + /vite-node/0.30.1_bynzxunm26yds2qzned2henjoq: resolution: {integrity: sha512-vTikpU/J7e6LU/8iM3dzBo8ZhEiKZEKRznEMm+mJh95XhWaPrJQraT/QsT2NWmuEf+zgAoMe64PKT7hfZ1Njmg==} engines: {node: '>=v14.18.0'} hasBin: true @@ -14113,7 +14212,7 @@ packages: mlly: 1.7.3 pathe: 1.1.2 picocolors: 1.1.1 - vite: 3.2.6_ilu4heox2xruf77sidg3lidnqi + vite: 3.2.6_bynzxunm26yds2qzned2henjoq transitivePeerDependencies: - '@types/node' - less @@ -14133,7 +14232,7 @@ packages: front-matter: 4.0.2 htmlparser2: 6.1.0 markdown-it: 12.3.2 - vite: 3.2.6_bllobutr3eoehqzbz4ic735l7m + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 dev: true /vite/3.2.6: @@ -14169,7 +14268,7 @@ packages: fsevents: 2.3.3 dev: true - /vite/3.2.6_@types+node@22.9.3: + /vite/3.2.6_3fcrixghlk5j7efp7olgstdjb4: resolution: {integrity: sha512-nTXTxYVvaQNLoW5BQ8PNNQ3lPia57gzsQU/Khv+JvzKPku8kNZL6NMUR/qwXhMG6E+g1idqEPanomJ+VZgixEg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -14194,16 +14293,17 @@ packages: terser: optional: true dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 esbuild: 0.15.18 postcss: 8.4.21 resolve: 1.22.8 rollup: 2.79.2 + sass: 1.43.5 optionalDependencies: fsevents: 2.3.3 dev: true - /vite/3.2.6_bllobutr3eoehqzbz4ic735l7m: + /vite/3.2.6_@types+node@22.10.0: resolution: {integrity: sha512-nTXTxYVvaQNLoW5BQ8PNNQ3lPia57gzsQU/Khv+JvzKPku8kNZL6NMUR/qwXhMG6E+g1idqEPanomJ+VZgixEg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -14228,17 +14328,16 @@ packages: terser: optional: true dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 esbuild: 0.15.18 postcss: 8.4.21 resolve: 1.22.8 rollup: 2.79.2 - sass: 1.43.5 optionalDependencies: fsevents: 2.3.3 dev: true - /vite/3.2.6_ilu4heox2xruf77sidg3lidnqi: + /vite/3.2.6_bynzxunm26yds2qzned2henjoq: resolution: {integrity: sha512-nTXTxYVvaQNLoW5BQ8PNNQ3lPia57gzsQU/Khv+JvzKPku8kNZL6NMUR/qwXhMG6E+g1idqEPanomJ+VZgixEg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -14263,7 +14362,7 @@ packages: terser: optional: true dependencies: - '@types/node': 22.9.3 + '@types/node': 22.10.0 esbuild: 0.15.18 less: 4.1.3 postcss: 8.4.21 @@ -14307,7 +14406,7 @@ packages: dependencies: '@types/chai': 4.3.20 '@types/chai-subset': 1.3.5 - '@types/node': 22.9.3 + '@types/node': 22.10.0 '@vitest/expect': 0.30.1 '@vitest/runner': 0.30.1 '@vitest/snapshot': 0.30.1 @@ -14320,7 +14419,7 @@ packages: concordance: 5.0.4 debug: 4.3.4 local-pkg: 0.4.3 - magic-string: 0.30.13 + magic-string: 0.30.14 pathe: 1.1.2 picocolors: 1.1.1 source-map: 0.6.1 @@ -14328,8 +14427,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.9.0 tinypool: 0.4.0 - vite: 3.2.6_ilu4heox2xruf77sidg3lidnqi - vite-node: 0.30.1_ilu4heox2xruf77sidg3lidnqi + vite: 3.2.6_bynzxunm26yds2qzned2henjoq + vite-node: 0.30.1_bynzxunm26yds2qzned2henjoq why-is-node-running: 2.3.0 transitivePeerDependencies: - less @@ -14674,11 +14773,6 @@ packages: engines: {node: '>=10'} dev: true - /yargs-parser/20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - dev: true - /yargs-parser/21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -14742,7 +14836,7 @@ packages: require-directory: 2.1.1 string-width: 4.2.3 y18n: 5.0.8 - yargs-parser: 20.2.9 + yargs-parser: 20.2.4 dev: true /yargs/17.7.2: diff --git a/packages/vtable-plugins/.eslintrc.js b/packages/vtable-plugins/.eslintrc.js new file mode 100644 index 000000000..8023127bc --- /dev/null +++ b/packages/vtable-plugins/.eslintrc.js @@ -0,0 +1,273 @@ +/* eslint-disable no-undef */ +require('@rushstack/eslint-patch/modern-module-resolution'); + +module.exports = { + extends: ['@internal/eslint-config/profile/lib'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tscofig.eslint.json' + }, + env: { + browser: true, + es2021: true, + node: true, + jest: true + }, + globals: { + __DEV__: 'readonly', + __VERSION__: 'readonly', + NodeJS: true + }, + overrides: [ + { + files: ['**/__tests__/**', '**/*.test.ts'], + // 测试文件允许以下规则 + rules: { + '@typescript-eslint/no-empty-function': 'off', + 'no-console': 'off', + 'dot-notation': 'off' + } + } + ], + rules: { + 'prettier/prettier': ['warn'], + 'linebreak-style': [0, 'error', 'windows'], + // 强制换行时操作符在行首 + // 与prettier冲突 + // "operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }], + // 允许给能自动推断出类型的primitive类型变量额外添加类型声明 + '@typescript-eslint/no-inferrable-types': 'off', + // 在类型导入时推荐import type写法 + '@typescript-eslint/consistent-type-imports': 'warn', + // 禁止出现空接口定义 + '@typescript-eslint/no-empty-interface': 'error', + // 禁止出现空函数 + '@typescript-eslint/no-empty-function': 'error', + '@typescript-eslint/no-this-alias': 'off', + // 禁止使用namespace + '@typescript-eslint/no-namespace': 'error', + // 禁止使用for-in Array + '@typescript-eslint/no-for-in-array': 'error', + // 禁止在optional chain语句后加非空断言 + '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', + // 接口定义中使用函数属性而不是对象方法声明 + '@typescript-eslint/method-signature-style': 'error', + // 默认省略除属性以外的public修饰符 + '@typescript-eslint/explicit-member-accessibility': [ + 'warn', + { + overrides: { + accessors: 'off', + constructors: 'no-public', + methods: 'no-public', + properties: 'no-public', + parameterProperties: 'explicit' + } + } + ], + 'no-console': [ + 1, // 开发期间先关闭 + { + // allow: ["warn", "error"] + allow: ['warn', 'error'] + } + ], + // 如果一个变量不会被重新赋值,最好使用const进行声明 + 'prefer-const': 2, + // 禁止在条件中使用常量表达式 + 'no-constant-condition': 0, + 'no-debugger': 2, + // 禁止对象字面量中出现重复的 key + 'no-dupe-keys': 2, + // 禁止在正则表达式中使用空字符集 + 'no-empty-character-class': 2, + // 禁止对 catch 子句的参数重新赋值 + 'no-ex-assign': 2, + 'no-extra-boolean-cast': 0, + // 禁止对 function 声明重新赋值 + 'no-func-assign': 2, + // 禁止在嵌套的块中出现变量声明或 function 声明 + 'no-inner-declarations': 2, + // 禁止 RegExp 构造函数中存在无效的正则表达式字符串 + 'no-invalid-regexp': 2, + // 禁止对关系运算符的左操作数使用否定操作符 + 'no-unsafe-negation': 2, + // 禁止把全局对象作为函数调用 + 'no-obj-calls': 2, + // 禁用稀疏数组 + 'no-sparse-arrays': 2, + // 禁止在 return、throw、continue 和 break 语句之后出现不可达代码 + 'no-unreachable': 2, + // 要求使用 isNaN() 检查 NaN + 'use-isnan': 2, + // 强制 typeof 表达式与有效的字符串进行比较 + 'valid-typeof': 2, + // 要求使用 === 和 !==,除了与 null 字面量进行比较时 + eqeqeq: [ + 'error', + 'always', + { + null: 'ignore' + } + ], + // 允许 if 语句中 return 语句之后有 else 块 + 'no-else-return': 1, + // 禁用标签语句 + 'no-labels': [ + 2, + { + // 忽略循环语句中的标签 + allowLoop: true + } + ], + // 禁用 eval() + 'no-eval': 2, + // 禁止扩展原生类型 + 'no-extend-native': 2, + // 禁止不必要的 .bind() 调用 + 'no-extra-bind': 0, + // 禁止使用类似 eval() 的方法 + 'no-implied-eval': 2, + // 禁用 __iterator__ 属性 + 'no-iterator': 2, + // 禁止不规则的空白 + 'no-irregular-whitespace': 2, + // 禁用不必要的嵌套块 + 'no-lone-blocks': 2, + // 禁止循环中存在函数 + 'no-loop-func': 2, + // 禁止多行字符串 + 'no-multi-str': 2, + // 禁止对原生对象或只读的全局对象进行赋值 + 'no-global-assign': 2, + // 禁止对 String,Number 和 Boolean 使用 new 操作符 + 'no-new-wrappers': 2, + // 禁用八进制字面量 + 'no-octal': 2, + // 禁止在字符串中使用八进制转义序列 + 'no-octal-escape': 2, + // 禁用 __proto__ 属性 + 'no-proto': 2, + // 禁止自身比较 + 'no-self-compare': 2, + // 禁止可以在有更简单的可替代的表达式时使用三元操作符 + 'no-unneeded-ternary': 2, + // 禁用 with 语句 + 'no-with': 2, + // 强制在 parseInt() 使用基数参数 + radix: 2, + // 要求 IIFE 使用括号括起来 + 'wrap-iife': [2, 'any'], + // 禁止删除变量 + 'no-delete-var': 2, + // 禁止 function 定义中出现重名参数 + 'no-dupe-args': 2, + // 禁止出现重复的 case 标签 + 'no-duplicate-case': 2, + // 不允许标签与变量同名 + 'no-label-var': 2, + // 禁止将标识符定义为受限的名字 + 'no-shadow-restricted-names': 2, + // 禁用未声明的变量,除非它们在 /*global */ 注释中被提到 + 'no-undef': 2, + // 禁止将变量初始化为 undefined + 'no-undef-init': 2, + // 允许在变量定义之前使用它们 + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 0, + // 强制或禁止调用无参构造函数时有圆括号 + 'new-parens': 2, + // 禁用 Array 构造函数 + 'no-array-constructor': 2, + // 禁用 Object 的构造函数 + 'no-new-object': 2, + // 禁止不必要的括号 + 'no-extra-parens': [2, 'functions'], + // 禁止使用 空格 和 tab 混合缩进 + 'no-mixed-spaces-and-tabs': 2, + // 强制函数中的变量在分开声明 + 'one-var': [2, 'never'], + // 建议回调函数最大嵌套深度不超过5 + 'max-nested-callbacks': [1, 5], + // 建议可嵌套的块的最大深度不超过6 + 'max-depth': [1, 6], + // 强制一行的最大长度不超过120,不包括注释和url + 'max-len': [ + 'error', + { + code: 120, + ignoreUrls: true, + ignoreComments: true + } + ], + // 建议函数定义中最多允许的参数数量不超过15个 + 'max-params': [1, 15], + // 强制非一元操作符周围有空格 + 'space-infix-ops': 2, + // 强制尽可能地使用点号 + 'dot-notation': [ + 2, + { + // 避免对是保留字的属性使用点号 + allowKeywords: true, + allowPattern: '^catch$' + } + ], + // 强制箭头函数的箭头前后使用一致的空格 + 'arrow-spacing': 2, + // 要求在构造函数中有 super() 的调用 + 'constructor-super': 2, + // 禁止在可能与比较操作符相混淆的地方使用箭头函数 + // 与prettier冲突 + // "no-confusing-arrow": [ + // 2, + // { + // // 该规则不那么严格,将括号作为有效防止混淆的语法。 + // "allowParens": true + // } + // ], + // 禁止修改类声明的变量 + 'no-class-assign': 2, + // 禁止修改 const 声明的变量 + 'no-const-assign': 2, + // 允许在构造函数中,在调用 super() 之前使用 this 或 super + 'no-this-before-super': 0, + // 要求使用 let 或 const 而不是 var + 'no-var': 2, + // 重复模块导入 + // "no-duplicate-imports": 1, + '@typescript-eslint/no-duplicate-imports': 1, + // 建议使用剩余参数而不是 arguments + 'prefer-rest-params': 1, + // 禁止 Unicode 字节顺序标记 (BOM) + 'unicode-bom': 2, + // 强制每一行中所允许的最大语句数量为2 + 'max-statements-per-line': 2, + // 允许不必要的构造函数 + 'no-useless-constructor': 0, + // 允许在函数标识符和其调用之间有空格 + 'func-call-spacing': 'off', + '@typescript-eslint/func-call-spacing': 'error', + // 允许出现未使用过的变量 + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ + 1, + { + // 仅仅检测本作用域中声明的变量是否使用,允许不使用全局环境中的变量。 + vars: 'local', + // 不检查参数 + args: 'none' + } + ], + // 禁用特定的全局变量 + 'no-restricted-globals': [2, 'event', 'name', 'length', 'orientation', 'top', 'parent', 'location', 'closed'], + // 不允许省略大括号 + curly: 'error', + 'promise/catch-or-return': 'warn', + // indent: [1, 2], + 'no-multi-spaces': 1, + 'no-multiple-empty-lines': [1, { max: 1 }], + 'no-trailing-spaces': 1 + }, + ignorePatterns: ['*.config.ts'] +}; diff --git a/packages/vtable-plugins/README.md b/packages/vtable-plugins/README.md new file mode 100644 index 000000000..7dbd61280 --- /dev/null +++ b/packages/vtable-plugins/README.md @@ -0,0 +1,59 @@ + + +
+

VTable-Plugins

+
+ +
+ +VTable is not just a high-performance multidimensional data analysis table, but also a grid artist that creates art between rows and columns.React-VTable is a React wrapper of VTable. + +[![npm Version](https://img.shields.io/npm/v/@visactor/vtable.svg)](https://www.npmjs.com/package/@visactor/react-vtable) +[![npm Download](https://img.shields.io/npm/dm/@visactor/vtable.svg)](https://www.npmjs.com/package/@visactor/react-vvtable) +[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/visactor/vtable/blob/main/LICENSE) + +
+ +# Usage + +## Installation + +[npm package](https://www.npmjs.com/package/@visactor/vtable-search) + +```bash +// npm +npm install @visactor/vtable-plugins + +// yarn +yarn add @visactor/vtable-plugins +``` + +## + +[More demos and detailed tutorials](https://visactor.io/vtable) + +# Related Links + +- [Official website](https://visactor.io/vtable) + +# Ecosystem + +| Project | Description | +| ----------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| [AI-generated Components](https://visactor.io/ai-vtable) | AI-generated table component. | + +# Contribution + +If you would like to contribute, please read the [Code of Conduct ](./CODE_OF_CONDUCT.md) 和 [ Guide](./CONTRIBUTING.zh-CN.md) first。 + +Small streams converge to make great rivers and seas! + + + +# License + +[MIT License](./LICENSE) diff --git a/packages/vtable-plugins/bundler.config.js b/packages/vtable-plugins/bundler.config.js new file mode 100644 index 000000000..4b43455e1 --- /dev/null +++ b/packages/vtable-plugins/bundler.config.js @@ -0,0 +1,17 @@ +/** + * @type {Partial} + */ +const resolve = require('rollup-plugin-node-resolve'); + +module.exports = { + formats: ['cjs', 'es', 'umd'], + noEmitOnError: false, + copy: ['css'], + name: 'VTable.plugins', + umdOutputFilename: 'vtable-plugins', + rollupOptions: {}, + globals: { + '@visactor/vtable': 'VTable' + }, + external: ['@visactor/vtable'] +}; diff --git a/packages/vtable-plugins/demo/index.html b/packages/vtable-plugins/demo/index.html new file mode 100644 index 000000000..922a54969 --- /dev/null +++ b/packages/vtable-plugins/demo/index.html @@ -0,0 +1,36 @@ + + + + + + + + + + VTable demos + + + +
+ +
+
+ + 0/0 + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/packages/vtable-plugins/demo/list/list.ts b/packages/vtable-plugins/demo/list/list.ts new file mode 100644 index 000000000..3d4cf978f --- /dev/null +++ b/packages/vtable-plugins/demo/list/list.ts @@ -0,0 +1,120 @@ +import * as VTable from '@visactor/vtable'; +import { SearchComponent } from '../../src'; +const CONTAINER_ID = 'vTable'; +const generatePersons = count => { + return Array.from(new Array(count)).map((_, i) => ({ + id: i + 1, + email1: `${i + 1}@xxx.com`, + name: `小明${i + 1}`, + lastName: '王', + date1: '2022年9月1日', + tel: '000-0000-0000', + sex: i % 2 === 0 ? 'boy' : 'girl', + work: i % 2 === 0 ? 'back-end engineer' : 'front-end engineer', + city: 'beijing' + })); +}; + +export function createTable() { + const records = generatePersons(100); + const columns: VTable.ColumnsDefine = [ + { + field: '', + title: '行号', + width: 80, + fieldFormat(data, col, row, table) { + return row - 1; + } + }, + { + field: 'id', + title: 'ID', + width: '1%', + minWidth: 200, + sort: true + }, + { + field: 'email1', + title: 'email', + width: 200, + sort: true + }, + { + title: 'full name', + columns: [ + { + field: 'name', + title: 'First Name', + width: 200 + }, + { + field: 'name', + title: 'Last Name', + width: 200 + } + ] + }, + { + field: 'date1', + title: 'birthday', + width: 200 + }, + { + field: 'sex', + title: 'sex', + width: 100 + }, + { + field: 'tel', + title: 'telephone', + width: 150 + }, + { + field: 'work', + title: 'job', + width: 200 + }, + { + field: 'city', + title: 'city', + width: 150 + } + ]; + const option = { + container: document.getElementById(CONTAINER_ID), + records, + columns, + tooltip: { + isShowOverflowTextTooltip: true + } + // frozenColCount: 1, + // bottomFrozenRowCount: 2, + // rightFrozenColCount: 2, + // overscrollBehavior: 'none' + // autoWrapText: true, + // heightMode: 'autoHeight', + // widthMode: 'adaptive' + }; + const tableInstance = new VTable.ListTable(option); + window.tableInstance = tableInstance; + + const search = new SearchComponent({ + table: tableInstance, + autoJump: true + }); + window.search = search; + // tableInstance.on('sort_click', args => { + // tableInstance.updateSortState( + // { + // field: args.field, + // order: Date.now() % 3 === 0 ? 'desc' : Date.now() % 3 === 1 ? 'asc' : 'normal' + // }, + // false + // ); + // return false; //return false代表不执行内部排序逻辑 + // }); + + setTimeout(() => { + tableInstance.updateOption(option); + }, 2000); +} diff --git a/packages/vtable-plugins/demo/main.ts b/packages/vtable-plugins/demo/main.ts new file mode 100644 index 000000000..334ab9ec9 --- /dev/null +++ b/packages/vtable-plugins/demo/main.ts @@ -0,0 +1,164 @@ +import { menus } from './menu'; +// import * as VTable from '../src'; +import { default as MarkdownIt } from 'markdown-it'; +// window.VTable = VTable; +// window.PivotTable = PivotTable; +// window.PivotTable = PivotTable; +// window.CONTAINER_ID = 'vTable'; + +const md = new MarkdownIt(); + +const ACTIVE_ITEM_CLS = 'menu-item-active'; +const MENU_TITLE_CLS = 'menu-title'; +const LOCAL_STORAGE_KEY = 'VTABLE_DEMO'; + +const evaluateCode = (code: string) => { + // eslint-disable-next-line no-console + if (!code) { + return; + } + try { + Function(code)(window); + } catch (err) { + // eslint-disable-next-line no-console + console.error(err); + } +}; + +const handleClick = (e: { target: any }, isInit?: boolean) => { + const triggerNode = e.target; + + if (!triggerNode || triggerNode.classList.contains(MENU_TITLE_CLS)) { + return; + } + + if (triggerNode) { + const path = triggerNode.dataset.path; + const name = triggerNode.dataset.name; + + if (path && name) { + const prevActiveItems = document.getElementsByClassName(ACTIVE_ITEM_CLS); + + if (prevActiveItems && prevActiveItems.length) { + for (let i = 0; i < prevActiveItems.length; i++) { + const element = prevActiveItems[i]; + + element.classList.remove(ACTIVE_ITEM_CLS); + } + } + triggerNode.classList.add(ACTIVE_ITEM_CLS); + if (!isInit) { + localStorage.setItem(LOCAL_STORAGE_KEY, name); + } + + if (window.tableInstance) { + window.tableInstance.release(); + document.getElementById('vTable').innerHTML = null; + } + + let fileType = 'ts'; + if (path === 'custom-layout-jsx') { + fileType = 'tsx'; + } + import(`./${path}/${name}.${fileType}`) + .then(module => { + // eslint-disable-next-line no-console + console.info('%c %s', 'color: #1890ff;font-weight: bold', `当前 demo 路径:./examples/${path}/${name}.md`); + // document.getElementById('article').innerHTML = module.html; + // const jsCode = document.getElementsByClassName('language-ts')[0].innerHTML; + // evaluateCode(md.utils.unescapeAll(jsCode)); + + if (module.createTable) { + module.createTable(); + } + }) + .catch(err => { + // eslint-disable-next-line no-console + console.log(err); + }); + } + } +}; + +const initSidebarEvent = (node: HTMLDivElement) => { + node.addEventListener('click', handleClick); +}; + +const createSidebar = (node: HTMLDivElement) => { + const specsHtml = menus.map(entry => { + if (entry.menu && entry.children && entry.children.length) { + const childrenItems = entry.children.map(child => { + return ``; + }); + + return `${childrenItems.join('')}`; + } + + return ``; + }); + + node.innerHTML = ` +
+ + +
+ `; +}; + +const run = () => { + const sidebarNode = document.querySelector('#sidebar')!; + const prevActivePath = localStorage.getItem(LOCAL_STORAGE_KEY); + + createSidebar(sidebarNode); + initSidebarEvent(sidebarNode); + + const menuItemNodes = document.getElementsByClassName('menu-item'); + + handleClick( + { + target: + menuItemNodes && + menuItemNodes.length && + ([...menuItemNodes].find(node => { + return prevActivePath && node.dataset.name === prevActivePath; + }) || + menuItemNodes[0]) + }, + true + ); +}; + +function bindSearch() { + const searchInput = document.getElementById('search-component-input') as HTMLInputElement; + const searchBtn = document.getElementById('search-component-search') as HTMLButtonElement; + const searchResult = document.getElementById('search-component-result') as HTMLSpanElement; + const searchPrevBtn = document.getElementById('search-component-prev') as HTMLButtonElement; + const searchNextBtn = document.getElementById('search-component-next') as HTMLButtonElement; + + searchBtn.addEventListener('click', () => { + if (window.search) { + const result = window.search.search(searchInput.value); + searchResult.innerText = `${result.index + 1}/${result.results.length}`; + } + }); + + searchPrevBtn.addEventListener('click', () => { + if (window.search) { + const result = window.search.prev(); + searchResult.innerText = `${result.index + 1}/${result.results.length}`; + } + }); + + searchNextBtn.addEventListener('click', () => { + if (window.search) { + const result = window.search.next(); + searchResult.innerText = `${result.index + 1}/${result.results.length}`; + } + }); +} + +run(); + +bindSearch(); diff --git a/packages/vtable-plugins/demo/menu.ts b/packages/vtable-plugins/demo/menu.ts new file mode 100644 index 000000000..0efaad87d --- /dev/null +++ b/packages/vtable-plugins/demo/menu.ts @@ -0,0 +1,20 @@ +export const menus = [ + { + menu: 'listTable', + children: [ + { + path: 'list', + name: 'list' + } + ] + }, + { + menu: 'pivotTable', + children: [ + { + path: 'pivot', + name: 'pivot-basic' + } + ] + } +]; diff --git a/packages/vtable-plugins/demo/pivot/pivot-basic.ts b/packages/vtable-plugins/demo/pivot/pivot-basic.ts new file mode 100644 index 000000000..22a378419 --- /dev/null +++ b/packages/vtable-plugins/demo/pivot/pivot-basic.ts @@ -0,0 +1,510 @@ +import * as VTable from '@visactor/vtable'; +import { SearchComponent } from '../../src'; +// import { bindDebugTool } from '../../src/scenegraph/debug-tool'; +const PivotTable = VTable.PivotTable; +const CONTAINER_ID = 'vTable'; + +function generatePivotDataSource(num, colCount) { + const array = new Array(num); + for (let i = 0; i < num; i++) { + const data = new Array(colCount); + for (let j = 0; j < colCount; j++) { + data[j] = i + j; + } + array[i] = data; + } + return array; +} +const DEFAULT_BAR_COLOR = data => { + const num = (data.percentile ?? 0) * 100; + if (num > 80) { + return '#20a8d8'; + } + if (num > 50) { + return '#4dbd74'; + } + if (num > 20) { + return '#ffc107'; + } + return '#f86c6b'; +}; + +export function createTable() { + const records = generatePivotDataSource(19, 18); + const theme: VTable.TYPES.ITableThemeDefine = { + underlayBackgroundColor: '#F6F6F6', + defaultStyle: { + borderColor: '#000', + color: '#000', + bgColor: '#F6F6F6' + }, + headerStyle: { + bgColor: '#F5F6FA', + frameStyle: { + borderColor: '#00ffff', + borderLineWidth: 2 + } + }, + selectionStyle: { + cellBgColor: 'rgba(130,178,245, 0.2)', + cellBorderColor: '#003fff', + cellBorderLineWidth: 2 + }, + rowHeaderStyle: { + bgColor: '#F3F8FF', + frameStyle: { + borderColor: '#ff00ff', + borderLineWidth: 2 + } + }, + cornerHeaderStyle: { + bgColor: '#CCE0FF', + fontSize: 20, + fontFamily: 'sans-serif', + frameStyle: { + borderColor: '#00ff00', + borderLineWidth: 2 + } + }, + bodyStyle: { + hover: { + cellBgColor: '#CCE0FF', + inlineRowBgColor: '#F3F8FF', + inlineColumnBgColor: '#F3F8FF' + }, + frameStyle: { + borderColor: '#ffff00', + borderLineWidth: 5 + } + }, + frameStyle: { + borderColor: '#000', + borderLineWidth: 1, + borderLineDash: [] + }, + columnResize: { + lineWidth: 1, + lineColor: '#416EFF', + bgColor: '#D9E2FF', + width: 3 + }, + frozenColumnLine: { + shadow: { + width: 24, + startColor: 'rgba(00, 24, 47, 0.06)', + endColor: 'rgba(00, 24, 47, 0)' + } + } + // menuStyle: { + // color: '#000', + // highlightColor: '#2E68CF', + // font: '12px sans-serif', + // highlightFont: '12px sans-serif', + // hoverBgColor: '#EEE' + // } + }; + const option: VTable.PivotTableConstructorOptions = { + columnHeaderTitle: { + title: true, + headerStyle: { + textStick: true + } + }, + columns: [ + { + dimensionKey: '地区', + title: '地区', + headerFormat(value) { + return `${value}地区`; + }, + description(args) { + return args.value; + }, + cornerDescription: '地区维度', + headerStyle: { + textAlign: 'center', + borderColor: 'blue', + color: 'pink', + textStick: true, + bgColor(arg) { + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { + return '#bd422a'; + } + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { + return '#ff9900'; + } + return 'gray'; + } + }, + // 指标菜单 + dropDownMenu: ['升序排序I', '降序排序I', '冻结列I'], + // corner菜单 + cornerDropDownMenu: ['升序排序C', '降序排序C', '冻结列C'], + drillDown: true + }, + { + dimensionKey: '邮寄方式', + title: '邮寄方式11', + headerFormat(value) { + return `${value}邮寄方式`; + }, + headerStyle: { + textAlign: 'left', + borderColor: 'blue', + color: 'pink', + // lineHeight: '2em', + fontSize: 16, + fontStyle: 'bold', + fontFamily: 'sans-serif', + underline: true, + textStick: true, + bgColor(arg) { + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { + return '#bd422a'; + } + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { + return '#ff9900'; + } + return 'gray'; + } + }, + drillUp: false + } + ], + rows: [ + { + dimensionKey: '类别', + title: '类别', + drillUp: true, + width: 'auto', + headerStyle: { + textAlign: 'center', + borderColor: 'blue', + color: 'purple', + textBaseline: 'top', + textStick: true, + bgColor: '#6cd26f' + } + }, + { + dimensionKey: '子类别', + title: '子类别', + headerStyle: { + textAlign: 'center', + color: 'blue', + bgColor: '#45b89f' + }, + width: 'auto', + dropDownMenu: ['升序排序I', '降序排序I', '冻结列I'] + // headerType: 'MULTILINETEXT', + } + ], + indicators: [ + { + indicatorKey: '1', + title: '销售额', + // format(rec) { + // return `${rec.dataValue}%`; + // }, + headerStyle: { + color: 'red', + bgColor(arg) { + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { + return '#bd422a'; + } + if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { + return '#ff9900'; + } + return 'gray'; + } + }, + // style: { + // barHeight: '100%', + // // barBgColor: '#aaa', + // // barColor: '#444', + // barBgColor: data => { + // return `rgb(${100 + 100 * (1 - (data.percentile ?? 0))},${100 + 100 * (1 - (data.percentile ?? 0))},${ + // 255 * (1 - (data.percentile ?? 0)) + // })`; + // }, + // barColor: 'transparent' + // }, + // cellType: 'progressbar', + showSort: true + // headerType: 'MULTILINETEXT', + }, + { + indicatorKey: '2', + title: '利润', + // format(rec) { + // // if (rec.rowDimensions[0].value === '东北') return `${rec.dataValue}%`; + // return rec.dataValue; + // }, + // cellType: 'progressbar', + // style: { + // barHeight: '50%', + // barBottom: 20, + // barColor: DEFAULT_BAR_COLOR + // }, + showSort: true, + dropDownMenu: ['利润升序排序I', '利润降序排序I', '利润冻结列I'] + } + ], + columnTree: [ + { + dimensionKey: '地区', + value: '东北', + children: [ + { + dimensionKey: '邮寄方式', + value: '一级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '二级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '三级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + } + ] + }, + { + dimensionKey: '地区', + value: '华北', + children: [ + { + dimensionKey: '邮寄方式', + value: '一级', + children: [ + { + indicatorKey: '1', + value: '销售额' + }, + { + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '二级', + children: [ + { + indicatorKey: '1', + value: '销售额' + }, + { + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '三级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + } + ] + }, + { + dimensionKey: '地区', + value: '中南', + children: [ + { + dimensionKey: '邮寄方式', + value: '一级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '二级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + }, + { + dimensionKey: '邮寄方式', + value: '三级', + children: [ + { + // dimensionKey: '指标名称', + indicatorKey: '1', + value: '销售额' + }, + { + // dimensionKey: '指标名称', + indicatorKey: '2', + value: '利润' + } + ] + } + ] + } + ], + rowTree: [ + { + dimensionKey: '类别', + value: '办公用品', + children: [ + { dimensionKey: '子类别', value: '电脑' }, + { dimensionKey: '子类别', value: '装订机' }, + { dimensionKey: '子类别', value: '签字笔' }, + { dimensionKey: '子类别', value: '标签' }, + { dimensionKey: '子类别', value: '收纳柜' }, + { dimensionKey: '子类别', value: '纸张' }, + { dimensionKey: '子类别', value: '电灯' } + ] + }, + { + dimensionKey: '类别', + value: '家具', + children: [ + { dimensionKey: '子类别', value: '衣柜' }, + { dimensionKey: '子类别', value: '沙发' }, + { dimensionKey: '子类别', value: '餐桌' }, + { dimensionKey: '子类别', value: '椅子' }, + { dimensionKey: '子类别', value: '桌子' } + ] + }, + { + dimensionKey: '类别', + value: '餐饮', + children: [ + { dimensionKey: '子类别', value: '锅具' }, + { + dimensionKey: '子类别', + value: '油盐酱醋' + }, + { dimensionKey: '子类别', value: '米面' } + ] + }, + { + dimensionKey: '类别', + value: '技术', + children: [ + { dimensionKey: '子类别', value: '设备' }, + { dimensionKey: '子类别', value: '配件' }, + { dimensionKey: '子类别', value: '电话' }, + { dimensionKey: '子类别', value: '复印机' } + ] + } + ], + corner: { + titleOnDimension: 'column', + headerStyle: { + textAlign: 'center', + borderColor: 'red', + color: 'yellow', + underline: true, + fontSize: 16, + fontStyle: 'bold', + fontFamily: 'sans-serif' + // lineHeight: '20px' + } + }, + indicatorTitle: '指标名称', + // indicatorsAsCol: false, + container: document.getElementById(CONTAINER_ID), + records, + theme, + showFrozenIcon: false, //显示VTable内置冻结列图标 + allowFrozenColCount: 2, + widthMode: 'autoWidth', // 宽度模式:standard 标准模式; adaptive 自动填满容器 + defaultRowHeight: 80, + columnResizeType: 'indicator', // 'column' | 'indicator' | 'all' + tooltip: { + isShowOverflowTextTooltip: true + } + }; + + const instance = new PivotTable(option); + window.tableInstance = instance; + + const search = new SearchComponent({ + table: instance, + autoJump: true + }); + window.search = search; + + const { PIVOT_SORT_CLICK } = VTable.PivotTable.EVENT_TYPE; + instance.on(PIVOT_SORT_CLICK, e => { + const order = e.order === 'asc' ? 'desc' : e.order === 'desc' ? 'normal' : 'asc'; + instance.updatePivotSortState([{ dimensions: e.dimensionInfo, order }]); + }); + + // bindDebugTool(instance.scenegraph.stage as any, { + // customGrapicKeys: ['role', '_updateTag'] + // }); + + // 只为了方便控制太调试用,不要拷贝 + window.tableInstance = instance; +} diff --git a/packages/vtable-plugins/demo/style.css b/packages/vtable-plugins/demo/style.css new file mode 100644 index 000000000..1ac1b4833 --- /dev/null +++ b/packages/vtable-plugins/demo/style.css @@ -0,0 +1,100 @@ +body { + margin: 0; + + --primary-color: #1890ff; + --primary-color-hover: #40a9ff; + --primary-color-active: #096dd9; + --primary-color-outline: rgba(24, 144, 255, 0.2); + --primary-1: #e6f7ff; + --primary-2: #bae7ff; + --primary-3: #91d5ff; + --primary-4: #69c0ff; + --primary-5: #40a9ff; + --primary-6: #1890ff; + --primary-7: #096dd9; +} +body p { + margin: 0; +} +.container { + font-family: Avenir, Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + /* text-align: center; */ + color: #2c3e50; + display: flex; + height: 100vh; +} + +.container .sidebar { + width: 200px; + /* height: 100%; */ + /* border-right: 1px solid rgba(0, 0, 0, 0.06); */ +} + +.container .sidebar > div { + height: 100%; +} + +.container .sidebar .sidebar-title { + font-weight: 700; + line-height: 5em; +} + +.container .sidebar .menu-list { + height: calc(100% - 5em); + overflow-y: scroll; +} + +.container .sidebar .menu-item { + line-height: 3em; + text-align: left; + padding: 0 1em; + cursor: pointer; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.container .sidebar .menu-item.menu-title { + line-height: 1.4em; + margin-left: -0.5em; + color: #999; + cursor: default; +} + +.container .sidebar .menu-item.menu-item-active { + background-color: var(--primary-1); + color: var(--primary-color); + font-weight: 700; +} + +.container .content { + flex: 1; + /* margin: 0 1em; */ + /* height: 100%; */ + min-width: 500px; +} + +#header { + height: 40px; + line-height: 40px; + border-bottom: 1px solid #d7d7d7; + margin-bottom: 20px; +} + +#chartContainer { + /* height: 500px; */ + height: calc(100% - 2em); + width: 100%; + /* margin: 1em 0em; */ +} + +pre { + border: 1px solid var(--primary-3); + padding: 1em; +} + +.language-ts { + color: var(--primary-6); +} diff --git a/packages/vtable-plugins/demo/vite.config.js b/packages/vtable-plugins/demo/vite.config.js new file mode 100644 index 000000000..0dd0c01ed --- /dev/null +++ b/packages/vtable-plugins/demo/vite.config.js @@ -0,0 +1,37 @@ +const { plugin: mdPlugin, Mode } = require('vite-plugin-markdown'); +const react = require('@vitejs/plugin-react'); +const path = require('path'); +module.exports = { + server: { + host: '0.0.0.0', + port: 3013, + https: !!process.env.HTTPS + }, + define: { + __DEV__: true, + __VERSION__: JSON.stringify(require('../package.json').version) + }, + resolve: { + alias: { + '@visactor/vtable/es/': path.resolve(__dirname, '../../vtable/src/es/'), + '@visactor/vtable': path.resolve(__dirname, '../../vtable/src/index.ts'), + '@vutils-extension': path.resolve(__dirname, '../../vtable/src/vutil-extension-temp') + } + }, + plugins: [ + mdPlugin({ mode: [Mode.HTML, Mode.MARKDOWN, Mode.TOC, Mode.REACT] }), + react({ + babel: { + plugins: [ + [ + '@babel/plugin-transform-react-jsx', + { + pragma: 'jsx', + pragmaFrag: 'Fragment' + } + ] + ] + } + }) + ] +}; diff --git a/packages/vtable-plugins/package.json b/packages/vtable-plugins/package.json new file mode 100644 index 000000000..9037b0b22 --- /dev/null +++ b/packages/vtable-plugins/package.json @@ -0,0 +1,86 @@ +{ + "name": "@visactor/vtable-plugins", + "version": "1.11.1", + "description": "The search util of VTable", + "author": { + "name": "VisActor", + "url": "https://VisActor.io/" + }, + "license": "MIT", + "sideEffects": false, + "main": "cjs/index.js", + "module": "es/index.js", + "types": "es/index.d.ts", + "files": [ + "cjs", + "es", + "dist" + ], + "exports": { + ".": { + "require": "./cjs/index.js", + "import": "./es/index.js" + } + }, + "scripts": { + "start": "vite ./demo", + "build": "bundle --clean" + }, + "unpkg": "latest", + "unpkgFiles": [ + "dist/vtable-exporter.js" + ], + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@visactor/vtable": "workspace:*", + "@visactor/vutils": "~0.18.14" + }, + "devDependencies": { + "@visactor/vchart": "1.12.12", + "@internal/bundler": "workspace:*", + "@internal/eslint-config": "workspace:*", + "@internal/ts-config": "workspace:*", + "@rushstack/eslint-patch": "~1.1.4", + "react": "^18.0.0", + "react-dom": "^18.0.0", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", + "@vitejs/plugin-react": "3.1.0", + "eslint": "~8.18.0", + "vite": "3.2.6", + "typescript": "4.9.5", + "@babel/core": "7.20.12", + "@babel/preset-env": "7.20.2", + "@types/chai": "4.2.22", + "@types/jest": "^26.0.0", + "@types/mocha": "9.0.0", + "@types/node": "*", + "@types/offscreencanvas": "2019.6.4", + "chai": "4.3.4", + "jest": "^26.0.0", + "jest-electron": "^0.1.12", + "jest-transform-stub": "^2.0.0", + "magic-string": "^0.25.7", + "mocha": "9.1.3", + "postcss": "8.4.21", + "rimraf": "3.0.2", + "sass": "1.43.5", + "ts-jest": "^26.0.0", + "ts-loader": "9.2.6", + "ts-node": "10.9.0", + "tslib": "2.3.1", + "ttypescript": "1.5.13", + "typescript-transform-paths": "3.3.1", + "json-formatter-js": "^2.3.4", + "inversify": "6.0.1", + "vite-plugin-markdown": "^2.1.0", + "markdown-it": "^13.0.0", + "node-fetch": "2.6.7", + "form-data": "~4.0.0", + "axios": "^1.4.0", + "@types/react-is": "^17.0.3", + "rollup-plugin-node-resolve": "5.2.0" + } +} \ No newline at end of file diff --git a/packages/vtable-plugins/setup-mock.js b/packages/vtable-plugins/setup-mock.js new file mode 100644 index 000000000..b0df380be --- /dev/null +++ b/packages/vtable-plugins/setup-mock.js @@ -0,0 +1,2 @@ +global.__DEV__ = true; +global.__VERSION__ = true; diff --git a/packages/vtable/src/plugins/carousel-animation.ts b/packages/vtable-plugins/src/carousel-animation.ts similarity index 97% rename from packages/vtable/src/plugins/carousel-animation.ts rename to packages/vtable-plugins/src/carousel-animation.ts index 14bd94d93..2fb4bc5a4 100644 --- a/packages/vtable/src/plugins/carousel-animation.ts +++ b/packages/vtable-plugins/src/carousel-animation.ts @@ -1,5 +1,5 @@ -import type { EasingType } from '@src/vrender'; -import type { BaseTableAPI } from '../ts-types/base-table'; +import type { EasingType } from '@visactor/vtable/es/vrender'; +import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; export interface ICarouselAnimationPluginOptions { rowCount?: number; diff --git a/packages/vtable/src/plugins/custom-cell-style.ts b/packages/vtable-plugins/src/custom-cell-style.ts similarity index 93% rename from packages/vtable/src/plugins/custom-cell-style.ts rename to packages/vtable-plugins/src/custom-cell-style.ts index 0f27e39ce..2227b6c64 100644 --- a/packages/vtable/src/plugins/custom-cell-style.ts +++ b/packages/vtable-plugins/src/custom-cell-style.ts @@ -1,13 +1,14 @@ import { merge } from '@visactor/vutils'; -import type { Style } from '../body-helper/style'; import type { CellRange, ColumnStyleOption, CustomCellStyle, CustomCellStyleArrangement, FullExtendStyle -} from '../ts-types'; -import type { BaseTableAPI } from '../ts-types/base-table'; +} from '@visactor/vtable/es/ts-types'; +import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; +import type { Style } from '@visactor/vtable/src/body-helper/style'; +import { Factory } from '@visactor/vtable/src/core/factory'; export class CustomCellStylePlugin { table: BaseTableAPI; @@ -216,3 +217,9 @@ export function mergeStyle(cacheStyle: Style, customCellStyle: ColumnStyleOption return cacheStyle; } + +export const registerCustomCellStylePlugin = () => { + Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin); +}; + +export type ICustomCellStylePlugin = typeof CustomCellStylePlugin; diff --git a/packages/vtable/src/plugins/header-highlight.ts b/packages/vtable-plugins/src/header-highlight.ts similarity index 97% rename from packages/vtable/src/plugins/header-highlight.ts rename to packages/vtable-plugins/src/header-highlight.ts index a3603301b..ba2c3eb20 100644 --- a/packages/vtable/src/plugins/header-highlight.ts +++ b/packages/vtable-plugins/src/header-highlight.ts @@ -1,5 +1,5 @@ -import type { CellRange } from '../ts-types'; -import type { BaseTableAPI } from '../ts-types/base-table'; +import type { CellRange } from '@visactor/vtable/es/ts-types'; +import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; export interface IHeaderHighlightPluginOptions { rowHighlight?: boolean; diff --git a/packages/vtable-plugins/src/index.ts b/packages/vtable-plugins/src/index.ts new file mode 100644 index 000000000..fcc0da94c --- /dev/null +++ b/packages/vtable-plugins/src/index.ts @@ -0,0 +1,5 @@ +export * from './carousel-animation'; +export * from './invert-highlight'; +export * from './list-tree-stick-cell'; +export * from './custom-cell-style'; +export * from './header-highlight'; diff --git a/packages/vtable/src/plugins/invert-highlight.ts b/packages/vtable-plugins/src/invert-highlight.ts similarity index 88% rename from packages/vtable/src/plugins/invert-highlight.ts rename to packages/vtable-plugins/src/invert-highlight.ts index 2dcabf4b2..cbc7b9a25 100644 --- a/packages/vtable/src/plugins/invert-highlight.ts +++ b/packages/vtable-plugins/src/invert-highlight.ts @@ -1,10 +1,10 @@ -import type { Rect } from '@src/vrender'; -import { createRect } from '@src/vrender'; -import type { Group } from '../scenegraph/graphic/group'; -import { isSameRange } from '../tools/cell-range'; -import type { CellRange } from '../ts-types'; -import type { BaseTableAPI } from '../ts-types/base-table'; -import { cellInRange } from '../tools/helper'; +import type { Rect } from '@visactor/vtable/es/vrender'; +import { createRect } from '@visactor/vtable/es/vrender'; +import type { Group } from '@visactor/vtable/es/scenegraph/graphic/group'; +import { isSameRange } from '@visactor/vtable/es/tools/cell-range'; +import type { CellRange } from '@visactor/vtable/es/ts-types'; +import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; +import { cellInRange } from '@visactor/vtable/es/tools/helper'; import { isValid } from '@visactor/vutils'; export interface InvertHighlightPluginOptions { diff --git a/packages/vtable/src/plugins/list-tree-stick-cell.ts b/packages/vtable-plugins/src/list-tree-stick-cell.ts similarity index 95% rename from packages/vtable/src/plugins/list-tree-stick-cell.ts rename to packages/vtable-plugins/src/list-tree-stick-cell.ts index 367ee8f64..7bb935437 100644 --- a/packages/vtable/src/plugins/list-tree-stick-cell.ts +++ b/packages/vtable-plugins/src/list-tree-stick-cell.ts @@ -1,10 +1,10 @@ import { isArray, isValid } from '@visactor/vutils'; -import type { ListTable } from '../ListTable'; -import { Factory } from '../core/factory'; -import { Group } from '../scenegraph/graphic/group'; -import { createRect, type Graphic } from '../vrender'; -import { updateCell } from '../scenegraph/group-creater/cell-helper'; -import { getTargetCell } from '../event/util'; +import type { ListTable } from '@visactor/vtable/es/ListTable'; +import { Factory } from '@visactor/vtable/es/core/factory'; +import { Group } from '@visactor/vtable/es/scenegraph/graphic/group'; +import { createRect, type Graphic } from '@visactor/vtable/es/vrender'; +import { updateCell } from '@visactor/vtable/es/scenegraph/group-creater/cell-helper'; +import { getTargetCell } from '@visactor/vtable/es/event/util'; export class ListTreeStickCellPlugin { table: ListTable; diff --git a/packages/vtable-plugins/tscofig.eslint.json b/packages/vtable-plugins/tscofig.eslint.json new file mode 100644 index 000000000..22e7ab7f7 --- /dev/null +++ b/packages/vtable-plugins/tscofig.eslint.json @@ -0,0 +1,25 @@ +{ + "extends": "@internal/ts-config/tsconfig.base.json", + "compilerOptions": { + "types": [ + "jest", + "offscreencanvas", + "node" + ], + "lib": [ + "DOM", + "ESNext" + ], + "baseUrl": "./", + "rootDir": "./", + "paths": { + "@visactor/vtable/es": [ + "../vtable/src" + ] + } + }, + "include": [ + "src", + "demo" + ] +} \ No newline at end of file diff --git a/packages/vtable-plugins/tsconfig.json b/packages/vtable-plugins/tsconfig.json new file mode 100644 index 000000000..75891b766 --- /dev/null +++ b/packages/vtable-plugins/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "@internal/ts-config/tsconfig.base.json", + "compilerOptions": { + "jsx": "react", + "types": ["jest", "offscreencanvas", "node"], + "lib": ["DOM", "ESNext"], + "baseUrl": "./", + "rootDir": "./src", + "paths": { + } + }, + "ts-node": { + "transpileOnly": true, + "compilerOptions": { + "module": "commonjs" + } + }, + "references": [ + { + "path": "../vtable" + } + ], + "include": ["src"] +} \ No newline at end of file diff --git a/packages/vtable-search/README.md b/packages/vtable-search/README.md index 456ef1467..6d9bc9d6d 100644 --- a/packages/vtable-search/README.md +++ b/packages/vtable-search/README.md @@ -5,7 +5,7 @@
-

VTable-Export

+

VTable-Search

diff --git a/packages/vtable/examples/vite.config.js b/packages/vtable/examples/vite.config.js index 76ef2e26b..18c0355e6 100644 --- a/packages/vtable/examples/vite.config.js +++ b/packages/vtable/examples/vite.config.js @@ -14,6 +14,7 @@ module.exports = { resolve: { alias: { '@visactor/vtable-editors': path.resolve(__dirname, '../../vtable-editors/src/index.ts'), + '@visactor/vtable-plugins': path.resolve(__dirname, '../../vtable-plugins/src/index.ts'), '@src': path.resolve(__dirname, '../src/'), '@vutils-extension': path.resolve(__dirname, '../src/vutil-extension-temp') } diff --git a/packages/vtable/jest.config.js b/packages/vtable/jest.config.js index 448cd9c44..adea01032 100644 --- a/packages/vtable/jest.config.js +++ b/packages/vtable/jest.config.js @@ -47,8 +47,12 @@ module.exports = { 'd3-dsv': path.resolve(__dirname, './node_modules/d3-dsv/dist/d3-dsv.min.js'), 'd3-hexbin': path.resolve(__dirname, './node_modules/d3-hexbin/build/d3-hexbin.min.js'), 'd3-hierarchy': path.resolve(__dirname, './node_modules/d3-hierarchy/dist/d3-hierarchy.min.js'), - '@visactor/vtable-editors': path.resolve(__dirname, '../vtable-editors/src/index.ts'), + // '@visactor/vtable-editors': path.resolve(__dirname, '../vtable-editors/src/index.ts'), + // '@visactor/vtable-plugins': path.resolve(__dirname, '../vtable-plugins/src/index.ts'), + '@visactor/vtable-editors': '/../vtable-editors/src/index.ts', + '@visactor/vtable-plugins': '/../vtable-plugins/src/index.ts', '@src/vrender': path.resolve(__dirname, './src/vrender.ts'), + '@visactor/vtable/es/(.*)': '/src/$1', '@vutils-extension': path.resolve(__dirname, './src/vutil-extension-temp/index.ts') }, setupFiles: ['./setup-mock.js'] diff --git a/packages/vtable/package.json b/packages/vtable/package.json index 1a377ab9f..69edf955d 100644 --- a/packages/vtable/package.json +++ b/packages/vtable/package.json @@ -52,6 +52,7 @@ }, "dependencies": { "@visactor/vtable-editors": "workspace:*", + "@visactor/vtable-plugins": "workspace:*", "@visactor/vrender-core": "0.21.0-alpha.4", "@visactor/vrender-kits": "0.21.0-alpha.4", "@visactor/vrender-components": "0.21.0-alpha.4", @@ -127,4 +128,4 @@ "url": "https://github.com/VisActor/VTable.git", "directory": "packages/vtable" } -} +} \ No newline at end of file diff --git a/packages/vtable/src/ListTable-all.ts b/packages/vtable/src/ListTable-all.ts index 12cea5d4f..6de5e57f2 100644 --- a/packages/vtable/src/ListTable-all.ts +++ b/packages/vtable/src/ListTable-all.ts @@ -7,7 +7,7 @@ import { registerTitle, registerTooltip } from './components'; -import { registerListTreeStickCellPlugin } from './plugins/list-tree-stick-cell'; +import { registerListTreeStickCellPlugin, registerCustomCellStylePlugin } from '@visactor/vtable-plugins'; import { registerChartCell, registerCheckboxCell, @@ -26,6 +26,7 @@ registerMenu(); registerTitle(); registerTooltip(); registerListTreeStickCellPlugin(); +registerCustomCellStylePlugin(); registerChartCell(); registerCheckboxCell(); diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts index 88a8d2425..d24a7915c 100644 --- a/packages/vtable/src/ListTable.ts +++ b/packages/vtable/src/ListTable.ts @@ -53,7 +53,7 @@ import { listTableUpdateRecords, sortRecords } from './core/record-helper'; -import type { IListTreeStickCellPlugin, ListTreeStickCellPlugin } from './plugins/list-tree-stick-cell'; +import type { IListTreeStickCellPlugin, ListTreeStickCellPlugin } from '@visactor/vtable-plugins'; // import { // registerAxis, // registerEmptyTip, diff --git a/packages/vtable/src/core/BaseTable.ts b/packages/vtable/src/core/BaseTable.ts index 5b141f35a..f9d30b9fd 100644 --- a/packages/vtable/src/core/BaseTable.ts +++ b/packages/vtable/src/core/BaseTable.ts @@ -126,7 +126,8 @@ import { NumberRangeMap } from '../layout/row-height-map'; import { ListTable } from '../ListTable'; import type { SimpleHeaderLayoutMap } from '../layout'; import { RowSeriesNumberHelper } from './row-series-number-helper'; -import { CustomCellStylePlugin, mergeStyle } from '../plugins/custom-cell-style'; +import type { ICustomCellStylePlugin } from '@visactor/vtable-plugins'; +import { mergeStyle } from '@visactor/vtable-plugins'; import { hideCellSelectBorder, restoreCellSelectBorder } from '../scenegraph/select/update-select-border'; import type { ITextGraphicAttribute } from '@src/vrender'; import { ReactCustomLayout } from '../components/react/react-custom-layout'; @@ -218,7 +219,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { isReleased: boolean = false; _chartEventMap: Record = {}; - customCellStylePlugin: CustomCellStylePlugin; + customCellStylePlugin?: ICustomCellStylePlugin; columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body'; @@ -499,11 +500,14 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { internalProps.customMergeCell = options.customMergeCell; - this.customCellStylePlugin = new CustomCellStylePlugin( - this, - options.customCellStyle ?? [], - options.customCellStyleArrangement ?? [] - ); + const CustomCellStylePlugin = Factory.getComponent('customCellStylePlugin') as ICustomCellStylePlugin; + if (CustomCellStylePlugin) { + this.customCellStylePlugin = new CustomCellStylePlugin( + this, + options.customCellStyle ?? [], + options.customCellStyleArrangement ?? [] + ); + } } /** 节流绘制 */ throttleInvalidate = throttle2(this.render.bind(this), 200); @@ -2412,7 +2416,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { internalProps.customMergeCell = options.customMergeCell; - this.customCellStylePlugin.updateCustomCell( + this.customCellStylePlugin?.updateCustomCell( options.customCellStyle ?? [], options.customCellStyleArrangement ?? [] ); @@ -4112,14 +4116,14 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { // } hasCustomCellStyle(customStyleId: string): boolean { - return this.customCellStylePlugin.hasCustomCellStyle(customStyleId); + return this.customCellStylePlugin?.hasCustomCellStyle(customStyleId); } registerCustomCellStyle(customStyleId: string, customStyle: ColumnStyleOption | undefined | null) { - this.customCellStylePlugin.registerCustomCellStyle(customStyleId, customStyle); + this.customCellStylePlugin?.registerCustomCellStyle(customStyleId, customStyle); } arrangeCustomCellStyle(cellPos: { col?: number; row?: number; range?: CellRange }, customStyleId: string) { - this.customCellStylePlugin.arrangeCustomCellStyle(cellPos, customStyleId); + this.customCellStylePlugin?.arrangeCustomCellStyle(cellPos, customStyleId); } isSeriesNumber(col: number, row: number): boolean { return this.internalProps.layoutMap.isSeriesNumber(col, row); diff --git a/packages/vtable/src/core/style-helper.ts b/packages/vtable/src/core/style-helper.ts index 5fab420ea..f738c00f1 100644 --- a/packages/vtable/src/core/style-helper.ts +++ b/packages/vtable/src/core/style-helper.ts @@ -1,4 +1,4 @@ -import { mergeStyle } from '../plugins/custom-cell-style'; +import { mergeStyle } from '@visactor/vtable-plugins'; import type { PivotHeaderLayoutMap } from '../layout/pivot-header-layout'; import { isLeftOrRightAxis, isTopOrBottomAxis } from '../layout/chart-helper/get-axis-config'; import { isFunction } from '@visactor/vutils'; @@ -16,7 +16,7 @@ const EMPTY_STYLE = {}; * @returns */ export function getCellStyle(col: number, row: number, table: BaseTableAPI): FullExtendStyle { - const customCellStyle = table.customCellStylePlugin.getCustomCellStyle(col, row); + const customCellStyle = table.customCellStylePlugin?.getCustomCellStyle(col, row); const { layoutMap } = table.internalProps; const isHeader = layoutMap.isHeader(col, row); if (isHeader) { diff --git a/packages/vtable/src/index.ts b/packages/vtable/src/index.ts index 7c0b9bb25..5df5ae0d0 100644 --- a/packages/vtable/src/index.ts +++ b/packages/vtable/src/index.ts @@ -131,6 +131,17 @@ export { TABLE_EVENT_TYPE } from './core/TABLE_EVENT_TYPE'; export { PIVOT_CHART_EVENT_TYPE, PIVOT_TABLE_EVENT_TYPE } from './ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE'; export { EventTarget } from './event/EventTarget'; -export * from './plugins/invert-highlight'; -export * from './plugins/carousel-animation'; -export * from './plugins/header-highlight'; + +export type { + ICarouselAnimationPluginOptions, + IHeaderHighlightPluginOptions, + InvertHighlightPluginOptions +} from '@visactor/vtable-plugins'; + +export { + CarouselAnimationPlugin, + HeaderHighlightPlugin, + InvertHighlightPlugin, + registerListTreeStickCellPlugin, + registerCustomCellStylePlugin +} from '@visactor/vtable-plugins'; diff --git a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts index 5bdf39a01..10f5e8775 100644 --- a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts +++ b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts @@ -36,7 +36,7 @@ import { updateCellContentHeight, updateCellContentWidth } from '../utils/text-i import { isArray, isValid } from '@visactor/vutils'; import { breakString } from '../utils/break-string'; import type { CreateRadioCellGroup } from './cell-type/radio-cell'; -import { onBeforeAttributeUpdateForInvertHighlight } from '../../plugins/invert-highlight'; +import { onBeforeAttributeUpdateForInvertHighlight } from '@visactor/vtable-plugins'; export function createCell( type: ColumnTypeOption, diff --git a/packages/vtable/src/ts-types/base-table.ts b/packages/vtable/src/ts-types/base-table.ts index 3c62c19f0..d898c88a6 100644 --- a/packages/vtable/src/ts-types/base-table.ts +++ b/packages/vtable/src/ts-types/base-table.ts @@ -100,7 +100,7 @@ import type { ISortedMapItem } from '../data/DataSource'; import type { IAnimationAppear } from './animation/appear'; import type { IEmptyTip } from './component/empty-tip'; import type { EmptyTip } from '../components/empty-tip/empty-tip'; -import type { CustomCellStylePlugin } from '../plugins/custom-cell-style'; +import type { ICustomCellStylePlugin } from '@visactor/vtable-plugins'; import type { EditManeger } from '../edit/edit-manager'; import type { ITableAnimationOption, TableAnimationManager } from '../core/animation'; @@ -924,7 +924,7 @@ export interface BaseTableAPI { /** 开启表格的滚动 */ enableScroll: () => void; - customCellStylePlugin: CustomCellStylePlugin; + customCellStylePlugin: ICustomCellStylePlugin; headerStyleCache: Map; bodyBottomStyleCache: Map; bodyStyleCache: Map; diff --git a/packages/vtable/tsconfig.eslint.json b/packages/vtable/tsconfig.eslint.json index 2017a9210..cbfa15726 100644 --- a/packages/vtable/tsconfig.eslint.json +++ b/packages/vtable/tsconfig.eslint.json @@ -8,6 +8,9 @@ "paths": { "@visactor/vtable-editors": [ "../vtable-editors/src" + ], + "@visactor/vtable-plugins": [ + "../vtable-plugins/src" ] } }, diff --git a/rush.json b/rush.json index 6516738f5..20ae89162 100644 --- a/rush.json +++ b/rush.json @@ -137,6 +137,15 @@ "shouldPublish": true, "versionPolicyName": "vtableMain" }, + { + "packageName": "@visactor/vtable-plugins", + "projectFolder": "packages/vtable-plugins", + "tags": [ + "package" + ], + "shouldPublish": true, + "versionPolicyName": "vtableMain" + }, { "packageName": "@internal/bugserver-trigger", "projectFolder": "tools/bugserver-trigger", From cc8ba6c38f965eddd508bdea4989378ceb365696 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 11:38:27 +0800 Subject: [PATCH 17/24] fix: fix src package name of vtable --- packages/react-vtable/demo/vite.config.ts | 2 ++ packages/react-vtable/src/table-components/component/menu.tsx | 2 +- packages/vtable-calendar/src/event/type.ts | 2 +- packages/vtable-calendar/src/month-calendar.ts | 2 +- packages/vtable-export/src/excel/index.ts | 2 +- packages/vtable-plugins/src/custom-cell-style.ts | 4 ++-- packages/vtable/examples/vite.config.js | 3 ++- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/react-vtable/demo/vite.config.ts b/packages/react-vtable/demo/vite.config.ts index e69f89ea4..602881721 100644 --- a/packages/react-vtable/demo/vite.config.ts +++ b/packages/react-vtable/demo/vite.config.ts @@ -26,7 +26,9 @@ export default defineConfig({ resolve: { alias: { '@visactor/vtable/es/vrender': path.resolve(__dirname, '../../vtable/src/vrender.ts'), + '@visactor/vtable/es': path.resolve(__dirname, '../../vtable/src/'), '@visactor/vtable': path.resolve(__dirname, '../../vtable/src/index.ts'), + '@visactor/vtable-plugins': path.resolve(__dirname, '../../vtable-plugins/src/index.ts'), '@src': path.resolve(__dirname, '../../vtable/src/'), '@vutils-extension': path.resolve(__dirname, '../../vtable/src/vutil-extension-temp') // ...localConf.resolve?.alias diff --git a/packages/react-vtable/src/table-components/component/menu.tsx b/packages/react-vtable/src/table-components/component/menu.tsx index af27cad71..99a2fd8f8 100644 --- a/packages/react-vtable/src/table-components/component/menu.tsx +++ b/packages/react-vtable/src/table-components/component/menu.tsx @@ -1,4 +1,4 @@ -import type { BaseTable } from '@visactor/vtable/src/core'; +import type { BaseTable } from '@visactor/vtable/es/core'; import type { BaseComponentProps } from '../base-component'; import { createComponent } from '../base-component'; import type { TYPES } from '@visactor/vtable'; diff --git a/packages/vtable-calendar/src/event/type.ts b/packages/vtable-calendar/src/event/type.ts index b6c4609e3..f070a68c1 100644 --- a/packages/vtable-calendar/src/event/type.ts +++ b/packages/vtable-calendar/src/event/type.ts @@ -1,6 +1,6 @@ import type { MousePointerCellEvent } from '@visactor/vtable'; import type { IEventData } from '../custom/custom-handler'; -import type { SelectedCellEvent } from '@visactor/vtable/src/ts-types'; +import type { SelectedCellEvent } from '@visactor/vtable/es/ts-types'; export interface CalendarEvents { /** diff --git a/packages/vtable-calendar/src/month-calendar.ts b/packages/vtable-calendar/src/month-calendar.ts index 4a034c9b3..23c7b3d1c 100644 --- a/packages/vtable-calendar/src/month-calendar.ts +++ b/packages/vtable-calendar/src/month-calendar.ts @@ -14,7 +14,7 @@ import type { CalendarEventListener } from './event/type'; import { CALENDAR_EVENT_TYPE } from './event/type'; -import type { EventListenerId } from '@visactor/vtable/src/ts-types'; +import type { EventListenerId } from '@visactor/vtable/es/ts-types'; import { isArray } from '@visactor/vutils'; export interface CalendarConstructorOptions { diff --git a/packages/vtable-export/src/excel/index.ts b/packages/vtable-export/src/excel/index.ts index 3b4a58ee9..18fb76694 100644 --- a/packages/vtable-export/src/excel/index.ts +++ b/packages/vtable-export/src/excel/index.ts @@ -4,7 +4,7 @@ import type { CellType, IVTable } from '../util/type'; import { getCellAlignment, getCellBorder, getCellFill, getCellFont } from './style'; import { updateCell, renderChart, graphicUtil } from '@visactor/vtable'; import { isArray } from '@visactor/vutils'; -import type { ColumnDefine, IRowSeriesNumber } from '@visactor/vtable/src/ts-types'; +import type { ColumnDefine, IRowSeriesNumber } from '@visactor/vtable/es/ts-types'; import { getHierarchyOffset } from '../util/indent'; import { isPromise } from '../util/promise'; diff --git a/packages/vtable-plugins/src/custom-cell-style.ts b/packages/vtable-plugins/src/custom-cell-style.ts index 2227b6c64..fae498d56 100644 --- a/packages/vtable-plugins/src/custom-cell-style.ts +++ b/packages/vtable-plugins/src/custom-cell-style.ts @@ -7,8 +7,8 @@ import type { FullExtendStyle } from '@visactor/vtable/es/ts-types'; import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; -import type { Style } from '@visactor/vtable/src/body-helper/style'; -import { Factory } from '@visactor/vtable/src/core/factory'; +import type { Style } from '@visactor/vtable/es/body-helper/style'; +import { Factory } from '@visactor/vtable/es/core/factory'; export class CustomCellStylePlugin { table: BaseTableAPI; diff --git a/packages/vtable/examples/vite.config.js b/packages/vtable/examples/vite.config.js index 18c0355e6..46c0a3f27 100644 --- a/packages/vtable/examples/vite.config.js +++ b/packages/vtable/examples/vite.config.js @@ -16,7 +16,8 @@ module.exports = { '@visactor/vtable-editors': path.resolve(__dirname, '../../vtable-editors/src/index.ts'), '@visactor/vtable-plugins': path.resolve(__dirname, '../../vtable-plugins/src/index.ts'), '@src': path.resolve(__dirname, '../src/'), - '@vutils-extension': path.resolve(__dirname, '../src/vutil-extension-temp') + '@vutils-extension': path.resolve(__dirname, '../src/vutil-extension-temp'), + '@visactor/vtable/es': path.resolve(__dirname, '../src/') } }, plugins: [ From 8532d4626f44ad441e3b7b8429c4be998dfe79b3 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 17:24:24 +0800 Subject: [PATCH 18/24] docs: add contributing docs --- ...-Setting-Up-the-Development-Environment.md | 119 +++++++ .../en/2-Howto Submit an Issue.md | 59 ++++ .../en/3-How to Contribute Documentation.md | 258 +++++++++++++++ .../en/4-How to Contribute to a Demo.md | 246 +++++++++++++++ .../en/5-How to Contribute Code.md | 244 ++++++++++++++ docs/assets/contributing/menu.json | 40 +++ ...-Setting-Up-the-Development-Environment.md | 129 ++++++++ .../zh/2-Howto Submit an Issue.md | 69 ++++ .../zh/3-How to Contribute Documentation.md | 297 ++++++++++++++++++ .../zh/4-How to Contribute to a Demo.md | 256 +++++++++++++++ .../zh/5-How to Contribute Code.md | 270 ++++++++++++++++ docs/menu.json | 4 + docs/vite.config.js | 2 + 13 files changed, 1993 insertions(+) create mode 100644 docs/assets/contributing/en/1-Setting-Up-the-Development-Environment.md create mode 100644 docs/assets/contributing/en/2-Howto Submit an Issue.md create mode 100644 docs/assets/contributing/en/3-How to Contribute Documentation.md create mode 100644 docs/assets/contributing/en/4-How to Contribute to a Demo.md create mode 100644 docs/assets/contributing/en/5-How to Contribute Code.md create mode 100644 docs/assets/contributing/menu.json create mode 100644 docs/assets/contributing/zh/1-Setting-Up-the-Development-Environment.md create mode 100644 docs/assets/contributing/zh/2-Howto Submit an Issue.md create mode 100644 docs/assets/contributing/zh/3-How to Contribute Documentation.md create mode 100644 docs/assets/contributing/zh/4-How to Contribute to a Demo.md create mode 100644 docs/assets/contributing/zh/5-How to Contribute Code.md diff --git a/docs/assets/contributing/en/1-Setting-Up-the-Development-Environment.md b/docs/assets/contributing/en/1-Setting-Up-the-Development-Environment.md new file mode 100644 index 000000000..b05c184af --- /dev/null +++ b/docs/assets/contributing/en/1-Setting-Up-the-Development-Environment.md @@ -0,0 +1,119 @@ +--- +title: 1-Setting-Up-the-Development-Environment + +key words: VisActor, VChart, VTable, VStory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, GIS, LLM +--- +# Github + +## 1.1 Register an Account + +The VisActor team usually develops and maintains issues on GitHub. Please visit [GitHub](https://github.com/), click the `Sign up` button on the top right to register your account, and start your journey into open source. + +If you are unable to access GitHub due to certain restrictions, please let us know and use [Gitee](https://gitee.com/VisActor/VTable) for project development. + +## 1.2 Fork the Project + +First, you need to fork this project. Go to the [VTable project page](https://github.com/VisActor/VTable) and click the Fork button on the top right. + + + +The project will appear as xxxx (your GitHub username)/vtable in your GitHub account. + + + +# Local Development Environment + +## 2.1 Install Git + +Since the code is hosted on GitHub, we use git for version control. + +Git is a version control system that helps track and manage code changes in software development projects. It aids developers in recording and managing code history, making team collaboration, code version control, and code merging easier. With Git, you can track each version of every file, switching and comparing between different versions easily. Git also offers branch management features, enabling simultaneous multiple parallel development tasks. + +* Visit the Git official website: [https://git-scm.com/](https://git-scm.com/) + +* Download the latest version of the Git installer. + +* Run the downloaded installer and follow the prompts in the installation wizard. + +* After installation, you can verify the installation by using `git version` in the command line. + +``` +HM4G2J09L6:~ xuanhun$ git version +**git version 2.39.2 (Apple Git-143)** +``` + +## 2.2 Install a Development Tool (Recommended: VSCode) + +VisActor predominantly uses a frontend tech stack. There are many tools available for frontend development, but we recommend using VSCode. Of course, you can use any development tool you prefer. + +If you're not familiar with VSCode, it might be helpful to read the official documentation: https://vscode.js.cn/docs/setup/setup-overview + +## 2.3 Install Doubao Marscode AI Programming Assistant + + +[Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + + +Doubao MarsCode Programming Assistant is an AI coding assistant from Doubao that provides AI features represented by intelligent code completion. It supports mainstream programming languages and IDEs, offering suggestions for writing a single line of code or an entire function during development. In addition, it offers features like code explanation, unit test generation, and problem fixing, improving development efficiency and quality. For more information, please refer to the [Doubao MarsCode Programming Assistant documentation](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a). + + + +With Marscode, VisActor developers can more easily understand code, write documentation, develop features, and perform unit testing. Detailed examples will be provided in specific task contribution guides. + + + +## 2.4 Clone the Code to Local + +Enter the VTable folder and add the remote address for VTable. + +``` +git remote add upstream https://github.com/VisActor/VTable.git +``` + +Get the latest source code for VTable. + +``` +git pull upstream develop +``` + +# Initialize the Project + +First, globally install [@microsoft/rush](https://rushjs.io/pages/intro/get_started/) + +``` +$ npm i --global @microsoft/rush +``` + +Then, execute the command to view the demo + +``` +# Install dependencies +$ rush update +# Start the demo page for vtable +$ cd ./packages/vtable && rushx demo +# Start the demo page for react-vtable +$ cd ./packages/react-vtable && rushx start +# Start the local documentation site +$ rush docs +``` + +# Next Steps + +At this point, you have completed the preparations for developing the code. Please continue reading the next tutorial to begin working on different types of tasks. + +github: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor WeChat subscription message (you can join the WeChat group via the subscription menu): + + + +VisActor official website: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu group: + + + +discord: https://discord.com/invite/3wPyxVyH6m + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/en/2-Howto Submit an Issue.md b/docs/assets/contributing/en/2-Howto Submit an Issue.md new file mode 100644 index 000000000..073f6353c --- /dev/null +++ b/docs/assets/contributing/en/2-Howto Submit an Issue.md @@ -0,0 +1,59 @@ +--- +title: 2. How to Submit an Issue + +key words: VisActor, VChart, VTable, VStrory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, Gis, LLM +--- +In each project's issues section, you can create, search, and manage issues. + +For example, VTable issues: [https://github.com/VisActor/VTable/issues](https://github.com/VisActor/VTable/issues) + + + +# Check for Existing Issues + +You can determine if an issue already exists by using search filters and reviewing issue details. + +# Create a New Issue + +If no similar issue is found, you can click the "New issue" button. + + + +Select "**Documentation Request**", click the "Get Start" button, and fill out the issue form. + + + +# **Submit the Issue** + +Once the issue form is completed, click the "Submit new issue" button to submit your issue. + +# **Follow Up on the Issue** + +After submission, you can monitor the status of your issue in the repository's "Issues" tab. The project developers might ask for more information or inform you that they are addressing the issue. + +# **Close the Issue** + +If your problem has been resolved or your request has been fulfilled, the project developers will close the issue. You may also close the issue yourself if you believe it has been resolved or if further assistance is no longer needed. + +By following these steps, you can successfully submit an issue for an open-source project on GitHub. Remember to be as detailed and clear as possible when describing your issue, as this helps project developers understand and resolve your problem more quickly. + +# Next Steps + +By now, you should be familiar with the concept of issues. Please continue reading the next section of the tutorial to start on different types of tasks. + +GitHub: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor WeChat Subscription (You can join the WeChat group via the subscription menu): + + + +VisActor Official Website: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu Group: + + + +Discord: [https://discord.com/invite/3wPyxVyH6m](https://discord.com/invite/3wPyxVyH6m) + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/en/3-How to Contribute Documentation.md b/docs/assets/contributing/en/3-How to Contribute Documentation.md new file mode 100644 index 000000000..a4b1af0b6 --- /dev/null +++ b/docs/assets/contributing/en/3-How to Contribute Documentation.md @@ -0,0 +1,258 @@ +--- +title: 3-How to Contribute Documentation + +keywords: VisActor, VChart, VTable, VStory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, Gis, LLM +--- +# Create a Branch + +The default branch for VTable is the develop branch. Whether it is for feature development, bug fixes, or documentation writing, please create a new branch and then merge it into the develop branch. Use the following command to create a branch: + +```bash +// Create a documentation/demo branch +git checkout -b docs/add-funnel-demo +``` + +# Find or Create an Issue + +In principle, we require each PR to have a corresponding issue. Before starting development, please confirm whether there is a corresponding issue, and that the issue has not been claimed. + +## Search for Documentation Issues + +You can search for documentation-related issues using the following filter: + +``` +is:open label:docs +``` + + + +Some features may be associated with the doc label, so check if the issue is purely a documentation task. + +## Create a Documentation Issue + +Click "NEW ISSUE" to open the issue selection page, then select “**Documentation Request**.” + + + +Fill out the relevant information for the documentation issue you want to submit. + + + +# Claim an Issue + +If you want to write or edit documentation bugs, you can leave a comment on the issue to claim it. An administrator will contact you, and after confirmation, the issue will be assigned to you. + +For example: + + + +# Create or Modify Documentation + +The locations of VTable documentation and demos in the project are as follows: + + + +The current documentation types are as follows: + +* api: Interface documentation, corresponding site: https://www.visactor.io/vtable/api/API/vtable +* changelog: Log, corresponding site: https://www.visactor.io/vtable/changelog/release +* demos: Independent running demos for debugging purposes +* examples: Graph examples, corresponding sites: +https://www.visactor.io/vtable/example +https://www.visactor.io/vtable/example-react +https://www.visactor.io/vtable/example-openinula +https://www.visactor.io/vtable/example-vue +* faq: FAQs, corresponding site: https://www.visactor.io/vtable/faq/1-How%20to%20implement%20multi-level%20headers%20in%20a%20basic%20table +* guide: Tutorials, corresponding site: https://www.visactor.io/vtable/guide/Getting_Started/Getting_Started +* option: Specification descriptions, corresponding site: https://www.visactor.io/vtable/option/ListTable +* contributing: Community contributor documentation, corresponding site: https://www.visactor.io/vtable/guide/contributing_docs/Contribution_Guide + +Find the corresponding location to add or modify the document. Note that some documents need to maintain the “menu.json” file as well. + + + +This file corresponds to the final position and name of the document displayed on the site. For example: + + + +# Use Doubao Marscode AI Programming Assistant + +[Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + +Using Doubao [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) can provide comprehensive assistance throughout the entire process of document creation. + +If you haven't installed the [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a), please download it from the following link: https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + +In document writing, using context commands appropriately can improve content accuracy. + +`**⭐️ #Workspace**` + +Select the global code from Workspace as context, and the AI will automatically find related code context based on user queries. + + + +`**⭐️ #Files**` + +Search and select files from the code repository as context + + + +`**⭐️ #Code**` + +Search and select functions or classes from the code repository as context + + + +Below is an example of how to use the [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) for document writing. + +## 5.1 Provide Document Writing Ideas + +Here, **by invoking #Workspace** and then asking it to help generate an outline for a developer document. + + + +## 5.2 Generate Project Structure Description + +Here, **by invoking #Workspace** and then asking it to help generate a project structure description document. + + + +We can still ask further questions about subfolders. + + + +## 5.3 Generate File or Code Details + +### 5.3.1 Generate Code Explanation + +When we select a piece of code in a file, we can choose the Explain command from the floating menu, and [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will generate a detailed code explanation for us. We can use this as a basis for proofreading and adaptation. + + + +You can also directly input the Explain command in the dialogue box. + + + +Here you can also directly use the previously mentioned #Code context to combine Explain with your instructions for more detailed tasks. + +### 5.3.2 Generate Explanations for Entire Files + +Explain can be used in conjunction with Context or Files commands to generate explanations for entire files. + + + +## 5.4 Generate Sample Code + +To better explain principles and usage, it is often necessary to provide a demo that can be practically run. You can use [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a)'s code generation capabilities to generate sample code for us. However, currently the code generation capabilities of various AIs cannot guarantee accuracy and require further verification. + +## 5.5 Content Search + +For each Q&A, [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will usually provide reference documentation, which can offer more contextual references for further analysis. + + + +You can also directly perform file searches: + + + +## 5.6 Translate Documents + +VisActor's documentation needs to be provided in both Chinese and English, and Marscode can assist in translation. + +# Submit Code + +After completing the documentation, first push the code to your remote branch. For example: + +```bash +git commit -a -m "docs: add custom funnel demo and related docs" +``` + +VisActor follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for commit messages: + +`[optional scope]: ` + +Common `type`s include docs (documentation, log changes), feat (new features), fix (bug fixes), refactor (code refactoring), and others. Please choose according to the actual situation. + +Write the description in concise and accurate English. + +Before submitting a commit, we will conduct a commit lint check. You can view the [rules for checking](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js). + +A common issue is when the remote upstream (@visactor/vtable) has new updates, leading to conflicts when submitting a Pull Request. Therefore, before submission, we can merge other developers' remote commits into ours. Use the following command to switch to the develop branch: + +```bash +git checkout develop +``` + +Use the following command to pull the latest code from upstream: + +```bash +git pull upstream develop +``` + +Switch back to your development branch: + +```bash +git checkout docs/add-funnel-demo +``` + +Merge the develop branch's commits into your branch: + +```bash +git rebase develop +``` + +Push the updated code to your branch: + +```bash +git push origin docs/add-funnel-demo +``` + +# Submit a PR + +You can click the `Compare & pull request` button on your GitHub repository page. + + + +Or create it through the `contribute` button: + +Fill out the template with the changes submitted: + +* Check the type of modification + + + +* Fill in the associated issue + + + +* If there are complex changes, please explain the background and solution + + + +Once the relevant information is filled in, click Create pull request to submit. + +The administrator will review the PR to decide whether to approve it. If not approved, modifications are needed and it must be resubmitted. + +# Next Steps + +Among different documentation types, demo documents have some special requirements, which can be referenced in the "How to Contribute a Demo" section. + +You can then continue to attempt different types of tasks. + +GitHub: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +Leave a message on the VisActor WeChat public account (you can join the WeChat group through the public account menu): + + + +Official website of VisActor: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu group: + + + +Discord: https://discord.com/invite/3wPyxVyH6m +``` + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/en/4-How to Contribute to a Demo.md b/docs/assets/contributing/en/4-How to Contribute to a Demo.md new file mode 100644 index 000000000..a8b7c877f --- /dev/null +++ b/docs/assets/contributing/en/4-How to Contribute to a Demo.md @@ -0,0 +1,246 @@ +--- +title: 4. How to Contribute to a Demo + +key words: VisActor, VChart, VTable, VStory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, GIS, LLM +--- + +# Creating a Branch + +The default branch for VTable is the develop branch. Whether it's for feature development, bug fixes, or documentation writing, please create a new branch before merging it into the develop branch. Use the following code to create a branch: + +``` +// Create a documentation/demo branch +git checkout -b docs/add-funnel-demo + +``` + +# Finding or Creating an Issue + +In principle, we require that each PR must have a corresponding issue. Before starting development, please ensure there is a corresponding issue, and that the issue is not already claimed. + +## Searching for Demo Issues + +You can search for demo-related issues using the following method: + +``` + label:demos + +``` + + +Some features may have the doc label associated with them. Check further if the issue is purely a demo task. + +## Creating a Demo Issue + +Click "NEW ISSUE" to open the issue selection page and choose "**Others**." + + + +Fill in the information related to the document issue you want to submit, and tag it with "demos." + + + +# Claiming an Issue + +If you want to submit a demo or fix a demo bug, you can leave a message in the issue to claim it. The administrator will contact you, and after confirmation, assign the issue to you. + +For example: + + + +# Creating or Modifying a Demo + +The location of VTable documentation and demos within the project is as follows (examples): + + + +Taking the example document of a basic area chart as an example (currently, a single example contains both Chinese and English versions, located under the paths zh & en respectively): + + + +Example Markdown content is divided into several parts: + +* Metadata: Attribute definitions of the example content, including chart category, cover image, keywords, etc. + +* Title: The main content under the first-level title corresponds to the description information of the example. + +* Key Configuration: Explanation of the key configurations included in the example, which will be displayed in the "Key Configuration" section on the right side of the example page. + +* Code Demonstration: The specific code content executed in the example; currently only native JavaScript code is supported. + +The field definitions of Markdown metadata are: + +* group: The classification information of the example, describing which chart category the current example belongs to. + +* title: The example title + +* keywords: Keywords of the example + +* order: The order criterion of the example within the same group + +* cover: The cover image of the example + +* tutorial: The tutorial link to jump to (the default example tutorial will jump to the tutorial corresponding to the example group) + +Currently, chart examples in the group include multiple categories such as area chart, bar chart, combination, storytelling, etc., corresponding to all categories under the vtable example gallery. Refer to existing example documents for specific classification fields. + + + +# Writing Demos with the Help of Doubao Marscode AI Programming Assistant +[Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + +With the help of Doubao [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a), you can get comprehensive assistance throughout the document creation process. + +If you haven't installed the [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a), please download it from this link: https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + +During demo writing, using context instructions reasonably can improve content accuracy. + +`**⭐️ #Workspace**` + +Select global code in the Workspace as context; AI will automatically find related code Context according to user Query. + + + +`**⭐️ #Files**` + +Search and select files in the code repository as context + + + +`**⭐️ #Code**` + +Search and select functions or classes in the code repository as context + + + +Below is an example of how to use the [Marscode AI Programming Assistant](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) for demo writing. + +## 5.1 Providing a Document Framework + +Here **invoke #Workspace**, then ask a question, select a document content of an example and hope it generates a new example document in the same manner. + + + +We can continue to make adjustments on this basis. + +## 5.2 Generating Descriptive Text + +The description text for each demo can be initially generated using [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a), and then proofread and adjusted. For example: + + + +## 5.3 Generating Example Code + +To better explain principles and usage, it is usually necessary to provide a runnable demo. The code generation capability of [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) can be used to generate example code. However, the current code generation capabilities of various AIs cannot guarantee accuracy and require further verification. + +## 5.4 Content Retrieval + +Usually, in each Q&A, [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will provide reference documents, which can offer more contextual references for further analysis. + + + +You can also perform file retrieval directly: + + + +# Submitting Code + +After the document is completed, push the code to your remote branch, for example: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + +The commit message for VisActor follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) convention. **For demo, use docs** + +`[optional scope]: ` + +Common `type` includes docs (documentation/log modifications), feat (new feature), fix (bug fix), refactor (code restructuring), etc., please choose based on the actual situation. + +Please write the description in brief and precise English. + +Before submitting a commit, we perform a commit lint check, which you can check in the [check rules](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js). + +A common issue is that the remote upstream (@visactor/vtable) has new updates, which can lead to conflicts during the submission of a Pull Request. Thus, before submission, you can merge the commits from other developers remotely into your commit. Use the following code to switch to the develop branch: + +``` +git checkout develop + +``` + +Use the following code to pull the latest remote code: + +``` +git pull upstream develop + +``` + +Switch back to your development branch: + +``` +git checkout docs/add-funnel-demo + +``` + +Merge the develop commits into your branch: + +``` +git rebase develop + +``` + +Push the updated code to your branch: + +``` +git push origin docs/add-funnel-demo + +``` + +# Submitting a PR + +You can click the `Compare & pull request` button on your GitHub repository page. + + + +Or create via the `contribute` button: + +Fill in the modified content of this submission according to the template: + +* Check what type of modification this is + + + +* Fill in the associated issue + + + +* If there are complex changes, explain the background and solution + + + +After filling in the relevant information, click Create pull request to submit. + +The administrator will review the PR to decide whether to approve it; if not, modifications need to be made, and a resubmission is required. + +# Next Step + +Next, you can continue to explore different types of tasks. + +GitHub: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor WeChat subscription account message (you can join the WeChat group through the subscription account menu): + + + +VisActor Official Website: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu Group: + + + +Discord: https://discord.com/invite/3wPyxVyH6m + + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/en/5-How to Contribute Code.md b/docs/assets/contributing/en/5-How to Contribute Code.md new file mode 100644 index 000000000..edaf41203 --- /dev/null +++ b/docs/assets/contributing/en/5-How to Contribute Code.md @@ -0,0 +1,244 @@ +--- +title: 5. How to Contribute Code + +key words: VisActor, VChart, VTable, VStory, VMind, VGrammar, VRender, Visualization, Chart, Data, Table, Graph, GIS, LLM +--- +# Creating a Branch + +The default branch for VTable is the develop branch. For any feature development, bug fixes, or documentation writing, please create a new branch and then merge it into the develop branch. Use the following code to create a branch: + +``` +// Create a documentation, demo branch +git checkout -b docs/add-funnel-demo + +``` + +# Finding or Creating an Issue + +In principle, we require every PR to have a corresponding issue. Before starting development, please confirm whether there is a corresponding issue, and the issue has not been claimed. + +## Search for Issues + +You can search for bug or feature-related issues in the following way: + + + +## Create Code-Related Issues + +Click "NEW ISSUE" to open the issue selection page, and choose "**Bug Report" or "Feature Request".** + + + +Fill in the relevant information for the document issue you want to submit and apply the appropriate tags. + + + +# Claiming an Issue + +If you want to contribute code, you can leave a message to claim the issue. An administrator will contact you and, upon confirmation, assign the issue to you. + +For example: + + + +# Writing Code + +The source code for VTable is located in the following way within the project: + + + +All the components of the VTable ecosystem are in the same directory, split by package name. Developers need to develop code in their own code branch and then submit it. + +# Writing Code with Marscode AI Programming Assistant + +With the help of the Marscode AI Programming Assistant, comprehensive assistance can be provided throughout the coding process. + +If you have not installed the Marscode AI Programming Assistant, please download it from this link: https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + +When writing code, using context commands appropriately can improve the accuracy of content. + +`**⭐️ #Workspace**` + +Select global code from Workspace as context, and AI will automatically find relevant code context based on the user's Query. + + + +`**⭐️ #Files**` + +Search and select files in the code repository as context. + + + +`**⭐️ #Code**` + +Search and select functions and classes in the code repository as context. + + + +Below is an example of how to use the Marscode AI Programming Assistant for coding. + +## 5.1 Quickly Familiarize with the Entire Repository + +Here, use ** # to summon #Workspace ** and then ask it to help generate a project structure description document. + + + +We can still ask further questions about subfolders. + + + +## 5.2 Explaining Code + +### 5.2.1 Generate Code Descriptions + +When we select a piece of code in a file, we can choose the Explain command from the floating menu, and [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will generate a detailed code explanation for us, which we can proofread and adapt. + + + +You can also directly enter the Explain command in the dialog box. + + + +Here, you can also directly use the #Code context mentioned above to combine Explain with your instructions for more detailed tasks. + +### 5.2.2 Generate Explanation for the Entire File + +Explain can be used with Context or Files commands to generate explanations for the entire file. + + + + +## 5.3 Content Retrieval + +Usually, for each Q&A session, [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) will provide reference documents, which can offer more contextual reference for further analysis. + + + +You can also directly perform file retrieval: + + + +## 5.4 Code Generation + +In daily coding, we often encounter scenarios where repetitive code is used. Sometimes you may not know if a certain function has already been implemented. At this time, use `#Workspace` to ask questions. For example: + + + +## 5.5 Adding Comments + +Use the "/doc" command to generate code comments. + + + +## 5.6 Generating Unit Tests + +The unit test code for VTable is located in the “__**tests**” directory of each package. + + + +Use the [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) "/test" command to quickly generate unit test code. + + + +## 5.7 Intelligent Suggestions + +During writing, the intelligent generation of optional code is a standard feature of the programming assistant. Please feel free to explore this feature. + +# Submitting Code + +After completing the documentation, first push the code to your remote branch. For example: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + +The commit message for VisActor follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification, **demo uses docs** + +`[optional scope]: ` + +Common types include docs (documentation, log changes), feat (new features), fix (problem fixes), refactor (code refactoring), etc. Please choose based on the actual situation. + +Please write the description with a concise and accurate English description. + +Before submitting a commit, we will conduct commit lint checks. For more details, please see [check rules](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js). + +A common issue is that the remote upstream (@visactor/vtable) has new updates, which may cause conflicts when you submit a Pull Request. Therefore, you can merge the commits from other developers with your commits before submitting. Use the following code to switch to the develop branch: + +``` +git checkout develop + +``` +Use the following code to pull out the latest code from upstream: + +``` +git pull upstream develop + +``` +Switch back to your development branch: + +``` +git checkout docs/add-funnel-demo + +``` +Merge the commits from develop into your branch: + +``` +git rebase develop + +``` +Submit the updated code to your branch: + +``` +git push origin docs/add-funnel-demo + +``` +# Submitting a PR + +You can click the `Compare & pull request` button on your GitHub code repository page. + + + +Or create one through the `contribute` button: + +Fill in the modification details of this submission according to the template: + +* Check what type of modification this is + + + +* Fill in the associated issue + + + +* If there are complex changes, please explain the background and solution + + + +After filling in the relevant information, click Create pull request to submit. + +An administrator will review the PR to decide whether to approve it. If not approved, modifications will be needed before resubmitting. + +# Next Step + +Next, you can read the implementation principles and source code explanations of each module, or join in contributing to these documents. + +Please join the VisActor family and contribute your efforts! + +GitHub: [github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor WeChat Subscription (you can join the WeChat group through the subscription menu): + + + +VisActor Official Website: [www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +Feishu Group: + + + +Discord: https://discord.com/invite/3wPyxVyH6m + +# This Document Was Contributed By +[玄魂](https://github.com/xuanhun) + diff --git a/docs/assets/contributing/menu.json b/docs/assets/contributing/menu.json new file mode 100644 index 000000000..c5d5bb185 --- /dev/null +++ b/docs/assets/contributing/menu.json @@ -0,0 +1,40 @@ +{ + "menu": "contributing", + "children": [ + { + "path": "1-Setting-Up-the-Development-Environment", + "title": { + "zh": "1.搭建开发环境", + "en": "1-Setting-Up-the-Development-Environment" + } + }, + { + "path": "2-Howto Submit an Issue", + "title": { + "zh": "2.如何提issue", + "en": "2-Howto Submit an Issue" + } + }, + { + "path": "3-How to Contribute Documentation", + "title": { + "zh": "3.如何贡献文档", + "en": "3-How to Contribute Documentation" + } + }, + { + "path": "4-How to Contribute to a Demo", + "title": { + "zh": "4.如何贡献demo", + "en": "4-How to Contribute to a Demo" + } + }, + { + "path": "5-How to Contribute Code", + "title": { + "zh": "5.如何贡献代码", + "en": "5-How to Contribute Code" + } + } + ] +} \ No newline at end of file diff --git a/docs/assets/contributing/zh/1-Setting-Up-the-Development-Environment.md b/docs/assets/contributing/zh/1-Setting-Up-the-Development-Environment.md new file mode 100644 index 000000000..487c65158 --- /dev/null +++ b/docs/assets/contributing/zh/1-Setting-Up-the-Development-Environment.md @@ -0,0 +1,129 @@ +--- +title: 1.搭建开发环境 + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +# Github + +## 1.1 注册账号 + +VisActor 团队通常在 github 上进行开发和 issue 维护,请打开 [Github 网站](https://github.com/),点击右上角 `Sign up` 按钮,注册一个自己的账号,开启你开源之旅的第一步。 + +如果因为特殊情况,你无法打开 Github 站点,请告知我们并通过 [Gitee](https://gitee.com/VisActor/VTable) 进行项目开发。 + +## 1.2 Fork 项目 + +首先需要 fork 这个项目,进入[VTable 项目页面](https://github.com/VisActor/VTable),点击右上角的 Fork 按钮 + + + + + + + +你的 github 帐号中会出现 xxxx(你的 github 用户名)/vtable 这个项目 + + + +# 本地开发环境 + +## 2.1 安装 git + +由于代码托管在 github 上,我们使用git做版本控制。 + +Git 是一种版本控制系统,用于跟踪和管理软件开发项目中的代码变更。它帮助开发者记录和管理代码的历史记录,方便团队协作、代码版本控制、合并代码等操作。通过 Git,您可以追踪每个文件的每个版本,并轻松地在不同版本之间进行切换和比较。Git 还提供了分支管理功能,使得可以同时进行多个并行开发任务。 + +* 访问 Git 官方网站:[https://git-scm.com/](https://git-scm.com/) + +* 下载最新版本的 Git 安装程序。 + +* 运行下载的安装程序,按照安装向导的提示进行安装。 + +* 安装完成后,你可以通过命令行使用 `git version` 命令确认安装成功。 + +``` +HM4G2J09L6:~ xuanhun$ git version +**git version 2.39.2 (Apple Git-143)** + +``` +## 2.2 安装开发工具(推荐VSCode) + +VisActor 整体上属于前端技术栈,能进行前端开发的工具很多,我们推荐使用VScode。当然,你也可以使用你喜欢的开发工具。 + +如果你对VSCode 不是很熟悉的话,建议阅读官方文档:https://vscode.js.cn/docs/setup/setup-overview + +## 2.3 安装 豆包 Marscode AI编程助手 + +[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + +豆包 MarsCode 编程助手是豆包旗下的 AI 编程助手,提供以智能代码补全为代表的 AI 功能。它支持主流的编程语言和 IDE,在开发过程中提供单行代码或整个函数的编写建议。此外,它还支持代码解释、单测生成和问题修复等功能,提高了开发效率和质量。 更多信息,请参考[豆包 MarsCode 编程助手的文档](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a)。 + + + +借助Marscode,VisActor 开发者可以更方便的进行代码理解、文档撰写、功能开发、单元测试等多项任务。在详细的各项任务贡献指南中,会有更详细的案例说明。 + + + + + +## 2.4 Clone 代码到本地 + +进入 VTable 文件夹,添加 VTable 的远程地址 + +``` +git remote add upstream https://github.com/VisActor/VTable.git + +``` +获取 VTable 最新源码 + +``` +git pull upstream develop + +``` +# 初始化项目 + +首先,全局安装 [@microsoft/rush](https://rushjs.io/pages/intro/get_started/) + +``` +$ npm i --global @microsoft/rush + +``` +接下来执行命令查看demo + +``` +# 安装依赖 +$ rush update +# 启动 vtable 的demo页 +$ cd ./packages/vtable && rushx demo +# 启动 react-vtable 的demo页 +$ cd ./packages/react-vtable && rushx start +# 启动本地文档站点 +$ rush docs + +``` +# 下一步 + +到目前为止,你已经做好了开发代码的准备了。接下来请继续阅读下一节教程,开始不同类型的任务。 + + + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号留言(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/zh/2-Howto Submit an Issue.md b/docs/assets/contributing/zh/2-Howto Submit an Issue.md new file mode 100644 index 000000000..7202c1903 --- /dev/null +++ b/docs/assets/contributing/zh/2-Howto Submit an Issue.md @@ -0,0 +1,69 @@ +--- +title: 2.如何提issue + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +每个项目的issues栏目下面,可以进行issue 的创建、搜索等工作。 + +比如VTable issues:https://github.com/VisActor/VTable/issues + + + +# 确定是否存在同样的issue + +可以通过搜索过滤,查看issue细节的方式确定是否已经存在相同的issue。 + +# 创建issue + +如果没有找到类似的issue,你可以点击"New issue"按钮。 + + + +以“**Documentation Request”,**点击“Get Start”按钮,**填写issue表单。** + + + + + +# **提交issue** + +填写完issue表单后,点击"Submit new issue"按钮提交你的issue。 + +# **跟进issue** + +提交issue后,你可以在仓库的"Issues"选项卡中查看你的issue状态。项目开发者可能会要求你提供更多的信息或者告诉你他们正在处理这个issue。 + +# **关闭issue** + +如果你的问题得到了解决或者你的需求得到了满足,项目开发者会关闭这个issue。你也可以自己关闭issue,如果你认为问题已经解决或者不再需要进一步的帮助。 + + + +通过以上步骤,你可以在GitHub上成功地为开源项目提issue。记得在描述问题时尽量详细和清晰,这样有助于项目开发者更快地理解和解决你的问题。 + +# 下一步 + +到目前为止,你已经熟悉了issue 的概念。接下来请继续阅读下一节教程,开始不同类型的任务。 + + + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号留言(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/zh/3-How to Contribute Documentation.md b/docs/assets/contributing/zh/3-How to Contribute Documentation.md new file mode 100644 index 000000000..bed1ed128 --- /dev/null +++ b/docs/assets/contributing/zh/3-How to Contribute Documentation.md @@ -0,0 +1,297 @@ +--- +title: 3.如何贡献文档 + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +# 创建分支 + +VTable 默认分支为 develop 分支。无论是功能开发、bug 修复、文档编写,都请新建立一个分支,再合并到 develop 分支上。使用以下代码创建分支: + +``` +// 创建文档、demo分支 +git checkout -b docs/add-funnel-demo + +``` + + +# 寻找或者创建issue + +原则上,我们规定每一个pr都要有对应的issue。在开始开发之前,请确认是否有对应的issue,且issue没有被认领。 + +## 搜索文档issue + +可以通过如下方式搜索文档相关的issue: + +``` +is:open label:docs + +``` + + + + +其中他有些 feature 会关联doc标签,可以进一步看一下该issue 是不是纯文档任务。 + +## 创建文档issue + +点击 “NEW ISSUE”,打开issue 选择页面,选择“**Documentation Request”。** + + + +填写你要提交的文档 issue 相关信息即可。 + + + +# 认领issue + +如果你想撰写文档或者修改文档bug,可以在该issue下留言认领。管理员会联系你,确认后将issue assign 给你。 + +例如: + + + + + +# 创建或者修改文档 + +VTable 文档和demo在项目的中的位置如下: + + + +目前文档类型如下: + +* api:接口文档,对应站点 https://www.visactor.io/vtable/api/API/vtable + +* changelog:日志,对应站点:https://www.visactor.io/vtable/changelog/release + +* demos:一些可以独立运行的demo,供调试用 + +* examples:图表示例,对应站点: + +https://www.visactor.io/vtable/example + +https://www.visactor.io/vtable/example-react + +https://www.visactor.io/vtable/example-openinula + +https://www.visactor.io/vtable/example-vue + +* faq:faq 文档,对应站点:https://www.visactor.io/vtable/faq/1-How%20to%20implement%20multi-level%20headers%20in%20a%20basic%20table + +* guide:教程,对应站点:https://www.visactor.io/vtable/guide/Getting_Started/Getting_Started + +* option:option 说明,对应站点:https://www.visactor.io/vtable/option/ListTable + +* contributing:社区贡献者文档,对应站点:https://www.visactor.io/vtable/guide/contributing_docs/Contribution_Guide + + + +找到对应的文档位置进行新增或者修改。这里需要注意的是部分文档需要同时维护 “menu.json” 文件。 + + + +该文件对应文档最后在站点上显示的位置和名称等。例如 + + + +# 借助豆包 Marscode AI编程助手 进行文档写作 + +[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) + +借助豆包[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),可以在文档创作的整个流程中提供全方面的帮助。 + +如果你还没有安装[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),请从该链接进入下载页面:https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + + + +在文档写作中,合理使用 context 指令,可以提升内容的准确性。 + +`**⭐️ #Workspace**` + +选择 Workspace 中的全局代码作为上下文,AI 将根据用户 Query 自动寻找相关代码 Context + + + +`**⭐️ #Files**` + +搜索选择代码仓库中的文件作为上下文 + + + +`**⭐️ #Code**` + +搜索选择代码仓库中的函数、类作为上下文 + + + + + + + +下面举例说明,如何使用[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 进行文档写作。 + +## 5.1 提供文档写作思路 + +这里 **通过 # 唤起 #Workspace ,**然后进行提问,希望它帮忙生成一份开发者文档大纲。 + + + +## 5.2 生成项目结构说明 + +这里 **通过 # 唤起 #Workspace ,**然后进行提问,希望它帮忙生成一份项目结构说明文档。 + + + +我们仍然可以针对子文件夹,进行进一步的提问。 + + + +## 5.3 生成文件或代码详解 + +### 5.3.1 生成代码说明 + +当我们在文件中选择一段代码,可以从悬浮菜单中选择 Explain 命令,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 会为我们生成详细的代码解释。我们可以在此基础上,进行校对和改编。 + + + +也可以直接在对话框中输入Explain 命令。 + + + +这里也可以直接使用上面提到的 #Code context 来结合Explain 和你的指令来进行更细节的任务。 + +### 5.3.2 生成针对整个文件的说明 + +Explain 可以和 Context 或者 Files 命令搭配使用,用来生成针对整个文件的说明文档。 + + + + + +## 5.4 生成示例代码 + +为了更好的解释说明原理和用法,通常需要给出可以实际运行的demo,可以利用 [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 的代码生成能力为我们生成示例代码。不过目前各种AI 的代码生成能力都不能保证准确,还需要进一步的进行验证。 + + + + + +## 5.5 内容检索 + +通常我们的每个问答,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 都会给出参考文档,这些文档可以给我们提供更多参考上下文,供进一步分析。 + + + + + +也可以直接进行文件检索: + + + +## 5.6 翻译文档 +VisActor 的文档需要同时提供中英文,Marscode可以辅助用来进行翻译。 + +# 提交代码 + +文档完成之后,先把代码push到你的远程分支。例如: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + + +VisActor 的 commit 提交信息遵循 [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 规范 + +`[optional scope]: ` + +其中常用的`type`包括 docs(文档、日志修改)、feat(新功能)、fix(问题修复)、refactor(代码重构)等,请根据实际情况选择。 + +请用简短精确的英文描述编写 description + +提交 commit 之前,我们会进行 commit lint 检查,具体可以查看[检查规则](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js)。 + +一个常见的问题是远程的 upstream (@visactor/vtable) 有了新的更新, 从而会导致我们提交的 Pull Request 时会导致冲突。 因此我们可以在提交前先把远程其他开发者的 commit 和我们的 commit 合并。使用以下代码切换到 develop 分支: + +``` +git checkout develop + +``` +使用以下代码拉出远程的最新代码: + +``` +git pull upstream develop + +``` +切换回自己的开发分支: + +``` +git checkout docs/add-funnel-demo + +``` +把 develop 的 commit 合并到自己分支: + +``` +git rebase develop + +``` +把更新代码提交到自己的分支中: + +``` +git push origin docs/add-funnel-demo + +``` +# 提交PR + +你可以在你的 github 代码仓库页面点击 `Compare & pull request` 按钮。 + + + +或通过 `contribute` 按钮创建: + +按照模板填写本次提交的修改内容: + +* 勾选这是什么类型的修改 + + + +* 填写关联的 issue + + + +* 若有复杂变更,请说明背景和解决方案 + + + +相关信息填写完成后,点击 Create pull request 提交。 + +管理员会review pr 决定是否通过,如果不通过需要进行修改然后重新提交。 + +# 下一步 + +不同的文档类型中,demo 文档有一些特殊要求,可以参考“如何贡献demo”一节。 + +接下来可以继续尝试不同类型的任务。 + + + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号留言(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/zh/4-How to Contribute to a Demo.md b/docs/assets/contributing/zh/4-How to Contribute to a Demo.md new file mode 100644 index 000000000..22884e183 --- /dev/null +++ b/docs/assets/contributing/zh/4-How to Contribute to a Demo.md @@ -0,0 +1,256 @@ +--- +title: 4.如何贡献demo + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +# 创建分支 + +VTable 默认分支为 develop 分支。无论是功能开发、bug 修复、文档编写,都请新建立一个分支,再合并到 develop 分支上。使用以下代码创建分支: + +``` +// 创建文档、demo分支 +git checkout -b docs/add-funnel-demo + +``` + + +# 寻找或者创建issue + +原则上,我们规定每一个pr都要有对应的issue。在开始开发之前,请确认是否有对应的issue,且issue没有被认领。 + +## 搜索demo issue + +可以通过如下方式搜索 demo 相关的issue: + +``` + label:demos + +``` + + +其中他有些 feature 会关联doc标签,可以进一步看一下该issue 是不是纯 demo 任务。 + +## 创建demo issue + +点击 “NEW ISSUE”,打开issue 选择页面,选择“**Others”。** + + + +填写你要提交的文档 issue 相关信息,并打上“demos”标签即可。 + + + +# 认领issue + +如果你想提交 demo 或者修改demo bug,可以在该issue下留言认领。管理员会联系你,确认后将issue assign 给你。 + +例如: + + + + + +# 创建或者修改 demo + +VTable 文档和demo在项目的中的位置如下(demos): + + + +以基础面积图的示例文档为例(目前一份示例同时包含中英文版本,分别在 zh & en 的路径下): + + + +示例 Markdown 内容分为几个部分: + +* 元信息:示例内容的属性定义,包括图表分类、封面图、关键词等; + +* 标题:一级标题下的正文内容对应了示例的描述信息; + +* 关键配置:示例中所包含的关键配置说明,这一部分将在示例页面右侧的“关键配置”中呈现; + +* 代码演示:示例执行的具体代码内容,目前只支持原生的 JavaScript 代码。 + +其中 Markdown 的元信息的字段定义为: + +* group:示例的分类信息,描述了当前示例属于什么图表类别 + +* title:示例的标 + +* keywords:示例的关键词 + +* order:示例在同个分组下的排序依据 + +* cover:示例的封面图 + +* tutorial:跳转的教程链接(默认的示例教程将会跳转到示例分组所对应的教程) + +目前图表示例的 group 包含多个分类,对应到 vtable 示例画廊中全部图表下的分类。具体的分类字段可以参照已有的示例文档进行填写。 + + + + + +# 借助豆包 Marscode AI编程助手进行demo编写 + +借助豆包[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),可以在文档创作的整个流程中提供全方面的帮助。 + +如果你还没有安装[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),请从该链接进入下载页面:https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + + + +在demo编写中,合理使用 context 指令,可以提升内容的准确性。 + +`**⭐️ #Workspace**` + +选择 Workspace 中的全局代码作为上下文,AI 将根据用户 Query 自动寻找相关代码 Context + + + +`**⭐️ #Files**` + +搜索选择代码仓库中的文件作为上下文 + + + +`**⭐️ #Code**` + +搜索选择代码仓库中的函数、类作为上下文 + + + + + +下面举例说明,如何使用[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 进行demo编写。 + +## 5.1 提供文档框架 + +这里 **通过 # 唤起 #Workspace ,**然后进行提问,选中一份example 的文档内容,希望它仿照生成一份新的 example 文档。 + + + +我们可以在此基础上继续细节的调整。 + +## 5.2 生成说明文字 + +每个demo的说明文字可以先用 [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 生成,然后再做校对和调整。比如: + + + +## 5.3 生成示例代码 + +为了更好的解释说明原理和用法,通常需要给出可以实际运行的demo,可以利用 [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 的代码生成能力为我们生成示例代码。不过目前各种AI 的代码生成能力都不能保证准确,还需要进一步的进行验证。 + +## 5.4 内容检索 + +通常我们的每个问答,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 都会给出参考文档,这些文档可以给我们提供更多参考上下文,供进一步分析。 + + + + + +也可以直接进行文件检索: + + + +# 提交代码 + +文档完成之后,先把代码push到你的远程分支。例如: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + + +VisActor 的 commit 提交信息遵循 [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 规范,**demo 使用docs** + +`[optional scope]: ` + +其中常用的`type`包括 docs(文档、日志修改)、feat(新功能)、fix(问题修复)、refactor(代码重构)等,请根据实际情况选择。 + +请用简短精确的英文描述编写 description + +提交 commit 之前,我们会进行 commit lint 检查,具体可以查看[检查规则](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js)。 + +一个常见的问题是远程的 upstream (@visactor/vtable) 有了新的更新, 从而会导致我们提交的 Pull Request 时会导致冲突。 因此我们可以在提交前先把远程其他开发者的 commit 和我们的 commit 合并。使用以下代码切换到 develop 分支: + +``` +git checkout develop + +``` +使用以下代码拉出远程的最新代码: + +``` +git pull upstream develop + +``` +切换回自己的开发分支: + +``` +git checkout docs/add-funnel-demo + +``` +把 develop 的 commit 合并到自己分支: + +``` +git rebase develop + +``` +把更新代码提交到自己的分支中: + +``` +git push origin docs/add-funnel-demo + +``` +# 提交PR + +你可以在你的 github 代码仓库页面点击 `Compare & pull request` 按钮。 + + + +或通过 `contribute` 按钮创建: + +按照模板填写本次提交的修改内容: + +* 勾选这是什么类型的修改 + + + +* 填写关联的 issue + + + +* 若有复杂变更,请说明背景和解决方案 + + + +相关信息填写完成后,点击 Create pull request 提交。 + +管理员会review pr 决定是否通过,如果不通过需要进行修改然后重新提交。 + +# 下一步 + +接下来可以继续尝试不同类型的任务。 + + + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号留言(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/assets/contributing/zh/5-How to Contribute Code.md b/docs/assets/contributing/zh/5-How to Contribute Code.md new file mode 100644 index 000000000..e1f7c965d --- /dev/null +++ b/docs/assets/contributing/zh/5-How to Contribute Code.md @@ -0,0 +1,270 @@ +--- +title: 5.如何贡献代码 + +key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM +--- +# 创建分支 + +VTable 默认分支为 develop 分支。无论是功能开发、bug 修复、文档编写,都请新建立一个分支,再合并到 develop 分支上。使用以下代码创建分支: + +``` +// 创建文档、demo分支 +git checkout -b docs/add-funnel-demo + +``` + + +# 寻找或者创建issue + +原则上,我们规定每一个pr都要有对应的issue。在开始开发之前,请确认是否有对应的issue,且issue没有被认领。 + +## 搜索 issue + +可以通过如下方式搜索 bug 或者 feature 相关的issue: + + + +## 创建代码相关 issue + +点击 “NEW ISSUE”,打开issue 选择页面,选择“**Bug Report” 或者 “Feature Request”。** + + + +填写你要提交的文档 issue 相关信息,并打上合适的标签即可。 + + + +# 认领issue + +如果你想贡献代码,可以在该issue下留言认领。管理员会联系你,确认后将issue assign 给你。 + +例如: + + + + + +# 编写代码 + +VTable 源码在项目的中的位置如下: + + + +VTable 生态所有的组件都在同一目录下,按包名进行拆分,开发者需要在自己的代码分支上开发代码,然后进行提交。 + +# 借助豆包 Marscode AI编程助手 进行代码编写 + +借助豆包[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),可以在代码编写的整个流程中提供全方面的帮助。 + +如果你还没有安装[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a),请从该链接进入下载页面:https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a + + + +在代码编写中,合理使用 context 指令,可以提升内容的准确性。 + +`**⭐️ #Workspace**` + +选择 Workspace 中的全局代码作为上下文,AI 将根据用户 Query 自动寻找相关代码 Context + + + +`**⭐️ #Files**` + +搜索选择代码仓库中的文件作为上下文 + + + +`**⭐️ #Code**` + +搜索选择代码仓库中的函数、类作为上下文 + + + + + +下面举例说明,如何使用[Marscode AI编程助手](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 进行代码编写。 + +## 5.1 快速熟悉整个仓库 + +这里 **通过 # 唤起 #Workspace ,**然后进行提问,希望它帮忙生成一份项目结构说明文档。 + + + +我们仍然可以针对子文件夹,进行进一步的提问。 + + + +## 5.2 解释代码 + +### 5.2.1 生成代码说明 + +当我们在文件中选择一段代码,可以从悬浮菜单中选择 Explain 命令,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 会为我们生成详细的代码解释。我们可以在此基础上,进行校对和改编。 + + + +也可以直接在对话框中输入Explain 命令。 + + + +这里也可以直接使用上面提到的 #Code context 来结合Explain 和你的指令来进行更细节的任务。 + +### 5.2.2 生成针对整个文件的说明 + +Explain 可以和 Context 或者 Files 命令搭配使用,用来生成针对整个文件的说明文档。 + + + + + + + +## 5.3 内容检索 + +通常我们的每个问答,[Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) 都会给出参考文档,这些文档可以给我们提供更多参考上下文,供进一步分析。 + + + + + +也可以直接进行文件检索: + + + +## 5.4 代码生成 + +在日常编码中经常会碰到使用重复代码的场景,有时候可能并不知道某个功能是否有现成的函数已实现,此时用 `#Workspace` 来进行提问。例如: + + + +## 5.5 添加注释 + +使用 "/doc"命令生成代码注释。 + + + + + +## 5.6 生成单测 + +VTable 单元测试代码在每个 package 的 “__**tests**__” 目录下。 + + + +使用 [Marscode](https://www.marscode.cn/home?utm_source=developer&utm_medium=oss&utm_campaign=visactor_a) “/test” 指令可以快速的生成单测代码。 + + + + + +## 5.7 智能提示 + +编写过程中,智能生成可选代码是编程助手的标配功能,大家自行体验吧。 + + + +# 提交代码 + +文档完成之后,先把代码push到你的远程分支。例如: + +``` +git commit -a -m "docs: add custom funnel demo and related docs" + +``` + + +VisActor 的 commit 提交信息遵循 [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 规范,**demo 使用docs** + +`[optional scope]: ` + +其中常用的`type`包括 docs(文档、日志修改)、feat(新功能)、fix(问题修复)、refactor(代码重构)等,请根据实际情况选择。 + +请用简短精确的英文描述编写 description + +提交 commit 之前,我们会进行 commit lint 检查,具体可以查看[检查规则](https://github.com/VisActor/VTable/blob/develop/common/autoinstallers/lint/commitlint.config.js)。 + +一个常见的问题是远程的 upstream (@visactor/vtable) 有了新的更新, 从而会导致我们提交的 Pull Request 时会导致冲突。 因此我们可以在提交前先把远程其他开发者的 commit 和我们的 commit 合并。使用以下代码切换到 develop 分支: + +``` +git checkout develop + +``` +使用以下代码拉出远程的最新代码: + +``` +git pull upstream develop + +``` +切换回自己的开发分支: + +``` +git checkout docs/add-funnel-demo + +``` +把 develop 的 commit 合并到自己分支: + +``` +git rebase develop + +``` +把更新代码提交到自己的分支中: + +``` +git push origin docs/add-funnel-demo + +``` +# 提交PR + +你可以在你的 github 代码仓库页面点击 `Compare & pull request` 按钮。 + + + +或通过 `contribute` 按钮创建: + +按照模板填写本次提交的修改内容: + +* 勾选这是什么类型的修改 + + + +* 填写关联的 issue + + + +* 若有复杂变更,请说明背景和解决方案 + + + +相关信息填写完成后,点击 Create pull request 提交。 + +管理员会review pr 决定是否通过,如果不通过需要进行修改然后重新提交。 + +# 下一步 + +接下来你可以阅读每一个模块的实现原理及源码详解,也可以加入贡献这些文档。 + +请加入VisActor 大家庭,贡献你的力量吧! + + + +github :[github.com/VisActor](https://link.juejin.cn/?target=https%3A%2F%2Fgithub.com%2FVisActor) + +VisActor 微信订阅号(可以通过订阅号菜单加入微信群): + + + +VisActor 官网:[www.visactor.io/](https://link.juejin.cn/?target=https%3A%2F%2Fwww.visactor.io%2Fvtable) + +飞书群: + + + +discord:https://discord.com/invite/3wPyxVyH6m + + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) + +# 本文档由由以下人员贡献 + +[玄魂](https://github.com/xuanhun) \ No newline at end of file diff --git a/docs/menu.json b/docs/menu.json index 20ca3e9bb..1cf8f0f49 100644 --- a/docs/menu.json +++ b/docs/menu.json @@ -19,6 +19,10 @@ "menu": "guide", "type": "markdown" }, + { + "menu": "contributing", + "type": "markdown" + }, { "menu": "option", "type": "markdown-template", diff --git a/docs/vite.config.js b/docs/vite.config.js index 23186da7e..8c79ee555 100644 --- a/docs/vite.config.js +++ b/docs/vite.config.js @@ -18,12 +18,14 @@ export default { resolve: { alias: { '@visactor/vtable/es/vrender': path.resolve('../packages/vtable/src/vrender.ts'), + '@visactor/vtable/es': path.resolve(__dirname, '../packages/vtable/src/'), '@visactor/vtable': path.resolve('../packages/vtable/src/index.ts'), '@visactor/vtable-gantt': path.resolve('../packages/vtable-gantt/src/index.ts'), '@visactor/vtable-calendar': path.resolve('../packages/vtable-calendar/src/index.ts'), '@visactor/vtable-editors': path.resolve('../packages/vtable-editors/src/index.ts'), '@visactor/vtable-export': path.resolve('../packages/vtable-export/src/index.ts'), '@visactor/vtable-search': path.resolve('../packages/vtable-search/src/index.ts'), + '@visactor/vtable-plugins': path.resolve('../packages/vtable-plugins/src/index.ts'), '@visactor/react-vtable': path.resolve('../packages/react-vtable/src/index.ts'), '@visactor/vue-vtable': path.resolve('../packages/vue-vtable/src/index.ts'), '@visactor/openinula-vtable': path.resolve('../packages/openinula-vtable/src/index.ts'), From 287e0324b2590da575b62cbc1f33cc7e6a024e90 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 17:30:16 +0800 Subject: [PATCH 19/24] fix: set vtable peerDependencies in vtable-plugins --- common/config/rush/pnpm-lock.yaml | 46 +++------------------------- packages/vtable-plugins/package.json | 4 ++- 2 files changed, 7 insertions(+), 43 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3cd0bb131..dbbcc8db0 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -781,7 +781,6 @@ importers: '@types/react-dom': ^18.0.0 '@types/react-is': ^17.0.3 '@visactor/vchart': 1.12.12 - '@visactor/vtable': workspace:* '@visactor/vutils': ~0.18.14 '@vitejs/plugin-react': 3.1.0 axios: ^1.4.0 @@ -813,7 +812,6 @@ importers: vite: 3.2.6 vite-plugin-markdown: ^2.1.0 dependencies: - '@visactor/vtable': link:../vtable '@visactor/vutils': 0.18.18 devDependencies: '@babel/core': 7.20.12 @@ -2788,7 +2786,7 @@ packages: jest-resolve: 26.6.2 jest-resolve-dependencies: 26.6.3 jest-runner: 26.6.3_ts-node@10.9.0 - jest-runtime: 26.6.3 + jest-runtime: 26.6.3_ts-node@10.9.0 jest-snapshot: 26.6.2 jest-util: 26.6.2 jest-validate: 26.6.2 @@ -2949,7 +2947,7 @@ packages: graceful-fs: 4.2.11 jest-haste-map: 26.6.2 jest-runner: 26.6.3_ts-node@10.9.0 - jest-runtime: 26.6.3 + jest-runtime: 26.6.3_ts-node@10.9.0 transitivePeerDependencies: - bufferutil - canvas @@ -4318,7 +4316,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.25.9_@babel+core@7.20.12 magic-string: 0.27.0 react-refresh: 0.14.2 - vite: 3.2.6 + vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 transitivePeerDependencies: - supports-color dev: true @@ -9500,7 +9498,7 @@ packages: jest-leak-detector: 26.6.2 jest-message-util: 26.6.2 jest-resolve: 26.6.2 - jest-runtime: 26.6.3 + jest-runtime: 26.6.3_ts-node@10.9.0 jest-util: 26.6.2 jest-worker: 26.6.2 source-map-support: 0.5.21 @@ -9545,42 +9543,6 @@ packages: - supports-color dev: true - /jest-runtime/26.6.3: - resolution: {integrity: sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==} - engines: {node: '>= 10.14.2'} - hasBin: true - dependencies: - '@jest/console': 26.6.2 - '@jest/environment': 26.6.2 - '@jest/fake-timers': 26.6.2 - '@jest/globals': 26.6.2 - '@jest/source-map': 26.6.2 - '@jest/test-result': 26.6.2 - '@jest/transform': 26.6.2 - '@jest/types': 26.6.2 - '@types/yargs': 15.0.19 - chalk: 4.1.2 - cjs-module-lexer: 0.6.0 - collect-v8-coverage: 1.0.2 - exit: 0.1.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-config: 26.6.3_ts-node@10.9.0 - jest-haste-map: 26.6.2 - jest-message-util: 26.6.2 - jest-mock: 26.6.2 - jest-regex-util: 26.0.0 - jest-resolve: 26.6.2 - jest-snapshot: 26.6.2 - jest-util: 26.6.2 - jest-validate: 26.6.2 - slash: 3.0.0 - strip-bom: 4.0.0 - yargs: 15.4.1 - transitivePeerDependencies: - - supports-color - dev: true - /jest-runtime/26.6.3_ts-node@10.9.0: resolution: {integrity: sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==} engines: {node: '>= 10.14.2'} diff --git a/packages/vtable-plugins/package.json b/packages/vtable-plugins/package.json index 9037b0b22..f84a464ca 100644 --- a/packages/vtable-plugins/package.json +++ b/packages/vtable-plugins/package.json @@ -34,9 +34,11 @@ "access": "public" }, "dependencies": { - "@visactor/vtable": "workspace:*", "@visactor/vutils": "~0.18.14" }, + "peerDependencies": { + "@visactor/vtable": "workspace:*" + }, "devDependencies": { "@visactor/vchart": "1.12.12", "@internal/bundler": "workspace:*", From 04df5658e4f00cf6ee7e2c34e2cd0d72b1c7b12d Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 20:44:08 +0800 Subject: [PATCH 20/24] fix: change vtable-plugins files --- common/config/rush/pnpm-lock.yaml | 4 +- .../carousel-animation/carousel-animation.ts | 98 ++++ .../header-highlight/header-highlight.ts} | 7 +- .../invert-highlight/invert-highlight.ts} | 15 +- packages/vtable-plugins/demo/list/list.ts | 120 ----- packages/vtable-plugins/demo/menu.ts | 21 +- .../vtable-plugins/demo/pivot/pivot-basic.ts | 510 ------------------ packages/vtable-plugins/demo/vite.config.js | 3 +- packages/vtable-plugins/src/index.ts | 2 - .../vtable-plugins/src/invert-highlight.ts | 23 +- packages/vtable/package.json | 1 - packages/vtable/src/ListTable-all.ts | 3 +- packages/vtable/src/ListTable.ts | 2 +- packages/vtable/src/core/BaseTable.ts | 5 +- packages/vtable/src/core/style-helper.ts | 2 +- packages/vtable/src/index.ts | 14 - .../src/plugins}/custom-cell-style.ts | 24 +- .../vtable/src/plugins/invert-highlight.ts | 16 + .../src/plugins}/list-tree-stick-cell.ts | 19 +- .../scenegraph/group-creater/cell-helper.ts | 2 +- packages/vtable/src/ts-types/base-table.ts | 9 +- 21 files changed, 186 insertions(+), 714 deletions(-) create mode 100644 packages/vtable-plugins/demo/carousel-animation/carousel-animation.ts rename packages/{vtable/examples/interactive/highlight-color.ts => vtable-plugins/demo/header-highlight/header-highlight.ts} (91%) rename packages/{vtable/examples/interactive/mask.ts => vtable-plugins/demo/invert-highlight/invert-highlight.ts} (88%) delete mode 100644 packages/vtable-plugins/demo/list/list.ts delete mode 100644 packages/vtable-plugins/demo/pivot/pivot-basic.ts rename packages/{vtable-plugins/src => vtable/src/plugins}/custom-cell-style.ts (92%) create mode 100644 packages/vtable/src/plugins/invert-highlight.ts rename packages/{vtable-plugins/src => vtable/src/plugins}/list-tree-stick-cell.ts (94%) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index dbbcc8db0..d2d5060c0 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -299,7 +299,6 @@ importers: '@visactor/vrender-kits': 0.21.0-alpha.4 '@visactor/vscale': ~0.18.1 '@visactor/vtable-editors': workspace:* - '@visactor/vtable-plugins': workspace:* '@visactor/vutils': ~0.18.14 '@visactor/vutils-extension': ~1.11.5 '@vitejs/plugin-react': 3.1.0 @@ -346,7 +345,6 @@ importers: '@visactor/vrender-kits': 0.21.0-alpha.4 '@visactor/vscale': 0.18.18 '@visactor/vtable-editors': link:../vtable-editors - '@visactor/vtable-plugins': link:../vtable-plugins '@visactor/vutils': 0.18.18 '@visactor/vutils-extension': 1.11.14 cssfontparser: 1.2.1 @@ -4316,7 +4314,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.25.9_@babel+core@7.20.12 magic-string: 0.27.0 react-refresh: 0.14.2 - vite: 3.2.6_3fcrixghlk5j7efp7olgstdjb4 + vite: 3.2.6 transitivePeerDependencies: - supports-color dev: true diff --git a/packages/vtable-plugins/demo/carousel-animation/carousel-animation.ts b/packages/vtable-plugins/demo/carousel-animation/carousel-animation.ts new file mode 100644 index 000000000..c9108ce29 --- /dev/null +++ b/packages/vtable-plugins/demo/carousel-animation/carousel-animation.ts @@ -0,0 +1,98 @@ +import * as VTable from '@visactor/vtable'; +import { bindDebugTool } from '@visactor/vtable/es/scenegraph/debug-tool'; +import { InvertHighlightPlugin, CarouselAnimationPlugin } from '../../src'; +const CONTAINER_ID = 'vTable'; +const generatePersons = count => { + return Array.from(new Array(count)).map((_, i) => ({ + id: i + 1, + email1: `${i + 1}@xxx.com`, + name: `小明${i + 1}`, + lastName: '王', + date1: '2022年9月1日', + tel: '000-0000-0000', + sex: i % 2 === 0 ? 'boy' : 'girl', + work: i % 2 === 0 ? 'back-end engineer' + (i + 1) : 'front-end engineer' + (i + 1), + city: 'beijing', + image: + '' + })); +}; + +export function createTable() { + const records = generatePersons(20); + const columns: VTable.ColumnsDefine = [ + { + field: 'image', + title: '行号', + width: 80, + cellType: 'image', + keepAspectRatio: true + }, + { + field: 'id', + title: 'ID', + width: 'auto', + minWidth: 50, + sort: true + }, + { + field: 'email1', + title: 'email', + width: 200, + sort: true, + style: { + underline: true, + underlineDash: [2, 0], + underlineOffset: 3 + } + }, + { + title: 'full name', + columns: [ + { + field: 'name', + title: 'First Name', + width: 200 + }, + { + field: 'name', + title: 'Last Name', + width: 200 + } + ] + }, + { + field: 'date1', + title: 'birthday', + width: 200 + }, + { + field: 'sex', + title: 'sex', + width: 100 + } + ]; + const option: VTable.ListTableConstructorOptions = { + container: document.getElementById(CONTAINER_ID), + records, + columns, + theme: VTable.themes.DARK, + // heightMode: 'adaptive', + select: { + disableSelect: true + } + }; + const tableInstance = new VTable.ListTable(option); + window.tableInstance = tableInstance; + + bindDebugTool(tableInstance.scenegraph.stage, { + customGrapicKeys: ['col', 'row'] + }); + + const ca = new CarouselAnimationPlugin(tableInstance, { + rowCount: 2, + replaceScrollAction: true + }); + + ca.play(); +} diff --git a/packages/vtable/examples/interactive/highlight-color.ts b/packages/vtable-plugins/demo/header-highlight/header-highlight.ts similarity index 91% rename from packages/vtable/examples/interactive/highlight-color.ts rename to packages/vtable-plugins/demo/header-highlight/header-highlight.ts index 413107d71..88d852bb3 100644 --- a/packages/vtable/examples/interactive/highlight-color.ts +++ b/packages/vtable-plugins/demo/header-highlight/header-highlight.ts @@ -1,5 +1,6 @@ -import * as VTable from '../../src'; -import { bindDebugTool } from '../../src/scenegraph/debug-tool'; +import * as VTable from '@visactor/vtable'; +import { bindDebugTool } from '@visactor/vtable/es/scenegraph/debug-tool'; +import { HeaderHighlightPlugin } from '../../src'; const CONTAINER_ID = 'vTable'; const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ @@ -97,7 +98,7 @@ export function createTable() { } ]); - const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance); + const highlightPlugin = new HeaderHighlightPlugin(tableInstance); window.highlightPlugin = highlightPlugin; // tableInstance.scenegraph.temporarilyUpdateSelectRectStyle({stroke: false}) diff --git a/packages/vtable/examples/interactive/mask.ts b/packages/vtable-plugins/demo/invert-highlight/invert-highlight.ts similarity index 88% rename from packages/vtable/examples/interactive/mask.ts rename to packages/vtable-plugins/demo/invert-highlight/invert-highlight.ts index 49eba6c4c..fa119406c 100644 --- a/packages/vtable/examples/interactive/mask.ts +++ b/packages/vtable-plugins/demo/invert-highlight/invert-highlight.ts @@ -1,5 +1,6 @@ -import * as VTable from '../../src'; -import { bindDebugTool } from '../../src/scenegraph/debug-tool'; +import * as VTable from '@visactor/vtable'; +import { bindDebugTool } from '@visactor/vtable/es/scenegraph/debug-tool'; +import { InvertHighlightPlugin, CarouselAnimationPlugin } from '../../src'; const CONTAINER_ID = 'vTable'; const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ @@ -88,7 +89,7 @@ export function createTable() { customGrapicKeys: ['col', 'row'] }); - const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance); + const highlightPlugin = new InvertHighlightPlugin(tableInstance); // highlightPlugin.setInvertHighlightRange({ // start: { // col: 0, @@ -118,10 +119,10 @@ export function createTable() { } }); - const ca = new VTable.CarouselAnimationPlugin(tableInstance, { - rowCount: 2, - replaceScrollAction: true - }); + // const ca = new CarouselAnimationPlugin(tableInstance, { + // rowCount: 2, + // replaceScrollAction: true + // }); // ca.play(); diff --git a/packages/vtable-plugins/demo/list/list.ts b/packages/vtable-plugins/demo/list/list.ts deleted file mode 100644 index 3d4cf978f..000000000 --- a/packages/vtable-plugins/demo/list/list.ts +++ /dev/null @@ -1,120 +0,0 @@ -import * as VTable from '@visactor/vtable'; -import { SearchComponent } from '../../src'; -const CONTAINER_ID = 'vTable'; -const generatePersons = count => { - return Array.from(new Array(count)).map((_, i) => ({ - id: i + 1, - email1: `${i + 1}@xxx.com`, - name: `小明${i + 1}`, - lastName: '王', - date1: '2022年9月1日', - tel: '000-0000-0000', - sex: i % 2 === 0 ? 'boy' : 'girl', - work: i % 2 === 0 ? 'back-end engineer' : 'front-end engineer', - city: 'beijing' - })); -}; - -export function createTable() { - const records = generatePersons(100); - const columns: VTable.ColumnsDefine = [ - { - field: '', - title: '行号', - width: 80, - fieldFormat(data, col, row, table) { - return row - 1; - } - }, - { - field: 'id', - title: 'ID', - width: '1%', - minWidth: 200, - sort: true - }, - { - field: 'email1', - title: 'email', - width: 200, - sort: true - }, - { - title: 'full name', - columns: [ - { - field: 'name', - title: 'First Name', - width: 200 - }, - { - field: 'name', - title: 'Last Name', - width: 200 - } - ] - }, - { - field: 'date1', - title: 'birthday', - width: 200 - }, - { - field: 'sex', - title: 'sex', - width: 100 - }, - { - field: 'tel', - title: 'telephone', - width: 150 - }, - { - field: 'work', - title: 'job', - width: 200 - }, - { - field: 'city', - title: 'city', - width: 150 - } - ]; - const option = { - container: document.getElementById(CONTAINER_ID), - records, - columns, - tooltip: { - isShowOverflowTextTooltip: true - } - // frozenColCount: 1, - // bottomFrozenRowCount: 2, - // rightFrozenColCount: 2, - // overscrollBehavior: 'none' - // autoWrapText: true, - // heightMode: 'autoHeight', - // widthMode: 'adaptive' - }; - const tableInstance = new VTable.ListTable(option); - window.tableInstance = tableInstance; - - const search = new SearchComponent({ - table: tableInstance, - autoJump: true - }); - window.search = search; - // tableInstance.on('sort_click', args => { - // tableInstance.updateSortState( - // { - // field: args.field, - // order: Date.now() % 3 === 0 ? 'desc' : Date.now() % 3 === 1 ? 'asc' : 'normal' - // }, - // false - // ); - // return false; //return false代表不执行内部排序逻辑 - // }); - - setTimeout(() => { - tableInstance.updateOption(option); - }, 2000); -} diff --git a/packages/vtable-plugins/demo/menu.ts b/packages/vtable-plugins/demo/menu.ts index 0efaad87d..269806252 100644 --- a/packages/vtable-plugins/demo/menu.ts +++ b/packages/vtable-plugins/demo/menu.ts @@ -1,19 +1,28 @@ export const menus = [ { - menu: 'listTable', + menu: 'carousel-animation', children: [ { - path: 'list', - name: 'list' + path: 'carousel-animation', + name: 'carousel-animation' } ] }, { - menu: 'pivotTable', + menu: 'header-highlight', children: [ { - path: 'pivot', - name: 'pivot-basic' + path: 'header-highlight', + name: 'header-highlight' + } + ] + }, + { + menu: 'invert-highlight', + children: [ + { + path: 'invert-highlight', + name: 'invert-highlight' } ] } diff --git a/packages/vtable-plugins/demo/pivot/pivot-basic.ts b/packages/vtable-plugins/demo/pivot/pivot-basic.ts deleted file mode 100644 index 22a378419..000000000 --- a/packages/vtable-plugins/demo/pivot/pivot-basic.ts +++ /dev/null @@ -1,510 +0,0 @@ -import * as VTable from '@visactor/vtable'; -import { SearchComponent } from '../../src'; -// import { bindDebugTool } from '../../src/scenegraph/debug-tool'; -const PivotTable = VTable.PivotTable; -const CONTAINER_ID = 'vTable'; - -function generatePivotDataSource(num, colCount) { - const array = new Array(num); - for (let i = 0; i < num; i++) { - const data = new Array(colCount); - for (let j = 0; j < colCount; j++) { - data[j] = i + j; - } - array[i] = data; - } - return array; -} -const DEFAULT_BAR_COLOR = data => { - const num = (data.percentile ?? 0) * 100; - if (num > 80) { - return '#20a8d8'; - } - if (num > 50) { - return '#4dbd74'; - } - if (num > 20) { - return '#ffc107'; - } - return '#f86c6b'; -}; - -export function createTable() { - const records = generatePivotDataSource(19, 18); - const theme: VTable.TYPES.ITableThemeDefine = { - underlayBackgroundColor: '#F6F6F6', - defaultStyle: { - borderColor: '#000', - color: '#000', - bgColor: '#F6F6F6' - }, - headerStyle: { - bgColor: '#F5F6FA', - frameStyle: { - borderColor: '#00ffff', - borderLineWidth: 2 - } - }, - selectionStyle: { - cellBgColor: 'rgba(130,178,245, 0.2)', - cellBorderColor: '#003fff', - cellBorderLineWidth: 2 - }, - rowHeaderStyle: { - bgColor: '#F3F8FF', - frameStyle: { - borderColor: '#ff00ff', - borderLineWidth: 2 - } - }, - cornerHeaderStyle: { - bgColor: '#CCE0FF', - fontSize: 20, - fontFamily: 'sans-serif', - frameStyle: { - borderColor: '#00ff00', - borderLineWidth: 2 - } - }, - bodyStyle: { - hover: { - cellBgColor: '#CCE0FF', - inlineRowBgColor: '#F3F8FF', - inlineColumnBgColor: '#F3F8FF' - }, - frameStyle: { - borderColor: '#ffff00', - borderLineWidth: 5 - } - }, - frameStyle: { - borderColor: '#000', - borderLineWidth: 1, - borderLineDash: [] - }, - columnResize: { - lineWidth: 1, - lineColor: '#416EFF', - bgColor: '#D9E2FF', - width: 3 - }, - frozenColumnLine: { - shadow: { - width: 24, - startColor: 'rgba(00, 24, 47, 0.06)', - endColor: 'rgba(00, 24, 47, 0)' - } - } - // menuStyle: { - // color: '#000', - // highlightColor: '#2E68CF', - // font: '12px sans-serif', - // highlightFont: '12px sans-serif', - // hoverBgColor: '#EEE' - // } - }; - const option: VTable.PivotTableConstructorOptions = { - columnHeaderTitle: { - title: true, - headerStyle: { - textStick: true - } - }, - columns: [ - { - dimensionKey: '地区', - title: '地区', - headerFormat(value) { - return `${value}地区`; - }, - description(args) { - return args.value; - }, - cornerDescription: '地区维度', - headerStyle: { - textAlign: 'center', - borderColor: 'blue', - color: 'pink', - textStick: true, - bgColor(arg) { - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { - return '#bd422a'; - } - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { - return '#ff9900'; - } - return 'gray'; - } - }, - // 指标菜单 - dropDownMenu: ['升序排序I', '降序排序I', '冻结列I'], - // corner菜单 - cornerDropDownMenu: ['升序排序C', '降序排序C', '冻结列C'], - drillDown: true - }, - { - dimensionKey: '邮寄方式', - title: '邮寄方式11', - headerFormat(value) { - return `${value}邮寄方式`; - }, - headerStyle: { - textAlign: 'left', - borderColor: 'blue', - color: 'pink', - // lineHeight: '2em', - fontSize: 16, - fontStyle: 'bold', - fontFamily: 'sans-serif', - underline: true, - textStick: true, - bgColor(arg) { - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { - return '#bd422a'; - } - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { - return '#ff9900'; - } - return 'gray'; - } - }, - drillUp: false - } - ], - rows: [ - { - dimensionKey: '类别', - title: '类别', - drillUp: true, - width: 'auto', - headerStyle: { - textAlign: 'center', - borderColor: 'blue', - color: 'purple', - textBaseline: 'top', - textStick: true, - bgColor: '#6cd26f' - } - }, - { - dimensionKey: '子类别', - title: '子类别', - headerStyle: { - textAlign: 'center', - color: 'blue', - bgColor: '#45b89f' - }, - width: 'auto', - dropDownMenu: ['升序排序I', '降序排序I', '冻结列I'] - // headerType: 'MULTILINETEXT', - } - ], - indicators: [ - { - indicatorKey: '1', - title: '销售额', - // format(rec) { - // return `${rec.dataValue}%`; - // }, - headerStyle: { - color: 'red', - bgColor(arg) { - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '东北') { - return '#bd422a'; - } - if (arg.cellHeaderPaths.colHeaderPaths && arg.cellHeaderPaths.colHeaderPaths[0].value === '华北') { - return '#ff9900'; - } - return 'gray'; - } - }, - // style: { - // barHeight: '100%', - // // barBgColor: '#aaa', - // // barColor: '#444', - // barBgColor: data => { - // return `rgb(${100 + 100 * (1 - (data.percentile ?? 0))},${100 + 100 * (1 - (data.percentile ?? 0))},${ - // 255 * (1 - (data.percentile ?? 0)) - // })`; - // }, - // barColor: 'transparent' - // }, - // cellType: 'progressbar', - showSort: true - // headerType: 'MULTILINETEXT', - }, - { - indicatorKey: '2', - title: '利润', - // format(rec) { - // // if (rec.rowDimensions[0].value === '东北') return `${rec.dataValue}%`; - // return rec.dataValue; - // }, - // cellType: 'progressbar', - // style: { - // barHeight: '50%', - // barBottom: 20, - // barColor: DEFAULT_BAR_COLOR - // }, - showSort: true, - dropDownMenu: ['利润升序排序I', '利润降序排序I', '利润冻结列I'] - } - ], - columnTree: [ - { - dimensionKey: '地区', - value: '东北', - children: [ - { - dimensionKey: '邮寄方式', - value: '一级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '二级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '三级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - } - ] - }, - { - dimensionKey: '地区', - value: '华北', - children: [ - { - dimensionKey: '邮寄方式', - value: '一级', - children: [ - { - indicatorKey: '1', - value: '销售额' - }, - { - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '二级', - children: [ - { - indicatorKey: '1', - value: '销售额' - }, - { - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '三级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - } - ] - }, - { - dimensionKey: '地区', - value: '中南', - children: [ - { - dimensionKey: '邮寄方式', - value: '一级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '二级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - }, - { - dimensionKey: '邮寄方式', - value: '三级', - children: [ - { - // dimensionKey: '指标名称', - indicatorKey: '1', - value: '销售额' - }, - { - // dimensionKey: '指标名称', - indicatorKey: '2', - value: '利润' - } - ] - } - ] - } - ], - rowTree: [ - { - dimensionKey: '类别', - value: '办公用品', - children: [ - { dimensionKey: '子类别', value: '电脑' }, - { dimensionKey: '子类别', value: '装订机' }, - { dimensionKey: '子类别', value: '签字笔' }, - { dimensionKey: '子类别', value: '标签' }, - { dimensionKey: '子类别', value: '收纳柜' }, - { dimensionKey: '子类别', value: '纸张' }, - { dimensionKey: '子类别', value: '电灯' } - ] - }, - { - dimensionKey: '类别', - value: '家具', - children: [ - { dimensionKey: '子类别', value: '衣柜' }, - { dimensionKey: '子类别', value: '沙发' }, - { dimensionKey: '子类别', value: '餐桌' }, - { dimensionKey: '子类别', value: '椅子' }, - { dimensionKey: '子类别', value: '桌子' } - ] - }, - { - dimensionKey: '类别', - value: '餐饮', - children: [ - { dimensionKey: '子类别', value: '锅具' }, - { - dimensionKey: '子类别', - value: '油盐酱醋' - }, - { dimensionKey: '子类别', value: '米面' } - ] - }, - { - dimensionKey: '类别', - value: '技术', - children: [ - { dimensionKey: '子类别', value: '设备' }, - { dimensionKey: '子类别', value: '配件' }, - { dimensionKey: '子类别', value: '电话' }, - { dimensionKey: '子类别', value: '复印机' } - ] - } - ], - corner: { - titleOnDimension: 'column', - headerStyle: { - textAlign: 'center', - borderColor: 'red', - color: 'yellow', - underline: true, - fontSize: 16, - fontStyle: 'bold', - fontFamily: 'sans-serif' - // lineHeight: '20px' - } - }, - indicatorTitle: '指标名称', - // indicatorsAsCol: false, - container: document.getElementById(CONTAINER_ID), - records, - theme, - showFrozenIcon: false, //显示VTable内置冻结列图标 - allowFrozenColCount: 2, - widthMode: 'autoWidth', // 宽度模式:standard 标准模式; adaptive 自动填满容器 - defaultRowHeight: 80, - columnResizeType: 'indicator', // 'column' | 'indicator' | 'all' - tooltip: { - isShowOverflowTextTooltip: true - } - }; - - const instance = new PivotTable(option); - window.tableInstance = instance; - - const search = new SearchComponent({ - table: instance, - autoJump: true - }); - window.search = search; - - const { PIVOT_SORT_CLICK } = VTable.PivotTable.EVENT_TYPE; - instance.on(PIVOT_SORT_CLICK, e => { - const order = e.order === 'asc' ? 'desc' : e.order === 'desc' ? 'normal' : 'asc'; - instance.updatePivotSortState([{ dimensions: e.dimensionInfo, order }]); - }); - - // bindDebugTool(instance.scenegraph.stage as any, { - // customGrapicKeys: ['role', '_updateTag'] - // }); - - // 只为了方便控制太调试用,不要拷贝 - window.tableInstance = instance; -} diff --git a/packages/vtable-plugins/demo/vite.config.js b/packages/vtable-plugins/demo/vite.config.js index 0dd0c01ed..c2bf7e972 100644 --- a/packages/vtable-plugins/demo/vite.config.js +++ b/packages/vtable-plugins/demo/vite.config.js @@ -13,8 +13,9 @@ module.exports = { }, resolve: { alias: { - '@visactor/vtable/es/': path.resolve(__dirname, '../../vtable/src/es/'), + '@visactor/vtable/es': path.resolve(__dirname, '../../vtable/src/'), '@visactor/vtable': path.resolve(__dirname, '../../vtable/src/index.ts'), + '@src': path.resolve(__dirname, '../../vtable/src/'), '@vutils-extension': path.resolve(__dirname, '../../vtable/src/vutil-extension-temp') } }, diff --git a/packages/vtable-plugins/src/index.ts b/packages/vtable-plugins/src/index.ts index fcc0da94c..dfb38a632 100644 --- a/packages/vtable-plugins/src/index.ts +++ b/packages/vtable-plugins/src/index.ts @@ -1,5 +1,3 @@ export * from './carousel-animation'; export * from './invert-highlight'; -export * from './list-tree-stick-cell'; -export * from './custom-cell-style'; export * from './header-highlight'; diff --git a/packages/vtable-plugins/src/invert-highlight.ts b/packages/vtable-plugins/src/invert-highlight.ts index cbc7b9a25..c5f5fd13b 100644 --- a/packages/vtable-plugins/src/invert-highlight.ts +++ b/packages/vtable-plugins/src/invert-highlight.ts @@ -1,11 +1,10 @@ -import type { Rect } from '@visactor/vtable/es/vrender'; +import type { INode } from '@visactor/vtable/es/vrender'; import { createRect } from '@visactor/vtable/es/vrender'; import type { Group } from '@visactor/vtable/es/scenegraph/graphic/group'; import { isSameRange } from '@visactor/vtable/es/tools/cell-range'; import type { CellRange } from '@visactor/vtable/es/ts-types'; import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; import { cellInRange } from '@visactor/vtable/es/tools/helper'; -import { isValid } from '@visactor/vutils'; export interface InvertHighlightPluginOptions { fill?: string; @@ -64,9 +63,11 @@ export class InvertHighlightPlugin { this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup, this.range); } updateCellGroupShadowInContainer(container: Group, range?: CellRange) { - container.forEachChildrenSkipChild((column: Group) => { + container.forEachChildrenSkipChild((item: INode) => { + const column = item as unknown as Group; if (column.role === 'column') { - column.forEachChildrenSkipChild((cell: Group) => { + column.forEachChildrenSkipChild((item: INode) => { + const cell = item as unknown as Group; if (cell.role !== 'cell') { return; } @@ -96,17 +97,3 @@ export class InvertHighlightPlugin { }); } } - -export function onBeforeAttributeUpdateForInvertHighlight(val: Record, attribute: any) { - // @ts-ignore - const graphic = this as any; - if (graphic.shadowRoot && graphic.shadowRoot.childrenCount && (isValid(val.width) || isValid(val.height))) { - const shadowRect = (graphic.shadowRoot as Group).findChildrenByName('shadow-rect')[0] as Rect; - if (shadowRect) { - shadowRect.setAttributes({ - width: val.width ?? shadowRect.attribute.width, - height: val.height ?? shadowRect.attribute.height - }); - } - } -} diff --git a/packages/vtable/package.json b/packages/vtable/package.json index 69edf955d..d72f6dce1 100644 --- a/packages/vtable/package.json +++ b/packages/vtable/package.json @@ -52,7 +52,6 @@ }, "dependencies": { "@visactor/vtable-editors": "workspace:*", - "@visactor/vtable-plugins": "workspace:*", "@visactor/vrender-core": "0.21.0-alpha.4", "@visactor/vrender-kits": "0.21.0-alpha.4", "@visactor/vrender-components": "0.21.0-alpha.4", diff --git a/packages/vtable/src/ListTable-all.ts b/packages/vtable/src/ListTable-all.ts index 6de5e57f2..2b94e88c2 100644 --- a/packages/vtable/src/ListTable-all.ts +++ b/packages/vtable/src/ListTable-all.ts @@ -7,7 +7,8 @@ import { registerTitle, registerTooltip } from './components'; -import { registerListTreeStickCellPlugin, registerCustomCellStylePlugin } from '@visactor/vtable-plugins'; +import { registerCustomCellStylePlugin } from './plugins/custom-cell-style'; +import { registerListTreeStickCellPlugin } from './plugins/list-tree-stick-cell'; import { registerChartCell, registerCheckboxCell, diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts index d24a7915c..88a8d2425 100644 --- a/packages/vtable/src/ListTable.ts +++ b/packages/vtable/src/ListTable.ts @@ -53,7 +53,7 @@ import { listTableUpdateRecords, sortRecords } from './core/record-helper'; -import type { IListTreeStickCellPlugin, ListTreeStickCellPlugin } from '@visactor/vtable-plugins'; +import type { IListTreeStickCellPlugin, ListTreeStickCellPlugin } from './plugins/list-tree-stick-cell'; // import { // registerAxis, // registerEmptyTip, diff --git a/packages/vtable/src/core/BaseTable.ts b/packages/vtable/src/core/BaseTable.ts index f9d30b9fd..3bf836184 100644 --- a/packages/vtable/src/core/BaseTable.ts +++ b/packages/vtable/src/core/BaseTable.ts @@ -126,8 +126,6 @@ import { NumberRangeMap } from '../layout/row-height-map'; import { ListTable } from '../ListTable'; import type { SimpleHeaderLayoutMap } from '../layout'; import { RowSeriesNumberHelper } from './row-series-number-helper'; -import type { ICustomCellStylePlugin } from '@visactor/vtable-plugins'; -import { mergeStyle } from '@visactor/vtable-plugins'; import { hideCellSelectBorder, restoreCellSelectBorder } from '../scenegraph/select/update-select-border'; import type { ITextGraphicAttribute } from '@src/vrender'; import { ReactCustomLayout } from '../components/react/react-custom-layout'; @@ -151,6 +149,7 @@ import { setIconColor } from '../icons'; import { TableAnimationManager } from './animation'; import type { ITableAnimationOption } from '../ts-types/animation/appear'; import { checkCellInSelect } from '../state/common/check-in-select'; +import type { CustomCellStylePlugin, ICustomCellStylePlugin } from '../plugins/custom-cell-style'; const { toBoxArray } = utilStyle; const { isTouchEvent } = event; @@ -219,7 +218,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI { isReleased: boolean = false; _chartEventMap: Record = {}; - customCellStylePlugin?: ICustomCellStylePlugin; + customCellStylePlugin?: CustomCellStylePlugin; columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body'; diff --git a/packages/vtable/src/core/style-helper.ts b/packages/vtable/src/core/style-helper.ts index f738c00f1..184b375c6 100644 --- a/packages/vtable/src/core/style-helper.ts +++ b/packages/vtable/src/core/style-helper.ts @@ -1,4 +1,3 @@ -import { mergeStyle } from '@visactor/vtable-plugins'; import type { PivotHeaderLayoutMap } from '../layout/pivot-header-layout'; import { isLeftOrRightAxis, isTopOrBottomAxis } from '../layout/chart-helper/get-axis-config'; import { isFunction } from '@visactor/vutils'; @@ -6,6 +5,7 @@ import * as headerStyleContents from '../header-helper/style'; import * as columnStyleContents from '../body-helper/style'; import type { BaseTableAPI, HeaderData, PivotTableProtected } from '../ts-types/base-table'; import type { ColorPropertyDefine, FullExtendStyle, MappingRule } from '../ts-types'; +import { mergeStyle } from '../plugins/custom-cell-style'; const EMPTY_STYLE = {}; diff --git a/packages/vtable/src/index.ts b/packages/vtable/src/index.ts index 5df5ae0d0..384c6ad15 100644 --- a/packages/vtable/src/index.ts +++ b/packages/vtable/src/index.ts @@ -131,17 +131,3 @@ export { TABLE_EVENT_TYPE } from './core/TABLE_EVENT_TYPE'; export { PIVOT_CHART_EVENT_TYPE, PIVOT_TABLE_EVENT_TYPE } from './ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE'; export { EventTarget } from './event/EventTarget'; - -export type { - ICarouselAnimationPluginOptions, - IHeaderHighlightPluginOptions, - InvertHighlightPluginOptions -} from '@visactor/vtable-plugins'; - -export { - CarouselAnimationPlugin, - HeaderHighlightPlugin, - InvertHighlightPlugin, - registerListTreeStickCellPlugin, - registerCustomCellStylePlugin -} from '@visactor/vtable-plugins'; diff --git a/packages/vtable-plugins/src/custom-cell-style.ts b/packages/vtable/src/plugins/custom-cell-style.ts similarity index 92% rename from packages/vtable-plugins/src/custom-cell-style.ts rename to packages/vtable/src/plugins/custom-cell-style.ts index fae498d56..7fa91555f 100644 --- a/packages/vtable-plugins/src/custom-cell-style.ts +++ b/packages/vtable/src/plugins/custom-cell-style.ts @@ -1,14 +1,16 @@ import { merge } from '@visactor/vutils'; -import type { - CellRange, - ColumnStyleOption, - CustomCellStyle, - CustomCellStyleArrangement, - FullExtendStyle -} from '@visactor/vtable/es/ts-types'; -import type { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; -import type { Style } from '@visactor/vtable/es/body-helper/style'; -import { Factory } from '@visactor/vtable/es/core/factory'; +import type { BaseTableAPI } from '../ts-types/base-table'; +import type { CellRange, ColumnStyleOption, CustomCellStyle, CustomCellStyleArrangement } from '../ts-types'; +import type { Style } from '../body-helper/style'; +import { Factory } from '../core/factory'; + +export interface ICustomCellStylePlugin { + new ( + table: BaseTableAPI, + customCellStyle: CustomCellStyle[], + customCellStyleArrangement: CustomCellStyleArrangement[] + ): CustomCellStylePlugin; +} export class CustomCellStylePlugin { table: BaseTableAPI; @@ -222,4 +224,4 @@ export const registerCustomCellStylePlugin = () => { Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin); }; -export type ICustomCellStylePlugin = typeof CustomCellStylePlugin; +// export type ICustomCellStylePlugin = typeof CustomCellStylePlugin; diff --git a/packages/vtable/src/plugins/invert-highlight.ts b/packages/vtable/src/plugins/invert-highlight.ts new file mode 100644 index 000000000..d6525ac35 --- /dev/null +++ b/packages/vtable/src/plugins/invert-highlight.ts @@ -0,0 +1,16 @@ +import type { Group, Rect } from '@src/vrender'; +import { isValid } from '@visactor/vutils'; + +export function onBeforeAttributeUpdateForInvertHighlight(val: Record, attribute: any) { + // @ts-ignore + const graphic = this as any; + if (graphic.shadowRoot && graphic.shadowRoot.childrenCount && (isValid(val.width) || isValid(val.height))) { + const shadowRect = (graphic.shadowRoot as Group).findChildrenByName('shadow-rect')[0] as Rect; + if (shadowRect) { + shadowRect.setAttributes({ + width: val.width ?? shadowRect.attribute.width, + height: val.height ?? shadowRect.attribute.height + }); + } + } +} diff --git a/packages/vtable-plugins/src/list-tree-stick-cell.ts b/packages/vtable/src/plugins/list-tree-stick-cell.ts similarity index 94% rename from packages/vtable-plugins/src/list-tree-stick-cell.ts rename to packages/vtable/src/plugins/list-tree-stick-cell.ts index 7bb935437..a5c0bc623 100644 --- a/packages/vtable-plugins/src/list-tree-stick-cell.ts +++ b/packages/vtable/src/plugins/list-tree-stick-cell.ts @@ -1,10 +1,15 @@ import { isArray, isValid } from '@visactor/vutils'; -import type { ListTable } from '@visactor/vtable/es/ListTable'; -import { Factory } from '@visactor/vtable/es/core/factory'; -import { Group } from '@visactor/vtable/es/scenegraph/graphic/group'; -import { createRect, type Graphic } from '@visactor/vtable/es/vrender'; -import { updateCell } from '@visactor/vtable/es/scenegraph/group-creater/cell-helper'; -import { getTargetCell } from '@visactor/vtable/es/event/util'; +import type { ListTable } from '../ListTable'; +import { Group } from '../scenegraph/graphic/group'; +import { updateCell } from '../scenegraph/group-creater/cell-helper'; +import type { Graphic } from '@src/vrender'; +import { createRect } from '@src/vrender'; +import { Factory } from '../core/factory'; +import { getTargetCell } from '../event/util'; + +export interface IListTreeStickCellPlugin { + new (table: ListTable): ListTreeStickCellPlugin; +} export class ListTreeStickCellPlugin { table: ListTable; @@ -292,4 +297,4 @@ export const registerListTreeStickCellPlugin = () => { Factory.registerComponent('listTreeStickCellPlugin', ListTreeStickCellPlugin); }; -export type IListTreeStickCellPlugin = typeof ListTreeStickCellPlugin; +// export type IListTreeStickCellPlugin = typeof ListTreeStickCellPlugin; diff --git a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts index 10f5e8775..5bdf39a01 100644 --- a/packages/vtable/src/scenegraph/group-creater/cell-helper.ts +++ b/packages/vtable/src/scenegraph/group-creater/cell-helper.ts @@ -36,7 +36,7 @@ import { updateCellContentHeight, updateCellContentWidth } from '../utils/text-i import { isArray, isValid } from '@visactor/vutils'; import { breakString } from '../utils/break-string'; import type { CreateRadioCellGroup } from './cell-type/radio-cell'; -import { onBeforeAttributeUpdateForInvertHighlight } from '@visactor/vtable-plugins'; +import { onBeforeAttributeUpdateForInvertHighlight } from '../../plugins/invert-highlight'; export function createCell( type: ColumnTypeOption, diff --git a/packages/vtable/src/ts-types/base-table.ts b/packages/vtable/src/ts-types/base-table.ts index d898c88a6..d55483259 100644 --- a/packages/vtable/src/ts-types/base-table.ts +++ b/packages/vtable/src/ts-types/base-table.ts @@ -97,12 +97,12 @@ import type { NumberRangeMap } from '../layout/row-height-map'; import type { RowSeriesNumberHelper } from '../core/row-series-number-helper'; import type { ReactCustomLayout } from '../components/react/react-custom-layout'; import type { ISortedMapItem } from '../data/DataSource'; -import type { IAnimationAppear } from './animation/appear'; +import type { IAnimationAppear, ITableAnimationOption } from './animation/appear'; import type { IEmptyTip } from './component/empty-tip'; import type { EmptyTip } from '../components/empty-tip/empty-tip'; -import type { ICustomCellStylePlugin } from '@visactor/vtable-plugins'; import type { EditManeger } from '../edit/edit-manager'; -import type { ITableAnimationOption, TableAnimationManager } from '../core/animation'; +import type { TableAnimationManager } from '../core/animation'; +import type { CustomCellStylePlugin } from '../plugins/custom-cell-style'; export interface IBaseTableProtected { element: HTMLElement; @@ -643,6 +643,7 @@ export interface BaseTableAPI { _rowRangeHeightsMap: Map; _colRangeWidthsMap: Map; canvasSizeSeted?: boolean; + /** 获取表格绘制的范围 不包括frame的宽度 */ getDrawRange: () => Rect; /** 将鼠标坐标值 转换成表格坐标系中的坐标位置 */ @@ -924,7 +925,7 @@ export interface BaseTableAPI { /** 开启表格的滚动 */ enableScroll: () => void; - customCellStylePlugin: ICustomCellStylePlugin; + customCellStylePlugin?: CustomCellStylePlugin; headerStyleCache: Map; bodyBottomStyleCache: Map; bodyStyleCache: Map; From d7aafd97fd58223509a38a4faa52c478910b074e Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 28 Nov 2024 21:04:02 +0800 Subject: [PATCH 21/24] docs: change docs about vtable-plugins --- docs/assets/demo/en/animation/carousel-animation.md | 7 +++++-- docs/assets/demo/en/interaction/head-highlight.md | 8 ++++++-- docs/assets/demo/en/interaction/invert-highlight.md | 8 ++++++-- docs/assets/demo/zh/animation/carousel-animation.md | 7 +++++-- docs/assets/demo/zh/interaction/head-highlight.md | 8 ++++++-- docs/assets/demo/zh/interaction/invert-highlight.md | 8 ++++++-- docs/assets/guide/en/animation/carousel_animation.md | 4 ++-- docs/assets/guide/en/plugin/header-highlight.md | 4 ++-- docs/assets/guide/en/plugin/invert-highlight.md | 4 ++-- docs/assets/guide/zh/animation/carousel_animation.md | 4 ++-- docs/assets/guide/zh/plugin/header-highlight.md | 4 ++-- docs/assets/guide/zh/plugin/invert-highlight.md | 4 ++-- docs/src/main.tsx | 2 ++ 13 files changed, 48 insertions(+), 24 deletions(-) diff --git a/docs/assets/demo/en/animation/carousel-animation.md b/docs/assets/demo/en/animation/carousel-animation.md index 35eacb17e..0e85b6bb7 100644 --- a/docs/assets/demo/en/animation/carousel-animation.md +++ b/docs/assets/demo/en/animation/carousel-animation.md @@ -12,7 +12,7 @@ Carousel animation in VTable ## Key configuration -- `VTable.CarouselAnimationPlugin` carousel animation plugin +- `CarouselAnimationPlugin` carousel animation plugin - `rowCount` scroll row count in a carousel animation - `colCount` scroll column count in a carousel animation - `animationDuration` The duration of a single carousel animation, in milliseconds @@ -23,6 +23,9 @@ Carousel animation in VTable ## Code demonstration ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; let tableInstance; fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_data100.json') @@ -95,7 +98,7 @@ const option = { tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const ca = new VTable.CarouselAnimationPlugin(tableInstance, { +const ca = new VTablePlugins.CarouselAnimationPlugin(tableInstance, { rowCount: 2, replaceScrollAction: true }); diff --git a/docs/assets/demo/en/interaction/head-highlight.md b/docs/assets/demo/en/interaction/head-highlight.md index 6aeac93ab..f6151cc1c 100644 --- a/docs/assets/demo/en/interaction/head-highlight.md +++ b/docs/assets/demo/en/interaction/head-highlight.md @@ -12,7 +12,7 @@ Highlight the header when selecting the cell. ## Key Configurations -- `VTable.HeaderHighlightPlugin` highlight plugin +- `HeaderHighlightPlugin` highlight plugin - `columnHighlight` whether highlight the column - `rowHighlight` whether highlight the row - `colHighlightBGColor` the background color of the column highlight @@ -23,6 +23,10 @@ Highlight the header when selecting the cell. ## Code demo ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; + const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ id: i + 1, @@ -95,6 +99,6 @@ const option = { const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance, {}); +const highlightPlugin = new VTablePlugins.HeaderHighlightPlugin(tableInstance, {}); ``` diff --git a/docs/assets/demo/en/interaction/invert-highlight.md b/docs/assets/demo/en/interaction/invert-highlight.md index 25a918fae..d9edfca36 100644 --- a/docs/assets/demo/en/interaction/invert-highlight.md +++ b/docs/assets/demo/en/interaction/invert-highlight.md @@ -12,7 +12,7 @@ Show the highlight effect when set highlight range. ## Key Configurations -- `VTable.InvertHighlightPlugin` invert highlight plugin +- `InvertHighlightPlugin` invert highlight plugin - `fill` invert highlight background color - `opacity` invert highlight opacity - `setInvertHighlightRange` set highlight range @@ -20,6 +20,10 @@ Show the highlight effect when set highlight range. ## Code demo ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; + const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ id: i + 1, @@ -92,7 +96,7 @@ const option = { const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance, {}); +const highlightPlugin = new VTablePlugins.InvertHighlightPlugin(tableInstance, {}); highlightPlugin.setInvertHighlightRange({ start: { diff --git a/docs/assets/demo/zh/animation/carousel-animation.md b/docs/assets/demo/zh/animation/carousel-animation.md index ad853e419..aba46b3a1 100644 --- a/docs/assets/demo/zh/animation/carousel-animation.md +++ b/docs/assets/demo/zh/animation/carousel-animation.md @@ -12,7 +12,7 @@ link: '../guide/animation/carousel_animation' ## 关键配置 -- `VTable.CarouselAnimationPlugin` 轮播动画插件 +- `CarouselAnimationPlugin` 轮播动画插件 - `rowCount` 一次动画滚动的行数 - `colCount` 一次动画滚动的列数 - `animationDuration` 一次滚动动画的时间 @@ -23,6 +23,9 @@ link: '../guide/animation/carousel_animation' ## 代码演示 ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; let tableInstance; fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_data100.json') @@ -95,7 +98,7 @@ const option = { tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const ca = new VTable.CarouselAnimationPlugin(tableInstance, { +const ca = new VTablePlugins.CarouselAnimationPlugin(tableInstance, { rowCount: 2, replaceScrollAction: true }); diff --git a/docs/assets/demo/zh/interaction/head-highlight.md b/docs/assets/demo/zh/interaction/head-highlight.md index ad6dfe65a..78288cbdd 100644 --- a/docs/assets/demo/zh/interaction/head-highlight.md +++ b/docs/assets/demo/zh/interaction/head-highlight.md @@ -12,7 +12,7 @@ link: '../guide/plugin/header-highlight' ## 关键配置 -- `VTable.HeaderHighlightPlugin` 高亮表头插件 +- `HeaderHighlightPlugin` 高亮表头插件 - `columnHighlight` 是否高亮列头 - `rowHighlight` 是否高亮行头 - `colHighlightBGColor` 列头高亮背景色 @@ -23,6 +23,10 @@ link: '../guide/plugin/header-highlight' ## 代码演示 ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; + const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ id: i + 1, @@ -95,6 +99,6 @@ const option = { const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance, {}); +const highlightPlugin = new VTablePlugins.HeaderHighlightPlugin(tableInstance, {}); ``` diff --git a/docs/assets/demo/zh/interaction/invert-highlight.md b/docs/assets/demo/zh/interaction/invert-highlight.md index eb8902f39..7b5508899 100644 --- a/docs/assets/demo/zh/interaction/invert-highlight.md +++ b/docs/assets/demo/zh/interaction/invert-highlight.md @@ -12,7 +12,7 @@ link: '../guide/plugin/invert-highlight' ## 关键配置 -- `VTable.InvertHighlightPlugin` 反选高亮插件 +- `InvertHighlightPlugin` 反选高亮插件 - `fill` 反选高亮背景色 - `opacity` 反选高亮透明度 - `setInvertHighlightRange` 设置反选高亮范围 @@ -20,6 +20,10 @@ link: '../guide/plugin/invert-highlight' ## 代码演示 ```javascript livedemo template=vtable +// use this for project +// import * as VTable from '@visactor/vtable'; +// import * as VTablePlugins from '@visactor/vtable-plugins'; + const generatePersons = count => { return Array.from(new Array(count)).map((_, i) => ({ id: i + 1, @@ -92,7 +96,7 @@ const option = { const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID),option); window['tableInstance'] = tableInstance; -const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance, {}); +const highlightPlugin = new VTablePlugins.InvertHighlightPlugin(tableInstance, {}); highlightPlugin.setInvertHighlightRange({ start: { diff --git a/docs/assets/guide/en/animation/carousel_animation.md b/docs/assets/guide/en/animation/carousel_animation.md index 9ae1533ae..796799d66 100644 --- a/docs/assets/guide/en/animation/carousel_animation.md +++ b/docs/assets/guide/en/animation/carousel_animation.md @@ -8,7 +8,7 @@ VTable provides carousel animation plugin, which can implement the carousel scro ## Carousel Animation Configuration -- `VTable.CarouselAnimationPlugin` carousel animation plugin, can configure the following parameters: +- `CarouselAnimationPlugin` carousel animation plugin, can configure the following parameters: - `rowCount` scroll row count in a carousel animation - `colCount` scroll column count in a carousel animation - `animationDuration` The duration of a single carousel animation, in milliseconds @@ -17,7 +17,7 @@ VTable provides carousel animation plugin, which can implement the carousel scro - `replaceScrollAction` Whether to replace the scroll action, if true, the scroll action will be replaced by the carousel animation ```js -const carouselAnimationPlugin = new VTable.CarouselAnimationPlugin(tableInstance, { +const carouselAnimationPlugin = new CarouselAnimationPlugin(tableInstance, { rowCount: 2, replaceScrollAction: true }); diff --git a/docs/assets/guide/en/plugin/header-highlight.md b/docs/assets/guide/en/plugin/header-highlight.md index 550b6e2de..4e73715f3 100644 --- a/docs/assets/guide/en/plugin/header-highlight.md +++ b/docs/assets/guide/en/plugin/header-highlight.md @@ -8,7 +8,7 @@ VTable provides Header Highlight plugin, which can highlight the corresponding h ## Header Highlight Plugin Configuration -- `VTable.HeaderHighlightPlugin` Header Highlight, can configure the following parameters: +- `HeaderHighlightPlugin` Header Highlight, can configure the following parameters: - `columnHighlight` whether highlight the column - `rowHighlight` whether highlight the row - `colHighlightBGColor` the background color of the column highlight @@ -17,7 +17,7 @@ VTable provides Header Highlight plugin, which can highlight the corresponding h - `rowHighlightColor` the color of the row highlight ```js -const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance, {}); +const highlightPlugin = new HeaderHighlightPlugin(tableInstance, {}); ``` For specific usage, please refer to [demo](../../demo/interaction/head-highlight) diff --git a/docs/assets/guide/en/plugin/invert-highlight.md b/docs/assets/guide/en/plugin/invert-highlight.md index 6fc59ad1e..6b26c31a0 100644 --- a/docs/assets/guide/en/plugin/invert-highlight.md +++ b/docs/assets/guide/en/plugin/invert-highlight.md @@ -8,13 +8,13 @@ VTable provides Invert Highlight plugin, which can highlight the specified area ## Invert Highlight Plugin Configuration -- `VTable.InvertHighlightPlugin` Invert Highlight Plugin, can configure the following parameters: +- `InvertHighlightPlugin` Invert Highlight Plugin, can configure the following parameters: - `fill` invert highlight background color - `opacity` invert highlight opacity - `setInvertHighlightRange` set highlight range ```js -const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance, {}); +const highlightPlugin = new InvertHighlightPlugin(tableInstance, {}); highlightPlugin.setInvertHighlightRange({ start: { diff --git a/docs/assets/guide/zh/animation/carousel_animation.md b/docs/assets/guide/zh/animation/carousel_animation.md index 9d3252998..4d3aa22fb 100644 --- a/docs/assets/guide/zh/animation/carousel_animation.md +++ b/docs/assets/guide/zh/animation/carousel_animation.md @@ -8,7 +8,7 @@ VTable 提供轮播动画插件,可以实现表格的轮播滚动动画效果 ## 轮播动画配置项 -- `VTable.CarouselAnimationPlugin` 轮播动画插件,可以配置以下参数: +- `CarouselAnimationPlugin` 轮播动画插件,可以配置以下参数: - `rowCount` 一次动画滚动的行数 - `colCount` 一次动画滚动的列数 - `animationDuration` 一次滚动动画的时间 @@ -17,7 +17,7 @@ VTable 提供轮播动画插件,可以实现表格的轮播滚动动画效果 - `replaceScrollAction` 是否替换滚动行为,如果为 true ,每次滚动操作会移动对于的行数/列数 ```js -const carouselAnimationPlugin = new VTable.CarouselAnimationPlugin(tableInstance, { +const carouselAnimationPlugin = new CarouselAnimationPlugin(tableInstance, { rowCount: 2, replaceScrollAction: true }); diff --git a/docs/assets/guide/zh/plugin/header-highlight.md b/docs/assets/guide/zh/plugin/header-highlight.md index 29652ab54..a01781045 100644 --- a/docs/assets/guide/zh/plugin/header-highlight.md +++ b/docs/assets/guide/zh/plugin/header-highlight.md @@ -8,7 +8,7 @@ VTable 提供表头高亮插件,支持选中单元格后,高亮对应的表 ## 表头高亮插件配置项 -- `VTable.HeaderHighlightPlugin` 表头高亮插件,可以配置以下参数: +- `HeaderHighlightPlugin` 表头高亮插件,可以配置以下参数: - `columnHighlight` 是否高亮列头 - `rowHighlight` 是否高亮行头 - `colHighlightBGColor` 列头高亮背景色 @@ -17,7 +17,7 @@ VTable 提供表头高亮插件,支持选中单元格后,高亮对应的表 - `rowHighlightColor` 行头高亮字体色 ```js -const highlightPlugin = new VTable.HeaderHighlightPlugin(tableInstance, {}); +const highlightPlugin = new HeaderHighlightPlugin(tableInstance, {}); ``` 具体使用参考[demo](../../demo/interaction/head-highlight) diff --git a/docs/assets/guide/zh/plugin/invert-highlight.md b/docs/assets/guide/zh/plugin/invert-highlight.md index fa30fd2bd..1be1fee5b 100644 --- a/docs/assets/guide/zh/plugin/invert-highlight.md +++ b/docs/assets/guide/zh/plugin/invert-highlight.md @@ -8,12 +8,12 @@ VTable 提供反选高亮插件,支持反选高亮指定区域。 ## 反选高亮插件配置项 -- `VTable.InvertHighlightPlugin` 反选高亮插件,可以配置以下参数: +- `InvertHighlightPlugin` 反选高亮插件,可以配置以下参数: - `fill` 反选高亮背景色 - `opacity` 反选高亮透明度 ```js -const highlightPlugin = new VTable.InvertHighlightPlugin(tableInstance, {}); +const highlightPlugin = new InvertHighlightPlugin(tableInstance, {}); highlightPlugin.setInvertHighlightRange({ start: { diff --git a/docs/src/main.tsx b/docs/src/main.tsx index f431fdf07..8a0817842 100644 --- a/docs/src/main.tsx +++ b/docs/src/main.tsx @@ -12,6 +12,7 @@ import { SearchComponent } from '@visactor/vtable-search'; import * as ReactVTable from '@visactor/react-vtable'; import * as VueVTable from '@visactor/vue-vtable'; import * as InulaVTable from '@visactor/openinula-vtable'; +import * as VTablePlugins from '@visactor/vtable-plugins'; import { App } from './app'; import * as ArcoDesign from '@arco-design/web-react'; import * as ArcoDesignVue from '@arco-design/web-vue'; @@ -28,6 +29,7 @@ import { createApp, ref, onMounted, h } from 'vue'; (window as any).VTableGantt = VTableGantt; (window as any).VTableCalendar = VTableCalendar; (window as any).VTable_editors = VTableEditors; +(window as any).VTablePlugins = VTablePlugins; (window as any).VChart = VChart.VChart; (window as any).downloadCsv = downloadCsv; From e94ccd39375242fad587e161e4bf43b3858f2847 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Fri, 29 Nov 2024 14:42:34 +0800 Subject: [PATCH 22/24] chore: add rush change --- .../vtable/feat-vtable-plugins_2024-11-29-06-41.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json diff --git a/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json b/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json new file mode 100644 index 000000000..b1fbf7450 --- /dev/null +++ b/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vtable", + "comment": "feat: add @visactor/vtable-plugins package", + "type": "none" + } + ], + "packageName": "@visactor/vtable" +} \ No newline at end of file From 14ee054a7d3143ea9468a6ce47e97da4d0bb23a6 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Fri, 29 Nov 2024 15:51:53 +0800 Subject: [PATCH 23/24] chore: add vtable devDependencies in vtable-plugins --- common/config/rush/pnpm-lock.yaml | 2 ++ packages/vtable-plugins/package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d2d5060c0..645af30ce 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -779,6 +779,7 @@ importers: '@types/react-dom': ^18.0.0 '@types/react-is': ^17.0.3 '@visactor/vchart': 1.12.12 + '@visactor/vtable': workspace:* '@visactor/vutils': ~0.18.14 '@vitejs/plugin-react': 3.1.0 axios: ^1.4.0 @@ -827,6 +828,7 @@ importers: '@types/react-dom': 18.3.1 '@types/react-is': 17.0.7 '@visactor/vchart': 1.12.12 + '@visactor/vtable': link:../vtable '@vitejs/plugin-react': 3.1.0_vite@3.2.6 axios: 1.7.8 chai: 4.3.4 diff --git a/packages/vtable-plugins/package.json b/packages/vtable-plugins/package.json index f84a464ca..3d5352595 100644 --- a/packages/vtable-plugins/package.json +++ b/packages/vtable-plugins/package.json @@ -40,6 +40,7 @@ "@visactor/vtable": "workspace:*" }, "devDependencies": { + "@visactor/vtable": "workspace:*", "@visactor/vchart": "1.12.12", "@internal/bundler": "workspace:*", "@internal/eslint-config": "workspace:*", From 173bbaac152de8dbd3bb79062a858492648a0540 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 29 Nov 2024 08:04:31 +0000 Subject: [PATCH 24/24] build: prelease version 1.11.5 --- ...tInfoWhenEnterOrLeave_2024-11-28-11-56.json | 11 ----------- ...tInfoWhenEnterOrLeave_2024-11-28-12-31.json | 11 ----------- .../feat-vtable-plugins_2024-11-29-06-41.json | 10 ---------- common/config/rush/version-policies.json | 2 +- packages/openinula-vtable/package.json | 2 +- packages/react-vtable/package.json | 2 +- packages/vtable-calendar/package.json | 2 +- packages/vtable-editors/package.json | 2 +- packages/vtable-export/package.json | 2 +- packages/vtable-gantt/package.json | 2 +- packages/vtable-plugins/package.json | 4 ++-- packages/vtable-search/package.json | 2 +- packages/vtable/CHANGELOG.json | 18 ++++++++++++++++++ packages/vtable/CHANGELOG.md | 15 ++++++++++++++- packages/vtable/package.json | 4 ++-- packages/vue-vtable/package.json | 2 +- 16 files changed, 45 insertions(+), 46 deletions(-) delete mode 100644 common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json delete mode 100644 common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json delete mode 100644 common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json diff --git a/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json b/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json deleted file mode 100644 index 909e5815a..000000000 --- a/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-11-56.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "docs: 更新进入或离开节点时的事件文档\n\n", - "type": "none", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "lou@trip.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json b/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json deleted file mode 100644 index 5e3c158a3..000000000 --- a/common/changes/@visactor/vtable/feat-fireTargetInfoWhenEnterOrLeave_2024-11-28-12-31.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "docs: 更新甘特图事件文档,暴露整个e的信息\n\n", - "type": "none", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "lou@trip.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json b/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json deleted file mode 100644 index b1fbf7450..000000000 --- a/common/changes/@visactor/vtable/feat-vtable-plugins_2024-11-29-06-41.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@visactor/vtable", - "comment": "feat: add @visactor/vtable-plugins package", - "type": "none" - } - ], - "packageName": "@visactor/vtable" -} \ No newline at end of file diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index e697bc28f..c32d6d378 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -1 +1 @@ -[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.11.4","mainProject":"@visactor/vtable","nextBump":"patch"}] +[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.11.5","mainProject":"@visactor/vtable","nextBump":"patch"}] diff --git a/packages/openinula-vtable/package.json b/packages/openinula-vtable/package.json index 24047966d..6d06cae46 100644 --- a/packages/openinula-vtable/package.json +++ b/packages/openinula-vtable/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/openinula-vtable", - "version": "1.11.4", + "version": "1.11.5", "description": "The openinula version of VTable", "keywords": [ "openinula", diff --git a/packages/react-vtable/package.json b/packages/react-vtable/package.json index 380662144..76dd1dba8 100644 --- a/packages/react-vtable/package.json +++ b/packages/react-vtable/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/react-vtable", - "version": "1.11.4", + "version": "1.11.5", "description": "The react version of VTable", "keywords": [ "react", diff --git a/packages/vtable-calendar/package.json b/packages/vtable-calendar/package.json index f49d0c1d1..58688a381 100644 --- a/packages/vtable-calendar/package.json +++ b/packages/vtable-calendar/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-calendar", - "version": "1.11.4", + "version": "1.11.5", "description": "The calendar component of VTable", "author": { "name": "VisActor", diff --git a/packages/vtable-editors/package.json b/packages/vtable-editors/package.json index 639b4886f..28b47420d 100644 --- a/packages/vtable-editors/package.json +++ b/packages/vtable-editors/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-editors", - "version": "1.11.4", + "version": "1.11.5", "description": "", "sideEffects": false, "main": "cjs/index.js", diff --git a/packages/vtable-export/package.json b/packages/vtable-export/package.json index 394bdf214..c0493ad38 100644 --- a/packages/vtable-export/package.json +++ b/packages/vtable-export/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-export", - "version": "1.11.4", + "version": "1.11.5", "description": "The export util of VTable", "author": { "name": "VisActor", diff --git a/packages/vtable-gantt/package.json b/packages/vtable-gantt/package.json index 1d13e1ae0..68d98c209 100644 --- a/packages/vtable-gantt/package.json +++ b/packages/vtable-gantt/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-gantt", - "version": "1.11.4", + "version": "1.11.5", "description": "canvas table width high performance", "keywords": [ "vtable-gantt", diff --git a/packages/vtable-plugins/package.json b/packages/vtable-plugins/package.json index 3d5352595..925df00e7 100644 --- a/packages/vtable-plugins/package.json +++ b/packages/vtable-plugins/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-plugins", - "version": "1.11.1", + "version": "1.11.5", "description": "The search util of VTable", "author": { "name": "VisActor", @@ -86,4 +86,4 @@ "@types/react-is": "^17.0.3", "rollup-plugin-node-resolve": "5.2.0" } -} \ No newline at end of file +} diff --git a/packages/vtable-search/package.json b/packages/vtable-search/package.json index 36e9a33bc..c4a7e0df9 100644 --- a/packages/vtable-search/package.json +++ b/packages/vtable-search/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-search", - "version": "1.11.4", + "version": "1.11.5", "description": "The search util of VTable", "author": { "name": "VisActor", diff --git a/packages/vtable/CHANGELOG.json b/packages/vtable/CHANGELOG.json index f0c3d5c26..5146c79e0 100644 --- a/packages/vtable/CHANGELOG.json +++ b/packages/vtable/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@visactor/vtable", "entries": [ + { + "version": "1.11.5", + "tag": "@visactor/vtable_v1.11.5", + "date": "Fri, 29 Nov 2024 07:59:16 GMT", + "comments": { + "none": [ + { + "comment": "docs: 更新进入或离开节点时的事件文档\n\n" + }, + { + "comment": "docs: 更新甘特图事件文档,暴露整个e的信息\n\n" + }, + { + "comment": "feat: add @visactor/vtable-plugins package" + } + ] + } + }, { "version": "1.11.4", "tag": "@visactor/vtable_v1.11.4", diff --git a/packages/vtable/CHANGELOG.md b/packages/vtable/CHANGELOG.md index 3ce9f1e27..39b3be65b 100644 --- a/packages/vtable/CHANGELOG.md +++ b/packages/vtable/CHANGELOG.md @@ -1,6 +1,19 @@ # Change Log - @visactor/vtable -This log was last generated on Fri, 29 Nov 2024 03:38:27 GMT and should not be manually modified. +This log was last generated on Fri, 29 Nov 2024 07:59:16 GMT and should not be manually modified. + +## 1.11.5 +Fri, 29 Nov 2024 07:59:16 GMT + +### Updates + +- docs: 更新进入或离开节点时的事件文档 + + +- docs: 更新甘特图事件文档,暴露整个e的信息 + + +- feat: add @visactor/vtable-plugins package ## 1.11.4 Fri, 29 Nov 2024 03:38:27 GMT diff --git a/packages/vtable/package.json b/packages/vtable/package.json index d72f6dce1..dda2ceb19 100644 --- a/packages/vtable/package.json +++ b/packages/vtable/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable", - "version": "1.11.4", + "version": "1.11.5", "description": "canvas table width high performance", "keywords": [ "grid", @@ -127,4 +127,4 @@ "url": "https://github.com/VisActor/VTable.git", "directory": "packages/vtable" } -} \ No newline at end of file +} diff --git a/packages/vue-vtable/package.json b/packages/vue-vtable/package.json index ae3d889d4..a4689e510 100644 --- a/packages/vue-vtable/package.json +++ b/packages/vue-vtable/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vue-vtable", - "version": "1.11.4", + "version": "1.11.5", "description": "The vue version of VTable", "keywords": [ "vue",