@dimailn/vuetify 2.7.2-alpha35 → 2.7.2-alpha36

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.
Files changed (44) hide show
  1. package/dist/vuetify.js +37 -37
  2. package/dist/vuetify.js.map +1 -1
  3. package/dist/vuetify.min.css +1 -1
  4. package/dist/vuetify.min.js +2 -2
  5. package/es5/components/VBottomNavigation/VBottomNavigation.js +3 -7
  6. package/es5/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  7. package/es5/components/VSelect/VSelect.js +1 -1
  8. package/es5/components/VSelect/VSelect.js.map +1 -1
  9. package/es5/components/VSlideGroup/VSlideGroup.js +32 -33
  10. package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
  11. package/es5/components/VStepper/VStepperContent.js +5 -3
  12. package/es5/components/VStepper/VStepperContent.js.map +1 -1
  13. package/es5/components/VTextarea/VTextarea.js +1 -1
  14. package/es5/components/VTextarea/VTextarea.js.map +1 -1
  15. package/es5/framework.js +1 -1
  16. package/es5/mixins/proxyable/index.js +5 -2
  17. package/es5/mixins/proxyable/index.js.map +1 -1
  18. package/lib/components/VBottomNavigation/VBottomNavigation.js +4 -8
  19. package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  20. package/lib/components/VSelect/VSelect.js +1 -1
  21. package/lib/components/VSelect/VSelect.js.map +1 -1
  22. package/lib/components/VSlideGroup/VSlideGroup.js +21 -18
  23. package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
  24. package/lib/components/VStepper/VStepperContent.js +6 -4
  25. package/lib/components/VStepper/VStepperContent.js.map +1 -1
  26. package/lib/components/VTextarea/VTextarea.js +1 -1
  27. package/lib/components/VTextarea/VTextarea.js.map +1 -1
  28. package/lib/framework.js +1 -1
  29. package/lib/mixins/proxyable/index.js +5 -2
  30. package/lib/mixins/proxyable/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/components/VBottomNavigation/VBottomNavigation.ts +9 -9
  33. package/src/components/VBottomNavigation/__tests__/__snapshots__/VBottomNavigation.spec.ts.snap +0 -1
  34. package/src/components/VExpansionPanel/__tests__/VExpansionPanel.spec.ts +2 -2
  35. package/src/components/VExpansionPanel/__tests__/__snapshots__/VExpansionPanel.spec.ts.snap +6 -7
  36. package/src/components/VSelect/VSelect.ts +1 -1
  37. package/src/components/VSlideGroup/VSlideGroup.ts +33 -19
  38. package/src/components/VStepper/VStepperContent.ts +8 -9
  39. package/src/components/VTextarea/VTextarea.ts +1 -1
  40. package/src/components/VTextarea/__tests__/VTextarea.spec.ts +51 -0
  41. package/src/components/VTextarea/__tests__/__snapshots__/VTextarea.spec.ts.snap +85 -0
  42. package/src/components/VTreeview/__tests__/VTreeviewNode.spec.ts +31 -46
  43. package/src/components/VTreeview/__tests__/__snapshots__/VTreeviewNode.spec.ts.snap +48 -17
  44. package/src/mixins/proxyable/index.ts +4 -1
