logitude-dashboard-library 3.1.141 → 3.1.143

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.
@@ -926,23 +926,71 @@ $dark-grey: #717585;
926
926
  font-family: "Manrope", sans-serif;
927
927
  }
928
928
 
929
+ /* Match DevExtreme pivot typography / colors (custom DX overrides above). */
930
+ .dl-ag-pivot-grid.ag-theme-balham {
931
+ font-family: "Manrope", sans-serif;
932
+ font-size: 12px;
933
+ color: #46494A;
934
+ --ag-font-family: "Manrope", sans-serif;
935
+ --ag-font-size: 12px;
936
+ --ag-foreground-color: #46494A;
937
+ --ag-secondary-foreground-color: #46494A;
938
+ --ag-disabled-foreground-color: #46494A;
939
+ --ag-header-foreground-color: #222222;
940
+ --ag-header-background-color: #ffffff;
941
+ --ag-background-color: #ffffff;
942
+ --ag-odd-row-background-color: #ffffff;
943
+ --ag-selected-row-background-color: rgba(221, 221, 221, 0.35);
944
+ --ag-row-hover-color: rgba(221, 221, 221, 0.15);
945
+ --ag-border-color: #DFE1E3;
946
+ --ag-row-border-color: #DFE1E3;
947
+ --ag-header-column-separator-color: #DFE1E3;
948
+ --ag-header-column-resize-handle-color: #DFE1E3;
949
+ }
950
+
929
951
  .dl-ag-pivot-grid .ag-root-wrapper {
930
- border: 1px solid #e0e0e0;
952
+ border: 1px solid #DFE1E3;
953
+ font-family: "Manrope", sans-serif;
931
954
  }
932
955
 
933
956
  .dl-ag-pivot-grid {
934
- --ag-border-color: #e0e0e0;
935
- --ag-row-border-color: #e0e0e0;
957
+ --ag-border-color: #DFE1E3;
958
+ --ag-row-border-color: #DFE1E3;
959
+ --ag-header-column-separator-color: #DFE1E3;
960
+ --ag-header-column-resize-handle-color: #DFE1E3;
936
961
  --ag-header-background-color: #ffffff;
937
962
  }
938
963
 
964
+ /* Force every Ag Grid structural border to the same color. */
965
+ .dl-ag-pivot-grid.ag-theme-balham .ag-root-wrapper,
966
+ .dl-ag-pivot-grid.ag-theme-balham .ag-root,
967
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header,
968
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-row,
969
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-cell,
970
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-group-cell,
971
+ .dl-ag-pivot-grid.ag-theme-balham .ag-pinned-left-header,
972
+ .dl-ag-pivot-grid.ag-theme-balham .ag-pinned-right-header,
973
+ .dl-ag-pivot-grid.ag-theme-balham .ag-row,
974
+ .dl-ag-pivot-grid.ag-theme-balham .ag-cell,
975
+ .dl-ag-pivot-grid.ag-theme-balham .ag-body-viewport,
976
+ .dl-ag-pivot-grid.ag-theme-balham .ag-center-cols-viewport,
977
+ .dl-ag-pivot-grid.ag-theme-balham .ag-center-cols-container,
978
+ .dl-ag-pivot-grid.ag-theme-balham .ag-floating-top,
979
+ .dl-ag-pivot-grid.ag-theme-balham .ag-floating-bottom,
980
+ .dl-ag-pivot-grid.ag-theme-balham .ag-side-bar,
981
+ .dl-ag-pivot-grid.ag-theme-balham .ag-status-bar {
982
+ border-color: #DFE1E3 !important;
983
+ }
984
+
939
985
  .dl-ag-pivot-grid.ag-theme-balham .ag-header {
940
986
  background-color: #ffffff !important;
987
+ font-family: "Manrope", sans-serif;
988
+ color: #222222;
941
989
  }
942
990
 
943
991
  .dl-ag-pivot-grid.ag-theme-balham .ag-header-cell,
944
992
  .dl-ag-pivot-grid.ag-theme-balham .ag-header-group-cell {
945
- font-family: "Manrope";
993
+ font-family: "Manrope", sans-serif;
946
994
  font-size: 12px;
947
995
  font-weight: 600;
948
996
  text-align: center;
@@ -950,29 +998,62 @@ $dark-grey: #717585;
950
998
  background-color: #ffffff !important;
951
999
  }
