Skip to content

Commit 58f0f7e

Browse files
fix TS in Scheduler set Vue demos
+ formatting
1 parent a051df5 commit 58f0f7e

File tree

9 files changed

+20
-22
lines changed

9 files changed

+20
-22
lines changed

apps/demos/Demos/PivotGrid/FieldPanel/Vue/App.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,11 @@ function onContextMenuPreparing(e: DxPivotGridTypes.ContextMenuPreparingEvent) {
125125
e.items?.push({
126126
text: 'Hide field',
127127
onItemClick() {
128-
let fieldIndex: number;
128+
const dataSourceField: Record<string, any> = sourceField.groupName
129+
? dataSource.getAreaFields(sourceField.area, true)[sourceField.areaIndex]
130+
: sourceField;
129131
130-
const dataSourceField: Record<string, any> = sourceField.groupName
131-
? dataSource.getAreaFields(sourceField.area, true)[sourceField.areaIndex]
132-
: sourceField
133-
134-
fieldIndex = dataSourceField.index;
132+
const fieldIndex = dataSourceField.index;
135133
136134
dataSource.field(fieldIndex, {
137135
area: null,

apps/demos/Demos/PivotGrid/Overview/Vue/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const dataSource = new PivotGridDataSource({
7676
store: sales,
7777
});
7878
79-
const customizeTooltip = function({ seriesName, originalValue }: Record<string, any>) {
79+
const customizeTooltip = function ({ seriesName, originalValue }: Record<string, any>) {
8080
const valueText = currencyFormatter.format(originalValue);
8181
return {
8282
html: `${seriesName} | Total<div class='currency'>${valueText}</div>`,

apps/demos/Demos/PivotGrid/StatePersistence/Vue/App.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ function onContextMenuPreparing(e: DxPivotGridTypes.ContextMenuPreparingEvent) {
8686
e.items?.push({
8787
text: 'Hide field',
8888
onItemClick() {
89-
let fieldIndex: number;
9089
const dataSourceField: Record<string, any> = sourceField.groupName
91-
? dataSource.getAreaFields(sourceField.area, true)[sourceField.areaIndex]
92-
: sourceField;
93-
94-
fieldIndex = dataSourceField.index;
90+
? dataSource.getAreaFields(sourceField.area, true)[sourceField.areaIndex]
91+
: sourceField;
92+
93+
const fieldIndex = dataSourceField.index;
9594
9695
dataSource.field(fieldIndex, {
9796
area: null,
@@ -102,7 +101,7 @@ function onContextMenuPreparing(e: DxPivotGridTypes.ContextMenuPreparingEvent) {
102101
}
103102
104103
if (sourceField.dataType === 'number') {
105-
const setSummaryType = function(args: Record<string, any>) {
104+
const setSummaryType = function (args: Record<string, any>) {
106105
dataSource.field(sourceField.index, {
107106
summaryType: args.itemData.value,
108107
});

apps/demos/Demos/PivotGrid/SummaryDisplayModes/Vue/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<script setup lang="ts">
2727
import DxPivotGrid, {
2828
DxFieldChooser,
29-
DxFieldPanel,
29+
DxFieldPanel,
3030
type DxPivotGridTypes,
3131
} from 'devextreme-vue/pivot-grid';
3232
import PivotGridDataSource from 'devextreme/ui/pivot_grid/data_source';

apps/demos/Demos/Scheduler/CellTemplates/Vue/App.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ function onContentReady(e: DxSchedulerTypes.ContentReadyEvent) {
8585
}
8686
8787
function onAppointmentFormOpening(e: DxSchedulerTypes.AppointmentFormOpeningEvent) {
88-
if (e.appointmentData?.startDate && !Utils.isValidAppointmentDate(new Date(e.appointmentData.startDate))) {
88+
if (e.appointmentData?.startDate
89+
&& !Utils.isValidAppointmentDate(new Date(e.appointmentData.startDate))) {
8990
e.cancel = true;
9091
notifyDisableDate();
91-
applyDisableDatesToDateEditors(e.form);
92+
applyDisableDatesToDateEditors(e.form);
9293
}
9394
9495
}
@@ -111,9 +112,9 @@ function notifyDisableDate() {
111112
}
112113
function applyDisableDatesToDateEditors(form: DxForm['instance']) {
113114
if (!form) {
114-
return
115+
return;
115116
}
116-
117+
117118
const startDateEditor = form.getEditor('startDate');
118119
startDateEditor?.option('disabledDates', holidays);
119120

apps/demos/Demos/Scheduler/ContextMenu/Vue/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function onCellContextMenu({ cellData }: DxSchedulerTypes.CellContextMenuEvent)
136136
];
137137
}
138138
function onContextMenuItemClick(e: DxContextMenuTypes.ItemClickEvent<ContextMenuItem>) {
139-
e.itemData.onItemClick(e);
139+
e.itemData?.onItemClick?.(e);
140140
}
141141
</script>
142142

apps/demos/Demos/Scheduler/Templates/Vue/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function onAppointmentFormOpening(e: DxSchedulerTypes.AppointmentFormOpeningEven
133133
},
134134
]);
135135
}
136-
const getMovieById = function(resourceId: string) {
136+
const getMovieById = function (resourceId: string) {
137137
return Query(moviesData)
138138
.filter(['id', resourceId])
139139
.toArray()[0];

apps/demos/Demos/Scheduler/Templates/Vue/AppointmentTemplate.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const props = defineProps<{
2525
function getFormatDate(value: Date) {
2626
return formatDate(value, 'shortTime');
2727
}
28-
const getMovieById = function(resourceId: string) {
28+
const getMovieById = function (resourceId: string) {
2929
return Query(moviesData)
3030
.filter(['id', resourceId])
3131
.toArray()[0];

apps/demos/Demos/Scheduler/Templates/Vue/AppointmentTooltipTemplate.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const props = defineProps<{
2323
templateTooltipModel?: DxSchedulerTypes.AppointmentTooltipTemplateData
2424
}>();
2525
26-
const getMovieById = function(resourceId: string) {
26+
const getMovieById = function (resourceId: string) {
2727
return Query(moviesData)
2828
.filter(['id', resourceId])
2929
.toArray()[0];

0 commit comments

Comments
 (0)