Skip to content

Commit e71a70a

Browse files
deps: Update to Vuetify ^3.9 and Vue ^3.5 (#2468)
* deps: Update to Vuetify ^3.9 and Vue ^3.5 - Update to latest Vuetify 3.9.0 - Update to latest Vue 3.5.17 - Update Vue peer dependency to ^3.5.0 - Update Vite to latest 5.x version ^5.4.19 - Fix imports for Vuetify promoted from labs - Fix typings for update events in Vuetify DateControlRenderer - Regenerate Vuetify test snapshots to fit changes in Vuetify (e.g. setting values in HTML element) - Add visualViewport mock for Vuetify tests as this seems to be needed after dependency update - In JsonForms.vue explicitly type provided state as `JsonFormsSubStates` to avoid TS7056 * fix: Vuetify TimeControlRenderer to autoclose after selecting smallest unit * fix: Vuetify DateTimeControlRenderer to close on smallest unit selection auto close on minute/second selection. No longer closes on day selection as there is not event for day selection * fix: Vuetify number control to show decimals by setting precision Also adapts the numbers example to use a step with scientific notation number
1 parent e814b0a commit e71a70a

28 files changed

+460
-255
lines changed

packages/examples/src/examples/numbers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ export const uischema = {
6262
{
6363
type: 'Control',
6464
scope: '#/properties/height',
65+
options: {
66+
step: 1e-2,
67+
},
6568
},
6669
{
6770
type: 'Control',

packages/vue-vanilla/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@
8989
"tslib": "^2.5.0",
9090
"typedoc": "~0.25.3",
9191
"typescript": "~5.5.0",
92-
"vue": "^3.4.21",
92+
"vue": "^3.5.17",
9393
"vue-jest": "^5.0.0-0"
9494
},
9595
"peerDependencies": {
9696
"@jsonforms/core": "3.6.0",
9797
"@jsonforms/vue": "3.6.0",
98-
"vue": "^3.2.26"
98+
"vue": "^3.5.0"
9999
}
100100
}

packages/vue-vuetify/dev/store/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function useHistoryHashQuery<T extends string | boolean | number>(
8080
queryParam: string,
8181
initialValue: T,
8282
) {
83-
const data: Ref<UnwrapRef<T>> = ref<T>(initialValue);
83+
const data = ref<T>(initialValue);
8484

8585
// Function to update data based on URL hash
8686
const updateDataFromHash = () => {

packages/vue-vuetify/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
"dayjs": "^1.10.6",
6565
"lodash": "^4.17.21",
6666
"maska": "^2.1.11",
67-
"vue": "^3.4.21",
68-
"vuetify": "^3.6.6"
67+
"vue": "^3.5.0",
68+
"vuetify": "^3.9.0"
6969
},
7070
"devDependencies": {
7171
"@fortawesome/fontawesome-free": "^6.5.2",
@@ -106,15 +106,15 @@
106106
"splitpanes": "^3.1.5",
107107
"typedoc": "~0.25.3",
108108
"typescript": "~5.4.0",
109-
"vite": "^5.2.8",
109+
"vite": "^5.4.19",
110110
"vite-plugin-dts": "^3.9.1",
111111
"vite-plugin-node-polyfills": "^0.21.0",
112112
"vite-plugin-static-copy": "^1.0.5",
113-
"vite-plugin-vuetify": "^2.0.3",
113+
"vite-plugin-vuetify": "^2.1.1",
114114
"vitest": "^1.4.0",
115-
"vue": "^3.4.21",
115+
"vue": "^3.5.17",
116116
"vue-eslint-parser": "^9.4.2",
117117
"vue-tsc": "^2.0.11",
118-
"vuetify": "^3.6.6"
118+
"vuetify": "^3.9.0"
119119
}
120120
}

packages/vue-vuetify/src/controls/DateControlRenderer.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,19 @@
4949
v-if="showMenu"
5050
:model-value="showActions ? proxyModel.value : pickerValue"
5151
@update:model-value="
52-
(val) => updateDatePickerValue(val, proxyModel)
52+
(val: any) => updateDatePickerValue(val, proxyModel)
5353
"
5454
v-bind="vuetifyProps('v-date-picker')"
5555
:title="computedLabel"
5656
:min="minDate"
5757
:max="maxDate"
5858
v-model:view-mode="viewMode"
5959
@update:month="
60-
(month) => updateDatePickerMonth(month, proxyModel)
60+
(month: number) => updateDatePickerMonth(month, proxyModel)
61+
"
62+
@update:year="
63+
(year: number) => updateDatePickerYear(year, proxyModel)
6164
"
62-
@update:year="(year) => updateDatePickerYear(year, proxyModel)"
6365
>
6466
<template v-slot:actions v-if="showActions">
6567
<component :is="actions"></component>

packages/vue-vuetify/src/controls/DateTimeControlRenderer.vue

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,19 @@
8888
proxyModel.value.time = val;
8989
} else {
9090
pickerValue.time = val;
91+
}
92+
}
93+
"
94+
@update:minute="
95+
() => {
96+
if (!showActions && !useSeconds) {
97+
showMenu = false;
98+
}
99+
}
100+
"
101+
@update:second="
102+
() => {
103+
if (!showActions && useSeconds) {
91104
showMenu = false;
92105
}
93106
}
@@ -145,7 +158,19 @@
145158
date: pickerValue.date,
146159
time: val,
147160
};
148-
161+
}
162+
}
163+
"
164+
@update:minute="
165+
() => {
166+
if (!showActions && !useSeconds) {
167+
showMenu = false;
168+
}
169+
}
170+
"
171+
@update:second="
172+
() => {
173+
if (!showActions && useSeconds) {
149174
showMenu = false;
150175
}
151176
}
@@ -197,10 +222,10 @@ import {
197222
VTab,
198223
VTabs,
199224
VTextField,
225+
VTimePicker,
200226
VWindow,
201227
VWindowItem,
202228
} from 'vuetify/components';
203-
import { VTimePicker } from 'vuetify/labs/VTimePicker';
204229
205230
import { vMaska, type MaskOptions, type MaskaDetail } from 'maska';
206231
import { useDisplay, useLocale } from 'vuetify';
@@ -542,10 +567,6 @@ const controlRenderer = defineComponent({
542567
if (this.useTabLayout && val.date) {
543568
this.activeTab = 'time';
544569
}
545-
546-
if (val.date && val.time && !this.showActions) {
547-
this.showMenu = false;
548-
}
549570
},
550571
},
551572
cancelLabel(): string {

packages/vue-vuetify/src/controls/IntegerControlRenderer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
type RendererProps,
3737
} from '@jsonforms/vue';
3838
import { defineComponent } from 'vue';
39-
import { VNumberInput } from 'vuetify/labs/VNumberInput';
39+
import { VNumberInput } from 'vuetify/components';
4040
import { determineClearValue, useVuetifyControl } from '../util';
4141
import { default as ControlWrapper } from './ControlWrapper.vue';
4242
import { DisabledIconFocus } from './directives';

