logitude-dashboard-library 3.2.66 → 3.2.67

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.
@@ -1016,6 +1016,19 @@ $dark-grey: #717585;
1016
1016
  color: #222222 !important;
1017
1017
  }
1018
1018
 
1019
+ /*
1020
+ * Header wrap only (Ag Grid 27 / pre-v28). Leaf headers also get white-space via
1021
+ * headerComponentParams.template; group headers have no wrapHeaderText until v32.1.
1022
+ * Do not touch body .ag-cell here.
1023
+ */
1024
+ .dl-ag-pivot-grid .ag-header-cell-text,
1025
+ .dl-ag-pivot-grid .ag-header-group-text {
1026
+ white-space: normal !important;
1027
+ overflow: visible !important;
1028
+ text-overflow: clip !important;
1029
+ line-height: 1.25;
1030
+ }
1031
+
1019
1032
  .dl-ag-pivot-grid .ag-header-cell[col-id^="ag-Grid-AutoColumn"] {
1020
1033
  text-align: left;
1021
1034
  }
@@ -1036,6 +1049,19 @@ $dark-grey: #717585;
1036
1049
  background-color: #f5f5f5 !important;
1037
1050
  }
1038
1051
 
1052
+ /* Column group totals (e.g. "Dtest Total") — match DX .dx-total / row-footer totals */
1053
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-cell.dl-pivot-column-group-total-header,
1054
+ .dl-ag-pivot-grid.ag-theme-balham .ag-header-group-cell.dl-pivot-column-group-total-header,
1055
+ .dl-ag-pivot-grid .ag-header-cell.dl-pivot-column-group-total-header,
1056
+ .dl-ag-pivot-grid .ag-header-group-cell.dl-pivot-column-group-total-header {
1057
+ background-color: #dddddd33 !important;
1058
+ }
1059
+
1060
+ .dl-ag-pivot-grid .ag-cell.dl-pivot-column-group-total-cell,
1061
+ .dl-ag-pivot-grid .dl-pivot-column-group-total-cell {
1062
+ background-color: #dddddd33 !important;
1063
+ }
1064
+
1039
1065
  .dl-ag-pivot-grid.ag-theme-balham .ag-cell {
1040
1066
  border: none !important;
1041
1067
  border-right: 1px solid #DFE1E3 !important;
@@ -1105,7 +1131,12 @@ $dark-grey: #717585;
1105
1131
  font-size: 12px;
1106
1132
  font-weight: 500;
1107
1133
  color: #46494A;
1108
- padding: 6px 8px 5px 8px;
1134
+ /*
1135
+ * Ag Grid autoHeight = wrapperHeight + paddingTop + paddingBottom (CellCtrl.setupAutoHeight).
1136
+ * Balham cell line-height is 26px; with old padding 6+5 the row measured ~37px and beat rowHeight 30.
1137
+ * Vertical padding 2+2 => 26+4 = 30 for single-line cells; wrapped content can still grow.
1138
+ */
1139
+ padding: 2px 8px 2px 8px;
1109
1140
  }
1110
1141
 
1111
1142
  .dl-ag-pivot-grid .ag-cell-value,
