@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
|
@@ -2,8 +2,7 @@ import './VSimpleCheckbox.sass'
|
|
|
2
2
|
|
|
3
3
|
import Ripple from '../../directives/ripple'
|
|
4
4
|
|
|
5
|
-
import { VNode,
|
|
6
|
-
import {defineComponent} from 'vue'
|
|
5
|
+
import { VNode, h, defineComponent, withDirectives } from 'vue'
|
|
7
6
|
|
|
8
7
|
import { VIcon } from '../VIcon'
|
|
9
8
|
|
|
@@ -18,8 +17,6 @@ import { wrapInArray } from '../../util/helpers'
|
|
|
18
17
|
export default defineComponent({
|
|
19
18
|
name: 'v-simple-checkbox',
|
|
20
19
|
|
|
21
|
-
functional: true,
|
|
22
|
-
|
|
23
20
|
directives: {
|
|
24
21
|
Ripple,
|
|
25
22
|
},
|
|
@@ -32,7 +29,7 @@ export default defineComponent({
|
|
|
32
29
|
type: Boolean,
|
|
33
30
|
default: true,
|
|
34
31
|
},
|
|
35
|
-
|
|
32
|
+
modelValue: Boolean,
|
|
36
33
|
indeterminate: Boolean,
|
|
37
34
|
indeterminateIcon: {
|
|
38
35
|
type: String,
|
|
@@ -48,49 +45,94 @@ export default defineComponent({
|
|
|
48
45
|
},
|
|
49
46
|
},
|
|
50
47
|
|
|
48
|
+
emits: ['input', 'update:modelValue'],
|
|
49
|
+
|
|
50
|
+
methods: {
|
|
51
|
+
getIcon (): string {
|
|
52
|
+
const { indeterminate, modelValue, indeterminateIcon, onIcon, offIcon } = this.$props
|
|
53
|
+
|
|
54
|
+
if (indeterminate) return indeterminateIcon
|
|
55
|
+
if (modelValue) return onIcon
|
|
56
|
+
return offIcon
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
createIcon (): VNode {
|
|
60
|
+
const { modelValue, disabled, dark, light, color } = this.$props
|
|
61
|
+
|
|
62
|
+
return h(
|
|
63
|
+
VIcon,
|
|
64
|
+
Colorable.methods.setTextColor(modelValue && color, {
|
|
65
|
+
disabled,
|
|
66
|
+
dark,
|
|
67
|
+
light,
|
|
68
|
+
}),
|
|
69
|
+
() => this.getIcon()
|
|
70
|
+
)
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
createRipple (): VNode | null {
|
|
74
|
+
const { ripple, disabled, color } = this.$props
|
|
75
|
+
|
|
76
|
+
if (!ripple || disabled) return null
|
|
77
|
+
|
|
78
|
+
return withDirectives(
|
|
79
|
+
h(
|
|
80
|
+
'div',
|
|
81
|
+
Colorable.methods.setTextColor(color, {
|
|
82
|
+
class: 'v-input--selection-controls__ripple',
|
|
83
|
+
})
|
|
84
|
+
),
|
|
85
|
+
[
|
|
86
|
+
[Ripple, { center: true }],
|
|
87
|
+
]
|
|
88
|
+
)
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
handleClick (e: MouseEvent): void {
|
|
92
|
+
e.stopPropagation()
|
|
93
|
+
|
|
94
|
+
if (this.$props.disabled) return
|
|
95
|
+
|
|
96
|
+
const newValue = !this.modelValue
|
|
97
|
+
const attrs = this.$attrs
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
this.$emit("input", newValue);
|
|
101
|
+
this.$emit('update:modelValue', newValue)
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
createChildren (): VNode[] {
|
|
105
|
+
const children = [this.createIcon()]
|
|
106
|
+
|
|
107
|
+
const ripple = this.createRipple()
|
|
108
|
+
if (ripple) {
|
|
109
|
+
children.push(ripple)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return children
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
|
|
51
116
|
render (): VNode {
|
|
52
|
-
const
|
|
117
|
+
const { disabled } = this.$props
|
|
53
118
|
const data = this.$attrs
|
|
54
119
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (props.indeterminate) icon = props.indeterminateIcon
|
|
58
|
-
else if (props.value) icon = props.onIcon
|
|
59
|
-
|
|
60
|
-
children.push(h(VIcon, Colorable.methods.setTextColor(props.value && props.color, {
|
|
61
|
-
disabled: props.disabled,
|
|
62
|
-
dark: props.dark,
|
|
63
|
-
light: props.light
|
|
64
|
-
}), icon))
|
|
65
|
-
|
|
66
|
-
if (props.ripple && !props.disabled) {
|
|
67
|
-
const ripple = h('div', Colorable.methods.setTextColor(props.color, {
|
|
68
|
-
class: 'v-input--selection-controls__ripple',
|
|
69
|
-
directives: [{
|
|
70
|
-
def: Ripple,
|
|
71
|
-
name: 'ripple',
|
|
72
|
-
value: { center: true },
|
|
73
|
-
}] as VNodeDirective[],
|
|
74
|
-
}))
|
|
75
|
-
|
|
76
|
-
children.push(ripple)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return h('div',
|
|
120
|
+
return h(
|
|
121
|
+
'div',
|
|
80
122
|
mergeData(data, {
|
|
81
123
|
class: {
|
|
82
124
|
'v-simple-checkbox': true,
|
|
83
|
-
'v-simple-checkbox--disabled':
|
|
84
|
-
},
|
|
85
|
-
onClick: (e: MouseEvent) => {
|
|
86
|
-
e.stopPropagation()
|
|
87
|
-
|
|
88
|
-
if (data.on && data.on.input && !props.disabled) {
|
|
89
|
-
data.onInput && data.onInput(!props.value)
|
|
90
|
-
}
|
|
125
|
+
'v-simple-checkbox--disabled': disabled,
|
|
91
126
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
127
|
+
onClick: this.handleClick,
|
|
128
|
+
}),
|
|
129
|
+
[
|
|
130
|
+
h(
|
|
131
|
+
'div',
|
|
132
|
+
{ class: 'v-input--selection-controls__input' },
|
|
133
|
+
this.createChildren()
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
)
|
|
95
137
|
},
|
|
96
138
|
})
|
|
@@ -1,32 +1,65 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mount,
|
|
3
|
-
|
|
4
|
-
MountOptions,
|
|
3
|
+
VueWrapper,
|
|
5
4
|
} from '@vue/test-utils'
|
|
6
5
|
import VSimpleCheckbox from '../VSimpleCheckbox'
|
|
7
6
|
|
|
8
7
|
describe('VSimpleCheckbox.ts', () => {
|
|
9
8
|
type Instance = InstanceType<typeof VSimpleCheckbox>
|
|
10
|
-
let mountFunction: (options?:
|
|
9
|
+
let mountFunction: (options?: any) => VueWrapper<Instance>
|
|
10
|
+
|
|
11
11
|
beforeEach(() => {
|
|
12
|
-
mountFunction = (options
|
|
13
|
-
return mount(VSimpleCheckbox,
|
|
12
|
+
mountFunction = (options = {}) => {
|
|
13
|
+
return mount(VSimpleCheckbox, {
|
|
14
|
+
global: {
|
|
15
|
+
stubs: {
|
|
16
|
+
VIcon: {
|
|
17
|
+
template: '<span class="v-icon"></span>',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
...options,
|
|
22
|
+
})
|
|
14
23
|
}
|
|
15
24
|
})
|
|
16
25
|
|
|
17
|
-
it('should
|
|
18
|
-
const mouseleave = jest.fn()
|
|
26
|
+
it('should render simple checkbox', () => {
|
|
19
27
|
const wrapper = mountFunction({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
props: { modelValue: false },
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
expect(wrapper.find('.v-simple-checkbox').exists()).toBe(true)
|
|
32
|
+
expect(wrapper.find('.v-input--selection-controls__input').exists()).toBe(true)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('should emit update:modelValue event on click', async () => {
|
|
36
|
+
const wrapper = mountFunction({
|
|
37
|
+
props: { modelValue: false },
|
|
24
38
|
})
|
|
25
39
|
|
|
26
40
|
const element = wrapper.find('.v-simple-checkbox')
|
|
41
|
+
await element.trigger('click')
|
|
42
|
+
|
|
43
|
+
expect(wrapper.emitted()['update:modelValue']).toBeTruthy()
|
|
44
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([true])
|
|
45
|
+
})
|
|
27
46
|
|
|
28
|
-
|
|
47
|
+
it('should not emit update:modelValue when disabled', async () => {
|
|
48
|
+
const wrapper = mountFunction({
|
|
49
|
+
props: { modelValue: false, disabled: true },
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const element = wrapper.find('.v-simple-checkbox')
|
|
53
|
+
await element.trigger('click')
|
|
54
|
+
|
|
55
|
+
expect(wrapper.emitted()['update:modelValue']).toBeFalsy()
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('should apply disabled class when disabled', () => {
|
|
59
|
+
const wrapper = mountFunction({
|
|
60
|
+
props: { disabled: true },
|
|
61
|
+
})
|
|
29
62
|
|
|
30
|
-
expect(
|
|
63
|
+
expect(wrapper.find('.v-simple-checkbox--disabled').exists()).toBe(true)
|
|
31
64
|
})
|
|
32
65
|
})
|
|
@@ -50,7 +50,7 @@ export default mixins(Elevatable, Themeable).extend({
|
|
|
50
50
|
type: [Number, String],
|
|
51
51
|
default: 150,
|
|
52
52
|
},
|
|
53
|
-
|
|
53
|
+
modelValue: {
|
|
54
54
|
type: [Object, String],
|
|
55
55
|
},
|
|
56
56
|
width: {
|
|
@@ -65,9 +65,9 @@ export default mixins(Elevatable, Themeable).extend({
|
|
|
65
65
|
|
|
66
66
|
computed: {
|
|
67
67
|
hideAlpha (): boolean {
|
|
68
|
-
if (!this.
|
|
68
|
+
if (!this.modelValue) return false
|
|
69
69
|
|
|
70
|
-
return !hasAlpha(this.
|
|
70
|
+
return !hasAlpha(this.modelValue)
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
|
|
@@ -83,10 +83,10 @@ export default mixins(Elevatable, Themeable).extend({
|
|
|
83
83
|
methods: {
|
|
84
84
|
updateColor (color: VColorPickerColor) {
|
|
85
85
|
this.internalValue = color
|
|
86
|
-
const value = extractColor(this.internalValue, this.
|
|
86
|
+
const value = extractColor(this.internalValue, this.modelValue)
|
|
87
87
|
|
|
88
|
-
if (!deepEqual(value, this.
|
|
89
|
-
this.$emit('
|
|
88
|
+
if (!deepEqual(value, this.modelValue)) {
|
|
89
|
+
this.$emit('update:modelValue', value)
|
|
90
90
|
this.$emit('update:color', this.internalValue)
|
|
91
91
|
}
|
|
92
92
|
},
|
|
@@ -203,7 +203,15 @@ export default defineComponent({
|
|
|
203
203
|
this.$emit('update:options', options)
|
|
204
204
|
},
|
|
205
205
|
deep: true,
|
|
206
|
-
|
|
206
|
+
/*
|
|
207
|
+
In Vue 3 this watcher fires even before created hook and
|
|
208
|
+
if mounting fails and the consumer code relies on update:options event to fetch data
|
|
209
|
+
it causes infinite loop because each data update triggers an attempt to render a table,
|
|
210
|
+
but because mounting constantly fails(for example, due to error in slot) it never happens.
|
|
211
|
+
Previously, in Vue 2 slot errors didn't cause mounting failure, we had partially rendered component.
|
|
212
|
+
This immediate prop is compensated by firing event in mounted hook.
|
|
213
|
+
*/
|
|
214
|
+
// immediate: true,
|
|
207
215
|
},
|
|
208
216
|
page (page: number) {
|
|
209
217
|
this.updateOptions({ page })
|
|
@@ -378,4 +386,7 @@ export default defineComponent({
|
|
|
378
386
|
render (): VNode {
|
|
379
387
|
return this.$slots.default && this.$slots.default(this.scopedProps)[0] as any
|
|
380
388
|
},
|
|
389
|
+
mounted() {
|
|
390
|
+
this.$emit('update:options', this.internalOptions)
|
|
391
|
+
},
|
|
381
392
|
})
|
|
@@ -88,8 +88,10 @@ export default mixins(
|
|
|
88
88
|
},
|
|
89
89
|
|
|
90
90
|
watch: {
|
|
91
|
-
|
|
91
|
+
modelValue: {
|
|
92
92
|
handler (value: any[]) {
|
|
93
|
+
if(!value) return
|
|
94
|
+
|
|
93
95
|
this.selection = value.reduce((selection, item) => {
|
|
94
96
|
selection[getObjectValueByPath(item, this.itemKey)] = item
|
|
95
97
|
return selection
|
|
@@ -100,7 +102,7 @@ export default mixins(
|
|
|
100
102
|
selection (value: Record<string, boolean>, old: Record<string, boolean>) {
|
|
101
103
|
if (deepEqual(Object.keys(value), Object.keys(old))) return
|
|
102
104
|
|
|
103
|
-
this.$emit('
|
|
105
|
+
this.$emit('update:modelValue', Object.values(value))
|
|
104
106
|
},
|
|
105
107
|
expanded: {
|
|
106
108
|
handler (value: any[]) {
|
|
@@ -154,7 +156,7 @@ export default mixins(
|
|
|
154
156
|
window.addEventListener('keydown', this.onKeyDown)
|
|
155
157
|
window.addEventListener('keyup', this.onKeyUp)
|
|
156
158
|
},
|
|
157
|
-
|
|
159
|
+
beforeUnmount () {
|
|
158
160
|
window.removeEventListener('keydown', this.onKeyDown)
|
|
159
161
|
window.removeEventListener('keyup', this.onKeyUp)
|
|
160
162
|
},
|
|
@@ -241,7 +241,7 @@ export default mixins(
|
|
|
241
241
|
}
|
|
242
242
|
},
|
|
243
243
|
|
|
244
|
-
|
|
244
|
+
beforeUnmount () {
|
|
245
245
|
if (this.calculateWidths) {
|
|
246
246
|
window.removeEventListener('resize', this.calcWidths)
|
|
247
247
|
}
|
|
@@ -511,7 +511,7 @@ export default mixins(
|
|
|
511
511
|
isMobile: this.isMobile,
|
|
512
512
|
}) : () => h(VSimpleCheckbox, {
|
|
513
513
|
class: 'v-data-table__checkbox',
|
|
514
|
-
|
|
514
|
+
modelValue: data.isSelected,
|
|
515
515
|
disabled: !this.isSelectable(item),
|
|
516
516
|
color: this.checkboxColor ?? '',
|
|
517
517
|
onInput: (val: boolean) => data.select(val),
|
|
@@ -20,8 +20,6 @@ import {defineComponent, h} from 'vue'
|
|
|
20
20
|
export default defineComponent({
|
|
21
21
|
name: 'v-data-table-header',
|
|
22
22
|
|
|
23
|
-
functional: true,
|
|
24
|
-
|
|
25
23
|
props: {
|
|
26
24
|
...header.props,
|
|
27
25
|
mobile: Boolean,
|
|
@@ -29,12 +27,15 @@ export default defineComponent({
|
|
|
29
27
|
|
|
30
28
|
render () {
|
|
31
29
|
const props = this.$props
|
|
32
|
-
let data =
|
|
30
|
+
let data = {
|
|
31
|
+
...this.$attrs,
|
|
32
|
+
...props,
|
|
33
|
+
}
|
|
33
34
|
|
|
34
35
|
// dedupeModelListeners(data)
|
|
35
36
|
const children = rebuildSlots(this.$slots, h)
|
|
36
37
|
|
|
37
|
-
if (
|
|
38
|
+
if (props.mobile) {
|
|
38
39
|
return h(VDataTableHeaderMobile, data, children)
|
|
39
40
|
} else {
|
|
40
41
|
return h(VDataTableHeaderDesktop, data, children)
|
|
@@ -110,7 +110,7 @@ export default mixins(header).extend({
|
|
|
110
110
|
return h('thead', {
|
|
111
111
|
class: 'v-data-table-header',
|
|
112
112
|
}, [
|
|
113
|
-
h('tr', this.headers
|
|
113
|
+
h('tr', this.headers?.map(header => this.genHeader(header)) || []),
|
|
114
114
|
])
|
|
115
115
|
},
|
|
116
116
|
})
|
|
@@ -98,7 +98,7 @@ export default baseMixins.extend({
|
|
|
98
98
|
this.$refs.table.addEventListener('scroll', this.scrollDebounce, { passive: true })
|
|
99
99
|
},
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
beforeUnmount () {
|
|
102
102
|
this.$refs.table.removeEventListener('scroll', this.scrollDebounce)
|
|
103
103
|
},
|
|
104
104
|
|
|
@@ -3,18 +3,18 @@ import VIcon from '../../VIcon'
|
|
|
3
3
|
import VSimpleCheckbox from '../../VCheckbox/VSimpleCheckbox'
|
|
4
4
|
import ripple from '../../../directives/ripple'
|
|
5
5
|
|
|
6
|
-
import {defineComponent, h} from 'vue'
|
|
6
|
+
import { defineComponent, h } from 'vue'
|
|
7
7
|
import { PropValidator } from 'vue/types/options'
|
|
8
8
|
import mixins from '../../../util/mixins'
|
|
9
9
|
import { DataOptions, DataTableHeader } from 'vuetify/types'
|
|
10
10
|
|
|
11
11
|
type VDataTableInstance = InstanceType<typeof VDataTable>
|
|
12
12
|
|
|
13
|
-
interface
|
|
13
|
+
interface HeaderOptions {
|
|
14
14
|
dataTable: VDataTableInstance
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export default mixins<
|
|
17
|
+
export default mixins<HeaderOptions>().extend({
|
|
18
18
|
// https://github.com/vuejs/vue/issues/6872
|
|
19
19
|
directives: {
|
|
20
20
|
ripple,
|
|
@@ -53,10 +53,10 @@ export default mixins<options>().extend({
|
|
|
53
53
|
methods: {
|
|
54
54
|
genSelectAll () {
|
|
55
55
|
const data = {
|
|
56
|
-
|
|
56
|
+
modelValue: this.everyItem,
|
|
57
57
|
indeterminate: !this.everyItem && this.someItems,
|
|
58
|
-
color: this.checkboxColor ?? ''
|
|
59
|
-
onInput: (v: boolean) => this.$emit('toggle-select-all', v)
|
|
58
|
+
color: this.checkboxColor ?? '',
|
|
59
|
+
onInput: (v: boolean) => this.$emit('toggle-select-all', v)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (this.$slots['data-table-select']) {
|
|
@@ -290,7 +290,7 @@ export default mixins(
|
|
|
290
290
|
const output = this.multipleValue
|
|
291
291
|
.map((val: string) => sanitizeDateString(val, type))
|
|
292
292
|
.filter(this.isDateAllowed)
|
|
293
|
-
this.$emit('
|
|
293
|
+
this.$emit('update:modelValue', this.isMultiple ? output : output[0])
|
|
294
294
|
}
|
|
295
295
|
},
|
|
296
296
|
},
|
|
@@ -308,10 +308,10 @@ export default mixins(
|
|
|
308
308
|
emitInput (newInput: string) {
|
|
309
309
|
if (this.range) {
|
|
310
310
|
if (this.multipleValue.length !== 1) {
|
|
311
|
-
this.$emit('
|
|
311
|
+
this.$emit('update:modelValue', [newInput])
|
|
312
312
|
} else {
|
|
313
313
|
const output = [this.multipleValue[0], newInput]
|
|
314
|
-
this.$emit('
|
|
314
|
+
this.$emit('update:modelValue', output)
|
|
315
315
|
this.$emit('change', output)
|
|
316
316
|
}
|
|
317
317
|
return
|
|
@@ -325,7 +325,7 @@ export default mixins(
|
|
|
325
325
|
)
|
|
326
326
|
: newInput
|
|
327
327
|
|
|
328
|
-
this.$emit('
|
|
328
|
+
this.$emit('update:modelValue', output)
|
|
329
329
|
this.multiple || this.$emit('change', newInput)
|
|
330
330
|
},
|
|
331
331
|
checkMultipleProp () {
|
|
@@ -348,7 +348,7 @@ export default mixins(
|
|
|
348
348
|
}
|
|
349
349
|
this.internalActivePicker = 'MONTH'
|
|
350
350
|
if (this.reactive && !this.readonly && !this.isMultiple && this.isDateAllowed(this.inputDate)) {
|
|
351
|
-
this.$emit('
|
|
351
|
+
this.$emit('update:modelValue', this.inputDate)
|
|
352
352
|
}
|
|
353
353
|
},
|
|
354
354
|
monthClick (value: string) {
|
|
@@ -365,7 +365,7 @@ export default mixins(
|
|
|
365
365
|
this.tableDate = value
|
|
366
366
|
this.internalActivePicker = 'DATE'
|
|
367
367
|
if (this.reactive && !this.readonly && !this.isMultiple && this.isDateAllowed(this.inputDate)) {
|
|
368
|
-
this.$emit('
|
|
368
|
+
this.$emit('update:modelValue', this.inputDate)
|
|
369
369
|
}
|
|
370
370
|
} else {
|
|
371
371
|
this.emitInput(this.inputDate)
|
|
@@ -62,12 +62,12 @@ export default mixins(
|
|
|
62
62
|
watchInput (input: any): Watchers {
|
|
63
63
|
const watcher = (input: any): (() => void) => {
|
|
64
64
|
return input.$watch('hasError', (val: boolean) => {
|
|
65
|
-
this.errorBag[input
|
|
65
|
+
this.errorBag[input.$.uid] = val
|
|
66
66
|
}, { immediate: true })
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
const watchers: Watchers = {
|
|
70
|
-
_uid: input
|
|
70
|
+
_uid: input.$.uid,
|
|
71
71
|
valid: () => {},
|
|
72
72
|
shouldValidate: () => {},
|
|
73
73
|
}
|
|
@@ -78,7 +78,7 @@ export default mixins(
|
|
|
78
78
|
if (!val) return
|
|
79
79
|
|
|
80
80
|
// Only watch if we're not already doing it
|
|
81
|
-
if (this.errorBag.hasOwnProperty(input
|
|
81
|
+
if (this.errorBag.hasOwnProperty(input.$.uid)) return
|
|
82
82
|
|
|
83
83
|
watchers.valid = watcher(input)
|
|
84
84
|
})
|
|
@@ -115,19 +115,19 @@ export default mixins(
|
|
|
115
115
|
this.watchers.push(this.watchInput(input))
|
|
116
116
|
},
|
|
117
117
|
unregister (input: VInputInstance) {
|
|
118
|
-
const found = this.inputs.find(i => i
|
|
118
|
+
const found = this.inputs.find(i => i.$.uid === input.$.uid)
|
|
119
119
|
|
|
120
120
|
if (!found) return
|
|
121
121
|
|
|
122
|
-
const unwatch = this.watchers.find(i => i._uid === found
|
|
122
|
+
const unwatch = this.watchers.find(i => i._uid === found.$.uid)
|
|
123
123
|
if (unwatch) {
|
|
124
124
|
unwatch.valid()
|
|
125
125
|
unwatch.shouldValidate()
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
this.watchers = this.watchers.filter(i => i._uid !== found
|
|
129
|
-
this.inputs = this.inputs.filter(i => i
|
|
130
|
-
|
|
128
|
+
this.watchers = this.watchers.filter(i => i._uid !== found.$.uid)
|
|
129
|
+
this.inputs = this.inputs.filter(i => i.$.uid !== found.$.uid)
|
|
130
|
+
delete this.errorBag[found.$.uid]
|
|
131
131
|
},
|
|
132
132
|
},
|
|
133
133
|
|
|
@@ -68,7 +68,7 @@ const cache = new Map<string, any[]>()
|
|
|
68
68
|
|
|
69
69
|
export default defineComponent({
|
|
70
70
|
name: 'v-col',
|
|
71
|
-
|
|
71
|
+
inheritAttrs: false,
|
|
72
72
|
props: {
|
|
73
73
|
cols: {
|
|
74
74
|
type: [Boolean, String, Number],
|
|
@@ -134,6 +134,6 @@ export default defineComponent({
|
|
|
134
134
|
cache.set(cacheKey, classList)
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
return h(props.tag, mergeData(
|
|
137
|
+
return h(props.tag, mergeData({ class: classList }, data), children)
|
|
138
138
|
},
|
|
139
139
|
})
|
|
@@ -244,7 +244,7 @@ export default mixins(
|
|
|
244
244
|
let content: VNode = VResponsive.methods.genContent.call(this)
|
|
245
245
|
|
|
246
246
|
if (this.naturalWidth) {
|
|
247
|
-
content = h(content.type, mergeProps(content.
|
|
247
|
+
content = h(content.type, mergeProps(content.props, {
|
|
248
248
|
style: { width: `${this.naturalWidth}px` },
|
|
249
249
|
}), content.children)
|
|
250
250
|
}
|