@@ -22,8 +22,11 @@ export function factory(prop = 'modelValue', event = 'update:modelValue') {
22
22
 
23
23
  set(val) {
24
24
  if (val === this.internalLazyValue) return;
25
- this.internalLazyValue = val;
26
- this.$emit(event, val);
25
+ this.internalLazyValue = val; // Don't emit events if component is being destroyed
26
+
27
+ if (!this._isDestroyed) {
28
+ this.$emit(event, val);
29
+ }
27
30
  }
28
31
 
29
32
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/mixins/proxyable/index.ts"],"names":[],"mappings":"AAAA,SAAS,eAAT,QAAgD,KAAhD;AAQA,OAAM,SAAU,OAAV,CACJ,IAAI,GAAG,YADH,EAEJ,KAAK,GAAG,mBAFJ,EAEuB;AAE3B,SAAO,eAAe,CAAC;AACrB,IAAA,IAAI,EAAE,WADe;AAGrB,IAAA,KAAK,EAAE;AACL,OAAC,IAAD,GAAQ;AACN,QAAA,QAAQ,EAAE;AADJ;AADH,KAHc;;AASrB,IAAA,IAAI,GAAA;AACF,aAAO;AACL,QAAA,iBAAiB,EAAE,KAAK,IAAL;AADd,OAAP;AAGD,KAboB;;AAerB,IAAA,QAAQ,EAAE;AACR,MAAA,aAAa,EAAE;AACb,QAAA,GAAG,GAAA;AACD,iBAAO,KAAK,iBAAZ;AACD,SAHY;;AAIb,QAAA,GAAG,CAAE,GAAF,EAAU;AACX,cAAI,GAAG,KAAK,KAAK,iBAAjB,EAAoC;AAEpC,eAAK,iBAAL,GAAyB,GAAzB;AAEA,eAAK,KAAL,CAAW,KAAX,EAAkB,GAAlB;AACD;;AAVY;AADP,KAfW;AA8BrB,IAAA,KAAK,EAAE;AACL,OAAC,IAAD,EAAQ,GAAR,EAAW;AACT,aAAK,iBAAL,GAAyB,GAAzB;AACD;;AAHI;AA9Bc,GAAD,CAAtB;AAoCD;AAED;;AACA,MAAM,SAAS,GAAG,OAAO,EAAzB;AAEA,eAAe,SAAf","sourcesContent":["import { defineComponent, Component, App } from 'vue'\n\nexport type Proxyable<T extends string = 'value'> = Component<App & {\n internalLazyValue: unknown\n internalValue: unknown\n} & Record<T, any>>\n\nexport function factory<T extends string = 'value'> (prop?: T, event?: string): Proxyable<T>\nexport function factory (\n prop = 'modelValue',\n event = 'update:modelValue'\n) {\n return defineComponent({\n name: 'proxyable',\n\n props: {\n [prop]: {\n required: false,\n },\n },\n\n data () {\n return {\n internalLazyValue: this[prop] as unknown,\n }\n },\n\n computed: {\n internalValue: {\n get (): unknown {\n return this.internalLazyValue\n },\n set (val: any) {\n if (val === this.internalLazyValue) return\n\n this.internalLazyValue = val\n\n this.$emit(event, val)\n },\n },\n },\n\n watch: {\n [prop] (val) {\n this.internalLazyValue = val\n },\n },\n })\n}\n\n/* eslint-disable-next-line @typescript-eslint/no-redeclare */\nconst Proxyable = factory()\n\nexport default Proxyable\n"],"sourceRoot":"","file":"index.js"}
1
+ {"version":3,"sources":["../../../src/mixins/proxyable/index.ts"],"names":[],"mappings":"AAAA,SAAS,eAAT,QAAgD,KAAhD;AAQA,OAAM,SAAU,OAAV,CACJ,IAAI,GAAG,YADH,EAEJ,KAAK,GAAG,mBAFJ,EAEuB;AAE3B,SAAO,eAAe,CAAC;AACrB,IAAA,IAAI,EAAE,WADe;AAGrB,IAAA,KAAK,EAAE;AACL,OAAC,IAAD,GAAQ;AACN,QAAA,QAAQ,EAAE;AADJ;AADH,KAHc;;AASrB,IAAA,IAAI,GAAA;AACF,aAAO;AACL,QAAA,iBAAiB,EAAE,KAAK,IAAL;AADd,OAAP;AAGD,KAboB;;AAerB,IAAA,QAAQ,EAAE;AACR,MAAA,aAAa,EAAE;AACb,QAAA,GAAG,GAAA;AACD,iBAAO,KAAK,iBAAZ;AACD,SAHY;;AAIb,QAAA,GAAG,CAAE,GAAF,EAAU;AACX,cAAI,GAAG,KAAK,KAAK,iBAAjB,EAAoC;AAEpC,eAAK,iBAAL,GAAyB,GAAzB,CAHW,CAKX;;AACA,cAAI,CAAE,KAAa,YAAnB,EAAiC;AAC/B,iBAAK,KAAL,CAAW,KAAX,EAAkB,GAAlB;AACD;AACF;;AAbY;AADP,KAfW;AAiCrB,IAAA,KAAK,EAAE;AACL,OAAC,IAAD,EAAQ,GAAR,EAAW;AACT,aAAK,iBAAL,GAAyB,GAAzB;AACD;;AAHI;AAjCc,GAAD,CAAtB;AAuCD;AAED;;AACA,MAAM,SAAS,GAAG,OAAO,EAAzB;AAEA,eAAe,SAAf","sourcesContent":["import { defineComponent, Component, App } from 'vue'\n\nexport type Proxyable<T extends string = 'value'> = Component<App & {\n internalLazyValue: unknown\n internalValue: unknown\n} & Record<T, any>>\n\nexport function factory<T extends string = 'value'> (prop?: T, event?: string): Proxyable<T>\nexport function factory (\n prop = 'modelValue',\n event = 'update:modelValue'\n) {\n return defineComponent({\n name: 'proxyable',\n\n props: {\n [prop]: {\n required: false,\n },\n },\n\n data () {\n return {\n internalLazyValue: this[prop] as unknown,\n }\n },\n\n computed: {\n internalValue: {\n get (): unknown {\n return this.internalLazyValue\n },\n set (val: any) {\n if (val === this.internalLazyValue) return\n\n this.internalLazyValue = val\n\n // Don't emit events if component is being destroyed\n if (!(this as any)._isDestroyed) {\n this.$emit(event, val)\n }\n },\n },\n },\n\n watch: {\n [prop] (val) {\n this.internalLazyValue = val\n },\n },\n })\n}\n\n/* eslint-disable-next-line @typescript-eslint/no-redeclare */\nconst Proxyable = factory()\n\nexport default Proxyable\n"],"sourceRoot":"","file":"index.js"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dimailn/vuetify",
3
3
  "description": "Vue Material Component Framework",
4
- "version": "2.7.2-alpha35",
4
+ "version": "2.7.2-alpha36",
5
5
  "author": {
6
6
  "name": "John Leider",
7
7
  "email": "john@vuetifyjs.com"
@@ -1,4 +1,4 @@
1
- import {h} from 'vue'
1
+ import {h, withDirectives} from 'vue'
2
2
  // Styles
3
3
  import './VBottomNavigation.sass'
4
4
 
@@ -153,16 +153,16 @@ export default mixins(
153
153
  onChange: this.updateValue
154
154
  })
155
155
 
156
- if (this.canScroll) {
157
- data.directives = data.directives || []
156
+ const vnode = h(ButtonGroup, this.setTextColor(this.color, data), getSlot(this))
158
157
 
159
- data.directives.push({
160
- arg: this.scrollTarget,
161
- name: 'scroll',
162
- value: this.onScroll,
163
- })
158
+ if (this.canScroll) {
159
+ return withDirectives(vnode, [[
160
+ 'scroll',
161
+ this.onScroll,
162
+ this.scrollTarget
163
+ ]])
164
164
  }
165
165
 
166
- return h(ButtonGroup, this.setTextColor(this.color, data), getSlot(this))
166
+ return vnode
167
167
  },
168
168
  })