@@ -42,6 +42,25 @@ export declare const getPivotDisplayName: (pivotData: any[], fieldName: string,
42
42
  export declare const isPivotRowGrandTotalColumnDef: (colDef: any) => boolean;
43
43
  export declare const isPivotRowGrandTotalGroupDef: (colGroupDef: any) => boolean;
44
44
  export declare const resolvePivotGroupHeaderName: (colGroupDef: any, columnFields: PivotApiField[], lookupDisplayName: (field: PivotApiField, rawValue: any) => string) => string | null;
45
+ /**
46
+ * Ag Grid expandable pivot totals: leaf with pivotTotalColumnIds + columnGroupShow 'closed'.
47
+ * (Created by addExpandablePivotGroups — one column per measure.)
48
+ */
49
+ export declare const isAgGridExpandablePivotColumnTotalLeaf: (colDef: any) => boolean;
50
+ /** After DX promote: per-measure column-group total leaf (still has pivotTotalColumnIds). */
51
+ export declare const isAgGridPivotColumnGroupTotalColumn: (colDef: any) => boolean;
52
+ export declare const setAllAgGridColumnGroupsOpened: (columnApi: any, opened: boolean) => void;
53
+ /**
54
+ * Choice 2 (DX parity) on top of Ag Grid expandable pivot totals:
55
+ * - Keeps native per-measure total leaves (same colIds → aggregation unchanged).
56
+ * - Clears columnGroupShow so totals stay visible when expanded AND collapsed
57
+ * (Ag Grid docs: undefined/null = always shown; open+always-shown still expandable).
58
+ * - Wraps them in a "{Value} Total" group for DX header layout.
59
+ *
60
+ * Requires: pivotColumnGroupTotals OFF (otherwise addExpandablePivotGroups is skipped)
61
+ * and suppressExpandablePivotGroups OFF when column totals are enabled.
62
+ */
63
+ export declare const promoteExpandablePivotColumnTotalsForDx: (colGroupDef: any, columnFields: PivotApiField[], lookupDisplayName: (field: PivotApiField, rawValue: any) => string) => void;
45
64
  export declare const getPivotValueColumnId: (pivotValueColumn: any) => string | null;
46
65
  export declare const resolveMeasureFromPivotValueColumn: (colDef: any, measures: PivotApiMeasure[]) => PivotApiMeasure | undefined;
47
66
  export declare const resolvePivotLeafHeaderName: (colDef: any, columnFields: PivotApiField[], lookupDisplayName: (field: PivotApiField, rawValue: any) => string, measureCount: number, measures: PivotApiMeasure[]) => string | null;
@@ -53,6 +72,13 @@ export declare const collectPivotRowPath: (startNode: any) => {
53
72
  key: any;
54
73
  }[];
55
74
  export declare const isAgGridPivotDrillDownMeasureColumn: (colDef: any, measures: PivotApiMeasure[]) => boolean;
75
+ /**
76
+ * Map Ag Grid blank dimension keys to what DrillDownDataProvider expects for IS NULL.
77
+ * - Row groups in pivot mode: null/undefined → single space ' ' (GroupStage).
78
+ * - Pivot column buckets: missing → '' (PivotStage.bucketChildren).
79
+ * Backend: string.IsNullOrEmpty(value) → `{field} IS NULL`.
80
+ */
81
+ export declare const normalizePivotDrillDownFieldValue: (value: any) => string | null;
56
82
  export declare const buildPivotDrillDownPivotFields: (colDef: any, startNode: any, apiFields: PivotApiField[]) => any[];
57
83
  export declare const getMeasureCaption: (measure: PivotApiMeasure) => string;
58
84
  export declare const parseJsonArray: (json: string | null | undefined) => any[];
package/dist/index.js CHANGED
@@ -2421,6 +2421,10 @@ var resolvePivotGroupHeaderName = function resolvePivotGroupHeaderName(colGroupD
2421
2421
  return 'Grand Total';
2422
2422
  }
2423
2423
 
2424
+ if (colGroupDef && colGroupDef.dlPivotColumnGroupTotal) {
2425
+ return null;
2426
+ }
2427
+
2424
2428
  var pivotKeys = colGroupDef && colGroupDef.pivotKeys ? colGroupDef.pivotKeys : [];
2425
2429
 
2426
2430
  if (pivotKeys.length === 0) {
@@ -2435,6 +2439,97 @@ var resolvePivotGroupHeaderName = function resolvePivotGroupHeaderName(colGroupD
2435
2439
 
2436
2440
  return lookupDisplayName(field, pivotKeys[pivotKeys.length - 1]);
2437
2441
  };
2442
+ var isAgGridExpandablePivotColumnTotalLeaf = function isAgGridExpandablePivotColumnTotalLeaf(colDef) {
2443
+ if (!colDef || colDef.children) {
2444
+ return false;
2445
+ }
2446
+
2447
+ if (isPivotRowGrandTotalColumnDef(colDef)) {
2448
+ return false;
2449
+ }
2450
+
2451
+ if (colDef.pivotTotalColumnIds === undefined || colDef.pivotTotalColumnIds === null) {
2452
+ return false;
2453
+ }
2454
+
2455
+ return colDef.columnGroupShow === 'closed';
2456
+ };
2457
+ var isAgGridPivotColumnGroupTotalColumn = function isAgGridPivotColumnGroupTotalColumn(colDef) {
2458
+ if (!colDef || colDef.children) {
2459
+ return false;
2460
+ }
2461
+
2462
+ if (isPivotRowGrandTotalColumnDef(colDef)) {
2463
+ return false;
2464
+ }
2465
+
2466
+ if (colDef.dlPivotColumnGroupTotalLeaf) {
2467
+ return true;
2468
+ }
2469
+
2470
+ return colDef.pivotTotalColumnIds !== undefined && colDef.pivotTotalColumnIds !== null;
2471
+ };
2472
+ var setAllAgGridColumnGroupsOpened = function setAllAgGridColumnGroupsOpened(columnApi, opened) {
2473
+ if (!columnApi || !columnApi.getColumnGroupState || !columnApi.setColumnGroupState) {
2474
+ return;
2475
+ }
2476
+
2477
+ var groupState = columnApi.getColumnGroupState();
2478
+
2479
+ if (!groupState || groupState.length === 0) {
2480
+ return;
2481
+ }
2482
+
2483
+ columnApi.setColumnGroupState(groupState.map(function (group) {
2484
+ return {
2485
+ groupId: group.groupId,
2486
+ open: opened
2487
+ };
2488
+ }));
2489
+ };
2490
+
2491
+ var buildDxPivotColumnGroupTotalHeaderName = function buildDxPivotColumnGroupTotalHeaderName(parentGroupDef, columnFields, lookupDisplayName) {
2492
+ var pivotKeys = parentGroupDef && parentGroupDef.pivotKeys ? parentGroupDef.pivotKeys : [];
2493
+
2494
+ if (pivotKeys.length === 0) {
2495
+ return 'Total';
2496
+ }
2497
+
2498
+ var field = columnFields[pivotKeys.length - 1];
2499
+ var rawValue = pivotKeys[pivotKeys.length - 1];
2500
+ var displayName = field ? lookupDisplayName(field, rawValue) : rawValue == null ? '' : String(rawValue);
2501
+ return displayName ? displayName + " Total" : 'Total';
2502
+ };
2503
+
2504
+ var promoteExpandablePivotColumnTotalsForDx = function promoteExpandablePivotColumnTotalsForDx(colGroupDef, columnFields, lookupDisplayName) {
2505
+ if (!colGroupDef || !colGroupDef.children || colGroupDef.children.length === 0) {
2506
+ return;
2507
+ }
2508
+
2509
+ var totalLeaves = [];
2510
+ var otherChildren = [];
2511
+ colGroupDef.children.forEach(function (child) {
2512
+ if (isAgGridExpandablePivotColumnTotalLeaf(child)) {
2513
+ delete child.columnGroupShow;
2514
+ child.dlPivotColumnGroupTotalLeaf = true;
2515
+ totalLeaves.push(child);
2516
+ } else {
2517
+ otherChildren.push(child);
2518
+ }
2519
+ });
2520
+
2521
+ if (totalLeaves.length === 0) {
2522
+ return;
2523
+ }
2524
+
2525
+ colGroupDef.children = otherChildren.concat([{
2526
+ headerName: buildDxPivotColumnGroupTotalHeaderName(colGroupDef, columnFields, lookupDisplayName),
2527
+ marryChildren: true,
2528
+ dlPivotColumnGroupTotal: true,
2529
+ headerClass: 'dl-pivot-column-group-total-header',
2530
+ children: totalLeaves
2531
+ }]);
2532
+ };
2438
2533
  var getPivotValueColumnId = function getPivotValueColumnId(pivotValueColumn) {
2439
2534
  if (!pivotValueColumn) {
2440
2535
  return null;
@@ -2761,6 +2856,13 @@ var isAgGridPivotDrillDownMeasureColumn = function isAgGridPivotDrillDownMeasure
2761
2856
  return measure.PivotMeasureCode === colDef.field || measure.PivotMeasureCode === colId;
2762
2857
  });
2763
2858
  };
2859
+ var normalizePivotDrillDownFieldValue = function normalizePivotDrillDownFieldValue(value) {
2860
+ if (value === null || value === undefined || value === '' || value === ' ') {
2861
+ return null;
2862
+ }
2863
+
2864
+ return value;
2865
+ };
2764
2866
  var buildPivotDrillDownPivotFields = function buildPivotDrillDownPivotFields(colDef, startNode, apiFields) {
2765
2867
  var columnFields = apiFields.filter(function (field) {
2766
2868
  return !isRowPivotField(field);
@@ -2782,7 +2884,7 @@ var buildPivotDrillDownPivotFields = function buildPivotDrillDownPivotFields(col
2782
2884
  pivotFields.push({
2783
2885
  FieldId: field.FieldId,
2784
2886
  FieldType: field.FieldType ? field.FieldType : 'Field',
2785
- FieldValue: key,
2887
+ FieldValue: normalizePivotDrillDownFieldValue(key),
2786
2888
  DateCode: field.DateCode
2787
2889
  });
2788
2890
  });
@@ -2800,7 +2902,7 @@ var buildPivotDrillDownPivotFields = function buildPivotDrillDownPivotFields(col
2800
2902
  pivotFields.push({
2801
2903
  FieldId: field.FieldId,
2802
2904
  FieldType: field.FieldType ? field.FieldType : 'Field',
2803
- FieldValue: pathItem.key,
2905
+ FieldValue: normalizePivotDrillDownFieldValue(pathItem.key),
2804
2906
  DateCode: field.DateCode
2805
2907
  });
2806
2908
  });
@@ -3257,6 +3359,42 @@ var PivotTable = React.forwardRef(function (props, comRef) {
3257
3359
  });
3258
3360
 
3259
3361
  var ROW_GROUP_COLUMN_MIN_WIDTH = 100;
3362
+ var PIVOT_VALUE_COLUMN_MIN_WIDTH = 100;
3363
+ var PIVOT_HEADER_BASE_HEIGHT = 36;
3364
+ var PIVOT_ROW_MIN_HEIGHT = 30;
3365
+ var PIVOT_HEADER_WRAP_PADDING = 20;
3366
+ var AG_PIVOT_WRAPPING_HEADER_TEMPLATE = '<div class="ag-cell-label-container" role="presentation">' + ' <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button"></span>' + ' <div ref="eLabel" class="ag-header-cell-label" role="presentation">' + ' <span ref="eSortOrder" class="ag-header-icon ag-sort-order"></span>' + ' <span ref="eSortAsc" class="ag-header-icon ag-sort-ascending-icon"></span>' + ' <span ref="eSortDesc" class="ag-header-icon ag-sort-descending-icon"></span>' + ' <span ref="eSortNone" class="ag-header-icon ag-sort-none-icon"></span>' + ' <span ref="eText" class="ag-header-cell-text" role="columnheader" style="white-space: normal;"></span>' + ' <span ref="eFilter" class="ag-header-icon ag-filter-icon"></span>' + ' </div>' + '</div>';
3367
+
3368
+ var applyFlexiblePivotValueColumnSizing = function applyFlexiblePivotValueColumnSizing(colDef) {
3369
+ delete colDef.width;
3370
+ colDef.flex = 1;
3371
+ colDef.minWidth = PIVOT_VALUE_COLUMN_MIN_WIDTH;
3372
+ };
3373
+
3374
+ var getMaxHeaderTextClientHeight = function getMaxHeaderTextClientHeight(root, selector) {
3375
+ var nodes = root.querySelectorAll(selector);
3376
+ var maxHeight = 0;
3377
+
3378
+ for (var i = 0; i < nodes.length; i++) {
3379
+ var height = nodes[i].clientHeight;
3380
+ if (height > maxHeight) maxHeight = height;
3381
+ }
3382
+
3383
+ return maxHeight;
3384
+ };
3385
+
3386
+ var syncWrappedPivotHeaderHeights = function syncWrappedPivotHeaderHeights(api, root) {
3387
+ if (!api || !root) return;
3388
+ var apiAny = api;
3389
+ var leafTextHeight = getMaxHeaderTextClientHeight(root, '.ag-header-cell-text');
3390
+ var groupTextHeight = getMaxHeaderTextClientHeight(root, '.ag-header-group-text');
3391
+ var leafHeight = Math.max(PIVOT_HEADER_BASE_HEIGHT, leafTextHeight + PIVOT_HEADER_WRAP_PADDING);
3392
+ var groupHeight = Math.max(PIVOT_HEADER_BASE_HEIGHT, groupTextHeight + PIVOT_HEADER_WRAP_PADDING);
3393
+ if (apiAny.setPivotHeaderHeight) apiAny.setPivotHeaderHeight(leafHeight);
3394
+ if (apiAny.setHeaderHeight) apiAny.setHeaderHeight(leafHeight);
3395
+ if (apiAny.setPivotGroupHeaderHeight) apiAny.setPivotGroupHeaderHeight(groupHeight);
3396
+ if (apiAny.setGroupHeaderHeight) apiAny.setGroupHeaderHeight(groupHeight);
3397
+ };
3260
3398
 
3261
3399
  var applyAgGridLicense = function applyAgGridLicense() {
3262
3400
  if (!Session.AgGridLicenseKey) return;
@@ -3472,6 +3610,7 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3472
3610
  return formatPivotMeasureValue(params.value, measure);
3473
3611
  }
3474
3612
  };
3613
+ applyFlexiblePivotValueColumnSizing(colDef);
3475
3614
 
3476
3615
  if (!isPivotDateMinMaxMeasure(measure)) {
3477
3616
  colDef.type = 'numericColumn';
@@ -3498,26 +3637,45 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3498
3637
  };
3499
3638
 
3500
3639
  var canShowRowsTotal = function canShowRowsTotal() {
3640
+ var pivotRows = parseJsonArray(widget === null || widget === void 0 ? void 0 : widget.PivotRows);
3641
+ if (pivotRows.length <= 1) return false;
3501
3642
  var settings = parsePivotTotalsSettings(widget === null || widget === void 0 ? void 0 : widget.PivotTotalsSettings);
3502
3643
  return !isNullOrUndefinedOrEmpty(settings.ShowRowsTotal) ? !!settings.ShowRowsTotal : false;
3503
3644
  };
3504
3645
 
3505
3646
  var canShowColumnsTotal = function canShowColumnsTotal() {
3647
+ var pivotColumns = parseJsonArray(widget === null || widget === void 0 ? void 0 : widget.PivotColumns);
3648
+ if (pivotColumns.length <= 1) return false;
3506
3649
  var settings = parsePivotTotalsSettings(widget === null || widget === void 0 ? void 0 : widget.PivotTotalsSettings);
3507
3650
  return !isNullOrUndefinedOrEmpty(settings.ShowColumnsTotal) ? !!settings.ShowColumnsTotal : false;
3508
3651
  };
3509
3652
 
3653
+ var showColumnsTotal = canShowColumnsTotal();
3654
+ var pivotRowTotalsPosition = canShowColumnsGrandTotal() ? 'after' : '';
3655
+ React.useEffect(function () {
3656
+ if (!gridApiRef.current || isLoading || columnDefs.length === 0) return;
3657
+ gridApiRef.current.setColumnDefs(columnDefs.slice());
3658
+ }, [widget === null || widget === void 0 ? void 0 : widget.PivotTotalsSettings, showColumnsTotal, pivotRowTotalsPosition]);
3510
3659
  var isSingleMeasurePivot = measureCount <= 1;
3511
3660
  var processSecondaryColGroupDef = React.useCallback(function (colGroupDef) {
3512
3661
  var columnFields = pivotFieldsRef.current.filter(function (field) {
3513
3662
  return !isRowPivotField(field);
3514
3663
  });
3664
+
3665
+ if (showColumnsTotal) {
3666
+ promoteExpandablePivotColumnTotalsForDx(colGroupDef, columnFields, lookupDisplayName);
3667
+
3668
+ if (!colGroupDef.dlPivotColumnGroupTotal) {
3669
+ colGroupDef.openByDefault = true;
3670
+ }
3671
+ }
3672
+
3515
3673
  var headerName = resolvePivotGroupHeaderName(colGroupDef, columnFields, lookupDisplayName);
3516
3674
 
3517
3675
  if (headerName) {
3518
3676
  colGroupDef.headerName = headerName;
3519
3677
  }
3520
- }, []);
3678
+ }, [showColumnsTotal]);
3521
3679
  var processSecondaryColDef = React.useCallback(function (colDef) {
3522
3680
  var columnFields = pivotFieldsRef.current.filter(function (field) {
3523
3681
  return !isRowPivotField(field);
@@ -3536,6 +3694,13 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3536
3694
 
3537
3695
  var measure = resolveMeasureForSecondaryColDef(colDef, pivotMeasuresRef.current);
3538
3696
  applyPivotDataCellFormatting(colDef, measure);
3697
+ applyFlexiblePivotValueColumnSizing(colDef);
3698
+
3699
+ if (isAgGridPivotColumnGroupTotalColumn(colDefAny)) {
3700
+ var existingCellClass = colDef.cellClass ? String(colDef.cellClass) : '';
3701
+ colDef.cellClass = (existingCellClass + ' dl-pivot-column-group-total-cell').trim();
3702
+ colDef.headerClass = 'dl-pivot-column-group-total-header';
3703
+ }
3539
3704
 
3540
3705
  colDef.valueFormatter = function (params) {
3541
3706
  var resolvedMeasure = measure || resolveMeasureForSecondaryColDef(params.colDef, pivotMeasuresRef.current);
@@ -3570,13 +3735,27 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3570
3735
  resizable: false,
3571
3736
  suppressMenu: true,
3572
3737
  wrapText: true,
3573
- autoHeight: true
3738
+ autoHeight: true,
3739
+ headerComponentParams: {
3740
+ template: AG_PIVOT_WRAPPING_HEADER_TEMPLATE
3741
+ }
3574
3742
  };
3575
3743
  }, []);
3744
+ var scheduleWrappedPivotHeaderHeights = React.useCallback(function () {
3745
+ var run = function run() {
3746
+ return syncWrappedPivotHeaderHeights(gridApiRef.current, gridContainerRef.current);
3747
+ };
3748
+
3749
+ window.requestAnimationFrame(function () {
3750
+ run();
3751
+ window.setTimeout(run, 0);
3752
+ });
3753
+ }, []);
3576
3754
  var autoGroupColumnDef = React.useMemo(function () {
3577
3755
  return {
3578
3756
  minWidth: ROW_GROUP_COLUMN_MIN_WIDTH,
3579
3757
  width: ROW_GROUP_COLUMN_MIN_WIDTH,
3758
+ suppressSizeToFit: true,
3580
3759
  sortable: false,
3581
3760
  filter: false,
3582
3761
  wrapText: true,
@@ -3646,32 +3825,77 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3646
3825
  columnApi.autoSizeColumns(autoGroupColumnIds, false);
3647
3826
  }
3648
3827
 
3828
+ scheduleWrappedPivotHeaderHeights();
3649
3829
  scheduleRowGrandTotalHeaderLabel();
3650
3830
  };
3651
3831
 
3652
3832
  var onColumnPivotChanged = function onColumnPivotChanged() {
3833
+ scheduleWrappedPivotHeaderHeights();
3653
3834
  scheduleRowGrandTotalHeaderLabel();
3654
3835
  };
3655
3836
 
3656
3837
  var onColumnResized = function onColumnResized() {
3838
+ scheduleWrappedPivotHeaderHeights();
3657
3839
  scheduleRowGrandTotalHeaderLabel();
3658
3840
  };
3659
3841
 
3660
3842
  var getContextMenuItems = React.useCallback(function (params) {
3661
3843
  var colId = params.column && params.column.getColId ? params.column.getColId() : '';
3662
- if (!colId || colId.indexOf('ag-Grid-AutoColumn') !== 0) return [];
3844
+ var isRowLabelColumn = !!(colId && colId.indexOf('ag-Grid-AutoColumn') === 0);
3845
+
3846
+ if (isRowLabelColumn) {
3847
+ return [{
3848
+ name: 'Expand All',
3849
+ action: function action() {
3850
+ if (params.api) params.api.expandAll();
3851
+ }
3852
+ }, {
3853
+ name: 'Collapse All',
3854
+ action: function action() {
3855
+ if (params.api) params.api.collapseAll();
3856
+ }
3857
+ }];
3858
+ }
3859
+
3860
+ var columnApi = columnApiRef.current;
3861
+ if (!columnApi || !columnApi.getColumnGroupState) return [];
3862
+ var groupState = columnApi.getColumnGroupState();
3863
+ if (!groupState || groupState.length === 0) return [];
3663
3864
  return [{
3664
3865
  name: 'Expand All',
3665
3866
  action: function action() {
3666
- if (params.api) params.api.expandAll();
3867
+ return setAllAgGridColumnGroupsOpened(columnApi, true);
3667
3868
  }
3668
3869
  }, {
3669
3870
  name: 'Collapse All',
3670
3871
  action: function action() {
3671
- if (params.api) params.api.collapseAll();
3872
+ return setAllAgGridColumnGroupsOpened(columnApi, false);
3672
3873
  }
3673
3874
  }];
3674
3875
  }, []);
3876
+ React.useEffect(function () {
3877
+ var container = gridContainerRef.current;
3878
+ if (!container || isLoading) return;
3879
+
3880
+ var onHeaderContextMenu = function onHeaderContextMenu(event) {
3881
+ var target = event.target;
3882
+ if (!target) return;
3883
+ var headerCell = target.closest('.ag-header-cell, .ag-header-group-cell');
3884
+ if (!headerCell) return;
3885
+ var colId = headerCell.getAttribute('col-id') || '';
3886
+ if (colId.indexOf('ag-Grid-AutoColumn') === 0) return;
3887
+ var api = gridApiRef.current;
3888
+ if (!api || !api.contextMenuFactory || !api.contextMenuFactory.onContextMenu) return;
3889
+ event.preventDefault();
3890
+ event.stopPropagation();
3891
+ api.contextMenuFactory.onContextMenu(event, null, null, null, null, headerCell);
3892
+ };
3893
+
3894
+ container.addEventListener('contextmenu', onHeaderContextMenu);
3895
+ return function () {
3896
+ return container.removeEventListener('contextmenu', onHeaderContextMenu);
3897
+ };
3898
+ }, [isLoading]);
3675
3899
  var gridWrapperClassName = 'ag-theme-balham pivot-grid-element dl-ag-pivot-grid';
3676
3900
  return React__default.createElement(React__default.Fragment, null, isLoading ? React__default.createElement("div", {
3677
3901
  className: 'dl-full-hight dl-flex-content-center spinner-custome'
@@ -3698,8 +3922,9 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3698
3922
  removePivotHeaderRowWhenSingleValueColumn: isSingleMeasurePivot,
3699
3923
  groupIncludeFooter: canShowRowsTotal(),
3700
3924
  groupIncludeTotalFooter: canShowRowsGrandTotal(),
3701
- pivotRowTotals: canShowColumnsGrandTotal() ? 'after' : undefined,
3702
- pivotColumnGroupTotals: canShowColumnsTotal() ? 'after' : undefined,
3925
+ pivotRowTotals: pivotRowTotalsPosition,
3926
+ pivotColumnGroupTotals: '',
3927
+ suppressExpandablePivotGroups: !showColumnsTotal,
3703
3928
  processSecondaryColGroupDef: processSecondaryColGroupDef,
3704
3929
  processSecondaryColDef: processSecondaryColDef,
3705
3930
  onCellClicked: onCellClicked,
@@ -3710,8 +3935,11 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
3710
3935
  getContextMenuItems: getContextMenuItems,
3711
3936
  animateRows: false,
3712
3937
  suppressMovableColumns: true,
3713
- headerHeight: 36,
3714
- rowHeight: 36
3938
+ headerHeight: PIVOT_HEADER_BASE_HEIGHT,
3939
+ groupHeaderHeight: PIVOT_HEADER_BASE_HEIGHT,
3940
+ pivotHeaderHeight: PIVOT_HEADER_BASE_HEIGHT,
3941
+ pivotGroupHeaderHeight: PIVOT_HEADER_BASE_HEIGHT,
3942
+ rowHeight: PIVOT_ROW_MIN_HEIGHT
3715
3943
  })));
3716
3944
  });
3717
3945