Skip to content

Commit 340927a

Browse files
Fix TS in Vue demos (DevExpress#29266)
1 parent af055b7 commit 340927a

File tree

39 files changed

+233
-257
lines changed

39 files changed

+233
-257
lines changed

apps/demos/Demos/Charts/ClientSideDataProcessing/Vue/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import DxChart, {
4444
DxSize,
4545
DxLoadingIndicator,
4646
} from 'devextreme-vue/chart';
47-
import DxSelectBox from 'devextreme-vue/select-box';
47+
import DxSelectBox, { type DxSelectBoxTypes } from 'devextreme-vue/select-box';
4848
import DataSource from 'devextreme/data/data_source';
4949
import CustomStore from 'devextreme/data/custom_store';
5050
@@ -65,7 +65,7 @@ const monthWeather = new DataSource({
6565
6666
const customizeLabelText = ({ valueText }) => `${valueText}${'&#176C'}`;
6767
68-
function changeTemperature({ value }) {
68+
function changeTemperature({ value }: DxSelectBoxTypes.ValueChangedEvent) {
6969
monthWeather.filter(['t', '>', value]);
7070
monthWeather.load();
7171
}

apps/demos/Demos/Charts/Palette/Vue/data.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { type DxPieChartTypes } from 'devextreme-vue/pie-chart';
2+
import { type PaletteExtensionMode } from 'devextreme-vue/common/charts';
23

34
export const paletteCollection: DxPieChartTypes.Palette[] = ['Material', 'Soft Pastel', 'Harmony Light', 'Pastel', 'Bright', 'Soft', 'Ocean', 'Office', 'Vintage', 'Violet', 'Carmine', 'Dark Moon', 'Soft Blue', 'Dark Violet', 'Green Mist'];
4-
export const paletteExtensionModes = ['alternate', 'blend', 'extrapolate'];
5+
export const paletteExtensionModes: PaletteExtensionMode[] = ['alternate', 'blend', 'extrapolate'];
56

67
const data = [];
78
for (let i = 0; i < 20; i += 1) {

apps/demos/Demos/Charts/PieWithResolvedLabelOverlapping/Vue/App.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ import DxPieChart, {
4343
DxExport,
4444
DxLegend,
4545
DxAnimation,
46+
type DxPieChartTypes,
4647
} from 'devextreme-vue/pie-chart';
4748
import DxSelectBox from 'devextreme-vue/select-box';
4849
import { dataSource } from './data.ts';
4950
50-
const resolveModes = ['shift', 'hide', 'none'];
51-
const resolveMode = ref('shift');
51+
const resolveModes: DxPieChartTypes.ShiftLabelOverlap[] = ['shift', 'hide', 'none'];
52+
const resolveMode = ref(resolveModes[0]);
5253
const formatText = ({ argumentText, percentText }) => `${argumentText} (${percentText})`;
5354
</script>
5455

apps/demos/Demos/Charts/ServerSideDataProcessing/Vue/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import DxChart, {
6868
DxExport,
6969
DxLoadingIndicator,
7070
} from 'devextreme-vue/chart';
71-
import DxSelectBox from 'devextreme-vue/select-box';
71+
import DxSelectBox, { type DxSelectBoxTypes } from 'devextreme-vue/select-box';
7272
import DataSource from 'devextreme/data/data_source';
7373
import 'devextreme/data/odata/store';
7474
import { months } from './data.ts';
@@ -90,7 +90,7 @@ const customizeLabelText = ({ valueText }) => `${valueText}${'&#176C'}`;
9090
const customizeTooltip = ({ valueText }) => ({
9191
text: `${valueText}${'&#176C'}`,
9292
});
93-
function onValueChanged({ value }) {
93+
function onValueChanged({ value }: DxSelectBoxTypes.ValueChangedEvent) {
9494
chartDataSource.filter(['Id', '=', value]);
9595
chartDataSource.load();
9696
}

apps/demos/Demos/Common/NavigationOverview/Vue/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@
8282
<script setup lang="ts">
8383
import { ref } from 'vue';
8484
import DxTabPanel from 'devextreme-vue/tab-panel';
85-
import DxTreeView from 'devextreme-vue/tree-view';
85+
import DxTreeView, { type DxTreeViewTypes } from 'devextreme-vue/tree-view';
8686
import { continents } from './data.ts';
8787
8888
const tabPanelIndex = ref(0);
89-
const countryData = ref(continents[0].items[0]);
89+
const countryData = ref<Record<string, any>>(continents[0].items[0]);
9090
const citiesData = ref(continents[0].items[0].cities);
9191
92-
function changeSelection({ itemData }) {
92+
function changeSelection({ itemData }: DxTreeViewTypes.ItemSelectionChangedEvent) {
9393
if (itemData.cities) {
9494
countryData.value = itemData;
9595
citiesData.value = itemData.cities;

apps/demos/Demos/DataGrid/BatchEditing/Vue/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,14 @@ import {
7272
DxPaging,
7373
DxEditing,
7474
DxLookup,
75+
type DxDataGridTypes,
7576
} from 'devextreme-vue/data-grid';
7677
import DxSelectBox from 'devextreme-vue/select-box';
7778
import DxCheckBox from 'devextreme-vue/check-box';
7879
import { employees, states } from './data.ts';
7980
8081
const selectTextOnEditStart = ref(true);
81-
const startEditAction = ref('click');
82+
const startEditAction = ref<DxDataGridTypes.StartEditAction>('click');
8283
</script>
8384
<style>
8485
#data-grid-demo {

apps/demos/Demos/DataGrid/ColumnResizing/Vue/App.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
import { ref } from 'vue';
3030
import {
3131
DxDataGrid,
32+
type DxDataGridTypes,
3233
} from 'devextreme-vue/data-grid';
3334
import DxSelectBox from 'devextreme-vue/select-box';
3435
import { orders } from './data.ts';
3536
3637
const columns = ['CompanyName', 'City', 'State', 'Phone', 'Fax'];
37-
const resizingModes = ['nextColumn', 'widget'];
38-
const currentMode = ref('nextColumn');
38+
const resizingModes: DxDataGridTypes.ColumnResizeMode[] = ['nextColumn', 'widget'];
39+
const currentMode = ref(resizingModes[0]);
3940
4041
</script>
4142
<style scoped>

apps/demos/Demos/DataGrid/CustomEditors/Vue/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ const onRowInserted = (e: DxDataGridTypes.RowInsertedEvent) => {
146146
function calculateFilterExpression(
147147
this: DxDataGridTypes.Column,
148148
filterValue: any,
149-
selectedFilterOperations: string | null,
149+
selectedFilterOperations: string,
150150
target: string,
151-
) {
151+
): any {
152152
if (target === 'search' && typeof filterValue === 'string') {
153153
return [this.dataField, 'contains', filterValue];
154154
}

apps/demos/Demos/DataGrid/CustomNewRecordPosition/Vue/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ import DxSelectBox from 'devextreme-vue/select-box';
101101
import Guid from 'devextreme/core/guid';
102102
import { dataSource } from './data.ts';
103103
104-
const newRowPositionOptions = ['first', 'last', 'pageTop', 'pageBottom', 'viewportTop', 'viewportBottom'];
104+
const newRowPositionOptions: DxDataGridTypes.NewRowPosition[] = ['first', 'last', 'pageTop', 'pageBottom', 'viewportTop', 'viewportBottom'];
105105
const scrollingModeOptions = ['standard', 'virtual'];
106106
107-
const newRowPosition = ref('viewportTop');
107+
const newRowPosition = ref(newRowPositionOptions[4]);
108108
const scrollingMode = ref<DxDataGridTypes.DataGridScrollMode>('standard');
109109
const changes = ref<DxDataGridTypes.DataChange[]>([]);
110110
const editRowKey = ref<string | null>(null);

apps/demos/Demos/DataGrid/CustomizeKeyboardNavigation/Vue/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ import DxSelectBox from 'devextreme-vue/select-box';
9494
import DxCheckBox from 'devextreme-vue/check-box';
9595
import { employees, states } from './data.ts';
9696
97-
const enterKeyActions = ['startEdit', 'moveFocus'];
98-
const enterKeyDirections = ['none', 'column', 'row'];
97+
const enterKeyActions: DxDataGridTypes.EnterKeyAction[] = ['startEdit', 'moveFocus'];
98+
const enterKeyDirections: DxDataGridTypes.EnterKeyDirection[] = ['none', 'column', 'row'];
9999
100100
const editOnKeyPress = ref(true);
101-
const enterKeyDirection = ref('column');
102-
const enterKeyAction = ref('moveFocus');
101+
const enterKeyDirection = ref(enterKeyDirections[1]);
102+
const enterKeyAction = ref(enterKeyActions[1]);
103103
104104
const onFocusedCellChanging = (e: DxDataGridTypes.FocusedCellChangingEvent) => {
105105
e.isHighlighted = true;

0 commit comments

Comments
 (0)