logitude-dashboard-library 3.2.65 → 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.
- package/dist/assets/styles/dl-dashboard.scss +178 -8
- package/dist/features/Dashboard/ChartsComponents/CustomCharts/PivotAgGridSupport.d.ts +27 -0
- package/dist/index.js +289 -30
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +289 -30
- package/dist/index.modern.js.map +1 -1
- package/dist/styles/dl-dashboard.scss +178 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1972,7 +1972,8 @@ var TableChart = function TableChart(props) {
|
|
|
1972
1972
|
}
|
|
1973
1973
|
|
|
1974
1974
|
if (!rowData) return true;
|
|
1975
|
-
|
|
1975
|
+
var rowTenantId = rowData.lookUp_Tenant != null ? rowData.lookUp_Tenant : rowData.Tenant;
|
|
1976
|
+
return Number(rowTenantId) === Number(Session.Tenant);
|
|
1976
1977
|
};
|
|
1977
1978
|
|
|
1978
1979
|
var isClickableCell = function isClickableCell(fieldCode, rowData) {
|
|
@@ -1984,7 +1985,7 @@ var TableChart = function TableChart(props) {
|
|
|
1984
1985
|
return false;
|
|
1985
1986
|
}
|
|
1986
1987
|
|
|
1987
|
-
return fieldCode == "ShipmentNumber" && objectTableName == "Shipment" || IsShipmentMasterFieldClickable(fieldCode, rowData) || fieldCode == "InvoiceNumber" && objectTableName == "APInvoice" || fieldCode == "InvoiceNumber" && objectTableName == "ARInvoice" || fieldCode == "ContainerNumber" && objectTableName == "Container" || fieldCode == "QuoteNumber" && objectTableName == "Quote" || fieldCode == "Subject" && objectTableName == "Opportunity" || fieldCode == "EnglishName" && objectTableName == "Customer" || fieldCode == "TaskNumber" && objectTableName == "Task" || fieldCode == "Subject" && objectTableName == "Activity" || fieldCode == "TicketNumber" && objectTableName == "Ticket" || fieldCode == "ReleaseNumber" && objectTableName == "WarehouseRelease" || fieldCode == "EntryNumber" && objectTableName == "WarehouseEntry";
|
|
1988
|
+
return fieldCode == "ShipmentNumber" && objectTableName == "Shipment" || IsShipmentMasterFieldClickable(fieldCode, rowData) || fieldCode == "InvoiceNumber" && objectTableName == "APInvoice" || fieldCode == "InvoiceNumber" && objectTableName == "ARInvoice" || fieldCode == "ContainerNumber" && objectTableName == "Container" || fieldCode == "QuoteNumber" && objectTableName == "Quote" || fieldCode == "Subject" && objectTableName == "Opportunity" || fieldCode == "EnglishName" && objectTableName == "Customer" || fieldCode == "TaskNumber" && objectTableName == "Task" || fieldCode == "Subject" && objectTableName == "Activity" || fieldCode == "TicketNumber" && objectTableName == "Ticket" || fieldCode == "ReleaseNumber" && objectTableName == "WarehouseRelease" || fieldCode == "EntryNumber" && objectTableName == "WarehouseEntry" || fieldCode == "Subject" && objectTableName == "Conversation" || fieldCode == "ConversationSubject" && objectTableName == "ConversationMessage";
|
|
1988
1989
|
};
|
|
1989
1990
|
|
|
1990
1991
|
var IsShipmentMasterFieldClickable = function IsShipmentMasterFieldClickable(fieldCode, rowData) {
|
|
@@ -2420,6 +2421,10 @@ var resolvePivotGroupHeaderName = function resolvePivotGroupHeaderName(colGroupD
|
|
|
2420
2421
|
return 'Grand Total';
|
|
2421
2422
|
}
|
|
2422
2423
|
|
|
2424
|
+
if (colGroupDef && colGroupDef.dlPivotColumnGroupTotal) {
|
|
2425
|
+
return null;
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2423
2428
|
var pivotKeys = colGroupDef && colGroupDef.pivotKeys ? colGroupDef.pivotKeys : [];
|
|
2424
2429
|
|
|
2425
2430
|
if (pivotKeys.length === 0) {
|
|
@@ -2434,6 +2439,97 @@ var resolvePivotGroupHeaderName = function resolvePivotGroupHeaderName(colGroupD
|
|
|
2434
2439
|
|
|
2435
2440
|
return lookupDisplayName(field, pivotKeys[pivotKeys.length - 1]);
|
|
2436
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
|
+
};
|
|
2437
2533
|
var getPivotValueColumnId = function getPivotValueColumnId(pivotValueColumn) {
|
|
2438
2534
|
if (!pivotValueColumn) {
|
|
2439
2535
|
return null;
|
|
@@ -2711,17 +2807,15 @@ var collectPivotRowPath = function collectPivotRowPath(startNode) {
|
|
|
2711
2807
|
return path;
|
|
2712
2808
|
}
|
|
2713
2809
|
|
|
2714
|
-
if (startNode.footer) {
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
}
|
|
2810
|
+
if (startNode.footer && startNode.level === -1) {
|
|
2811
|
+
return path;
|
|
2812
|
+
}
|
|
2718
2813
|
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
}
|
|
2814
|
+
if (startNode.field != null && startNode.key !== undefined) {
|
|
2815
|
+
path.unshift({
|
|
2816
|
+
field: startNode.field,
|
|
2817
|
+
key: startNode.key
|
|
2818
|
+
});
|
|
2725
2819
|
}
|
|
2726
2820
|
|
|
2727
2821
|
var node = startNode.parent;
|
|
@@ -2739,6 +2833,36 @@ var collectPivotRowPath = function collectPivotRowPath(startNode) {
|
|
|
2739
2833
|
|
|
2740
2834
|
return path;
|
|
2741
2835
|
};
|
|
2836
|
+
var isAgGridPivotDrillDownMeasureColumn = function isAgGridPivotDrillDownMeasureColumn(colDef, measures) {
|
|
2837
|
+
if (!colDef || !measures || measures.length === 0) {
|
|
2838
|
+
return false;
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
if (colDef.pivotValueColumn) {
|
|
2842
|
+
return true;
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
if (colDef.rowGroup || colDef.pivot) {
|
|
2846
|
+
return false;
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
var colId = colDef.colId ? String(colDef.colId) : '';
|
|
2850
|
+
|
|
2851
|
+
if (colId.indexOf('ag-Grid-AutoColumn') === 0) {
|
|
2852
|
+
return false;
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
return measures.some(function (measure) {
|
|
2856
|
+
return measure.PivotMeasureCode === colDef.field || measure.PivotMeasureCode === colId;
|
|
2857
|
+
});
|
|
2858
|
+
};
|
|
2859
|
+
var normalizePivotDrillDownFieldValue = function normalizePivotDrillDownFieldValue(value) {
|
|
2860
|
+
if (value === null || value === undefined || value === '' || value === ' ') {
|
|
2861
|
+
return null;
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
return value;
|
|
2865
|
+
};
|
|
2742
2866
|
var buildPivotDrillDownPivotFields = function buildPivotDrillDownPivotFields(colDef, startNode, apiFields) {
|
|
2743
2867
|
var columnFields = apiFields.filter(function (field) {
|
|
2744
2868
|
return !isRowPivotField(field);
|
|
@@ -2760,7 +2884,7 @@ var buildPivotDrillDownPivotFields = function buildPivotDrillDownPivotFields(col
|
|
|
2760
2884
|
pivotFields.push({
|
|
2761
2885
|
FieldId: field.FieldId,
|
|
2762
2886
|
FieldType: field.FieldType ? field.FieldType : 'Field',
|
|
2763
|
-
FieldValue: key,
|
|
2887
|
+
FieldValue: normalizePivotDrillDownFieldValue(key),
|
|
2764
2888
|
DateCode: field.DateCode
|
|
2765
2889
|
});
|
|
2766
2890
|
});
|
|
@@ -2778,7 +2902,7 @@ var buildPivotDrillDownPivotFields = function buildPivotDrillDownPivotFields(col
|
|
|
2778
2902
|
pivotFields.push({
|
|
2779
2903
|
FieldId: field.FieldId,
|
|
2780
2904
|
FieldType: field.FieldType ? field.FieldType : 'Field',
|
|
2781
|
-
FieldValue: pathItem.key,
|
|
2905
|
+
FieldValue: normalizePivotDrillDownFieldValue(pathItem.key),
|
|
2782
2906
|
DateCode: field.DateCode
|
|
2783
2907
|
});
|
|
2784
2908
|
});
|
|
@@ -3235,6 +3359,42 @@ var PivotTable = React.forwardRef(function (props, comRef) {
|
|
|
3235
3359
|
});
|
|
3236
3360
|
|
|
3237
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
|
+
};
|
|
3238
3398
|
|
|
3239
3399
|
var applyAgGridLicense = function applyAgGridLicense() {
|
|
3240
3400
|
if (!Session.AgGridLicenseKey) return;
|
|
@@ -3450,6 +3610,7 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
|
|
|
3450
3610
|
return formatPivotMeasureValue(params.value, measure);
|
|
3451
3611
|
}
|
|
3452
3612
|
};
|
|
3613
|
+
applyFlexiblePivotValueColumnSizing(colDef);
|
|
3453
3614
|
|
|
3454
3615
|
if (!isPivotDateMinMaxMeasure(measure)) {
|
|
3455
3616
|
colDef.type = 'numericColumn';
|
|
@@ -3476,26 +3637,45 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
|
|
|
3476
3637
|
};
|
|
3477
3638
|
|
|
3478
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;
|
|
3479
3642
|
var settings = parsePivotTotalsSettings(widget === null || widget === void 0 ? void 0 : widget.PivotTotalsSettings);
|
|
3480
3643
|
return !isNullOrUndefinedOrEmpty(settings.ShowRowsTotal) ? !!settings.ShowRowsTotal : false;
|
|
3481
3644
|
};
|
|
3482
3645
|
|
|
3483
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;
|
|
3484
3649
|
var settings = parsePivotTotalsSettings(widget === null || widget === void 0 ? void 0 : widget.PivotTotalsSettings);
|
|
3485
3650
|
return !isNullOrUndefinedOrEmpty(settings.ShowColumnsTotal) ? !!settings.ShowColumnsTotal : false;
|
|
3486
3651
|
};
|
|
3487
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]);
|
|
3488
3659
|
var isSingleMeasurePivot = measureCount <= 1;
|
|
3489
3660
|
var processSecondaryColGroupDef = React.useCallback(function (colGroupDef) {
|
|
3490
3661
|
var columnFields = pivotFieldsRef.current.filter(function (field) {
|
|
3491
3662
|
return !isRowPivotField(field);
|
|
3492
3663
|
});
|
|
3664
|
+
|
|
3665
|
+
if (showColumnsTotal) {
|
|
3666
|
+
promoteExpandablePivotColumnTotalsForDx(colGroupDef, columnFields, lookupDisplayName);
|
|
3667
|
+
|
|
3668
|
+
if (!colGroupDef.dlPivotColumnGroupTotal) {
|
|
3669
|
+
colGroupDef.openByDefault = true;
|
|
3670
|
+
}
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3493
3673
|
var headerName = resolvePivotGroupHeaderName(colGroupDef, columnFields, lookupDisplayName);
|
|
3494
3674
|
|
|
3495
3675
|
if (headerName) {
|
|
3496
3676
|
colGroupDef.headerName = headerName;
|
|
3497
3677
|
}
|
|
3498
|
-
}, []);
|
|
3678
|
+
}, [showColumnsTotal]);
|
|
3499
3679
|
var processSecondaryColDef = React.useCallback(function (colDef) {
|
|
3500
3680
|
var columnFields = pivotFieldsRef.current.filter(function (field) {
|
|
3501
3681
|
return !isRowPivotField(field);
|
|
@@ -3514,6 +3694,13 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
|
|
|
3514
3694
|
|
|
3515
3695
|
var measure = resolveMeasureForSecondaryColDef(colDef, pivotMeasuresRef.current);
|
|
3516
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
|
+
}
|
|
3517
3704
|
|
|
3518
3705
|
colDef.valueFormatter = function (params) {
|
|
3519
3706
|
var resolvedMeasure = measure || resolveMeasureForSecondaryColDef(params.colDef, pivotMeasuresRef.current);
|
|
@@ -3528,7 +3715,7 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
|
|
|
3528
3715
|
}, []);
|
|
3529
3716
|
var onCellClicked = React.useCallback(function (event) {
|
|
3530
3717
|
var colDef = event.colDef;
|
|
3531
|
-
if (!colDef
|
|
3718
|
+
if (!isAgGridPivotDrillDownMeasureColumn(colDef, pivotMeasuresRef.current)) return;
|
|
3532
3719
|
if (isPivotMeasureValueEmpty(event.value)) return;
|
|
3533
3720
|
var pivotFields = buildPivotDrillDownPivotFields(colDef, event.node, pivotFieldsRef.current);
|
|
3534
3721
|
props.customChartProps.onSelectDataPoint({
|
|
@@ -3548,26 +3735,34 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
|
|
|
3548
3735
|
resizable: false,
|
|
3549
3736
|
suppressMenu: true,
|
|
3550
3737
|
wrapText: true,
|
|
3551
|
-
autoHeight: true
|
|
3738
|
+
autoHeight: true,
|
|
3739
|
+
headerComponentParams: {
|
|
3740
|
+
template: AG_PIVOT_WRAPPING_HEADER_TEMPLATE
|
|
3741
|
+
}
|
|
3742
|
+
};
|
|
3743
|
+
}, []);
|
|
3744
|
+
var scheduleWrappedPivotHeaderHeights = React.useCallback(function () {
|
|
3745
|
+
var run = function run() {
|
|
3746
|
+
return syncWrappedPivotHeaderHeights(gridApiRef.current, gridContainerRef.current);
|
|
3552
3747
|
};
|
|
3748
|
+
|
|
3749
|
+
window.requestAnimationFrame(function () {
|
|
3750
|
+
run();
|
|
3751
|
+
window.setTimeout(run, 0);
|
|
3752
|
+
});
|
|
3553
3753
|
}, []);
|
|
3554
3754
|
var autoGroupColumnDef = React.useMemo(function () {
|
|
3555
3755
|
return {
|
|
3556
3756
|
minWidth: ROW_GROUP_COLUMN_MIN_WIDTH,
|
|
3557
3757
|
width: ROW_GROUP_COLUMN_MIN_WIDTH,
|
|
3758
|
+
suppressSizeToFit: true,
|
|
3558
3759
|
sortable: false,
|
|
3559
3760
|
filter: false,
|
|
3560
3761
|
wrapText: true,
|
|
3561
3762
|
autoHeight: true,
|
|
3562
3763
|
cellClass: 'dl-ag-pivot-row-label-cell',
|
|
3563
|
-
headerValueGetter: function headerValueGetter(
|
|
3564
|
-
|
|
3565
|
-
var showRowGroup = colDef && colDef.showRowGroup;
|
|
3566
|
-
if (!showRowGroup) return '';
|
|
3567
|
-
var field = pivotFieldsRef.current.find(function (f) {
|
|
3568
|
-
return f.PivotCode === showRowGroup;
|
|
3569
|
-
});
|
|
3570
|
-
return field ? field.DisplayName : '';
|
|
3764
|
+
headerValueGetter: function headerValueGetter() {
|
|
3765
|
+
return '';
|
|
3571
3766
|
},
|
|
3572
3767
|
valueFormatter: function valueFormatter(params) {
|
|
3573
3768
|
var colDef = params.colDef;
|
|
@@ -3630,17 +3825,77 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
|
|
|
3630
3825
|
columnApi.autoSizeColumns(autoGroupColumnIds, false);
|
|
3631
3826
|
}
|
|
3632
3827
|
|
|
3828
|
+
scheduleWrappedPivotHeaderHeights();
|
|
3633
3829
|
scheduleRowGrandTotalHeaderLabel();
|
|
3634
3830
|
};
|
|
3635
3831
|
|
|
3636
3832
|
var onColumnPivotChanged = function onColumnPivotChanged() {
|
|
3833
|
+
scheduleWrappedPivotHeaderHeights();
|
|
3637
3834
|
scheduleRowGrandTotalHeaderLabel();
|
|
3638
3835
|
};
|
|
3639
3836
|
|
|
3640
3837
|
var onColumnResized = function onColumnResized() {
|
|
3838
|
+
scheduleWrappedPivotHeaderHeights();
|
|
3641
3839
|
scheduleRowGrandTotalHeaderLabel();
|
|
3642
3840
|
};
|
|
3643
3841
|
|
|
3842
|
+
var getContextMenuItems = React.useCallback(function (params) {
|
|
3843
|
+
var colId = params.column && params.column.getColId ? params.column.getColId() : '';
|
|
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 [];
|
|
3864
|
+
return [{
|
|
3865
|
+
name: 'Expand All',
|
|
3866
|
+
action: function action() {
|
|
3867
|
+
return setAllAgGridColumnGroupsOpened(columnApi, true);
|
|
3868
|
+
}
|
|
3869
|
+
}, {
|
|
3870
|
+
name: 'Collapse All',
|
|
3871
|
+
action: function action() {
|
|
3872
|
+
return setAllAgGridColumnGroupsOpened(columnApi, false);
|
|
3873
|
+
}
|
|
3874
|
+
}];
|
|
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]);
|
|
3644
3899
|
var gridWrapperClassName = 'ag-theme-balham pivot-grid-element dl-ag-pivot-grid';
|
|
3645
3900
|
return React__default.createElement(React__default.Fragment, null, isLoading ? React__default.createElement("div", {
|
|
3646
3901
|
className: 'dl-full-hight dl-flex-content-center spinner-custome'
|
|
@@ -3667,8 +3922,9 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
|
|
|
3667
3922
|
removePivotHeaderRowWhenSingleValueColumn: isSingleMeasurePivot,
|
|
3668
3923
|
groupIncludeFooter: canShowRowsTotal(),
|
|
3669
3924
|
groupIncludeTotalFooter: canShowRowsGrandTotal(),
|
|
3670
|
-
pivotRowTotals:
|
|
3671
|
-
pivotColumnGroupTotals:
|
|
3925
|
+
pivotRowTotals: pivotRowTotalsPosition,
|
|
3926
|
+
pivotColumnGroupTotals: '',
|
|
3927
|
+
suppressExpandablePivotGroups: !showColumnsTotal,
|
|
3672
3928
|
processSecondaryColGroupDef: processSecondaryColGroupDef,
|
|
3673
3929
|
processSecondaryColDef: processSecondaryColDef,
|
|
3674
3930
|
onCellClicked: onCellClicked,
|
|
@@ -3676,11 +3932,14 @@ var AgPivotGrid = React.forwardRef(function (props, _comRef) {
|
|
|
3676
3932
|
onFirstDataRendered: onFirstDataRendered,
|
|
3677
3933
|
onColumnPivotChanged: onColumnPivotChanged,
|
|
3678
3934
|
onColumnResized: onColumnResized,
|
|
3935
|
+
getContextMenuItems: getContextMenuItems,
|
|
3679
3936
|
animateRows: false,
|
|
3680
|
-
suppressContextMenu: true,
|
|
3681
3937
|
suppressMovableColumns: true,
|
|
3682
|
-
headerHeight:
|
|
3683
|
-
|
|
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
|
|
3684
3943
|
})));
|
|
3685
3944
|
});
|
|
3686
3945
|
|