vuetify 2.5.13 → 2.6.1

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 (225) hide show
  1. package/dist/json/attributes.json +188 -0
  2. package/dist/json/tags.json +86 -20
  3. package/dist/json/web-types.json +697 -139
  4. package/dist/vuetify.css +136 -5
  5. package/dist/vuetify.css.map +1 -1
  6. package/dist/vuetify.js +927 -304
  7. package/dist/vuetify.js.map +1 -1
  8. package/dist/vuetify.min.css +2 -2
  9. package/dist/vuetify.min.js +2 -2
  10. package/es5/components/VAutocomplete/VAutocomplete.js +1 -0
  11. package/es5/components/VAutocomplete/VAutocomplete.js.map +1 -1
  12. package/es5/components/VBanner/VBanner.js +3 -2
  13. package/es5/components/VBanner/VBanner.js.map +1 -1
  14. package/es5/components/VBottomSheet/VBottomSheet.js +1 -4
  15. package/es5/components/VBottomSheet/VBottomSheet.js.map +1 -1
  16. package/es5/components/VCalendar/VCalendar.js +2 -2
  17. package/es5/components/VCalendar/VCalendar.js.map +1 -1
  18. package/es5/components/VCalendar/VCalendarDaily.js +16 -8
  19. package/es5/components/VCalendar/VCalendarDaily.js.map +1 -1
  20. package/es5/components/VCalendar/VCalendarWeekly.js +14 -10
  21. package/es5/components/VCalendar/VCalendarWeekly.js.map +1 -1
  22. package/es5/components/VCalendar/mixins/calendar-with-events.js +19 -20
  23. package/es5/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  24. package/es5/components/VCalendar/mixins/mouse.js +13 -4
  25. package/es5/components/VCalendar/mixins/mouse.js.map +1 -1
  26. package/es5/components/VDataTable/MobileRow.js +2 -2
  27. package/es5/components/VDataTable/MobileRow.js.map +1 -1
  28. package/es5/components/VDataTable/Row.js +25 -9
  29. package/es5/components/VDataTable/Row.js.map +1 -1
  30. package/es5/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
  31. package/es5/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  32. package/es5/components/VDatePicker/mixins/date-picker-table.js +13 -3
  33. package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  34. package/es5/components/VDialog/VDialog.js +4 -10
  35. package/es5/components/VDialog/VDialog.js.map +1 -1
  36. package/es5/components/VInput/VInput.js +3 -1
  37. package/es5/components/VInput/VInput.js.map +1 -1
  38. package/es5/components/VItemGroup/VItemGroup.js +8 -4
  39. package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
  40. package/es5/components/VMenu/VMenu.js +1 -1
  41. package/es5/components/VMenu/VMenu.js.map +1 -1
  42. package/es5/components/VOtpInput/VOtpInput.js +375 -0
  43. package/es5/components/VOtpInput/VOtpInput.js.map +1 -0
  44. package/es5/components/VOtpInput/index.js +20 -0
  45. package/es5/components/VOtpInput/index.js.map +1 -0
  46. package/es5/components/VRadioGroup/VRadioGroup.js +1 -3
  47. package/es5/components/VRadioGroup/VRadioGroup.js.map +1 -1
  48. package/es5/components/VSlideGroup/VSlideGroup.js +8 -1
  49. package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
  50. package/es5/components/VSnackbar/VSnackbar.js +4 -8
  51. package/es5/components/VSnackbar/VSnackbar.js.map +1 -1
  52. package/es5/components/VTabs/VTab.js +3 -2
  53. package/es5/components/VTabs/VTab.js.map +1 -1
  54. package/es5/components/VTextField/VTextField.js +6 -1
  55. package/es5/components/VTextField/VTextField.js.map +1 -1
  56. package/es5/components/VTooltip/VTooltip.js +0 -1
  57. package/es5/components/VTooltip/VTooltip.js.map +1 -1
  58. package/es5/components/VTreeview/VTreeview.js +2 -1
  59. package/es5/components/VTreeview/VTreeview.js.map +1 -1
  60. package/es5/components/VTreeview/VTreeviewNode.js +3 -1
  61. package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
  62. package/es5/components/index.js +13 -0
  63. package/es5/components/index.js.map +1 -1
  64. package/es5/directives/click-outside/index.js +3 -1
  65. package/es5/directives/click-outside/index.js.map +1 -1
  66. package/es5/directives/intersect/index.js +8 -5
  67. package/es5/directives/intersect/index.js.map +1 -1
  68. package/es5/directives/mutate/index.js +3 -2
  69. package/es5/directives/mutate/index.js.map +1 -1
  70. package/es5/directives/resize/index.js +3 -1
  71. package/es5/directives/resize/index.js.map +1 -1
  72. package/es5/directives/ripple/index.js +0 -7
  73. package/es5/directives/ripple/index.js.map +1 -1
  74. package/es5/directives/scroll/index.js.map +1 -1
  75. package/es5/framework.js +1 -1
  76. package/es5/locale/da.js +77 -0
  77. package/es5/locale/da.js.map +1 -0
  78. package/es5/locale/index.js +8 -0
  79. package/es5/locale/index.js.map +1 -1
  80. package/es5/locale/it.js +6 -6
  81. package/es5/locale/it.js.map +1 -1
  82. package/es5/mixins/intersectable/index.js +6 -0
  83. package/es5/mixins/intersectable/index.js.map +1 -1
  84. package/es5/mixins/routable/index.js +2 -5
  85. package/es5/mixins/routable/index.js.map +1 -1
  86. package/es5/util/helpers.js +13 -6
  87. package/es5/util/helpers.js.map +1 -1
  88. package/lib/components/VAutocomplete/VAutocomplete.js +1 -0
  89. package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
  90. package/lib/components/VBanner/VBanner.js +3 -2
  91. package/lib/components/VBanner/VBanner.js.map +1 -1
  92. package/lib/components/VBottomSheet/VBottomSheet.js +1 -4
  93. package/lib/components/VBottomSheet/VBottomSheet.js.map +1 -1
  94. package/lib/components/VCalendar/VCalendar.js +2 -2
  95. package/lib/components/VCalendar/VCalendar.js.map +1 -1
  96. package/lib/components/VCalendar/VCalendarDaily.js +20 -8
  97. package/lib/components/VCalendar/VCalendarDaily.js.map +1 -1
  98. package/lib/components/VCalendar/VCalendarWeekly.js +10 -2
  99. package/lib/components/VCalendar/VCalendarWeekly.js.map +1 -1
  100. package/lib/components/VCalendar/mixins/calendar-with-events.js +6 -3
  101. package/lib/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  102. package/lib/components/VCalendar/mixins/mouse.js +9 -4
  103. package/lib/components/VCalendar/mixins/mouse.js.map +1 -1
  104. package/lib/components/VDataTable/MobileRow.js +2 -2
  105. package/lib/components/VDataTable/MobileRow.js.map +1 -1
  106. package/lib/components/VDataTable/Row.js +15 -8
  107. package/lib/components/VDataTable/Row.js.map +1 -1
  108. package/lib/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
  109. package/lib/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  110. package/lib/components/VDatePicker/mixins/date-picker-table.js +12 -2
  111. package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  112. package/lib/components/VDialog/VDialog.js +4 -10
  113. package/lib/components/VDialog/VDialog.js.map +1 -1
  114. package/lib/components/VInput/VInput.js +2 -0
  115. package/lib/components/VInput/VInput.js.map +1 -1
  116. package/lib/components/VItemGroup/VItemGroup.js +7 -5
  117. package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
  118. package/lib/components/VMenu/VMenu.js +1 -1
  119. package/lib/components/VMenu/VMenu.js.map +1 -1
  120. package/lib/components/VOtpInput/VOtpInput.js +342 -0
  121. package/lib/components/VOtpInput/VOtpInput.js.map +1 -0
  122. package/lib/components/VOtpInput/index.js +4 -0
  123. package/lib/components/VOtpInput/index.js.map +1 -0
  124. package/lib/components/VRadioGroup/VRadioGroup.js +2 -4
  125. package/lib/components/VRadioGroup/VRadioGroup.js.map +1 -1
  126. package/lib/components/VSlideGroup/VSlideGroup.js +9 -1
  127. package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
  128. package/lib/components/VSnackbar/VSnackbar.js +4 -8
  129. package/lib/components/VSnackbar/VSnackbar.js.map +1 -1
  130. package/lib/components/VTabs/VTab.js +3 -2
  131. package/lib/components/VTabs/VTab.js.map +1 -1
  132. package/lib/components/VTextField/VTextField.js +8 -1
  133. package/lib/components/VTextField/VTextField.js.map +1 -1
  134. package/lib/components/VTooltip/VTooltip.js +0 -1
  135. package/lib/components/VTooltip/VTooltip.js.map +1 -1
  136. package/lib/components/VTreeview/VTreeview.js +2 -1
  137. package/lib/components/VTreeview/VTreeview.js.map +1 -1
  138. package/lib/components/VTreeview/VTreeviewNode.js +3 -1
  139. package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
  140. package/lib/components/index.js +1 -0
  141. package/lib/components/index.js.map +1 -1
  142. package/lib/directives/click-outside/index.js +3 -1
  143. package/lib/directives/click-outside/index.js.map +1 -1
  144. package/lib/directives/intersect/index.js +7 -5
  145. package/lib/directives/intersect/index.js.map +1 -1
  146. package/lib/directives/mutate/index.js +3 -2
  147. package/lib/directives/mutate/index.js.map +1 -1
  148. package/lib/directives/resize/index.js +3 -1
  149. package/lib/directives/resize/index.js.map +1 -1
  150. package/lib/directives/ripple/index.js +0 -7
  151. package/lib/directives/ripple/index.js.map +1 -1
  152. package/lib/directives/scroll/index.js.map +1 -1
  153. package/lib/framework.js +1 -1
  154. package/lib/locale/da.js +70 -0
  155. package/lib/locale/da.js.map +1 -0
  156. package/lib/locale/index.js +1 -0
  157. package/lib/locale/index.js.map +1 -1
  158. package/lib/locale/it.js +6 -6
  159. package/lib/locale/it.js.map +1 -1
  160. package/lib/mixins/intersectable/index.js +4 -0
  161. package/lib/mixins/intersectable/index.js.map +1 -1
  162. package/lib/mixins/routable/index.js +3 -5
  163. package/lib/mixins/routable/index.js.map +1 -1
  164. package/lib/util/helpers.js +13 -6
  165. package/lib/util/helpers.js.map +1 -1
  166. package/package.json +2 -2
  167. package/src/components/VAutocomplete/VAutocomplete.ts +2 -0
  168. package/src/components/VAutocomplete/__tests__/VAutocomplete3.spec.ts +16 -0
  169. package/src/components/VBanner/VBanner.ts +16 -10
  170. package/src/components/VBottomSheet/VBottomSheet.ts +1 -4
  171. package/src/components/VCalendar/VCalendar.ts +3 -2
  172. package/src/components/VCalendar/VCalendarCategory.sass +67 -0
  173. package/src/components/VCalendar/VCalendarDaily.ts +9 -8
  174. package/src/components/VCalendar/VCalendarWeekly.ts +4 -2
  175. package/src/components/VCalendar/_variables.scss +4 -0
  176. package/src/components/VCalendar/mixins/calendar-with-events.ts +4 -3
  177. package/src/components/VCalendar/mixins/mouse.ts +10 -4
  178. package/src/components/VDataTable/MobileRow.ts +2 -2
  179. package/src/components/VDataTable/Row.ts +23 -16
  180. package/src/components/VDataTable/VDataTableHeaderDesktop.ts +1 -1
  181. package/src/components/VDatePicker/__tests__/VDatePicker.date.spec.ts +16 -0
  182. package/src/components/VDatePicker/__tests__/VDatePicker.month.spec.ts +16 -0
  183. package/src/components/VDatePicker/mixins/date-picker-table.ts +24 -2
  184. package/src/components/VDialog/VDialog.ts +4 -10
  185. package/src/components/VInput/VInput.sass +8 -0
  186. package/src/components/VInput/VInput.ts +2 -0
  187. package/src/components/VItemGroup/VItemGroup.ts +5 -3
  188. package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +19 -2
  189. package/src/components/VMenu/VMenu.ts +1 -1
  190. package/src/components/VOtpInput/VOtpInput.sass +37 -0
  191. package/src/components/VOtpInput/VOtpInput.ts +322 -0
  192. package/src/components/VOtpInput/__tests__/VOtpInput.spec.ts +294 -0
  193. package/src/components/VOtpInput/_variables.scss +4 -0
  194. package/src/components/VOtpInput/index.ts +4 -0
  195. package/src/components/VRadioGroup/VRadioGroup.ts +0 -4
  196. package/src/components/VSlideGroup/VSlideGroup.ts +14 -1
  197. package/src/components/VSnackbar/VSnackbar.ts +3 -7
  198. package/src/components/VSnackbar/__tests__/VSnackbar.spec.ts +4 -1
  199. package/src/components/VStepper/VStepper.sass +4 -4
  200. package/src/components/VTabs/VTab.ts +10 -2
  201. package/src/components/VTextField/VTextField.ts +8 -3
  202. package/src/components/VTooltip/VTooltip.sass +4 -1
  203. package/src/components/VTooltip/VTooltip.ts +0 -1
  204. package/src/components/VTooltip/_variables.scss +1 -0
  205. package/src/components/VTreeview/VTreeview.ts +2 -1
  206. package/src/components/VTreeview/VTreeviewNode.ts +3 -1
  207. package/src/components/index.ts +1 -0
  208. package/src/directives/click-outside/index.ts +2 -2
  209. package/src/directives/intersect/index.ts +6 -5
  210. package/src/directives/mutate/index.ts +2 -3
  211. package/src/directives/resize/index.ts +2 -2
  212. package/src/directives/ripple/VRipple.sass +4 -1
  213. package/src/directives/ripple/index.ts +0 -7
  214. package/src/directives/scroll/index.ts +1 -1
  215. package/src/globals.d.ts +5 -5
  216. package/src/locale/da.ts +69 -0
  217. package/src/locale/index.ts +1 -0
  218. package/src/locale/it.ts +6 -6
  219. package/src/mixins/intersectable/index.ts +6 -0
  220. package/src/mixins/routable/index.ts +1 -4
  221. package/src/styles/settings/_variables.scss +4 -3
  222. package/src/util/__tests__/__snapshots__/helpers.spec.ts.snap +11 -0
  223. package/src/util/__tests__/helpers.spec.ts +17 -0
  224. package/src/util/helpers.ts +14 -7
  225. package/src/directives/ripple/_variables.scss +0 -6