packages/vue-vuetify/src/controls/NumberControlRenderer.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<v-number-input
99
v-disabled-icon-focus
1010
:step="step"
11+
:precision="precision"
1112
:id="control.id + '-input'"
1213
:class="styles.control.input"
1314
:disabled="!control.enabled"
@@ -36,7 +37,7 @@ import {
3637
type RendererProps,
3738
} from '@jsonforms/vue';
3839
import { defineComponent } from 'vue';
39-
import { VNumberInput } from 'vuetify/labs/VNumberInput';
40+
import { VNumberInput } from 'vuetify/components';
4041
4142
import { determineClearValue, useVuetifyControl } from '../util';
4243
import { default as ControlWrapper } from './ControlWrapper.vue';
@@ -66,6 +67,17 @@ const controlRenderer = defineComponent({
6667
const options: any = this.appliedOptions;
6768
return options.step ?? 0.1;
6869
},
70+
precision(): number | undefined {
71+
if (!this.step || Number.isInteger(this.step)) return undefined;
72+
// Handle scientific notation and float imprecision
73+
const stepStr = this.step.toString();
74+
if (stepStr.indexOf('e-') > -1) {
75+
// Handle cases like 1e-3
76+
return parseInt(stepStr.split('e-')[1], 10);
77+
}
78+
const fraction = stepStr.split('.')[1];
79+
return fraction ? fraction.length : undefined;
80+
},
6981
},
7082
});
7183

packages/vue-vuetify/src/controls/TimeControlRenderer.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@
5454
proxyModel.value = val;
5555
} else {
5656
pickerValue = val;
57+
}
58+
}
59+
"
60+
@update:minute="
61+
() => {
62+
if (!showActions && !useSeconds) {
63+
showMenu = false;
64+
}
65+
}
66+
"
67+
@update:second="
68+
() => {
69+
if (!showActions && useSeconds) {
5770
showMenu = false;
5871
}
5972
}
@@ -95,8 +108,8 @@ import {
95108
VMenu,
96109
VSpacer,
97110
VTextField,
111+
VTimePicker,
98112
} from 'vuetify/components';
99-
import { VTimePicker } from 'vuetify/labs/VTimePicker';
100113
101114
import { useLocale } from 'vuetify';
102115
import type { IconValue } from '../icons';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Mock the visualViewport API for testing purposes
2+
if (!window.visualViewport) {
3+
window.visualViewport = {
4+
addEventListener: () => {},
5+
removeEventListener: () => {},
6+
width: window.innerWidth,
7+
height: window.innerHeight,
8+
scale: 1,
9+
offsetLeft: 0,
10+
offsetTop: 0,
11+
pageLeft: 0,
12+
pageTop: 0,
13+
onresize: null,
14+
onscroll: null,
15+
dispatchEvent: () => true,
16+
};
17+
}

0 commit comments

Comments
 (0)