@adaptabletools/adaptable-cjs 18.0.0-canary.21 → 18.0.0-canary.22

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.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableOptions/CommentOptions.d.ts +6 -0
  3. package/src/AdaptableOptions/GroupingOptions.d.ts +0 -4
  4. package/src/AdaptableOptions/NoteOptions.d.ts +8 -2
  5. package/src/Api/ColumnApi.d.ts +5 -0
  6. package/src/Api/Implementation/ColumnApiImpl.d.ts +3 -0
  7. package/src/Api/Implementation/ColumnApiImpl.js +22 -7
  8. package/src/Api/Implementation/ScopeApiImpl.js +34 -1
  9. package/src/Api/Internal/ColumnInternalApi.d.ts +2 -0
  10. package/src/Api/Internal/ColumnInternalApi.js +8 -1
  11. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  12. package/src/Utilities/Constants/GeneralConstants.js +3 -2
  13. package/src/View/Comments/CommentsPopup.js +5 -2
  14. package/src/View/Components/CellPopup/index.js +1 -1
  15. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +1 -1
  16. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +19 -6
  17. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -5
  18. package/src/View/Note/NotePopup.js +5 -2
  19. package/src/agGrid/AdaptableAgGrid.js +19 -60
  20. package/src/agGrid/AgGridAdapter.d.ts +1 -0
  21. package/src/agGrid/AgGridAdapter.js +4 -0
  22. package/src/agGrid/AgGridColumnAdapter.d.ts +0 -2
  23. package/src/agGrid/AgGridColumnAdapter.js +0 -43
  24. package/src/agGrid/buildSortedColumnStateForLayout.d.ts +7 -0
  25. package/src/agGrid/buildSortedColumnStateForLayout.js +124 -0
  26. package/src/agGrid/defaultAdaptableOptions.js +0 -1
  27. package/src/agGrid/sortColumnStateForVisibleColumns.d.ts +12 -0
  28. package/src/agGrid/sortColumnStateForVisibleColumns.js +50 -0
  29. package/src/env.js +2 -2
  30. package/src/metamodel/adaptable.metamodel.d.ts +18 -12
  31. package/src/metamodel/adaptable.metamodel.js +1 -1
  32. package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "18.0.0-canary.21",
3
+ "version": "18.0.0-canary.22",
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",
@@ -16,6 +16,12 @@ export interface CommentOptions<TData = any> {
16
16
  * @param commentThreads
17
17
  */
18
18
  persistCommentThreads?(commentThreads: CommentThread[]): void;
19
+ /**
20
+ * Format string for formatting in the Comments Popup
21
+ *
22
+ * @defaultValue 'dd-MM-yyyy HH:mm:ss'
23
+ */
24
+ dateFormat?: string;
19
25
  }
20
26
  /**
21
27
  * Context used when determining if a cell can show Comments
@@ -4,10 +4,6 @@ import { KeyCreatorParams } from '@ag-grid-community/core';
4
4
  * Options for managing Row and Column Groups in AdapTable
5
5
  */
6
6
  export interface GroupingOptions<TData = any> {
7
- /**
8
- * Value to use for 'Balanced Groups' (string columns only)
9
- */
10
- balancedGroupsKey?: string | ((context: BalancedGroupsKeyContext<TData>) => string);
11
7
  /**
12
8
  * Places ungrouped columns at pre-grouping indexed position
13
9
  * @defaultValue false
@@ -7,13 +7,19 @@ export interface NoteOptions<TData = any> {
7
7
  * Whether a cell can contain Notes
8
8
  */
9
9
  isCellNotable?: (context: NotableCellContext) => boolean;
10
+ /**
11
+ * Format string for formatting in the Notes Popup
12
+ *
13
+ * @defaultValue 'dd-MM-yyyy HH:mm:ss'
14
+ */
15
+ dateFormat?: string;
10
16
  }
11
17
  /**
12
18
  * Context used when determining if a Note can be added to a Cell
13
19
  */
14
20
  export interface NotableCellContext extends BaseContext {
15
21
  /**
16
- * Grid Cell in AdapTable which has been clicked
17
- */
22
+ * Grid Cell in AdapTable which has been clicked
23
+ */
18
24
  gridCell: GridCell;
19
25
  }
@@ -266,4 +266,9 @@ export interface ColumnApi {
266
266
  * Returns available columns types defined under columnOptions.columnTypes
267
267
  */
268
268
  getColumnTypes(): string[];
269
+ /**
270
+ * Returns all columns of a given columnType
271
+ * @param columnType the columnType to filter by
272
+ */
273
+ getColumnsByColumnType(columnType: string): AdaptableColumn[];
269
274
  }
