@dimailn/vuetify 2.7.2-alpha35 → 2.7.2-alpha37
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 +51 -46
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VBottomNavigation/VBottomNavigation.js +3 -7
- package/es5/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +1 -1
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VItemGroup/VItemGroup.js +1 -1
- package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
- package/es5/components/VMenu/VMenu.js +1 -1
- package/es5/components/VMenu/VMenu.js.map +1 -1
- package/es5/components/VNavigationDrawer/VNavigationDrawer.js +1 -1
- package/es5/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
- package/es5/components/VSelect/VSelect.js +2 -2
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VSlideGroup/VSlideGroup.js +33 -34
- package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/es5/components/VStepper/VStepperContent.js +5 -3
- package/es5/components/VStepper/VStepperContent.js.map +1 -1
- package/es5/components/VTabs/VTabs.js +1 -1
- package/es5/components/VTabs/VTabs.js.map +1 -1
- package/es5/components/VTextarea/VTextarea.js +1 -1
- package/es5/components/VTextarea/VTextarea.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/detachable/index.js +1 -1
- package/es5/mixins/detachable/index.js.map +1 -1
- package/es5/mixins/groupable/index.js +5 -1
- package/es5/mixins/groupable/index.js.map +1 -1
- package/es5/mixins/proxyable/index.js +5 -1
- package/es5/mixins/proxyable/index.js.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.js +4 -8
- package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +1 -1
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.js +1 -1
- package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
- package/lib/components/VMenu/VMenu.js +1 -1
- package/lib/components/VMenu/VMenu.js.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.js +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
- package/lib/components/VSelect/VSelect.js +2 -2
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.js +23 -20
- package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/lib/components/VStepper/VStepperContent.js +6 -4
- package/lib/components/VStepper/VStepperContent.js.map +1 -1
- package/lib/components/VTabs/VTabs.js +1 -1
- package/lib/components/VTabs/VTabs.js.map +1 -1
- package/lib/components/VTextarea/VTextarea.js +1 -1
- package/lib/components/VTextarea/VTextarea.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/detachable/index.js +1 -1
- package/lib/mixins/detachable/index.js.map +1 -1
- package/lib/mixins/groupable/index.js +3 -1
- package/lib/mixins/groupable/index.js.map +1 -1
- package/lib/mixins/proxyable/index.js +5 -1
- package/lib/mixins/proxyable/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VBottomNavigation/VBottomNavigation.ts +9 -9
- package/src/components/VBottomNavigation/__tests__/__snapshots__/VBottomNavigation.spec.ts.snap +0 -1
- package/src/components/VBtn/__tests__/VBtn.spec.ts +2 -1
- package/src/components/VDialog/VDialog.ts +1 -1
- package/src/components/VExpansionPanel/__tests__/VExpansionPanel.spec.ts +2 -2
- package/src/components/VExpansionPanel/__tests__/__snapshots__/VExpansionPanel.spec.ts.snap +6 -7
- package/src/components/VItemGroup/VItemGroup.ts +1 -1
- package/src/components/VMenu/VMenu.ts +1 -1
- package/src/components/VNavigationDrawer/VNavigationDrawer.ts +1 -1
- package/src/components/VSelect/VSelect.ts +2 -2
- package/src/components/VSlideGroup/VSlideGroup.ts +35 -21
- package/src/components/VStepper/VStepperContent.ts +8 -9
- package/src/components/VTabs/VTabs.ts +1 -1
- package/src/components/VTextarea/VTextarea.ts +1 -1
- package/src/components/VTextarea/__tests__/VTextarea.spec.ts +51 -0
- package/src/components/VTextarea/__tests__/__snapshots__/VTextarea.spec.ts.snap +85 -0
- package/src/components/VTreeview/__tests__/VTreeviewNode.spec.ts +31 -46
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeviewNode.spec.ts.snap +48 -17
- package/src/mixins/detachable/index.ts +1 -1
- package/src/mixins/groupable/index.ts +3 -1
- package/src/mixins/proxyable/index.ts +4 -1
package/src/components/VBottomNavigation/__tests__/__snapshots__/VBottomNavigation.spec.ts.snap
CHANGED
|
@@ -36,7 +36,6 @@ Object {
|
|
|
36
36
|
exports[`VBottomNavigation.ts should be visible with a true value 4`] = `
|
|
37
37
|
<div class="v-item-group theme--light v-bottom-navigation"
|
|
38
38
|
style="height: 56px; transform: translateY(100%);"
|
|
39
|
-
directives="[object Object]"
|
|
40
39
|
>
|
|
41
40
|
<button class="v-btn v-btn--is-elevated v-btn--has-bg theme--light v-size--default"
|
|
42
41
|
type="button"
|
|
@@ -77,7 +77,7 @@ describe('VBtn.ts', () => {
|
|
|
77
77
|
expect(wrapper.html()).toMatchSnapshot()
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
it('should register and unregister', () => {
|
|
80
|
+
it('should register and unregister', async () => {
|
|
81
81
|
const register = jest.fn()
|
|
82
82
|
const unregister = jest.fn()
|
|
83
83
|
|
|
@@ -94,6 +94,7 @@ describe('VBtn.ts', () => {
|
|
|
94
94
|
|
|
95
95
|
expect(register).toHaveBeenCalled()
|
|
96
96
|
wrapper.unmount()
|
|
97
|
+
await nextTick()
|
|
97
98
|
expect(unregister).toHaveBeenCalled()
|
|
98
99
|
})
|
|
99
100
|
it('should use custom active-class', () => {
|
|
@@ -171,7 +171,7 @@ export default baseMixins.extend({
|
|
|
171
171
|
// if it was dragged onto the overlay (#6969),
|
|
172
172
|
// or if this isn't the topmost dialog (#9907)
|
|
173
173
|
return !(
|
|
174
|
-
this
|
|
174
|
+
this.$.isUnmounted ||
|
|
175
175
|
!this.isActive ||
|
|
176
176
|
this.$refs.content.contains(target) ||
|
|
177
177
|
(this.overlay && target && !this.overlay.$el.contains(target))
|
|
@@ -26,7 +26,7 @@ describe('VExpansionPanel', () => {
|
|
|
26
26
|
VExpansionPanelHeader,
|
|
27
27
|
{
|
|
28
28
|
render: () => h(VExpansionPanelContent, {
|
|
29
|
-
|
|
29
|
+
eager: true,
|
|
30
30
|
}),
|
|
31
31
|
},
|
|
32
32
|
],
|
|
@@ -113,7 +113,7 @@ describe('VExpansionPanel', () => {
|
|
|
113
113
|
default: [
|
|
114
114
|
{
|
|
115
115
|
render: () => h(VExpansionPanelHeader, {
|
|
116
|
-
|
|
116
|
+
hideActions: true,
|
|
117
117
|
}),
|
|
118
118
|
},
|
|
119
119
|
VExpansionPanelContent,
|
|
@@ -7,14 +7,7 @@ exports[`VExpansionPanel should hide actions and match snapshot 1`] = `
|
|
|
7
7
|
<button class="v-expansion-panel-header"
|
|
8
8
|
type="button"
|
|
9
9
|
aria-expanded="false"
|
|
10
|
-
props="[object Object]"
|
|
11
10
|
>
|
|
12
|
-
<div class="v-expansion-panel-header__icon">
|
|
13
|
-
<i class="v-icon notranslate theme--light mdi mdi-chevron-down"
|
|
14
|
-
aria-hidden="true"
|
|
15
|
-
>
|
|
16
|
-
</i>
|
|
17
|
-
</div>
|
|
18
11
|
</button>
|
|
19
12
|
</div>
|
|
20
13
|
`;
|
|
@@ -34,5 +27,11 @@ exports[`VExpansionPanel should hide actions and match snapshot 2`] = `
|
|
|
34
27
|
</i>
|
|
35
28
|
</div>
|
|
36
29
|
</button>
|
|
30
|
+
<div class="v-expansion-panel-content"
|
|
31
|
+
style="display: none;"
|
|
32
|
+
>
|
|
33
|
+
<div class="v-expansion-panel-content__wrap">
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
37
36
|
</div>
|
|
38
37
|
`;
|
|
@@ -149,7 +149,7 @@ export const BaseItemGroup = mixins(
|
|
|
149
149
|
this.updateItem(item, index)
|
|
150
150
|
},
|
|
151
151
|
unregister (item: GroupableInstance) {
|
|
152
|
-
if (this
|
|
152
|
+
if (this.$.isUnmounted) return
|
|
153
153
|
|
|
154
154
|
const index = this.items.indexOf(item)
|
|
155
155
|
const value = this.getValue(item, index)
|
|
@@ -300,7 +300,7 @@ export default baseMixins.extend({
|
|
|
300
300
|
const target = e.target as HTMLElement
|
|
301
301
|
|
|
302
302
|
return this.isActive &&
|
|
303
|
-
!this
|
|
303
|
+
!this.$.isUnmounted &&
|
|
304
304
|
this.closeOnClick &&
|
|
305
305
|
this.$refs.content &&
|
|
306
306
|
!this.$refs.content.contains(target)
|
|
@@ -316,7 +316,7 @@ export default baseMixins.extend({
|
|
|
316
316
|
}
|
|
317
317
|
},
|
|
318
318
|
closeConditional () {
|
|
319
|
-
return this.isActive && !this
|
|
319
|
+
return this.isActive && !this.$.isUnmounted && this.reactsToClick
|
|
320
320
|
},
|
|
321
321
|
genAppend () {
|
|
322
322
|
return this.genPosition('append')
|
|
@@ -360,7 +360,7 @@ export default baseMixins.extend({
|
|
|
360
360
|
if (!this.isMenuActive) return true
|
|
361
361
|
|
|
362
362
|
return (
|
|
363
|
-
!this
|
|
363
|
+
!this.$.isUnmounted &&
|
|
364
364
|
|
|
365
365
|
// Click originates from outside the menu content
|
|
366
366
|
// Multiple selects don't close when an item is clicked
|
|
@@ -631,7 +631,7 @@ export default baseMixins.extend({
|
|
|
631
631
|
parent: this,
|
|
632
632
|
item,
|
|
633
633
|
index,
|
|
634
|
-
|
|
634
|
+
onSelect: (e: Event) => {
|
|
635
635
|
e.stopPropagation()
|
|
636
636
|
this.selectedIndex = index
|
|
637
637
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {h, withDirectives} from 'vue'
|
|
1
|
+
import { h, withDirectives } from 'vue'
|
|
2
2
|
// Styles
|
|
3
3
|
import './VSlideGroup.sass'
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ import Touch from '../../directives/touch'
|
|
|
20
20
|
import mixins, { ExtractVue } from '../../util/mixins'
|
|
21
21
|
|
|
22
22
|
// Types
|
|
23
|
-
import
|
|
23
|
+
import { VNode, defineComponent } from 'vue'
|
|
24
24
|
import { composedPath, getSlot } from '../../util/helpers'
|
|
25
25
|
|
|
26
26
|
interface TouchEvent {
|
|
@@ -36,7 +36,7 @@ interface Widths {
|
|
|
36
36
|
wrapper: number
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
interface options
|
|
39
|
+
interface options {
|
|
40
40
|
$refs: {
|
|
41
41
|
content: HTMLElement
|
|
42
42
|
wrapper: HTMLElement
|
|
@@ -107,7 +107,6 @@ export const BaseSlideGroup = mixins<options &
|
|
|
107
107
|
).extend({
|
|
108
108
|
name: 'base-slide-group',
|
|
109
109
|
|
|
110
|
-
|
|
111
110
|
props: {
|
|
112
111
|
activeClass: {
|
|
113
112
|
type: String,
|
|
@@ -257,7 +256,10 @@ export const BaseSlideGroup = mixins<options &
|
|
|
257
256
|
|
|
258
257
|
methods: {
|
|
259
258
|
onScroll () {
|
|
260
|
-
this.$refs.wrapper
|
|
259
|
+
const wrapper = this.$refs.wrapper as HTMLElement
|
|
260
|
+
if (wrapper) {
|
|
261
|
+
wrapper.scrollLeft = 0
|
|
262
|
+
}
|
|
261
263
|
},
|
|
262
264
|
onFocusin (e: FocusEvent) {
|
|
263
265
|
if (!this.isOverflowing) return
|
|
@@ -301,7 +303,7 @@ export const BaseSlideGroup = mixins<options &
|
|
|
301
303
|
},
|
|
302
304
|
genData (): object {
|
|
303
305
|
return {
|
|
304
|
-
class: this.classes
|
|
306
|
+
class: this.classes,
|
|
305
307
|
}
|
|
306
308
|
},
|
|
307
309
|
genIcon (location: 'prev' | 'next'): VNode | null {
|
|
@@ -321,9 +323,9 @@ export const BaseSlideGroup = mixins<options &
|
|
|
321
323
|
!hasAffix
|
|
322
324
|
) return null
|
|
323
325
|
|
|
324
|
-
return h(VIcon,
|
|
326
|
+
return h(VIcon, {
|
|
325
327
|
disabled: !hasAffix,
|
|
326
|
-
}, (this as any)[`${icon}Icon`])
|
|
328
|
+
}, (this as any)[`${icon}Icon`])
|
|
327
329
|
},
|
|
328
330
|
// Always generate prev for scrollable hint
|
|
329
331
|
genPrev (): VNode | null {
|
|
@@ -340,7 +342,7 @@ export const BaseSlideGroup = mixins<options &
|
|
|
340
342
|
}, [slot])
|
|
341
343
|
},
|
|
342
344
|
genTransition (location: 'prev' | 'next') {
|
|
343
|
-
return h(VFadeTransition,
|
|
345
|
+
return h(VFadeTransition, {}, [this.genIcon(location)])
|
|
344
346
|
},
|
|
345
347
|
genWrapper (): VNode {
|
|
346
348
|
return withDirectives(h('div', {
|
|
@@ -354,8 +356,8 @@ export const BaseSlideGroup = mixins<options &
|
|
|
354
356
|
start: (e: TouchEvent) => this.overflowCheck(e, this.onTouchStart),
|
|
355
357
|
move: (e: TouchEvent) => this.overflowCheck(e, this.onTouchMove),
|
|
356
358
|
end: (e: TouchEvent) => this.overflowCheck(e, this.onTouchEnd),
|
|
357
|
-
}
|
|
358
|
-
]
|
|
359
|
+
},
|
|
360
|
+
],
|
|
359
361
|
|
|
360
362
|
])
|
|
361
363
|
},
|
|
@@ -372,12 +374,14 @@ export const BaseSlideGroup = mixins<options &
|
|
|
372
374
|
},
|
|
373
375
|
onResize () {
|
|
374
376
|
/* istanbul ignore next */
|
|
375
|
-
if (this
|
|
377
|
+
if (this.$.isUnmounted) return
|
|
376
378
|
|
|
377
379
|
this.setWidths()
|
|
378
380
|
},
|
|
379
381
|
onTouchStart (e: TouchEvent) {
|
|
380
|
-
const
|
|
382
|
+
const content = this.$refs.content as HTMLElement
|
|
383
|
+
|
|
384
|
+
if (!content) return
|
|
381
385
|
|
|
382
386
|
this.startX = this.scrollOffset + e.touchstartX as number
|
|
383
387
|
|
|
@@ -406,7 +410,11 @@ export const BaseSlideGroup = mixins<options &
|
|
|
406
410
|
onTouchEnd () {
|
|
407
411
|
if (!this.canTouch) return
|
|
408
412
|
|
|
409
|
-
const
|
|
413
|
+
const content = this.$refs.content as HTMLElement
|
|
414
|
+
const wrapper = this.$refs.wrapper as HTMLElement
|
|
415
|
+
|
|
416
|
+
if (!content || !wrapper) return
|
|
417
|
+
|
|
410
418
|
const maxScrollOffset = content.clientWidth - wrapper.clientWidth
|
|
411
419
|
|
|
412
420
|
content.style.setProperty('transition', null)
|
|
@@ -439,7 +447,10 @@ export const BaseSlideGroup = mixins<options &
|
|
|
439
447
|
scrollIntoView /* istanbul ignore next */ () {
|
|
440
448
|
if (!this.selectedItem && this.items.length) {
|
|
441
449
|
const lastItemPosition = this.items[this.items.length - 1].$el.getBoundingClientRect()
|
|
442
|
-
const
|
|
450
|
+
const wrapper = this.$refs.wrapper as HTMLElement
|
|
451
|
+
|
|
452
|
+
if (!wrapper) return
|
|
453
|
+
const wrapperPosition = wrapper.getBoundingClientRect()
|
|
443
454
|
|
|
444
455
|
if (
|
|
445
456
|
(this.$vuetify.rtl && wrapperPosition.right < lastItemPosition.right) ||
|
|
@@ -482,13 +493,16 @@ export const BaseSlideGroup = mixins<options &
|
|
|
482
493
|
},
|
|
483
494
|
setWidths () {
|
|
484
495
|
window.requestAnimationFrame(() => {
|
|
485
|
-
if (this
|
|
496
|
+
if (this.$.isUnmounted) return
|
|
497
|
+
|
|
498
|
+
const content = this.$refs.content as HTMLElement
|
|
499
|
+
const wrapper = this.$refs.wrapper as HTMLElement
|
|
486
500
|
|
|
487
|
-
|
|
501
|
+
if (!content || !wrapper) return
|
|
488
502
|
|
|
489
503
|
this.widths = {
|
|
490
|
-
content: content
|
|
491
|
-
wrapper: wrapper
|
|
504
|
+
content: content.clientWidth,
|
|
505
|
+
wrapper: wrapper.clientWidth,
|
|
492
506
|
}
|
|
493
507
|
|
|
494
508
|
// https://github.com/vuetifyjs/vuetify/issues/13212
|
|
@@ -509,8 +523,8 @@ export const BaseSlideGroup = mixins<options &
|
|
|
509
523
|
]), [
|
|
510
524
|
[
|
|
511
525
|
Resize,
|
|
512
|
-
this.onResize
|
|
513
|
-
]
|
|
526
|
+
this.onResize,
|
|
527
|
+
],
|
|
514
528
|
])
|
|
515
529
|
},
|
|
516
530
|
})
|
|
@@ -149,18 +149,17 @@ export default baseMixins.extend({
|
|
|
149
149
|
ref: 'wrapper',
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
const wrapper = h('div', wrapperData, getSlot(this))
|
|
153
|
+
let content: VNode
|
|
154
|
+
|
|
152
155
|
if (!this.isVertical) {
|
|
153
|
-
|
|
154
|
-
[
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
]
|
|
156
|
+
content = withDirectives(h('div', contentData, [wrapper]), [
|
|
157
|
+
[vShow, this.isActive]
|
|
158
|
+
])
|
|
159
|
+
} else {
|
|
160
|
+
content = h('div', contentData, [wrapper])
|
|
159
161
|
}
|
|
160
162
|
|
|
161
|
-
const wrapper = h('div', wrapperData, getSlot(this))
|
|
162
|
-
const content = h('div', contentData, [wrapper])
|
|
163
|
-
|
|
164
163
|
return h(this.computedTransition, {
|
|
165
164
|
...this.$listeners,
|
|
166
165
|
}, () => [content])
|
|
@@ -221,4 +221,55 @@ describe('VTextarea.ts', () => {
|
|
|
221
221
|
|
|
222
222
|
expect(wrapper.vm.$refs.input.style.height).toBe('150px')
|
|
223
223
|
})
|
|
224
|
+
|
|
225
|
+
it('should render with default rows attribute', () => {
|
|
226
|
+
const wrapper = mountFunction()
|
|
227
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
228
|
+
})
|
|
229
|
+
|
|
230
|
+
it('should render with custom rows attribute', () => {
|
|
231
|
+
const wrapper = mountFunction({
|
|
232
|
+
props: {
|
|
233
|
+
rows: 3,
|
|
234
|
+
},
|
|
235
|
+
})
|
|
236
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
it('should render with rows as string', () => {
|
|
240
|
+
const wrapper = mountFunction({
|
|
241
|
+
props: {
|
|
242
|
+
rows: '10',
|
|
243
|
+
},
|
|
244
|
+
})
|
|
245
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
it('should render with rows and autoGrow', () => {
|
|
249
|
+
const wrapper = mountFunction({
|
|
250
|
+
props: {
|
|
251
|
+
rows: 7,
|
|
252
|
+
autoGrow: true,
|
|
253
|
+
},
|
|
254
|
+
})
|
|
255
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
it('should have rows attribute in DOM', () => {
|
|
259
|
+
const wrapper = mountFunction({
|
|
260
|
+
props: {
|
|
261
|
+
rows: 8,
|
|
262
|
+
},
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
const textarea = wrapper.find('textarea')
|
|
266
|
+
expect(textarea.attributes('rows')).toBe('8')
|
|
267
|
+
})
|
|
268
|
+
|
|
269
|
+
it('should have default rows attribute in DOM', () => {
|
|
270
|
+
const wrapper = mountFunction()
|
|
271
|
+
|
|
272
|
+
const textarea = wrapper.find('textarea')
|
|
273
|
+
expect(textarea.attributes('rows')).toBe('5')
|
|
274
|
+
})
|
|
224
275
|
})
|
|
@@ -6,6 +6,7 @@ exports[`VTextarea.ts should calculate element height when using auto-grow prop
|
|
|
6
6
|
<div class="v-input__slot">
|
|
7
7
|
<div class="v-text-field__slot">
|
|
8
8
|
<textarea id="input-1"
|
|
9
|
+
rows="5"
|
|
9
10
|
value="this
|
|
10
11
|
is
|
|
11
12
|
a
|
|
@@ -34,3 +35,87 @@ maybe?"
|
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
36
37
|
`;
|
|
38
|
+
|
|
39
|
+
exports[`VTextarea.ts should render with custom rows attribute 1`] = `
|
|
40
|
+
<div class="v-input v-textarea theme--light v-text-field">
|
|
41
|
+
<div class="v-input__control">
|
|
42
|
+
<div class="v-input__slot">
|
|
43
|
+
<div class="v-text-field__slot">
|
|
44
|
+
<textarea id="input-45"
|
|
45
|
+
rows="3"
|
|
46
|
+
>
|
|
47
|
+
</textarea>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="v-text-field__details">
|
|
51
|
+
<div class="v-messages theme--light">
|
|
52
|
+
<div class="v-messages__wrapper">
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
exports[`VTextarea.ts should render with default rows attribute 1`] = `
|
|
61
|
+
<div class="v-input v-textarea theme--light v-text-field">
|
|
62
|
+
<div class="v-input__control">
|
|
63
|
+
<div class="v-input__slot">
|
|
64
|
+
<div class="v-text-field__slot">
|
|
65
|
+
<textarea id="input-41"
|
|
66
|
+
rows="5"
|
|
67
|
+
>
|
|
68
|
+
</textarea>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="v-text-field__details">
|
|
72
|
+
<div class="v-messages theme--light">
|
|
73
|
+
<div class="v-messages__wrapper">
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
exports[`VTextarea.ts should render with rows and autoGrow 1`] = `
|
|
82
|
+
<div class="v-input v-textarea v-textarea--auto-grow v-textarea--no-resize theme--light v-text-field">
|
|
83
|
+
<div class="v-input__control">
|
|
84
|
+
<div class="v-input__slot">
|
|
85
|
+
<div class="v-text-field__slot">
|
|
86
|
+
<textarea id="input-53"
|
|
87
|
+
rows="7"
|
|
88
|
+
>
|
|
89
|
+
</textarea>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="v-text-field__details">
|
|
93
|
+
<div class="v-messages theme--light">
|
|
94
|
+
<div class="v-messages__wrapper">
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
`;
|
|
101
|
+
|
|
102
|
+
exports[`VTextarea.ts should render with rows as string 1`] = `
|
|
103
|
+
<div class="v-input v-textarea theme--light v-text-field">
|
|
104
|
+
<div class="v-input__control">
|
|
105
|
+
<div class="v-input__slot">
|
|
106
|
+
<div class="v-text-field__slot">
|
|
107
|
+
<textarea id="input-49"
|
|
108
|
+
rows="10"
|
|
109
|
+
>
|
|
110
|
+
</textarea>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="v-text-field__details">
|
|
114
|
+
<div class="v-messages theme--light">
|
|
115
|
+
<div class="v-messages__wrapper">
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
`;
|
|
@@ -17,27 +17,9 @@ const defaultSlot = () => h('div', 'foobar')
|
|
|
17
17
|
const Mock = defineComponent({
|
|
18
18
|
name: 'test',
|
|
19
19
|
|
|
20
|
-
render() {
|
|
20
|
+
render () {
|
|
21
21
|
return h(VTreeviewNode, {
|
|
22
|
-
|
|
23
|
-
prepend: defaultSlot,
|
|
24
|
-
append: defaultSlot,
|
|
25
|
-
},
|
|
26
|
-
})
|
|
27
|
-
},
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
const MockScopedLabel = defineComponent({
|
|
31
|
-
name: 'test',
|
|
32
|
-
|
|
33
|
-
render() {
|
|
34
|
-
return h(VTreeviewNode, {
|
|
35
|
-
props: {
|
|
36
|
-
item: singleRootTwoChildren,
|
|
37
|
-
},
|
|
38
|
-
slots: {
|
|
39
|
-
label: (props: any) => h('div', [props.item.name.toUpperCase()]),
|
|
40
|
-
},
|
|
22
|
+
item: singleRootTwoChildren,
|
|
41
23
|
})
|
|
42
24
|
},
|
|
43
25
|
})
|
|
@@ -85,14 +67,20 @@ describe('VTreeViewNode.ts', () => {
|
|
|
85
67
|
expect(wrapper.vm.computedIcon).toBe('$checkboxOff')
|
|
86
68
|
|
|
87
69
|
// В Vue 3 нужно использовать другой подход для изменения внутренних данных
|
|
88
|
-
wrapper.
|
|
89
|
-
await wrapper.vm.$nextTick()
|
|
70
|
+
await wrapper.setData({ isIndeterminate: true })
|
|
90
71
|
|
|
91
72
|
expect(wrapper.vm.computedIcon).toBe('$checkboxIndeterminate')
|
|
92
73
|
})
|
|
93
74
|
|
|
94
75
|
it('should use scoped slots', () => {
|
|
95
|
-
const wrapper = mount(
|
|
76
|
+
const wrapper = mount(VTreeviewNode, {
|
|
77
|
+
props: {
|
|
78
|
+
item: singleRootTwoChildren,
|
|
79
|
+
},
|
|
80
|
+
slots: {
|
|
81
|
+
prepend: defaultSlot,
|
|
82
|
+
append: defaultSlot,
|
|
83
|
+
},
|
|
96
84
|
global: {
|
|
97
85
|
provide: { treeview },
|
|
98
86
|
},
|
|
@@ -110,7 +98,13 @@ describe('VTreeViewNode.ts', () => {
|
|
|
110
98
|
})
|
|
111
99
|
|
|
112
100
|
it('should use label slot', () => {
|
|
113
|
-
const wrapper = mount(
|
|
101
|
+
const wrapper = mount(VTreeviewNode, {
|
|
102
|
+
props: {
|
|
103
|
+
item: singleRootTwoChildren,
|
|
104
|
+
},
|
|
105
|
+
slots: {
|
|
106
|
+
label: (props: any) => h('div', [props.item.name.toUpperCase()]),
|
|
107
|
+
},
|
|
114
108
|
global: {
|
|
115
109
|
provide: { treeview },
|
|
116
110
|
},
|
|
@@ -120,23 +114,14 @@ describe('VTreeViewNode.ts', () => {
|
|
|
120
114
|
})
|
|
121
115
|
|
|
122
116
|
it('should render disabled item', () => {
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
append: defaultSlot,
|
|
131
|
-
},
|
|
132
|
-
props: {
|
|
133
|
-
item: { ...singleRootTwoChildren, disabled: true },
|
|
134
|
-
},
|
|
135
|
-
})
|
|
117
|
+
const wrapper = mount(VTreeviewNode, {
|
|
118
|
+
props: {
|
|
119
|
+
item: { ...singleRootTwoChildren, disabled: true },
|
|
120
|
+
},
|
|
121
|
+
slots: {
|
|
122
|
+
prepend: defaultSlot,
|
|
123
|
+
append: defaultSlot,
|
|
136
124
|
},
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
const wrapper = mount(TestComponent, {
|
|
140
125
|
global: {
|
|
141
126
|
provide: { treeview },
|
|
142
127
|
},
|
|
@@ -146,7 +131,7 @@ describe('VTreeViewNode.ts', () => {
|
|
|
146
131
|
})
|
|
147
132
|
|
|
148
133
|
const singleRootWithEmptyChildrens = { id: 1, name: 'Child', children: [] }
|
|
149
|
-
it('should be able to have active children with empty array', () => {
|
|
134
|
+
it('should be able to have active children with empty array', async () => {
|
|
150
135
|
const wrapper = mountFunction({
|
|
151
136
|
props: {
|
|
152
137
|
item: singleRootWithEmptyChildrens,
|
|
@@ -157,13 +142,13 @@ describe('VTreeViewNode.ts', () => {
|
|
|
157
142
|
|
|
158
143
|
expect(wrapper.vm.isActive).toBe(false)
|
|
159
144
|
const selectedLeaf = wrapper.find('.v-treeview-node__root')
|
|
160
|
-
selectedLeaf.trigger('click')
|
|
145
|
+
await selectedLeaf.trigger('click')
|
|
161
146
|
expect(wrapper.vm.isActive).toBe(true)
|
|
162
147
|
|
|
163
148
|
expect(wrapper.html()).toMatchSnapshot()
|
|
164
149
|
})
|
|
165
150
|
|
|
166
|
-
it('should not be able to have active children with empty array when loadChildren is specified', () => {
|
|
151
|
+
it('should not be able to have active children with empty array when loadChildren is specified', async () => {
|
|
167
152
|
const wrapper = mountFunction({
|
|
168
153
|
props: {
|
|
169
154
|
item: singleRootWithEmptyChildrens,
|
|
@@ -175,13 +160,13 @@ describe('VTreeViewNode.ts', () => {
|
|
|
175
160
|
|
|
176
161
|
expect(wrapper.vm.isActive).toBe(false)
|
|
177
162
|
const selectedLeaf = wrapper.find('.v-treeview-node__root')
|
|
178
|
-
selectedLeaf.trigger('click')
|
|
163
|
+
await selectedLeaf.trigger('click')
|
|
179
164
|
expect(wrapper.vm.isActive).toBe(false)
|
|
180
165
|
|
|
181
166
|
expect(wrapper.html()).toMatchSnapshot()
|
|
182
167
|
})
|
|
183
168
|
|
|
184
|
-
it('should not be able to have active children with empty array when disabled', () => {
|
|
169
|
+
it('should not be able to have active children with empty array when disabled', async () => {
|
|
185
170
|
const wrapper = mountFunction({
|
|
186
171
|
props: {
|
|
187
172
|
item: { ...singleRootWithEmptyChildrens, disabled: true },
|
|
@@ -192,7 +177,7 @@ describe('VTreeViewNode.ts', () => {
|
|
|
192
177
|
|
|
193
178
|
expect(wrapper.vm.isActive).toBe(false)
|
|
194
179
|
const selectedLeaf = wrapper.find('.v-treeview-node__root')
|
|
195
|
-
selectedLeaf.trigger('click')
|
|
180
|
+
await selectedLeaf.trigger('click')
|
|
196
181
|
expect(wrapper.vm.isActive).toBe(false)
|
|
197
182
|
|
|
198
183
|
expect(wrapper.html()).toMatchSnapshot()
|