vuetify 2.5.14 → 2.6.2

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 (237) hide show
  1. package/dist/json/attributes.json +196 -0
  2. package/dist/json/tags.json +88 -20
  3. package/dist/json/web-types.json +721 -141
  4. package/dist/vuetify.css +165 -5
  5. package/dist/vuetify.css.map +1 -1
  6. package/dist/vuetify.js +966 -333
  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/VBottomNavigation/VBottomNavigation.js +10 -2
  15. package/es5/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  16. package/es5/components/VBottomSheet/VBottomSheet.js +1 -4
  17. package/es5/components/VBottomSheet/VBottomSheet.js.map +1 -1
  18. package/es5/components/VCalendar/VCalendar.js +2 -2
  19. package/es5/components/VCalendar/VCalendar.js.map +1 -1
  20. package/es5/components/VCalendar/VCalendarDaily.js +16 -8
  21. package/es5/components/VCalendar/VCalendarDaily.js.map +1 -1
  22. package/es5/components/VCalendar/VCalendarWeekly.js +14 -10
  23. package/es5/components/VCalendar/VCalendarWeekly.js.map +1 -1
  24. package/es5/components/VCalendar/mixins/calendar-with-events.js +19 -20
  25. package/es5/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  26. package/es5/components/VCalendar/mixins/mouse.js +13 -4
  27. package/es5/components/VCalendar/mixins/mouse.js.map +1 -1
  28. package/es5/components/VCombobox/VCombobox.js +1 -1
  29. package/es5/components/VCombobox/VCombobox.js.map +1 -1
  30. package/es5/components/VDataTable/MobileRow.js +2 -2
  31. package/es5/components/VDataTable/MobileRow.js.map +1 -1
  32. package/es5/components/VDataTable/Row.js +25 -9
  33. package/es5/components/VDataTable/Row.js.map +1 -1
  34. package/es5/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
  35. package/es5/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  36. package/es5/components/VDatePicker/mixins/date-picker-table.js +13 -3
  37. package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  38. package/es5/components/VDialog/VDialog.js +4 -10
  39. package/es5/components/VDialog/VDialog.js.map +1 -1
  40. package/es5/components/VInput/VInput.js +3 -1
  41. package/es5/components/VInput/VInput.js.map +1 -1
  42. package/es5/components/VItemGroup/VItemGroup.js +8 -4
  43. package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
  44. package/es5/components/VMenu/VMenu.js +0 -4
  45. package/es5/components/VMenu/VMenu.js.map +1 -1
  46. package/es5/components/VNavigationDrawer/VNavigationDrawer.js +7 -11
  47. package/es5/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
  48. package/es5/components/VOtpInput/VOtpInput.js +377 -0
  49. package/es5/components/VOtpInput/VOtpInput.js.map +1 -0
  50. package/es5/components/VOtpInput/index.js +20 -0
  51. package/es5/components/VOtpInput/index.js.map +1 -0
  52. package/es5/components/VRadioGroup/VRadioGroup.js +1 -3
  53. package/es5/components/VRadioGroup/VRadioGroup.js.map +1 -1
  54. package/es5/components/VSelect/VSelect.js +6 -1
  55. package/es5/components/VSelect/VSelect.js.map +1 -1
  56. package/es5/components/VSlideGroup/VSlideGroup.js +12 -4
  57. package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
  58. package/es5/components/VSnackbar/VSnackbar.js +4 -8
  59. package/es5/components/VSnackbar/VSnackbar.js.map +1 -1
  60. package/es5/components/VStepper/VStepperStep.js +12 -1
  61. package/es5/components/VStepper/VStepperStep.js.map +1 -1
  62. package/es5/components/VTabs/VTab.js +3 -2
  63. package/es5/components/VTabs/VTab.js.map +1 -1
  64. package/es5/components/VTooltip/VTooltip.js +14 -9
  65. package/es5/components/VTooltip/VTooltip.js.map +1 -1
  66. package/es5/components/VTreeview/VTreeview.js +2 -1
  67. package/es5/components/VTreeview/VTreeview.js.map +1 -1
  68. package/es5/components/VTreeview/VTreeviewNode.js +3 -1
  69. package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
  70. package/es5/components/index.js +13 -0
  71. package/es5/components/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/framework.js +1 -1
  75. package/es5/locale/da.js +77 -0
  76. package/es5/locale/da.js.map +1 -0
  77. package/es5/locale/index.js +8 -0
  78. package/es5/locale/index.js.map +1 -1
  79. package/es5/locale/it.js +6 -6
  80. package/es5/locale/it.js.map +1 -1
  81. package/es5/mixins/activatable/index.js +6 -2
  82. package/es5/mixins/activatable/index.js.map +1 -1
  83. package/es5/mixins/menuable/index.js +9 -8
  84. package/es5/mixins/menuable/index.js.map +1 -1
  85. package/es5/mixins/routable/index.js +4 -7
  86. package/es5/mixins/routable/index.js.map +1 -1
  87. package/es5/services/application/index.js +1 -3
  88. package/es5/services/application/index.js.map +1 -1
  89. package/es5/util/helpers.js +13 -6
  90. package/es5/util/helpers.js.map +1 -1
  91. package/lib/components/VAutocomplete/VAutocomplete.js +1 -0
  92. package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
  93. package/lib/components/VBanner/VBanner.js +3 -2
  94. package/lib/components/VBanner/VBanner.js.map +1 -1
  95. package/lib/components/VBottomNavigation/VBottomNavigation.js +10 -2
  96. package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  97. package/lib/components/VBottomSheet/VBottomSheet.js +1 -4
  98. package/lib/components/VBottomSheet/VBottomSheet.js.map +1 -1
  99. package/lib/components/VCalendar/VCalendar.js +2 -2
  100. package/lib/components/VCalendar/VCalendar.js.map +1 -1
  101. package/lib/components/VCalendar/VCalendarDaily.js +20 -8
  102. package/lib/components/VCalendar/VCalendarDaily.js.map +1 -1
  103. package/lib/components/VCalendar/VCalendarWeekly.js +10 -2
  104. package/lib/components/VCalendar/VCalendarWeekly.js.map +1 -1
  105. package/lib/components/VCalendar/mixins/calendar-with-events.js +6 -3
  106. package/lib/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  107. package/lib/components/VCalendar/mixins/mouse.js +9 -4
  108. package/lib/components/VCalendar/mixins/mouse.js.map +1 -1
  109. package/lib/components/VCombobox/VCombobox.js +1 -1
  110. package/lib/components/VCombobox/VCombobox.js.map +1 -1
  111. package/lib/components/VDataTable/MobileRow.js +2 -2
  112. package/lib/components/VDataTable/MobileRow.js.map +1 -1
  113. package/lib/components/VDataTable/Row.js +15 -8
  114. package/lib/components/VDataTable/Row.js.map +1 -1
  115. package/lib/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
  116. package/lib/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  117. package/lib/components/VDatePicker/mixins/date-picker-table.js +12 -2
  118. package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  119. package/lib/components/VDialog/VDialog.js +4 -10
  120. package/lib/components/VDialog/VDialog.js.map +1 -1
  121. package/lib/components/VInput/VInput.js +2 -0
  122. package/lib/components/VInput/VInput.js.map +1 -1
  123. package/lib/components/VItemGroup/VItemGroup.js +7 -5
  124. package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
  125. package/lib/components/VMenu/VMenu.js +0 -4
  126. package/lib/components/VMenu/VMenu.js.map +1 -1
  127. package/lib/components/VNavigationDrawer/VNavigationDrawer.js +3 -7
  128. package/lib/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
  129. package/lib/components/VOtpInput/VOtpInput.js +344 -0
  130. package/lib/components/VOtpInput/VOtpInput.js.map +1 -0
  131. package/lib/components/VOtpInput/index.js +4 -0
  132. package/lib/components/VOtpInput/index.js.map +1 -0
  133. package/lib/components/VRadioGroup/VRadioGroup.js +2 -4
  134. package/lib/components/VRadioGroup/VRadioGroup.js.map +1 -1
  135. package/lib/components/VSelect/VSelect.js +6 -1
  136. package/lib/components/VSelect/VSelect.js.map +1 -1
  137. package/lib/components/VSlideGroup/VSlideGroup.js +13 -4
  138. package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
  139. package/lib/components/VSnackbar/VSnackbar.js +4 -8
  140. package/lib/components/VSnackbar/VSnackbar.js.map +1 -1
  141. package/lib/components/VStepper/VStepperStep.js +12 -1
  142. package/lib/components/VStepper/VStepperStep.js.map +1 -1
  143. package/lib/components/VTabs/VTab.js +3 -2
  144. package/lib/components/VTabs/VTab.js.map +1 -1
  145. package/lib/components/VTooltip/VTooltip.js +14 -9
  146. package/lib/components/VTooltip/VTooltip.js.map +1 -1
  147. package/lib/components/VTreeview/VTreeview.js +2 -1
  148. package/lib/components/VTreeview/VTreeview.js.map +1 -1
  149. package/lib/components/VTreeview/VTreeviewNode.js +3 -1
  150. package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
  151. package/lib/components/index.js +1 -0
  152. package/lib/components/index.js.map +1 -1
  153. package/lib/directives/ripple/index.js +0 -7
  154. package/lib/directives/ripple/index.js.map +1 -1
  155. package/lib/framework.js +1 -1
  156. package/lib/locale/da.js +70 -0
  157. package/lib/locale/da.js.map +1 -0
  158. package/lib/locale/index.js +1 -0
  159. package/lib/locale/index.js.map +1 -1
  160. package/lib/locale/it.js +6 -6
  161. package/lib/locale/it.js.map +1 -1
  162. package/lib/mixins/activatable/index.js +6 -2
  163. package/lib/mixins/activatable/index.js.map +1 -1
  164. package/lib/mixins/menuable/index.js +9 -8
  165. package/lib/mixins/menuable/index.js.map +1 -1
  166. package/lib/mixins/routable/index.js +5 -7
  167. package/lib/mixins/routable/index.js.map +1 -1
  168. package/lib/services/application/index.js +1 -3
  169. package/lib/services/application/index.js.map +1 -1
  170. package/lib/util/helpers.js +13 -6
  171. package/lib/util/helpers.js.map +1 -1
  172. package/package.json +2 -2
  173. package/src/components/VAutocomplete/VAutocomplete.ts +2 -0
  174. package/src/components/VAutocomplete/__tests__/VAutocomplete3.spec.ts +16 -0
  175. package/src/components/VBanner/VBanner.ts +16 -10
  176. package/src/components/VBottomNavigation/VBottomNavigation.ts +14 -2
  177. package/src/components/VBottomNavigation/__tests__/VBottomNavigation.spec.ts +9 -7
  178. package/src/components/VBottomSheet/VBottomSheet.ts +1 -4
  179. package/src/components/VCalendar/VCalendar.ts +3 -2
  180. package/src/components/VCalendar/VCalendarCategory.sass +67 -0
  181. package/src/components/VCalendar/VCalendarDaily.ts +9 -8
  182. package/src/components/VCalendar/VCalendarWeekly.ts +4 -2
  183. package/src/components/VCalendar/_variables.scss +4 -0
  184. package/src/components/VCalendar/mixins/calendar-with-events.ts +4 -3
  185. package/src/components/VCalendar/mixins/mouse.ts +10 -4
  186. package/src/components/VCombobox/VCombobox.ts +1 -1
  187. package/src/components/VCombobox/__tests__/VCombobox.spec.ts +2 -2
  188. package/src/components/VDataTable/MobileRow.ts +2 -2
  189. package/src/components/VDataTable/Row.ts +23 -16
  190. package/src/components/VDataTable/VDataTableHeaderDesktop.ts +1 -1
  191. package/src/components/VDatePicker/__tests__/VDatePicker.date.spec.ts +16 -0
  192. package/src/components/VDatePicker/__tests__/VDatePicker.month.spec.ts +16 -0
  193. package/src/components/VDatePicker/mixins/date-picker-table.ts +24 -2
  194. package/src/components/VDialog/VDialog.ts +4 -10
  195. package/src/components/VInput/VInput.sass +8 -0
  196. package/src/components/VInput/VInput.ts +2 -0
  197. package/src/components/VItemGroup/VItemGroup.ts +5 -3
  198. package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +19 -2
  199. package/src/components/VMenu/VMenu.ts +0 -4
  200. package/src/components/VNavigationDrawer/VNavigationDrawer.ts +3 -6
  201. package/src/components/VOtpInput/VOtpInput.sass +37 -0
  202. package/src/components/VOtpInput/VOtpInput.ts +324 -0
  203. package/src/components/VOtpInput/__tests__/VOtpInput.spec.ts +294 -0
  204. package/src/components/VOtpInput/_variables.scss +4 -0
  205. package/src/components/VOtpInput/index.ts +4 -0
  206. package/src/components/VRadioGroup/VRadioGroup.ts +0 -4
  207. package/src/components/VSelect/VSelect.ts +4 -0
  208. package/src/components/VSlideGroup/VSlideGroup.ts +21 -2
  209. package/src/components/VSnackbar/VSnackbar.ts +3 -7
  210. package/src/components/VSnackbar/__tests__/VSnackbar.spec.ts +4 -1
  211. package/src/components/VStepper/VStepper.sass +4 -4
  212. package/src/components/VStepper/VStepperStep.ts +14 -2
  213. package/src/components/VStepper/__tests__/__snapshots__/VStepperStep.spec.ts.snap +18 -6
  214. package/src/components/VTabs/VTab.ts +10 -2
  215. package/src/components/VTextarea/VTextarea.sass +13 -0
  216. package/src/components/VTooltip/VTooltip.sass +4 -1
  217. package/src/components/VTooltip/VTooltip.ts +14 -8
  218. package/src/components/VTooltip/_variables.scss +1 -0
  219. package/src/components/VTreeview/VTreeview.ts +2 -1
  220. package/src/components/VTreeview/VTreeviewNode.ts +3 -1
  221. package/src/components/index.ts +1 -0
  222. package/src/directives/ripple/VRipple.sass +4 -1
  223. package/src/directives/ripple/index.ts +0 -7
  224. package/src/locale/da.ts +69 -0
  225. package/src/locale/index.ts +1 -0
  226. package/src/locale/it.ts +6 -6
  227. package/src/mixins/activatable/__tests__/__snapshots__/activatable.spec.ts.snap +1 -2
  228. package/src/mixins/activatable/index.ts +6 -2
  229. package/src/mixins/menuable/index.ts +8 -7
  230. package/src/mixins/routable/index.ts +3 -6
  231. package/src/services/application/index.ts +1 -1
  232. package/src/styles/settings/_variables.scss +4 -3
  233. package/src/util/__tests__/__snapshots__/helpers.spec.ts.snap +11 -0
  234. package/src/util/__tests__/helpers.spec.ts +17 -0
  235. package/src/util/helpers.ts +14 -7
  236. package/types/lib.d.ts +2 -0
  237. package/src/directives/ripple/_variables.scss +0 -6