@@ -7,21 +7,88 @@
7
7
  border-right: map-deep-get($material, 'calendar', 'line-color') $calendar-line-width solid
8
8
 
9
9
  .v-calendar-category
10
+ overflow: auto
11
+ position: relative
12
+
10
13
  .v-calendar-category__category
11
14
  text-align: center
12
15
 
13
16
  .v-calendar-daily__day-container
17
+ width: min-content
14
18
  .v-calendar-category__columns
15
19
  position: absolute
16
20
  height: 100%
17
21
  width: 100%
18
22
  top: 0
19
23
 
24
+ .v-calendar-daily__day-body
25
+ display: flex
26
+ flex: 1
27
+ width: 100%
28
+ height: 100%
29
+
30
+ .v-calendar-daily__head
31
+ flex-direction: row
32
+ width: min-content
33
+ min-width: 100%
34
+ position: sticky
35
+ top: 0
36
+ background: white
37
+ z-index: 2
38
+
39
+ .v-calendar-daily_head-day
40
+ width: auto
41
+ position: unset
42
+
43
+ .v-calendar-daily__intervals-head
44
+ position: sticky
45
+ left: 0
46
+ top: 0
47
+ background: white
48
+ z-index: 2
49
+
50
+ .v-calendar-daily_head-weekday
51
+ position: sticky
52
+ left: 50%
53
+ width: $calendar-daily-head-weekday-size
54
+
55
+ .v-calendar-daily_head-day-label
56
+ width: $calendar-daily-head-day-label-size
57
+ position: sticky
58
+ left: 50%
59
+
60
+ .v-calendar-daily__day
61
+ min-width: $calendar-category-column-min-width
62
+
63
+ .v-calendar-daily__intervals-body
64
+ position: sticky
65
+ left: 0
66
+ background: white
67
+ z-index: 1
68
+
69
+ .v-calendar-daily__interval
70
+ &:last-of-type::after
71
+ display: none
72
+
73
+ .v-calendar-daily__body
74
+ overflow: visible
75
+ .v-calendar-daily__scroll-area
76
+ overflow-y: visible
77
+ flex: none
78
+
79
+ .v-calendar-daily__pane
80
+ overflow-y: visible
81
+
20
82
  .v-calendar-category__columns
