Skip to content

Commit

Permalink
chore: update vue to 2.5.21 (#5789)
Browse files Browse the repository at this point in the history
* chore: update vue to 2.5.18

* chore: remove separate vue version in api-generator

* fix: ts errors

* fix: return VueConstructor from createSimpleFunctional

* refactor: remove non-null assertions

* style: remove unused imports

* refactor: replace ternary with boolean

* chore: update vue to 2.5.19

* chore: update vue to 2.5.21

* chore(build): add es2015 to tslib

* chore: relax vue version requirement

* docs: replace es5 with lib

* chore(server): resolve externals from node_modules
  • Loading branch information
KaelWD committed Dec 12, 2018
1 parent 8a2a1a1 commit ae31593
Show file tree
Hide file tree
Showing 40 changed files with 124 additions and 136 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -43,6 +43,7 @@
"typescript": "^3.1.3",
"typescript-eslint-parser": "^20.0.0",
"typestrict": "^1.0.1",
"vue": "^2.5.17"
"vue": "^2.5.21",
"vue-template-compiler": "^2.5.21"
}
}
1 change: 0 additions & 1 deletion packages/api-generator/package.json
Expand Up @@ -12,7 +12,6 @@
"license": "ISC",
"dependencies": {
"deepmerge": "^2.2.1",
"vue": "^2.5.16",
"vuetify": "^1.3.13"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/vuetify/package.json
Expand Up @@ -77,7 +77,6 @@
"url-loader": "^1.1.2",
"vue-loader": "^15.4.2",
"vue-router": "^3.0.1",
"vue-template-compiler": "^2.5.17",
"vue-template-es2015-compiler": "^1.6.0",
"vuetify-loader": "^0.2.0",
"webpack": "^4.23.1",
Expand All @@ -86,7 +85,7 @@
"webpack-merge": "^4.1.4"
},
"peerDependencies": {
"vue": "^2.5.10"
"vue": "^2.5.18"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VAlert/VAlert.ts
Expand Up @@ -90,7 +90,7 @@ export default mixins(Colorable, Toggleable, Transitionable).extend({
directives: [{
name: 'show',
value: this.isActive
}] as any,
}],
on: this.$listeners
}), children)

Expand Down
6 changes: 3 additions & 3 deletions packages/vuetify/src/components/VBadge/VBadge.ts
Expand Up @@ -46,14 +46,14 @@ export default mixins(
},

render (h): VNode {
const badge = this.$slots.badge ? [h('span', this.setBackgroundColor(this.color, {
const badge = this.$slots.badge && [h('span', this.setBackgroundColor(this.color, {
staticClass: 'v-badge__badge',
attrs: this.$attrs,
directives: [{
name: 'show',
value: this.isActive
}] as any
}), this.$slots.badge)] as any : null
}]
}), this.$slots.badge)]

