From 1f6e0192ffd5f874c8e2ce804eefdd1d1b018ab5 Mon Sep 17 00:00:00 2001 From: wjgogogo <906626481@qq.com> Date: Tue, 19 Nov 2024 15:03:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20icon=20=E4=BD=8D=E7=BD=AE=E8=BF=81?= =?UTF-8?q?=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/s2-core/package.json | 4 ++-- packages/s2-core/src/shared/icons/dot-icon.svg | 10 ---------- packages/s2-core/src/shared/icons/sort-icon.svg | 13 ------------- .../s2-core/src/shared/icons/switcher-icon.svg | 15 --------------- .../src/components/common/icons/index.tsx | 12 ++++++------ .../common/icons/svg}/calendar-icon.svg | 0 .../src/components/common/icons/svg}/col-icon.svg | 0 .../common/icons/svg}/location-icon.svg | 0 .../src/components/common/icons/svg}/row-icon.svg | 0 .../components/common/icons/svg}/text-icon.svg | 0 .../components/common/icons/svg}/value-icon.svg | 0 packages/s2-react-components/tsconfig.build.json | 4 ++-- packages/s2-react/tsconfig.build.json | 4 ++-- .../s2-vue/src/components/drill-down/index.vue | 6 +++--- .../src/svg/calendar-icon.svg} | 0 packages/s2-vue/src/svg/location-icon.svg | 13 +++++++++++++ packages/s2-vue/src/svg/text-icon.svg | 13 +++++++++++++ 17 files changed, 41 insertions(+), 53 deletions(-) delete mode 100644 packages/s2-core/src/shared/icons/dot-icon.svg delete mode 100644 packages/s2-core/src/shared/icons/sort-icon.svg delete mode 100644 packages/s2-core/src/shared/icons/switcher-icon.svg rename packages/{s2-core/src/shared/icons => s2-react-components/src/components/common/icons/svg}/calendar-icon.svg (100%) rename packages/{s2-core/src/shared/icons => s2-react-components/src/components/common/icons/svg}/col-icon.svg (100%) rename packages/{s2-core/src/shared/icons => s2-react-components/src/components/common/icons/svg}/location-icon.svg (100%) rename packages/{s2-core/src/shared/icons => s2-react-components/src/components/common/icons/svg}/row-icon.svg (100%) rename packages/{s2-core/src/shared/icons => s2-react-components/src/components/common/icons/svg}/text-icon.svg (100%) rename packages/{s2-core/src/shared/icons => s2-react-components/src/components/common/icons/svg}/value-icon.svg (100%) rename packages/{s2-core/src/shared/icons/search-icon.svg => s2-vue/src/svg/calendar-icon.svg} (100%) create mode 100644 packages/s2-vue/src/svg/location-icon.svg create mode 100644 packages/s2-vue/src/svg/text-icon.svg diff --git a/packages/s2-core/package.json b/packages/s2-core/package.json index 912b39fb68..b25c4b45e7 100644 --- a/packages/s2-core/package.json +++ b/packages/s2-core/package.json @@ -32,8 +32,8 @@ "require": "./lib/index.js" }, "./extends": { - "import": "./esm/extends.js", - "require": "./lib/extends.js" + "import": "./esm/extends/index.js", + "require": "./lib/extends/index.js" }, "./*": "./*" }, diff --git a/packages/s2-core/src/shared/icons/dot-icon.svg b/packages/s2-core/src/shared/icons/dot-icon.svg deleted file mode 100644 index 7f66ea2d2a..0000000000 --- a/packages/s2-core/src/shared/icons/dot-icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/packages/s2-core/src/shared/icons/sort-icon.svg b/packages/s2-core/src/shared/icons/sort-icon.svg deleted file mode 100644 index 705b29c1a1..0000000000 --- a/packages/s2-core/src/shared/icons/sort-icon.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/packages/s2-core/src/shared/icons/switcher-icon.svg b/packages/s2-core/src/shared/icons/switcher-icon.svg deleted file mode 100644 index 051059343d..0000000000 --- a/packages/s2-core/src/shared/icons/switcher-icon.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/packages/s2-react-components/src/components/common/icons/index.tsx b/packages/s2-react-components/src/components/common/icons/index.tsx index 6cfea3a12c..ed0201d507 100644 --- a/packages/s2-react-components/src/components/common/icons/index.tsx +++ b/packages/s2-react-components/src/components/common/icons/index.tsx @@ -1,9 +1,9 @@ -import { ReactComponent as CalendarIcon } from '@antv/s2/esm/shared/icons/calendar-icon.svg'; -import { ReactComponent as ColIcon } from '@antv/s2/esm/shared/icons/col-icon.svg'; -import { ReactComponent as LocationIcon } from '@antv/s2/esm/shared/icons/location-icon.svg'; -import { ReactComponent as RowIcon } from '@antv/s2/esm/shared/icons/row-icon.svg'; -import { ReactComponent as TextIcon } from '@antv/s2/esm/shared/icons/text-icon.svg'; -import { ReactComponent as ValueIcon } from '@antv/s2/esm/shared/icons/value-icon.svg'; import './index.less'; +import { ReactComponent as CalendarIcon } from './svg/calendar-icon.svg'; +import { ReactComponent as ColIcon } from './svg/col-icon.svg'; +import { ReactComponent as LocationIcon } from './svg/location-icon.svg'; +import { ReactComponent as RowIcon } from './svg/row-icon.svg'; +import { ReactComponent as TextIcon } from './svg/text-icon.svg'; +import { ReactComponent as ValueIcon } from './svg/value-icon.svg'; export { CalendarIcon, ColIcon, LocationIcon, RowIcon, TextIcon, ValueIcon }; diff --git a/packages/s2-core/src/shared/icons/calendar-icon.svg b/packages/s2-react-components/src/components/common/icons/svg/calendar-icon.svg similarity index 100% rename from packages/s2-core/src/shared/icons/calendar-icon.svg rename to packages/s2-react-components/src/components/common/icons/svg/calendar-icon.svg diff --git a/packages/s2-core/src/shared/icons/col-icon.svg b/packages/s2-react-components/src/components/common/icons/svg/col-icon.svg similarity index 100% rename from packages/s2-core/src/shared/icons/col-icon.svg rename to packages/s2-react-components/src/components/common/icons/svg/col-icon.svg diff --git a/packages/s2-core/src/shared/icons/location-icon.svg b/packages/s2-react-components/src/components/common/icons/svg/location-icon.svg similarity index 100% rename from packages/s2-core/src/shared/icons/location-icon.svg rename to packages/s2-react-components/src/components/common/icons/svg/location-icon.svg diff --git a/packages/s2-core/src/shared/icons/row-icon.svg b/packages/s2-react-components/src/components/common/icons/svg/row-icon.svg similarity index 100% rename from packages/s2-core/src/shared/icons/row-icon.svg rename to packages/s2-react-components/src/components/common/icons/svg/row-icon.svg diff --git a/packages/s2-core/src/shared/icons/text-icon.svg b/packages/s2-react-components/src/components/common/icons/svg/text-icon.svg similarity index 100% rename from packages/s2-core/src/shared/icons/text-icon.svg rename to packages/s2-react-components/src/components/common/icons/svg/text-icon.svg diff --git a/packages/s2-core/src/shared/icons/value-icon.svg b/packages/s2-react-components/src/components/common/icons/svg/value-icon.svg similarity index 100% rename from packages/s2-core/src/shared/icons/value-icon.svg rename to packages/s2-react-components/src/components/common/icons/svg/value-icon.svg diff --git a/packages/s2-react-components/tsconfig.build.json b/packages/s2-react-components/tsconfig.build.json index 0dae21a498..2664f3c426 100644 --- a/packages/s2-react-components/tsconfig.build.json +++ b/packages/s2-react-components/tsconfig.build.json @@ -3,8 +3,8 @@ "include": ["src/**/*", "./typings.d.ts", "../../global.d.ts"], "compilerOptions": { "paths": { - "@antv/s2": ["s2-core/src/index.ts"], - "@antv/s2/*": ["s2-core/src/*"] + "@antv/s2": ["s2-react-components/node_modules/@antv/s2/esm/index.d.ts"], + "@antv/s2/*": ["s2-react-components/node_modules/@antv/s2/esm/*"] } } } diff --git a/packages/s2-react/tsconfig.build.json b/packages/s2-react/tsconfig.build.json index 602f8222cc..4426e44631 100644 --- a/packages/s2-react/tsconfig.build.json +++ b/packages/s2-react/tsconfig.build.json @@ -3,8 +3,8 @@ "include": ["src/**/*", "./typings.d.ts", "../../global.d.ts"], "compilerOptions": { "paths": { - "@antv/s2/*": ["s2-core/src/*"], - "@antv/s2": ["s2-core/src/index.ts"] + "@antv/s2": ["s2-react/node_modules/@antv/s2/esm/index.d.ts"], + "@antv/s2/*": ["s2-react/node_modules/@antv/s2/esm/*"] } } } diff --git a/packages/s2-vue/src/components/drill-down/index.vue b/packages/s2-vue/src/components/drill-down/index.vue index d4dd37dba8..dec31507ed 100644 --- a/packages/s2-vue/src/components/drill-down/index.vue +++ b/packages/s2-vue/src/components/drill-down/index.vue @@ -9,11 +9,11 @@ import { import { Button, Input, Empty, Menu, MenuItem } from 'ant-design-vue'; import type { SelectInfo } from 'ant-design-vue/lib/menu/src/interface'; import { isEmpty } from 'lodash'; -import LocationIcon from '@antv/s2/esm/shared/icons/location-icon.svg?component'; -import TextIcon from '@antv/s2/esm/shared/icons/text-icon.svg?component'; -import CalendarIcon from '@antv/s2/esm/shared/icons/calendar-icon.svg?component'; import type { Key } from 'ant-design-vue/lib/_util/type'; import type { ChangeEvent } from 'ant-design-vue/lib/_util/EventInterface'; +import LocationIcon from '../../svg/location-icon.svg?component'; +import TextIcon from '../../svg/text-icon.svg?component'; +import CalendarIcon from '../../svg/calendar-icon.svg?component'; import { initDrillDownEmits, initDrillDownProps, diff --git a/packages/s2-core/src/shared/icons/search-icon.svg b/packages/s2-vue/src/svg/calendar-icon.svg similarity index 100% rename from packages/s2-core/src/shared/icons/search-icon.svg rename to packages/s2-vue/src/svg/calendar-icon.svg diff --git a/packages/s2-vue/src/svg/location-icon.svg b/packages/s2-vue/src/svg/location-icon.svg new file mode 100644 index 0000000000..49a9c711f8 --- /dev/null +++ b/packages/s2-vue/src/svg/location-icon.svg @@ -0,0 +1,13 @@ + + + diff --git a/packages/s2-vue/src/svg/text-icon.svg b/packages/s2-vue/src/svg/text-icon.svg new file mode 100644 index 0000000000..af3a86d533 --- /dev/null +++ b/packages/s2-vue/src/svg/text-icon.svg @@ -0,0 +1,13 @@ + + +