UNPKG

@adaptabletools/adaptable

Version:

Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

64 lines (63 loc) 1.96 kB
export function getLayoutWizardInitialExpandedCardId(layoutWizardMode, firstCardId, isSectionConfigured) { if (layoutWizardMode !== 'create' || isSectionConfigured) { return null; } return firstCardId; } export function isColumnsSectionConfigured(layout) { if ((layout.TableColumns?.length ?? 0) > 0) { return true; } if (layout.ColumnPinning && Object.keys(layout.ColumnPinning).length > 0) { return true; } if ((layout.ColumnSorts?.length ?? 0) > 0) { return true; } if (layout.ColumnSizing && Object.keys(layout.ColumnSizing).length > 0) { return true; } return false; } export function isRowGroupingSectionConfigured(layout) { return (layout.RowGroupedColumns?.length ?? 0) > 0; } export function isPivotRowGroupingSectionConfigured(layout) { return (layout.PivotGroupedColumns?.length ?? 0) > 0; } export function isTableAggregationsSectionConfigured(layout) { if ((layout.TableAggregationColumns?.length ?? 0) > 0) { return true; } if (layout.GrandTotalRow != null && layout.GrandTotalRow !== false) { return true; } return false; } export function isPivotAggregationsSectionConfigured(layout) { if ((layout.PivotAggregationColumns?.length ?? 0) > 0) { return true; } if (layout.GrandTotalRow != null && layout.GrandTotalRow !== false) { return true; } if (layout.PivotGrandTotal != null && layout.PivotGrandTotal !== false) { return true; } if (layout.PivotColumnTotal != null && layout.PivotColumnTotal !== false) { return true; } return false; } export function isPivotColumnsSectionConfigured(layout) { if ((layout.PivotColumns?.length ?? 0) > 0) { return true; } if (layout.PivotResultColumnsOrder) { return true; } if ((layout.ColumnSorts?.length ?? 0) > 0) { return true; } return false; }