return h('span', {
staticClass: 'v-badge',
Expand Down
Expand Up @@ -89,7 +89,7 @@ export default mixins(
for (let i = 0; i < this.items.length; i++) {
const item = this.items[i]

if (hasSlot) items.push(this.$scopedSlots.item({ item }))
if (hasSlot) items.push(this.$scopedSlots.item!({ item }))
else items.push(this.$createElement(VBreadcrumbsItem, { key: item.text, props: item }, [item.text]))

if (i < this.items.length - 1) items.push(this.genDivider())
Expand Down
47 changes: 24 additions & 23 deletions packages/vuetify/src/components/VBtn/VBtn.ts
Expand Up @@ -2,9 +2,9 @@
import '../../stylus/components/_buttons.styl'

// Types
import { VNode, VNodeChildren } from 'vue'
import { VNode } from 'vue'
import { PropValidator } from 'vue/types/options'
import mixins from '../../util/mixins'
import mixins, { ExtractVue } from '../../util/mixins'
import { RippleOptions } from '../../directives/ripple'

// Components
Expand All @@ -21,15 +21,20 @@ import { factory as ToggleableFactory } from '../../mixins/toggleable'
// Utilities
import { getObjectValueByPath } from '../../util/helpers'

export default mixins(
const baseMixins = mixins(
Colorable,
Routable,
Positionable,
Themeable,
GroupableFactory('btnToggle'),
ToggleableFactory('inputValue')
/* @vue/component */
).extend({
)
interface options extends ExtractVue<typeof baseMixins> {
$el: HTMLElement
}

export default baseMixins.extend<options>().extend({
name: 'v-btn',

props: {
Expand Down Expand Up @@ -114,25 +119,19 @@ export default mixins(
return this.$createElement(
'div',
{ 'class': 'v-btn__content' },
[this.$slots.default]
this.$slots.default
)
},
genLoader (): VNode {
const children: VNodeChildren = []

if (!this.$slots.loader) {
children.push(this.$createElement(VProgressCircular, {
props: {
indeterminate: true,
size: 23,
width: 2
}
}))
} else {
children.push(this.$slots.loader)
}

return this.$createElement('span', { 'class': 'v-btn__loading' }, children)
return this.$createElement('span', {
class: 'v-btn__loading'
}, this.$slots.loader || [this.$createElement(VProgressCircular, {
props: {
indeterminate: true,
size: 23,
width: 2
}
})])
},
onRouteChange () {
if (!this.to || !this.$refs.link) return
Expand All @@ -150,10 +149,12 @@ export default mixins(
render (h): VNode {
const setColor = (!this.outline && !this.flat && !this.disabled) ? this.setBackgroundColor : this.setTextColor
const { tag, data } = this.generateRouteLink(this.classes)
const children = [this.genContent()]
const children = [
this.genContent(),
this.loading && this.genLoader()
]

tag === 'button' && (data.attrs!.type = this.type)
this.loading && children.push(this.genLoader())
if (tag === 'button') data.attrs!.type = this.type

data.attrs!.value = ['string', 'number'].includes(typeof this.value)
? this.value
Expand Down
5 changes: 2 additions & 3 deletions packages/vuetify/src/components/VCard/index.ts
Expand Up @@ -2,10 +2,9 @@ import { createSimpleFunctional } from '../../util/helpers'
import VCard from './VCard'
import VCardMedia from './VCardMedia'
import VCardTitle from './VCardTitle'
import Vue from 'vue'

const VCardActions = Vue.extend(createSimpleFunctional('v-card__actions'))
const VCardText = Vue.extend(createSimpleFunctional('v-card__text'))
const VCardActions = createSimpleFunctional('v-card__actions')
const VCardText = createSimpleFunctional('v-card__text')

export { VCard, VCardMedia, VCardTitle, VCardActions, VCardText }

Expand Down
13 changes: 6 additions & 7 deletions packages/vuetify/src/components/VChip/VChip.ts
@@ -1,7 +1,7 @@
import '../../stylus/components/_chips.styl'

// Types
import { CreateElement, VNode, VNodeChildren } from 'vue'
import { CreateElement, VNode } from 'vue'
import mixins from '../../util/mixins'

// Components
Expand Down Expand Up @@ -63,13 +63,12 @@ export default mixins(Colorable, Themeable, Toggleable).extend({
])
},
genContent (h: CreateElement): VNode {
const children: VNodeChildren = [this.$slots.default]

this.close && children.push(this.genClose(h))

return h('span', {
staticClass: 'v-chip__content'
}, children)
}, [
this.$slots.default,
this.close && this.genClose(h)
])
}
},

Expand All @@ -81,7 +80,7 @@ export default mixins(Colorable, Themeable, Toggleable).extend({
directives: [{
name: 'show',
value: this.isActive
}] as any,
}],
on: this.$listeners
})

Expand Down
Expand Up @@ -99,7 +99,7 @@ export default mixins<options &
directives: [{
name: 'show',
value: this.isActive
}] as any
}]
}, this.showLazyContent(this.$slots.default))
},
genHeader () {
Expand All @@ -112,7 +112,7 @@ export default mixins<options &
directives: [{
name: 'ripple',
value: this.ripple
}] as any,
}],
on: {
click: this.onHeaderClick
}
Expand All @@ -130,7 +130,7 @@ export default mixins<options &
directives: [{
name: 'show',
value: !this.isDisabled
}] as any
}]
}, icon)
])
},
Expand All @@ -142,11 +142,6 @@ export default mixins<options &
},

