@adaptabletools/adaptable 22.0.0-canary.9 → 22.0.0
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/index.css +1157 -1319
- package/index.css.map +1 -1
- package/index.d.ts +8 -8
- package/index.js +8 -8
- package/package.json +1 -4
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +3 -3
- package/src/AdaptableState/Common/AdaptableForm.d.ts +1 -1
- package/src/AdaptableState/Common/AggregationColumns.d.ts +1 -0
- package/src/AdaptableState/Common/AggregationColumns.js +1 -0
- package/src/AdaptableState/Common/DataUpdateConfig.d.ts +15 -5
- package/src/AdaptableState/Common/TransposeConfig.d.ts +4 -9
- package/src/AdaptableState/InitialState.d.ts +1 -1
- package/src/AdaptableState/UserInterfaceState.d.ts +1 -1
- package/src/Api/ColumnApi.d.ts +1 -1
- package/src/Api/GridApi.d.ts +4 -0
- package/src/Api/Implementation/ApiBase.d.ts +1 -1
- package/src/Api/Implementation/ApiBase.js +1 -1
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.js +4 -4
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +6 -5
- package/src/Api/Implementation/LayoutHelpers.js +1 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +1 -1
- package/src/Api/Internal/ColumnInternalApi.js +5 -3
- package/src/Api/Internal/EventInternalApi.js +1 -1
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +5 -6
- package/src/Strategy/FormatColumnModule.js +2 -2
- package/src/Strategy/LayoutModule.js +1 -1
- package/src/Strategy/StyledColumnModule.js +14 -6
- package/src/Strategy/TeamSharingModule.js +2 -2
- package/src/Strategy/Utilities/FormatColumn/{getFormatColumnSettingsTargetItems.d.ts → getFormatColumnRowTargetItems.d.ts} +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnRowTargetItems.js +22 -0
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +5 -13
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
- package/src/Utilities/Extensions/StringExtensions.js +1 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
- package/src/Utilities/Helpers/FormatHelper.js +1 -1
- package/src/Utilities/Hooks/index.d.ts +1 -2
- package/src/Utilities/Hooks/index.js +1 -2
- package/src/Utilities/Services/LicenseService/index.js +1 -1
- package/src/Utilities/Services/RowSummaryService.d.ts +1 -1
- package/src/Utilities/Services/RowSummaryService.js +2 -2
- package/src/Utilities/getScopeViewItems.js +1 -1
- package/src/Utilities/only.d.ts +15 -0
- package/src/Utilities/only.js +54 -0
- package/src/Utilities/utils/chunk.d.ts +6 -0
- package/src/Utilities/utils/chunk.js +17 -0
- package/src/Utilities/utils/clamp.d.ts +5 -0
- package/src/Utilities/utils/clamp.js +7 -0
- package/src/Utilities/utils/cloneDeepWith.d.ts +9 -0
- package/src/Utilities/utils/cloneDeepWith.js +67 -0
- package/src/Utilities/utils/debounce.d.ts +20 -0
- package/src/Utilities/utils/debounce.js +121 -0
- package/src/Utilities/utils/flatten.d.ts +5 -0
- package/src/Utilities/utils/flatten.js +7 -0
- package/src/Utilities/utils/flattenDeep.d.ts +5 -0
- package/src/Utilities/utils/flattenDeep.js +7 -0
- package/src/Utilities/utils/get.d.ts +6 -0
- package/src/Utilities/utils/get.js +35 -0
- package/src/Utilities/utils/index.d.ts +22 -0
- package/src/Utilities/utils/index.js +22 -0
- package/src/Utilities/utils/isArray.d.ts +6 -0
- package/src/Utilities/utils/isArray.js +6 -0
- package/src/Utilities/utils/isEqual.d.ts +5 -0
- package/src/Utilities/utils/isEqual.js +124 -0
- package/src/Utilities/utils/isObject.d.ts +6 -0
- package/src/Utilities/utils/isObject.js +9 -0
- package/src/Utilities/utils/isPlainObject.d.ts +6 -0
- package/src/Utilities/utils/isPlainObject.js +17 -0
- package/src/Utilities/utils/kebabCase.d.ts +5 -0
- package/src/Utilities/utils/kebabCase.js +8 -0
- package/src/Utilities/utils/merge.d.ts +11 -0
- package/src/Utilities/utils/merge.js +40 -0
- package/src/Utilities/utils/mergeWith.d.ts +7 -0
- package/src/Utilities/utils/mergeWith.js +46 -0
- package/src/Utilities/utils/orderBy.d.ts +8 -0
- package/src/Utilities/utils/orderBy.js +30 -0
- package/src/Utilities/utils/parseInt.d.ts +6 -0
- package/src/Utilities/utils/parseInt.js +9 -0
- package/src/Utilities/utils/sentenceCase.d.ts +6 -0
- package/src/Utilities/utils/sentenceCase.js +15 -0
- package/src/Utilities/utils/startCase.d.ts +5 -0
- package/src/Utilities/utils/startCase.js +11 -0
- package/src/Utilities/utils/throttle.d.ts +17 -0
- package/src/Utilities/utils/throttle.js +19 -0
- package/src/Utilities/utils/toNumber.d.ts +5 -0
- package/src/Utilities/utils/toNumber.js +39 -0
- package/src/Utilities/utils/uniq.d.ts +7 -0
- package/src/Utilities/utils/uniq.js +9 -0
- package/src/Utilities/utils/uniqBy.d.ts +8 -0
- package/src/Utilities/utils/uniqBy.js +22 -0
- package/src/Utilities/utils/words.d.ts +7 -0
- package/src/Utilities/utils/words.js +10 -0
- package/src/Utilities/weightedAverage.js +1 -1
- package/src/View/AdaptableComputedCSSVarsContext.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +1 -1
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +1 -1
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +1 -1
- package/src/View/Components/RangesComponent.js +1 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +7 -2
- package/src/View/Dashboard/CustomDashboardButton.js +1 -1
- package/src/View/Dashboard/Dashboard.js +1 -1
- package/src/View/Dashboard/DashboardPopup.js +4 -3
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
- package/src/View/Export/Wizard/NewReportWizard.js +8 -8
- package/src/View/Filter/FilterViewPanel.d.ts +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +19 -10
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnRowScopeWizardSection.d.ts +8 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRowScopeWizardSection.js +80 -0
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +22 -61
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +22 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +3 -3
- package/src/View/Layout/LayoutViewPanel.js +1 -1
- package/src/View/Layout/TransposedPopup.js +0 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Note/NoteEditor.js +1 -1
- package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeRowsSection.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/{StyledColumnWizardSettingsSection.js → StyledColumnBadgeRowsSection.js} +19 -19
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +10 -11
- package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
- package/src/View/Theme/ThemeEditor.js +1 -1
- package/src/View/Theme/ThemeField.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/View/Wizard/OnePageWizards.js +1 -1
- package/src/agGrid/AdaptableAgGrid.js +26 -7
- package/src/agGrid/AgGridAdapter.js +4 -4
- package/src/agGrid/AgGridColumnAdapter.js +11 -4
- package/src/agGrid/AgGridExportAdapter.d.ts +2 -2
- package/src/agGrid/AgGridExportAdapter.js +7 -6
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +17 -5
- package/src/components/ColorPicker/ColorPicker.js +1 -1
- package/src/components/DropdownButton/renderItem.js +1 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -1
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/OverlayTrigger/index.js +1 -1
- package/src/components/Select/Select.js +4 -0
- package/src/env.js +2 -2
- package/src/layout-manager/src/isLayoutEqual.js +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +12 -1
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade22.js +9 -0
- package/themes/dark.css +2 -3
- package/themes/light.css +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.js +0 -12
- package/src/Utilities/Hooks/useAdaptableState.d.ts +0 -3
- package/src/Utilities/Hooks/useAdaptableState.js +0 -39
- package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.d.ts +0 -8
- package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.js +0 -31
- package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.d.ts +0 -8
- /package/src/View/FormatColumn/Wizard/{FormatColumnScopeWizardSection.d.ts → FormatColumnColumnScopeWizardSection.d.ts} +0 -0
- /package/src/View/FormatColumn/Wizard/{FormatColumnScopeWizardSection.js → FormatColumnColumnScopeWizardSection.js} +0 -0
|
@@ -5,7 +5,7 @@ export class ApiBase {
|
|
|
5
5
|
_adaptable;
|
|
6
6
|
/**
|
|
7
7
|
* Constructor for all the api classes which simply takes and assigns an instance of Adaptable
|
|
8
|
-
* @param _adaptable
|
|
8
|
+
* @param _adaptable core IAdaptable object - for INTERNAL USE ONLY and not part of public API
|
|
9
9
|
*/
|
|
10
10
|
constructor(_adaptable) {
|
|
11
11
|
this._adaptable = _adaptable;
|
|
@@ -78,7 +78,7 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
|
|
|
78
78
|
getAggregatableColumns(): AdaptableColumn[];
|
|
79
79
|
getQueryableColumns(): AdaptableColumn[];
|
|
80
80
|
getExportableColumns(): AdaptableColumn[];
|
|
81
|
-
|
|
81
|
+
getUIHiddenColumns(): AdaptableColumn[];
|
|
82
82
|
private logMissingColumnWarning;
|
|
83
83
|
getPrimaryKeyColumn(): AdaptableColumn<any>;
|
|
84
84
|
getDefaultAggFunc(columnId: string): string;
|
|
@@ -15,7 +15,7 @@ const ROW_GROUP_COLUMN_DEFAULTS = {
|
|
|
15
15
|
readOnly: false,
|
|
16
16
|
resizable: true,
|
|
17
17
|
visible: true,
|
|
18
|
-
|
|
18
|
+
isUIHiddenColumn: false,
|
|
19
19
|
fieldOnly: false,
|
|
20
20
|
queryable: false,
|
|
21
21
|
sortable: false,
|
|
@@ -118,7 +118,7 @@ export class ColumnApiImpl extends ApiBase {
|
|
|
118
118
|
return this.getGridApi().getInternalState().Columns ?? [];
|
|
119
119
|
}
|
|
120
120
|
getUIAvailableColumns() {
|
|
121
|
-
return this.getColumns().filter((c) => !c.
|
|
121
|
+
return this.getColumns().filter((c) => !c.isUIHiddenColumn &&
|
|
122
122
|
!c.isGeneratedSelectionColumn &&
|
|
123
123
|
// currently (20.0.7) we don't display Pivot Totals in UI
|
|
124
124
|
!c.isPivotTotalColumn);
|
|
@@ -467,8 +467,8 @@ export class ColumnApiImpl extends ApiBase {
|
|
|
467
467
|
getExportableColumns() {
|
|
468
468
|
return this.getColumns().filter((c) => c.exportable);
|
|
469
469
|
}
|
|
470
|
-
|
|
471
|
-
return this.getColumns().filter((c) => c.
|
|
470
|
+
getUIHiddenColumns() {
|
|
471
|
+
return this.getColumns().filter((c) => c.isUIHiddenColumn);
|
|
472
472
|
}
|
|
473
473
|
logMissingColumnWarning(columnId) {
|
|
474
474
|
if (this.getColumnOptions().showMissingColumnsWarning === true) {
|
|
@@ -152,6 +152,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
|
152
152
|
openGridInfoSettingsPanel(): void;
|
|
153
153
|
getAgGridRowModelType(): RowModelType;
|
|
154
154
|
showTransposedView(transposeConfig?: TransposeConfig): void;
|
|
155
|
+
closeTransposedView(): void;
|
|
155
156
|
getAllAgGridColumns(): Column<any>[];
|
|
156
157
|
updateAgGridColumnState(columnState: ColumnState): void;
|
|
157
158
|
updateAgGridColumnStates(columnStates: ColumnState[]): void;
|
|
@@ -98,15 +98,15 @@ export class GridApiImpl extends ApiBase {
|
|
|
98
98
|
async manageGridData(dataRowConfig, dataUpdateConfig) {
|
|
99
99
|
const transactionResult = await this._adaptable.manageGridRows(dataRowConfig, dataUpdateConfig);
|
|
100
100
|
if (Array.isArray(transactionResult.removedRows) && transactionResult.removedRows.length) {
|
|
101
|
-
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.
|
|
101
|
+
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.deleteRows, transactionResult.removedRows, 'Delete');
|
|
102
102
|
this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
|
|
103
103
|
}
|
|
104
104
|
if (Array.isArray(transactionResult.updatedRows) && transactionResult.updatedRows.length) {
|
|
105
|
-
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.
|
|
105
|
+
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.updateRows, transactionResult.updatedRows, 'Update');
|
|
106
106
|
this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
|
|
107
107
|
}
|
|
108
108
|
if (Array.isArray(transactionResult.addedRows) && transactionResult.addedRows.length) {
|
|
109
|
-
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.
|
|
109
|
+
const rowDataChangedInfo = this.getAdaptableInternalApi().buildRowDataChangedInfo(dataRowConfig.addRows, transactionResult.addedRows, 'Add');
|
|
110
110
|
this.getAdaptableInternalApi().getDataService().CreateRowDataChangedEvent(rowDataChangedInfo);
|
|
111
111
|
}
|
|
112
112
|
return transactionResult;
|
|
@@ -607,7 +607,6 @@ export class GridApiImpl extends ApiBase {
|
|
|
607
607
|
showTransposedView(transposeConfig = {}) {
|
|
608
608
|
const transposedColumnId = transposeConfig.transposedColumnId ?? this.getOptionsApi().getPrimaryKey();
|
|
609
609
|
const hideTransposedColumn = transposeConfig.hideTransposedColumn ?? true;
|
|
610
|
-
const autosize = transposeConfig.autosize ?? true;
|
|
611
610
|
const columnsToTranspose = transposeConfig.columnsToTranspose;
|
|
612
611
|
const rowsToTranspose = transposeConfig.rowsToTranspose;
|
|
613
612
|
this.getAdaptableInternalApi().showPopupWindow({
|
|
@@ -618,12 +617,14 @@ export class GridApiImpl extends ApiBase {
|
|
|
618
617
|
popupProps: {
|
|
619
618
|
transposedColumnId,
|
|
620
619
|
hideTransposedColumn,
|
|
621
|
-
autosize,
|
|
622
620
|
columnsToTranspose,
|
|
623
621
|
rowsToTranspose,
|
|
624
622
|
},
|
|
625
623
|
});
|
|
626
624
|
}
|
|
625
|
+
closeTransposedView() {
|
|
626
|
+
this.getUserInterfaceApi().closeCustomWindowPopup('WINDOW_SHOW_TRANSPOSED_VIEW');
|
|
627
|
+
}
|
|
627
628
|
getAllAgGridColumns() {
|
|
628
629
|
return this._adaptable.getAllGridColumns();
|
|
629
630
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import isEqual from '
|
|
1
|
+
import isEqual from '../../Utilities/utils/isEqual';
|
|
2
2
|
import { isPivotLayoutModel } from '../../layout-manager/src/isPivotLayoutModel';
|
|
3
3
|
import { normalizeTableLayoutModel, normalizePivotLayoutModel, } from '../../layout-manager/src/normalizeLayoutModel';
|
|
4
4
|
import { simplifyTableLayoutModel, simplifyPivotLayoutModel, } from '../../layout-manager/src/simplifyLayoutModel';
|
|
@@ -32,6 +32,6 @@ export declare class ColumnInternalApi extends ApiBase {
|
|
|
32
32
|
private buildColumnHeaderContext;
|
|
33
33
|
hasArrayDataType(column: AdaptableColumn): boolean;
|
|
34
34
|
getQueryableColumnsForUIEditor(): AdaptableColumn[];
|
|
35
|
-
|
|
35
|
+
isColumnUIHidden(columnIdentifier: string | ColDef): boolean;
|
|
36
36
|
getColumnDateTypes(): AdaptableColumnDataType[];
|
|
37
37
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
2
|
import { AG_GRID_GROUPED_COLUMN } from '../../Utilities/Constants/GeneralConstants';
|
|
3
|
-
import uniq from '
|
|
3
|
+
import uniq from '../../Utilities/utils/uniq';
|
|
4
4
|
import StringExtensions from '../../Utilities/Extensions/StringExtensions';
|
|
5
5
|
import { isPivotGrandTotal, isPivotResultColumn } from '../Implementation/ColumnApiImpl';
|
|
6
6
|
import { destructurePivotColumnId } from '../../layout-manager/src/destructurePivotColumnId';
|
|
@@ -277,9 +277,11 @@ export class ColumnInternalApi extends ApiBase {
|
|
|
277
277
|
getQueryableColumnsForUIEditor() {
|
|
278
278
|
return this.getColumnApi()
|
|
279
279
|
.getQueryableColumns()
|
|
280
|
-
.filter((column) => !column.isGeneratedPivotResultColumn &&
|
|
280
|
+
.filter((column) => !column.isGeneratedPivotResultColumn &&
|
|
281
|
+
!column.isGeneratedRowGroupColumn &&
|
|
282
|
+
!column.isGeneratedSelectionColumn);
|
|
281
283
|
}
|
|
282
|
-
|
|
284
|
+
isColumnUIHidden(columnIdentifier) {
|
|
283
285
|
return this.getColumnApi().hasColumnType(columnIdentifier, HIDDEN_COLUMN_TYPE);
|
|
284
286
|
}
|
|
285
287
|
getColumnDateTypes() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import debounce from '
|
|
1
|
+
import debounce from '../../Utilities/utils/debounce';
|
|
2
2
|
import { MergeStateFunction } from './AdaptableReduxMerger';
|
|
3
3
|
import { AdaptableLogger } from '../../agGrid/AdaptableLogger';
|
|
4
4
|
import { buildAdaptableStateFunctionConfig } from './buildAdaptableStateFunctionConfig';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import mergeWith from '
|
|
2
|
-
import merge from '
|
|
3
|
-
import isArray from '
|
|
4
|
-
import
|
|
5
|
-
import isObject from 'lodash/isObject';
|
|
1
|
+
import mergeWith from '../../Utilities/utils/mergeWith';
|
|
2
|
+
import merge from '../../Utilities/utils/merge';
|
|
3
|
+
import isArray from '../../Utilities/utils/isArray';
|
|
4
|
+
import isObject from '../../Utilities/utils/isObject';
|
|
6
5
|
import { AdaptableLogger } from '../../agGrid/AdaptableLogger';
|
|
7
6
|
import AdaptableHelper from '../../Utilities/Helpers/AdaptableHelper';
|
|
8
7
|
function customizer(objValue, srcValue) {
|
|
@@ -112,7 +111,7 @@ export function MergeStateFunction(oldState, newState) {
|
|
|
112
111
|
}
|
|
113
112
|
// main merge function
|
|
114
113
|
export function MergeState(oldState, newState) {
|
|
115
|
-
const result =
|
|
114
|
+
const result = Object.assign({}, oldState);
|
|
116
115
|
for (const key in newState) {
|
|
117
116
|
if (!newState.hasOwnProperty(key)) {
|
|
118
117
|
continue;
|
|
@@ -9,7 +9,7 @@ import { MoveFormatColumn } from '../View/FormatColumn/MoveFormatColumn';
|
|
|
9
9
|
import { getObjectTagsViewItems } from '../Utilities/getObjectTagsViewItems';
|
|
10
10
|
import { getRuleViewItems } from '../Utilities/getRuleViewItems';
|
|
11
11
|
import { getScopeViewItems } from '../Utilities/getScopeViewItems';
|
|
12
|
-
import {
|
|
12
|
+
import { getFormatColumnRowTargetItems } from './Utilities/FormatColumn/getFormatColumnRowTargetItems';
|
|
13
13
|
import { renderFormatColumnStyleSummary } from '../View/FormatColumn/Wizard/FormatColumnStyleWizardSection';
|
|
14
14
|
export class FormatColumnModule extends AdaptableModuleBase {
|
|
15
15
|
constructor(api) {
|
|
@@ -87,7 +87,7 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
87
87
|
values: [formatColumn.Name],
|
|
88
88
|
},
|
|
89
89
|
getScopeViewItems(formatColumn.Scope, this.api),
|
|
90
|
-
|
|
90
|
+
getFormatColumnRowTargetItems(formatColumn),
|
|
91
91
|
formatColumn.Rule && getRuleViewItems(formatColumn.Rule, this.api),
|
|
92
92
|
{
|
|
93
93
|
name: 'Style',
|
|
@@ -11,7 +11,7 @@ import { getLayoutFilterViewItems } from './Utilities/Layout/getLayoutFilterView
|
|
|
11
11
|
import { getLayoutSortViewItems } from './Utilities/Layout/getLayoutSortViewItems';
|
|
12
12
|
import { WEIGHTED_AVERAGE_AGG_FN_NAME } from '../AdaptableState/Common/AggregationColumns';
|
|
13
13
|
import { SHOW_PIVOT_COLUMN_DETAILS } from '../View/Components/Popups/WindowPopups/windowFactory';
|
|
14
|
-
import flattenDeep from '
|
|
14
|
+
import flattenDeep from '../Utilities/utils/flattenDeep';
|
|
15
15
|
import StringExtensions from '../Utilities/Extensions/StringExtensions';
|
|
16
16
|
import { getGridFilterViewItems } from '../View/Layout/Wizard/getGridFilterPreview';
|
|
17
17
|
import { RowSummaryService } from '../Utilities/Services/RowSummaryService';
|
|
@@ -187,14 +187,22 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
if (styledColumn.BadgeStyle) {
|
|
190
|
+
let rowTypes = [];
|
|
191
|
+
if (!styledColumn.BadgeStyle?.RowScope?.ExcludeDataRows) {
|
|
192
|
+
rowTypes.push('Data');
|
|
193
|
+
}
|
|
194
|
+
if (!styledColumn.BadgeStyle?.RowScope?.ExcludeGroupRows) {
|
|
195
|
+
rowTypes.push('Group');
|
|
196
|
+
}
|
|
197
|
+
if (!styledColumn.BadgeStyle?.RowScope?.ExcludeSummaryRows) {
|
|
198
|
+
rowTypes.push('Summary');
|
|
199
|
+
}
|
|
200
|
+
if (!styledColumn.BadgeStyle?.RowScope?.ExcludeTotalRows) {
|
|
201
|
+
rowTypes.push('Total');
|
|
202
|
+
}
|
|
190
203
|
specificTypeItems.push({
|
|
191
204
|
name: 'Rows',
|
|
192
|
-
values:
|
|
193
|
-
`Data Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeDataRows ? 'No' : 'Yes'}`,
|
|
194
|
-
`Group Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeGroupRows ? 'No' : 'Yes'}`,
|
|
195
|
-
`Summary Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeSummaryRows ? 'No' : 'Yes'}`,
|
|
196
|
-
`Total Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeTotalRows ? 'No' : 'Yes'}`,
|
|
197
|
-
],
|
|
205
|
+
values: rowTypes
|
|
198
206
|
});
|
|
199
207
|
}
|
|
200
208
|
if (styledColumn.BadgeStyle) {
|
|
@@ -2,13 +2,13 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
|
2
2
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
3
3
|
import { TEAMSHARING_GET, TEAMSHARING_IMPORT_ITEM, TEAMSHARING_LINK_ITEM, TEAMSHARING_PROCESS_IMPORT, TEAMSHARING_REMOVE_ITEM, TEAMSHARING_SET, TEAMSHARING_SHARE, TEAMSHARING_UPDATE_ITEM, TeamSharingUpdateItem, } from '../Redux/ActionsReducers/TeamSharingRedux';
|
|
4
4
|
import * as TeamSharingRedux from '../Redux/ActionsReducers/TeamSharingRedux';
|
|
5
|
-
import isEqual from '
|
|
5
|
+
import isEqual from '../Utilities/utils/isEqual';
|
|
6
6
|
import { LAYOUT_SAVE } from '../Redux/ActionsReducers/LayoutRedux';
|
|
7
7
|
import { getSharedEntityStaleDepsItemView, SharedEntityTypeItemView, getSharedEntityActiveStatusObjectView, } from '../View/TeamSharing/SharedEntityObjectView';
|
|
8
8
|
import { TeamSharingApplyButton } from '../View/TeamSharing/TeamSharingApplyButton';
|
|
9
9
|
import { SharedEntityDependencies } from '../View/TeamSharing/SharedEntityDependencies';
|
|
10
10
|
import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
|
|
11
|
-
import flatten from '
|
|
11
|
+
import flatten from '../Utilities/utils/flatten';
|
|
12
12
|
import AdaptableHelper from '../Utilities/Helpers/AdaptableHelper';
|
|
13
13
|
export class TeamSharingModule extends AdaptableModuleBase {
|
|
14
14
|
SKIP_TEAMSHARING_UPDATE_ACTIONS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormatColumn } from '../../../AdaptableState/FormatColumnState';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getFormatColumnRowTargetItems: (formatColumn: FormatColumn) => {
|
|
3
3
|
name: string;
|
|
4
4
|
values: string[];
|
|
5
5
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const getFormatColumnRowTargetItems = (formatColumn) => {
|
|
2
|
+
let values = [];
|
|
3
|
+
if (formatColumn.RowScope) {
|
|
4
|
+
if (!formatColumn.RowScope.ExcludeDataRows) {
|
|
5
|
+
values.push('Data');
|
|
6
|
+
}
|
|
7
|
+
if (!formatColumn.RowScope.ExcludeGroupRows) {
|
|
8
|
+
values.push('Group');
|
|
9
|
+
}
|
|
10
|
+
if (!formatColumn.RowScope.ExcludeSummaryRows) {
|
|
11
|
+
values.push('Summary');
|
|
12
|
+
}
|
|
13
|
+
if (!formatColumn.RowScope.ExcludeTotalRows) {
|
|
14
|
+
values.push('Total');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
values = values.filter(Boolean);
|
|
18
|
+
return {
|
|
19
|
+
name: 'Rows',
|
|
20
|
+
values: values.length > 0 ? values : ['-'],
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
export const getFormatColumnSettingsViewItems = (formatColumn) => {
|
|
2
2
|
let values = [];
|
|
3
|
-
if (formatColumn.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
values.push('Exclude Group Rows');
|
|
9
|
-
}
|
|
10
|
-
if (formatColumn.RowScope.ExcludeSummaryRows) {
|
|
11
|
-
values.push('Exclude Summary Rows');
|
|
12
|
-
}
|
|
13
|
-
if (formatColumn.RowScope.ExcludeTotalRows) {
|
|
14
|
-
values.push('Exclude Total Rows');
|
|
15
|
-
}
|
|
3
|
+
if (!formatColumn.Target || formatColumn.Target === 'cell') {
|
|
4
|
+
values.push('Target: Column Cells');
|
|
5
|
+
}
|
|
6
|
+
else {
|
|
7
|
+
values.push('Target: Column Header');
|
|
16
8
|
}
|
|
17
9
|
if (formatColumn.ColumnGroupScope) {
|
|
18
10
|
values.push(`Column Groups: ${formatColumn.ColumnGroupScope === 'Both' ? 'Always' : formatColumn.ColumnGroupScope}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import parseInt from '
|
|
1
|
+
import parseInt from '../utils/parseInt';
|
|
2
2
|
import { ExpressionEvaluationError } from '../../parser/src/ExpressionEvaluationError';
|
|
3
3
|
import { handleColumnFunction, handleWhereFunction, } from './expressionFunctionUtils';
|
|
4
4
|
import { aggregatedScalarExpressionFunctions, } from './aggregatedScalarExpressionFunctions';
|
|
@@ -451,7 +451,7 @@ export const aggregatedScalarExpressionFunctions = {
|
|
|
451
451
|
handler(args, context) {
|
|
452
452
|
const distinctColumnParameter = extractColumnParameter('ONLY', args);
|
|
453
453
|
const onlyColumnName = distinctColumnParameter.value;
|
|
454
|
-
const columnType = validateColumnType(onlyColumnName, ['number'], 'ONLY', context.adaptableApi);
|
|
454
|
+
const columnType = validateColumnType(onlyColumnName, ['number', 'text'], 'ONLY', context.adaptableApi);
|
|
455
455
|
const groupByParameter = extractParameter('ONLY', 'operand', ['GROUP_BY'], args, {
|
|
456
456
|
isOptional: true,
|
|
457
457
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExpressionEvaluationError } from '../../parser/src/ExpressionEvaluationError';
|
|
2
2
|
import StringExtensions from '../Extensions/StringExtensions';
|
|
3
3
|
import { filter } from 'rxjs/operators';
|
|
4
|
-
import toNumber from '
|
|
4
|
+
import toNumber from '../utils/toNumber';
|
|
5
5
|
import { evaluateNode } from '../../parser/src/evaluator';
|
|
6
6
|
// string functions may be case (in)sensitive, see internalApi.isTextComparisonCaseSensitive()
|
|
7
7
|
// if case is insensitive, we convert ALL involved strings to lower case
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defer, of } from 'rxjs';
|
|
2
2
|
import { count, debounceTime, delay, filter, map, mergeAll, mergeMap, startWith, takeUntil, tap, withLatestFrom, } from 'rxjs/operators';
|
|
3
|
-
import parseInt from '
|
|
3
|
+
import parseInt from '../utils/parseInt';
|
|
4
4
|
import { ExpressionEvaluationError } from '../../parser/src/ExpressionEvaluationError';
|
|
5
5
|
import { extractColumnParameter, extractParameter, getDataChangeLog$, getGridChangeLog$, getNumericValue, handleColumnFunction, handleWhereFunction, validateColumnType, } from './expressionFunctionUtils';
|
|
6
6
|
import { getTypedKeys } from '../Extensions/TypeExtensions';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import cloneDeepWith from '
|
|
2
|
-
import isPlainObject from '
|
|
1
|
+
import cloneDeepWith from '../utils/cloneDeepWith';
|
|
2
|
+
import isPlainObject from '../utils/isPlainObject';
|
|
3
3
|
import { createUuid } from '../../AdaptableState/Uuid';
|
|
4
4
|
import packageJson from '../../../package.json';
|
|
5
5
|
const GET_CURRENT_VERSION = () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// TODO inspect why the following is erroring on angular build
|
|
2
2
|
import { format as dateFnsFormat } from 'date-fns';
|
|
3
|
-
import
|
|
3
|
+
import sentenceCase from '../utils/sentenceCase';
|
|
4
4
|
import { DEFAULT_DATE_FORMAT_PATTERN } from '../Constants/GeneralConstants';
|
|
5
5
|
import Helper from './Helper';
|
|
6
6
|
import StringExtensions from '../Extensions/StringExtensions';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { useAdaptableColumn } from './useAdaptableColumn';
|
|
2
2
|
import { useAdaptableOptions } from './useAdaptableOptions';
|
|
3
|
-
|
|
4
|
-
export { useAdaptableColumn, useAdaptableOptions, useAdaptableState };
|
|
3
|
+
export { useAdaptableColumn, useAdaptableOptions };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { useAdaptableColumn } from './useAdaptableColumn';
|
|
2
2
|
import { useAdaptableOptions } from './useAdaptableOptions';
|
|
3
|
-
|
|
4
|
-
export { useAdaptableColumn, useAdaptableOptions, useAdaptableState };
|
|
3
|
+
export { useAdaptableColumn, useAdaptableOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LicenseDisablePersistence as e,LicenseShowWatermark as a}from"../../../Redux/ActionsReducers/InternalRedux";import{PopupShowAlert as t}from"../../../Redux/ActionsReducers/PopupRedux";import i from"../../ObjectFactory";import s from"
|
|
1
|
+
import{LicenseDisablePersistence as e,LicenseShowWatermark as a}from"../../../Redux/ActionsReducers/InternalRedux";import{PopupShowAlert as t}from"../../../Redux/ActionsReducers/PopupRedux";import i from"../../ObjectFactory";import s from"../../utils/clamp";import{LicenseDocsLink as o}from"../../Constants/DocumentationLinkConstants";import{decode as n,GENERIC_APP_NAME as r}from"../../license/decode";import{shouldLogThankYouMessage as l}from"./shouldLogThankYouMessage";const c="sales@adaptabletools.com",p=10,d=864e5;export var LicenseValidityType;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(LicenseValidityType||(LicenseValidityType={}));const h=()=>"undefined"!=typeof window?window.location.origin:"",E=()=>{const e=h(),[a,t,i]=Array.from(/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===i},I=()=>{const e=h(),[a,t,i]=Array.from(/(https):\/\/\S+(\.csb\.app)/g.exec(e)||[]);return"https"===t&&".csb.app"===i},_=()=>{const e=h(),[a,t,i]=Array.from(/(https):\/\/\S+(\.adaptabletools\.com)/g.exec(e)||[]);return"https"===t&&".adaptabletools.com"===i};export class LicenseService{adaptable;licenseKey;packageDetails;constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",()=>{requestAnimationFrame(()=>{this.adaptable.isDestroyed||this.init()})})}init(){let e=null;if(this.licenseKey)try{e=n(this.licenseKey)}catch(a){e=a}E()||I()||_()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return LicenseValidityType.NO_LICENSE;if(e instanceof Error)return LicenseValidityType.INVALID_LICENSE;const t=new Date(a.publishedAt),i=new Date(e.end),s=i<new Date,o=e.trial;let n=null;return n=s?i>t?o?LicenseValidityType.NON_PRODUCTION_EXPIRED_IN_SCOPE:LicenseValidityType.COMMERCIAL_EXPIRED_IN_SCOPE:o?LicenseValidityType.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:LicenseValidityType.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?LicenseValidityType.NON_PRODUCTION_VALID:LicenseValidityType.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){const t=new Date;t.setHours(0,0,0,0);let i=0;e instanceof Error||!e?.end||(i=Math.floor((e?.end?.getTime()-t.getTime())/d),i=s(i,0,1/0));let n="",h="";!e||e instanceof Error||!e.appName||e.appName==r||(n=e.appName,h=" for application [APP_NAME]");const E=(e,a=o,t=c,s=i,r=n)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",r).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(i<=p)this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{l()&&this.adaptable.logger.consoleLogByMessageType(E(`Thank you for using a valid AdapTable license${h}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction(t({alertType:"generic",header:"License Error",message:e,alertDefinition:i.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction(a(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction(e())}destroy(){}}
|
|
@@ -19,7 +19,7 @@ export declare class RowSummaryService {
|
|
|
19
19
|
*
|
|
20
20
|
* @param colId optional to evaluate only one column
|
|
21
21
|
*/
|
|
22
|
-
_throttledEvaluateRowSummary: import("
|
|
22
|
+
_throttledEvaluateRowSummary: import("../utils/debounce").DebouncedFunction<(reason?: {
|
|
23
23
|
columnIds: string[];
|
|
24
24
|
}) => void>;
|
|
25
25
|
private evaluateRowSummary;
|
|
@@ -4,8 +4,8 @@ import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
|
|
|
4
4
|
import Helper from '../Helpers/Helper';
|
|
5
5
|
import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
|
|
6
6
|
import { isObjectEmpty } from '../Extensions/ObjectExtensions';
|
|
7
|
-
import throttle from '
|
|
8
|
-
import isEqual from '
|
|
7
|
+
import throttle from '../utils/throttle';
|
|
8
|
+
import isEqual from '../utils/isEqual';
|
|
9
9
|
/**
|
|
10
10
|
* The logic is extracted here to make it easier to follow
|
|
11
11
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IAggFuncParams } from 'ag-grid-enterprise';
|
|
2
|
+
interface OnlyAggResult {
|
|
3
|
+
distinctValues: Set<number | string>;
|
|
4
|
+
value: number | string | null;
|
|
5
|
+
toString(): string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* AG Grid aggFunc that returns the column value only when all rows in the group
|
|
9
|
+
* share the same value. Returns null when values differ (or when there are no values).
|
|
10
|
+
*
|
|
11
|
+
* Supports multiple group levels: leaf groups aggregate raw cell values while
|
|
12
|
+
* parent groups merge the metadata objects returned by child groups.
|
|
13
|
+
*/
|
|
14
|
+
export declare const only: (params: IAggFuncParams, columnId: string) => OnlyAggResult;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function createOnlyResult(distinctValues) {
|
|
2
|
+
const value = distinctValues.size === 1 ? distinctValues.values().next().value : null;
|
|
3
|
+
return {
|
|
4
|
+
distinctValues,
|
|
5
|
+
value,
|
|
6
|
+
toString() {
|
|
7
|
+
return value != null ? String(value) : '';
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* AG Grid aggFunc that returns the column value only when all rows in the group
|
|
13
|
+
* share the same value. Returns null when values differ (or when there are no values).
|
|
14
|
+
*
|
|
15
|
+
* Supports multiple group levels: leaf groups aggregate raw cell values while
|
|
16
|
+
* parent groups merge the metadata objects returned by child groups.
|
|
17
|
+
*/
|
|
18
|
+
export const only = (params, columnId) => {
|
|
19
|
+
const { api: gridApi, rowNode: groupRowNode, values } = params;
|
|
20
|
+
// Leaf group: the lowest-level group whose children are actual data rows.
|
|
21
|
+
// We read raw cell values and collect distinct ones, bailing out early
|
|
22
|
+
// as soon as we see a second distinct value (the result would be null anyway).
|
|
23
|
+
if (groupRowNode.leafGroup) {
|
|
24
|
+
const filteredOnly = !gridApi.getGridOption('suppressAggFilteredOnly');
|
|
25
|
+
const childNodes = (filteredOnly ? groupRowNode.childrenAfterFilter : groupRowNode.childrenAfterGroup) ?? [];
|
|
26
|
+
const distinctValues = new Set();
|
|
27
|
+
for (const rowNode of childNodes) {
|
|
28
|
+
const rawValue = gridApi.getCellValue({ colKey: columnId, rowNode });
|
|
29
|
+
if (typeof rawValue === 'number' || typeof rawValue === 'string') {
|
|
30
|
+
distinctValues.add(rawValue);
|
|
31
|
+
if (distinctValues.size > 1) {
|
|
32
|
+
return createOnlyResult(distinctValues);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return createOnlyResult(distinctValues);
|
|
37
|
+
}
|
|
38
|
+
// Non-leaf group: children are other groups, not data rows.
|
|
39
|
+
// AG Grid has already called this aggFunc on each child group, so
|
|
40
|
+
// `params.values` contains the OnlyAggResult objects they returned.
|
|
41
|
+
// We merge their distinctValues sets instead of re-traversing leaf rows.
|
|
42
|
+
const mergedDistinctValues = new Set();
|
|
43
|
+
for (const childResult of values) {
|
|
44
|
+
if (childResult && typeof childResult === 'object' && 'distinctValues' in childResult) {
|
|
45
|
+
for (const val of childResult.distinctValues) {
|
|
46
|
+
mergedDistinctValues.add(val);
|
|
47
|
+
if (mergedDistinctValues.size > 1) {
|
|
48
|
+
return createOnlyResult(mergedDistinctValues);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return createOnlyResult(mergedDistinctValues);
|
|
54
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates an array of elements split into groups the length of size.
|
|
3
|
+
* If array can't be split evenly, the final chunk will be the remaining elements.
|
|
4
|
+
* Drop-in replacement for lodash/chunk.
|
|
5
|
+
*/
|
|
6
|
+
export default function chunk<T>(array: T[], size?: number): T[][];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates an array of elements split into groups the length of size.
|
|
3
|
+
* If array can't be split evenly, the final chunk will be the remaining elements.
|
|
4
|
+
* Drop-in replacement for lodash/chunk.
|
|
5
|
+
*/
|
|
6
|
+
export default function chunk(array, size = 1) {
|
|
7
|
+
const length = array.length;
|
|
8
|
+
if (!length || !(size >= 1)) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
const chunkSize = Math.floor(size);
|
|
12
|
+
const result = [];
|
|
13
|
+
for (let i = 0; i < length; i += chunkSize) {
|
|
14
|
+
result.push(array.slice(i, i + chunkSize));
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This method is like `cloneDeep` except that it accepts customizer which
|
|
3
|
+
* is invoked to produce the cloned value. If customizer returns undefined,
|
|
4
|
+
* cloning is handled by the method instead.
|
|
5
|
+
* Drop-in replacement for lodash/cloneDeepWith.
|
|
6
|
+
*/
|
|
7
|
+
type CloneCustomizer = (value: any) => any;
|
|
8
|
+
export default function cloneDeepWith<T>(value: T, customizer: CloneCustomizer): T;
|
|
9
|
+
export {};
|