@dimailn/vuetify 2.7.2-alpha2 → 2.7.2-alpha21
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.css +45 -45
- package/dist/vuetify.css.map +1 -1
- package/dist/vuetify.js +490 -349
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VAppBar/VAppBar.js +7 -12
- package/es5/components/VAppBar/VAppBar.js.map +1 -1
- package/es5/components/VAutocomplete/VAutocomplete.js +10 -7
- package/es5/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/es5/components/VCheckbox/VSimpleCheckbox.js +66 -35
- package/es5/components/VCheckbox/VSimpleCheckbox.js.map +1 -1
- package/es5/components/VColorPicker/VColorPicker.js +6 -6
- package/es5/components/VColorPicker/VColorPicker.js.map +1 -1
- package/es5/components/VData/VData.js +14 -2
- package/es5/components/VData/VData.js.map +1 -1
- package/es5/components/VDataIterator/VDataIterator.js +4 -3
- package/es5/components/VDataIterator/VDataIterator.js.map +1 -1
- package/es5/components/VDataTable/VDataTable.js +2 -2
- package/es5/components/VDataTable/VDataTable.js.map +1 -1
- package/es5/components/VDataTable/VDataTableHeader.js +4 -3
- package/es5/components/VDataTable/VDataTableHeader.js.map +1 -1
- package/es5/components/VDataTable/VDataTableHeaderDesktop.js +4 -2
- package/es5/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
- package/es5/components/VDataTable/VVirtualTable.js +1 -1
- package/es5/components/VDataTable/VVirtualTable.js.map +1 -1
- package/es5/components/VDataTable/mixins/header.js +1 -1
- package/es5/components/VDataTable/mixins/header.js.map +1 -1
- package/es5/components/VDatePicker/VDatePicker.js +6 -6
- package/es5/components/VDatePicker/VDatePicker.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +1 -1
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelContent.js +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelHeader.js +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/es5/components/VForm/VForm.js +8 -8
- package/es5/components/VForm/VForm.js.map +1 -1
- package/es5/components/VGrid/VCol.js +3 -3
- package/es5/components/VGrid/VCol.js.map +1 -1
- package/es5/components/VGrid/VContainer.js +3 -1
- package/es5/components/VGrid/VContainer.js.map +1 -1
- package/es5/components/VImg/VImg.js +1 -1
- package/es5/components/VImg/VImg.js.map +1 -1
- package/es5/components/VInput/VInput.js +1 -1
- package/es5/components/VInput/VInput.js.map +1 -1
- package/es5/components/VItemGroup/VItem.js +17 -18
- package/es5/components/VItemGroup/VItem.js.map +1 -1
- package/es5/components/VItemGroup/VItemGroup.js +1 -1
- package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
- package/es5/components/VList/VList.js +1 -1
- package/es5/components/VList/VList.js.map +1 -1
- package/es5/components/VList/VListGroup.js +12 -15
- package/es5/components/VList/VListGroup.js.map +1 -1
- package/es5/components/VMenu/VMenu.js +1 -1
- package/es5/components/VMenu/VMenu.js.map +1 -1
- package/es5/components/VOverlay/VOverlay.js +1 -1
- package/es5/components/VOverlay/VOverlay.js.map +1 -1
- package/es5/components/VRadioGroup/VRadioGroup.js +5 -5
- package/es5/components/VRadioGroup/VRadioGroup.js.map +1 -1
- package/es5/components/VRangeSlider/VRangeSlider.js +1 -1
- package/es5/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/es5/components/VSelect/VSelect.js +3 -5
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VSelect/VSelectList.js +7 -5
- package/es5/components/VSelect/VSelectList.js.map +1 -1
- package/es5/components/VSparkline/VSparkline.js +6 -6
- package/es5/components/VSparkline/VSparkline.js.map +1 -1
- package/es5/components/VStepper/VStepperContent.js +1 -1
- package/es5/components/VStepper/VStepperContent.js.map +1 -1
- package/es5/components/VStepper/VStepperStep.js +1 -1
- package/es5/components/VStepper/VStepperStep.js.map +1 -1
- package/es5/components/VSubheader/VSubheader.js +3 -3
- package/es5/components/VSubheader/VSubheader.js.map +1 -1
- package/es5/components/VTabs/VTab.js.map +1 -1
- package/es5/components/VTabs/VTabs.js +1 -2
- package/es5/components/VTabs/VTabs.js.map +1 -1
- package/es5/components/VTextField/VTextField.js +5 -2
- package/es5/components/VTextField/VTextField.js.map +1 -1
- package/es5/components/VToolbar/VToolbar.js +2 -3
- package/es5/components/VToolbar/VToolbar.js.map +1 -1
- package/es5/components/VTreeview/VTreeviewNode.js +1 -1
- package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/es5/components/transitions/createTransition.js +9 -4
- package/es5/components/transitions/createTransition.js.map +1 -1
- package/es5/components/transitions/expand-transition.js +8 -7
- package/es5/components/transitions/expand-transition.js.map +1 -1
- package/es5/directives/intersect/index.js +20 -7
- package/es5/directives/intersect/index.js.map +1 -1
- package/es5/directives/mutate/index.js +13 -13
- package/es5/directives/mutate/index.js.map +1 -1
- package/es5/directives/resize/index.js +8 -8
- package/es5/directives/resize/index.js.map +1 -1
- package/es5/directives/scroll/index.js +10 -9
- package/es5/directives/scroll/index.js.map +1 -1
- package/es5/directives/touch/index.js +4 -4
- package/es5/directives/touch/index.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/install.js +10 -33
- package/es5/install.js.map +1 -1
- package/es5/mixins/activatable/index.js +9 -4
- package/es5/mixins/activatable/index.js.map +1 -1
- package/es5/mixins/applicationable/index.js +4 -4
- package/es5/mixins/applicationable/index.js.map +1 -1
- package/es5/mixins/binds-attrs/index.js +1 -1
- package/es5/mixins/binds-attrs/index.js.map +1 -1
- package/es5/mixins/detachable/index.js +5 -6
- package/es5/mixins/detachable/index.js.map +1 -1
- package/es5/mixins/groupable/index.js +1 -1
- package/es5/mixins/groupable/index.js.map +1 -1
- package/es5/mixins/intersectable/index.js +2 -2
- package/es5/mixins/intersectable/index.js.map +1 -1
- package/es5/mixins/menuable/index.js +1 -1
- package/es5/mixins/menuable/index.js.map +1 -1
- package/es5/mixins/overlayable/index.js +5 -4
- package/es5/mixins/overlayable/index.js.map +1 -1
- package/es5/mixins/proxyable/index.js +0 -4
- package/es5/mixins/proxyable/index.js.map +1 -1
- package/es5/mixins/selectable/index.js +2 -5
- package/es5/mixins/selectable/index.js.map +1 -1
- package/es5/mixins/translatable/index.js +1 -1
- package/es5/mixins/translatable/index.js.map +1 -1
- package/es5/mixins/validatable/index.js +2 -2
- package/es5/mixins/validatable/index.js.map +1 -1
- package/es5/services/breakpoint/index.js +3 -1
- package/es5/services/breakpoint/index.js.map +1 -1
- package/es5/util/helpers.js +44 -0
- package/es5/util/helpers.js.map +1 -1
- package/es5/util/legacyEventsMixin.js +48 -0
- package/es5/util/legacyEventsMixin.js.map +1 -0
- package/lib/components/VAppBar/VAppBar.js +7 -11
- package/lib/components/VAppBar/VAppBar.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.js +11 -8
- package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/lib/components/VCheckbox/VSimpleCheckbox.js +72 -36
- package/lib/components/VCheckbox/VSimpleCheckbox.js.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.js +6 -6
- package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
- package/lib/components/VData/VData.js +15 -2
- package/lib/components/VData/VData.js.map +1 -1
- package/lib/components/VDataIterator/VDataIterator.js +4 -3
- package/lib/components/VDataIterator/VDataIterator.js.map +1 -1
- package/lib/components/VDataTable/VDataTable.js +2 -2
- package/lib/components/VDataTable/VDataTable.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeader.js +4 -3
- package/lib/components/VDataTable/VDataTableHeader.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.js +3 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
- package/lib/components/VDataTable/VVirtualTable.js +1 -1
- package/lib/components/VDataTable/VVirtualTable.js.map +1 -1
- package/lib/components/VDataTable/mixins/header.js +1 -1
- package/lib/components/VDataTable/mixins/header.js.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.js +6 -6
- package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +1 -1
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelContent.js +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.js +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/lib/components/VForm/VForm.js +8 -8
- package/lib/components/VForm/VForm.js.map +1 -1
- package/lib/components/VGrid/VCol.js +3 -3
- package/lib/components/VGrid/VCol.js.map +1 -1
- package/lib/components/VGrid/VContainer.js +3 -1
- package/lib/components/VGrid/VContainer.js.map +1 -1
- package/lib/components/VImg/VImg.js +1 -1
- package/lib/components/VImg/VImg.js.map +1 -1
- package/lib/components/VInput/VInput.js +1 -1
- package/lib/components/VInput/VInput.js.map +1 -1
- package/lib/components/VItemGroup/VItem.js +20 -18
- package/lib/components/VItemGroup/VItem.js.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.js +1 -1
- package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
- package/lib/components/VList/VList.js +1 -1
- package/lib/components/VList/VList.js.map +1 -1
- package/lib/components/VList/VListGroup.js +11 -15
- package/lib/components/VList/VListGroup.js.map +1 -1
- package/lib/components/VMenu/VMenu.js +1 -1
- package/lib/components/VMenu/VMenu.js.map +1 -1
- package/lib/components/VOverlay/VOverlay.js +1 -1
- package/lib/components/VOverlay/VOverlay.js.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.js +5 -7
- package/lib/components/VRadioGroup/VRadioGroup.js.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.js +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/lib/components/VSelect/VSelect.js +1 -3
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSelect/VSelectList.js +7 -5
- package/lib/components/VSelect/VSelectList.js.map +1 -1
- package/lib/components/VSparkline/VSparkline.js +6 -6
- package/lib/components/VSparkline/VSparkline.js.map +1 -1
- package/lib/components/VStepper/VStepperContent.js +1 -1
- package/lib/components/VStepper/VStepperContent.js.map +1 -1
- package/lib/components/VStepper/VStepperStep.js +1 -1
- package/lib/components/VStepper/VStepperStep.js.map +1 -1
- package/lib/components/VSubheader/VSubheader.js +2 -3
- package/lib/components/VSubheader/VSubheader.js.map +1 -1
- package/lib/components/VTabs/VTab.js.map +1 -1
- package/lib/components/VTabs/VTabs.js +1 -2
- package/lib/components/VTabs/VTabs.js.map +1 -1
- package/lib/components/VTextField/VTextField.js +5 -2
- package/lib/components/VTextField/VTextField.js.map +1 -1
- package/lib/components/VToolbar/VToolbar.js +4 -3
- package/lib/components/VToolbar/VToolbar.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.js +1 -1
- package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/lib/components/transitions/createTransition.js +1 -1
- package/lib/components/transitions/createTransition.js.map +1 -1
- package/lib/components/transitions/expand-transition.js +8 -7
- package/lib/components/transitions/expand-transition.js.map +1 -1
- package/lib/directives/intersect/index.js +20 -7
- package/lib/directives/intersect/index.js.map +1 -1
- package/lib/directives/mutate/index.js +13 -13
- package/lib/directives/mutate/index.js.map +1 -1
- package/lib/directives/resize/index.js +8 -8
- package/lib/directives/resize/index.js.map +1 -1
- package/lib/directives/scroll/index.js +10 -9
- package/lib/directives/scroll/index.js.map +1 -1
- package/lib/directives/touch/index.js +4 -4
- package/lib/directives/touch/index.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/install.js +5 -28
- package/lib/install.js.map +1 -1
- package/lib/mixins/activatable/index.js +10 -5
- package/lib/mixins/activatable/index.js.map +1 -1
- package/lib/mixins/applicationable/index.js +4 -4
- package/lib/mixins/applicationable/index.js.map +1 -1
- package/lib/mixins/binds-attrs/index.js +1 -1
- package/lib/mixins/binds-attrs/index.js.map +1 -1
- package/lib/mixins/detachable/index.js +6 -7
- package/lib/mixins/detachable/index.js.map +1 -1
- package/lib/mixins/groupable/index.js +1 -1
- package/lib/mixins/groupable/index.js.map +1 -1
- package/lib/mixins/intersectable/index.js +2 -2
- package/lib/mixins/intersectable/index.js.map +1 -1
- package/lib/mixins/menuable/index.js +1 -1
- package/lib/mixins/menuable/index.js.map +1 -1
- package/lib/mixins/overlayable/index.js +5 -4
- package/lib/mixins/overlayable/index.js.map +1 -1
- package/lib/mixins/proxyable/index.js +0 -4
- package/lib/mixins/proxyable/index.js.map +1 -1
- package/lib/mixins/selectable/index.js +2 -5
- package/lib/mixins/selectable/index.js.map +1 -1
- package/lib/mixins/translatable/index.js +1 -1
- package/lib/mixins/translatable/index.js.map +1 -1
- package/lib/mixins/validatable/index.js +2 -2
- package/lib/mixins/validatable/index.js.map +1 -1
- package/lib/services/breakpoint/index.js +3 -1
- package/lib/services/breakpoint/index.js.map +1 -1
- package/lib/util/helpers.js +42 -0
- package/lib/util/helpers.js.map +1 -1
- package/lib/util/legacyEventsMixin.js +37 -0
- package/lib/util/legacyEventsMixin.js.map +1 -0
- package/package.json +1 -1
- package/src/components/VAppBar/VAppBar.ts +11 -13
- package/src/components/VAutocomplete/VAutocomplete.ts +13 -6
- package/src/components/VBottomSheet/VBottomSheet.sass +1 -1
- package/src/components/VCheckbox/VSimpleCheckbox.ts +84 -42
- package/src/components/VCheckbox/__tests__/VSimpleCheckbox.spec.ts +46 -13
- package/src/components/VColorPicker/VColorPicker.ts +6 -6
- package/src/components/VData/VData.ts +12 -1
- package/src/components/VDataIterator/VDataIterator.ts +5 -3
- package/src/components/VDataTable/VDataTable.ts +2 -2
- package/src/components/VDataTable/VDataTableHeader.ts +5 -4
- package/src/components/VDataTable/VDataTableHeaderDesktop.ts +1 -1
- package/src/components/VDataTable/VVirtualTable.ts +1 -1
- package/src/components/VDataTable/mixins/header.ts +6 -6
- package/src/components/VDatePicker/VDatePicker.ts +6 -6
- package/src/components/VDialog/VDialog.ts +1 -1
- package/src/components/VExpansionPanel/VExpansionPanelContent.ts +1 -1
- package/src/components/VExpansionPanel/VExpansionPanelHeader.ts +1 -1
- package/src/components/VForm/VForm.ts +8 -8
- package/src/components/VGrid/VCol.ts +2 -2
- package/src/components/VGrid/VContainer.ts +1 -1
- package/src/components/VImg/VImg.ts +1 -1
- package/src/components/VInput/VInput.ts +1 -1
- package/src/components/VItemGroup/VItem.ts +25 -23
- package/src/components/VItemGroup/VItemGroup.ts +3 -3
- package/src/components/VList/VList.ts +1 -1
- package/src/components/VList/VListGroup.ts +14 -14
- package/src/components/VMenu/VMenu.sass +2 -2
- package/src/components/VMenu/VMenu.ts +1 -0
- package/src/components/VOverlay/VOverlay.ts +1 -1
- package/src/components/VRadioGroup/VRadioGroup.ts +8 -9
- package/src/components/VRangeSlider/VRangeSlider.ts +1 -1
- package/src/components/VSelect/VSelect.ts +6 -5
- package/src/components/VSelect/VSelectList.ts +5 -5
- package/src/components/VSnackbar/VSnackbar.sass +2 -2
- package/src/components/VSparkline/VSparkline.ts +6 -6
- package/src/components/VStepper/VStepperContent.ts +1 -1
- package/src/components/VStepper/VStepperStep.ts +1 -1
- package/src/components/VSubheader/VSubheader.ts +2 -2
- package/src/components/VTabs/VTab.ts +1 -1
- package/src/components/VTabs/VTabs.ts +1 -2
- package/src/components/VTabs/__tests__/VTab.spec.ts +48 -37
- package/src/components/VTabs/__tests__/VTabs.spec.ts +134 -79
- package/src/components/VTabs/__tests__/VTabsBar.spec.ts +67 -26
- package/src/components/VTabs/__tests__/VTabsSlider.spec.ts +7 -6
- package/src/components/VTabs/__tests__/__snapshots__/VTabs.spec.ts.snap +1 -3
- package/src/components/VTextField/VTextField.ts +4 -3
- package/src/components/VToolbar/VToolbar.ts +4 -5
- package/src/components/VTreeview/VTreeviewNode.ts +1 -1
- package/src/components/transitions/createTransition.ts +1 -2
- package/src/components/transitions/expand-transition.ts +9 -7
- package/src/directives/intersect/index.ts +81 -42
- package/src/directives/mutate/index.ts +58 -49
- package/src/directives/resize/index.ts +33 -14
- package/src/directives/scroll/index.ts +36 -20
- package/src/directives/touch/index.ts +37 -27
- package/src/install.ts +10 -32
- package/src/mixins/activatable/index.ts +8 -4
- package/src/mixins/applicationable/index.ts +4 -4
- package/src/mixins/binds-attrs/index.ts +1 -1
- package/src/mixins/detachable/index.ts +7 -6
- package/src/mixins/groupable/index.ts +1 -1
- package/src/mixins/intersectable/index.ts +2 -2
- package/src/mixins/menuable/index.ts +1 -1
- package/src/mixins/overlayable/index.ts +4 -5
- package/src/mixins/proxyable/index.ts +0 -5
- package/src/mixins/selectable/index.ts +3 -7
- package/src/mixins/translatable/index.ts +1 -1
- package/src/mixins/validatable/index.ts +2 -2
- package/src/services/breakpoint/index.ts +5 -0
- package/src/styles/generic/_transitions.scss +38 -38
- package/src/util/__tests__/helpers.spec.ts +62 -1
- package/src/util/helpers.ts +42 -1
- package/src/util/legacyEventsMixin.ts +34 -0
|
@@ -7,10 +7,9 @@ import { factory as GroupableFactory } from '../../mixins/groupable'
|
|
|
7
7
|
// Utilities
|
|
8
8
|
import mixins from '../../util/mixins'
|
|
9
9
|
import { consoleWarn } from '../../util/console'
|
|
10
|
+
import { defineComponent, mergeProps } from "vue"
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
import {defineComponent} from 'vue'
|
|
13
|
-
import { VNode, ScopedSlotChildren } from 'vue/types/vnode'
|
|
12
|
+
import type { VNode } from 'vue'
|
|
14
13
|
|
|
15
14
|
/* @vue/component */
|
|
16
15
|
export const BaseItem = defineComponent({
|
|
@@ -32,42 +31,45 @@ export const BaseItem = defineComponent({
|
|
|
32
31
|
},
|
|
33
32
|
},
|
|
34
33
|
|
|
35
|
-
render (): VNode {
|
|
34
|
+
render (): VNode | null {
|
|
36
35
|
if (!this.$slots.default) {
|
|
37
36
|
consoleWarn('v-item is missing a default scopedSlot', this)
|
|
38
|
-
|
|
39
|
-
return null as any
|
|
37
|
+
return null
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
const slotContent = this.$slots.default({
|
|
41
|
+
active: this.isActive,
|
|
42
|
+
toggle: this.toggle,
|
|
43
|
+
})
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
active: this.isActive,
|
|
48
|
-
toggle: this.toggle,
|
|
49
|
-
})
|
|
45
|
+
if (!slotContent || slotContent.length === 0) {
|
|
46
|
+
consoleWarn('v-item slot returned empty content', this)
|
|
47
|
+
return null
|
|
50
48
|
}
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
element = element[0]
|
|
54
|
-
}
|
|
50
|
+
let element = slotContent[0]
|
|
55
51
|
|
|
56
|
-
if (!element
|
|
57
|
-
consoleWarn('v-item should
|
|
52
|
+
if (!element) {
|
|
53
|
+
consoleWarn('v-item should contain at least one element', this)
|
|
54
|
+
return null
|
|
55
|
+
}
|
|
58
56
|
|
|
59
|
-
|
|
57
|
+
if (!element.type) {
|
|
58
|
+
consoleWarn('v-item should only contain valid VNode elements', this)
|
|
59
|
+
return element
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
element.
|
|
62
|
+
element.props = mergeProps(element.props || {}, {
|
|
63
63
|
class: {
|
|
64
64
|
[this.activeClass]: this.isActive,
|
|
65
|
-
|
|
66
|
-
}
|
|
65
|
+
"v-item--disabled": this.disabled
|
|
66
|
+
}
|
|
67
67
|
})
|
|
68
68
|
|
|
69
69
|
if (this.disabled) {
|
|
70
|
-
element.
|
|
70
|
+
element.props = mergeProps(element.props || {}, {
|
|
71
|
+
tabindex: -1
|
|
72
|
+
})
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
return element
|
|
@@ -52,8 +52,8 @@ export const BaseItemGroup = mixins(
|
|
|
52
52
|
// As long as a value is defined, show it
|
|
53
53
|
// Otherwise, check if multiple
|
|
54
54
|
// to determine which default to provide
|
|
55
|
-
internalLazyValue: this.
|
|
56
|
-
? this.
|
|
55
|
+
internalLazyValue: this.modelValue !== undefined
|
|
56
|
+
? this.modelValue
|
|
57
57
|
: this.multiple ? [] : undefined,
|
|
58
58
|
items: [] as GroupableInstance[],
|
|
59
59
|
}
|
|
@@ -102,7 +102,7 @@ export const BaseItemGroup = mixins(
|
|
|
102
102
|
|
|
103
103
|
watch: {
|
|
104
104
|
internalValue: 'updateItemsState',
|
|
105
|
-
items: 'updateItemsState'
|
|
105
|
+
items: 'updateItemsState'
|
|
106
106
|
},
|
|
107
107
|
|
|
108
108
|
created () {
|
|
@@ -75,7 +75,7 @@ export default defineComponent({
|
|
|
75
75
|
this.groups.push(content)
|
|
76
76
|
},
|
|
77
77
|
unregister (content: VListGroupInstance) {
|
|
78
|
-
const index = this.groups.findIndex(g => g
|
|
78
|
+
const index = this.groups.findIndex(g => g.$.uid === content.$.uid)
|
|
79
79
|
|
|
80
80
|
if (index > -1) this.groups.splice(index, 1)
|
|
81
81
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {h, withDirectives} from 'vue'
|
|
1
|
+
import {h, withDirectives, vShow} from 'vue'
|
|
2
2
|
// Styles
|
|
3
3
|
import './VListGroup.sass'
|
|
4
4
|
|
|
@@ -91,7 +91,7 @@ export default baseMixins.extend({
|
|
|
91
91
|
isActive (val: boolean) {
|
|
92
92
|
/* istanbul ignore else */
|
|
93
93
|
if (!this.subGroup && val) {
|
|
94
|
-
this.list && this.list.listClick(this
|
|
94
|
+
this.list && this.list.listClick(this.$.uid)
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
$route: 'onRouteChange',
|
|
@@ -102,13 +102,13 @@ export default baseMixins.extend({
|
|
|
102
102
|
|
|
103
103
|
if (this.group &&
|
|
104
104
|
this.$route &&
|
|
105
|
-
this.
|
|
105
|
+
this.modelValue == null
|
|
106
106
|
) {
|
|
107
107
|
this.isActive = this.matchRoute(this.$route.path)
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
beforeUnmount () {
|
|
112
112
|
this.list && this.list.unregister(this)
|
|
113
113
|
},
|
|
114
114
|
|
|
@@ -157,14 +157,15 @@ export default baseMixins.extend({
|
|
|
157
157
|
])
|
|
158
158
|
},
|
|
159
159
|
genItems (): VNode[] {
|
|
160
|
+
const directives = [[
|
|
161
|
+
vShow,
|
|
162
|
+
this.isActive
|
|
163
|
+
]]
|
|
164
|
+
|
|
160
165
|
return this.showLazyContent(() => [
|
|
161
|
-
h('div', {
|
|
166
|
+
withDirectives(h('div', {
|
|
162
167
|
class: 'v-list-group__items',
|
|
163
|
-
|
|
164
|
-
name: 'show',
|
|
165
|
-
value: this.isActive,
|
|
166
|
-
}],
|
|
167
|
-
}, getSlot(this)),
|
|
168
|
+
}, getSlot(this)), directives)
|
|
168
169
|
])
|
|
169
170
|
},
|
|
170
171
|
genPrependIcon (): VNode | null {
|
|
@@ -189,13 +190,13 @@ export default baseMixins.extend({
|
|
|
189
190
|
|
|
190
191
|
/* istanbul ignore else */
|
|
191
192
|
if (isActive && this.isActive !== isActive) {
|
|
192
|
-
this.list && this.list.listClick(this
|
|
193
|
+
this.list && this.list.listClick(this.$.uid)
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
this.isActive = isActive
|
|
196
197
|
},
|
|
197
198
|
toggle (uid: number) {
|
|
198
|
-
const isActive = this
|
|
199
|
+
const isActive = this.$.uid === uid
|
|
199
200
|
|
|
200
201
|
if (isActive) this.isBooted = true
|
|
201
202
|
this.$nextTick(() => (this.isActive = isActive))
|
|
@@ -207,8 +208,7 @@ export default baseMixins.extend({
|
|
|
207
208
|
|
|
208
209
|
render (): VNode {
|
|
209
210
|
return h('div', this.setTextColor(this.isActive && this.color, {
|
|
210
|
-
class: 'v-list-group',
|
|
211
|
-
class: this.classes,
|
|
211
|
+
class: ['v-list-group', this.classes]
|
|
212
212
|
}), [
|
|
213
213
|
this.genHeader(),
|
|
214
214
|
h(VExpandTransition, this.genItems()),
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
max-width: none
|
|
37
37
|
|
|
38
38
|
&-transition
|
|
39
|
-
&-enter
|
|
39
|
+
&-enter-from
|
|
40
40
|
.v-list-item
|
|
41
41
|
min-width: 0
|
|
42
42
|
pointer-events: none
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
&-leave-to
|
|
49
49
|
pointer-events: none
|
|
50
50
|
|
|
51
|
-
&-enter,
|
|
51
|
+
&-enter-from,
|
|
52
52
|
&-leave-to
|
|
53
53
|
opacity: 0
|
|
54
54
|
|
|
@@ -6,14 +6,16 @@ import './VRadioGroup.sass'
|
|
|
6
6
|
import VInput from '../VInput'
|
|
7
7
|
import { BaseItemGroup } from '../VItemGroup/VItemGroup'
|
|
8
8
|
|
|
9
|
-
//
|
|
9
|
+
// Utilities
|
|
10
|
+
import { mergeProps, h } from 'vue'
|
|
10
11
|
import mixins from '../../util/mixins'
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
// Types
|
|
14
|
+
import type { PropType } from 'vue'
|
|
13
15
|
|
|
14
16
|
const baseMixins = mixins(
|
|
17
|
+
VInput,
|
|
15
18
|
BaseItemGroup,
|
|
16
|
-
VInput
|
|
17
19
|
)
|
|
18
20
|
|
|
19
21
|
/* @vue/component */
|
|
@@ -40,7 +42,7 @@ export default baseMixins.extend({
|
|
|
40
42
|
// If no value set on VRadio
|
|
41
43
|
// will match valueComparator
|
|
42
44
|
// force default to null
|
|
43
|
-
|
|
45
|
+
modelValue: null as unknown as PropType<any>,
|
|
44
46
|
},
|
|
45
47
|
|
|
46
48
|
computed: {
|
|
@@ -88,10 +90,7 @@ export default baseMixins.extend({
|
|
|
88
90
|
render () {
|
|
89
91
|
const vnode = VInput.render.call(this)
|
|
90
92
|
|
|
91
|
-
vnode.props =
|
|
92
|
-
...vnode.props,
|
|
93
|
-
...this.attrs$
|
|
94
|
-
}
|
|
93
|
+
vnode.props = mergeProps(vnode.props, this.attrs$);
|
|
95
94
|
|
|
96
95
|
return vnode
|
|
97
96
|
},
|
|
@@ -100,7 +100,7 @@ export default defineComponent({
|
|
|
100
100
|
input.data = input.data || {}
|
|
101
101
|
input.data.attrs = input.data.attrs || {}
|
|
102
102
|
input.data.attrs.value = this.internalValue[i]
|
|
103
|
-
input.data.attrs.id = `input-${i ? 'max' : 'min'}-${this
|
|
103
|
+
input.data.attrs.id = `input-${i ? 'max' : 'min'}-${this.$.uid}`
|
|
104
104
|
|
|
105
105
|
return input
|
|
106
106
|
})
|
|
@@ -494,15 +494,16 @@ export default baseMixins.extend({
|
|
|
494
494
|
}
|
|
495
495
|
},
|
|
496
496
|
genListWithSlot (): VNode {
|
|
497
|
-
const slots = ['prepend-item', 'no-data', 'append-item']
|
|
497
|
+
const slots = Object.fromEntries(['prepend-item', 'no-data', 'append-item']
|
|
498
498
|
.filter(slotName => this.$slots[slotName])
|
|
499
|
-
.map(slotName =>
|
|
500
|
-
|
|
501
|
-
|
|
499
|
+
.map(slotName => [
|
|
500
|
+
slotName,
|
|
501
|
+
this.$slots[slotName]
|
|
502
|
+
]
|
|
503
|
+
))
|
|
502
504
|
// Requires destructuring due to Vue
|
|
503
505
|
// modifying the `on` property when passed
|
|
504
506
|
// as a referenced object
|
|
505
|
-
|
|
506
507
|
return h(VSelectList, {
|
|
507
508
|
...this.listData,
|
|
508
509
|
}, {...slots,item: this.$slots.item})
|
|
@@ -90,7 +90,7 @@ export default mixins(Colorable, Themeable).extend({
|
|
|
90
90
|
return h(VListItemAction, [
|
|
91
91
|
h(VSimpleCheckbox, {
|
|
92
92
|
color: this.color,
|
|
93
|
-
|
|
93
|
+
modelValue: inputValue,
|
|
94
94
|
ripple: false,
|
|
95
95
|
onInput: () => this.$emit('select', item)
|
|
96
96
|
}),
|
|
@@ -147,7 +147,7 @@ export default mixins(Colorable, Themeable).extend({
|
|
|
147
147
|
// Default behavior in list does not
|
|
148
148
|
// contain aria-selected by default
|
|
149
149
|
'aria-selected': String(value),
|
|
150
|
-
id: `list-item-${this
|
|
150
|
+
id: `list-item-${this.$.uid}-${index}`,
|
|
151
151
|
role: 'option',
|
|
152
152
|
onMousedown: (e: Event) => {
|
|
153
153
|
// Prevent onBlur from being called
|
|
@@ -226,11 +226,11 @@ export default mixins(Colorable, Themeable).extend({
|
|
|
226
226
|
else children.push(this.genTile({ item, index }))
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
children.length || children.push(this.$slots['no-data'] || this.staticNoDataTile)
|
|
229
|
+
children.length || children.push(this.$slots['no-data']?.() || this.staticNoDataTile)
|
|
230
230
|
|
|
231
|
-
this.$slots['prepend-item'] && children.unshift(this.$slots['prepend-item'])
|
|
231
|
+
this.$slots['prepend-item'] && children.unshift(this.$slots['prepend-item']())
|
|
232
232
|
|
|
233
|
-
this.$slots['append-item'] && children.push(this.$slots['append-item'])
|
|
233
|
+
this.$slots['append-item'] && children.push(this.$slots['append-item']())
|
|
234
234
|
|
|
235
235
|
return h(VList, {
|
|
236
236
|
class: ['v-select-list', this.themeClasses],
|
|
@@ -132,11 +132,11 @@
|
|
|
132
132
|
margin-bottom: $snackbar-vertical-action-margin-bottom
|
|
133
133
|
|
|
134
134
|
.v-snack-transition
|
|
135
|
-
&-enter
|
|
135
|
+
&-enter-from
|
|
136
136
|
&.v-snack__wrapper
|
|
137
137
|
transform: scale($snackbar-transition-wrapper-transform)
|
|
138
138
|
|
|
139
|
-
&-enter,
|
|
139
|
+
&-enter-from,
|
|
140
140
|
&-leave-to
|
|
141
141
|
&.v-snack__wrapper
|
|
142
142
|
opacity: 0
|
|
@@ -284,7 +284,7 @@ export default mixins<options &
|
|
|
284
284
|
return h('defs', [
|
|
285
285
|
h('linearGradient', {
|
|
286
286
|
attrs: {
|
|
287
|
-
id: this
|
|
287
|
+
id: this.$.uid,
|
|
288
288
|
gradientUnits: 'userSpaceOnUse',
|
|
289
289
|
x1: gradientDirection === 'left' ? '100%' : '0',
|
|
290
290
|
y1: gradientDirection === 'top' ? '100%' : '0',
|
|
@@ -310,8 +310,8 @@ export default mixins<options &
|
|
|
310
310
|
return h('path', {
|
|
311
311
|
attrs: {
|
|
312
312
|
d: genPath(points, this._radius, this.fill, this.parsedHeight),
|
|
313
|
-
fill: this.fill ? `url(#${this
|
|
314
|
-
stroke: this.fill ? 'none' : `url(#${this
|
|
313
|
+
fill: this.fill ? `url(#${this.$.uid})` : 'none',
|
|
314
|
+
stroke: this.fill ? 'none' : `url(#${this.$.uid})`,
|
|
315
315
|
},
|
|
316
316
|
ref: 'path',
|
|
317
317
|
})
|
|
@@ -347,12 +347,12 @@ export default mixins<options &
|
|
|
347
347
|
},
|
|
348
348
|
}, [
|
|
349
349
|
this.genGradient(),
|
|
350
|
-
this.genClipPath(bars, offsetX, this._lineWidth, 'sparkline-bar-' + this
|
|
350
|
+
this.genClipPath(bars, offsetX, this._lineWidth, 'sparkline-bar-' + this.$.uid),
|
|
351
351
|
this.hasLabels ? this.genLabels(offsetX) : undefined as never,
|
|
352
352
|
h('g', {
|
|
353
353
|
attrs: {
|
|
354
|
-
'clip-path': `url(#sparkline-bar-${this
|
|
355
|
-
fill: `url(#${this
|
|
354
|
+
'clip-path': `url(#sparkline-bar-${this.$.uid}-clip)`,
|
|
355
|
+
fill: `url(#${this.$.uid})`,
|
|
356
356
|
},
|
|
357
357
|
}, [
|
|
358
358
|
h('rect', {
|
|
@@ -22,11 +22,11 @@ export default mixins(
|
|
|
22
22
|
|
|
23
23
|
render (): VNode {
|
|
24
24
|
return h('div', {
|
|
25
|
+
...this.$attrs,
|
|
25
26
|
class: ['v-subheader', {
|
|
26
27
|
'v-subheader--inset': this.inset,
|
|
27
28
|
...this.themeClasses,
|
|
28
|
-
}],
|
|
29
|
-
...this.$attrs,
|
|
29
|
+
}, this.$attrs.class],
|
|
30
30
|
...this.$listeners
|
|
31
31
|
}, getSlot(this))
|
|
32
32
|
},
|
|
@@ -204,7 +204,7 @@ export default baseMixins.extend({
|
|
|
204
204
|
nextIcon: this.nextIcon,
|
|
205
205
|
prevIcon: this.prevIcon,
|
|
206
206
|
showArrows: this.showArrows,
|
|
207
|
-
|
|
207
|
+
modelValue: this.internalValue,
|
|
208
208
|
'onCall:slider': this.callSlider,
|
|
209
209
|
'onUpdate:modelValue': (val: any) => {
|
|
210
210
|
this.internalValue = val
|
|
@@ -232,7 +232,6 @@ export default baseMixins.extend({
|
|
|
232
232
|
return h(VTabsItems, {
|
|
233
233
|
modelValue: this.internalValue,
|
|
234
234
|
'onUpdate:modelValue': (val: any) => {
|
|
235
|
-
console.log(val)
|
|
236
235
|
this.internalValue = val
|
|
237
236
|
}
|
|
238
237
|
}, item)
|
|
@@ -5,15 +5,12 @@ import VTab from '../VTab'
|
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
7
|
RouterLinkStub,
|
|
8
|
-
|
|
8
|
+
VueWrapper,
|
|
9
9
|
} from '@vue/test-utils'
|
|
10
10
|
|
|
11
|
-
// Types
|
|
12
|
-
import { ExtractVue } from './../../../util/mixins'
|
|
13
|
-
|
|
14
11
|
describe('VTab.ts', () => {
|
|
15
|
-
type Instance =
|
|
16
|
-
let mountFunction: (options?: object) =>
|
|
12
|
+
type Instance = InstanceType<typeof VTab>
|
|
13
|
+
let mountFunction: (options?: object) => VueWrapper<Instance>
|
|
17
14
|
|
|
18
15
|
beforeEach(() => {
|
|
19
16
|
mountFunction = (options = {}) => {
|
|
@@ -23,28 +20,33 @@ describe('VTab.ts', () => {
|
|
|
23
20
|
}
|
|
24
21
|
})
|
|
25
22
|
|
|
26
|
-
it('should have the correct value', () => {
|
|
23
|
+
it('should have the correct value', async () => {
|
|
27
24
|
const wrapper = mountFunction({
|
|
28
|
-
|
|
25
|
+
props: {
|
|
29
26
|
href: '#foo',
|
|
30
27
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
global: {
|
|
29
|
+
mocks: {
|
|
30
|
+
$route: { path: '/' },
|
|
31
|
+
$router: {
|
|
32
|
+
resolve: (to: any) => {
|
|
33
|
+
let href
|
|
34
|
+
if (to.path) href = to.path
|
|
35
|
+
|
|
36
|
+
return { href }
|
|
37
|
+
},
|
|
39
38
|
},
|
|
40
39
|
},
|
|
40
|
+
stubs: {
|
|
41
|
+
'router-link': RouterLinkStub,
|
|
42
|
+
},
|
|
41
43
|
},
|
|
42
44
|
})
|
|
43
45
|
|
|
44
46
|
expect(wrapper.vm.value).toBe('foo')
|
|
45
|
-
wrapper.setProps({ href: null, to: '/foo' })
|
|
47
|
+
await wrapper.setProps({ href: null, to: '/foo' })
|
|
46
48
|
expect(wrapper.vm.value).toBe('/foo')
|
|
47
|
-
wrapper.setProps({ to: { path: 'bar' } })
|
|
49
|
+
await wrapper.setProps({ to: { path: 'bar' } })
|
|
48
50
|
expect(wrapper.vm.value).toBe('bar')
|
|
49
51
|
})
|
|
50
52
|
|
|
@@ -52,19 +54,23 @@ describe('VTab.ts', () => {
|
|
|
52
54
|
it('should react to route change', async () => {
|
|
53
55
|
const toggle = jest.fn()
|
|
54
56
|
const wrapper = mountFunction({
|
|
55
|
-
|
|
57
|
+
props: {
|
|
56
58
|
activeClass: 'bar',
|
|
57
59
|
to: 'foo',
|
|
58
60
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
global: {
|
|
62
|
+
mocks: {
|
|
63
|
+
$route: { path: '/' },
|
|
64
|
+
},
|
|
65
|
+
stubs: {
|
|
66
|
+
'router-link': RouterLinkStub,
|
|
67
|
+
},
|
|
65
68
|
},
|
|
66
69
|
})
|
|
67
70
|
|
|
71
|
+
// Mock the toggle method
|
|
72
|
+
wrapper.vm.toggle = toggle
|
|
73
|
+
|
|
68
74
|
// Mock route change being called
|
|
69
75
|
wrapper.vm.onRouteChange()
|
|
70
76
|
await wrapper.vm.$nextTick()
|
|
@@ -73,15 +79,19 @@ describe('VTab.ts', () => {
|
|
|
73
79
|
|
|
74
80
|
// explicitly mock class added
|
|
75
81
|
// by vue router
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
if (wrapper.vm.$refs.link) {
|
|
83
|
+
;(wrapper.vm.$refs.link as any)._vnode = {
|
|
84
|
+
data: {
|
|
85
|
+
class: { 'bar v-tab--active': true },
|
|
86
|
+
}
|
|
87
|
+
}
|
|
78
88
|
}
|
|
79
89
|
;(wrapper.vm as any).$route.path = '/foo'
|
|
80
90
|
|
|
81
91
|
wrapper.vm.onRouteChange()
|
|
82
92
|
await wrapper.vm.$nextTick()
|
|
83
93
|
|
|
84
|
-
wrapper.setProps({ to: undefined })
|
|
94
|
+
await wrapper.setProps({ to: undefined })
|
|
85
95
|
|
|
86
96
|
wrapper.vm.onRouteChange()
|
|
87
97
|
await wrapper.vm.$nextTick()
|
|
@@ -89,26 +99,27 @@ describe('VTab.ts', () => {
|
|
|
89
99
|
expect(toggle).toHaveBeenCalledTimes(1)
|
|
90
100
|
})
|
|
91
101
|
|
|
92
|
-
it('should respond to clicks and mousedown.enter', () => {
|
|
102
|
+
it('should respond to clicks and mousedown.enter', async () => {
|
|
93
103
|
const event = { preventDefault: jest.fn() }
|
|
94
104
|
const toggle = jest.fn()
|
|
95
|
-
const wrapper = mountFunction(
|
|
96
|
-
|
|
97
|
-
|
|
105
|
+
const wrapper = mountFunction()
|
|
106
|
+
|
|
107
|
+
// Mock the toggle method
|
|
108
|
+
wrapper.vm.toggle = toggle
|
|
98
109
|
|
|
99
|
-
wrapper.trigger('click', event)
|
|
110
|
+
await wrapper.trigger('click', event)
|
|
100
111
|
|
|
101
112
|
expect(event.preventDefault).not.toHaveBeenCalled()
|
|
102
113
|
expect(toggle).toHaveBeenCalled()
|
|
103
114
|
|
|
104
|
-
wrapper.setProps({ href: '#foo' })
|
|
115
|
+
await wrapper.setProps({ href: '#foo' })
|
|
105
116
|
|
|
106
|
-
wrapper.trigger('click', event)
|
|
117
|
+
await wrapper.trigger('click', event)
|
|
107
118
|
|
|
108
119
|
expect(event.preventDefault).toHaveBeenCalled()
|
|
109
120
|
|
|
110
|
-
wrapper.trigger('keydown.enter', event)
|
|
111
|
-
wrapper.trigger('keydown.space', event)
|
|
121
|
+
await wrapper.trigger('keydown.enter', event)
|
|
122
|
+
await wrapper.trigger('keydown.space', event)
|
|
112
123
|
|
|
113
124
|
expect(event.preventDefault).toHaveBeenCalledTimes(2)
|
|
114
125
|
expect(toggle).toHaveBeenCalledTimes(3)
|