File tree Expand file tree Collapse file tree 9 files changed +20
-22
lines changed
Expand file tree Collapse file tree 9 files changed +20
-22
lines changed Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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> ` ,
Original file line number Diff line number Diff 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 });
Original file line number Diff line number Diff line change 2626<script setup lang="ts">
2727import DxPivotGrid , {
2828 DxFieldChooser ,
29- DxFieldPanel ,
29+ DxFieldPanel ,
3030 type DxPivotGridTypes ,
3131} from ' devextreme-vue/pivot-grid' ;
3232import PivotGridDataSource from ' devextreme/ui/pivot_grid/data_source' ;
Original file line number Diff line number Diff line change @@ -85,10 +85,11 @@ function onContentReady(e: DxSchedulerTypes.ContentReadyEvent) {
8585}
8686
8787function 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}
112113function 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
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ function onCellContextMenu({ cellData }: DxSchedulerTypes.CellContextMenuEvent)
136136 ];
137137}
138138function onContextMenuItemClick(e : DxContextMenuTypes .ItemClickEvent <ContextMenuItem >) {
139- e .itemData .onItemClick (e );
139+ e .itemData ? .onItemClick ?. (e );
140140}
141141 </script >
142142
Original file line number Diff line number Diff 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 ];
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const props = defineProps<{
2525function 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 ];
Original file line number Diff line number Diff 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 ];
You can’t perform that action at this time.
0 commit comments