@adaptabletools/adaptable 17.0.2 → 17.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "17.0.2",
3
+ "version": "17.0.4",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1705992544629;
1
+ declare const _default: 1706885118631;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1705992544629;
3
+ exports.default = 1706885118631;
@@ -208,7 +208,7 @@ export interface ValuesFilterOptions<TData = any> {
208
208
  * @gridInfoItem
209
209
  * @noCodeItem
210
210
  */
211
- showValuesCount?: (column: AdaptableColumn<TData>) => boolean;
211
+ showValuesCount?: (columFilterContext: ColumnFilterContext<TData>) => boolean;
212
212
  /**
213
213
  * Includes a [BLANKS] entry in Values filter
214
214
  * @defaultValue false
@@ -301,12 +301,6 @@ export interface GridApi {
301
301
  * @param displayValue Display Value to use
302
302
  */
303
303
  getGridCellsForDisplayValue(columnId: string, displayValue: any): GridCell[] | undefined;
304
- /**
305
- * Gets the count of the cells in a Column that have the given Display Value
306
- * @param columnId ColumnId to lookup
307
- * @param displayValue Display Value to use
308
- */
309
- getCellDisplayValueCount(columnId: string, displayValue: any): number;
310
304
  /**
311
305
  * Retrieves Formatted Value for a given Raw Value in given Column
312
306
  * @param columnId ColumnId to lookup
@@ -4,7 +4,7 @@ import { ExpressionApi } from '../ExpressionApi';
4
4
  import { AdaptableQuery } from '../../PredefinedConfig/Common/AdaptableQuery';
5
5
  import { AdaptableColumnBase } from '../../PredefinedConfig/Common/AdaptableColumn';
6
6
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
7
- import { ExpressionInternalApi } from '../Internal/ExpressionnternalApi';
7
+ import { ExpressionInternalApi } from '../Internal/ExpressionInternalApi';
8
8
  export declare class ExpressionApiImpl extends ApiBase implements ExpressionApi {
9
9
  internalApi: ExpressionInternalApi;
10
10
  constructor(adaptable: IAdaptable);
@@ -4,11 +4,11 @@ exports.ExpressionApiImpl = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const parser = tslib_1.__importStar(require("../../parser/src"));
7
- const ExpressionnternalApi_1 = require("../Internal/ExpressionnternalApi");
7
+ const ExpressionInternalApi_1 = require("../Internal/ExpressionInternalApi");
8
8
  class ExpressionApiImpl extends ApiBase_1.ApiBase {
9
9
  constructor(adaptable) {
10
10
  super(adaptable);
11
- this.internalApi = new ExpressionnternalApi_1.ExpressionInternalApi(adaptable);
11
+ this.internalApi = new ExpressionInternalApi_1.ExpressionInternalApi(adaptable);
12
12
  }
13
13
  isValidBooleanExpression(query, module, validationErrorMessage) {
14
14
  const { isValid, errorMessage } = this.adaptable.api.internalApi
@@ -93,8 +93,7 @@ class ExpressionApiImpl extends ApiBase_1.ApiBase {
93
93
  .getExpressionWithColumnFriendlyNames(this.getAdaptableQueryExpression(query));
94
94
  }
95
95
  useCaseSensitivity() {
96
- return this.adaptable.adaptableOptions.expressionOptions
97
- .caseSensitiveExpressions;
96
+ return this.adaptable.adaptableOptions.expressionOptions.caseSensitiveExpressions;
98
97
  }
99
98
  }
100
99
  exports.ExpressionApiImpl = ExpressionApiImpl;
@@ -99,7 +99,6 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
99
99
  getGridCellsForRawValue(columnId: string, rawValue: any): GridCell[] | undefined;
100
100
  getCellRawValueCount(columnId: string, rawValue: any): number;
101
101
  getGridCellsForDisplayValue(columnId: string, displayValue: any): GridCell[] | undefined;
102
- getCellDisplayValueCount(columnId: string, displayValue: any): number;
103
102
  jumpToRow(primaryKeyValue: any): void;
104
103
  jumpToColumn(columnId: string): void;
105
104
  jumpToCell(primaryKeyValue: any, columnId: string): void;
@@ -385,10 +385,6 @@ class GridApiImpl extends ApiBase_1.ApiBase {
385
385
  });
386
386
  return returnGridCells;
387
387
  }
388
- getCellDisplayValueCount(columnId, displayValue) {
389
- const gridCells = this.getGridCellsForDisplayValue(columnId, displayValue);
390
- return gridCells === null || gridCells === void 0 ? void 0 : gridCells.length;
391
- }
392
388
  jumpToRow(primaryKeyValue) {
393
389
  const node = this.adaptable.getRowNodeForPrimaryKey(primaryKeyValue);
394
390
  this.adaptable.jumpToRow(node);
@@ -4,6 +4,7 @@ exports.DataImportInternalApi = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ObjectFactory_1 = tslib_1.__importStar(require("../../Utilities/ObjectFactory"));
6
6
  const ApiBase_1 = require("../Implementation/ApiBase");
7
+ const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
7
8
  class DataImportInternalApi extends ApiBase_1.ApiBase {
8
9
  async importData(partialRows) {
9
10
  const dataImportOptions = this.getOptions().dataImportOptions;
@@ -64,6 +65,7 @@ class DataImportInternalApi extends ApiBase_1.ApiBase {
64
65
  userName: adaptableApi.optionsApi.getUserName(),
65
66
  adaptableId: adaptableApi.optionsApi.getAdaptableId(),
66
67
  };
68
+ this.adaptable.api.internalApi.dispatchReduxAction(SystemRedux.DataImportCompleted(dataImportedInfo));
67
69
  this.getEventApi().emit('DataImported', dataImportedInfo);
68
70
  }
69
71
  }
@@ -26,7 +26,9 @@ export declare class GridInternalApi extends ApiBase {
26
26
  */
27
27
  getDistinctDisplayValuesForColumn(columnId: string): any[];
28
28
  /**
29
- * Gets all distinct Filter values for the Column with the given ColumnId (used for Floating Filter and Column Header filter)
29
+ * Gets all distinct Filter values for the Column with the given ColumnId
30
+ * used for Floating Filter and Column Header filter
31
+ * either returns a list of values or al ist a list of values with count
30
32
  * @param columnId Column to check
31
33
  * @param columnFilter Current applied filter
32
34
  */
@@ -74,11 +74,14 @@ class GridInternalApi extends ApiBase_1.ApiBase {
74
74
  });