@@ -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 },
@@ -75,10 +75,6 @@ export default baseMixins.extend({
75
75
  },
76
76
  offsetX: Boolean,
77
77
  offsetY: Boolean,
78
- openOnClick: {
79
- type: Boolean,
80
- default: true,
81
- },
82
78
  openOnHover: Boolean,
83
79
  origin: {
84
80
  type: String,
@@ -351,6 +351,8 @@ export default baseMixins.extend({
351
351
  },
352
352
  genListeners () {
353
353
  const on: Record<string, (e: Event) => void> = {
354
+ mouseenter: () => (this.isMouseover = true),
355
+ mouseleave: () => (this.isMouseover = false),
354
356
  transitionend: (e: Event) => {
355
357
  if (e.target !== e.currentTarget) return
356
358
  this.$emit('transitionend', e)
@@ -366,11 +368,6 @@ export default baseMixins.extend({
366
368
  on.click = () => this.$emit('update:mini-variant', false)
367
369
  }
368
370
 
369
- if (this.expandOnHover) {
370
- on.mouseenter = () => (this.isMouseover = true)
371
- on.mouseleave = () => (this.isMouseover = false)
372
- }
373
-
374
371
  return on
375
372
  },
376
373
  genPosition (name: 'prepend' | 'append') {
@@ -442,7 +439,7 @@ export default baseMixins.extend({
442
439
  !this.$el
443
440
  ) return 0
444
441
 
445
- const width = Number(this.computedWidth)
442
+ const width = Number(this.miniVariant ? this.miniVariantWidth : this.width)
446
443
 
447
444
  return isNaN(width) ? this.$el.clientWidth : width
448
445
  },
@@ -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