@@ -3,6 +3,8 @@ import { AdaptableColumn, AdaptableColumnDataType } from '../../PredefinedConfig
3
3
  import { ColumnApi } from '../ColumnApi';
4
4
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
5
5
  import { ColumnInternalApi } from '../Internal/ColumnInternalApi';
6
+ export declare function isAutoRowGroupColumn(columnId: string): boolean;
7
+ export declare function isAutoPivotColumn(columnId: string): boolean;
6
8
  export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
7
9
  internalApi: ColumnInternalApi;
8
10
  constructor(adaptable: IAdaptable);
@@ -64,4 +66,5 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
64
66
  isSpecialColumn(columnId: string): boolean;
65
67
  openColumnInfoSettingsPanel(): void;
66
68
  getColumnTypes(): string[];
69
+ getColumnsByColumnType(columnType: string): AdaptableColumn[];
67
70
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ColumnApiImpl = void 0;
3
+ exports.ColumnApiImpl = exports.isAutoPivotColumn = exports.isAutoRowGroupColumn = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const GeneralConstants = tslib_1.__importStar(require("../../Utilities/Constants/GeneralConstants"));
@@ -8,6 +8,18 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
8
8
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
9
9
  const ColumnInternalApi_1 = require("../Internal/ColumnInternalApi");
10
10
  const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
11
+ function isAutoRowGroupColumn(columnId) {
12
+ // put this here as there might be other indicators we are not aware of
13
+ // perhaps with non auto groups ?
14
+ //https://www.ag-grid.com/javascript-grid-grouping/
15
+ return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
16
+ }
17
+ exports.isAutoRowGroupColumn = isAutoRowGroupColumn;
18
+ function isAutoPivotColumn(columnId) {
19
+ // put this here as there might be other indicators we are not aware of?
20
+ return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_PIVOT_COLUMN);
21
+ }
22
+ exports.isAutoPivotColumn = isAutoPivotColumn;
11
23
  class ColumnApiImpl extends ApiBase_1.ApiBase {
12
24
  constructor(adaptable) {
13
25
  super(adaptable);
@@ -56,14 +68,10 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
56
68
  this.adaptable.showColumn(columnId);
57
69
  }
58
70
  isAutoRowGroupColumn(columnId) {
59
- // put this here as there might be other indicators we are not aware of
60
- // perhaps with non auto groups ?
61
- //https://www.ag-grid.com/javascript-grid-grouping/
62
- return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
71
+ return isAutoRowGroupColumn(columnId);
63
72
  }
64
73
  isAutoPivotColumn(columnId) {
65
- // put this here as there might be other indicators we are not aware of?
66
- return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_PIVOT_COLUMN);
74
+ return isAutoPivotColumn(columnId);
67
75
  }
68
76
  isCalculatedColumn(columnId) {
69
77
  return (this.adaptable.api.calculatedColumnApi
@@ -347,5 +355,12 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
347
355
  return columnTypes;
348
356
  }
349
357
  }
358
+ getColumnsByColumnType(columnType) {
359
+ const abColumns = this.getColumns();
360
+ return abColumns.filter((c) => {
361
+ var _a;
362
+ return ((_a = c.columnTypes) !== null && _a !== void 0 ? _a : []).includes(columnType);
363
+ });
364
+ }
350
365
  }
351
366
  exports.ColumnApiImpl = ColumnApiImpl;
@@ -47,7 +47,9 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
47
47
  return 'Columns: All';
48
48
  }
49
49
  if ('ColumnTypes' in scope) {
50
- return ((scope.ColumnTypes.length > 0 ? 'ColumnTypes' : 'ColumnType') + ': ' + scope.ColumnTypes.join(', '));
50
+ return ((scope.ColumnTypes.length > 0 ? 'ColumnTypes' : 'ColumnType') +
51
+ ': ' +
52
+ scope.ColumnTypes.join(', '));
51
53
  }
52
54
  if ('DataTypes' in scope) {
53
55
  return ((scope.DataTypes.length > 0 ? 'DataTypes' : 'DataType') + ': ' + scope.DataTypes.join(', '));
@@ -164,6 +166,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
164
166
  return undefined;
165
167
  }