21
83
  display: flex
84
+ width: min-content
85
+ min-width: 100%
22
86
 
23
87
  .v-calendar-category__column,
24
88
  .v-calendar-category__column-header
25
89
  flex: 1 1 auto
26
90
  width: 0
27
91
  position: relative
92
+
93
+ .v-calendar-category__column-header
94
+ min-width: $calendar-category-column-min-width
@@ -82,8 +82,8 @@ export default CalendarWithIntervals.extend({
82
82
  key: day.date,
83
83
  staticClass: 'v-calendar-daily_head-day',
84
84
  class: this.getRelativeClasses(day),
85
- on: this.getDefaultMouseEventHandlers(':day', _e => {
86
- return this.getSlotScope(day)
85
+ on: this.getDefaultMouseEventHandlers(':day', nativeEvent => {
86
+ return { nativeEvent, ...this.getSlotScope(day) }
87
87
  }),
88
88
  }, [
89
89
  this.genHeadWeekday(day),
@@ -120,8 +120,8 @@ export default CalendarWithIntervals.extend({
120
120
  on: this.getMouseEventHandlers({
121
121
  'click:date': { event: 'click', stop: true },
122
122
  'contextmenu:date': { event: 'contextmenu', stop: true, prevent: true, result: false },
123
- }, _e => {
124
- return day
123
+ }, nativeEvent => {
124
+ return { nativeEvent, ...day }
125
125
  }),
126
126
  }, this.dayFormatter(day, false))
127
127
  },
@@ -167,8 +167,8 @@ export default CalendarWithIntervals.extend({
167
167
  key: day.date,
168
168
  staticClass: 'v-calendar-daily__day',
169
169
  class: this.getRelativeClasses(day),
170
- on: this.getDefaultMouseEventHandlers(':time', e => {
171
- return this.getSlotScope(this.getTimestampAtEvent(e, day))
170
+ on: this.getDefaultMouseEventHandlers(':time', nativeEvent => {
171
+ return { nativeEvent, ...this.getSlotScope(this.getTimestampAtEvent(nativeEvent, day)) }
172
172
  }),
173
173
  }, [
174
174
  ...this.genDayIntervals(index),
@@ -192,6 +192,7 @@ export default CalendarWithIntervals.extend({
192
192
  height,
193
193
  ...styler(interval),
194
194
  },
195
+
195
196
  }
196
197
 
197
198
  const children = getSlot(this, 'interval', () => this.getSlotScope(interval))
@@ -205,8 +206,8 @@ export default CalendarWithIntervals.extend({
205
206
  style: {
206
207
  width,
207
208
  },
208
- on: this.getDefaultMouseEventHandlers(':interval', e => {
209
- return this.getTimestampAtEvent(e, this.parsedStart)
209
+ on: this.getDefaultMouseEventHandlers(':interval', nativeEvent => {
210
+ return { nativeEvent, ...this.getTimestampAtEvent(nativeEvent, this.parsedStart) }
210
211
  }),
211
212
  }
212
213
 
@@ -159,7 +159,9 @@ export default CalendarBase.extend({
159
159
  key: day.date,
160
160
  staticClass: 'v-calendar-weekly__day',
161
161
  class: this.getRelativeClasses(day, outside),
162
- on: this.getDefaultMouseEventHandlers(':day', _e => day),
162
+ on: this.getDefaultMouseEventHandlers(':day', nativeEvent => {
163
+ return { nativeEvent, ...day }
164
+ }),
163
165
  }, [
164
166
  this.genDayLabel(day),
165
167
  ...(getSlot(this, 'day', () => ({ outside, index, week, ...day })) || []),
@@ -184,7 +186,7 @@ export default CalendarBase.extend({
184
186
  on: this.getMouseEventHandlers({
185
187
  'click:date': { event: 'click', stop: true },
186
188
  'contextmenu:date': { event: 'contextmenu', stop: true, prevent: true, result: false },
187
- }, _e => day),
189
+ }, nativeEvent => ({ nativeEvent, ...day })),
188
190
  }, hasMonth
189
191
  ? this.monthFormatter(day, this.shortMonths) + ' ' + this.dayFormatter(day, false)
190
192
  : this.dayFormatter(day, false)
@@ -2,6 +2,8 @@
2
2
 
3
3
  $calendar-line-width: 1px !default;
4
4
 
5
+ $calendar-daily-head-day-label-size: 56px !default;
6
+ $calendar-daily-head-weekday-size: 50px !default;
5
7
  $calendar-daily-weekday-padding: 3px 0px 0px 0px !default;
6
8
  $calendar-daily-weekday-font-size: 11px !default;
7
9
  $calendar-daily-day-padding: 0px 0px 3px 0px !default;
@@ -12,6 +14,8 @@ $calendar-daily-interval-gutter-align: right !default;
12
14
  $calendar-daily-interval-gutter-line-width: 8px !default;
13
15
  $calendar-daily-interval-gutter-font-size: 10px !default;
14
16
 
17
+ $calendar-category-column-min-width: 200px !default;
18
+
15
19
  $calendar-weekly-weekday-padding: 0px 4px 0px 4px !default;
16
20
  $calendar-weekly-weekday-font-size: 11px !default;
17
21
  $calendar-weekly-day-padding: 0px 0px 0px 0px !default;
@@ -384,9 +384,10 @@ export default CalendarBase.extend({
384
384
  name: 'ripple',
385
385
  value: this.eventRipple ?? true,
386
386
  }],
387
- on: {
388
- click: () => this.$emit('click:more', day),
389
- },
387
+ on: this.getDefaultMouseEventHandlers(':more', nativeEvent => {
388
+ return { nativeEvent, ...day }
389
+ }),
390
+
390
391
  style: {
391
392
  display: 'none',
392
393
  height: `${eventHeight}px`,
@@ -65,11 +65,17 @@ export default Vue.extend({
65
65
  // Ref: https://developer.mozilla.org/en-US/docs/Web/API/Touch/target
66
66
  // This block of code aims to make sure touchEvent is always dispatched from the element that is being pointed at
67
67
  if (e && 'touches' in e) {
68
- const currentTarget = document.elementFromPoint(e.changedTouches[0].clientX, e.changedTouches[0].clientY)
68
+ const classSeparator = ' '
69
+
70
+ const eventTargetClasses = (e.currentTarget as HTMLElement)?.className.split(classSeparator)
71
+ const currentTargets = document.elementsFromPoint(e.changedTouches[0].clientX, e.changedTouches[0].clientY)
72
+
73
+ // Get "the same kind" current hovering target by checking
74
+ // If element has the same class of initial touch start element (which has touch event listener registered)
75
+ const currentTarget = currentTargets.find(t => t.className.split(classSeparator).some(c => eventTargetClasses.includes(c)))
69
76
 
70
77
  if (currentTarget &&
71
- !(e.target as HTMLElement)?.isSameNode(currentTarget) &&
72
- (e.target as HTMLElement)?.className === currentTarget.className
78
+ !(e.target as HTMLElement)?.isSameNode(currentTarget)
73
79
  ) {
74
80
  currentTarget.dispatchEvent(new TouchEvent(e.type, {
75
81
  changedTouches: e.changedTouches as unknown as Touch[],
@@ -80,7 +86,7 @@ export default Vue.extend({
80
86
  }
81
87
  }
82
88
 
83
- this.$emit(event, getEvent(e))
89
+ this.$emit(event, getEvent(e), e)
84
90
  }
85
91
 
86
92
  return eventOptions.result
@@ -27,8 +27,8 @@ export default Vue.extend({
27
27
  const value = getObjectValueByPath(props.item, header.value)
28
28
 
29
29
  const slotName = header.value
30
- const scopedSlot = data.scopedSlots && data.scopedSlots[slotName]
31
- const regularSlot = computedSlots[slotName]
30
+ const scopedSlot = data.scopedSlots && data.scopedSlots.hasOwnProperty(slotName) && data.scopedSlots[slotName]
31
+ const regularSlot = computedSlots.hasOwnProperty(slotName) && computedSlots[slotName]
32
32
 
33
33
  if (scopedSlot) {
34
34
  children.push(scopedSlot({
@@ -3,7 +3,12 @@ import Vue, { VNode, PropType } from 'vue'
3
3
  import { DataTableHeader } from 'vuetify/types'
4
4
 
5
5
  // Utils
6
- import { getObjectValueByPath } from '../../util/helpers'
6
+ import { getObjectValueByPath, wrapInArray } from '../../util/helpers'
7
+
8
+ function needsTd (slot: VNode[] | undefined) {
9
+ return slot!.length !== 1 ||
10
+ !['td', 'th'].includes(slot![0]?.tag!)
11
+ }
7
12
 
8
13
  export default Vue.extend({
9
14
  name: 'row',
@@ -20,39 +25,41 @@ export default Vue.extend({
20
25
  render (h, { props, slots, data }): VNode {
21
26
  const computedSlots = slots()
22
27
 
23
- const columns: VNode[] = props.headers.map((header: DataTableHeader) => {
28
+ const columns = props.headers.map((header: DataTableHeader) => {
24
29
  const children = []
25
30
  const value = getObjectValueByPath(props.item, header.value)
26
31
 
27
32
  const slotName = header.value
28
- const scopedSlot = data.scopedSlots && data.scopedSlots[slotName]
29
- const regularSlot = computedSlots[slotName]
33
+ const scopedSlot = data.scopedSlots && data.scopedSlots.hasOwnProperty(slotName) && data.scopedSlots[slotName]
34
+ const regularSlot = computedSlots.hasOwnProperty(slotName) && computedSlots[slotName]
30
35
 
31
36
  if (scopedSlot) {
32
- children.push(scopedSlot({
37
+ children.push(...wrapInArray(scopedSlot({
33
38
  item: props.item,
34
39
  isMobile: false,
35
40
  header,
36
41
  index: props.index,
37
42
  value,
38
- }))
43
+ })))
39
44
  } else if (regularSlot) {
40
- children.push(regularSlot)
45
+ children.push(...wrapInArray(regularSlot))
41
46
  } else {
42
47
  children.push(value == null ? value : String(value))
43
48
  }
44
49
 
45
50
  const textAlign = `text-${header.align || 'start'}`
46
51
 
47
- return h('td', {
48
- class: [
49
- textAlign,
50
- header.cellClass,
51
- {
52
- 'v-data-table__divider': header.divider,
53
- },
54
- ],
55
- }, children)
52
+ return needsTd(children)
53
+ ? h('td', {
54
+ class: [
55
+ textAlign,
56
+ header.cellClass,
57
+ {
58
+ 'v-data-table__divider': header.divider,
59
+ },
60
+ ],
61
+ }, children)
62
+ : children
56
63
  })
57
64
 
58
65
  return h('tr', data, columns)
@@ -73,7 +73,7 @@ export default mixins(header).extend({
73
73
  }
74
74
 
75
75
  children.push(
76
- this.$scopedSlots[header.value]
76
+ this.$scopedSlots.hasOwnProperty(header.value)
77
77
  ? this.$scopedSlots[header.value]!({ header })
78
78
  : this.$createElement('span', [header.text])
79
79
  )
@@ -695,6 +695,22 @@ describe('VDatePicker.ts', () => { // eslint-disable-line max-statements
695
695
  expect(change.mock.calls).toHaveLength(1)
696
696
  })
697
697
 
698
+ it('should add class for the first and last days in range', async () => {
699
+ const wrapper = mountFunction({
700
+ propsData: {
701
+ range: true,
702
+ showCurrent: '2019-01',
703
+ type: 'date',
704
+ value: ['2019-01-06', '2019-01-16'],
705
+ },
706
+ })
707
+
708
+ expect(wrapper.findAll('.v-date-picker-table--date tbody button.v-date-picker--first-in-range')
709
+ .exists()).toBe(true)
710
+ expect(wrapper.findAll('.v-date-picker-table--date tbody button.v-date-picker--last-in-range')
711
+ .exists()).toBe(true)
712
+ })
713
+
698
714
  it('should set proper tableDate', async () => {
699
715
  const wrapper = mountFunction({
700
716
  propsData: {
@@ -332,4 +332,20 @@ describe('VDatePicker.ts', () => {
332
332
  expect(cb.mock.calls[0][0][0]).toBe(fromDate)
333
333
  expect(cb.mock.calls[1][0][0]).toBe(toDate)
334
334
  })
335
+
336
+ it('should add class for the first and last days in range', async () => {
337
+ const wrapper = mountFunction({
338
+ propsData: {
339
+ range: true,
340
+ showCurrent: '2019',
341
+ type: 'month',
342
+ value: ['2019-01', '2019-02'],
343
+ },
344
+ })
345
+
346
+ expect(wrapper.findAll('.v-date-picker-table--month tbody button.v-date-picker--first-in-range')
347
+ .exists()).toBe(true)
348
+ expect(wrapper.findAll('.v-date-picker-table--month tbody button.v-date-picker--last-in-range')
349
+ .exists()).toBe(true)
350
+ })
335
351
  })
@@ -93,7 +93,14 @@ export default mixins(
93
93
  },
94
94
 
95
95
  methods: {
96
- genButtonClasses (isAllowed: boolean, isFloating: boolean, isSelected: boolean, isCurrent: boolean) {
96
+ genButtonClasses (
97
+ isAllowed: boolean,
98
+ isFloating: boolean,
99
+ isSelected: boolean,
100
+ isCurrent: boolean,
101
+ isFirst: boolean,
102
+ isLast: boolean,
103
+ ) {
97
104
  return {
98
105
  'v-size--default': !isFloating,
99
106
  'v-date-picker-table__current': isCurrent,
@@ -103,6 +110,8 @@ export default mixins(
103
110
  'v-btn--rounded': isFloating,
104
111
  'v-btn--disabled': !isAllowed || this.disabled,
105
112
  'v-btn--outlined': isCurrent && !isSelected,
113
+ 'v-date-picker--first-in-range': isFirst,
114
+ 'v-date-picker--last-in-range': isLast,
106
115
  ...this.themeClasses,
107
116
  }
108
117
  },
@@ -121,10 +130,23 @@ export default mixins(
121
130
  const isCurrent = value === this.current
122
131
  const setColor = isSelected ? this.setBackgroundColor : this.setTextColor
123
132
  const color = (isSelected || isCurrent) && (this.color || 'accent')
133
+ let isFirst = false
134
+ let isLast = false
135
+ if (this.range && !!this.value && Array.isArray(this.value)) {
136
+ isFirst = value === this.value[0]
137
+ isLast = value === this.value[this.value.length - 1]
138
+ }
124
139
 
125
140
  return this.$createElement('button', setColor(color, {
126
141
  staticClass: 'v-btn',
127
- class: this.genButtonClasses(isAllowed && !isOtherMonth, isFloating, isSelected, isCurrent),
142
+ class: this.genButtonClasses(
143
+ isAllowed && !isOtherMonth,
144
+ isFloating,
145
+ isSelected,
146
+ isCurrent,
147
+ isFirst,
148
+ isLast,
149
+ ),
128
150
  attrs: {
129
151
  type: 'button',
130
152
  },
@@ -48,10 +48,7 @@ export default baseMixins.extend({
48
48
  disabled: Boolean,
49
49
  fullscreen: Boolean,
50
50
  light: Boolean,
51
- maxWidth: {
52
- type: [String, Number],
53
- default: 'none',
54
- },
51
+ maxWidth: [String, Number],
55
52
  noClickAnimation: Boolean,
56
53
  origin: {
57
54
  type: String,
@@ -67,10 +64,7 @@ export default baseMixins.extend({
67
64
  type: [String, Boolean],
68
65
  default: 'dialog-transition',
69
66
  },
70
- width: {
71
- type: [String, Number],
72
- default: 'auto',
73
- },
67
+ width: [String, Number],
74
68
  },
75
69
 
76
70
  data () {
@@ -306,8 +300,8 @@ export default baseMixins.extend({
306
300
  if (!this.fullscreen) {
307
301
  data.style = {
308
302
  ...data.style as object,
309
- maxWidth: this.maxWidth === 'none' ? undefined : convertToUnit(this.maxWidth),
310
- width: this.width === 'auto' ? undefined : convertToUnit(this.width),
303
+ maxWidth: convertToUnit(this.maxWidth),
304
+ width: convertToUnit(this.width),
311
305
  }
312
306
  }
313
307
 
@@ -125,3 +125,11 @@
125
125
  &--has-state
126
126
  &.error--text .v-label
127
127
  animation: v-shake .6s map-get($transition, 'swing')
128
+
129
+ &--hide-spin-buttons
130
+ input::-webkit-outer-spin-button,
131
+ input::-webkit-inner-spin-button
132
+ -webkit-appearance: none
133
+ margin: 0
134
+ input[type=number]
135
+ -moz-appearance: textfield
@@ -48,6 +48,7 @@ export default baseMixins.extend<options>().extend({
48
48
  dense: Boolean,
49
49
  height: [Number, String],
50
50
  hideDetails: [Boolean, String] as PropType<boolean | 'auto'>,
51
+ hideSpinButtons: Boolean,
51
52
  hint: String,
52
53
  id: String,
53
54
  label: String,
@@ -77,6 +78,7 @@ export default baseMixins.extend<options>().extend({
77
78
  'v-input--is-loading': this.loading !== false && this.loading != null,
78
79
  'v-input--is-readonly': this.isReadonly,
79
80
  'v-input--dense': this.dense,
81
+ 'v-input--hide-spin-buttons': this.hideSpinButtons,
80
82
  ...this.themeClasses,
81
83
  }
82
84
  },
@@ -2,6 +2,7 @@
2
2
  import './VItemGroup.sass'
3
3
 
4
4
  // Mixins
5
+ import Comparable from '../../mixins/comparable'
5
6
  import Groupable from '../../mixins/groupable'
6
7
  import Proxyable from '../../mixins/proxyable'
7
8
  import Themeable from '../../mixins/themeable'
@@ -20,6 +21,7 @@ export type GroupableInstance = InstanceType<typeof Groupable> & {
20
21
  }
21
22
 
22
23
  export const BaseItemGroup = mixins(
24
+ Comparable,
23
25
  Proxyable,
24
26
  Themeable
25
27
  ).extend({
@@ -83,12 +85,12 @@ export const BaseItemGroup = mixins(
83
85
  },
84
86
  toggleMethod (): (v: any) => boolean {
85
87
  if (!this.multiple) {
86
- return (v: any) => this.internalValue === v
88
+ return (v: any) => this.valueComparator(this.internalValue, v)
87
89
  }
88
90
 
89
91
  const internalValue = this.internalValue
90
92
  if (Array.isArray(internalValue)) {
91
- return (v: any) => internalValue.includes(v)
93
+ return (v: any) => internalValue.some(intern => this.valueComparator(intern, v))
92
94
  }
93
95
 
94
96
  return () => false
@@ -114,7 +116,7 @@ export const BaseItemGroup = mixins(
114
116
  }
115
117
  },
116
118
  getValue (item: GroupableInstance, i: number): unknown {
117
- return item.value == null || item.value === ''
119
+ return item.value === undefined
118
120
  ? i
119
121
  : item.value
120
122
  },
@@ -58,9 +58,9 @@ describe('VItemGroup', () => {
58
58
 
59
59
  const getValue = wrapper.vm.getValue
60
60
 
61
- expect(getValue({ value: null }, 0)).toBe(0)
61
+ expect(getValue({ value: null }, 0)).toBeNull()
62
62
  expect(getValue({ value: undefined }, 1)).toBe(1)
63
- expect(getValue({ value: '' }, 2)).toBe(2)
63
+ expect(getValue({ value: '' }, 2)).toBe('')
64
64
  expect(getValue({ value: 'foo' }, 'foo')).toBe('foo')
65
65
  })
66
66
 
@@ -167,6 +167,23 @@ describe('VItemGroup', () => {
167
167
  expect(wrapper.vm.toggleMethod(0)).toBe(false)
168
168
  })
169
169
 
170
+ it('should correctly be active with objects having different references', () => {
171
+ const wrapper = mountFunction()
172
+
173
+ wrapper.setProps({ value: { a: 1 } })
174
+ expect(wrapper.vm.toggleMethod({ a: 1 })).toBe(true)
175
+ expect(wrapper.vm.toggleMethod({ a: 2 })).toBe(false)
176
+ })
177
+
178
+ it('should have a customizable comparator function', () => {
179
+ const wrapper = mountFunction()
180
+
181
+ wrapper.setProps({ valueComparator: (a: any, b: any) => a === b + 1, value: 0 })
182
+
183
+ expect(wrapper.vm.toggleMethod(0)).toBe(false)
184
+ expect(wrapper.vm.toggleMethod(-1)).toBe(true)
185
+ })
186
+
170
187
  it('should select the first item if mandatory and no value', async () => {
171
188
  const wrapper = mountFunction({
172
189
  propsData: { mandatory: true },
@@ -391,7 +391,7 @@ export default baseMixins.extend({
391
391
  getTiles () {
392
392
  if (!this.$refs.content) return
393
393
 
394
- this.tiles = Array.from(this.$refs.content.querySelectorAll('.v-list-item'))
394
+ this.tiles = Array.from(this.$refs.content.querySelectorAll('.v-list-item, .v-divider, .v-subheader'))
395
395
  },
396
396
  mouseEnterHandler () {
397
397
  this.runDelay('open', () => {
@@ -0,0 +1,37 @@
1
+ // Imports
2
+ @import './_variables.scss'
3
+
4
+ // Theme
5
+ +theme(v-otp-input) using ($material)
6
+ .v-input
7
+ .v-input__control
8
+ .v-input__slot
9
+ background: map-get($material, 'bg-color')
10
+
11
+ .v-otp-input
12
+ display: flex
13
+ flex-wrap: wrap
14
+ flex: 1 1 auto
15
+ margin-right: -$otp-gutter
16
+ margin-left: -$otp-gutter
17
+
18
+ input
19
+ text-align: center
20
+
21
+ .v-input
22
+ margin: 0
23
+ flex: 1 0 $otp-width + $otp-gutter * 2
24
+ max-width: 100%
25
+ width: 100%
26
+ padding: $otp-gutter
27
+
28
+ &.v-otp-input--plain
29
+ fieldset
30
+ display: none
31
+
32
+ input[type=number]::-webkit-outer-spin-button,
33
+ input[type=number]::-webkit-inner-spin-button
34
+ -webkit-appearance: none
35
+ margin: 0
36
+ input[type=number]
37
+ -moz-appearance: textfield