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.
- package/dist/json/attributes.json +196 -0
- package/dist/json/tags.json +88 -20
- package/dist/json/web-types.json +721 -141
- package/dist/vuetify.css +165 -5
- package/dist/vuetify.css.map +1 -1
- package/dist/vuetify.js +966 -333
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VAutocomplete/VAutocomplete.js +1 -0
- package/es5/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/es5/components/VBanner/VBanner.js +3 -2
- package/es5/components/VBanner/VBanner.js.map +1 -1
- package/es5/components/VBottomNavigation/VBottomNavigation.js +10 -2
- package/es5/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
- package/es5/components/VBottomSheet/VBottomSheet.js +1 -4
- package/es5/components/VBottomSheet/VBottomSheet.js.map +1 -1
- package/es5/components/VCalendar/VCalendar.js +2 -2
- package/es5/components/VCalendar/VCalendar.js.map +1 -1
- package/es5/components/VCalendar/VCalendarDaily.js +16 -8
- package/es5/components/VCalendar/VCalendarDaily.js.map +1 -1
- package/es5/components/VCalendar/VCalendarWeekly.js +14 -10
- package/es5/components/VCalendar/VCalendarWeekly.js.map +1 -1
- package/es5/components/VCalendar/mixins/calendar-with-events.js +19 -20
- package/es5/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
- package/es5/components/VCalendar/mixins/mouse.js +13 -4
- package/es5/components/VCalendar/mixins/mouse.js.map +1 -1
- package/es5/components/VCombobox/VCombobox.js +1 -1
- package/es5/components/VCombobox/VCombobox.js.map +1 -1
- package/es5/components/VDataTable/MobileRow.js +2 -2
- package/es5/components/VDataTable/MobileRow.js.map +1 -1
- package/es5/components/VDataTable/Row.js +25 -9
- package/es5/components/VDataTable/Row.js.map +1 -1
- package/es5/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
- package/es5/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
- package/es5/components/VDatePicker/mixins/date-picker-table.js +13 -3
- package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +4 -10
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VInput/VInput.js +3 -1
- package/es5/components/VInput/VInput.js.map +1 -1
- package/es5/components/VItemGroup/VItemGroup.js +8 -4
- package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
- package/es5/components/VMenu/VMenu.js +0 -4
- package/es5/components/VMenu/VMenu.js.map +1 -1
- package/es5/components/VNavigationDrawer/VNavigationDrawer.js +7 -11
- package/es5/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
- package/es5/components/VOtpInput/VOtpInput.js +377 -0
- package/es5/components/VOtpInput/VOtpInput.js.map +1 -0
- package/es5/components/VOtpInput/index.js +20 -0
- package/es5/components/VOtpInput/index.js.map +1 -0
- package/es5/components/VRadioGroup/VRadioGroup.js +1 -3
- package/es5/components/VRadioGroup/VRadioGroup.js.map +1 -1
- package/es5/components/VSelect/VSelect.js +6 -1
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VSlideGroup/VSlideGroup.js +12 -4
- package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/es5/components/VSnackbar/VSnackbar.js +4 -8
- package/es5/components/VSnackbar/VSnackbar.js.map +1 -1
- package/es5/components/VStepper/VStepperStep.js +12 -1
- package/es5/components/VStepper/VStepperStep.js.map +1 -1
- package/es5/components/VTabs/VTab.js +3 -2
- package/es5/components/VTabs/VTab.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +14 -9
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/components/VTreeview/VTreeview.js +2 -1
- package/es5/components/VTreeview/VTreeview.js.map +1 -1
- package/es5/components/VTreeview/VTreeviewNode.js +3 -1
- package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/es5/components/index.js +13 -0
- package/es5/components/index.js.map +1 -1
- package/es5/directives/ripple/index.js +0 -7
- package/es5/directives/ripple/index.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/locale/da.js +77 -0
- package/es5/locale/da.js.map +1 -0
- package/es5/locale/index.js +8 -0
- package/es5/locale/index.js.map +1 -1
- package/es5/locale/it.js +6 -6
- package/es5/locale/it.js.map +1 -1
- package/es5/mixins/activatable/index.js +6 -2
- package/es5/mixins/activatable/index.js.map +1 -1
- package/es5/mixins/menuable/index.js +9 -8
- package/es5/mixins/menuable/index.js.map +1 -1
- package/es5/mixins/routable/index.js +4 -7
- package/es5/mixins/routable/index.js.map +1 -1
- package/es5/services/application/index.js +1 -3
- package/es5/services/application/index.js.map +1 -1
- package/es5/util/helpers.js +13 -6
- package/es5/util/helpers.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.js +1 -0
- package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/lib/components/VBanner/VBanner.js +3 -2
- package/lib/components/VBanner/VBanner.js.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.js +10 -2
- package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.js +1 -4
- package/lib/components/VBottomSheet/VBottomSheet.js.map +1 -1
- package/lib/components/VCalendar/VCalendar.js +2 -2
- package/lib/components/VCalendar/VCalendar.js.map +1 -1
- package/lib/components/VCalendar/VCalendarDaily.js +20 -8
- package/lib/components/VCalendar/VCalendarDaily.js.map +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.js +10 -2
- package/lib/components/VCalendar/VCalendarWeekly.js.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.js +6 -3
- package/lib/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
- package/lib/components/VCalendar/mixins/mouse.js +9 -4
- package/lib/components/VCalendar/mixins/mouse.js.map +1 -1
- package/lib/components/VCombobox/VCombobox.js +1 -1
- package/lib/components/VCombobox/VCombobox.js.map +1 -1
- package/lib/components/VDataTable/MobileRow.js +2 -2
- package/lib/components/VDataTable/MobileRow.js.map +1 -1
- package/lib/components/VDataTable/Row.js +15 -8
- package/lib/components/VDataTable/Row.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js +12 -2
- package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +4 -10
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VInput/VInput.js +2 -0
- package/lib/components/VInput/VInput.js.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.js +7 -5
- package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
- package/lib/components/VMenu/VMenu.js +0 -4
- package/lib/components/VMenu/VMenu.js.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.js +3 -7
- package/lib/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.js +344 -0
- package/lib/components/VOtpInput/VOtpInput.js.map +1 -0
- package/lib/components/VOtpInput/index.js +4 -0
- package/lib/components/VOtpInput/index.js.map +1 -0
- package/lib/components/VRadioGroup/VRadioGroup.js +2 -4
- package/lib/components/VRadioGroup/VRadioGroup.js.map +1 -1
- package/lib/components/VSelect/VSelect.js +6 -1
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.js +13 -4
- package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.js +4 -8
- package/lib/components/VSnackbar/VSnackbar.js.map +1 -1
- package/lib/components/VStepper/VStepperStep.js +12 -1
- package/lib/components/VStepper/VStepperStep.js.map +1 -1
- package/lib/components/VTabs/VTab.js +3 -2
- package/lib/components/VTabs/VTab.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +14 -9
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/components/VTreeview/VTreeview.js +2 -1
- package/lib/components/VTreeview/VTreeview.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.js +3 -1
- package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/directives/ripple/index.js +0 -7
- package/lib/directives/ripple/index.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/locale/da.js +70 -0
- package/lib/locale/da.js.map +1 -0
- package/lib/locale/index.js +1 -0
- package/lib/locale/index.js.map +1 -1
- package/lib/locale/it.js +6 -6
- package/lib/locale/it.js.map +1 -1
- package/lib/mixins/activatable/index.js +6 -2
- package/lib/mixins/activatable/index.js.map +1 -1
- package/lib/mixins/menuable/index.js +9 -8
- package/lib/mixins/menuable/index.js.map +1 -1
- package/lib/mixins/routable/index.js +5 -7
- package/lib/mixins/routable/index.js.map +1 -1
- package/lib/services/application/index.js +1 -3
- package/lib/services/application/index.js.map +1 -1
- package/lib/util/helpers.js +13 -6
- package/lib/util/helpers.js.map +1 -1
- package/package.json +2 -2
- package/src/components/VAutocomplete/VAutocomplete.ts +2 -0
- package/src/components/VAutocomplete/__tests__/VAutocomplete3.spec.ts +16 -0
- package/src/components/VBanner/VBanner.ts +16 -10
- package/src/components/VBottomNavigation/VBottomNavigation.ts +14 -2
- package/src/components/VBottomNavigation/__tests__/VBottomNavigation.spec.ts +9 -7
- package/src/components/VBottomSheet/VBottomSheet.ts +1 -4
- package/src/components/VCalendar/VCalendar.ts +3 -2
- package/src/components/VCalendar/VCalendarCategory.sass +67 -0
- package/src/components/VCalendar/VCalendarDaily.ts +9 -8
- package/src/components/VCalendar/VCalendarWeekly.ts +4 -2
- package/src/components/VCalendar/_variables.scss +4 -0
- package/src/components/VCalendar/mixins/calendar-with-events.ts +4 -3
- package/src/components/VCalendar/mixins/mouse.ts +10 -4
- package/src/components/VCombobox/VCombobox.ts +1 -1
- package/src/components/VCombobox/__tests__/VCombobox.spec.ts +2 -2
- package/src/components/VDataTable/MobileRow.ts +2 -2
- package/src/components/VDataTable/Row.ts +23 -16
- package/src/components/VDataTable/VDataTableHeaderDesktop.ts +1 -1
- package/src/components/VDatePicker/__tests__/VDatePicker.date.spec.ts +16 -0
- package/src/components/VDatePicker/__tests__/VDatePicker.month.spec.ts +16 -0
- package/src/components/VDatePicker/mixins/date-picker-table.ts +24 -2
- package/src/components/VDialog/VDialog.ts +4 -10
- package/src/components/VInput/VInput.sass +8 -0
- package/src/components/VInput/VInput.ts +2 -0
- package/src/components/VItemGroup/VItemGroup.ts +5 -3
- package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +19 -2
- package/src/components/VMenu/VMenu.ts +0 -4
- package/src/components/VNavigationDrawer/VNavigationDrawer.ts +3 -6
- package/src/components/VOtpInput/VOtpInput.sass +37 -0
- package/src/components/VOtpInput/VOtpInput.ts +324 -0
- package/src/components/VOtpInput/__tests__/VOtpInput.spec.ts +294 -0
- package/src/components/VOtpInput/_variables.scss +4 -0
- package/src/components/VOtpInput/index.ts +4 -0
- package/src/components/VRadioGroup/VRadioGroup.ts +0 -4
- package/src/components/VSelect/VSelect.ts +4 -0
- package/src/components/VSlideGroup/VSlideGroup.ts +21 -2
- package/src/components/VSnackbar/VSnackbar.ts +3 -7
- package/src/components/VSnackbar/__tests__/VSnackbar.spec.ts +4 -1
- package/src/components/VStepper/VStepper.sass +4 -4
- package/src/components/VStepper/VStepperStep.ts +14 -2
- package/src/components/VStepper/__tests__/__snapshots__/VStepperStep.spec.ts.snap +18 -6
- package/src/components/VTabs/VTab.ts +10 -2
- package/src/components/VTextarea/VTextarea.sass +13 -0
- package/src/components/VTooltip/VTooltip.sass +4 -1
- package/src/components/VTooltip/VTooltip.ts +14 -8
- package/src/components/VTooltip/_variables.scss +1 -0
- package/src/components/VTreeview/VTreeview.ts +2 -1
- package/src/components/VTreeview/VTreeviewNode.ts +3 -1
- package/src/components/index.ts +1 -0
- package/src/directives/ripple/VRipple.sass +4 -1
- package/src/directives/ripple/index.ts +0 -7
- package/src/locale/da.ts +69 -0
- package/src/locale/index.ts +1 -0
- package/src/locale/it.ts +6 -6
- package/src/mixins/activatable/__tests__/__snapshots__/activatable.spec.ts.snap +1 -2
- package/src/mixins/activatable/index.ts +6 -2
- package/src/mixins/menuable/index.ts +8 -7
- package/src/mixins/routable/index.ts +3 -6
- package/src/services/application/index.ts +1 -1
- package/src/styles/settings/_variables.scss +4 -3
- package/src/util/__tests__/__snapshots__/helpers.spec.ts.snap +11 -0
- package/src/util/__tests__/helpers.spec.ts +17 -0
- package/src/util/helpers.ts +14 -7
- package/types/lib.d.ts +2 -0
- 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
|
|
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
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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)
|
|
@@ -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 (
|
|
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(
|
|
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:
|
|
310
|
-
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
|
|
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.
|
|
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
|
|
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)).
|
|
61
|
+
expect(getValue({ value: null }, 0)).toBeNull()
|
|
62
62
|
expect(getValue({ value: undefined }, 1)).toBe(1)
|
|
63
|
-
expect(getValue({ value: '' }, 2)).toBe(
|
|
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 },
|
|
@@ -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.
|
|
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
|