@@ -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"
@@ -26,7 +26,7 @@ describe('VExpansionPanel', () => {
26
26
  VExpansionPanelHeader,
27
27
  {
28
28
  render: () => h(VExpansionPanelContent, {
29
- props: { eager: true },
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
- props: { hideActions: true },
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
  `;
@@ -631,7 +631,7 @@ export default baseMixins.extend({
631
631
  parent: this,
632
632
  item,
633
633
  index,
634
- select: (e: Event) => {
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 Vue, { VNode, defineComponent } from 'vue'
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 extends Vue {
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.scrollLeft = 0
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, () => [this.genIcon(location)])
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
  },
@@ -377,7 +379,9 @@ export const BaseSlideGroup = mixins<options &
377
379
  this.setWidths()
378
380
  },
379
381
  onTouchStart (e: TouchEvent) {
380
- const { content } = this.$refs
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 { content, wrapper } = this.$refs
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 wrapperPosition = this.$refs.wrapper.getBoundingClientRect()
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) ||
@@ -484,11 +495,14 @@ export const BaseSlideGroup = mixins<options &
484
495
  window.requestAnimationFrame(() => {
485
496
  if (this._isDestroyed) return
486
497
 
487
- const { content, wrapper } = this.$refs
498
+ const content = this.$refs.content as HTMLElement
499
+ const wrapper = this.$refs.wrapper as HTMLElement
500
+
501
+ if (!content || !wrapper) return
488
502
 
489
503
  this.widths = {
490
- content: content ? content.clientWidth : 0,
491
- wrapper: wrapper ? wrapper.clientWidth : 0,
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
- contentData.directives = [
154
- [
155
- vShow,
156
- this.isActive,
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])
@@ -95,7 +95,7 @@ export default baseMixins.extend({
95
95
  input.tag = 'textarea'
96
96
  input.type = 'textarea'
97
97
  delete input.props.type
98
- input.rows = this.rows
98
+ input.props.rows = this.rows
99
99
 
100
100
  return input
101
101
  },
@@ -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
- slots: {
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.vm.isIndeterminate = true
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(Mock, {
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(MockScopedLabel, {
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 TestComponent = defineComponent({
124
- name: 'test',
125
-
126
- render() {
127
- return h(VTreeviewNode, {
128
- slots: {
129
- prepend: defaultSlot,
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()