75
75
  }
76
76
  /**
77
- * Gets all distinct Filter values for the Column with the given ColumnId (used for Floating Filter and Column Header filter)
77
+ * Gets all distinct Filter values for the Column with the given ColumnId
78
+ * used for Floating Filter and Column Header filter
79
+ * either returns a list of values or al ist a list of values with count
78
80
  * @param columnId Column to check
79
81
  * @param columnFilter Current applied filter
80
82
  */
81
83
  async getDistinctFilterDisplayValuesForColumn(columnId, filter, showFilteredRowsOnly) {
84
+ var _a;
82
85
  const abColumn = this.getColumnApi().getColumnWithColumnId(columnId);
83
86
  if (abColumn == undefined) {
84
87
  return {
@@ -90,19 +93,39 @@ class GridInternalApi extends ApiBase_1.ApiBase {
90
93
  visibleRowsOnly: showFilteredRowsOnly,
91
94
  };
92
95
  const { gridCells, suppressClientSideFilter } = await this.adaptable.getDistinctFilterListValuesForColumn(abColumn, filter, distinctValuesParams);
93
- let showValuesCount = false;
96
+ const sortedDistinctValues = this.sortDistinctValues(gridCells, abColumn);
97
+ let shouldShowValuesCount = false;
94
98
  const showValuesCountFunction = this.getColumnFilterOptions().valuesFilterOptions.showValuesCount;
95
99
  if (showValuesCountFunction) {
96
- showValuesCount = showValuesCountFunction(abColumn);
100
+ const columnFilterContext = {
101
+ column: abColumn,
102
+ adaptableApi: this.adaptable.api,
103
+ userName: this.adaptable.api.optionsApi.getUserName(),
104
+ adaptableId: this.adaptable.api.optionsApi.getAdaptableId(),
105
+ };
106
+ shouldShowValuesCount = showValuesCountFunction(columnFilterContext);
107
+ }
108
+ if (shouldShowValuesCount) {
109
+ const allColumnDisplayValues = (_a = this.adaptable
110
+ .getGridCellsForColumn(columnId)) === null || _a === void 0 ? void 0 : _a.map((gc) => {
111
+ return gc.displayValue;
112
+ });
113
+ return {
114
+ values: sortedDistinctValues.map((cv) => {
115
+ const label = cv.displayValue +
116
+ NumberExtensions_1.default.WrapInParentheses(ArrayExtensions_1.default.getOccurrence(allColumnDisplayValues, cv.displayValue));
117
+ return {
118
+ label: label,
119
+ value: cv.normalisedValue,
120
+ };
121
+ }),
122
+ suppressClientSideFilter,
123
+ };
97
124
  }
98
125
  return {
99
- values: this.sortDistinctValues(gridCells, abColumn).map((cv) => {
100
- const label = showValuesCount
101
- ? cv.displayValue +
102
- NumberExtensions_1.default.WrapInParentheses(this.getGridApi().getCellDisplayValueCount(abColumn.columnId, cv.displayValue))
103
- : cv.displayValue;
126
+ values: sortedDistinctValues.map((cv) => {
104
127
  return {
105
- label: label,
128
+ label: cv.displayValue,
106
129
  value: cv.normalisedValue,
107
130
  };
108
131
  }),
@@ -13,7 +13,7 @@ import { SummaryOperation } from '../../PredefinedConfig/Common/Enums';
13
13
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
14
14
  import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
15
15
  import { SmartEditOperation } from '../../AdaptableOptions/EditOptions';
16
- import { DataSet, NoteGridCell } from '../../types';
16
+ import { DataImportedInfo, DataSet, NoteGridCell } from '../../types';
17
17
  import { ChartModel } from '@ag-grid-community/core';
18
18
  import { CachedQuery } from '../../PredefinedConfig/NamedQueryState';
19
19
  export declare const FLASHING_CELL_ROW_KEY = "__ROW";
@@ -76,6 +76,10 @@ export declare const SYSTEM_VISUAL_EXPORT_BEGIN = "SYSTEM_VISUAL_EXPORT_BEGIN";
76
76
  export declare const SYSTEM_VISUAL_EXPORT_END = "SYSTEM_VISUAL_EXPORT_END";
77
77
  export declare const SYSTEM_NOTESS_SHOW = "SYSTEM_NOTES_SHOW";
78
78
  export declare const SYSTEM_NOTS_HIDE = "SYSTEM_NOTES_HIDE";
79
+ export declare const DATA_IMPORT_COMPLETED = "DATA_IMPORT_COMPLETED";
80
+ export interface DataImportCompletedAction extends Redux.Action {
81
+ dataImportedInfo: DataImportedInfo;
82
+ }
79
83
  export interface SystemHighlightCellAddAction extends Redux.Action {
80
84
  cellHighlightInfo: CellHighlightInfo;
81
85
  }
@@ -325,4 +329,5 @@ export declare const SystemPreviousGroupedColumnsSelector: (state: SystemState)
325
329
  export declare const SystemQuickSearchFloatingVisibilitySelector: (state: SystemState) => boolean;
326
330
  export declare const SystemNotesSelector: (state: SystemState) => NoteGridCell;
327
331
  export declare const SystemNotesEditModeSelector: (state: SystemState) => boolean;
332
+ export declare const DataImportCompleted: (dataImportedInfo: DataImportedInfo) => DataImportCompletedAction;
328
333
  export declare const SystemReducer: Redux.Reducer<SystemState>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SYSTEM_DISABLE_DELETE_CONFIRMATION = exports.SYSTEM_FILTER_FORM_HIDE = exports.SYSTEM_QUICK_FILTER_BAR_HIDE = exports.SYSTEM_QUICK_FILTER_BAR_SHOW = exports.SYSTEM_SETTINGS_PANEL_SET = exports.SYSTEM_DATA_CHANGE_HISTORY_RESUME = exports.SYSTEM_DATA_CHANGE_HISTORY_SUSPEND = exports.SYSTEM_DATA_CHANGE_HISTORY_DISABLE = exports.SYSTEM_DATA_CHANGE_HISTORY_ENABLE = exports.SYSTEM_DATA_CHANGE_HISTORY_CLEAR_ROW = exports.SYSTEM_DATA_CHANGE_HISTORY_UNDO = exports.SYSTEM_DATA_CHANGE_HISTORY_ADD = exports.SYSTEM_LICENSE_DISABLE_PERSISTENCE = exports.SYSTEM_LICENSE_SHOW_WATERMARK = exports.SYSTEM_PROGRESS_INDICATOR_HIDE = exports.SYSTEM_PROGRESS_INDICATOR_SHOW = exports.SYSTEM_CELL_SUMMARY_CHANGE_OPERATION = exports.SYSTEM_CACHED_QUERY_ADD = exports.SYSTEM_SET_LAST_APPLIED_SHORTCUT = exports.SYSTEM_SET_NEW_COLUMN_LIST_ORDER = exports.SYSTEM_HIGHLIGHT_ROW_DELETE_ALL = exports.SYSTEM_HIGHLIGHT_ROWS_DELETE = exports.SYSTEM_HIGHLIGHT_ROW_DELETE = exports.SYSTEM_HIGHLIGHT_ROWS_ADD = exports.SYSTEM_HIGHLIGHT_ROW_ADD = exports.SYSTEM_HIGHLIGHT_CELL_DELETE_ALL = exports.SYSTEM_HIGHLIGHT_CELL_DELETE = exports.SYSTEM_HIGHLIGHT_CELL_ADD = exports.SYSTEM_BULK_UPDATE_CHANGE_VALUE = exports.SYSTEM_BULK_UPDATE_SET_PREVIEW = exports.SYSTEM_BULK_UPDATE_SET_VALID_SELECTION = exports.SYSTEM_BULK_UPDATE_CHECK_CELL_SELECTION = exports.SYSTEM_SMART_EDIT_CHANGE_OPERATION = exports.SYSTEM_SMART_EDIT_CHANGE_VALUE = exports.SYSTEM_SMARTEDIT_SET_PREVIEW = exports.SYSTEM_SMARTEDIT_SET_VALID_SELECTION = exports.SYSTEM_SMARTEDIT_FETCH_PREVIEW = exports.SYSTEM_SMARTEDIT_CHECK_CELL_SELECTION = exports.SYSTEM_STATUS_MESSAGE_INFO_DELETE_ALL = exports.SYSTEM_STATUS_MESSAGE_INFO_DELETE = exports.SYSTEM_STATUS_MESSAGE_INFO_ADD = exports.SYSTEM_FLASHING_CELL_DELETE_ALL = exports.SYSTEM_FLASHING_CELL_DELETE = exports.SYSTEM_FLASHING_CELL_ADD = exports.SYSTEM_ALERT_REMOVE_ROW_HIGHLIGHT = exports.SYSTEM_ALERT_REMOVE_CELL_HIGHLIGHT = exports.SYSTEM_ALERT_DELETE_ALL = exports.SYSTEM_ALERT_DELETE = exports.SYSTEM_ALERT_ADD = exports.FLASHING_CELL_ROW_KEY = void 0;
4
- exports.SystemDataChangeHistoryEnable = exports.SystemDataChangeHistoryClearRow = exports.SystemDataChangeHistoryUndo = exports.SystemDataChangeHistoryAdd = exports.SystemLicenseDisablePersistence = exports.SystemLicenseShowWatermark = exports.SystemProgressIndicatorHide = exports.SystemProgressIndicatorShow = exports.SystemCellSummaryChangeOperation = exports.SystemCachedQueryAdd = exports.SetLastAppliedShortcut = exports.SetNewColumnListOrder = exports.BulkUpdateChangeValue = exports.BulkUpdateSetPreview = exports.BulkUpdateSetValidSelection = exports.BulkUpdateCheckCellSelection = exports.SmartEditSetPreview = exports.SmartEditSetValidSelection = exports.SmartEditCheckCellSelection = exports.SmartEditChangeOperation = exports.SmartEditChangeValue = exports.SystemStatusMessageInfoDeleteAll = exports.SystemStatusMessageInfoDelete = exports.SystemStatusMessageInfoAdd = exports.SystemFlashingCellDeleteAll = exports.SystemFlashingCellDelete = exports.SystemFlashingCellAdd = exports.SystemAlertRemoveRowHighlight = exports.SystemAlertRemoveCellHighlight = exports.SystemAlertDeleteAll = exports.SystemAlertDelete = exports.SystemAlertAdd = exports.SystemHighlightRowDeleteAll = exports.SystemHighlightRowsDelete = exports.SystemHighlightRowDelete = exports.SystemHighlightRowsAdd = exports.SystemHighlightRowAdd = exports.SystemHighlightCellDeleteAll = exports.SystemHighlightCellDelete = exports.SystemHighlightCellAdd = exports.SYSTEM_NOTS_HIDE = exports.SYSTEM_NOTESS_SHOW = exports.SYSTEM_VISUAL_EXPORT_END = exports.SYSTEM_VISUAL_EXPORT_BEGIN = exports.SYSTEM_SET_QUICK_SEARCH_FLOATING_VISIBILITY = exports.SYSTEM_SET_PREVIOUS_GROUPED_COLUMN_INDEX = exports.SYSTEM_CHARTING_SET_CURRENT_CHART_MODELS = exports.SYSTEM_DATA_SET_SELECT = exports.DASHBOARD_REFRESH = exports.SYSTEM_LAYOUT_SHOW_NOT_ASSOCIATED_OBJECTS = void 0;
5
- exports.SystemReducer = exports.SystemNotesEditModeSelector = exports.SystemNotesSelector = exports.SystemQuickSearchFloatingVisibilitySelector = exports.SystemPreviousGroupedColumnsSelector = exports.SystemDisableDeleteConfirmationSelector = exports.SystemNoteHide = exports.SystemNotesShow = exports.SystemQuickSearchFloatingVisibility = exports.SystemVisualExportEnd = exports.SystemVisualExportBegin = exports.SystemDisableDeleteConfirmation = exports.SystemSetPreviousGroupedColumnsIndex = exports.SystemChartingCurrentChartModelsSelector = exports.SystemChartingSetCurrentChartModels = exports.SystemDataSetSelect = exports.SystemDashboardRefresh = exports.SystemLayoutShowNotAssociatedObjects = exports.SystemFilterFormHide = exports.SystemQuickFilterBarHide = exports.SystemQuickFilterBarShow = exports.SystemSettingsPanelSet = exports.SystemDataChangeHistoryResume = exports.SystemDataChangeHistorySuspend = exports.SystemDataChangeHistoryDisable = void 0;
4
+ exports.SystemDataChangeHistoryClearRow = exports.SystemDataChangeHistoryUndo = exports.SystemDataChangeHistoryAdd = exports.SystemLicenseDisablePersistence = exports.SystemLicenseShowWatermark = exports.SystemProgressIndicatorHide = exports.SystemProgressIndicatorShow = exports.SystemCellSummaryChangeOperation = exports.SystemCachedQueryAdd = exports.SetLastAppliedShortcut = exports.SetNewColumnListOrder = exports.BulkUpdateChangeValue = exports.BulkUpdateSetPreview = exports.BulkUpdateSetValidSelection = exports.BulkUpdateCheckCellSelection = exports.SmartEditSetPreview = exports.SmartEditSetValidSelection = exports.SmartEditCheckCellSelection = exports.SmartEditChangeOperation = exports.SmartEditChangeValue = exports.SystemStatusMessageInfoDeleteAll = exports.SystemStatusMessageInfoDelete = exports.SystemStatusMessageInfoAdd = exports.SystemFlashingCellDeleteAll = exports.SystemFlashingCellDelete = exports.SystemFlashingCellAdd = exports.SystemAlertRemoveRowHighlight = exports.SystemAlertRemoveCellHighlight = exports.SystemAlertDeleteAll = exports.SystemAlertDelete = exports.SystemAlertAdd = exports.SystemHighlightRowDeleteAll = exports.SystemHighlightRowsDelete = exports.SystemHighlightRowDelete = exports.SystemHighlightRowsAdd = exports.SystemHighlightRowAdd = exports.SystemHighlightCellDeleteAll = exports.SystemHighlightCellDelete = exports.SystemHighlightCellAdd = exports.DATA_IMPORT_COMPLETED = exports.SYSTEM_NOTS_HIDE = exports.SYSTEM_NOTESS_SHOW = exports.SYSTEM_VISUAL_EXPORT_END = exports.SYSTEM_VISUAL_EXPORT_BEGIN = exports.SYSTEM_SET_QUICK_SEARCH_FLOATING_VISIBILITY = exports.SYSTEM_SET_PREVIOUS_GROUPED_COLUMN_INDEX = exports.SYSTEM_CHARTING_SET_CURRENT_CHART_MODELS = exports.SYSTEM_DATA_SET_SELECT = exports.DASHBOARD_REFRESH = exports.SYSTEM_LAYOUT_SHOW_NOT_ASSOCIATED_OBJECTS = void 0;
5
+ exports.SystemReducer = exports.DataImportCompleted = exports.SystemNotesEditModeSelector = exports.SystemNotesSelector = exports.SystemQuickSearchFloatingVisibilitySelector = exports.SystemPreviousGroupedColumnsSelector = exports.SystemDisableDeleteConfirmationSelector = exports.SystemNoteHide = exports.SystemNotesShow = exports.SystemQuickSearchFloatingVisibility = exports.SystemVisualExportEnd = exports.SystemVisualExportBegin = exports.SystemDisableDeleteConfirmation = exports.SystemSetPreviousGroupedColumnsIndex = exports.SystemChartingCurrentChartModelsSelector = exports.SystemChartingSetCurrentChartModels = exports.SystemDataSetSelect = exports.SystemDashboardRefresh = exports.SystemLayoutShowNotAssociatedObjects = exports.SystemFilterFormHide = exports.SystemQuickFilterBarHide = exports.SystemQuickFilterBarShow = exports.SystemSettingsPanelSet = exports.SystemDataChangeHistoryResume = exports.SystemDataChangeHistorySuspend = exports.SystemDataChangeHistoryDisable = exports.SystemDataChangeHistoryEnable = void 0;
6
6
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
7
7
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
8
8
  const Helper_1 = require("../../Utilities/Helpers/Helper");
@@ -94,6 +94,8 @@ exports.SYSTEM_VISUAL_EXPORT_END = 'SYSTEM_VISUAL_EXPORT_END';
94
94
  // Notes
95
95
  exports.SYSTEM_NOTESS_SHOW = 'SYSTEM_NOTES_SHOW';
96
96
  exports.SYSTEM_NOTS_HIDE = 'SYSTEM_NOTES_HIDE';
97
+ // Data Import
98
+ exports.DATA_IMPORT_COMPLETED = 'DATA_IMPORT_COMPLETED';
97
99
  const SystemHighlightCellAdd = (cellHighlightInfo) => ({
98
100
  type: exports.SYSTEM_HIGHLIGHT_CELL_ADD,
99
101
  cellHighlightInfo: cellHighlightInfo,
@@ -398,6 +400,11 @@ const SystemNotesEditModeSelector = (state) => {
398
400
  return (_a = state === null || state === void 0 ? void 0 : state.Notes) === null || _a === void 0 ? void 0 : _a.editMode;
399
401
  };
400
402
  exports.SystemNotesEditModeSelector = SystemNotesEditModeSelector;
403
+ const DataImportCompleted = (dataImportedInfo) => ({
404
+ type: exports.DATA_IMPORT_COMPLETED,
405
+ dataImportedInfo: dataImportedInfo,
406
+ });
407
+ exports.DataImportCompleted = DataImportCompleted;
401
408
  const initialState = {
402
409
  AdaptableAlerts: GeneralConstants_1.EMPTY_ARRAY,
403
410
  AdaptableFlashingCells: {},
@@ -243,11 +243,13 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
243
243
  return returnColumnMenuItems;
244
244
  }
245
245
  createViewPivotItemsMenuItem(menuContext) {
246
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
247
246
  // current group => menuContext.rowNode.field;
248
- if (((_b = (_a = menuContext.selectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells) === null || _b === void 0 ? void 0 : _b.length) !== 1) {
247
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
248
+ const selectedCellInfo = (_a = menuContext.selectedCellInfo) !== null && _a !== void 0 ? _a : this.api.gridApi.getSelectedCellInfo();
249
+ if (((_b = selectedCellInfo === null || selectedCellInfo === void 0 ? void 0 : selectedCellInfo.gridCells) === null || _b === void 0 ? void 0 : _b.length) !== 1) {
249
250
  return;
250
251
  }
252
+ const gridCell = (_c = menuContext.gridCell) !== null && _c !== void 0 ? _c : selectedCellInfo.gridCells[0];
251
253
  const currentLayout = this.api.layoutApi.getCurrentLayout();
252
254
  if (!currentLayout.EnablePivot) {
253
255
  return;
@@ -266,11 +268,11 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
266
268
  */
267
269
  // pivot_status_Booked_price
268
270
  // price
269
- const aggColumn = (_f = (_e = (_d = (_c = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _c === void 0 ? void 0 : _c.call(agGridColumn).pivotValueColumn) === null || _d === void 0 ? void 0 : _d.getColDef) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.field;
271
+ const aggColumn = (_g = (_f = (_e = (_d = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _d === void 0 ? void 0 : _d.call(agGridColumn).pivotValueColumn) === null || _e === void 0 ? void 0 : _e.getColDef) === null || _f === void 0 ? void 0 : _f.call(_e)) === null || _g === void 0 ? void 0 : _g.field;
270
272
  // Booked
271
- const pivotValue = (_j = (_h = (_g = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _g === void 0 ? void 0 : _g.call(agGridColumn)) === null || _h === void 0 ? void 0 : _h.pivotKeys) === null || _j === void 0 ? void 0 : _j[0];
273
+ const pivotValue = (_k = (_j = (_h = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _h === void 0 ? void 0 : _h.call(agGridColumn)) === null || _j === void 0 ? void 0 : _j.pivotKeys) === null || _k === void 0 ? void 0 : _k[0];
272
274
  // status - the preview works only with one column
273
- const pivotColumnId = (_k = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.PivotColumns) === null || _k === void 0 ? void 0 : _k[0];
275
+ const pivotColumnId = (_l = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.PivotColumns) === null || _l === void 0 ? void 0 : _l[0];
274
276
  function getData(rows) {
275
277
  return [
276
278
  ...rows.map((row) => {
@@ -283,9 +285,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
283
285
  }
284
286
  const data = (0, flattenDeep_1.default)(getData(menuContext.rowNode.childrenAfterFilter));
285
287
  const rowGroups = currentLayout.RowGroupedColumns;
286
- const cellValue = isPivotColumn
287
- ? menuContext.rowNode.aggData[columnId]
288
- : menuContext.gridCell.displayValue;
288
+ const cellValue = isPivotColumn ? menuContext.rowNode.aggData[columnId] : gridCell.displayValue;
289
289
  const popupProps = {
290
290
  hasPivotValue: isPivotColumn,
291
291
  columnId,
@@ -2,6 +2,6 @@ import { ExpressionFunction } from '../../parser/src/types';
2
2
  /**
3
3
  * List of all the Scalar Functions available in AdaptableQL
4
4
  */
5
- export type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'ABS' | 'CEILING' | 'FLOOR' | 'ROUND' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'TODAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'NULL' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'CASE' | 'COL' | 'VAR' | 'TO_ARRAY' | 'QUERY' | 'IS_BLANK' | 'IS_NOT_BLANK';
5
+ export type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'ABS' | 'CEILING' | 'FLOOR' | 'ROUND' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'CURRENT_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'NULL' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'CASE' | 'COL' | 'VAR' | 'TO_ARRAY' | 'QUERY' | 'IS_BLANK' | 'IS_NOT_BLANK';
6
6
  export declare const scalarExpressionFunctions: Record<ScalarFunctionName, ExpressionFunction>;
7
7
  export declare const scalarExpressionFunctionNames: ScalarFunctionName[];
@@ -387,13 +387,13 @@ exports.scalarExpressionFunctions = {
387
387
  category: 'dates',
388
388
  returnType: 'date',
389
389
  },
390
- TODAY: {
390
+ CURRENT_DAY: {
391
391
  handler() {
392
392
  return (0, startOfDay_1.default)(new Date());
393
393
  },
394
394
  description: 'Returns the current day',
395
- signatures: ['TODAY()'],
396
- examples: ['[col1] > TODAY()'],
395
+ signatures: ['CURRENT_DAY()'],
396
+ examples: ['[col1] > CURRENT_DAY()'],
397
397
  category: 'dates',
398
398
  returnType: 'date',
399
399
  },
@@ -443,7 +443,7 @@ exports.scalarExpressionFunctions = {
443
443
  },
444
444
  description: 'Returns a date based on input data and days to add',
445
445
  signatures: ['ADD_DAYS(input: date, days: number)'],
446
- examples: ['ADD_DAYS(TODAY(), 5)', 'ADD_DAYS([col1], 5)'],
446
+ examples: ['ADD_DAYS(CURRENT_DAY(), 5)', 'ADD_DAYS([col1], 5)'],
447
447
  category: 'dates',
448
448
  returnType: 'date',
449
449
  },
@@ -453,7 +453,7 @@ exports.scalarExpressionFunctions = {
453
453
  },
454
454
  description: 'Returns a date based on input data and weeks to add',
455
455
  signatures: ['ADD_WEEKS(input: date, weeks: number)'],
456
- examples: ['ADD_WEEKS(TODAY(), 5)', 'ADD_WEEKS([col1], 5)'],
456
+ examples: ['ADD_WEEKS(CURRENT_DAY(), 5)', 'ADD_WEEKS([col1], 5)'],
457
457
  category: 'dates',
458
458
  returnType: 'date',
459
459
  },
@@ -463,7 +463,7 @@ exports.scalarExpressionFunctions = {
463
463
  },
464
464
  description: 'Returns a date based on input data and months to add',
465
465
  signatures: ['ADD_MONTHS(input: date, months: number)'],
466
- examples: ['ADD_MONTHS(TODAY(), 5)', 'ADD_MONTHS([col1], 5)'],
466
+ examples: ['ADD_MONTHS(CURRENT_DAY(), 5)', 'ADD_MONTHS([col1], 5)'],
467
467
  category: 'dates',
468
468
  returnType: 'date',
469
469
  },
@@ -473,7 +473,7 @@ exports.scalarExpressionFunctions = {
473
473
  },
474
474
  description: 'Returns a date based on input data and years to add',
475
475
  signatures: ['ADD_YEARS(input: date, years: number)'],
476
- examples: ['ADD_YEARS(TODAY(), 5)', 'ADD_YEARS([col1], 5)'],
476
+ examples: ['ADD_YEARS(CURRENT_DAY(), 5)', 'ADD_YEARS([col1], 5)'],
477
477
  category: 'dates',
478
478
  returnType: 'date',
479
479
  },
@@ -485,7 +485,7 @@ exports.scalarExpressionFunctions = {
485
485
  },
486
486
  description: 'Returns the difference in days between 2 dates',
487
487
  signatures: ['DIFF_DAYS(a: date, b: date)'],
488
- examples: ['DIFF_DAYS([col1], TODAY())'],
488
+ examples: ['DIFF_DAYS([col1], CURRENT_DAY())'],
489
489
  category: 'dates',
490
490
  returnType: 'number',
491
491
  },
@@ -497,7 +497,7 @@ exports.scalarExpressionFunctions = {
497
497
  },
498
498
  description: 'Returns the difference in weeks between 2 dates',
499
499
  signatures: ['DIFF_WEEKS(a: date, b: date)'],
500
- examples: ['DIFF_WEEKS([col1], TODAY())'],
500
+ examples: ['DIFF_WEEKS([col1], CURRENT_DAY())'],
501
501
  category: 'dates',
502
502
  returnType: 'number',
503
503
  },
@@ -509,7 +509,7 @@ exports.scalarExpressionFunctions = {
509
509
  },
510
510
  description: 'Returns the difference in months between 2 dates',
511
511
  signatures: ['DIFF_MONTHS(a: date, b: date)'],
512
- examples: ['DIFF_MONTHS([col1], TODAY())'],
512
+ examples: ['DIFF_MONTHS([col1], CURRENT_DAY())'],
513
513
  category: 'dates',
514
514
  returnType: 'number',
515
515
  },
@@ -521,7 +521,7 @@ exports.scalarExpressionFunctions = {
521
521
  },
522
522
  description: 'Returns the difference in years between 2 dates',
523
523
  signatures: ['DIFF_YEARS(a: date, b: date)'],
524
- examples: ['DIFF_YEARS([col1], TODAY())'],
524
+ examples: ['DIFF_YEARS([col1], CURRENT_DAY())'],
525
525
  category: 'dates',
526
526
  returnType: 'number',
527
527
  },
@@ -17,6 +17,7 @@ export declare function IsNotNullOrEmpty(arrayToCheck: any[] | undefined | null)
17
17
  export declare function IsNullOrEmptyOrContainsSingleEmptyValue(arrayToCheck: any[]): boolean;
18
18
  export declare function IsNotNullOrEmptyNorContainsSingleEmptyValue(arrayToCheck: any[]): boolean;
19
19
  export declare function HasSingleEmptyValue(arrayToCheck: any[]): boolean;
20
+ export declare function getOccurrence(arrayToCheck: any[], valueToCheck: any): number;
20
21
  export declare function hasOneItem(arrayToCheck: any[]): boolean;
21
22
  export declare function hasItemsOfCount(arrayToCheck: any[], numberOfItems: number): boolean;
22
23
  export declare function moveArray(array: any[], from: number, to: number): void;
@@ -50,6 +51,7 @@ export declare const ArrayExtensions: {
50
51
  IsNullOrEmptyOrContainsSingleEmptyValue: typeof IsNullOrEmptyOrContainsSingleEmptyValue;
51
52
  IsNotNullOrEmptyNorContainsSingleEmptyValue: typeof IsNotNullOrEmptyNorContainsSingleEmptyValue;
52
53
  HasSingleEmptyValue: typeof HasSingleEmptyValue;
54
+ getOccurrence: typeof getOccurrence;
53
55
  hasOneItem: typeof hasOneItem;
54
56
  hasItemsOfCount: typeof hasItemsOfCount;
55
57
  moveArray: typeof moveArray;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ArrayExtensions = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
3
+ exports.ArrayExtensions = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
4
4
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
5
5
  function GetLength(arrayToCheck) {
6
6
  return IsNotNull(arrayToCheck) ? arrayToCheck.length : 0;
@@ -95,6 +95,12 @@ function HasSingleEmptyValue(arrayToCheck) {
95
95
  return false;
96
96
  }
97
97
  exports.HasSingleEmptyValue = HasSingleEmptyValue;
98
+ function getOccurrence(arrayToCheck, valueToCheck) {
99
+ var count = 0;
100
+ arrayToCheck.forEach((v) => v === valueToCheck && count++);
101
+ return count;
102
+ }
103
+ exports.getOccurrence = getOccurrence;
98
104
  function hasOneItem(arrayToCheck) {
99
105
  return hasItemsOfCount(arrayToCheck, 1);
100
106
  }
@@ -302,6 +308,7 @@ exports.ArrayExtensions = {
302
308
  IsNullOrEmptyOrContainsSingleEmptyValue,
303
309
  IsNotNullOrEmptyNorContainsSingleEmptyValue,
304
310
  HasSingleEmptyValue,
311
+ getOccurrence,
305
312
  hasOneItem,
306
313
  hasItemsOfCount,
307
314
  moveArray,
@@ -71,7 +71,7 @@ const useChartingElements = ({ elementType, accessLevel, size = 'normal', }) =>
71
71
  if ((0, ChartingState_1.isAgChartDefinition)(selectedChart)) {
72
72
  containerOptions.unshift({
73
73
  label: chartingOptions.agGridContainerName,
74
- value: null,
74
+ value: chartingOptions.agGridContainerName,
75
75
  });
76
76
  }
77
77
  const style = {};
@@ -82,8 +82,13 @@ const useChartingElements = ({ elementType, accessLevel, size = 'normal', }) =>
82
82
  iconSize = 15;
83
83
  }
84
84
  const chartSelector = (React.createElement(Select_1.Select, { className: `ab-${elementType}__Chart__select`, size: size, value: selectedChartId, options: options, placeholder: 'Select Chart', disabled: !hasCharts, onChange: (chartUuid) => setSelectedChartId(chartUuid) }));
85
- const containerSelector = Boolean(chartContainers === null || chartContainers === void 0 ? void 0 : chartContainers.length) && (React.createElement(Select_1.Select, { value: selectedContainer === null || selectedContainer === void 0 ? void 0 : selectedContainer.name, size: size, onChange: (containerName) => {
86
- setSelectedContainer(chartContainers.find((containerOption) => containerOption.name === containerName));
85
+ const containerSelector = Boolean(chartContainers === null || chartContainers === void 0 ? void 0 : chartContainers.length) && (React.createElement(Select_1.Select, { value: selectedContainer === null ? chartingOptions.agGridContainerName : selectedContainer === null || selectedContainer === void 0 ? void 0 : selectedContainer.name, size: size, onChange: (containerName) => {
86
+ if (containerName === chartingOptions.agGridContainerName) {
87
+ setSelectedContainer(null);
88
+ }
89
+ else {
90
+ setSelectedContainer(chartContainers.find((containerOption) => containerOption.name === containerName));
91
+ }
87
92
  }, options: containerOptions, placeholder: "Select Container" }));
88
93
  const chartButton = (React.createElement(SimpleButton_1.default, { style: style, mr: 1, onClick: () => (isOpen ? hideChart() : showChart(selectedContainer)), disabled: !Boolean(selectedChart), variant: 'text', tone: 'neutral', icon: isOpen ? 'visibility-off' : 'visibility-on', tooltip: isOpen ? 'Hide Chart' : 'Show Chart' }));
89
94
  const deleteButton = (React.createElement(DeleteChartButton_1.DeleteChartButton, { iconSize: iconSize, chart: selectedChart, accessLevel: chartAccessLevel }));
@@ -2660,6 +2660,18 @@ class Adaptable {
2660
2660
  columnTypes.push(...calculatedColumnSettings.ColumnTypes);
2661
2661
  }
2662
2662
  const isExternalEvaluation = !this.api.expressionApi.internalApi.evaluateExpressionInAdaptableQL('CalculatedColumn', calculatedColumn, this.api.expressionApi.getAdaptableQueryExpression(calculatedColumn.Query));
2663
+ const valueGetter = (params) => {
2664
+ var _a, _b;
2665
+ if (isExternalEvaluation) {
2666
+ return (_a = params.data) === null || _a === void 0 ? void 0 : _a[calculatedColumn.ColumnId];
2667
+ }
2668
+ // if the grid data is NOT client side, we can aggregate only simple scalar expression (which depend on row data, not on other rows)
2669
+ if (this.api.gridApi.getAgGridRowModelType() !== 'clientSide' &&
2670
+ StringExtensions_1.StringExtensions.IsNotNullOrEmpty(calculatedColumn.Query.AggregatedScalarExpression)) {
2671
+ return (_b = params.data) === null || _b === void 0 ? void 0 : _b[calculatedColumn.ColumnId];
2672
+ }
2673
+ return this.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
2674
+ };
2663
2675
  const newColDef = {
2664
2676
  headerName: calculatedColumn.FriendlyName
2665
2677
  ? calculatedColumn.FriendlyName
@@ -2678,13 +2690,7 @@ class Adaptable {
2678
2690
  suppressMenu: calculatedColumnSettings.SuppressMenu,
2679
2691
  suppressMovable: calculatedColumnSettings.SuppressMovable,
2680
2692
  type: columnTypes,
2681
- valueGetter: (params) => {
2682
- var _a;
2683
- if (isExternalEvaluation) {
2684
- return (_a = params.data) === null || _a === void 0 ? void 0 : _a[calculatedColumn.ColumnId];
2685
- }
2686
- return this.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
2687
- },
2693
+ valueGetter,
2688
2694
  };
2689
2695
  if (calculatedColumnSettings.ShowToolTip != null &&
2690
2696
  calculatedColumnSettings.ShowToolTip == true) {
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "17.0.2";
1
+ declare const _default: "17.0.4";
2
2
  export default _default;
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '17.0.2'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
3
+ exports.default = '17.0.4'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version