From 6503e5527715a6424433df0ff523b8910e891033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Fri, 11 Feb 2022 11:03:15 +0800 Subject: [PATCH] refactor(utils): migrate utils (#5949) * refactor(utils-v2): migrate utils * refactor(utils-v2): migrate utils * refactor(utils-v2): migrate utils * refactor(utils): remove * refactor(utils): rename * refactor(utils): move EVENT_CODE to constants * refactor: remove generic --- .../vitepress/composables/lock-screen.ts | 4 +- package.json | 2 +- packages/components/affix/index.ts | 2 +- packages/components/affix/src/affix.ts | 2 +- packages/components/affix/src/affix.vue | 2 +- .../components/alert/__tests__/alert.spec.ts | 2 +- packages/components/alert/index.ts | 2 +- packages/components/alert/src/alert.ts | 4 +- packages/components/alert/src/alert.vue | 2 +- packages/components/autocomplete/index.ts | 2 +- .../components/autocomplete/src/index.vue | 2 +- packages/components/avatar/index.ts | 2 +- packages/components/avatar/src/avatar.ts | 6 +- packages/components/avatar/src/avatar.vue | 2 +- packages/components/backtop/index.ts | 2 +- packages/components/backtop/src/backtop.vue | 3 +- packages/components/badge/index.ts | 2 +- packages/components/badge/src/badge.ts | 2 +- packages/components/breadcrumb/index.ts | 2 +- .../breadcrumb/src/breadcrumb-item.ts | 2 +- .../components/breadcrumb/src/breadcrumb.ts | 2 +- packages/components/button/index.ts | 2 +- packages/components/button/src/button.ts | 2 +- packages/components/calendar/index.ts | 2 +- packages/components/calendar/src/calendar.ts | 2 +- packages/components/calendar/src/calendar.vue | 2 +- .../components/calendar/src/date-table.ts | 2 +- packages/components/card/index.ts | 2 +- packages/components/card/src/card.ts | 2 +- packages/components/carousel/index.ts | 2 +- packages/components/carousel/src/item.vue | 5 +- packages/components/carousel/src/main.vue | 4 +- packages/components/cascader-panel/index.ts | 2 +- .../components/cascader-panel/src/index.vue | 33 +- .../components/cascader-panel/src/menu.vue | 4 +- .../components/cascader-panel/src/node.ts | 2 +- .../components/cascader-panel/src/store.ts | 2 +- .../components/cascader-panel/src/types.ts | 2 +- .../components/cascader-panel/src/utils.ts | 2 +- .../cascader/__tests__/cascader.spec.ts | 2 +- packages/components/cascader/index.ts | 2 +- packages/components/cascader/src/index.vue | 14 +- packages/components/check-tag/index.ts | 2 +- .../components/check-tag/src/check-tag.ts | 2 +- packages/components/checkbox/index.ts | 2 +- .../checkbox/src/checkbox-group.vue | 2 +- .../components/checkbox/src/checkbox.type.ts | 3 +- packages/components/checkbox/src/checkbox.vue | 2 +- .../components/checkbox/src/useCheckbox.ts | 11 +- packages/components/col/index.ts | 2 +- packages/components/col/src/col.ts | 2 +- .../components/collapse-transition/index.ts | 2 +- packages/components/collapse/index.ts | 2 +- .../components/collapse/src/collapse-item.vue | 2 +- .../__tests__/color-picker.spec.ts | 2 +- packages/components/color-picker/index.ts | 2 +- packages/components/color-picker/src/color.ts | 2 +- .../src/components/alpha-slider.vue | 4 +- .../src/components/hue-slider.vue | 2 +- .../color-picker/src/components/sv-panel.vue | 2 +- .../components/color-picker/src/draggable.ts | 2 +- .../components/color-picker/src/index.vue | 2 +- packages/components/config-provider/index.ts | 2 +- .../config-provider/src/config-provider.ts | 2 +- packages/components/container/index.ts | 2 +- .../date-picker/__tests__/date-picker.spec.ts | 2 +- packages/components/date-picker/index.ts | 2 +- .../src/date-picker-com/basic-cell-render.ts | 2 +- .../src/date-picker-com/basic-date-table.vue | 10 +- .../src/date-picker-com/basic-month-table.vue | 5 +- .../src/date-picker-com/basic-year-table.vue | 7 +- .../src/date-picker-com/panel-date-pick.vue | 4 +- .../src/date-picker-com/panel-date-range.vue | 2 +- packages/components/descriptions/index.ts | 2 +- .../descriptions/src/descriptions-cell.ts | 2 +- .../components/descriptions/src/index.vue | 2 +- packages/components/dialog/index.ts | 2 +- packages/components/dialog/src/dialog.ts | 6 +- packages/components/dialog/src/dialog.vue | 2 +- packages/components/dialog/src/use-dialog.ts | 2 +- packages/components/divider/index.ts | 2 +- packages/components/divider/src/divider.ts | 2 +- packages/components/drawer/index.ts | 2 +- packages/components/drawer/src/drawer.ts | 2 +- .../dropdown/__tests__/dropdown.spec.ts | 2 +- packages/components/dropdown/index.ts | 2 +- .../dropdown/src/dropdown-item-impl.vue | 4 +- .../components/dropdown/src/dropdown-item.vue | 2 +- .../components/dropdown/src/dropdown-menu.vue | 4 +- packages/components/dropdown/src/dropdown.ts | 10 +- packages/components/dropdown/src/dropdown.vue | 2 +- .../components/dropdown/src/useDropdown.ts | 8 +- packages/components/empty/index.ts | 2 +- .../focus-trap/__tests__/focus-trap.spec.ts | 2 +- .../components/focus-trap/src/focus-trap.vue | 4 +- packages/components/form/index.ts | 2 +- packages/components/form/src/form-item.vue | 7 +- packages/components/form/src/form.vue | 2 +- packages/components/form/src/label-wrap.ts | 8 +- packages/components/icon/index.ts | 2 +- packages/components/icon/src/icon.ts | 2 +- packages/components/icon/src/icon.vue | 2 +- packages/components/image-viewer/index.ts | 2 +- .../image-viewer/src/image-viewer.ts | 2 +- .../image-viewer/src/image-viewer.vue | 12 +- packages/components/image/index.ts | 2 +- packages/components/image/src/image.ts | 2 +- packages/components/image/src/image.vue | 2 +- packages/components/infinite-scroll/index.ts | 2 +- .../components/infinite-scroll/src/index.ts | 4 +- packages/components/input-number/index.ts | 2 +- .../input-number/src/input-number.ts | 2 +- .../input-number/src/input-number.vue | 2 +- packages/components/input/index.ts | 2 +- .../input/src/calc-textarea-height.ts | 2 +- packages/components/input/src/input.ts | 2 +- packages/components/input/src/input.vue | 6 +- packages/components/link/index.ts | 2 +- packages/components/link/src/link.ts | 2 +- packages/components/loading/src/loading.ts | 2 +- packages/components/loading/src/service.ts | 2 +- packages/components/menu/index.ts | 2 +- .../menu/src/menu-collapse-transition.vue | 2 +- .../components/menu/src/menu-item-group.vue | 2 +- packages/components/menu/src/menu-item.ts | 2 +- packages/components/menu/src/menu-item.vue | 2 +- packages/components/menu/src/menu.ts | 4 +- packages/components/menu/src/sub-menu.ts | 2 +- packages/components/menu/src/use-menu.ts | 2 +- .../menu/src/utils}/menu-bar.ts | 0 .../menu/src/utils}/menu-item.ts | 3 +- .../menu/src/utils}/submenu.ts | 3 +- packages/components/message-box/index.ts | 2 +- packages/components/message-box/src/index.vue | 9 +- .../components/message-box/src/messageBox.ts | 2 +- .../message/__tests__/message-manager.spec.ts | 2 +- .../message/__tests__/message.spec.ts | 4 +- packages/components/message/index.ts | 2 +- .../components/message/src/message-method.ts | 2 +- packages/components/message/src/message.ts | 6 +- packages/components/message/src/message.vue | 4 +- .../__tests__/notification.spec.ts | 4 +- packages/components/notification/index.ts | 2 +- .../notification/src/notification.ts | 2 +- .../notification/src/notification.vue | 4 +- .../components/notification/src/notify.ts | 2 +- packages/components/overlay/src/overlay.ts | 2 +- packages/components/page-header/index.ts | 2 +- packages/components/pagination/index.ts | 2 +- .../pagination/src/components/sizes.vue | 4 +- .../components/pagination/src/pagination.ts | 2 +- packages/components/popconfirm/index.ts | 2 +- .../components/popconfirm/src/popconfirm.ts | 6 +- packages/components/popover/index.ts | 2 +- packages/components/popover/src/index.vue | 2 +- packages/components/popover/src/popover.ts | 2 +- packages/components/popper/index.ts | 2 +- packages/components/popper/src/container.ts | 2 +- packages/components/popper/src/deprecation.ts | 2 +- packages/components/popper/src/popper.ts | 2 +- packages/components/progress/index.ts | 2 +- packages/components/progress/src/progress.ts | 2 +- .../components/radio/__tests__/radio.spec.ts | 2 +- packages/components/radio/index.ts | 2 +- packages/components/radio/src/radio-button.ts | 2 +- packages/components/radio/src/radio-group.ts | 2 +- packages/components/radio/src/radio-group.vue | 3 +- packages/components/radio/src/radio.ts | 7 +- packages/components/rate/index.ts | 2 +- packages/components/rate/src/rate.ts | 2 +- packages/components/rate/src/rate.vue | 6 +- packages/components/result/index.ts | 2 +- packages/components/result/src/result.ts | 2 +- .../__tests__/roving-focus-group.spec.ts | 2 +- .../__tests__/roving-focus-item.spec.ts | 4 +- .../roving-focus-group/__tests__/util.spec.ts | 2 +- .../src/roving-focus-group-impl.vue | 2 +- .../src/roving-focus-group.ts | 2 +- .../src/roving-focus-item.vue | 4 +- .../roving-focus-group/src/utils.ts | 2 +- packages/components/row/index.ts | 2 +- packages/components/row/src/row.ts | 2 +- packages/components/scrollbar/index.ts | 2 +- packages/components/scrollbar/src/bar.ts | 2 +- .../components/scrollbar/src/scrollbar.ts | 2 +- .../components/scrollbar/src/scrollbar.vue | 2 +- packages/components/scrollbar/src/thumb.ts | 2 +- packages/components/scrollbar/src/thumb.vue | 2 +- .../select-v2/__tests__/select.spec.ts | 4 +- packages/components/select-v2/index.ts | 2 +- packages/components/select-v2/src/defaults.ts | 2 +- .../select-v2/src/select-dropdown.vue | 14 +- packages/components/select-v2/src/useInput.ts | 2 +- .../components/select-v2/src/useSelect.ts | 11 +- .../select/__tests__/select.spec.ts | 2 +- packages/components/select/index.ts | 2 +- .../components/select/src/select-dropdown.vue | 7 +- packages/components/select/src/select.vue | 4 +- packages/components/select/src/useOption.ts | 9 +- packages/components/select/src/useSelect.ts | 29 +- packages/components/skeleton/index.ts | 2 +- .../components/skeleton/src/skeleton-item.ts | 2 +- packages/components/skeleton/src/skeleton.ts | 2 +- packages/components/slider/index.ts | 2 +- packages/components/slider/src/index.vue | 5 +- packages/components/slider/src/slider.type.ts | 2 +- packages/components/slider/src/useSlide.ts | 2 +- .../components/slider/src/useSliderButton.ts | 2 +- packages/components/slider/src/useStops.ts | 2 +- .../slot/__tests__/only-child.spec.ts | 4 +- packages/components/slot/src/only-child.ts | 2 +- packages/components/space/index.ts | 2 +- packages/components/space/src/item.vue | 2 +- packages/components/space/src/space.ts | 2 +- packages/components/space/src/use-space.ts | 2 +- packages/components/steps/index.ts | 2 +- packages/components/switch/index.ts | 2 +- packages/components/switch/src/switch.ts | 2 +- packages/components/switch/src/switch.vue | 2 +- packages/components/table/index.ts | 2 +- packages/components/table/src/config.ts | 2 +- .../components/table/src/store/watcher.ts | 2 +- .../table/src/table-body/events-helper.ts | 2 +- .../components/table/src/table-body/index.ts | 2 +- .../table/src/table-column/render-helper.ts | 2 +- .../table/src/table-column/watcher-helper.ts | 2 +- .../table/src/table-header/event-helper.ts | 2 +- packages/components/table/src/table-layout.ts | 2 +- .../components/table/src/table/defaults.ts | 2 +- .../table/src/table/style-helper.ts | 7 +- packages/components/table/src/util.ts | 12 +- .../components/tabs/__tests__/tabs.spec.ts | 2 +- packages/components/tabs/index.ts | 2 +- packages/components/tabs/src/tab-bar.ts | 2 +- packages/components/tabs/src/tab-bar.vue | 2 +- packages/components/tabs/src/tab-nav.ts | 4 +- packages/components/tabs/src/tab-pane.ts | 2 +- packages/components/tabs/src/tab-pane.vue | 2 +- packages/components/tabs/src/tabs.ts | 9 +- packages/components/tag/index.ts | 2 +- packages/components/tag/src/tag.ts | 2 +- packages/components/teleport/index.ts | 2 +- packages/components/teleport/src/teleport.ts | 2 +- packages/components/time-picker/index.ts | 2 +- .../time-picker/src/common/picker.vue | 4 +- .../time-picker/src/common/props.ts | 2 +- .../time-picker-com/basic-time-spinner.vue | 2 +- .../src/time-picker-com/panel-time-pick.vue | 2 +- .../src/time-picker-com/panel-time-range.vue | 2 +- packages/components/time-select/index.ts | 2 +- packages/components/timeline/index.ts | 2 +- .../components/timeline/src/timeline-item.ts | 2 +- .../tooltip/__tests__/tooltip.spec.ts | 4 +- .../tooltip/__tests__/trigger.spec.ts | 2 +- packages/components/tooltip/index.ts | 2 +- packages/components/tooltip/src/content.vue | 2 +- packages/components/tooltip/src/tooltip.ts | 2 +- packages/components/tooltip/src/tooltip.vue | 2 +- packages/components/tooltip/src/trigger.vue | 4 +- packages/components/tooltip/src/utils.ts | 2 +- packages/components/transfer/index.ts | 2 +- packages/components/tree-v2/index.ts | 2 +- .../components/tree-v2/src/virtual-tree.ts | 2 +- packages/components/tree/index.ts | 2 +- packages/components/tree/src/model/node.ts | 4 +- .../components/tree/src/model/tree-store.ts | 2 +- .../components/tree/src/model/useDragNode.ts | 2 +- .../components/tree/src/model/useKeydown.ts | 6 +- packages/components/tree/src/tree-node.vue | 4 +- packages/components/tree/src/tree.vue | 2 +- .../upload/__tests__/upload-list.spec.ts | 2 +- .../upload/__tests__/upload.spec.ts | 4 +- packages/components/upload/index.ts | 2 +- packages/components/upload/src/ajax.ts | 2 +- packages/components/upload/src/index.vue | 2 +- packages/components/upload/src/upload.vue | 4 +- .../virtual-list/src/builders/build-grid.ts | 8 +- .../virtual-list/src/builders/build-list.ts | 2 +- .../src/components/dynamic-size-grid.ts | 2 +- .../src/components/dynamic-size-list.ts | 2 +- .../src/components/fixed-size-grid.ts | 2 +- .../src/components/fixed-size-list.ts | 2 +- .../virtual-list/src/components/scrollbar.ts | 3 +- .../virtual-list/src/hooks/use-grid-wheel.ts | 2 +- .../virtual-list/src/hooks/use-wheel.ts | 2 +- packages/components/virtual-list/src/props.ts | 2 +- packages/constants/aria.ts | 17 + packages/constants/index.ts | 1 + .../directives/__tests__/trap-focus.spec.ts | 2 +- packages/directives/click-outside/index.ts | 4 +- packages/directives/mousewheel/index.ts | 2 +- packages/directives/repeat-click/index.ts | 2 +- packages/directives/resize/index.ts | 5 +- packages/directives/trap-focus/index.ts | 8 +- .../hooks/__tests__/use-deprecated.spec.ts | 4 +- .../hooks/__tests__/use-lockscreen.spec.ts | 2 +- packages/hooks/__tests__/use-modal.spec.ts | 2 +- .../hooks/__tests__/use-prevent-global.ts | 2 +- packages/hooks/use-attrs/index.ts | 2 +- packages/hooks/use-common-props/index.ts | 2 +- packages/hooks/use-delayed-toggle/index.ts | 2 +- packages/hooks/use-deprecated/index.ts | 2 +- packages/hooks/use-draggable/index.ts | 2 +- packages/hooks/use-escape-keydown/index.ts | 4 +- packages/hooks/use-global-config/index.ts | 17 +- packages/hooks/use-id/index.ts | 2 +- packages/hooks/use-lockscreen/index.ts | 6 +- packages/hooks/use-modal/index.ts | 2 +- packages/hooks/use-model-toggle/index.ts | 2 +- packages/hooks/use-popper-container/index.ts | 2 +- packages/hooks/use-teleport/index.ts | 5 +- packages/utils-v2/arrays.ts | 1 - packages/utils-v2/index.ts | 11 - packages/utils-v2/objects.ts | 2 - packages/utils-v2/package.json | 8 - packages/utils-v2/strings.ts | 6 - packages/utils-v2/types.ts | 20 -- packages/utils/arrays.ts | 7 + packages/{utils-v2 => utils}/browser.ts | 0 packages/utils/dom.ts | 295 ------------------ packages/utils/{ => dom}/aria.ts | 60 +--- packages/utils/dom/event.ts | 59 ++++ packages/utils/dom/index.ts | 6 + packages/utils/dom/position.ts | 66 ++++ packages/utils/{ => dom}/resize-event.ts | 4 +- packages/utils/dom/scroll.ts | 62 ++++ packages/utils/dom/style.ts | 72 +++++ packages/{utils-v2 => utils}/error.ts | 0 packages/{utils-v2 => utils}/i18n.ts | 0 packages/utils/index.ts | 19 +- packages/utils/menu/index.ts | 3 - packages/utils/objects.ts | 54 ++++ packages/utils/package.json | 5 +- packages/utils/raf.ts | 14 +- packages/{utils-v2 => utils}/rand.ts | 0 packages/utils/scroll-into-view.ts | 36 --- packages/utils/scrollbar-width.ts | 29 -- packages/utils/strings.ts | 9 + packages/utils/tests/{ => dom}/aria.test.ts | 2 +- packages/utils/tests/{ => dom}/dom.spec.ts | 2 +- .../tests/{ => vue}/global-nodes.spec.ts | 2 +- .../tests => utils/tests/vue}/prop.spec.ts | 8 +- packages/utils/types.ts | 22 +- packages/{utils-v2 => utils}/typescript.ts | 6 + packages/utils/util.ts | 169 ---------- .../{global-nodes.ts => vue/global-node.ts} | 22 +- packages/{utils-v2 => utils}/vue/icon.ts | 2 +- packages/{utils-v2 => utils}/vue/index.ts | 4 +- packages/{utils-v2 => utils}/vue/install.ts | 0 .../vue/prop.ts => utils/vue/props.ts} | 0 packages/utils/vue/refs.ts | 9 + packages/{utils-v2 => utils}/vue/style.ts | 2 +- .../{utils-v2 => utils}/vue/typescript.ts | 0 packages/{utils-v2 => utils}/vue/validator.ts | 0 packages/{utils-v2 => utils}/vue/vnode.ts | 2 +- pnpm-lock.yaml | 12 +- 356 files changed, 895 insertions(+), 1189 deletions(-) rename packages/{utils/menu => components/menu/src/utils}/menu-bar.ts (100%) rename packages/{utils/menu => components/menu/src/utils}/menu-item.ts (93%) rename packages/{utils/menu => components/menu/src/utils}/submenu.ts (93%) create mode 100644 packages/constants/aria.ts delete mode 100644 packages/utils-v2/arrays.ts delete mode 100644 packages/utils-v2/index.ts delete mode 100644 packages/utils-v2/objects.ts delete mode 100644 packages/utils-v2/package.json delete mode 100644 packages/utils-v2/strings.ts delete mode 100644 packages/utils-v2/types.ts create mode 100644 packages/utils/arrays.ts rename packages/{utils-v2 => utils}/browser.ts (100%) delete mode 100644 packages/utils/dom.ts rename packages/utils/{ => dom}/aria.ts (67%) create mode 100644 packages/utils/dom/event.ts create mode 100644 packages/utils/dom/index.ts create mode 100644 packages/utils/dom/position.ts rename packages/utils/{ => dom}/resize-event.ts (85%) create mode 100644 packages/utils/dom/scroll.ts create mode 100644 packages/utils/dom/style.ts rename packages/{utils-v2 => utils}/error.ts (100%) rename packages/{utils-v2 => utils}/i18n.ts (100%) delete mode 100644 packages/utils/menu/index.ts create mode 100644 packages/utils/objects.ts rename packages/{utils-v2 => utils}/rand.ts (100%) delete mode 100644 packages/utils/scroll-into-view.ts delete mode 100644 packages/utils/scrollbar-width.ts create mode 100644 packages/utils/strings.ts rename packages/utils/tests/{ => dom}/aria.test.ts (97%) rename packages/utils/tests/{ => dom}/dom.spec.ts (99%) rename packages/utils/tests/{ => vue}/global-nodes.spec.ts (97%) rename packages/{utils-v2/tests => utils/tests/vue}/prop.spec.ts (98%) rename packages/{utils-v2 => utils}/typescript.ts (62%) delete mode 100644 packages/utils/util.ts rename packages/utils/{global-nodes.ts => vue/global-node.ts} (57%) rename packages/{utils-v2 => utils}/vue/icon.ts (94%) rename packages/{utils-v2 => utils}/vue/index.ts (66%) rename packages/{utils-v2 => utils}/vue/install.ts (100%) rename packages/{utils-v2/vue/prop.ts => utils/vue/props.ts} (100%) create mode 100644 packages/utils/vue/refs.ts rename packages/{utils-v2 => utils}/vue/style.ts (91%) rename packages/{utils-v2 => utils}/vue/typescript.ts (100%) rename packages/{utils-v2 => utils}/vue/validator.ts (100%) rename packages/{utils-v2 => utils}/vue/vnode.ts (98%) diff --git a/docs/.vitepress/vitepress/composables/lock-screen.ts b/docs/.vitepress/vitepress/composables/lock-screen.ts index dba078f674..672f1e0d59 100644 --- a/docs/.vitepress/vitepress/composables/lock-screen.ts +++ b/docs/.vitepress/vitepress/composables/lock-screen.ts @@ -5,8 +5,8 @@ import { hasClass, getStyle, removeClass, -} from '@element-plus/utils/dom' -import getScrollBarWidth from '@element-plus/utils/scrollbar-width' + getScrollBarWidth, +} from '@element-plus/utils' export const useLockScreen = () => { let scrollBarWidth = 0 diff --git a/package.json b/package.json index 90b8d60dc2..d381b5dad1 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,6 @@ "@element-plus/theme-chalk": "workspace:*", "@element-plus/tokens": "workspace:*", "@element-plus/utils": "workspace:*", - "@element-plus/utils-v2": "workspace:*", "@popperjs/core": "^2.11.2", "@vueuse/core": "^7.6.0", "async-validator": "^4.0.7", @@ -125,6 +124,7 @@ "sucrase": "3.20.3", "ts-jest": "26.5.6", "ts-morph": "13.0.3", + "type-fest": "^2.11.2", "typescript": "4.5.5", "vue": "3.2.30", "vue-jest": "5.0.0-alpha.10", diff --git a/packages/components/affix/index.ts b/packages/components/affix/index.ts index 301872b72a..817d61cb90 100644 --- a/packages/components/affix/index.ts +++ b/packages/components/affix/index.ts @@ -1,4 +1,4 @@ -import { withInstall } from '@element-plus/utils-v2' +import { withInstall } from '@element-plus/utils' import Affix from './src/affix.vue' diff --git a/packages/components/affix/src/affix.ts b/packages/components/affix/src/affix.ts index e9e400f1be..1c98332934 100644 --- a/packages/components/affix/src/affix.ts +++ b/packages/components/affix/src/affix.ts @@ -1,4 +1,4 @@ -import { buildProps, definePropType } from '@element-plus/utils-v2' +import { buildProps, definePropType } from '@element-plus/utils' import type { ExtractPropTypes } from 'vue' import type { ZIndexProperty } from 'csstype' import type Affix from './affix.vue' diff --git a/packages/components/affix/src/affix.vue b/packages/components/affix/src/affix.vue index 87e9994cca..770894caa5 100644 --- a/packages/components/affix/src/affix.vue +++ b/packages/components/affix/src/affix.vue @@ -15,7 +15,7 @@ import { watch, } from 'vue' import { useEventListener, useResizeObserver } from '@vueuse/core' -import { getScrollContainer } from '@element-plus/utils/dom' +import { getScrollContainer } from '@element-plus/utils' import { useNamespace } from '@element-plus/hooks' import { affixEmits, affixProps } from './affix' diff --git a/packages/components/alert/__tests__/alert.spec.ts b/packages/components/alert/__tests__/alert.spec.ts index a1cd389462..77b671ce2a 100644 --- a/packages/components/alert/__tests__/alert.spec.ts +++ b/packages/components/alert/__tests__/alert.spec.ts @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils' -import { TypeComponentsMap } from '@element-plus/utils-v2' +import { TypeComponentsMap } from '@element-plus/utils' import Alert from '../src/alert.vue' const AXIOM = 'Rem is the best girl' diff --git a/packages/components/alert/index.ts b/packages/components/alert/index.ts index c5b018ec1b..5aa4e5e7c7 100644 --- a/packages/components/alert/index.ts +++ b/packages/components/alert/index.ts @@ -1,4 +1,4 @@ -import { withInstall } from '@element-plus/utils-v2' +import { withInstall } from '@element-plus/utils' import Alert from './src/alert.vue' diff --git a/packages/components/alert/src/alert.ts b/packages/components/alert/src/alert.ts index f4551fa239..756d4b83c7 100644 --- a/packages/components/alert/src/alert.ts +++ b/packages/components/alert/src/alert.ts @@ -1,4 +1,4 @@ -import { TypeComponentsMap, buildProps, keyOf } from '@element-plus/utils-v2' +import { TypeComponentsMap, buildProps, keysOf } from '@element-plus/utils' import type { ExtractPropTypes } from 'vue' import type Alert from './alert.vue' @@ -15,7 +15,7 @@ export const alertProps = buildProps({ }, type: { type: String, - values: keyOf(TypeComponentsMap), + values: keysOf(TypeComponentsMap), default: 'info', }, closable: { diff --git a/packages/components/alert/src/alert.vue b/packages/components/alert/src/alert.vue index ea595ea960..6eb1573f67 100644 --- a/packages/components/alert/src/alert.vue +++ b/packages/components/alert/src/alert.vue @@ -42,7 +42,7 @@