166
168
  isColumnInNumericScope(column, scope) {
169
+ var _a, _b;
167
170
  // if column is not even numeric then return false
168
171
  if (column == null || column == undefined || column.dataType !== 'Number') {
169
172
  return false;
@@ -180,9 +183,14 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
180
183
  if ('DataTypes' in scope && scope.DataTypes.includes('Number')) {
181
184
  return true;
182
185
  }
186
+ if ('ColumnTypes' in scope &&
187
+ ((_b = (_a = scope.ColumnTypes) === null || _a === void 0 ? void 0 : _a.some) === null || _b === void 0 ? void 0 : _b.call(_a, (scopeColumnType) => { var _a, _b; return (_b = (_a = column.columnTypes) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, scopeColumnType); }))) {
188
+ return true;
189
+ }
183
190
  return false;
184
191
  }
185
192
  isColumnInStringsScope(column, scope) {
193
+ var _a, _b;
186
194
  // if column is not even string then return false
187
195
  if (column == null || column == undefined || column.dataType !== 'String') {
188
196
  return false;
@@ -199,9 +207,14 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
199
207
  if ('DataTypes' in scope && scope.DataTypes.includes('String')) {
200
208
  return true;
201
209
  }
210
+ if ('ColumnTypes' in scope &&
211
+ ((_b = (_a = scope.ColumnTypes) === null || _a === void 0 ? void 0 : _a.some) === null || _b === void 0 ? void 0 : _b.call(_a, (scopeColumnType) => { var _a, _b; return (_b = (_a = column.columnTypes) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, scopeColumnType); }))) {
212
+ return true;
213
+ }
202
214
  return false;
203
215
  }
204
216
  isColumnInDateScope(column, scope) {
217
+ var _a, _b;
205
218
  // if column is not even numeric then return false
206
219
  if (column == null || column == undefined || column.dataType !== 'Date') {
207
220
  return false;
@@ -218,6 +231,10 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
218
231
  if ('DataTypes' in scope && scope.DataTypes.includes('Date')) {
219
232
  return true;
220
233
  }
234
+ if ('ColumnTypes' in scope &&
235
+ ((_b = (_a = scope.ColumnTypes) === null || _a === void 0 ? void 0 : _a.some) === null || _b === void 0 ? void 0 : _b.call(_a, (scopeColumnType) => { var _a, _b; return (_b = (_a = column.columnTypes) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, scopeColumnType); }))) {
236
+ return true;
237
+ }
221
238
  return false;
222
239
  }
223
240
  isScopeInScope(a, b) {
@@ -244,6 +261,22 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
244
261
  })) {
245
262
  return true;
246
263
  }
264
+ if ('ColumnTypes' in a &&
265
+ 'ColumnTypes' in b &&
266
+ a.ColumnTypes.every((columnType) => b.ColumnTypes.includes(columnType))) {
267
+ return true;
268
+ }
269
+ // check if each colum in a has column types in b
270
+ if ('ColumnIds' in a && 'ColumnTypes' in b) {
271
+ const inScope = a.ColumnIds.every((columnId) => {
272
+ const column = this.adaptable.api.columnApi.getColumnWithColumnId(columnId);
273
+ // check if at least one column-type is in scope
274
+ return column.columnTypes.some((columnColumnType) => b.ColumnTypes.includes(columnColumnType));
275
+ });
276
+ if (inScope) {
277
+ return true;
278
+ }
279
+ }
247
280
  return false;
248
281
  }
