From 957b4bc1cc8f870ba155e37be2dca6d5de4e588a Mon Sep 17 00:00:00 2001 From: Kael Date: Thu, 23 May 2024 20:51:21 +1000 Subject: [PATCH] fix: remove circular imports fixes #19852 --- .../src/components/VExpansionPanel/VExpansionPanel.tsx | 2 +- .../src/components/VExpansionPanel/VExpansionPanelText.tsx | 2 +- .../components/VExpansionPanel/VExpansionPanelTitle.tsx | 2 +- .../src/components/VExpansionPanel/VExpansionPanels.tsx | 6 ++---- packages/vuetify/src/components/VExpansionPanel/shared.ts | 5 +++++ packages/vuetify/src/components/VStepper/VStepper.tsx | 6 ++---- packages/vuetify/src/components/VStepper/VStepperItem.tsx | 2 +- .../vuetify/src/components/VStepper/VStepperWindow.tsx | 7 +------ packages/vuetify/src/components/VStepper/shared.ts | 5 +++++ packages/vuetify/src/composables/defaults.ts | 4 +++- .../src/labs/VStepperVertical/VStepperVerticalItem.tsx | 3 +-- packages/vuetify/src/labs/VTreeview/VTreeviewItem.tsx | 2 +- 12 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 packages/vuetify/src/components/VExpansionPanel/shared.ts create mode 100644 packages/vuetify/src/components/VStepper/shared.ts diff --git a/packages/vuetify/src/components/VExpansionPanel/VExpansionPanel.tsx b/packages/vuetify/src/components/VExpansionPanel/VExpansionPanel.tsx index 4e913e6ffe5..881a6f6c0c4 100644 --- a/packages/vuetify/src/components/VExpansionPanel/VExpansionPanel.tsx +++ b/packages/vuetify/src/components/VExpansionPanel/VExpansionPanel.tsx @@ -1,5 +1,5 @@ // Components -import { VExpansionPanelSymbol } from './VExpansionPanels' +import { VExpansionPanelSymbol } from './shared' import { makeVExpansionPanelTextProps, VExpansionPanelText } from './VExpansionPanelText' import { makeVExpansionPanelTitleProps, VExpansionPanelTitle } from './VExpansionPanelTitle' diff --git a/packages/vuetify/src/components/VExpansionPanel/VExpansionPanelText.tsx b/packages/vuetify/src/components/VExpansionPanel/VExpansionPanelText.tsx index cf9f1f4ceea..6c0211b4150 100644 --- a/packages/vuetify/src/components/VExpansionPanel/VExpansionPanelText.tsx +++ b/packages/vuetify/src/components/VExpansionPanel/VExpansionPanelText.tsx @@ -1,5 +1,5 @@ // Components -import { VExpansionPanelSymbol } from './VExpansionPanels' +import { VExpansionPanelSymbol } from './shared' import { VExpandTransition } from '@/components/transitions' // Composables diff --git a/packages/vuetify/src/components/VExpansionPanel/VExpansionPanelTitle.tsx b/packages/vuetify/src/components/VExpansionPanel/VExpansionPanelTitle.tsx index 50083b3850b..54cc401592c 100644 --- a/packages/vuetify/src/components/VExpansionPanel/VExpansionPanelTitle.tsx +++ b/packages/vuetify/src/components/VExpansionPanel/VExpansionPanelTitle.tsx @@ -1,5 +1,5 @@ // Components -import { VExpansionPanelSymbol } from './VExpansionPanels' +import { VExpansionPanelSymbol } from './shared' import { VIcon } from '@/components/VIcon' // Composables diff --git a/packages/vuetify/src/components/VExpansionPanel/VExpansionPanels.tsx b/packages/vuetify/src/components/VExpansionPanel/VExpansionPanels.tsx index f60ccb44420..ac5d7e6e9f5 100644 --- a/packages/vuetify/src/components/VExpansionPanel/VExpansionPanels.tsx +++ b/packages/vuetify/src/components/VExpansionPanel/VExpansionPanels.tsx @@ -2,6 +2,7 @@ import './VExpansionPanel.sass' // Components +import { VExpansionPanelSymbol } from './shared' import { makeVExpansionPanelProps } from './VExpansionPanel' // Composables @@ -14,10 +15,7 @@ import { computed, toRef } from 'vue' import { genericComponent, propsFactory, useRender } from '@/util' // Types -import type { InjectionKey, PropType } from 'vue' -import type { GroupItemProvide } from '@/composables/group' - -export const VExpansionPanelSymbol: InjectionKey = Symbol.for('vuetify:v-expansion-panel') +import type { PropType } from 'vue' const allowedVariants = ['default', 'accordion', 'inset', 'popout'] as const diff --git a/packages/vuetify/src/components/VExpansionPanel/shared.ts b/packages/vuetify/src/components/VExpansionPanel/shared.ts new file mode 100644 index 00000000000..002b0a0379e --- /dev/null +++ b/packages/vuetify/src/components/VExpansionPanel/shared.ts @@ -0,0 +1,5 @@ +// Types +import type { InjectionKey } from 'vue' +import type { GroupItemProvide } from '@/composables/group' + +export const VExpansionPanelSymbol: InjectionKey = Symbol.for('vuetify:v-expansion-panel') diff --git a/packages/vuetify/src/components/VStepper/VStepper.tsx b/packages/vuetify/src/components/VStepper/VStepper.tsx index 1350134118c..c00678e8133 100644 --- a/packages/vuetify/src/components/VStepper/VStepper.tsx +++ b/packages/vuetify/src/components/VStepper/VStepper.tsx @@ -2,6 +2,7 @@ import './VStepper.sass' // Components +import { VStepperSymbol } from './shared' import { makeVStepperActionsProps, VStepperActions } from './VStepperActions' import { VStepperHeader } from './VStepperHeader' import { VStepperItem } from './VStepperItem' @@ -19,11 +20,8 @@ import { computed, toRefs } from 'vue' import { genericComponent, getPropertyFromItem, only, propsFactory, useRender } from '@/util' // Types -import type { InjectionKey, PropType } from 'vue' +import type { PropType } from 'vue' import type { StepperItem, StepperItemSlot } from './VStepperItem' -import type { GroupItemProvide } from '@/composables/group' - -export const VStepperSymbol: InjectionKey = Symbol.for('vuetify:v-stepper') export type VStepperSlot = { prev: () => void diff --git a/packages/vuetify/src/components/VStepper/VStepperItem.tsx b/packages/vuetify/src/components/VStepper/VStepperItem.tsx index 42766e6221a..7873532a86c 100644 --- a/packages/vuetify/src/components/VStepper/VStepperItem.tsx +++ b/packages/vuetify/src/components/VStepper/VStepperItem.tsx @@ -14,7 +14,7 @@ import { Ripple } from '@/directives/ripple' // Utilities import { computed } from 'vue' -import { VStepperSymbol } from './VStepper' +import { VStepperSymbol } from './shared' import { genericComponent, propsFactory, useRender } from '@/util' // Types diff --git a/packages/vuetify/src/components/VStepper/VStepperWindow.tsx b/packages/vuetify/src/components/VStepper/VStepperWindow.tsx index b59f2da9023..146fec2fd28 100644 --- a/packages/vuetify/src/components/VStepper/VStepperWindow.tsx +++ b/packages/vuetify/src/components/VStepper/VStepperWindow.tsx @@ -1,4 +1,5 @@ // Components +import { VStepperSymbol } from './shared' import { makeVWindowProps, VWindow } from '@/components/VWindow/VWindow' // Composables @@ -8,12 +9,6 @@ import { useProxiedModel } from '@/composables/proxiedModel' import { computed, inject } from 'vue' import { genericComponent, omit, propsFactory, useRender } from '@/util' -// Types -import type { InjectionKey } from 'vue' -import type { GroupProvide } from '@/composables/group' - -export const VStepperSymbol: InjectionKey = Symbol.for('vuetify:v-stepper') - export const makeVStepperWindowProps = propsFactory({ ...omit(makeVWindowProps(), ['continuous', 'nextIcon', 'prevIcon', 'showArrows', 'touch', 'mandatory']), }, 'VStepperWindow') diff --git a/packages/vuetify/src/components/VStepper/shared.ts b/packages/vuetify/src/components/VStepper/shared.ts new file mode 100644 index 00000000000..0612889d89d --- /dev/null +++ b/packages/vuetify/src/components/VStepper/shared.ts @@ -0,0 +1,5 @@ +// Types +import type { InjectionKey } from 'vue' +import type { GroupProvide } from '@/composables/group' + +export const VStepperSymbol: InjectionKey = Symbol.for('vuetify:v-stepper') diff --git a/packages/vuetify/src/composables/defaults.ts b/packages/vuetify/src/composables/defaults.ts index 701c61824b9..395354152b3 100644 --- a/packages/vuetify/src/composables/defaults.ts +++ b/packages/vuetify/src/composables/defaults.ts @@ -1,6 +1,8 @@ // Utilities import { computed, inject, provide, ref, shallowRef, unref, watchEffect } from 'vue' -import { getCurrentInstance, injectSelf, mergeDeep, toKebabCase } from '@/util' +import { getCurrentInstance } from '@/util/getCurrentInstance' +import { mergeDeep, toKebabCase } from '@/util/helpers' +import { injectSelf } from '@/util/injectSelf' // Types import type { ComputedRef, InjectionKey, Ref, VNode } from 'vue' diff --git a/packages/vuetify/src/labs/VStepperVertical/VStepperVerticalItem.tsx b/packages/vuetify/src/labs/VStepperVertical/VStepperVerticalItem.tsx index fb2f13c0e7c..e2d719e06da 100644 --- a/packages/vuetify/src/labs/VStepperVertical/VStepperVerticalItem.tsx +++ b/packages/vuetify/src/labs/VStepperVertical/VStepperVerticalItem.tsx @@ -5,8 +5,7 @@ import './VStepperVerticalItem.sass' import { VStepperVerticalActions } from './VStepperVerticalActions' import { VAvatar } from '@/components/VAvatar/VAvatar' import { VDefaultsProvider } from '@/components/VDefaultsProvider/VDefaultsProvider' -import { VExpansionPanel } from '@/components/VExpansionPanel' -import { makeVExpansionPanelProps } from '@/components/VExpansionPanel/VExpansionPanel' +import { makeVExpansionPanelProps, VExpansionPanel } from '@/components/VExpansionPanel/VExpansionPanel' import { VIcon } from '@/components/VIcon/VIcon' import { makeStepperItemProps } from '@/components/VStepper/VStepperItem' diff --git a/packages/vuetify/src/labs/VTreeview/VTreeviewItem.tsx b/packages/vuetify/src/labs/VTreeview/VTreeviewItem.tsx index 738bc411533..6fae4204548 100644 --- a/packages/vuetify/src/labs/VTreeview/VTreeviewItem.tsx +++ b/packages/vuetify/src/labs/VTreeview/VTreeviewItem.tsx @@ -5,6 +5,7 @@ import './VTreeviewItem.sass' import { VBtn } from '@/components/VBtn' import { VListItemAction } from '@/components/VList' import { makeVListItemProps, VListItem } from '@/components/VList/VListItem' +import { VProgressCircular } from '@/components/VProgressCircular' // Composables import { IconValue } from '@/composables/icons' @@ -16,7 +17,6 @@ import { genericComponent, propsFactory, useRender } from '@/util' // Types import { VTreeviewSymbol } from './shared' -import { VProgressCircular } from '../allComponents' import type { VListItemSlots } from '@/components/VList/VListItem' export const makeVTreeviewItemProps = propsFactory({