952
1000
 
1001
+ /* Balham defaults height:50% / inset top — force full-height separators. */
1002
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-cell::after,
1003
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-group-cell::after {
1004
+ height: 100%;
1005
+ top: 0;
1006
+ background-color: #DFE1E3;
1007
+ }
1008
+
1009
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-cell-text,
1010
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-group-text,
1011
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-cell-label,
1012
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-group-cell-label {
1013
+ font-family: "Manrope", sans-serif;
1014
+ font-size: 12px;
1015
+ font-weight: 600;
1016
+ color: #222222 !important;
1017
+ }
1018
+
953
1019
  .dl-ag-pivot-grid .ag-header-cell[col-id^="ag-Grid-AutoColumn"] {
954
1020
  text-align: left;
955
1021
  }
956
1022
 
1023
+ .dl-ag-pivot-grid .ag-header-cell[col-id^="ag-Grid-AutoColumn"] .ag-header-cell-text,
1024
+ .dl-ag-pivot-grid .ag-header-cell[col-id^="ag-Grid-AutoColumn"] .ag-header-cell-label {
1025
+ text-align: left;
1026
+ }
1027
+
1028
+ /* Column grand totals — match DevExtreme .dx-grandtotal */
957
1029
  .dl-ag-pivot-grid .ag-header-cell[col-id^="PivotRowTotal_"],
958
1030
  .dl-ag-pivot-grid .ag-header-group-cell.dl-pivot-row-grand-total-group-header,
959
1031
  .dl-ag-pivot-grid .ag-header-group-cell.dl-pivot-row-grand-total-group-header-sibling {
960
1032
  background-color: #f5f5f5 !important;
961
1033
  }
962
1034
 
1035
+ .dl-ag-pivot-grid .ag-cell[col-id^="PivotRowTotal_"] {
1036
+ background-color: #f5f5f5 !important;
1037
+ }
1038
+
963
1039
  .dl-ag-pivot-grid.ag-theme-balham .ag-cell {
964
1040
  border: none !important;
965
- border-right: 1px solid #e0e0e0 !important;
1041
+ border-right: 1px solid #DFE1E3 !important;
966
1042
  }
967
1043
 
968
1044
  .dl-ag-pivot-grid.ag-theme-balham .ag-row {
969
- border-bottom: 1px solid #e0e0e0 !important;
1045
+ border-bottom: 1px solid #DFE1E3 !important;
1046
+ background-color: #ffffff;
970
1047
  }
971
1048
 
972
1049
  .dl-ag-pivot-grid .dl-ag-pivot-data-cell,
973
1050
  .dl-ag-pivot-grid .ag-cell.dl-ag-pivot-data-cell {
974
1051
  text-align: right !important;
975
1052
  cursor: pointer;
1053
+ font-family: "Manrope", sans-serif;
1054
+ font-size: 12px;
1055
+ font-weight: 500;
1056
+ color: #46494A;
976
1057
  }
977
1058
 
978
1059
  .dl-ag-pivot-grid .dl-pivot-date-data-cell,
@@ -991,11 +1072,27 @@ $dark-grey: #717585;
991
1072
  text-align: left !important;
992
1073
  justify-content: flex-start;
993
1074
  background-color: #ffffff;
1075
+ font-family: "Manrope", sans-serif;
1076
+ font-size: 12px;
1077
+ font-weight: 500;
1078
+ color: #46494A;
1079
+ }
1080
+
1081
+ /* Parent row headers — match DevExtreme vertical-headers td div>span (weight 600) */
1082
+ .dl-ag-pivot-grid .ag-row-group.ag-row-group-expanded .dl-ag-pivot-row-label-cell,
1083
+ .dl-ag-pivot-grid .ag-row-group.ag-row-group-contracted .dl-ag-pivot-row-label-cell,
1084
+ .dl-ag-pivot-grid .ag-row-group.ag-row-group-expanded .ag-cell.dl-ag-pivot-row-label-cell,
1085
+ .dl-ag-pivot-grid .ag-row-group.ag-row-group-contracted .ag-cell.dl-ag-pivot-row-label-cell {
1086
+ font-weight: 600 !important;
1087
+ color: #46494A !important;
994
1088
  }