249
282
  createCellColorRangesForScope(scope) {
@@ -2,6 +2,7 @@ import { ApiBase } from '../Implementation/ApiBase';
2
2
  import { Column, IRowNode } from '@ag-grid-community/core';
3
3
  import { CustomSort } from '../../PredefinedConfig/CustomSortState';
4
4
  import { ColumnValuesComparer } from '../../AdaptableOptions/CustomSortOptions';
5
+ export declare function getAutoRowGroupColumnIdFor(columnId: string): string;
5
6
  export declare class ColumnInternalApi extends ApiBase {
6
7
  /**
7
8
  * Retrieves 'ColumnType' property for a given Column
@@ -15,6 +16,7 @@ export declare class ColumnInternalApi extends ApiBase {
15
16
  * Retrieves a list providing the Friendly Name / Caption for all columns
16
17
  */
17
18
  getAllColumnFriendlyNames(): string[];
19
+ getAutoRowGroupColumnIdFor(columnId: string): string;
18
20
  /**
19
21
  * Retrieves AG Grid's field property for the column
20
22
  * @param columnId columnId to look up
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ColumnInternalApi = void 0;
3
+ exports.ColumnInternalApi = exports.getAutoRowGroupColumnIdFor = void 0;
4
4
  const ApiBase_1 = require("../Implementation/ApiBase");
5
5
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
6
+ function getAutoRowGroupColumnIdFor(columnId) {
7
+ return `${GeneralConstants_1.AG_GRID_GROUPED_COLUMN}-${columnId}`;
8
+ }
9
+ exports.getAutoRowGroupColumnIdFor = getAutoRowGroupColumnIdFor;
6
10
  class ColumnInternalApi extends ApiBase_1.ApiBase {
7
11
  /**
8
12
  * Retrieves 'ColumnType' property for a given Column
@@ -24,6 +28,9 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
24
28
  return c.friendlyName;
25
29
  });
26
30
  }
31
+ getAutoRowGroupColumnIdFor(columnId) {
32
+ return getAutoRowGroupColumnIdFor(columnId);
33
+ }
27
34
  /**
28
35
  * Retrieves AG Grid's field property for the column
29
36
  * @param columnId columnId to look up
@@ -35,6 +35,7 @@ export declare const ADAPTABLE_ROW_ACTION_BUTTONS = "adaptableRowActionButtons";
35
35
  export declare const ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = "(ActionRowButtons)";
36
36
  export declare const ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = "(FDC3ActionColumn)";
37
37
  export declare const DEFAULT_DATE_FORMAT_PATTERN = "dd-MM-yyyy";
38
+ export declare const DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = "dd-MM-yyyy HH:mm:ss";
38
39
  export declare const BLANK_DISTINCT_COLUMN_VALUE = "[BLANKS]";
39
40
  export declare const DEFAULT_STRING_DISPLAY_VALUE = "Hello World";
40
41
  export declare const DEFAULT_INTEGER_DISPLAY_VALUE = 12345;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.DEFAULT_DOUBLE_DISPLAY_VALUE = exports.DEFAULT_INTEGER_DISPLAY_VALUE = exports.DEFAULT_STRING_DISPLAY_VALUE = exports.BLANK_DISTINCT_COLUMN_VALUE = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.GROUP_PATH_SEPARATOR = exports.HALF_SECOND = exports.AB_FDC3_COLUMN = exports.AB_ROW_ACTIONS_COLUMN = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.OS_THEME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
4
- exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = void 0;
3
+ exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.DEFAULT_DOUBLE_DISPLAY_VALUE = exports.DEFAULT_INTEGER_DISPLAY_VALUE = exports.DEFAULT_STRING_DISPLAY_VALUE = exports.BLANK_DISTINCT_COLUMN_VALUE = exports.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.GROUP_PATH_SEPARATOR = exports.HALF_SECOND = exports.AB_FDC3_COLUMN = exports.AB_ROW_ACTIONS_COLUMN = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.OS_THEME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
4
+ exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = void 0;
5
5
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
6
6
  const UIHelper_1 = require("../../View/UIHelper");
7
7
  exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
@@ -38,6 +38,7 @@ exports.ADAPTABLE_ROW_ACTION_BUTTONS = 'adaptableRowActionButtons';
38
38
  exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = '(ActionRowButtons)';
39
39
  exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = '(FDC3ActionColumn)';
40
40
  exports.DEFAULT_DATE_FORMAT_PATTERN = 'dd-MM-yyyy';
41
+ exports.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = 'dd-MM-yyyy HH:mm:ss';
41
42
  exports.BLANK_DISTINCT_COLUMN_VALUE = '[BLANKS]';
42
43
  exports.DEFAULT_STRING_DISPLAY_VALUE = 'Hello World';
43
44
  exports.DEFAULT_INTEGER_DISPLAY_VALUE = 12345;
@@ -7,10 +7,11 @@ const react_redux_1 = require("react-redux");
7
7
  const InfiniteTable_1 = require("../../components/InfiniteTable");
8
8
  const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
9
9
  const rebass_1 = require("rebass");
10
- const dateUtils_1 = require("../../Utilities/ExpressionFunctions/dateUtils");
10
+ const format_1 = tslib_1.__importDefault(require("date-fns/format"));
11
11
  const AdaptableContext_1 = require("../AdaptableContext");
12
12
  const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
13
13
  const AdaptableButton_1 = require("../Components/AdaptableButton");
14
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
14
15
  const tableDOMProps = {
15
16
  style: {
16
17
  minHeight: 160,
@@ -18,7 +19,9 @@ const tableDOMProps = {
18
19
  },
19
20
  };
20
21
  const CellComments = (props) => {
22
+ var _a;
21
23
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
24
+ const dateFormat = (_a = adaptable.api.optionsApi.getCommentOptions().dateFormat) !== null && _a !== void 0 ? _a : GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
22
25
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
23
26
  const columnsMap = React.useMemo(() => {
24
27
  const columns = {
@@ -31,7 +34,7 @@ const CellComments = (props) => {
31
34
  field: 'Timestamp',
32
35
  maxWidth: 150,
33
36
  valueGetter: (params) => {
34
- return (0, dateUtils_1.formatDate)(params.data.Timestamp, 'MM.DD.YYYY HH:mm');
37
+ return (0, format_1.default)(params.data.Timestamp, dateFormat);
35
38
  },
36
39
  },
37
40
  text: {
@@ -17,7 +17,7 @@ const ensurePortalElement = (className) => {
17
17
  }
18
18
  portalElement = document.createElement('div');
19
19
  portalElement.style.position = 'absolute';
20
- portalElement.style.zIndex = '999';
20
+ portalElement.style.zIndex = '4'; // under the context menu
21
21
  portalElement.style.top = '0px';
22
22
  portalElement.style.left = '0px';
23
23
  if (className) {
@@ -136,7 +136,7 @@ const DataImportWizard = (props) => {
136
136
  return [...userDefinedHandlers, ...systemFileHandlers_1.systemFileHandlers];
137
137
  }, []);
138
138
  const supportedFileFormats = React.useMemo(() => {
139
- return fileHandlers.map((h) => h.fileExtension).join(', ');
139
+ return [...new Set(fileHandlers.map((h) => h.fileExtension)).values()].join(', ');
140
140
  }, [fileHandlers]);
141
141
  const readFile = React.useCallback(async (file) => {
142
142
  var _a, _b;
@@ -149,6 +149,19 @@ const getFormatDisplayTypeForScope = (scope, api) => {
149
149
  if ('DataTypes' in scope && scope.DataTypes.length == 1 && scope.DataTypes[0] == 'String') {
150
150
  return 'String';
151
151
  }
152
+ if ('ColumnTypes' in scope && scope.ColumnTypes.length) {
153
+ // need to check if all column with this column type has the same data type and return that particular one
154
+ const columns = scope.ColumnTypes.flatMap((columnType) => {
155
+ return api.columnApi.getColumnsByColumnType(columnType);
156
+ });
157
+ // check if all have the same type
158
+ if (columns.length &&
159
+ columns.every((column) => column.dataType === columns[0].dataType) &&
160
+ // supported data types
161
+ ['Number', 'Date', 'String'].includes(columns[0].dataType)) {
162
+ return columns[0].dataType;
163
+ }
164
+ }
152
165
  return undefined;
153
166
  };
154
167
  exports.getFormatDisplayTypeForScope = getFormatDisplayTypeForScope;
@@ -196,7 +209,7 @@ const renderDateFormat = (data, _onChange, setFormatOption, scopedCustomFormatte
196
209
  ] })))))));
197
210
  };
198
211
  const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatters, formatColumnApi) => {
199
- var _a, _b, _c;
212
+ var _a, _b, _c, _d, _e;
200
213
  if (data.DisplayFormat.Formatter !== 'NumberFormatter') {
201
214
  return null;
202
215
  }
@@ -255,13 +268,13 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
255
268
  React.createElement(rebass_1.Flex, { flexDirection: "row" },
256
269
  React.createElement(FormLayout_1.default, { mr: 3 },
257
270
  React.createElement(FormLayout_1.FormRow, { label: "Fraction Separator" },
258
- React.createElement(Input_1.default, { "data-name": "fraction-separator", value: data.DisplayFormat.Options.FractionSeparator, onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) })),
271
+ React.createElement(Input_1.default, { "data-name": "fraction-separator", value: (_a = data.DisplayFormat.Options.FractionSeparator) !== null && _a !== void 0 ? _a : '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) })),
259
272
  React.createElement(FormLayout_1.FormRow, { label: "Integer Separator" },
260
- React.createElement(Input_1.default, { "data-name": "integer-separator", value: data.DisplayFormat.Options.IntegerSeparator, onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) })),
273
+ React.createElement(Input_1.default, { "data-name": "integer-separator", value: (_b = data.DisplayFormat.Options.IntegerSeparator) !== null && _b !== void 0 ? _b : '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) })),
261
274
  React.createElement(FormLayout_1.FormRow, { label: "Prefix" },
262
- React.createElement(Input_1.default, { "data-name": "prefix", value: (_a = data.DisplayFormat.Options.Prefix) !== null && _a !== void 0 ? _a : '', onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) })),
275
+ React.createElement(Input_1.default, { "data-name": "prefix", value: (_c = data.DisplayFormat.Options.Prefix) !== null && _c !== void 0 ? _c : '', onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) })),
263
276
  React.createElement(FormLayout_1.FormRow, { label: "Suffix" },
264
- React.createElement(Input_1.default, { "data-name": "suffix", value: (_b = data.DisplayFormat.Options.Suffix) !== null && _b !== void 0 ? _b : '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
277
+ React.createElement(Input_1.default, { "data-name": "suffix", value: (_d = data.DisplayFormat.Options.Suffix) !== null && _d !== void 0 ? _d : '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
265
278
  React.createElement(FormLayout_1.FormRow, { label: "Truncate" },
266
279
  React.createElement(CheckBox_1.CheckBox, { "data-name": "truncate-checkbox", checked: data.DisplayFormat.Options.Truncate, onChange: (checked) => setFormatOption('Truncate', checked) })),
267
280
  React.createElement(FormLayout_1.FormRow, { label: "Ceiling" },
@@ -286,7 +299,7 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
286
299
  React.createElement(Input_1.default, { "data-name": "multiplier", type: "number", value: data.DisplayFormat.Options.Multiplier, onChange: (e) => setFormatOption('Multiplier', Number(e.currentTarget.value)) })),
287
300
  ' ',
288
301
  React.createElement(FormLayout_1.FormRow, { label: "Content" },
289
- React.createElement(Input_1.default, { "data-name": "content", value: (_c = data.DisplayFormat.Options.Content) !== null && _c !== void 0 ? _c : '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) })),
302
+ React.createElement(Input_1.default, { "data-name": "content", value: (_e = data.DisplayFormat.Options.Content) !== null && _e !== void 0 ? _e : '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) })),
290
303
  ' ',
291
304
  React.createElement(FormLayout_1.FormRow, { label: "Parentheses" },
292
305
  React.createElement(CheckBox_1.CheckBox, { "data-name": "parentheses-checkbox", checked: data.DisplayFormat.Options.Parentheses, onChange: (checked) => setFormatOption('Parentheses', checked) })),
@@ -11,11 +11,6 @@ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
11
11
  const Tag_1 = require("../../../components/Tag");
12
12
  const ToggleGroup_1 = require("../../../components/Toggle/ToggleGroup");
13
13
  const Toggle_1 = require("../../../components/Toggle/Toggle");
14
- let alignmentOptions = [
15
- { value: 'Left', label: 'Left' },
16
- { value: 'Right', label: 'Right' },
17
- { value: 'Center', label: 'Center' },
18
- ];
19
14
  const renderFormatColumnSettingsSummary = (data) => {
20
15
  var _a;
21
16
  return (React.createElement(rebass_1.Box, { padding: 2 },
@@ -6,9 +6,11 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const react_redux_1 = require("react-redux");
7
7
  const InfiniteTable_1 = require("../../components/InfiniteTable");
8
8
  const NoteRedux_1 = require("../../Redux/ActionsReducers/NoteRedux");
9
+ const format_1 = tslib_1.__importDefault(require("date-fns/format"));
9
10
  const AdaptableContext_1 = require("../AdaptableContext");
10
11
  const AdaptableButton_1 = require("../Components/AdaptableButton");
11
12
  const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
13
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
12
14
  const tableDOMProps = {
13
15
  style: {
14
16
  height: '100%',
@@ -17,8 +19,10 @@ const tableDOMProps = {
17
19
  },
18
20
  };
19
21
  const NotePopup = (props) => {
22
+ var _a;
20
23
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
21
24
  const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
25
+ const dateFormat = (_a = adaptable.api.optionsApi.getNoteOptions().dateFormat) !== null && _a !== void 0 ? _a : GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
22
26
  const allNotes = (0, react_redux_1.useSelector)((state) => (0, NoteRedux_1.GetAllNotesSelector)(state.Note));
23
27
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Note') === 'ReadOnly';
24
28
  const columnsMap = React.useMemo(() => {
@@ -43,8 +47,7 @@ const NotePopup = (props) => {
43
47
  timestamp: {
44
48
  field: 'Timestamp',
45
49
  valueGetter: (params) => {
46
- var _a;
47
- return (_a = new Date(params.data.Timestamp)) === null || _a === void 0 ? void 0 : _a.toDateString();
50
+ return (0, format_1.default)(params.data.Timestamp, dateFormat);
48
51
  },
49
52
  },
50
53
  delete: {
@@ -100,6 +100,7 @@ const Modal_1 = require("../components/Modal");
100
100
  const AdaptableLoadingScreen_1 = require("../View/Components/Popups/AdaptableLoadingScreen");
101
101
  const react_1 = require("react");
102
102
  const AdaptableHelper_1 = require("../Utilities/Helpers/AdaptableHelper");
103
+ const buildSortedColumnStateForLayout_1 = require("./buildSortedColumnStateForLayout");
103
104
  const RowNodeProto = core_1.RowNode.prototype;
104
105
  const RowNode_dispatchLocalEvent = RowNodeProto.dispatchLocalEvent;
105
106
  /**
@@ -2207,53 +2208,20 @@ class AdaptableAgGrid {
2207
2208
  });
2208
2209
  this.deriveAdaptableColumnStateFromAgGrid();
2209
2210
  }
2210
- getSortedColumnStateForVisibleColumns(visibleColumnList, columnState, isPivot) {
2211
+ getSortedColumnStateForVisibleColumns(visibleColumnList, columnState, layout) {
2212
+ layout = layout || this.api.layoutApi.getCurrentLayout();
2213
+ visibleColumnList = visibleColumnList || layout.Columns;
2211
2214
  columnState = columnState || this.agGridAdapter.getAgGridApi().getColumnState();
2212
- const pivotMode = isPivot !== null && isPivot !== void 0 ? isPivot : this.api.layoutApi.isCurrentLayoutPivot();
2213
- const NewVisibleColumnIdsMap = visibleColumnList.reduce((acc, colId, index) => {
2214
- acc[colId] = index;
2215
- return acc;
2216
- }, {});
2217
- const columnsStateIndexes = columnState.reduce((acc, colState, index) => {
2218
- acc[colState.colId] = index;
2219
- return acc;
2220
- }, {});
2221
- const newVisibleColumnsMap = visibleColumnList.reduce((acc, colId, index) => {
2222
- acc[colId] = index;
2223
- return acc;
2224
- }, {});
2225
- const result = [...columnState]
2226
- .sort((colState1, colState2) => {
2227
- const colId1 = colState1.colId;
2228
- const colId2 = colState2.colId;
2229
- const originalIndex1 = columnsStateIndexes[colId1];
2230
- const originalIndex2 = columnsStateIndexes[colId2];
2231
- if (pivotMode) {
2232
- const isRowGroup1 = this.api.columnApi.isAutoRowGroupColumn(colId1);
2233
- const isRowGroup2 = this.api.columnApi.isAutoRowGroupColumn(colId2);
2234
- if (isRowGroup1 && isRowGroup2) {
2235
- return 1;
2236
- }
2237
- if (isRowGroup1) {
2238
- return -1;
2239
- }
2240
- if (isRowGroup2) {
2241
- return 1;
2242
- }
2243
- }
2244
- if (newVisibleColumnsMap[colId1] != null && newVisibleColumnsMap[colId2] == null) {
2245
- return -1;
2246
- }
2247
- if (newVisibleColumnsMap[colId1] == null && newVisibleColumnsMap[colId2] != null) {
2248
- return 1;
2249
- }
2250
- if (newVisibleColumnsMap[colId1] == null && newVisibleColumnsMap[colId2] == null) {
2251
- return originalIndex1 - originalIndex2;
2252
- }
2253
- return newVisibleColumnsMap[colState1.colId] - newVisibleColumnsMap[colState2.colId];
2254
- })
2255
- .map((colState) => (Object.assign(Object.assign({}, colState), { hide: NewVisibleColumnIdsMap[colState.colId] == null })));
2256
- return result;
2215
+ return (0, buildSortedColumnStateForLayout_1.buildSortedColumnStateForLayout)({
2216
+ columnState: columnState.map((colState) => {
2217
+ return {
2218
+ colId: colState.colId,
2219
+ hide: colState.hide,
2220
+ };
2221
+ }),
2222
+ layout: Object.assign(Object.assign({}, layout), { Columns: visibleColumnList }),
2223
+ gridOptions: this.agGridAdapter.getLiveGridOptions(),
2224
+ });
2257
2225
  }
2258
2226
  getDistinctValuesForColumn(column, distinctValuesParams) {
2259
2227
  let gridCells = this.getGridCellsForPermittedValues(column, distinctValuesParams);
@@ -3194,10 +3162,6 @@ class AdaptableAgGrid {
3194
3162
  layout.PinnedColumnsMap = layout.PinnedColumnsMap || {};
3195
3163
  layout.PinnedColumnsMap[actionRowColumn.colId] = actionRowColumn.pinned;
3196
3164
  }
3197
- const layoutColumnsMap = layout.Columns.reduce((acc, colId) => {
3198
- acc[colId] = true;
3199
- return acc;
3200
- }, {});
3201
3165
  const columnsState = this.agGridAdapter.getAgGridApi().getColumnState();
3202
3166
  const columnsStateIndexes = {};
3203
3167
  const columnsStateMap = columnsState.reduce((acc, colState, index) => {
@@ -3229,20 +3193,19 @@ class AdaptableAgGrid {
3229
3193
  .getPivotResultColumns()) === null || _b === void 0 ? void 0 : _b.map((column) => column.getColId())) || [];
3230
3194
  let isChanged = false;
3231
3195
  const colsToAutoSize = {};
3232
- let newColumnsState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState, !!layout.EnablePivot);
3196
+ let newColumnsState = this.getSortedColumnStateForVisibleColumns(columnsToShow, columnsState, layout);
3233
3197
  newColumnsState = newColumnsState
3234
3198
  .map((colState) => {
3235
3199
  var _a, _b, _c;
3236
3200
  const { colId } = colState;
3237
3201
  const oldColState = columnsStateMap[colId];
3238
- const hide = this.api.columnApi.isAutoPivotColumn(colId)
3239
- ? colState.hide
3240
- : !layoutColumnsMap[colId];
3241
- const newColState = Object.assign(Object.assign({}, oldColState), { hide });
3202
+ // it's important to have width here, so it's not inherited from the existing colState
3203
+ // which could be from a different layout
3204
+ const newColState = Object.assign(Object.assign(Object.assign({}, oldColState), { width: null }), colState);
3242
3205
  if (layout.ColumnWidthMap && layout.ColumnWidthMap[colId] != null) {
3243
3206
  newColState.width = layout.ColumnWidthMap[colId];
3244
3207
  }
3245
- else if (!hide) {
3208
+ else if (!colState.hide) {
3246
3209
  // autosize only the columns which are part of the selected layout
3247
3210
  colsToAutoSize[colId] = true;
3248
3211
  }
@@ -3251,11 +3214,7 @@ class AdaptableAgGrid {
3251
3214
  }
3252
3215
  newColState.rowGroupIndex =
3253
3216
  groupedColumnsIndexesMap[colId] != null ? groupedColumnsIndexesMap[colId] : null;
3254
- const previousRowGroup = newColState.rowGroup;
3255
3217
  newColState.rowGroup = newColState.rowGroupIndex != null;
3256
- if (!previousRowGroup && newColState.rowGroup) {
3257
- this.agGridColumnAdapter.triggerSetupColumnKeyCreator(colId);
3258
- }
3259
3218
  const normalizePinned = (pinnedValue) => {
3260
3219
  if (typeof pinnedValue === 'string') {
3261
3220
  return pinnedValue;
@@ -24,6 +24,7 @@ export declare class AgGridAdapter {
24
24
  grabAgGridApiOnTheFly(args: unknown): void;
25
25
  getLiveGridOptions(): GridOptions | undefined;
26
26
  updateGridOptions(options: ManagedGridOptions): void;
27
+ getGridOption<Key extends keyof GridOptions>(key: Key): GridOptions[Key];
27
28
  setGridOption<Key extends ManagedGridOptionKey>(key: Key, value: GridOptions[Key]): void;
28
29
  getUserGridOptionsProperty<T extends keyof GridOptions>(propertyName: T): GridOptions[T];
29
30
  updateColumnFilterActiveState(): void;
@@ -64,6 +64,10 @@ class AgGridAdapter {
64
64
  var _a;
65
65
  (_a = this.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.updateGridOptions(options);
66
66
  }
67
+ getGridOption(key) {
68
+ var _a;
69
+ return (_a = this.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.getGridOption(key);
70
+ }
67
71
  setGridOption(key, value) {
68
72
  var _a;
69
73
  (_a = this.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.setGridOption(key, value);
@@ -12,7 +12,6 @@ export declare class AgGridColumnAdapter {
12
12
  setColDefProperty<T extends keyof ColDef>(col: Column, propertyName: T, propertyGetter: (userPropertyValue: ColDef[T]) => ColDef[T] | undefined): void;
13
13
  getUserColDefProperty<T extends keyof ColDef>(columnId: string, propertyName: T): ColDef[T] | undefined;
14
14
  setupColumns(): void;
15
- triggerSetupColumnKeyCreator(colId: string): void;
16
15
  private setupColumnValueGetter;
17
16
  private setupColumnCellClass;
18
17
  private setupColumnCellStyle;
@@ -21,7 +20,6 @@ export declare class AgGridColumnAdapter {
21
20
  private setupColumnTooltipValueGetter;
22
21
  private setupColumnQuickFilerText;
23
22
  private setupColumnAllowedAggFuncs;
24
- private setupColumnKeyCreator;
25
23
  private setupColumnCellDataType;
26
24
  setupColumnHeader({ col, abColumn }: ColumnSetupInfo): boolean;
27
25
  private setupColumnFilter;