Skip to content

Commit

Permalink
refactor(VWindow): tuning pass (#15244)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Jun 23, 2022
1 parent ed02b09 commit daccd1b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 578 deletions.
10 changes: 5 additions & 5 deletions packages/vuetify/src/components/VWindow/VWindow.tsx
Expand Up @@ -4,26 +4,26 @@ import './VWindow.sass'
// Components
import { VBtn } from '@/components/VBtn'

// Directives
import { Touch } from '@/directives/touch'

// Composables
import { makeTagProps } from '@/composables/tag'
import { makeThemeProps, provideTheme } from '@/composables/theme'
import { useGroup } from '@/composables/group'
import { useLocale } from '@/composables/locale'
import { useRtl } from '@/composables/rtl'

// Directives
import { Touch } from '@/directives/touch'

// Utilities
import { computed, provide, ref, watch } from 'vue'
import { genericComponent, useRender } from '@/util'

// Types
import type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'
import type { GroupItemProvide, GroupProvide } from '@/composables/group'
import type { TouchHandlers } from '@/directives/touch'
import type { MakeSlots } from '@/util'
import type { IconValue } from '@/composables/icons'
import type { MakeSlots } from '@/util'
import type { TouchHandlers } from '@/directives/touch'

type WindowProvide = {
transition: ComputedRef<undefined | string>
Expand Down
41 changes: 21 additions & 20 deletions packages/vuetify/src/components/VWindow/VWindowItem.tsx
@@ -1,15 +1,15 @@
// Directives
import Touch from '@/directives/touch'

// Composables
import { makeGroupItemProps, useGroupItem } from '@/composables/group'
import { makeLazyProps, useLazy } from '@/composables/lazy'
import { MaybeTransition } from '@/composables/transition'
import { useSsrBoot } from '@/composables/ssrBoot'

// Directives
import Touch from '@/directives/touch'

// Utilities
import { computed, inject, nextTick, ref } from 'vue'
import { convertToUnit, defineComponent } from '@/util'
import { convertToUnit, defineComponent, useRender } from '@/util'
import { VWindowGroupSymbol, VWindowSymbol } from './VWindow'

export const VWindowItem = defineComponent({
Expand All @@ -28,8 +28,9 @@ export const VWindowItem = defineComponent({
type: [Boolean, String],
default: undefined,
},
...makeLazyProps(),

...makeGroupItemProps(),
...makeLazyProps(),
},

setup (props, { slots }) {
Expand Down Expand Up @@ -114,21 +115,21 @@ export const VWindowItem = defineComponent({

const { hasContent } = useLazy(props, groupItem.isSelected)

return () => {
return (
<MaybeTransition transition={ isBooted.value && transition.value } >
<div
class={[
'v-window-item',
groupItem.selectedClass.value,
]}
v-show={ groupItem.isSelected.value }
>
{ hasContent.value && slots.default?.() }
</div>
</MaybeTransition>
)
}
useRender(() => (
<MaybeTransition transition={ isBooted.value && transition.value } >
<div
class={[
'v-window-item',
groupItem.selectedClass.value,
]}
v-show={ groupItem.isSelected.value }
>
{ hasContent.value && slots.default?.() }
</div>
</MaybeTransition>
))

return {}
},
})

Expand Down

0 comments on commit daccd1b

Please sign in to comment.