995
1089
 
996
1090
  .dl-ag-pivot-grid .ag-row-footer .ag-cell,
997
1091
  .dl-ag-pivot-grid .ag-row-group-footer .ag-cell {
1092
+ font-family: "Manrope", sans-serif;
1093
+ font-size: 12px;
998
1094
  font-weight: 500;
1095
+ color: #46494A;
999
1096
  }
1000
1097
 
1001
1098
  .dl-ag-pivot-grid .ag-row-footer .dl-ag-pivot-row-label-cell,
@@ -1004,13 +1101,21 @@ $dark-grey: #717585;
1004
1101
  }
1005
1102
 
1006
1103
  .dl-ag-pivot-grid .ag-cell {
1007
- font-family: "Manrope";
1104
+ font-family: "Manrope", sans-serif;
1008
1105
  font-size: 12px;
1009
1106
  font-weight: 500;
1010
1107
  color: #46494A;
1011
1108
  padding: 6px 8px 5px 8px;
1012
1109
  }
1013
1110
 
1111
+ .dl-ag-pivot-grid .ag-cell-value,
1112
+ .dl-ag-pivot-grid .ag-group-value,
1113
+ .dl-ag-pivot-grid .ag-group-child-count {
1114
+ font-family: "Manrope", sans-serif;
1115
+ font-size: 12px;
1116
+ color: #46494A;
1117
+ }
1118
+
1014
1119
  .dl-ag-pivot-grid .ag-row-group .ag-cell {
1015
1120
  text-align: left;
1016
1121
  background-color: #ffffff;
@@ -1020,8 +1125,38 @@ $dark-grey: #717585;
1020
1125
  text-align: left;
1021
1126
  }
1022
1127
 
1128
+ /*
1129
+ * Ag Grid paints cell backgrounds, not the row. Footer row bg alone is invisible.
1130
+ * Match DevExtreme totals across the full total row (row label + measure cells).
1131
+ */
1023
1132
  .dl-ag-pivot-grid .ag-row-footer,
1024
1133
  .dl-ag-pivot-grid .ag-row-group-footer {
1134
+ background-color: #dddddd33 !important;
1135
+ }
1136
+
1137
+ .dl-ag-pivot-grid .ag-row-footer .ag-cell,
1138
+ .dl-ag-pivot-grid .ag-row-group-footer .ag-cell,
1139
+ .dl-ag-pivot-grid .ag-row-footer .dl-ag-pivot-row-label-cell,
1140
+ .dl-ag-pivot-grid .ag-row-group-footer .dl-ag-pivot-row-label-cell,
1141
+ .dl-ag-pivot-grid .ag-row-footer .dl-ag-pivot-data-cell,
1142
+ .dl-ag-pivot-grid .ag-row-group-footer .dl-ag-pivot-data-cell,
1143
+ .dl-ag-pivot-grid .ag-row-footer .ag-cell.dl-ag-pivot-row-label-cell,
1144
+ .dl-ag-pivot-grid .ag-row-group-footer .ag-cell.dl-ag-pivot-row-label-cell,
1145
+ .dl-ag-pivot-grid .ag-row-footer .ag-cell.dl-ag-pivot-data-cell,
1146
+ .dl-ag-pivot-grid .ag-row-group-footer .ag-cell.dl-ag-pivot-data-cell {
1147
+ background-color: #dddddd33 !important;
1148
+ }
1149
+
1150
+ /* Grand Total row */
1151
+ .dl-ag-pivot-grid .ag-row-footer.ag-row-level--1 {
1152
+ background-color: #f5f5f5 !important;
1153
+ }
1154
+
1155
+ .dl-ag-pivot-grid .ag-row-footer.ag-row-level--1 .ag-cell,
1156
+ .dl-ag-pivot-grid .ag-row-footer.ag-row-level--1 .dl-ag-pivot-row-label-cell,
1157
+ .dl-ag-pivot-grid .ag-row-footer.ag-row-level--1 .dl-ag-pivot-data-cell,
1158
+ .dl-ag-pivot-grid .ag-row-footer.ag-row-level--1 .ag-cell.dl-ag-pivot-row-label-cell,
1159
+ .dl-ag-pivot-grid .ag-row-footer.ag-row-level--1 .ag-cell.dl-ag-pivot-data-cell {
1025
1160
  background-color: #f5f5f5 !important;
1026
1161
  }
