@dimailn/vuetify 2.7.2-alpha32 → 2.7.2-alpha34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vuetify.js +544 -366
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VCalendar/VCalendarWeekly.js +10 -5
- package/es5/components/VCalendar/VCalendarWeekly.js.map +1 -1
- package/es5/components/VCheckbox/VCheckbox.js +7 -9
- package/es5/components/VCheckbox/VCheckbox.js.map +1 -1
- package/es5/components/VContent/VContent.js +24 -5
- package/es5/components/VContent/VContent.js.map +1 -1
- package/es5/components/VCounter/VCounter.js.map +1 -1
- package/es5/components/VDatePicker/VDatePicker.js +15 -7
- package/es5/components/VDatePicker/VDatePicker.js.map +1 -1
- package/es5/components/VDatePicker/VDatePickerTitle.js +30 -19
- package/es5/components/VDatePicker/VDatePickerTitle.js.map +1 -1
- package/es5/components/VDatePicker/mixins/date-picker-table.js +1 -1
- package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/es5/components/VDatePicker/util/eventHelpers.js +27 -17
- package/es5/components/VDatePicker/util/eventHelpers.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/es5/components/VGrid/VCol.js +3 -1
- package/es5/components/VGrid/VCol.js.map +1 -1
- package/es5/components/VGrid/VContainer.js +23 -10
- package/es5/components/VGrid/VContainer.js.map +1 -1
- package/es5/components/VGrid/grid.js +33 -15
- package/es5/components/VGrid/grid.js.map +1 -1
- package/es5/components/VHover/VHover.js +23 -17
- package/es5/components/VHover/VHover.js.map +1 -1
- package/es5/components/VIcon/VIcon.js +77 -53
- package/es5/components/VIcon/VIcon.js.map +1 -1
- package/es5/components/VItemGroup/VItemGroup.js +5 -0
- package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
- package/es5/components/VLabel/VLabel.js +3 -1
- package/es5/components/VLabel/VLabel.js.map +1 -1
- package/es5/components/VOtpInput/VOtpInput.js +54 -33
- package/es5/components/VOtpInput/VOtpInput.js.map +1 -1
- package/es5/components/VOverflowBtn/VOverflowBtn.js +14 -13
- package/es5/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
- package/es5/components/VProgressLinear/VProgressLinear.js +12 -33
- package/es5/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/es5/components/VSelect/VSelect.js +4 -1
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VStepper/VStepper.js +1 -1
- package/es5/components/VStepper/VStepper.js.map +1 -1
- package/es5/components/VStepper/VStepperContent.js +2 -5
- package/es5/components/VStepper/VStepperContent.js.map +1 -1
- package/es5/components/VSwitch/VSwitch.js +1 -1
- package/es5/components/VSwitch/VSwitch.js.map +1 -1
- package/es5/components/VTabs/VTabs.js +5 -0
- package/es5/components/VTabs/VTabs.js.map +1 -1
- package/es5/components/VTabs/VTabsBar.js +3 -0
- package/es5/components/VTabs/VTabsBar.js.map +1 -1
- package/es5/components/VTextField/VTextField.js +2 -1
- package/es5/components/VTextField/VTextField.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +0 -7
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/directives/color/index.js +6 -3
- package/es5/directives/color/index.js.map +1 -1
- package/es5/directives/ripple/index.js +5 -2
- package/es5/directives/ripple/index.js.map +1 -1
- package/es5/directives/scroll/index.js +1 -2
- package/es5/directives/scroll/index.js.map +1 -1
- package/es5/directives/touch/index.js +7 -4
- package/es5/directives/touch/index.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/activatable/index.js +0 -8
- package/es5/mixins/activatable/index.js.map +1 -1
- package/es5/mixins/groupable/index.js.map +1 -1
- package/es5/mixins/positionable/index.js.map +1 -1
- package/es5/mixins/proxyable/index.js.map +1 -1
- package/es5/mixins/registrable/index.js.map +1 -1
- package/es5/mixins/selectable/index.js +4 -2
- package/es5/mixins/selectable/index.js.map +1 -1
- package/es5/mixins/toggleable/index.js.map +1 -1
- package/es5/services/goto/util.js +42 -3
- package/es5/services/goto/util.js.map +1 -1
- package/es5/services/theme/index.js +20 -71
- package/es5/services/theme/index.js.map +1 -1
- package/es5/util/mergeData.js +6 -5
- package/es5/util/mergeData.js.map +1 -1
- package/es5/util/mixins.js +4 -3
- package/es5/util/mixins.js.map +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.js +11 -6
- package/lib/components/VCalendar/VCalendarWeekly.js.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.js +5 -8
- package/lib/components/VCheckbox/VCheckbox.js.map +1 -1
- package/lib/components/VContent/VContent.js +18 -3
- package/lib/components/VContent/VContent.js.map +1 -1
- package/lib/components/VCounter/VCounter.js.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.js +17 -7
- package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.js +25 -14
- package/lib/components/VDatePicker/VDatePickerTitle.js.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/lib/components/VDatePicker/util/eventHelpers.js +26 -14
- package/lib/components/VDatePicker/util/eventHelpers.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/lib/components/VGrid/VCol.js +3 -1
- package/lib/components/VGrid/VCol.js.map +1 -1
- package/lib/components/VGrid/VContainer.js +11 -10
- package/lib/components/VGrid/VContainer.js.map +1 -1
- package/lib/components/VGrid/grid.js +15 -14
- package/lib/components/VGrid/grid.js.map +1 -1
- package/lib/components/VHover/VHover.js +23 -18
- package/lib/components/VHover/VHover.js.map +1 -1
- package/lib/components/VIcon/VIcon.js +79 -57
- package/lib/components/VIcon/VIcon.js.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.js +5 -0
- package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
- package/lib/components/VLabel/VLabel.js +3 -1
- package/lib/components/VLabel/VLabel.js.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.js +58 -34
- package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.js +14 -14
- package/lib/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.js +12 -16
- package/lib/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/lib/components/VSelect/VSelect.js +4 -1
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VStepper/VStepper.js +1 -1
- package/lib/components/VStepper/VStepper.js.map +1 -1
- package/lib/components/VStepper/VStepperContent.js +3 -6
- package/lib/components/VStepper/VStepperContent.js.map +1 -1
- package/lib/components/VSwitch/VSwitch.js +1 -1
- package/lib/components/VSwitch/VSwitch.js.map +1 -1
- package/lib/components/VTabs/VTabs.js +5 -0
- package/lib/components/VTabs/VTabs.js.map +1 -1
- package/lib/components/VTabs/VTabsBar.js +3 -0
- package/lib/components/VTabs/VTabsBar.js.map +1 -1
- package/lib/components/VTextField/VTextField.js +2 -1
- package/lib/components/VTextField/VTextField.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +1 -8
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/directives/color/index.js +6 -3
- package/lib/directives/color/index.js.map +1 -1
- package/lib/directives/ripple/index.js +5 -3
- package/lib/directives/ripple/index.js.map +1 -1
- package/lib/directives/scroll/index.js +1 -2
- package/lib/directives/scroll/index.js.map +1 -1
- package/lib/directives/touch/index.js +7 -4
- package/lib/directives/touch/index.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/activatable/index.js +1 -8
- package/lib/mixins/activatable/index.js.map +1 -1
- package/lib/mixins/groupable/index.js.map +1 -1
- package/lib/mixins/positionable/index.js.map +1 -1
- package/lib/mixins/proxyable/index.js.map +1 -1
- package/lib/mixins/registrable/index.js.map +1 -1
- package/lib/mixins/selectable/index.js +9 -7
- package/lib/mixins/selectable/index.js.map +1 -1
- package/lib/mixins/toggleable/index.js.map +1 -1
- package/lib/services/goto/util.js +42 -3
- package/lib/services/goto/util.js.map +1 -1
- package/lib/services/theme/index.js +18 -64
- package/lib/services/theme/index.js.map +1 -1
- package/lib/util/mergeData.js +6 -5
- package/lib/util/mergeData.js.map +1 -1
- package/lib/util/mixins.js +3 -2
- package/lib/util/mixins.js.map +1 -1
- package/package.json +2 -2
- package/src/components/VAlert/__tests__/__snapshots__/VAlert.spec.ts.snap +4 -4
- package/src/components/VAppBar/__tests__/__snapshots__/VAppBarNavIcon.spec.ts.snap +2 -2
- package/src/components/VAutocomplete/__tests__/VAutocomplete.spec.ts +75 -20
- package/src/components/VAutocomplete/__tests__/VAutocomplete2.spec.ts +38 -40
- package/src/components/VAutocomplete/__tests__/VAutocomplete3.spec.ts +26 -26
- package/src/components/VBanner/__tests__/__snapshots__/VBanner.spec.ts.snap +2 -2
- package/src/components/VBtn/__tests__/VBtn.spec.ts +8 -4
- package/src/components/VCalendar/VCalendarWeekly.ts +12 -5
- package/src/components/VCalendar/__tests__/VCalendar.spec.ts +1 -1
- package/src/components/VCalendar/__tests__/VCalendarCategory.spec.ts +5 -5
- package/src/components/VCalendar/__tests__/__snapshots__/VCalendar.spec.ts.snap +167 -168
- package/src/components/VCheckbox/VCheckbox.ts +4 -9
- package/src/components/VCheckbox/__tests__/VCheckbox.spec.ts +7 -1
- package/src/components/VCheckbox/__tests__/__snapshots__/VCheckbox.spec.ts.snap +54 -50
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +18 -18
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +10 -10
- package/src/components/VCombobox/__tests__/VCombobox-multiple.spec.ts +89 -69
- package/src/components/VCombobox/__tests__/VCombobox.spec.ts +17 -12
- package/src/components/VContent/VContent.ts +10 -2
- package/src/components/VCounter/VCounter.ts +1 -1
- package/src/components/VCounter/__tests__/VCounter.spec.ts +10 -25
- package/src/components/VDataIterator/__tests__/__snapshots__/VDataFooter.spec.ts.snap +42 -42
- package/src/components/VDataIterator/__tests__/__snapshots__/VDataIterator.spec.ts.snap +30 -30
- package/src/components/VDataTable/__tests__/VDataTable.spec.ts +1 -1
- package/src/components/VDataTable/__tests__/VDataTableHeader.spec.ts +6 -10
- package/src/components/VDataTable/__tests__/VEditDialog.spec.ts +24 -21
- package/src/components/VDataTable/__tests__/__snapshots__/VDataTable.spec.ts.snap +409 -409
- package/src/components/VDataTable/__tests__/__snapshots__/VDataTableHeader.spec.ts.snap +70 -70
- package/src/components/VDataTable/mixins/__tests__/__snapshots__/header.spec.ts.snap +8 -8
- package/src/components/VDataTable/mixins/__tests__/header.spec.ts +3 -3
- package/src/components/VDatePicker/VDatePicker.ts +23 -7
- package/src/components/VDatePicker/VDatePickerTitle.ts +28 -16
- package/src/components/VDatePicker/__tests__/VDatePicker.date.spec.ts +86 -124
- package/src/components/VDatePicker/__tests__/VDatePicker.month.spec.ts +85 -63
- package/src/components/VDatePicker/__tests__/VDatePickerHeader.spec.ts +12 -27
- package/src/components/VDatePicker/__tests__/VDatePickerTitle.spec.ts +9 -5
- package/src/components/VDatePicker/__tests__/VDatePickerYears.spec.ts +4 -4
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.date.spec.ts.snap +27 -9
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.month.spec.ts.snap +45 -35
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerTitle.spec.ts.snap +15 -5
- package/src/components/VDatePicker/mixins/date-picker-table.ts +1 -1
- package/src/components/VDatePicker/util/eventHelpers.ts +33 -13
- package/src/components/VExpansionPanel/VExpansionPanelContent.ts +5 -8
- package/src/components/VExpansionPanel/VExpansionPanelHeader.ts +10 -14
- package/src/components/VExpansionPanel/__tests__/VExpansionPanelHeader.spec.ts +6 -4
- package/src/components/VExpansionPanel/__tests__/VExpansionPanels.spec.ts +9 -5
- package/src/components/VExpansionPanel/__tests__/__snapshots__/VExpansionPanel.spec.ts.snap +4 -4
- package/src/components/VFileInput/__tests__/__snapshots__/VFileInput.spec.ts.snap +38 -38
- package/src/components/VFooter/__tests__/VFooter.spec.ts +28 -21
- package/src/components/VGrid/VCol.ts +1 -1
- package/src/components/VGrid/VContainer.ts +12 -10
- package/src/components/VGrid/__tests__/VCol.spec.ts +4 -2
- package/src/components/VGrid/__tests__/VGrid.spec.ts +2 -3
- package/src/components/VGrid/grid.ts +14 -17
- package/src/components/VHover/VHover.ts +21 -17
- package/src/components/VHover/__tests__/VHover.spec.ts +44 -28
- package/src/components/VIcon/VIcon.ts +72 -53
- package/src/components/VIcon/__tests__/VIcon.spec.ts +86 -176
- package/src/components/VIcon/__tests__/__snapshots__/VIcon.spec.ts.snap +19 -74
- package/src/components/VItemGroup/VItemGroup.ts +5 -0
- package/src/components/VItemGroup/__tests__/VItem.spec.ts +20 -12
- package/src/components/VLabel/VLabel.ts +1 -1
- package/src/components/VList/__tests__/VListGroup.spec.ts +1 -1
- package/src/components/VList/__tests__/VListItemAction.spec.ts +32 -31
- package/src/components/VList/__tests__/__snapshots__/VListGroup.spec.ts.snap +2 -2
- package/src/components/VList/__tests__/__snapshots__/VListItemAction.spec.ts.snap +20 -6
- package/src/components/VOtpInput/VOtpInput.ts +57 -32
- package/src/components/VOtpInput/__tests__/VOtpInput.spec.ts +75 -78
- package/src/components/VOverflowBtn/VOverflowBtn.ts +13 -10
- package/src/components/VOverflowBtn/__tests__/VOverflowBtn.spec.ts +6 -6
- package/src/components/VOverflowBtn/__tests__/__snapshots__/VOverflowBtn.spec.ts.snap +38 -46
- package/src/components/VPagination/__tests__/__snapshots__/VPagination.spec.ts.snap +32 -32
- package/src/components/VProgressLinear/VProgressLinear.ts +13 -18
- package/src/components/VProgressLinear/__tests__/VProgressLinear.spec.ts +20 -12
- package/src/components/VRadioGroup/__tests__/VRadio.spec.ts +57 -44
- package/src/components/VRadioGroup/__tests__/VRadioGroup.spec.ts +4 -4
- package/src/components/VRadioGroup/__tests__/__snapshots__/VRadio.spec.ts.snap +29 -33
- package/src/components/VRadioGroup/__tests__/__snapshots__/VRadioGroup.spec.ts.snap +10 -18
- package/src/components/VRating/__tests__/VRating.spec.ts +24 -29
- package/src/components/VResponsive/__tests__/VResponsive.spec.ts +10 -5
- package/src/components/VSelect/VSelect.ts +5 -1
- package/src/components/VSelect/__tests__/VSelect2.spec.ts +5 -5
- package/src/components/VSelect/__tests__/VSelect3.spec.ts +7 -7
- package/src/components/VSelect/__tests__/VSelect4.spec.ts +2 -2
- package/src/components/VSelect/__tests__/__snapshots__/VSelect2.spec.ts.snap +4 -4
- package/src/components/VSelect/__tests__/__snapshots__/VSelect3.spec.ts.snap +0 -284
- package/src/components/VSelect/__tests__/__snapshots__/VSelectList.spec.ts.snap +30 -27
- package/src/components/VSlideGroup/__tests__/VSlideGroup.spec.ts +70 -62
- package/src/components/VSlideGroup/__tests__/__snapshots__/VSlideGroup.spec.ts.snap +13 -34
- package/src/components/VSnackbar/__tests__/VSnackbar.spec.ts +46 -37
- package/src/components/VStepper/VStepper.ts +2 -2
- package/src/components/VStepper/VStepperContent.ts +7 -12
- package/src/components/VStepper/__tests__/VStepper.spec.ts +3 -3
- package/src/components/VStepper/__tests__/VStepperContent.spec.ts +25 -6
- package/src/components/VStepper/__tests__/__snapshots__/VStepperStep.spec.ts.snap +10 -12
- package/src/components/VSwitch/VSwitch.ts +1 -1
- package/src/components/VSwitch/__tests__/VSwitch.spec.ts +4 -7
- package/src/components/VSwitch/__tests__/__snapshots__/VSwitch.spec.ts.snap +11 -15
- package/src/components/VTabs/VTabs.ts +5 -0
- package/src/components/VTabs/VTabsBar.ts +4 -0
- package/src/components/VTabs/__tests__/VTabs.spec.ts +65 -0
- package/src/components/VTextField/VTextField.ts +2 -1
- package/src/components/VTextField/__tests__/VTextField.spec.ts +24 -27
- package/src/components/VTextField/__tests__/__snapshots__/VTextField.spec.ts.snap +49 -73
- package/src/components/VTextarea/__tests__/__snapshots__/VTextarea.spec.ts.snap +16 -6
- package/src/components/VThemeProvider/__tests__/VThemeProvider.spec.ts +49 -10
- package/src/components/VTimePicker/__tests__/VTimePicker.spec.ts +3 -3
- package/src/components/VTimePicker/__tests__/VTimePickerTitle.spec.ts +3 -3
- package/src/components/VTimeline/__tests__/__snapshots__/VTimelineItem.spec.ts.snap +2 -2
- package/src/components/VTooltip/VTooltip.ts +0 -6
- package/src/components/VTooltip/__tests__/VTooltip.spec.ts +12 -11
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeview.spec.ts.snap +42 -42
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeviewNode.spec.ts.snap +2 -2
- package/src/directives/click-outside/__tests__/click-outside-shadow-dom.spec.ts +4 -4
- package/src/directives/click-outside/__tests__/click-outside.spec.ts +3 -3
- package/src/directives/color/__tests__/color.spec.ts +54 -34
- package/src/directives/color/index.ts +7 -3
- package/src/directives/intersect/__tests__/intersect.spec.ts +7 -7
- package/src/directives/mutate/__tests__/mutate.spec.ts +32 -26
- package/src/directives/resize/__tests__/resize.spec.ts +5 -5
- package/src/directives/ripple/__tests__/ripple.spec.ts +34 -36
- package/src/directives/ripple/index.ts +3 -6
- package/src/directives/scroll/__tests__/scroll.spec.ts +13 -13
- package/src/directives/scroll/index.ts +0 -1
- package/src/directives/touch/__tests__/touch.spec.ts +23 -16
- package/src/directives/touch/index.ts +6 -4
- package/src/globals.d.ts +6 -6
- package/src/mixins/activatable/__tests__/activatable.spec.ts +55 -55
- package/src/mixins/activatable/index.ts +0 -6
- package/src/mixins/dependent/__tests__/dependent.spec.ts +72 -33
- package/src/mixins/detachable/__tests__/detachable.spec.ts +45 -31
- package/src/mixins/groupable/index.ts +6 -6
- package/src/mixins/positionable/index.ts +2 -2
- package/src/mixins/proxyable/index.ts +2 -2
- package/src/mixins/registrable/index.ts +4 -4
- package/src/mixins/selectable/index.ts +10 -7
- package/src/mixins/toggleable/index.ts +2 -2
- package/src/services/goto/__tests__/goto.spec.ts +146 -1
- package/src/services/goto/util.ts +44 -5
- package/src/services/theme/__tests__/__snapshots__/theme.spec.ts.snap +0 -1128
- package/src/services/theme/__tests__/theme.spec.ts +81 -83
- package/src/services/theme/index.ts +22 -60
- package/src/util/__tests__/dom.spec.ts +8 -5
- package/src/util/__tests__/helpers.spec.ts +1 -1
- package/src/util/__tests__/mergeData.spec.ts +8 -8
- package/src/util/mergeData.ts +10 -5
- package/src/util/mixins.ts +24 -7
- package/types/alacarte.d.ts +14 -14
- package/types/index.d.ts +8 -8
- package/types/lib.d.ts +173 -173
|
@@ -14,10 +14,12 @@ describe('VExpansionPanelHeader', () => {
|
|
|
14
14
|
beforeEach(() => {
|
|
15
15
|
mountFunction = (options = {}) => {
|
|
16
16
|
return mount(VExpansionPanelHeader, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
global: {
|
|
18
|
+
provide: {
|
|
19
|
+
expansionPanel: {
|
|
20
|
+
registerHeader: () => {},
|
|
21
|
+
unregisterHeader: () => {},
|
|
22
|
+
},
|
|
21
23
|
},
|
|
22
24
|
},
|
|
23
25
|
...options,
|
|
@@ -4,12 +4,16 @@ import VExpansionPanels from '../VExpansionPanels'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
|
|
7
|
+
VueWrapper,
|
|
8
|
+
MountingOptions,
|
|
9
|
+
enableAutoUnmount,
|
|
8
10
|
} from '@vue/test-utils'
|
|
9
11
|
|
|
10
12
|
describe('VExpansionPanels.ts', () => {
|
|
11
13
|
type Instance = InstanceType<typeof VExpansionPanels>
|
|
12
|
-
let mountFunction: (options?:
|
|
14
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
15
|
+
|
|
16
|
+
enableAutoUnmount(afterEach)
|
|
13
17
|
|
|
14
18
|
beforeEach(() => {
|
|
15
19
|
mountFunction = (options = {}) => {
|
|
@@ -19,9 +23,9 @@ describe('VExpansionPanels.ts', () => {
|
|
|
19
23
|
}
|
|
20
24
|
})
|
|
21
25
|
|
|
22
|
-
it('should work', () => {
|
|
26
|
+
it('should work', async () => {
|
|
23
27
|
const wrapper = mountFunction({
|
|
24
|
-
|
|
28
|
+
props: { modelValue: 0 },
|
|
25
29
|
})
|
|
26
30
|
|
|
27
31
|
const item = {
|
|
@@ -35,7 +39,7 @@ describe('VExpansionPanels.ts', () => {
|
|
|
35
39
|
expect(item.isActive).toBe(true)
|
|
36
40
|
expect(item.nextIsActive).toBe(false)
|
|
37
41
|
|
|
38
|
-
wrapper.setProps({
|
|
42
|
+
await wrapper.setProps({ modelValue: 1 })
|
|
39
43
|
wrapper.vm.updateItem(item, 0)
|
|
40
44
|
|
|
41
45
|
expect(item.isActive).toBe(false)
|
|
@@ -10,8 +10,8 @@ exports[`VExpansionPanel should hide actions and match snapshot 1`] = `
|
|
|
10
10
|
props="[object Object]"
|
|
11
11
|
>
|
|
12
12
|
<div class="v-expansion-panel-header__icon">
|
|
13
|
-
<i
|
|
14
|
-
|
|
13
|
+
<i class="v-icon notranslate theme--light mdi mdi-chevron-down"
|
|
14
|
+
aria-hidden="true"
|
|
15
15
|
>
|
|
16
16
|
</i>
|
|
17
17
|
</div>
|
|
@@ -28,8 +28,8 @@ exports[`VExpansionPanel should hide actions and match snapshot 2`] = `
|
|
|
28
28
|
aria-expanded="false"
|
|
29
29
|
>
|
|
30
30
|
<div class="v-expansion-panel-header__icon">
|
|
31
|
-
<i
|
|
32
|
-
|
|
31
|
+
<i class="v-icon notranslate theme--light mdi mdi-chevron-down"
|
|
32
|
+
aria-hidden="true"
|
|
33
33
|
>
|
|
34
34
|
</i>
|
|
35
35
|
</div>
|
|
@@ -4,8 +4,8 @@ exports[`VFileInput.ts should be unclearable 1`] = `
|
|
|
4
4
|
<div class="v-input theme--light v-text-field v-file-input">
|
|
5
5
|
<div class="v-input__prepend-outer">
|
|
6
6
|
<div class="v-input__icon v-input__icon--prepend">
|
|
7
|
-
<button
|
|
8
|
-
|
|
7
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
8
|
+
aria-hidden="false"
|
|
9
9
|
type="button"
|
|
10
10
|
aria-label="File input prepended action"
|
|
11
11
|
>
|
|
@@ -43,8 +43,8 @@ exports[`VFileInput.ts should display file size 1`] = `
|
|
|
43
43
|
<div class="v-input v-input--is-label-active v-input--is-dirty theme--light v-text-field v-file-input">
|
|
44
44
|
<div class="v-input__prepend-outer">
|
|
45
45
|
<div class="v-input__icon v-input__icon--prepend">
|
|
46
|
-
<button
|
|
47
|
-
|
|
46
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
47
|
+
aria-hidden="false"
|
|
48
48
|
type="button"
|
|
49
49
|
aria-label="File input prepended action"
|
|
50
50
|
>
|
|
@@ -70,8 +70,8 @@ exports[`VFileInput.ts should display file size 1`] = `
|
|
|
70
70
|
</div>
|
|
71
71
|
<div class="v-input__append-inner">
|
|
72
72
|
<div class="v-input__icon v-input__icon--clear">
|
|
73
|
-
<button
|
|
74
|
-
|
|
73
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-close"
|
|
74
|
+
aria-hidden="false"
|
|
75
75
|
type="button"
|
|
76
76
|
aria-label="Clear File input"
|
|
77
77
|
tabindex="-1"
|
|
@@ -94,8 +94,8 @@ exports[`VFileInput.ts should display file size 2`] = `
|
|
|
94
94
|
<div class="v-input v-input--is-label-active v-input--is-dirty theme--light v-text-field v-file-input">
|
|
95
95
|
<div class="v-input__prepend-outer">
|
|
96
96
|
<div class="v-input__icon v-input__icon--prepend">
|
|
97
|
-
<button
|
|
98
|
-
|
|
97
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
98
|
+
aria-hidden="false"
|
|
99
99
|
type="button"
|
|
100
100
|
aria-label="File input prepended action"
|
|
101
101
|
>
|
|
@@ -121,8 +121,8 @@ exports[`VFileInput.ts should display file size 2`] = `
|
|
|
121
121
|
</div>
|
|
122
122
|
<div class="v-input__append-inner">
|
|
123
123
|
<div class="v-input__icon v-input__icon--clear">
|
|
124
|
-
<button
|
|
125
|
-
|
|
124
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-close"
|
|
125
|
+
aria-hidden="false"
|
|
126
126
|
type="button"
|
|
127
127
|
aria-label="Clear File input"
|
|
128
128
|
tabindex="-1"
|
|
@@ -145,8 +145,8 @@ exports[`VFileInput.ts should display total size in counter 1`] = `
|
|
|
145
145
|
<div class="v-input v-input--is-label-active v-input--is-dirty theme--light v-text-field v-file-input">
|
|
146
146
|
<div class="v-input__prepend-outer">
|
|
147
147
|
<div class="v-input__icon v-input__icon--prepend">
|
|
148
|
-
<button
|
|
149
|
-
|
|
148
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
149
|
+
aria-hidden="false"
|
|
150
150
|
type="button"
|
|
151
151
|
aria-label="File input prepended action"
|
|
152
152
|
>
|
|
@@ -172,8 +172,8 @@ exports[`VFileInput.ts should display total size in counter 1`] = `
|
|
|
172
172
|
</div>
|
|
173
173
|
<div class="v-input__append-inner">
|
|
174
174
|
<div class="v-input__icon v-input__icon--clear">
|
|
175
|
-
<button
|
|
176
|
-
|
|
175
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-close"
|
|
176
|
+
aria-hidden="false"
|
|
177
177
|
type="button"
|
|
178
178
|
aria-label="Clear File input"
|
|
179
179
|
tabindex="-1"
|
|
@@ -199,8 +199,8 @@ exports[`VFileInput.ts should display total size in counter 2`] = `
|
|
|
199
199
|
<div class="v-input v-input--is-label-active v-input--is-dirty theme--light v-text-field v-file-input">
|
|
200
200
|
<div class="v-input__prepend-outer">
|
|
201
201
|
<div class="v-input__icon v-input__icon--prepend">
|
|
202
|
-
<button
|
|
203
|
-
|
|
202
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
203
|
+
aria-hidden="false"
|
|
204
204
|
type="button"
|
|
205
205
|
aria-label="File input prepended action"
|
|
206
206
|
>
|
|
@@ -226,8 +226,8 @@ exports[`VFileInput.ts should display total size in counter 2`] = `
|
|
|
226
226
|
</div>
|
|
227
227
|
<div class="v-input__append-inner">
|
|
228
228
|
<div class="v-input__icon v-input__icon--clear">
|
|
229
|
-
<button
|
|
230
|
-
|
|
229
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-close"
|
|
230
|
+
aria-hidden="false"
|
|
231
231
|
type="button"
|
|
232
232
|
aria-label="Clear File input"
|
|
233
233
|
tabindex="-1"
|
|
@@ -253,8 +253,8 @@ exports[`VFileInput.ts should render 1`] = `
|
|
|
253
253
|
<div class="v-input theme--light v-text-field v-file-input">
|
|
254
254
|
<div class="v-input__prepend-outer">
|
|
255
255
|
<div class="v-input__icon v-input__icon--prepend">
|
|
256
|
-
<button
|
|
257
|
-
|
|
256
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
257
|
+
aria-hidden="false"
|
|
258
258
|
type="button"
|
|
259
259
|
aria-label="File input prepended action"
|
|
260
260
|
>
|
|
@@ -296,8 +296,8 @@ exports[`VFileInput.ts should render chips 1`] = `
|
|
|
296
296
|
<div class="v-input v-input--is-label-active v-input--is-dirty theme--light v-text-field v-file-input">
|
|
297
297
|
<div class="v-input__prepend-outer">
|
|
298
298
|
<div class="v-input__icon v-input__icon--prepend">
|
|
299
|
-
<button
|
|
300
|
-
|
|
299
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
300
|
+
aria-hidden="false"
|
|
301
301
|
type="button"
|
|
302
302
|
aria-label="File input prepended action"
|
|
303
303
|
>
|
|
@@ -327,8 +327,8 @@ exports[`VFileInput.ts should render chips 1`] = `
|
|
|
327
327
|
</div>
|
|
328
328
|
<div class="v-input__append-inner">
|
|
329
329
|
<div class="v-input__icon v-input__icon--clear">
|
|
330
|
-
<button
|
|
331
|
-
|
|
330
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-close"
|
|
331
|
+
aria-hidden="false"
|
|
332
332
|
type="button"
|
|
333
333
|
aria-label="Clear File input"
|
|
334
334
|
tabindex="-1"
|
|
@@ -351,8 +351,8 @@ exports[`VFileInput.ts should render counter 1`] = `
|
|
|
351
351
|
<div class="v-input v-input--is-label-active v-input--is-dirty theme--light v-text-field v-file-input">
|
|
352
352
|
<div class="v-input__prepend-outer">
|
|
353
353
|
<div class="v-input__icon v-input__icon--prepend">
|
|
354
|
-
<button
|
|
355
|
-
|
|
354
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
355
|
+
aria-hidden="false"
|
|
356
356
|
type="button"
|
|
357
357
|
aria-label="File input prepended action"
|
|
358
358
|
>
|
|
@@ -378,8 +378,8 @@ exports[`VFileInput.ts should render counter 1`] = `
|
|
|
378
378
|
</div>
|
|
379
379
|
<div class="v-input__append-inner">
|
|
380
380
|
<div class="v-input__icon v-input__icon--clear">
|
|
381
|
-
<button
|
|
382
|
-
|
|
381
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-close"
|
|
382
|
+
aria-hidden="false"
|
|
383
383
|
type="button"
|
|
384
384
|
aria-label="Clear File input"
|
|
385
385
|
tabindex="-1"
|
|
@@ -405,8 +405,8 @@ exports[`VFileInput.ts should render multiple 1`] = `
|
|
|
405
405
|
<div class="v-input theme--light v-text-field v-file-input">
|
|
406
406
|
<div class="v-input__prepend-outer">
|
|
407
407
|
<div class="v-input__icon v-input__icon--prepend">
|
|
408
|
-
<button
|
|
409
|
-
|
|
408
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
409
|
+
aria-hidden="false"
|
|
410
410
|
type="button"
|
|
411
411
|
aria-label="File input prepended action"
|
|
412
412
|
>
|
|
@@ -449,8 +449,8 @@ exports[`VFileInput.ts should render small chips 1`] = `
|
|
|
449
449
|
<div class="v-input v-input--is-label-active v-input--is-dirty theme--light v-text-field v-file-input">
|
|
450
450
|
<div class="v-input__prepend-outer">
|
|
451
451
|
<div class="v-input__icon v-input__icon--prepend">
|
|
452
|
-
<button
|
|
453
|
-
|
|
452
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
453
|
+
aria-hidden="false"
|
|
454
454
|
type="button"
|
|
455
455
|
aria-label="File input prepended action"
|
|
456
456
|
>
|
|
@@ -480,8 +480,8 @@ exports[`VFileInput.ts should render small chips 1`] = `
|
|
|
480
480
|
</div>
|
|
481
481
|
<div class="v-input__append-inner">
|
|
482
482
|
<div class="v-input__icon v-input__icon--clear">
|
|
483
|
-
<button
|
|
484
|
-
|
|
483
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-close"
|
|
484
|
+
aria-hidden="false"
|
|
485
485
|
type="button"
|
|
486
486
|
aria-label="Clear File input"
|
|
487
487
|
tabindex="-1"
|
|
@@ -506,8 +506,8 @@ exports[`VFileInput.ts should render with hideInput prop like original Vuetify 1
|
|
|
506
506
|
>
|
|
507
507
|
<div class="v-input__prepend-outer">
|
|
508
508
|
<div class="v-input__icon v-input__icon--prepend">
|
|
509
|
-
<button
|
|
510
|
-
|
|
509
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
510
|
+
aria-hidden="false"
|
|
511
511
|
type="button"
|
|
512
512
|
aria-label="File input prepended action"
|
|
513
513
|
>
|
|
@@ -585,8 +585,8 @@ exports[`VFileInput.ts should set display none if hide-input prop is set 1`] = `
|
|
|
585
585
|
<div class="v-input theme--light v-text-field v-file-input">
|
|
586
586
|
<div class="v-input__prepend-outer">
|
|
587
587
|
<div class="v-input__icon v-input__icon--prepend">
|
|
588
|
-
<button
|
|
589
|
-
|
|
588
|
+
<button class="v-icon--link v-icon notranslate theme--light mdi mdi-paperclip"
|
|
589
|
+
aria-hidden="false"
|
|
590
590
|
type="button"
|
|
591
591
|
aria-label="File input prepended action"
|
|
592
592
|
>
|
|
@@ -4,21 +4,26 @@ import VFooter from '../VFooter'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
|
|
7
|
+
VueWrapper,
|
|
8
|
+
enableAutoUnmount,
|
|
8
9
|
} from '@vue/test-utils'
|
|
9
10
|
|
|
10
11
|
describe('VFooter.ts', () => {
|
|
11
12
|
type Instance = InstanceType<typeof VFooter>
|
|
12
|
-
let mountFunction: (options?: object) =>
|
|
13
|
+
let mountFunction: (options?: object) => VueWrapper<Instance>
|
|
14
|
+
|
|
15
|
+
enableAutoUnmount(afterEach)
|
|
13
16
|
|
|
14
17
|
beforeEach(() => {
|
|
15
18
|
mountFunction = (options = {}) => {
|
|
16
19
|
return mount(VFooter, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
global: {
|
|
21
|
+
mocks: {
|
|
22
|
+
$vuetify: {
|
|
23
|
+
application: {
|
|
24
|
+
register: () => {},
|
|
25
|
+
unregister: () => {},
|
|
26
|
+
},
|
|
22
27
|
},
|
|
23
28
|
},
|
|
24
29
|
},
|
|
@@ -27,30 +32,32 @@ describe('VFooter.ts', () => {
|
|
|
27
32
|
}
|
|
28
33
|
})
|
|
29
34
|
|
|
30
|
-
it('should return insetFooter', () => {
|
|
35
|
+
it('should return insetFooter', async () => {
|
|
31
36
|
const wrapper = mountFunction()
|
|
32
37
|
|
|
33
38
|
expect(wrapper.vm.applicationProperty).toBe('footer')
|
|
34
39
|
|
|
35
|
-
wrapper.setProps({ inset: true })
|
|
40
|
+
await wrapper.setProps({ inset: true })
|
|
36
41
|
|
|
37
42
|
expect(wrapper.vm.applicationProperty).toBe('insetFooter')
|
|
38
43
|
})
|
|
39
44
|
|
|
40
45
|
it('should return computed values when using app', async () => {
|
|
41
46
|
const wrapper = mountFunction({
|
|
42
|
-
|
|
47
|
+
props: {
|
|
43
48
|
app: true,
|
|
44
49
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
global: {
|
|
51
|
+
mocks: {
|
|
52
|
+
$vuetify: {
|
|
53
|
+
application: {
|
|
54
|
+
footer: 0,
|
|
55
|
+
bottom: 64,
|
|
56
|
+
left: 300,
|
|
57
|
+
right: 200,
|
|
58
|
+
register: () => {},
|
|
59
|
+
unregister: () => {},
|
|
60
|
+
},
|
|
54
61
|
},
|
|
55
62
|
},
|
|
56
63
|
},
|
|
@@ -60,10 +67,10 @@ describe('VFooter.ts', () => {
|
|
|
60
67
|
expect(wrapper.vm.computedLeft).toBe(0)
|
|
61
68
|
expect(wrapper.vm.computedRight).toBe(0)
|
|
62
69
|
|
|
63
|
-
wrapper.setProps({ inset: true })
|
|
70
|
+
await wrapper.setProps({ inset: true })
|
|
64
71
|
expect(wrapper.vm.computedLeft).toBe(300)
|
|
65
72
|
expect(wrapper.vm.computedRight).toBe(200)
|
|
66
73
|
|
|
67
|
-
wrapper.setProps({ height: 48 })
|
|
74
|
+
await wrapper.setProps({ height: 48 })
|
|
68
75
|
})
|
|
69
76
|
})
|
|
@@ -98,7 +98,7 @@ export default defineComponent({
|
|
|
98
98
|
render (): VNode {
|
|
99
99
|
const props = this.$props
|
|
100
100
|
const data = this.$attrs
|
|
101
|
-
const children = this.$slots.default()
|
|
101
|
+
const children = this.$slots.default?.() || []
|
|
102
102
|
// const {parent} = getCurrentInstance()
|
|
103
103
|
|
|
104
104
|
// Super-fast memoization based on props, 5x faster than JSON.stringify
|
|
@@ -10,7 +10,6 @@ import { defineComponent, h } from 'vue'
|
|
|
10
10
|
export default defineComponent({
|
|
11
11
|
name: 'v-container',
|
|
12
12
|
extends: Grid('container'),
|
|
13
|
-
functional: true,
|
|
14
13
|
props: {
|
|
15
14
|
id: String,
|
|
16
15
|
tag: {
|
|
@@ -48,18 +47,21 @@ export default defineComponent({
|
|
|
48
47
|
})
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const data = mergeData(this.$attrs, {
|
|
51
|
+
class: [
|
|
52
|
+
'container',
|
|
53
|
+
{ 'container--fluid': this.fluid },
|
|
54
|
+
...(classes || []),
|
|
55
|
+
],
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
if (this.id) {
|
|
59
|
+
data.id = this.id
|
|
60
|
+
}
|
|
55
61
|
|
|
56
62
|
return h(
|
|
57
63
|
this.tag,
|
|
58
|
-
|
|
59
|
-
class: Array<any>({
|
|
60
|
-
'container--fluid': this.fluid,
|
|
61
|
-
}).concat(classes || []).concat('container'),
|
|
62
|
-
}),
|
|
64
|
+
data,
|
|
63
65
|
this.$slots.default?.()
|
|
64
66
|
)
|
|
65
67
|
},
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
|
1
|
+
import { mount, enableAutoUnmount } from '@vue/test-utils'
|
|
2
2
|
import VCol from '../VCol'
|
|
3
3
|
|
|
4
4
|
describe('layout > col', () => {
|
|
5
|
+
enableAutoUnmount(afterEach)
|
|
6
|
+
|
|
5
7
|
it('should have default expected structure', async () => {
|
|
6
8
|
const wrapper = mount(VCol)
|
|
7
9
|
|
|
@@ -143,7 +145,7 @@ describe('layout > col', () => {
|
|
|
143
145
|
const wrapper = mount(VCol)
|
|
144
146
|
const wrapper2 = mount(VCol)
|
|
145
147
|
|
|
146
|
-
// В Vue 3 структура vnode изменилась, поэтому проверяем по-другому
|
|
147
148
|
expect(wrapper.classes()).toEqual(wrapper2.classes())
|
|
149
|
+
expect(wrapper.classes()).toContain('col')
|
|
148
150
|
})
|
|
149
151
|
})
|
|
@@ -40,13 +40,12 @@ describe('VGrid.ts', () => {
|
|
|
40
40
|
|
|
41
41
|
it('should pass the id attr', () => {
|
|
42
42
|
const wrapper = mountFunction({
|
|
43
|
-
|
|
43
|
+
props: {
|
|
44
44
|
id: 'test',
|
|
45
45
|
},
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
expect(wrapper.attributes('id')).toBeUndefined()
|
|
48
|
+
expect(wrapper.attributes('id')).toBe('test')
|
|
50
49
|
})
|
|
51
50
|
|
|
52
51
|
it('should not pass data-* attrs as classes', () => {
|
|
@@ -6,8 +6,6 @@ export default function VGrid (name: string) {
|
|
|
6
6
|
return defineComponent({
|
|
7
7
|
name: `v-${name}`,
|
|
8
8
|
|
|
9
|
-
functional: true,
|
|
10
|
-
|
|
11
9
|
props: {
|
|
12
10
|
id: String,
|
|
13
11
|
tag: {
|
|
@@ -16,23 +14,23 @@ export default function VGrid (name: string) {
|
|
|
16
14
|
},
|
|
17
15
|
},
|
|
18
16
|
|
|
19
|
-
render
|
|
20
|
-
const data = this.$attrs
|
|
21
|
-
const children = this.$slots
|
|
22
|
-
const
|
|
17
|
+
render() {
|
|
18
|
+
const data: any = { ...this.$attrs }
|
|
19
|
+
const children = this.$slots?.default?.() || []
|
|
20
|
+
const componentProps = this.$props
|
|
23
21
|
|
|
24
|
-
data.
|
|
22
|
+
data.class = [name, data.class].filter(Boolean)
|
|
25
23
|
|
|
26
|
-
const { attrs } = data
|
|
27
|
-
if (
|
|
24
|
+
const { attrs: dataAttrs } = data
|
|
25
|
+
if (dataAttrs) {
|
|
28
26
|
// reset attrs to extract utility clases like pa-3
|
|
29
27
|
data.attrs = {}
|
|
30
|
-
const classes = Object.keys(
|
|
28
|
+
const classes = Object.keys(dataAttrs).filter(key => {
|
|
31
29
|
// TODO: Remove once resolved
|
|
32
30
|
// https://github.com/vuejs/vue/issues/7841
|
|
33
31
|
if (key === 'slot') return false
|
|
34
32
|
|
|
35
|
-
const value =
|
|
33
|
+
const value = dataAttrs[key]
|
|
36
34
|
|
|
37
35
|
// add back data attributes like data-test="foo" but do not
|
|
38
36
|
// add them as classes
|
|
@@ -44,15 +42,14 @@ export default function VGrid (name: string) {
|
|
|
44
42
|
return value || typeof value === 'string'
|
|
45
43
|
})
|
|
46
44
|
|
|
47
|
-
if (classes.length) data.
|
|
45
|
+
if (classes.length) data.class = [...data.class, ...classes]
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
if (
|
|
51
|
-
data.
|
|
52
|
-
data.domProps.id = props.id
|
|
48
|
+
if (componentProps?.id) {
|
|
49
|
+
data.id = componentProps.id
|
|
53
50
|
}
|
|
54
51
|
|
|
55
|
-
return h(
|
|
56
|
-
}
|
|
52
|
+
return h(componentProps?.tag || 'div', data, children)
|
|
53
|
+
}
|
|
57
54
|
})
|
|
58
55
|
}
|
|
@@ -7,7 +7,8 @@ import mixins from '../../util/mixins'
|
|
|
7
7
|
import { consoleWarn } from '../../util/console'
|
|
8
8
|
|
|
9
9
|
// Types
|
|
10
|
-
import { VNode,
|
|
10
|
+
import { VNode, mergeProps } from 'vue'
|
|
11
|
+
import { ScopedSlotChildren } from 'vue/types/vnode'
|
|
11
12
|
|
|
12
13
|
export default mixins(
|
|
13
14
|
Delayable,
|
|
@@ -21,7 +22,7 @@ export default mixins(
|
|
|
21
22
|
type: Boolean,
|
|
22
23
|
default: false,
|
|
23
24
|
},
|
|
24
|
-
|
|
25
|
+
modelValue: {
|
|
25
26
|
type: Boolean,
|
|
26
27
|
default: undefined,
|
|
27
28
|
},
|
|
@@ -31,42 +32,45 @@ export default mixins(
|
|
|
31
32
|
|
|
32
33
|
methods: {
|
|
33
34
|
onMouseEnter () {
|
|
35
|
+
if (this.disabled) return
|
|
34
36
|
this.runDelay('open')
|
|
35
37
|
},
|
|
36
38
|
onMouseLeave () {
|
|
39
|
+
if (this.disabled) return
|
|
37
40
|
this.runDelay('close')
|
|
38
41
|
},
|
|
39
42
|
},
|
|
40
43
|
|
|
41
44
|
render (): VNode {
|
|
42
|
-
if (!this.$slots.default && this.
|
|
45
|
+
if (!this.$slots.default && this.modelValue === undefined) {
|
|
43
46
|
consoleWarn('v-hover is missing a default scopedSlot or bound value', this)
|
|
44
|
-
|
|
45
47
|
return null as any
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
if (!this.$slots.default) return null as any
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
if (this.$slots.default) {
|
|
52
|
-
element = this.$slots.default({ hover: this.isActive })
|
|
53
|
-
}
|
|
52
|
+
const slotContent = this.$slots.default({ hover: this.isActive })
|
|
54
53
|
|
|
55
|
-
if (
|
|
56
|
-
|
|
54
|
+
if (!slotContent?.length) {
|
|
55
|
+
consoleWarn('v-hover slot returned empty content', this)
|
|
56
|
+
return null as any
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
consoleWarn('v-hover should only contain a single element', this)
|
|
59
|
+
const element = slotContent[0]
|
|
61
60
|
|
|
61
|
+
if (!element?.type) {
|
|
62
|
+
consoleWarn('v-hover should only contain valid VNode elements', this)
|
|
62
63
|
return element as any
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
if (slotContent.length > 1) {
|
|
67
|
+
consoleWarn('v-hover should only contain a single element', this)
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
if (!this.disabled) {
|
|
66
|
-
element.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
mouseleave: this.onMouseLeave,
|
|
71
|
+
element.props = mergeProps(element.props || {}, {
|
|
72
|
+
onMouseenter: this.onMouseEnter,
|
|
73
|
+
onMouseleave: this.onMouseLeave,
|
|
70
74
|
})
|
|
71
75
|
}
|
|
72
76
|
|