@adaptabletools/adaptable 22.0.0-canary.11 → 22.0.0-canary.13
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 +3 -12
- 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/InitialState.d.ts +1 -1
- package/src/AdaptableState/UserInterfaceState.d.ts +1 -1
- package/src/Api/ColumnApi.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.js +4 -4
- 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/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/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/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/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/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/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/agGrid/AdaptableAgGrid.js +2 -2
- package/src/agGrid/AgGridAdapter.js +4 -4
- package/src/agGrid/AgGridColumnAdapter.js +2 -2
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +1 -1
- package/src/components/ColorPicker/ColorPicker.js +1 -1
- package/src/components/DropdownButton/renderItem.js +1 -1
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/OverlayTrigger/index.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/isLayoutEqual.js +1 -1
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade22.js +9 -0
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.js +0 -12
- 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
|
@@ -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';
|
|
@@ -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 +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,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 {};
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
function baseCloneDeep(value, customizer, seen) {
|
|
8
|
+
// Invoke customizer first
|
|
9
|
+
const customResult = customizer(value);
|
|
10
|
+
if (customResult !== undefined) {
|
|
11
|
+
return customResult;
|
|
12
|
+
}
|
|
13
|
+
// Primitives
|
|
14
|
+
if (value === null || typeof value !== 'object') {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
// Circular reference detection
|
|
18
|
+
if (seen.has(value)) {
|
|
19
|
+
return seen.get(value);
|
|
20
|
+
}
|
|
21
|
+
// Date
|
|
22
|
+
if (value instanceof Date) {
|
|
23
|
+
return new Date(value.getTime());
|
|
24
|
+
}
|
|
25
|
+
// RegExp
|
|
26
|
+
if (value instanceof RegExp) {
|
|
27
|
+
return new RegExp(value.source, value.flags);
|
|
28
|
+
}
|
|
29
|
+
// Map
|
|
30
|
+
if (value instanceof Map) {
|
|
31
|
+
const cloned = new Map();
|
|
32
|
+
seen.set(value, cloned);
|
|
33
|
+
value.forEach((v, k) => {
|
|
34
|
+
cloned.set(baseCloneDeep(k, customizer, seen), baseCloneDeep(v, customizer, seen));
|
|
35
|
+
});
|
|
36
|
+
return cloned;
|
|
37
|
+
}
|
|
38
|
+
// Set
|
|
39
|
+
if (value instanceof Set) {
|
|
40
|
+
const cloned = new Set();
|
|
41
|
+
seen.set(value, cloned);
|
|
42
|
+
value.forEach((v) => {
|
|
43
|
+
cloned.add(baseCloneDeep(v, customizer, seen));
|
|
44
|
+
});
|
|
45
|
+
return cloned;
|
|
46
|
+
}
|
|
47
|
+
// Arrays
|
|
48
|
+
if (Array.isArray(value)) {
|
|
49
|
+
const cloned = [];
|
|
50
|
+
seen.set(value, cloned);
|
|
51
|
+
for (let i = 0; i < value.length; i++) {
|
|
52
|
+
cloned[i] = baseCloneDeep(value[i], customizer, seen);
|
|
53
|
+
}
|
|
54
|
+
return cloned;
|
|
55
|
+
}
|
|
56
|
+
// Plain objects and others
|
|
57
|
+
const cloned = Object.create(Object.getPrototypeOf(value));
|
|
58
|
+
seen.set(value, cloned);
|
|
59
|
+
const keys = Object.keys(value);
|
|
60
|
+
for (const key of keys) {
|
|
61
|
+
cloned[key] = baseCloneDeep(value[key], customizer, seen);
|
|
62
|
+
}
|
|
63
|
+
return cloned;
|
|
64
|
+
}
|
|
65
|
+
export default function cloneDeepWith(value, customizer) {
|
|
66
|
+
return baseCloneDeep(value, customizer, new Map());
|
|
67
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a debounced function that delays invoking func until after wait
|
|
3
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
4
|
+
* invoked. The debounced function comes with a cancel method to cancel
|
|
5
|
+
* delayed func invocations and a flush method to immediately invoke them.
|
|
6
|
+
*
|
|
7
|
+
* Supports options: { leading, trailing, maxWait }
|
|
8
|
+
* Drop-in replacement for lodash/debounce.
|
|
9
|
+
*/
|
|
10
|
+
export interface DebounceOptions {
|
|
11
|
+
leading?: boolean;
|
|
12
|
+
trailing?: boolean;
|
|
13
|
+
maxWait?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface DebouncedFunction<T extends (...args: any[]) => any> {
|
|
16
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
17
|
+
cancel(): void;
|
|
18
|
+
flush(): ReturnType<T> | undefined;
|
|
19
|
+
}
|
|
20
|
+
export default function debounce<T extends (...args: any[]) => any>(func: T, wait?: number, options?: DebounceOptions): DebouncedFunction<T>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a debounced function that delays invoking func until after wait
|
|
3
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
4
|
+
* invoked. The debounced function comes with a cancel method to cancel
|
|
5
|
+
* delayed func invocations and a flush method to immediately invoke them.
|
|
6
|
+
*
|
|
7
|
+
* Supports options: { leading, trailing, maxWait }
|
|
8
|
+
* Drop-in replacement for lodash/debounce.
|
|
9
|
+
*/
|
|
10
|
+
export default function debounce(func, wait = 0, options) {
|
|
11
|
+
let lastArgs;
|
|
12
|
+
let lastThis;
|
|
13
|
+
let result;
|
|
14
|
+
let timerId;
|
|
15
|
+
let lastCallTime;
|
|
16
|
+
let lastInvokeTime = 0;
|
|
17
|
+
const leading = options?.leading ?? false;
|
|
18
|
+
const trailing = options?.trailing ?? true;
|
|
19
|
+
const maxWait = options?.maxWait;
|
|
20
|
+
const hasMaxWait = maxWait !== undefined;
|
|
21
|
+
const maxing = hasMaxWait;
|
|
22
|
+
function invokeFunc(time) {
|
|
23
|
+
const args = lastArgs;
|
|
24
|
+
const thisArg = lastThis;
|
|
25
|
+
lastArgs = undefined;
|
|
26
|
+
lastThis = undefined;
|
|
27
|
+
lastInvokeTime = time;
|
|
28
|
+
result = func.apply(thisArg, args);
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
function startTimer(pendingFunc, waitMs) {
|
|
32
|
+
timerId = setTimeout(pendingFunc, waitMs);
|
|
33
|
+
}
|
|
34
|
+
function cancelTimer() {
|
|
35
|
+
if (timerId !== undefined) {
|
|
36
|
+
clearTimeout(timerId);
|
|
37
|
+
}
|
|
38
|
+
timerId = undefined;
|
|
39
|
+
}
|
|
40
|
+
function remainingWait(time) {
|
|
41
|
+
const timeSinceLastCall = time - (lastCallTime ?? 0);
|
|
42
|
+
const timeSinceLastInvoke = time - lastInvokeTime;
|
|
43
|
+
const timeWaiting = wait - timeSinceLastCall;
|
|
44
|
+
return maxing
|
|
45
|
+
? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)
|
|
46
|
+
: timeWaiting;
|
|
47
|
+
}
|
|
48
|
+
function shouldInvoke(time) {
|
|
49
|
+
const timeSinceLastCall = time - (lastCallTime ?? 0);
|
|
50
|
+
const timeSinceLastInvoke = time - lastInvokeTime;
|
|
51
|
+
return (lastCallTime === undefined ||
|
|
52
|
+
timeSinceLastCall >= wait ||
|
|
53
|
+
timeSinceLastCall < 0 ||
|
|
54
|
+
(maxing && timeSinceLastInvoke >= maxWait));
|
|
55
|
+
}
|
|
56
|
+
function timerExpired() {
|
|
57
|
+
const time = Date.now();
|
|
58
|
+
if (shouldInvoke(time)) {
|
|
59
|
+
trailingEdge(time);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Restart the timer
|
|
63
|
+
startTimer(timerExpired, remainingWait(time));
|
|
64
|
+
}
|
|
65
|
+
function trailingEdge(time) {
|
|
66
|
+
timerId = undefined;
|
|
67
|
+
if (trailing && lastArgs) {
|
|
68
|
+
invokeFunc(time);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
lastArgs = undefined;
|
|
72
|
+
lastThis = undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function leadingEdge(time) {
|
|
76
|
+
lastInvokeTime = time;
|
|
77
|
+
startTimer(timerExpired, wait);
|
|
78
|
+
if (leading) {
|
|
79
|
+
invokeFunc(time);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function debounced(...args) {
|
|
83
|
+
const time = Date.now();
|
|
84
|
+
const isInvoking = shouldInvoke(time);
|
|
85
|
+
lastArgs = args;
|
|
86
|
+
lastThis = this;
|
|
87
|
+
lastCallTime = time;
|
|
88
|
+
if (isInvoking) {
|
|
89
|
+
if (timerId === undefined) {
|
|
90
|
+
leadingEdge(time);
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
if (maxing) {
|
|
94
|
+
// Handle invocations in a tight loop with maxWait
|
|
95
|
+
cancelTimer();
|
|
96
|
+
startTimer(timerExpired, wait);
|
|
97
|
+
invokeFunc(time);
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (timerId === undefined) {
|
|
102
|
+
startTimer(timerExpired, wait);
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
debounced.cancel = function cancel() {
|
|
107
|
+
cancelTimer();
|
|
108
|
+
lastInvokeTime = 0;
|
|
109
|
+
lastArgs = undefined;
|
|
110
|
+
lastCallTime = undefined;
|
|
111
|
+
lastThis = undefined;
|
|
112
|
+
};
|
|
113
|
+
debounced.flush = function flush() {
|
|
114
|
+
if (timerId === undefined) {
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
trailingEdge(Date.now());
|
|
118
|
+
return result;
|
|
119
|
+
};
|
|
120
|
+
return debounced;
|
|
121
|
+
}
|