1027
1162
 
@@ -1033,6 +1168,10 @@ $dark-grey: #717585;
1033
1168
  visibility: hidden;
1034
1169
  }
1035
1170
 
1171
+ .dl-ag-pivot-grid .ag-icon {
1172
+ color: #46494A;
1173
+ }
1174
+
1036
1175
  .dx-scrollbar-hoverable .dx-scrollable-scroll.dx-state-invisible .dx-scrollable-scroll-content {
1037
1176
  background-color: rgba(191, 191, 191, .7);
1038
1177
  }
@@ -26,8 +26,8 @@ export declare const isPivotMeasureValueEmpty: (value: any) => boolean;
26
26
  export declare const logitudeSumAgg: (params: {
27
27
  values: any[];
28
28
  }) => number | null;
29
- export declare const isDevExtremePivotDataCellTotalOrGrandTotal: (cell: any) => boolean;
30
- export declare const isDevExtremeSummaryCellTotalOrGrandTotal: (cell: any) => boolean;
29
+ export declare const isDevExtremePivotDataCellTotalOrGrandTotal: (cell: any, hasRowFields: boolean, hasColumnFields: boolean) => boolean;
30
+ export declare const isDevExtremeSummaryCellTotalOrGrandTotal: (cell: any, hasRowFields: boolean, hasColumnFields: boolean) => boolean;
31
31
  export declare const isAgGridPivotDateMeasureTotalDisplayCell: (params: any) => boolean;
