@dimailn/vuetify 2.7.2-alpha24 → 2.7.2-alpha26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vuetify.js +583 -388
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VAppBar/VAppBarNavIcon.js +5 -1
- package/es5/components/VAppBar/VAppBarNavIcon.js.map +1 -1
- package/es5/components/VBanner/VBanner.js +15 -6
- package/es5/components/VBanner/VBanner.js.map +1 -1
- package/es5/components/VBreadcrumbs/VBreadcrumbs.js +18 -6
- package/es5/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/es5/components/VBtn/VBtn.js +19 -15
- package/es5/components/VBtn/VBtn.js.map +1 -1
- package/es5/components/VCarousel/VCarousel.js +10 -4
- package/es5/components/VCarousel/VCarousel.js.map +1 -1
- package/es5/components/VCarousel/VCarouselItem.js +7 -3
- package/es5/components/VCarousel/VCarouselItem.js.map +1 -1
- package/es5/components/VCheckbox/VCheckbox.js +5 -1
- package/es5/components/VCheckbox/VCheckbox.js.map +1 -1
- package/es5/components/VColorPicker/VColorPicker.js +18 -31
- package/es5/components/VColorPicker/VColorPicker.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerCanvas.js +45 -46
- package/es5/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerEdit.js +27 -26
- package/es5/components/VColorPicker/VColorPickerEdit.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerPreview.js +41 -30
- package/es5/components/VColorPicker/VColorPickerPreview.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerSwatches.js +13 -10
- package/es5/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
- package/es5/components/VDataIterator/VDataFooter.js +5 -1
- package/es5/components/VDataIterator/VDataFooter.js.map +1 -1
- package/es5/components/VDataTable/VDataTable.js +28 -18
- package/es5/components/VDataTable/VDataTable.js.map +1 -1
- package/es5/components/VDataTable/VDataTableHeader.js +2 -6
- package/es5/components/VDataTable/VDataTableHeader.js.map +1 -1
- package/es5/components/VDataTable/VEditDialog.js +6 -2
- package/es5/components/VDataTable/VEditDialog.js.map +1 -1
- package/es5/components/VDataTable/mixins/header.js +5 -1
- package/es5/components/VDataTable/mixins/header.js.map +1 -1
- package/es5/components/VDatePicker/VDatePickerHeader.js +8 -2
- package/es5/components/VDatePicker/VDatePickerHeader.js.map +1 -1
- package/es5/components/VDatePicker/VDatePickerTitle.js +13 -5
- package/es5/components/VDatePicker/VDatePickerTitle.js.map +1 -1
- package/es5/components/VDatePicker/mixins/date-picker-table.js +5 -3
- package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +16 -12
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelContent.js +11 -9
- package/es5/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelHeader.js +15 -9
- package/es5/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/es5/components/VImg/VImg.js +6 -2
- package/es5/components/VImg/VImg.js.map +1 -1
- package/es5/components/VInput/VInput.js +28 -8
- package/es5/components/VInput/VInput.js.map +1 -1
- package/es5/components/VList/VListGroup.js +27 -9
- package/es5/components/VList/VListGroup.js.map +1 -1
- package/es5/components/VList/VListItem.js +5 -1
- package/es5/components/VList/VListItem.js.map +1 -1
- package/es5/components/VMessages/VMessages.js +5 -1
- package/es5/components/VMessages/VMessages.js.map +1 -1
- package/es5/components/VOverflowBtn/VOverflowBtn.js +3 -1
- package/es5/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
- package/es5/components/VPagination/VPagination.js +3 -1
- package/es5/components/VPagination/VPagination.js.map +1 -1
- package/es5/components/VPicker/VPicker.js +5 -1
- package/es5/components/VPicker/VPicker.js.map +1 -1
- package/es5/components/VRadioGroup/VRadio.js +10 -2
- package/es5/components/VRadioGroup/VRadio.js.map +1 -1
- package/es5/components/VSelect/VSelect.js +6 -2
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VSelect/VSelectList.js +17 -9
- package/es5/components/VSelect/VSelectList.js.map +1 -1
- package/es5/components/VSlideGroup/VSlideGroup.js +26 -18
- package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/es5/components/VSlider/VSlider.js +36 -27
- package/es5/components/VSlider/VSlider.js.map +1 -1
- package/es5/components/VStepper/VStepperContent.js +3 -1
- package/es5/components/VStepper/VStepperContent.js.map +1 -1
- package/es5/components/VSwitch/VSwitch.js +10 -6
- package/es5/components/VSwitch/VSwitch.js.map +1 -1
- package/es5/components/VTabs/VTabs.js +6 -2
- package/es5/components/VTabs/VTabs.js.map +1 -1
- package/es5/components/VTextField/VTextField.js +7 -3
- package/es5/components/VTextField/VTextField.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +6 -8
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/components/VTreeview/VTreeviewNode.js +11 -3
- package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/es5/components/transitions/createTransition.js +8 -2
- package/es5/components/transitions/createTransition.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/picker/index.js +13 -3
- package/es5/mixins/picker/index.js.map +1 -1
- package/lib/components/VAppBar/VAppBarNavIcon.js +1 -1
- package/lib/components/VAppBar/VAppBarNavIcon.js.map +1 -1
- package/lib/components/VBanner/VBanner.js +3 -3
- package/lib/components/VBanner/VBanner.js.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js +2 -2
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/lib/components/VBtn/VBtn.js +20 -19
- package/lib/components/VBtn/VBtn.js.map +1 -1
- package/lib/components/VCarousel/VCarousel.js +3 -3
- package/lib/components/VCarousel/VCarousel.js.map +1 -1
- package/lib/components/VCarousel/VCarouselItem.js +1 -1
- package/lib/components/VCarousel/VCarouselItem.js.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.js +1 -1
- package/lib/components/VCheckbox/VCheckbox.js.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.js +29 -37
- package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.js +41 -43
- package/lib/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.js +25 -31
- package/lib/components/VColorPicker/VColorPickerEdit.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.js +45 -32
- package/lib/components/VColorPicker/VColorPickerPreview.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.js +15 -9
- package/lib/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
- package/lib/components/VDataIterator/VDataFooter.js +1 -1
- package/lib/components/VDataIterator/VDataFooter.js.map +1 -1
- package/lib/components/VDataTable/VDataTable.js +8 -9
- package/lib/components/VDataTable/VDataTable.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeader.js +3 -6
- package/lib/components/VDataTable/VDataTableHeader.js.map +1 -1
- package/lib/components/VDataTable/VEditDialog.js +2 -2
- package/lib/components/VDataTable/VEditDialog.js.map +1 -1
- package/lib/components/VDataTable/mixins/header.js +1 -1
- package/lib/components/VDataTable/mixins/header.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerHeader.js +2 -2
- package/lib/components/VDatePicker/VDatePickerHeader.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.js +2 -2
- package/lib/components/VDatePicker/VDatePickerTitle.js.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +2 -2
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelContent.js +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.js +2 -2
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/lib/components/VImg/VImg.js +2 -2
- package/lib/components/VImg/VImg.js.map +1 -1
- package/lib/components/VInput/VInput.js +14 -6
- package/lib/components/VInput/VInput.js.map +1 -1
- package/lib/components/VList/VListGroup.js +5 -5
- package/lib/components/VList/VListGroup.js.map +1 -1
- package/lib/components/VList/VListItem.js +3 -1
- package/lib/components/VList/VListItem.js.map +1 -1
- package/lib/components/VMessages/VMessages.js +1 -1
- package/lib/components/VMessages/VMessages.js.map +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.js +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
- package/lib/components/VPagination/VPagination.js +1 -1
- package/lib/components/VPagination/VPagination.js.map +1 -1
- package/lib/components/VPicker/VPicker.js +1 -1
- package/lib/components/VPicker/VPicker.js.map +1 -1
- package/lib/components/VRadioGroup/VRadio.js +2 -2
- package/lib/components/VRadioGroup/VRadio.js.map +1 -1
- package/lib/components/VSelect/VSelect.js +2 -2
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSelect/VSelectList.js +2 -2
- package/lib/components/VSelect/VSelectList.js.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.js +3 -3
- package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/lib/components/VSlider/VSlider.js +26 -21
- package/lib/components/VSlider/VSlider.js.map +1 -1
- package/lib/components/VStepper/VStepperContent.js +1 -1
- package/lib/components/VStepper/VStepperContent.js.map +1 -1
- package/lib/components/VSwitch/VSwitch.js +1 -1
- package/lib/components/VSwitch/VSwitch.js.map +1 -1
- package/lib/components/VTabs/VTabs.js +2 -2
- package/lib/components/VTabs/VTabs.js.map +1 -1
- package/lib/components/VTextField/VTextField.js +1 -1
- package/lib/components/VTextField/VTextField.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +7 -10
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.js +3 -3
- package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/lib/components/transitions/createTransition.js +2 -2
- package/lib/components/transitions/createTransition.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/picker/index.js +5 -3
- package/lib/mixins/picker/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VAppBar/VAppBarNavIcon.ts +1 -1
- package/src/components/VBanner/VBanner.ts +3 -3
- package/src/components/VBreadcrumbs/VBreadcrumbs.ts +2 -2
- package/src/components/VBtn/VBtn.ts +24 -16
- package/src/components/VBtn/__tests__/VBtn.spec.ts +257 -242
- package/src/components/VBtn/__tests__/__snapshots__/VBtn.spec.ts.snap +13 -73
- package/src/components/VCarousel/VCarousel.ts +3 -3
- package/src/components/VCarousel/VCarouselItem.ts +1 -1
- package/src/components/VCheckbox/VCheckbox.ts +1 -1
- package/src/components/VColorPicker/VColorPicker.ts +32 -35
- package/src/components/VColorPicker/VColorPickerCanvas.ts +44 -37
- package/src/components/VColorPicker/VColorPickerEdit.ts +37 -35
- package/src/components/VColorPicker/VColorPickerPreview.ts +48 -28
- package/src/components/VColorPicker/VColorPickerSwatches.ts +23 -12
- package/src/components/VColorPicker/__tests__/VColorPicker.spec.ts +47 -47
- package/src/components/VColorPicker/__tests__/VColorPickerCanvas.spec.ts +15 -13
- package/src/components/VColorPicker/__tests__/VColorPickerEdit.spec.ts +52 -50
- package/src/components/VColorPicker/__tests__/VColorPickerPreview.spec.ts +101 -30
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +200 -157
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +28 -11
- package/src/components/VDataIterator/VDataFooter.ts +1 -1
- package/src/components/VDataTable/VDataTable.ts +8 -8
- package/src/components/VDataTable/VDataTableHeader.ts +2 -4
- package/src/components/VDataTable/VEditDialog.ts +2 -2
- package/src/components/VDataTable/mixins/header.ts +1 -1
- package/src/components/VDatePicker/VDatePickerHeader.ts +3 -3
- package/src/components/VDatePicker/VDatePickerTitle.ts +2 -2
- package/src/components/VDatePicker/mixins/date-picker-table.ts +1 -1
- package/src/components/VDialog/VDialog.ts +2 -2
- package/src/components/VExpansionPanel/VExpansionPanelContent.ts +1 -1
- package/src/components/VExpansionPanel/VExpansionPanelHeader.ts +2 -2
- package/src/components/VImg/VImg.ts +2 -2
- package/src/components/VInput/VInput.ts +10 -4
- package/src/components/VInput/__tests__/VInput.spec.ts +170 -234
- package/src/components/VInput/__tests__/__snapshots__/VInput.spec.ts.snap +50 -101
- package/src/components/VList/VListGroup.ts +5 -5
- package/src/components/VList/VListItem.ts +7 -4
- package/src/components/VMessages/VMessages.ts +1 -1
- package/src/components/VOverflowBtn/VOverflowBtn.ts +1 -1
- package/src/components/VPagination/VPagination.ts +1 -1
- package/src/components/VPicker/VPicker.ts +1 -1
- package/src/components/VRadioGroup/VRadio.ts +2 -2
- package/src/components/VSelect/VSelect.ts +2 -2
- package/src/components/VSelect/VSelectList.ts +3 -3
- package/src/components/VSkeletonLoader/__tests__/VSkeletonLoader.spec.ts +22 -15
- package/src/components/VSkeletonLoader/__tests__/__snapshots__/VSkeletonLoader.spec.ts.snap +60 -60
- package/src/components/VSlideGroup/VSlideGroup.ts +3 -3
- package/src/components/VSlider/VSlider.ts +44 -28
- package/src/components/VSlider/__tests__/VSlider.spec.ts +188 -286
- package/src/components/VSlider/__tests__/__snapshots__/VSlider.spec.ts.snap +157 -246
- package/src/components/VStepper/VStepperContent.ts +1 -1
- package/src/components/VSwitch/VSwitch.ts +1 -1
- package/src/components/VTabs/VTabs.ts +2 -2
- package/src/components/VTabs/__tests__/VTab.spec.ts +3 -3
- package/src/components/VTabs/__tests__/VTabsBar.spec.ts +2 -2
- package/src/components/VTextField/VTextField.ts +1 -1
- package/src/components/VTooltip/VTooltip.ts +21 -21
- package/src/components/VTooltip/__tests__/VTooltip.spec.ts +60 -75
- package/src/components/VTreeview/VTreeviewNode.ts +3 -3
- package/src/components/transitions/createTransition.ts +2 -2
- package/src/mixins/picker/index.ts +4 -4
|
@@ -215,7 +215,7 @@ export default baseMixins.extend({
|
|
|
215
215
|
this.setTextColor(this.computedColor, data)
|
|
216
216
|
this.setBackgroundColor(this.backgroundColor, data)
|
|
217
217
|
|
|
218
|
-
return h(VTabsBar, data, [
|
|
218
|
+
return h(VTabsBar, data, () => [
|
|
219
219
|
this.genSlider(slider),
|
|
220
220
|
items,
|
|
221
221
|
])
|
|
@@ -234,7 +234,7 @@ export default baseMixins.extend({
|
|
|
234
234
|
'onUpdate:modelValue': (val: any) => {
|
|
235
235
|
this.internalValue = val
|
|
236
236
|
}
|
|
237
|
-
}, item)
|
|
237
|
+
}, () => item)
|
|
238
238
|
},
|
|
239
239
|
genSlider (slider: VNode | null) {
|
|
240
240
|
if (this.hideSlider) return null
|
|
@@ -4,9 +4,9 @@ import VTab from '../VTab'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
RouterLinkStub,
|
|
8
7
|
VueWrapper,
|
|
9
8
|
} from '@vue/test-utils'
|
|
9
|
+
import { Vue3RouterLinkStub } from '../../../../test/util/stubs'
|
|
10
10
|
|
|
11
11
|
describe('VTab.ts', () => {
|
|
12
12
|
type Instance = InstanceType<typeof VTab>
|
|
@@ -38,7 +38,7 @@ describe('VTab.ts', () => {
|
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
stubs: {
|
|
41
|
-
'router-link':
|
|
41
|
+
'router-link': Vue3RouterLinkStub,
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
})
|
|
@@ -63,7 +63,7 @@ describe('VTab.ts', () => {
|
|
|
63
63
|
$route: { path: '/' },
|
|
64
64
|
},
|
|
65
65
|
stubs: {
|
|
66
|
-
'router-link':
|
|
66
|
+
'router-link': Vue3RouterLinkStub,
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
})
|
|
@@ -5,9 +5,9 @@ import VTabsBar from '../VTabsBar'
|
|
|
5
5
|
// Utilities
|
|
6
6
|
import {
|
|
7
7
|
mount,
|
|
8
|
-
RouterLinkStub,
|
|
9
8
|
VueWrapper,
|
|
10
9
|
} from '@vue/test-utils'
|
|
10
|
+
import { Vue3RouterLinkStub } from '../../../../test/util/stubs'
|
|
11
11
|
import { h, nextTick } from 'vue'
|
|
12
12
|
|
|
13
13
|
describe('VTabsBar.ts', () => {
|
|
@@ -21,7 +21,7 @@ describe('VTabsBar.ts', () => {
|
|
|
21
21
|
warnHandler: () => {}, // Подавляем предупреждения Vue
|
|
22
22
|
},
|
|
23
23
|
stubs: {
|
|
24
|
-
RouterLink:
|
|
24
|
+
RouterLink: Vue3RouterLinkStub,
|
|
25
25
|
},
|
|
26
26
|
mocks: {
|
|
27
27
|
$vuetify: {
|
|
@@ -368,7 +368,7 @@ export default baseMixins.extend({
|
|
|
368
368
|
value: this.labelValue
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
return h(VLabel, data, getSlot(this, 'label') || this.label)
|
|
371
|
+
return h(VLabel, data, () => getSlot(this, 'label') || this.label)
|
|
372
372
|
},
|
|
373
373
|
genLegend () {
|
|
374
374
|
const width = !this.singleLine && (this.labelValue || this.isDirty) ? this.labelWidth : 0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {h, Transition} from 'vue'
|
|
1
|
+
import { h, Transition, vShow, withDirectives, VNode } from 'vue'
|
|
2
2
|
import './VTooltip.sass'
|
|
3
3
|
|
|
4
4
|
// Mixins
|
|
@@ -13,7 +13,6 @@ import { convertToUnit, keyCodes, getSlotType } from '../../util/helpers'
|
|
|
13
13
|
import { consoleError } from '../../util/console'
|
|
14
14
|
|
|
15
15
|
// Types
|
|
16
|
-
import { VNode } from 'vue'
|
|
17
16
|
import mixins from '../../util/mixins'
|
|
18
17
|
|
|
19
18
|
/* @vue/component */
|
|
@@ -137,7 +136,7 @@ export default mixins(Colorable, Delayable, Dependent, Menuable).extend({
|
|
|
137
136
|
|
|
138
137
|
beforeMount () {
|
|
139
138
|
this.$nextTick(() => {
|
|
140
|
-
this.
|
|
139
|
+
this.modelValue && this.callActivate()
|
|
141
140
|
})
|
|
142
141
|
},
|
|
143
142
|
|
|
@@ -194,26 +193,27 @@ export default mixins(Colorable, Delayable, Dependent, Menuable).extend({
|
|
|
194
193
|
|
|
195
194
|
return h(Transition, {
|
|
196
195
|
name: this.computedTransition,
|
|
197
|
-
}, [content])
|
|
196
|
+
}, () => [content])
|
|
198
197
|
},
|
|
199
198
|
genContent () {
|
|
200
|
-
return
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
199
|
+
return withDirectives(
|
|
200
|
+
h(
|
|
201
|
+
'div',
|
|
202
|
+
this.setBackgroundColor(this.color, {
|
|
203
|
+
class: ['v-tooltip__content', {
|
|
204
|
+
[this.contentClass]: true,
|
|
205
|
+
menuable__content__active: this.isActive,
|
|
206
|
+
'v-tooltip__content--fixed': this.activatorFixed,
|
|
207
|
+
}],
|
|
208
|
+
style: this.styles,
|
|
209
|
+
attrs: this.getScopeIdAttrs(),
|
|
210
|
+
ref: 'content',
|
|
211
|
+
}),
|
|
212
|
+
this.getContentSlot()
|
|
213
|
+
),
|
|
214
|
+
[
|
|
215
|
+
[vShow, this.isContentActive]
|
|
216
|
+
]
|
|
217
217
|
)
|
|
218
218
|
},
|
|
219
219
|
},
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import VTooltip from '../VTooltip'
|
|
2
2
|
import {
|
|
3
3
|
mount,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
enableAutoUnmount,
|
|
5
|
+
VueWrapper,
|
|
6
6
|
} from '@vue/test-utils'
|
|
7
|
+
import { h } from 'vue'
|
|
7
8
|
|
|
8
9
|
describe('VTooltip', () => {
|
|
9
10
|
type Instance = InstanceType<typeof VTooltip>
|
|
10
|
-
let mountFunction: (options?:
|
|
11
|
+
let mountFunction: (options?: any) => VueWrapper<Instance>
|
|
12
|
+
|
|
13
|
+
enableAutoUnmount(afterEach)
|
|
11
14
|
|
|
12
15
|
beforeEach(() => {
|
|
13
16
|
document.body.setAttribute('data-app', 'true')
|
|
@@ -19,15 +22,13 @@ describe('VTooltip', () => {
|
|
|
19
22
|
|
|
20
23
|
it('should render component with top and match snapshot', async () => {
|
|
21
24
|
const wrapper = mountFunction({
|
|
22
|
-
|
|
25
|
+
props: {
|
|
23
26
|
openDelay: 0,
|
|
24
27
|
top: true,
|
|
25
28
|
},
|
|
26
|
-
scopedSlots: {
|
|
27
|
-
activator: '<span>activator</span>',
|
|
28
|
-
},
|
|
29
29
|
slots: {
|
|
30
|
-
|
|
30
|
+
activator: () => h('span', 'activator'),
|
|
31
|
+
default: () => h('span', 'content'),
|
|
31
32
|
},
|
|
32
33
|
})
|
|
33
34
|
|
|
@@ -35,24 +36,21 @@ describe('VTooltip', () => {
|
|
|
35
36
|
expect(wrapper.vm.offsetY).toBeTruthy()
|
|
36
37
|
expect(wrapper.html()).toMatchSnapshot()
|
|
37
38
|
|
|
38
|
-
wrapper.setProps({
|
|
39
|
-
|
|
39
|
+
await wrapper.setProps({
|
|
40
|
+
modelValue: true,
|
|
40
41
|
})
|
|
41
|
-
await wrapper.vm.$nextTick()
|
|
42
42
|
expect(wrapper.html()).toMatchSnapshot()
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
it('should render component with left and match snapshot', async () => {
|
|
46
46
|
const wrapper = mountFunction({
|
|
47
|
-
|
|
47
|
+
props: {
|
|
48
48
|
openDelay: 0,
|
|
49
49
|
left: true,
|
|
50
50
|
},
|
|
51
|
-
scopedSlots: {
|
|
52
|
-
activator: '<span>activator</span>',
|
|
53
|
-
},
|
|
54
51
|
slots: {
|
|
55
|
-
|
|
52
|
+
activator: () => h('span', 'activator'),
|
|
53
|
+
default: () => h('span', 'content'),
|
|
56
54
|
},
|
|
57
55
|
})
|
|
58
56
|
|
|
@@ -60,24 +58,21 @@ describe('VTooltip', () => {
|
|
|
60
58
|
expect(wrapper.vm.offsetY).toBeFalsy()
|
|
61
59
|
expect(wrapper.html()).toMatchSnapshot()
|
|
62
60
|
|
|
63
|
-
wrapper.setProps({
|
|
64
|
-
|
|
61
|
+
await wrapper.setProps({
|
|
62
|
+
modelValue: true,
|
|
65
63
|
})
|
|
66
|
-
await wrapper.vm.$nextTick()
|
|
67
64
|
expect(wrapper.html()).toMatchSnapshot()
|
|
68
65
|
})
|
|
69
66
|
|
|
70
67
|
it('should render component with bottom and match snapshot', async () => {
|
|
71
68
|
const wrapper = mountFunction({
|
|
72
|
-
|
|
69
|
+
props: {
|
|
73
70
|
openDelay: 0,
|
|
74
71
|
bottom: true,
|
|
75
72
|
},
|
|
76
|
-
scopedSlots: {
|
|
77
|
-
activator: '<span>activator</span>',
|
|
78
|
-
},
|
|
79
73
|
slots: {
|
|
80
|
-
|
|
74
|
+
activator: () => h('span', 'activator'),
|
|
75
|
+
default: () => h('span', 'content'),
|
|
81
76
|
},
|
|
82
77
|
})
|
|
83
78
|
|
|
@@ -85,24 +80,21 @@ describe('VTooltip', () => {
|
|
|
85
80
|
expect(wrapper.vm.offsetY).toBeTruthy()
|
|
86
81
|
expect(wrapper.html()).toMatchSnapshot()
|
|
87
82
|
|
|
88
|
-
wrapper.setProps({
|
|
89
|
-
|
|
83
|
+
await wrapper.setProps({
|
|
84
|
+
modelValue: true,
|
|
90
85
|
})
|
|
91
|
-
await wrapper.vm.$nextTick()
|
|
92
86
|
expect(wrapper.html()).toMatchSnapshot()
|
|
93
87
|
})
|
|
94
88
|
|
|
95
89
|
it('should render component with right and match snapshot', async () => {
|
|
96
90
|
const wrapper = mountFunction({
|
|
97
|
-
|
|
91
|
+
props: {
|
|
98
92
|
openDelay: 0,
|
|
99
93
|
right: true,
|
|
100
94
|
},
|
|
101
|
-
scopedSlots: {
|
|
102
|
-
activator: '<span>activator</span>',
|
|
103
|
-
},
|
|
104
95
|
slots: {
|
|
105
|
-
|
|
96
|
+
activator: () => h('span', 'activator'),
|
|
97
|
+
default: () => h('span', 'content'),
|
|
106
98
|
},
|
|
107
99
|
})
|
|
108
100
|
|
|
@@ -110,39 +102,34 @@ describe('VTooltip', () => {
|
|
|
110
102
|
expect(wrapper.vm.offsetY).toBeFalsy()
|
|
111
103
|
expect(wrapper.html()).toMatchSnapshot()
|
|
112
104
|
|
|
113
|
-
wrapper.setProps({
|
|
114
|
-
|
|
105
|
+
await wrapper.setProps({
|
|
106
|
+
modelValue: true,
|
|
115
107
|
})
|
|
116
|
-
await wrapper.vm.$nextTick()
|
|
117
108
|
expect(wrapper.html()).toMatchSnapshot()
|
|
118
109
|
})
|
|
119
110
|
|
|
120
111
|
it('should render component with custom eager and match snapshot', () => {
|
|
121
112
|
const wrapper = mountFunction({
|
|
122
|
-
|
|
113
|
+
props: {
|
|
123
114
|
eager: true,
|
|
124
115
|
},
|
|
125
|
-
scopedSlots: {
|
|
126
|
-
activator: '<span>activator</span>',
|
|
127
|
-
},
|
|
128
116
|
slots: {
|
|
129
|
-
|
|
117
|
+
activator: () => h('span', 'activator'),
|
|
118
|
+
default: () => h('span', 'content'),
|
|
130
119
|
},
|
|
131
120
|
})
|
|
132
121
|
|
|
133
122
|
expect(wrapper.html()).toMatchSnapshot()
|
|
134
123
|
})
|
|
135
124
|
|
|
136
|
-
it('should render component with
|
|
125
|
+
it('should render component with modelValue=true and match snapshot', async () => {
|
|
137
126
|
const wrapper = mountFunction({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
scopedSlots: {
|
|
142
|
-
activator: '<span>activator</span>',
|
|
127
|
+
props: {
|
|
128
|
+
modelValue: true,
|
|
143
129
|
},
|
|
144
130
|
slots: {
|
|
145
|
-
|
|
131
|
+
activator: () => h('span', 'activator'),
|
|
132
|
+
default: () => h('span', 'content'),
|
|
146
133
|
},
|
|
147
134
|
})
|
|
148
135
|
|
|
@@ -152,16 +139,14 @@ describe('VTooltip', () => {
|
|
|
152
139
|
|
|
153
140
|
it('should render component with min/max width and match snapshot', async () => {
|
|
154
141
|
const wrapper = mountFunction({
|
|
155
|
-
|
|
156
|
-
|
|
142
|
+
props: {
|
|
143
|
+
modelValue: true,
|
|
157
144
|
minWidth: 100,
|
|
158
145
|
maxWidth: 200,
|
|
159
146
|
},
|
|
160
|
-
scopedSlots: {
|
|
161
|
-
activator: '<span>activator</span>',
|
|
162
|
-
},
|
|
163
147
|
slots: {
|
|
164
|
-
|
|
148
|
+
activator: () => h('span', 'activator'),
|
|
149
|
+
default: () => h('span', 'content'),
|
|
165
150
|
},
|
|
166
151
|
})
|
|
167
152
|
|
|
@@ -170,7 +155,7 @@ describe('VTooltip', () => {
|
|
|
170
155
|
|
|
171
156
|
it('should render component with zIndex prop and match snapshot', async () => {
|
|
172
157
|
const wrapper = mountFunction({
|
|
173
|
-
|
|
158
|
+
props: {
|
|
174
159
|
zIndex: 42,
|
|
175
160
|
},
|
|
176
161
|
})
|
|
@@ -181,43 +166,45 @@ describe('VTooltip', () => {
|
|
|
181
166
|
it('should display tooltip after mouseenter and hide after mouseleave', async () => {
|
|
182
167
|
jest.useFakeTimers()
|
|
183
168
|
const wrapper = mountFunction({
|
|
184
|
-
|
|
169
|
+
props: {
|
|
185
170
|
openDelay: 123,
|
|
186
171
|
closeDelay: 321,
|
|
187
172
|
},
|
|
188
|
-
scopedSlots: {
|
|
189
|
-
activator: '<span v-on="props.on" class="activator">activator</span>',
|
|
190
|
-
},
|
|
191
173
|
slots: {
|
|
192
|
-
|
|
174
|
+
activator: ({ on }: any) => h('span', { ...on, class: 'activator' }, 'activator'),
|
|
175
|
+
default: () => h('span', { class: 'content' }, 'content'),
|
|
193
176
|
},
|
|
194
177
|
})
|
|
195
178
|
|
|
196
179
|
const activator = wrapper.find('.activator')
|
|
197
|
-
const cb = jest.fn()
|
|
198
|
-
wrapper.vm.$on('input', cb)
|
|
199
180
|
|
|
200
|
-
activator.trigger('mouseenter')
|
|
181
|
+
await activator.trigger('mouseenter')
|
|
201
182
|
jest.runAllTimers()
|
|
202
183
|
await wrapper.vm.$nextTick()
|
|
203
|
-
expect((setTimeout as any).mock.calls[0][1]).toBe(123)
|
|
204
|
-
expect(cb).toHaveBeenCalledWith(true)
|
|
205
184
|
|
|
206
|
-
|
|
185
|
+
// Check if tooltip became active
|
|
186
|
+
expect(wrapper.vm.isActive).toBe(true)
|
|
187
|
+
expect(wrapper.emitted()['update:modelValue']).toBeTruthy()
|
|
188
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([true])
|
|
189
|
+
|
|
190
|
+
await activator.trigger('mouseleave')
|
|
207
191
|
jest.runAllTimers()
|
|
208
192
|
await wrapper.vm.$nextTick()
|
|
209
|
-
|
|
210
|
-
expect(
|
|
193
|
+
|
|
194
|
+
expect(wrapper.vm.isActive).toBe(false)
|
|
195
|
+
expect(wrapper.emitted()['update:modelValue'][1]).toEqual([false])
|
|
196
|
+
|
|
197
|
+
jest.useRealTimers()
|
|
211
198
|
})
|
|
212
199
|
|
|
213
200
|
it(`should warn if activator isn't scoped`, () => {
|
|
214
201
|
mountFunction({
|
|
215
|
-
|
|
202
|
+
props: {
|
|
216
203
|
openDelay: 0,
|
|
217
204
|
},
|
|
218
205
|
slots: {
|
|
219
|
-
activator: '
|
|
220
|
-
default: '
|
|
206
|
+
activator: () => h('span', 'activator'),
|
|
207
|
+
default: () => h('span', 'content'),
|
|
221
208
|
},
|
|
222
209
|
})
|
|
223
210
|
|
|
@@ -227,15 +214,13 @@ describe('VTooltip', () => {
|
|
|
227
214
|
it(`should open and close`, () => {
|
|
228
215
|
jest.useFakeTimers()
|
|
229
216
|
const wrapper = mountFunction({
|
|
230
|
-
|
|
217
|
+
props: {
|
|
231
218
|
openDelay: 0,
|
|
232
219
|
closeDelay: 0,
|
|
233
220
|
},
|
|
234
|
-
scopedSlots: {
|
|
235
|
-
activator: '<span v-on="props.on" class="activator">activator</span>',
|
|
236
|
-
},
|
|
237
221
|
slots: {
|
|
238
|
-
|
|
222
|
+
activator: ({ on }: any) => h('span', { ...on, class: 'activator' }, 'activator'),
|
|
223
|
+
default: () => h('span', { class: 'content' }, 'content'),
|
|
239
224
|
},
|
|
240
225
|
})
|
|
241
226
|
|
|
@@ -234,7 +234,7 @@ const VTreeviewNode = baseMixins.extend({
|
|
|
234
234
|
|
|
235
235
|
this.checkChildren().then(() => this.open())
|
|
236
236
|
}
|
|
237
|
-
}, [this.isLoading ? this.loadingIcon : this.expandIcon])
|
|
237
|
+
}, () => [this.isLoading ? this.loadingIcon : this.expandIcon])
|
|
238
238
|
},
|
|
239
239
|
genCheckbox () {
|
|
240
240
|
return h(VIcon, {
|
|
@@ -257,7 +257,7 @@ const VTreeviewNode = baseMixins.extend({
|
|
|
257
257
|
})
|
|
258
258
|
})
|
|
259
259
|
},
|
|
260
|
-
}, [this.computedIcon])
|
|
260
|
+
}, () => [this.computedIcon])
|
|
261
261
|
},
|
|
262
262
|
genLevel (level: number) {
|
|
263
263
|
return createRange(level).map(() => h('div', {
|
|
@@ -331,7 +331,7 @@ const VTreeviewNode = baseMixins.extend({
|
|
|
331
331
|
}, children)
|
|
332
332
|
},
|
|
333
333
|
genTransition () {
|
|
334
|
-
return h(VExpandTransition, [this.genChildrenWrapper()])
|
|
334
|
+
return h(VExpandTransition, {}, () => [this.genChildrenWrapper()])
|
|
335
335
|
},
|
|
336
336
|
},
|
|
337
337
|
|
|
@@ -88,7 +88,7 @@ export function createSimpleTransition (
|
|
|
88
88
|
el.style.setProperty('display', 'none', 'important')
|
|
89
89
|
})
|
|
90
90
|
}
|
|
91
|
-
return h(tag, mergeData(this.$attrs, data), this.$slots.default())
|
|
91
|
+
return h(tag, mergeData(this.$attrs, data), () => this.$slots.default())
|
|
92
92
|
},
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -117,7 +117,7 @@ export function createJavascriptTransition (
|
|
|
117
117
|
name,
|
|
118
118
|
...functions,
|
|
119
119
|
}),
|
|
120
|
-
this.$slots.default()
|
|
120
|
+
() => this.$slots.default()
|
|
121
121
|
)
|
|
122
122
|
},
|
|
123
123
|
}
|
|
@@ -47,17 +47,17 @@ export default mixins(
|
|
|
47
47
|
}) : getSlot(this)
|
|
48
48
|
},
|
|
49
49
|
genPicker (staticClass: string) {
|
|
50
|
-
const children = {}
|
|
50
|
+
const children: Record<string, any> = {}
|
|
51
51
|
|
|
52
52
|
if (!this.noTitle) {
|
|
53
53
|
const title = this.genPickerTitle()
|
|
54
|
-
title && (children.title = title)
|
|
54
|
+
title && (children.title = () => [title])
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const body = this.genPickerBody()
|
|
58
|
-
body && (children.default = body)
|
|
58
|
+
body && (children.default = () => [body])
|
|
59
59
|
|
|
60
|
-
children.actions = (
|
|
60
|
+
children.actions = () => [this.genPickerActionsSlot()]
|
|
61
61
|
|
|
62
62
|
return h(VPicker, {
|
|
63
63
|
class: staticClass,
|