From 21d08d3ff51e96883f1ba0a5cdcc6d079322c079 Mon Sep 17 00:00:00 2001 From: vaynevayne <740652572@qq.com> Date: Mon, 27 Nov 2023 18:09:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(core):=20Table=20=E8=A1=8C=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E5=AF=BC=E8=87=B4=E7=9A=84=E5=88=97=E6=8B=96=E6=8B=BD?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/docs/package.json | 6 +++--- packages/eslint-config-soul/CHANGELOG.md | 6 ++++++ packages/eslint-config-soul/package.json | 2 +- packages/soul-core/CHANGELOG.md | 8 ++++++++ packages/soul-core/package.json | 2 +- packages/soul-core/src/Table/Table.tsx | 10 +++++++--- packages/soul-tsconfig/CHANGELOG.md | 6 ++++++ packages/soul-tsconfig/package.json | 2 +- packages/soul-utils/CHANGELOG.md | 6 ++++++ packages/soul-utils/package.json | 2 +- pnpm-lock.yaml | 6 +++--- 11 files changed, 43 insertions(+), 13 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index be8f832..a2862bb 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -10,13 +10,13 @@ "deploy": "pnpm build && touch ./storybook-static/.nojekyll && gh-pages -d ./storybook-static -t true" }, "dependencies": { - "@soul/core": "workspace:0.0.28", + "@soul/core": "workspace:0.0.29", "mockjs": "^1.1.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@soul/tsconfig": "workspace:0.0.27", + "@soul/tsconfig": "workspace:0.0.28", "@storybook/addon-essentials": "^7.0.12", "@storybook/addon-interactions": "^7.0.12", "@storybook/addon-links": "^7.0.12", @@ -26,7 +26,7 @@ "@storybook/testing-library": "^0.0.14-next.2", "@types/react": "^18.2.7", "@vitejs/plugin-react": "^1.3.2", - "eslint-config-soul": "workspace:0.0.27", + "eslint-config-soul": "workspace:0.0.28", "eslint-plugin-storybook": "^0.6.12", "prop-types": "^15.8.1", "serve": "^13.0.4", diff --git a/packages/eslint-config-soul/CHANGELOG.md b/packages/eslint-config-soul/CHANGELOG.md index d11dcd3..cbb06b1 100644 --- a/packages/eslint-config-soul/CHANGELOG.md +++ b/packages/eslint-config-soul/CHANGELOG.md @@ -1,5 +1,11 @@ # eslint-config-soul +## 0.0.28 + +### Patch Changes + +- dadd + ## 0.0.27 ### Patch Changes diff --git a/packages/eslint-config-soul/package.json b/packages/eslint-config-soul/package.json index 9aa94af..0de3c3f 100644 --- a/packages/eslint-config-soul/package.json +++ b/packages/eslint-config-soul/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-soul", - "version": "0.0.27", + "version": "0.0.28", "main": "index.js", "license": "MIT", "dependencies": { diff --git a/packages/soul-core/CHANGELOG.md b/packages/soul-core/CHANGELOG.md index aa052f9..8e0e3e1 100644 --- a/packages/soul-core/CHANGELOG.md +++ b/packages/soul-core/CHANGELOG.md @@ -1,5 +1,13 @@ # @soul/core +## 0.0.29 + +### Patch Changes + +- dadd +- Updated dependencies + - @soul/utils@0.0.29 + ## 0.0.28 ### Patch Changes diff --git a/packages/soul-core/package.json b/packages/soul-core/package.json index 6025979..7f651be 100644 --- a/packages/soul-core/package.json +++ b/packages/soul-core/package.json @@ -1,6 +1,6 @@ { "name": "@soul/core", - "version": "0.0.28", + "version": "0.0.29", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", diff --git a/packages/soul-core/src/Table/Table.tsx b/packages/soul-core/src/Table/Table.tsx index ce75010..725810d 100644 --- a/packages/soul-core/src/Table/Table.tsx +++ b/packages/soul-core/src/Table/Table.tsx @@ -192,10 +192,14 @@ const SoulTable: React.ForwardRefRenderFunction = ( const dragProps = { onDragEnd(fromIndex: number, toIndex: number) { + const leftLength = tableColumns.filter( + (item) => item.fixed === "left" + ).length + const moved = arrayMoveImmutable( tableColumns, - fromIndex, - toIndex + fromIndex + leftLength, + toIndex + leftLength ) const newColumnsState = produce(columnsState, (draft) => { @@ -211,7 +215,7 @@ const SoulTable: React.ForwardRefRenderFunction = ( setColumnsState(newColumnsState) }, nodeSelector: "th:not(.ant-table-cell-fix-left)", - // ignoreSelector: ".ant-table-cell-fix-left", + ignoreSelector: ".ant-table-cell-fix-left", } const dragRowProps = { diff --git a/packages/soul-tsconfig/CHANGELOG.md b/packages/soul-tsconfig/CHANGELOG.md index 370df9d..9ffe52c 100644 --- a/packages/soul-tsconfig/CHANGELOG.md +++ b/packages/soul-tsconfig/CHANGELOG.md @@ -1,5 +1,11 @@ # @soul/tsconfig +## 0.0.28 + +### Patch Changes + +- dadd + ## 0.0.27 ### Patch Changes diff --git a/packages/soul-tsconfig/package.json b/packages/soul-tsconfig/package.json index e1b0a3d..10b2a44 100644 --- a/packages/soul-tsconfig/package.json +++ b/packages/soul-tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "@soul/tsconfig", - "version": "0.0.27", + "version": "0.0.28", "private": true, "license": "MIT", "publishConfig": { diff --git a/packages/soul-utils/CHANGELOG.md b/packages/soul-utils/CHANGELOG.md index 06f38ba..810bdad 100644 --- a/packages/soul-utils/CHANGELOG.md +++ b/packages/soul-utils/CHANGELOG.md @@ -1,5 +1,11 @@ # @soul/utils +## 0.0.29 + +### Patch Changes + +- dadd + ## 0.0.28 ### Patch Changes diff --git a/packages/soul-utils/package.json b/packages/soul-utils/package.json index 5b94cfe..e4af443 100644 --- a/packages/soul-utils/package.json +++ b/packages/soul-utils/package.json @@ -1,6 +1,6 @@ { "name": "@soul/utils", - "version": "0.0.28", + "version": "0.0.29", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9827e77..f078fc1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,7 +32,7 @@ importers: apps/docs: dependencies: '@soul/core': - specifier: workspace:0.0.28 + specifier: workspace:0.0.29 version: link:../../packages/soul-core mockjs: specifier: ^1.1.0 @@ -45,7 +45,7 @@ importers: version: 18.2.0(react@18.2.0) devDependencies: '@soul/tsconfig': - specifier: workspace:0.0.27 + specifier: workspace:0.0.28 version: link:../../packages/soul-tsconfig '@storybook/addon-essentials': specifier: ^7.0.12 @@ -75,7 +75,7 @@ importers: specifier: ^1.3.2 version: 1.3.2 eslint-config-soul: - specifier: workspace:0.0.27 + specifier: workspace:0.0.28 version: link:../../packages/eslint-config-soul eslint-plugin-storybook: specifier: ^0.6.12