32
32
  export declare const logitudeMinAgg: (params: {
33
33
  values: any[];
@@ -52,6 +52,7 @@ export declare const collectPivotRowPath: (startNode: any) => {
52
52
  field: string;
53
53
  key: any;
54
54
  }[];
55
+ export declare const isAgGridPivotDrillDownMeasureColumn: (colDef: any, measures: PivotApiMeasure[]) => boolean;
55
56
  export declare const buildPivotDrillDownPivotFields: (colDef: any, startNode: any, apiFields: PivotApiField[]) => any[];
56
57
  export declare const getMeasureCaption: (measure: PivotApiMeasure) => string;
57
58
  export declare const parseJsonArray: (json: string | null | undefined) => any[];
package/dist/index.js CHANGED
@@ -2232,14 +2232,22 @@ var isAgGridDateMeasureTotalAggregation = function isAgGridDateMeasureTotalAggre
2232
2232
  return !!(colId && String(colId).indexOf('PivotRowTotal_') === 0);
2233
2233
  };
2234
2234
 
2235
- var isDevExtremePivotDataCellTotalOrGrandTotal = function isDevExtremePivotDataCellTotalOrGrandTotal(cell) {
2235
+ var isDevExtremePivotDataCellTotalOrGrandTotal = function isDevExtremePivotDataCellTotalOrGrandTotal(cell, hasRowFields, hasColumnFields) {
2236
2236
  if (!cell) {
2237
2237
  return false;
2238
2238
  }
2239
2239
 
2240
- return cell.rowType === 'T' || cell.rowType === 'GT' || cell.columnType === 'T' || cell.columnType === 'GT';
2240
+ if (hasRowFields && (cell.rowType === 'T' || cell.rowType === 'GT')) {
2241
+ return true;
2242
+ }
2243
+
2244
+ if (hasColumnFields && (cell.columnType === 'T' || cell.columnType === 'GT')) {
2245
+ return true;
2246
+ }
2247
+
2248
+ return false;
2241
2249
  };
2242
- var isDevExtremeSummaryCellTotalOrGrandTotal = function isDevExtremeSummaryCellTotalOrGrandTotal(cell) {
2250
+ var isDevExtremeSummaryCellTotalOrGrandTotal = function isDevExtremeSummaryCellTotalOrGrandTotal(cell, hasRowFields, hasColumnFields) {
2243
2251
  if (!cell) {
2244
2252
  return false;
2245
2253
  }
@@ -2248,7 +2256,16 @@ var isDevExtremeSummaryCellTotalOrGrandTotal = function isDevExtremeSummaryCellT
2248
2256
  var columnPath = cell._columnPath;
2249
2257
  var rowType = rowPath && rowPath[0] ? rowPath[0].type : null;
2250
2258
  var columnType = columnPath && columnPath[0] ? columnPath[0].type : null;
2251
- return rowType === 'T' || rowType === 'GT' || columnType === 'T' || columnType === 'GT';
2259
+
2260
+ if (hasRowFields && (rowType === 'T' || rowType === 'GT')) {
2261
+ return true;
2262
+ }
2263
+
2264
+ if (hasColumnFields && (columnType === 'T' || columnType === 'GT')) {
2265
+ return true;
2266
+ }
2267
+
2268
+ return false;
2252
2269
  };
2253
2270
  var isAgGridPivotDateMeasureTotalDisplayCell = function isAgGridPivotDateMeasureTotalDisplayCell(params) {
2254
2271
  var node = params && params.node;
@@ -2694,17 +2711,15 @@ var collectPivotRowPath = function collectPivotRowPath(startNode) {
2694
2711
  return path;
2695
2712
  }
2696
2713
 
2697
- if (startNode.footer) {
2698
- if (startNode.level === -1) {
2699
- return path;
2700
- }
2714
+ if (startNode.footer && startNode.level === -1) {
2715
+ return path;
2716
+ }
2701
2717
 
2702
- if (startNode.field != null && startNode.key !== undefined) {
2703
- path.unshift({
2704
- field: startNode.field,
2705
- key: startNode.key
2706
- });
2707
- }
2718
+ if (startNode.field != null && startNode.key !== undefined) {
2719
+ path.unshift({
2720
+ field: startNode.field,
2721
+ key: startNode.key
2722
+ });
2708
2723
  }
2709
2724
 
2710
2725
  var node = startNode.parent;
@@ -2722,6 +2737,29 @@ var collectPivotRowPath = function collectPivotRowPath(startNode) {
2722
2737
 
2723
2738
  return path;
2724
2739
  };
2740
+ var isAgGridPivotDrillDownMeasureColumn = function isAgGridPivotDrillDownMeasureColumn(colDef, measures) {
2741
+ if (!colDef || !measures || measures.length === 0) {
2742
+ return false;
2743
+ }
2744
+
2745
+ if (colDef.pivotValueColumn) {
2746
+ return true;
2747
+ }
2748
+
2749
+ if (colDef.rowGroup || colDef.pivot) {
2750
+ return false;
2751
+ }
2752
+
2753
+ var colId = colDef.colId ? String(colDef.colId) : '';
2754
+
2755
+ if (colId.indexOf('ag-Grid-AutoColumn') === 0) {
2756
+ return false;
2757
+ }
2758
+
2759
+ return measures.some(function (measure) {
2760
+ return measure.PivotMeasureCode === colDef.field || measure.PivotMeasureCode === colId;
2761
+ });
2762
+ };
2725
2763
  var buildPivotDrillDownPivotFields = function buildPivotDrillDownPivotFields(colDef, startNode, apiFields) {
2726
2764
  var columnFields = apiFields.filter(function (field) {
2727
2765
  return !isRowPivotField(field);
@@ -2809,6 +2847,8 @@ var PivotTable = React.forwardRef(function (props, comRef) {
2809
2847
  var tabledata = React.useRef();
2810
2848
  var pivotGridRef = React.useRef(null);
2811
2849
  var dateMeasureDataFieldsRef = React.useRef(new Set());
2850
+ var pivotHasRowFieldsRef = React.useRef(false);
2851
+ var pivotHasColumnFieldsRef = React.useRef(false);
2812
2852
 
2813
2853
  var _useState3 = React.useState(new PivotGridDataSource({
2814
2854
  store: [],
@@ -2947,7 +2987,7 @@ var PivotTable = React.forwardRef(function (props, comRef) {
2947
2987
 
2948
2988
  e.cellElement.classList.add(PIVOT_DATE_DATA_CELL_CLASS);
2949
2989
 
2950
- if (isDevExtremePivotDataCellTotalOrGrandTotal(e.cell)) {
2990
+ if (isDevExtremePivotDataCellTotalOrGrandTotal(e.cell, pivotHasRowFieldsRef.current, pivotHasColumnFieldsRef.current)) {
2951
2991
  e.cell.text = '';
2952
2992
  var contentSpan = e.cellElement ? e.cellElement.querySelector('span') : null;
2953
2993
 
@@ -3035,6 +3075,14 @@ var PivotTable = React.forwardRef(function (props, comRef) {
3035
3075
  }
3036
3076
  };
3037
3077
  });
3078
+ var hasRowFields = tabledata.current.PivoFields.some(function (field) {
3079
+ return field.PivotCode && field.PivotCode.includes('Row');
3080
+ });
3081
+ var hasColumnFields = tabledata.current.PivoFields.some(function (field) {
3082
+ return field.PivotCode && !field.PivotCode.includes('Row');
3083
+ });
3084
+ pivotHasRowFieldsRef.current = hasRowFields;
3085
+ pivotHasColumnFieldsRef.current = hasColumnFields;
3038
3086
  dateMeasureDataFieldsRef.current = new Set(tabledata.current.PivotMeasures.filter(function (measure) {
3039
3087
  return (measure.MeasureCode === 'Min' || measure.MeasureCode === 'Max') && FieldDataType.isDateOrDateTimeType(measure.MeasureFieldDataType);
3040
3088
  }).map(function (measure) {
@@ -3108,7 +3156,7 @@ var PivotTable = React.forwardRef(function (props, comRef) {
3108
3156
  }
3109
3157
  }, isDateMinMaxMeasure ? {
3110
3158
  calculateSummaryValue: function calculateSummaryValue(cell) {
3111
- if (isDevExtremeSummaryCellTotalOrGrandTotal(cell)) {
3159
+ if (isDevExtremeSummaryCellTotalOrGrandTotal(cell, hasRowFields, hasColumnFields)) {
3112
3160
  return null;
3113
3161
  }
3114
3162
 
@@ -3136,17 +3184,7 @@ var PivotTable = React.forwardRef(function (props, comRef) {
3136
3184
  }
3137
3185
  };
3138
3186
 
3139
- var isRowsEmptyAndColumnsNotEmpty = function isRowsEmptyAndColumnsNotEmpty() {
3140
- var pivotRows = widget && !isNullOrUndefinedOrEmpty(widget === null || widget === void 0 ? void 0 : widget.PivotRows) ? JSON.parse(widget === null || widget === void 0 ? void 0 : widget.PivotRows) : [];
3141
- var pivotColumns = widget && !isNullOrUndefinedOrEmpty(widget === null || widget === void 0 ? void 0 : widget.PivotColumns) ? JSON.parse(widget === null || widget === void 0 ? void 0 : widget.PivotColumns) : [];
3142
- return (pivotRows === null || pivotRows === void 0 ? void 0 : pivotRows.length) === 0 && (pivotColumns === null || pivotColumns === void 0 ? void 0 : pivotColumns.length) > 0;
3143
- };
3144
-
3145
3187
  var canShowRowsGrandTotal = function canShowRowsGrandTotal() {
3146
- if (isRowsEmptyAndColumnsNotEmpty()) {
3147
- return true;
3148
- }
3149
-
3150
3188
  var pivotTotalsSettings = widget && !isNullOrUndefinedOrEmpty(widget === null || widget === void 0 ? void 0 : widget.PivotTotalsSettings) ? JSON.parse(widget === null || widget === void 0 ? void 0 : widget.PivotTotalsSettings) : {};
3151
3189
  return !isNullOrUndefinedOrEmpty(pivotTotalsSettings.ShowRowsGrandTotal) ? pivotTotalsSettings.ShowRowsGrandTotal : false;
3152
3190
  };
@@ -3441,12 +3479,6 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3441
3479
  return colDef;
3442
3480
  };
3443
3481
 
3444
- var isRowsEmptyAndColumnsNotEmpty = function isRowsEmptyAndColumnsNotEmpty() {
3445
- var pivotRows = parseJsonArray(widget === null || widget === void 0 ? void 0 : widget.PivotRows);
3446
- var pivotColumns = parseJsonArray(widget === null || widget === void 0 ? void 0 : widget.PivotColumns);
3447
- return pivotRows.length === 0 && pivotColumns.length > 0;
3448
- };
3449
-
3450
3482
  var isRowsNotEmptyAndColumnsEmpty = function isRowsNotEmptyAndColumnsEmpty() {
3451
3483
  var pivotRows = parseJsonArray(widget === null || widget === void 0 ? void 0 : widget.PivotRows);
3452
3484
  var pivotColumns = parseJsonArray(widget === null || widget === void 0 ? void 0 : widget.PivotColumns);
@@ -3454,7 +3486,6 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3454
3486
  };
3455
3487
 
3456
3488
  var canShowRowsGrandTotal = function canShowRowsGrandTotal() {
3457
- if (isRowsEmptyAndColumnsNotEmpty()) return true;
3458
3489
  var settings = parsePivotTotalsSettings(widget === null || widget === void 0 ? void 0 : widget.PivotTotalsSettings);
3459
3490
  return !isNullOrUndefinedOrEmpty(settings.ShowRowsGrandTotal) ? !!settings.ShowRowsGrandTotal : false;
3460
3491
  };
@@ -3518,7 +3549,7 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3518
3549
  }, []);
3519
3550
  var onCellClicked = React.useCallback(function (event) {
3520
3551
  var colDef = event.colDef;
3521
- if (!colDef || !colDef.pivotValueColumn) return;
3552
+ if (!isAgGridPivotDrillDownMeasureColumn(colDef, pivotMeasuresRef.current)) return;
3522
3553
  if (isPivotMeasureValueEmpty(event.value)) return;
3523
3554
  var pivotFields = buildPivotDrillDownPivotFields(colDef, event.node, pivotFieldsRef.current);
3524
3555
  props.customChartProps.onSelectDataPoint({
@@ -3550,14 +3581,8 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3550
3581
  wrapText: true,
3551
3582
  autoHeight: true,
3552
3583
  cellClass: 'dl-ag-pivot-row-label-cell',
3553
- headerValueGetter: function headerValueGetter(params) {
3554
- var colDef = params.colDef;
3555
- var showRowGroup = colDef && colDef.showRowGroup;
3556
- if (!showRowGroup) return '';
3557
- var field = pivotFieldsRef.current.find(function (f) {
3558
- return f.PivotCode === showRowGroup;
3559
- });
3560
- return field ? field.DisplayName : '';
3584
+ headerValueGetter: function headerValueGetter() {
3585
+ return '';
3561
3586
  },
3562
3587
  valueFormatter: function valueFormatter(params) {
3563
3588
  var colDef = params.colDef;
@@ -3631,6 +3656,21 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3631
3656
  scheduleRowGrandTotalHeaderLabel();
3632
3657
  };
3633
3658
 
3659
+ var getContextMenuItems = React.useCallback(function (params) {
3660
+ var colId = params.column && params.column.getColId ? params.column.getColId() : '';
3661
+ if (!colId || colId.indexOf('ag-Grid-AutoColumn') !== 0) return [];
3662
+ return [{
3663
+ name: 'Expand All',
3664
+ action: function action() {
3665
+ if (params.api) params.api.expandAll();
3666
+ }
3667
+ }, {
3668
+ name: 'Collapse All',
3669
+ action: function action() {
3670
+ if (params.api) params.api.collapseAll();
3671
+ }
3672
+ }];
3673
+ }, []);
3634
3674
  var gridWrapperClassName = 'ag-theme-balham pivot-grid-element dl-ag-pivot-grid';
3635
3675
  return React__default.createElement(React__default.Fragment, null, isLoading ? React__default.createElement("div", {
3636
3676
  className: 'dl-full-hight dl-flex-content-center spinner-custome'
@@ -3666,8 +3706,8 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3666
3706
  onFirstDataRendered: onFirstDataRendered,
3667
3707
  onColumnPivotChanged: onColumnPivotChanged,
3668
3708
  onColumnResized: onColumnResized,
3709
+ getContextMenuItems: getContextMenuItems,
3669
3710
  animateRows: false,
3670
- suppressContextMenu: true,
3671
3711
  suppressMovableColumns: true,
3672
3712
  headerHeight: 36,
3673
3713
  rowHeight: 36