Skip to content

Commit

Permalink
chore: update vue to v 3.2.34
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed May 20, 2022
1 parent 1096d83 commit b339a6d
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 97 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@octokit/core": "^3.6.0",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"@vue/compiler-sfc": "^3.2.31",
"@vue/compiler-sfc": "^3.2.34",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"conventional-changelog-cli": "^2.2.2",
Expand Down Expand Up @@ -71,7 +71,7 @@
"shelljs": "^0.8.5",
"typescript": "^4.6.3",
"vite-plugin-inspect": "^0.4.3",
"vue": "^3.2.31",
"vue": "^3.2.34",
"vue-analytics": "^5.16.1",
"vue-router": "^4.0.14"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"fix:md": "markdownlint --config .markdownlintrc src/pages/en --fix"
},
"dependencies": {
"@vueuse/head": "~0.7.5",
"@vueuse/head": "~0.7.6",
"cosmicjs": "^4.1.5",
"lodash-es": "^4.17.21",
"pinia": "^2.0.13",
"prism-theme-vars": "^0.2.2",
"prismjs": "^1.27.0",
"roboto-fontface": "^0.10.0",
"vue": "^3.2.31",
"vue": "^3.2.34",
"vue-i18n": "^9.2.0-beta.34",
"vue-prism-component": "^2.0.0",
"vuetify": "^3.0.0-beta.2"
Expand All @@ -39,7 +39,7 @@
"@types/prismjs": "^1.26.0",
"@types/rimraf": "^3.0.2",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/compiler-sfc": "^3.2.31",
"@vue/compiler-sfc": "^3.2.34",
"@vuetify/vite-ssg": "^0.19.0",
"ajv": "^8.11.0",
"front-matter": "^4.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/vuetify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"@vitejs/plugin-vue-jsx": "^1.3.9",
"@vue/babel-plugin-jsx": "^1.1.1",
"@vue/test-utils": "2.0.0-rc.9",
"@vueuse/head": "^0.7.5",
"@vueuse/head": "^0.7.6",
"acorn-walk": "^8.2.0",
"autoprefixer": "^10.4.4",
"babel-plugin-add-import-extension": "1.5.1",
Expand Down Expand Up @@ -155,7 +155,7 @@
},
"peerDependencies": {
"@formatjs/intl": "^1.0.0 || ^2.0.0",
"vue": "^3.2.31",
"vue": "^3.2.34",
"vue-i18n": "^9.0.0"
},
"peerDependenciesMeta": {
Expand Down
8 changes: 4 additions & 4 deletions packages/vuetify/src/components/VAppBar/VAppBarTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import { VToolbarTitle } from '@/components/VToolbar'

// Utilities
import { defineComponent } from '@/util'
import { defineComponent } from 'vue'

export const VAppBarTitle = defineComponent({
...VToolbarTitle,

name: 'VAppBarTitle',

props: { ...VToolbarTitle.props },

setup (_, { slots }) {
return () => (
<VToolbarTitle
Expand All @@ -17,4 +17,4 @@ export const VAppBarTitle = defineComponent({
/>
)
},
}) as typeof VToolbarTitle
})
5 changes: 2 additions & 3 deletions packages/vuetify/src/components/VSlider/VSliderTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const VSliderTrack = defineComponent({

return ticks.map((tick, index) => {
const directionProperty = vertical.value ? 'bottom' : 'margin-inline-start'
const directionValue = (tick.position > 0 && tick.position < 100) ? convertToUnit(tick.position, '%') : undefined
return (
<div
key={ tick.value }
Expand All @@ -91,9 +92,7 @@ export const VSliderTrack = defineComponent({
'v-slider-track__tick--filled': tick.position >= props.start && tick.position <= props.stop,
},
]}
style={{
[directionProperty]: (tick.position > 0 && tick.position < 100) && convertToUnit(tick.position, '%'),
}}
style={{ [directionProperty]: directionValue }}
>
{
(tick.label || slots['tick-label']) && (
Expand Down
28 changes: 19 additions & 9 deletions packages/vuetify/src/composables/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
import { useResizeObserver } from '@/composables/resizeObserver'

// Utilities
import { computed, inject, onActivated, onBeforeUnmount, onDeactivated, onMounted, provide, reactive, ref } from 'vue'
import {
computed,
inject,
onActivated,
onBeforeUnmount,
onDeactivated,
onMounted,
provide,
reactive,
ref,
} from 'vue'
import { convertToUnit, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory } from '@/util'

// Types
import type { ComponentInternalInstance, InjectionKey, Prop, Ref } from 'vue'
import type { ComponentInternalInstance, CSSProperties, InjectionKey, Prop, Ref } from 'vue'

type Position = 'top' | 'left' | 'right' | 'bottom'

Expand All @@ -33,12 +43,12 @@ interface LayoutProvide {
absolute: Ref<boolean | undefined>
}
) => {
layoutItemStyles: Ref<Record<string, unknown>>
layoutItemScrimStyles: Ref<Record<string, unknown>>
layoutItemStyles: Ref<CSSProperties>
layoutItemScrimStyles: Ref<CSSProperties>
zIndex: Ref<number>
}
unregister: (id: string) => void
mainStyles: Ref<Record<string, unknown>>
mainStyles: Ref<CSSProperties>
getLayoutItem: (id: string) => LayoutItem | undefined
items: Ref<LayoutItem[]>
layoutRect: Ref<DOMRectReadOnly | undefined>
Expand Down Expand Up @@ -192,7 +202,7 @@ export function createLayout (props: { overlaps?: string[], fullHeight?: boolean
return !Array.from(disabledTransitions.values()).some(ref => ref.value)
})

const mainStyles = computed(() => {
const mainStyles = computed<CSSProperties>(() => {
const layer = layers.value[layers.value.length - 1].layer

return {
Expand Down Expand Up @@ -258,7 +268,7 @@ export function createLayout (props: { overlaps?: string[], fullHeight?: boolean
const index = computed(() => items.value.findIndex(i => i.id === id))
const zIndex = computed(() => rootZIndex.value + (layers.value.length * 2) - (index.value * 2))

const layoutItemStyles = computed(() => {
const layoutItemStyles = computed<CSSProperties>(() => {
const isHorizontal = position.value === 'left' || position.value === 'right'
const isOppositeHorizontal = position.value === 'right'
const isOppositeVertical = position.value === 'bottom'
Expand All @@ -269,7 +279,7 @@ export function createLayout (props: { overlaps?: string[], fullHeight?: boolean
transform: `translate${isHorizontal ? 'X' : 'Y'}(${(active.value ? 0 : -110) * (isOppositeHorizontal || isOppositeVertical ? -1 : 1)}%)`,
position: absolute.value || rootZIndex.value !== ROOT_ZINDEX ? 'absolute' : 'fixed',
...(transitionsEnabled.value ? undefined : { transition: 'none' }),
}
} as const

if (!isMounted.value) return styles

Expand All @@ -295,7 +305,7 @@ export function createLayout (props: { overlaps?: string[], fullHeight?: boolean
}
})

const layoutItemScrimStyles = computed(() => ({
const layoutItemScrimStyles = computed<CSSProperties>(() => ({
zIndex: zIndex.value - 1,
position: rootZIndex.value === ROOT_ZINDEX ? 'fixed' : 'absolute',
}))
Expand Down
31 changes: 29 additions & 2 deletions packages/vuetify/src/util/defineComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type {
ComponentOptionsMixin,
ComponentOptionsWithObjectProps,
ComponentPropsOptions,
ComponentProvideOptions,
ComputedOptions,
DefineComponent,
EffectScope,
Expand Down Expand Up @@ -119,6 +120,30 @@ export function genericComponent<T extends (new () => {
E extends EmitsOptions = Record<string, any>,
EE extends string = string,
I = InstanceType<T>,
Provide extends ComponentProvideOptions = ComponentProvideOptions,
Options extends ComponentOptionsWithObjectProps<
PropsOptions,
RawBindings,
D,
C,
M,
Mixin,
Extends,
E,
EE,
Provide
> = ComponentOptionsWithObjectProps<
PropsOptions,
RawBindings,
D,
C,
M,
Mixin,
Extends,
E,
EE,
Provide
>,
Base = DefineComponent<
(I extends Record<'$props', any> ? Omit<PropsOptions, keyof I['$props']> : PropsOptions) & (
I extends Record<'$slots', any>
Expand All @@ -132,8 +157,10 @@ export function genericComponent<T extends (new () => {
Mixin,
Extends,
E extends any[] ? E : I extends Record<'$props', any> ? Omit<E, ToListeners<keyof I['$props']>> : E,
EE
EE,
Provide,
Options
>
>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>) => Base & T {
>(options: Options & ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>) => Base & T {
return options => (exposeDefaults ? defineComponent : _defineComponent)(options) as any
}

0 comments on commit b339a6d

Please sign in to comment.