render (h): VNode {
const children = []

this.$slots.header && children.push(this.genHeader())
children.push(h(VExpandTransition, [this.genBody()]))

return h('li', {
staticClass: 'v-expansion-panel__container',
class: this.containerClasses,
Expand All @@ -156,6 +151,9 @@ export default mixins<options &
on: {
keydown: this.onKeydown
}
}, children)
}, [
this.$slots.header && this.genHeader(),
h(VExpandTransition, [this.genBody()])
])
}
})
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VHover/VHover.ts
Expand Up @@ -47,7 +47,7 @@ export default mixins(

if (this.$scopedSlots.default) {
element = this.$scopedSlots.default({ hover: this.isActive })
} else if (this.$slots.default.length === 1) {
} else if (this.$slots.default && this.$slots.default.length === 1) {
element = this.$slots.default[0]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VPagination/VPagination.ts
Expand Up @@ -186,7 +186,7 @@ export default mixins(Colorable, Themeable).extend({
modifiers: { quiet: true },
name: 'resize',
value: this.onResize
}] as any,
}],
class: this.classes
}, children)
}
Expand Down
Expand Up @@ -131,7 +131,7 @@ export default mixins(Colorable).extend({
},

render (h): VNode {
const info = h('div', { staticClass: 'v-progress-circular__info' }, [this.$slots.default])
const info = h('div', { staticClass: 'v-progress-circular__info' }, this.$slots.default)
const svg = this.genSvg(h)

return h('div', this.setTextColor(this.color, {
Expand Down
4 changes: 2 additions & 2 deletions packages/vuetify/src/components/VRating/VRating.ts
Expand Up @@ -16,7 +16,7 @@ import { createRange } from '../../util/helpers'
import mixins from '../../util/mixins'

// Types
import { VNode, VNodeDirective, VNodeChildrenArrayContents } from 'vue'
import { VNode, VNodeDirective, VNodeChildren } from 'vue'

type ItemSlotProps = {
index: number
Expand Down Expand Up @@ -188,7 +188,7 @@ export default mixins(
onMouseLeave (): void {
this.runDelay('close', () => (this.hoverIndex = -1))
},
genItem (i: number): VNode | VNodeChildrenArrayContents | string {
genItem (i: number): VNode | VNodeChildren | string {
const props = this.createProps(i)

if (this.$scopedSlots.item) return this.$scopedSlots.item(props)
Expand Down
38 changes: 16 additions & 22 deletions packages/vuetify/src/components/VSnackbar/VSnackbar.ts
Expand Up @@ -5,7 +5,7 @@ import Toggleable from '../../mixins/toggleable'
import { factory as PositionableFactory } from '../../mixins/positionable'

import mixins from '../../util/mixins'
import { VNode, VNodeChildrenArrayContents } from 'vue'
import { VNode } from 'vue'

export default mixins(
Colorable,
Expand Down Expand Up @@ -71,28 +71,22 @@ export default mixins(
},

render (h): VNode {
const children: VNodeChildrenArrayContents = []

if (this.isActive) {
children.push(
h('div', {
staticClass: 'v-snack',
class: this.classes,
on: this.$listeners
}, [
h('div', this.setBackgroundColor(this.color, {
staticClass: 'v-snack__wrapper'
}), [
h('div', {
staticClass: 'v-snack__content'
}, this.$slots.default)
])
])
)
}

return h('transition', {
attrs: { name: 'v-snack-transition' }
}, children)
}, this.isActive && [
h('div', {
staticClass: 'v-snack',
class: this.classes,
on: this.$listeners
}, [
h('div', this.setBackgroundColor(this.color, {
staticClass: 'v-snack__wrapper'
}), [
h('div', {
staticClass: 'v-snack__content'
}, this.$slots.default)
])
])
])
}
})
8 changes: 2 additions & 6 deletions packages/vuetify/src/components/VTimeline/VTimelineItem.ts
Expand Up @@ -57,16 +57,12 @@ export default mixins(
}, this.icon)
},
genInnerDot () {
const children = []

this.hasIcon && children.push(this.genIcon())

const data: VNodeData = this.setBackgroundColor(this.color)

return this.$createElement('div', {
staticClass: 'v-timeline-item__inner-dot',
...data
}, children)
}, [this.hasIcon && this.genIcon()])
},
genDot () {
return this.$createElement('div', {
Expand All @@ -80,7 +76,7 @@ export default mixins(
genOpposite () {
return this.$createElement('div', {
staticClass: 'v-timeline-item__opposite'
}, [this.$slots.opposite])
}, this.$slots.opposite)
}
},

Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VTreeview/VTreeview.ts
Expand Up @@ -327,7 +327,7 @@ export default mixins(
const children: VNodeChildrenArrayContents = this.items.length
? this.items.map(VTreeviewNode.options.methods.genChild.bind(this))
/* istanbul ignore next */
: this.$slots.default
: this.$slots.default! // TODO: remove type annotation with TS 3.2

return h('div', {
staticClass: 'v-treeview',
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VWindow/VWindow.ts
Expand Up @@ -125,7 +125,7 @@ export default BaseItemGroup.extend({
data.directives.push({
name: 'touch',
value
} as VNodeDirective)
})
}

return h('div', data, [this.genContainer()])
Expand Down

0 comments on commit ae31593

Please sign in to comment.