@adaptabletools/adaptable 12.1.6 → 12.1.7

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 (37) hide show
  1. package/bundle.cjs.js +81 -81
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  6. package/src/AdaptableOptions/ColumnOptions.d.ts +2 -4
  7. package/src/Api/FlashingCellApi.d.ts +8 -0
  8. package/src/Api/Implementation/ColumnApiImpl.js +0 -1
  9. package/src/Api/Implementation/FilterApiImpl.js +10 -1
  10. package/src/Api/Implementation/FlashingCellApiImpl.d.ts +1 -0
  11. package/src/Api/Implementation/FlashingCellApiImpl.js +4 -0
  12. package/src/Api/SystemStatusApi.d.ts +1 -1
  13. package/src/Api/ToolPanelApi.d.ts +1 -1
  14. package/src/PredefinedConfig/Common/AdaptablePredicate.js +14 -6
  15. package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +6 -6
  16. package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -2
  17. package/src/Redux/ActionsReducers/SystemRedux.js +1 -2
  18. package/src/Redux/Store/AdaptableStore.js +5 -0
  19. package/src/Strategy/FlashingCellModule.js +2 -2
  20. package/src/Utilities/Helpers/CalendarHelper.js +10 -7
  21. package/src/Utilities/Helpers/DateHelper.d.ts +0 -26
  22. package/src/Utilities/Helpers/DateHelper.js +2 -32
  23. package/src/Utilities/ObjectFactory.d.ts +2 -2
  24. package/src/Utilities/ObjectFactory.js +14 -14
  25. package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingTags.js +2 -0
  26. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -4
  27. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
  28. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +10 -10
  29. package/src/View/Components/AdaptableDateInput/index.js +1 -1
  30. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -2
  31. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
  32. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +1 -1
  33. package/src/agGrid/Adaptable.d.ts +1 -0
  34. package/src/agGrid/Adaptable.js +9 -8
  35. package/src/metamodel/adaptable.metamodel.js +1 -1
  36. package/version.d.ts +1 -1
  37. package/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "12.1.6",
3
+ "version": "12.1.7",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1659973452141;
1
+ declare const _default: 1660658453580;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1659973452141;
3
+ exports.default = 1660658453580;
@@ -119,6 +119,7 @@ export interface IAdaptable {
119
119
  _emitSync(eventName: 'CreateAdaptableContextMenuItems', data?: any): Promise<any>;
120
120
  prepareGrid(): void;
121
121
  redrawBody(): void;
122
+ redrawRenderedRows(): void;
122
123
  redrawHeader(): void;
123
124
  redrawRow(rowNode: RowNode): void;
124
125
  redrawRows(rowNodes: RowNode[]): void;
@@ -5,14 +5,12 @@ import { Column } from '@ag-grid-community/all-modules';
5
5
  export interface ColumnOptions {
6
6
  /**
7
7
  * Provide an alternative Friendly Name for a Column
8
- *
9
8
  * @defaultValue undefined
10
9
  */
11
10
  columnFriendlyName?: (columnFriendlyNameContext: ColumnFriendlyNameContext) => string | undefined;
12
11
  /**
13
- * Optional list of Column Types - used primarily for Special Columns
14
- *
15
- * @defaultValue []
12
+ * Optional list of Column Types - used primarily for Calculated and FreeText Columns
13
+ * @defaultValue undefined
16
14
  */
17
15
  columnTypes?: string[];
18
16
  /**
@@ -60,6 +60,10 @@ export interface FlashingCellApi {
60
60
  * @param flashingCellDefinitions Flashing Cell Definitions to Add to State
61
61
  */
62
62
  setFlashingCellDefinitions(flashingCellDefinitions: FlashingCellDefinition[]): void;
63
+ /**
64
+ * Merges a Flashing Cell Definition with default values
65
+ * @param flashingCellDefinition Flashing Cell Definition to Merge
66
+ */
63
67
  mergeFlashingCellDefinitionWithDefaults(flashingCellDefinition: FlashingCellDefinition): FlashingCellDefinition;
64
68
  /**
65
69
  * Adds provided Flashing cell Definitions
@@ -88,4 +92,8 @@ export interface FlashingCellApi {
88
92
  * @param scope the Scope to check
89
93
  */
90
94
  getFlashingCellPredicateDefsForScope(scope: AdaptableScope): AdaptablePredicateDef[];
95
+ /**
96
+ * Clears all Cells and Rows which have been flashed (primarily used if duration is 'Always')
97
+ */
98
+ clearGridFlashing(): void;
91
99
  }
@@ -291,7 +291,6 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
291
291
  }
292
292
  async getDistinctFilterDisplayValuesForColumn(columnId, filter, showFilteredRowsOnly) {
293
293
  const abColumn = this.getColumnFromId(columnId);
294
- console.log('getting for ', columnId);
295
294
  if (abColumn == undefined) {
296
295
  return {
297
296
  values: [],
@@ -176,7 +176,16 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
176
176
  if (!columnFilter.Predicate) {
177
177
  return true;
178
178
  }
179
- if ((_a = columnFilter.Predicate.Inputs) === null || _a === void 0 ? void 0 : _a.some((input) => StringExtensions_1.default.IsNullOrEmpty(input))) {
179
+ const someInputsAreEmpty = (_a = columnFilter.Predicate.Inputs) === null || _a === void 0 ? void 0 : _a.some((input) => {
180
+ if (typeof input === 'string') {
181
+ return StringExtensions_1.default.IsNullOrEmpty(input);
182
+ }
183
+ if (typeof input === 'number') {
184
+ return isNaN(input);
185
+ }
186
+ return !input;
187
+ });
188
+ if (someInputsAreEmpty) {
180
189
  return true;
181
190
  }
182
191
  const column = this.adaptable.api.columnApi.getColumnFromId(columnFilter.ColumnId);
@@ -21,4 +21,5 @@ export declare class FlashingCellApiImpl extends ApiBase implements FlashingCell
21
21
  editFlashingCellDefinitions(flashingCellDefinitions: FlashingCellDefinition[]): FlashingCellDefinition[];
22
22
  getFlashingCellPredicateDefs(): AdaptablePredicateDef[];
23
23
  getFlashingCellPredicateDefsForScope(scope: AdaptableScope): AdaptablePredicateDef[];
24
+ clearGridFlashing(): void;
24
25
  }
@@ -106,5 +106,9 @@ class FlashingCellApiImpl extends ApiBase_1.ApiBase {
106
106
  getFlashingCellPredicateDefsForScope(scope) {
107
107
  return this.getFlashingCellPredicateDefs().filter((predicateDef) => this.adaptable.api.scopeApi.isScopeInScope(scope, predicateDef.columnScope));
108
108
  }
109
+ clearGridFlashing() {
110
+ const currentFlashingCells = this.getAdaptableState().System.AdaptableFlashingCells;
111
+ this.dispatchAction(SystemRedux.SystemFlashingCellDeleteAll());
112
+ }
109
113
  }
110
114
  exports.FlashingCellApiImpl = FlashingCellApiImpl;
@@ -24,7 +24,7 @@ export interface SystemStatusApi {
24
24
  */
25
25
  setInfoSystemStatus(statusMessage: string, furtherInformation?: string): void;
26
26
  /**
27
- * Opens System Status popup
27
+ * Opens Settings Panel with System Status section selected and visible
28
28
  */
29
29
  showSystemStatusPopup(): void;
30
30
  /**
@@ -11,7 +11,7 @@ export interface ToolPanelApi {
11
11
  */
12
12
  getToolPanelState(): ToolPanelState;
13
13
  /**
14
- * Opens the Tool Panel popup
14
+ * Opens Settings Panel with Tool Panel section selected and visible
15
15
  */
16
16
  showToolPanelPopup(): void;
17
17
  /**
@@ -16,6 +16,7 @@ const isAfter_1 = tslib_1.__importDefault(require("date-fns/isAfter"));
16
16
  const isBefore_1 = tslib_1.__importDefault(require("date-fns/isBefore"));
17
17
  const isSameDay_1 = tslib_1.__importDefault(require("date-fns/isSameDay"));
18
18
  const CalendarHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/CalendarHelper"));
19
+ const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
19
20
  const DateHelper_1 = require("../../Utilities/Helpers/DateHelper");
20
21
  /**
21
22
  * Array of Predicate Defs which are shipped by AdapTable
@@ -143,7 +144,14 @@ exports.SystemPredicateDefs = [
143
144
  columnScope: { DataTypes: ['Number'] },
144
145
  moduleScope: ['filter', 'alert', 'flashingcell', 'conditionalstyle'],
145
146
  inputs: [{ type: 'number' }],
146
- handler: ({ value, inputs }) => Number(value) === Number(inputs[0]),
147
+ handler: ({ value, inputs }) => {
148
+ const input = inputs[0];
149
+ if ((typeof value === 'string' && !StringExtensions_1.default.IsNumeric(value)) ||
150
+ (typeof input === 'string' && !StringExtensions_1.default.IsNumeric(input))) {
151
+ return false;
152
+ }
153
+ return Number(value) === Number(inputs[0]);
154
+ },
147
155
  toString: ({ inputs }) => `= ${inputs[0]}`,
148
156
  shortcuts: ['='],
149
157
  },
@@ -397,7 +405,7 @@ exports.SystemPredicateDefs = [
397
405
  columnScope: { DataTypes: ['Date'] },
398
406
  moduleScope: ['filter', 'alert', 'flashingcell', 'conditionalstyle'],
399
407
  inputs: [{ type: 'date' }],
400
- handler: ({ value, inputs }) => isAfter_1.default(DateHelper_1.parseFilterValueDate(value), DateHelper_1.parseFilterInputDate(inputs[0])),
408
+ handler: ({ value, inputs }) => isAfter_1.default(DateHelper_1.parseDateValue(value), DateHelper_1.parseDateValue(inputs[0])),
401
409
  toString: ({ inputs }) => `> ${inputs[0]}`,
402
410
  },
403
411
  {
@@ -407,7 +415,7 @@ exports.SystemPredicateDefs = [
407
415
  columnScope: { DataTypes: ['Date'] },
408
416
  moduleScope: ['filter', 'alert', 'flashingcell', 'conditionalstyle'],
409
417
  inputs: [{ type: 'date' }],
410
- handler: ({ value, inputs }) => isBefore_1.default(DateHelper_1.parseFilterValueDate(value), DateHelper_1.parseFilterInputDate(inputs[0])),
418
+ handler: ({ value, inputs }) => isBefore_1.default(DateHelper_1.parseDateValue(value), DateHelper_1.parseDateValue(inputs[0])),
411
419
  toString: ({ inputs }) => `< ${inputs[0]}`,
412
420
  },
413
421
  {
@@ -417,7 +425,7 @@ exports.SystemPredicateDefs = [
417
425
  columnScope: { DataTypes: ['Date'] },
418
426
  moduleScope: ['filter', 'alert', 'flashingcell', 'conditionalstyle'],
419
427
  inputs: [{ type: 'date' }],
420
- handler: ({ value, inputs }) => isSameDay_1.default(DateHelper_1.parseFilterValueDate(value), DateHelper_1.parseFilterInputDate(inputs[0])),
428
+ handler: ({ value, inputs }) => isSameDay_1.default(DateHelper_1.parseDateValue(value), DateHelper_1.parseDateValue(inputs[0])),
421
429
  toString: ({ inputs }) => `= ${inputs[0]}`,
422
430
  },
423
431
  {
@@ -427,7 +435,7 @@ exports.SystemPredicateDefs = [
427
435
  columnScope: { DataTypes: ['Date'] },
428
436
  moduleScope: ['filter', 'alert', 'flashingcell', 'conditionalstyle'],
429
437
  inputs: [{ type: 'date' }],
430
- handler: ({ value, inputs }) => !isSameDay_1.default(DateHelper_1.parseFilterValueDate(value), DateHelper_1.parseFilterInputDate(inputs[0])),
438
+ handler: ({ value, inputs }) => !isSameDay_1.default(DateHelper_1.parseDateValue(value), DateHelper_1.parseDateValue(inputs[0])),
431
439
  toString: ({ inputs }) => `!= ${inputs[0]}`,
432
440
  },
433
441
  {
@@ -436,7 +444,7 @@ exports.SystemPredicateDefs = [
436
444
  icon: { name: 'calendar' },
437
445
  columnScope: { DataTypes: ['Date'] },
438
446
  moduleScope: ['filter', 'alert', 'flashingcell', 'conditionalstyle'],
439
- handler: ({ value, api }) => isSameDay_1.default(DateHelper_1.parseFilterValueDate(value), CalendarHelper_1.default.getNextWorkingDay()),
447
+ handler: ({ value, api }) => isSameDay_1.default(DateHelper_1.parseDateValue(value), CalendarHelper_1.default.getNextWorkingDay()),
440
448
  },
441
449
  {
442
450
  id: 'LastWorkDay',
@@ -8,32 +8,32 @@ export interface SpecialColumnSettings {
8
8
  Width?: number;
9
9
  /**
10
10
  * Whether Column is filterable
11
- * @defaultValue true
11
+ * @defaultValue false
12
12
  */
13
13
  Filterable?: boolean;
14
14
  /**
15
15
  * Whether Column can be resized (by dragging column header edges)
16
- * @defaultValue true
16
+ * @defaultValue false
17
17
  */
18
18
  Resizable?: boolean;
19
19
  /**
20
20
  * Whether Column can be grouped
21
- * @defaultValue true
21
+ * @defaultValue false
22
22
  */
23
23
  Groupable?: boolean;
24
24
  /**
25
25
  * Whether Column is sortable
26
- * @defaultValue true
26
+ * @defaultValue false
27
27
  */
28
28
  Sortable?: boolean;
29
29
  /**
30
30
  * Whether Column can be used when grid is in pivot mode
31
- * @defaultValue true
31
+ * @defaultValue false
32
32
  */
33
33
  Pivotable?: boolean;
34
34
  /**
35
35
  * Whether Column can be used in an aggregation when grouping
36
- * @defaultValue true
36
+ * @defaultValue false
37
37
  */
38
38
  Aggregatable?: boolean;
39
39
  /**
@@ -112,7 +112,6 @@ export interface SystemFlashingCellDeleteAction extends Redux.Action {
112
112
  flashingCell: AdaptableFlashingCell;
113
113
  }
114
114
  export interface SystemFlashingCellDeleteAllAction extends Redux.Action {
115
- flashingCells: AdaptableFlashingCell[];
116
115
  }
117
116
  export interface SystemStatusMessageInfoAddAction extends Redux.Action {
118
117
  systemStatusMessageInfo: SystemStatusMessageInfo;
@@ -241,7 +240,7 @@ export declare const SystemAlertRemoveCellHighlight: (alert: AdaptableAlert) =>
241
240
  export declare const SystemAlertRemoveRowHighlight: (alert: AdaptableAlert) => SystemAlertRemoveRowHighlightAction;
242
241
  export declare const SystemFlashingCellAdd: (flashingCell: AdaptableFlashingCell) => SystemFlashingCellAddAction;
243
242
  export declare const SystemFlashingCellDelete: (flashingCell: AdaptableFlashingCell) => SystemFlashingCellDeleteAction;
244
- export declare const SystemFlashingCellDeleteAll: (flashingCells: AdaptableFlashingCell[]) => SystemFlashingCellDeleteAllAction;
243
+ export declare const SystemFlashingCellDeleteAll: () => SystemFlashingCellDeleteAllAction;
245
244
  export declare const SystemStatusMessageInfoAdd: (SystemStatusMessageInfo: SystemStatusMessageInfo, MaxSystemStatusMessagesInStore: number) => SystemStatusMessageInfoAddAction;
246
245
  export declare const SystemStatusMessageInfoDelete: (SystemStatusMessageInfo: SystemStatusMessageInfo) => SystemStatusMessageInfoDeleteAction;
247
246
  export declare const SystemStatusMessageInfoDeleteAll: () => SystemStatusMessageInfoDeleteAllAction;
@@ -154,9 +154,8 @@ const SystemFlashingCellDelete = (flashingCell) => ({
154
154
  flashingCell: flashingCell,
155
155
  });
156
156
  exports.SystemFlashingCellDelete = SystemFlashingCellDelete;
157
- const SystemFlashingCellDeleteAll = (flashingCells) => ({
157
+ const SystemFlashingCellDeleteAll = () => ({
158
158
  type: exports.SYSTEM_FLASHING_CELL_DELETE_ALL,
159
- flashingCells: flashingCells,
160
159
  });
161
160
  exports.SystemFlashingCellDeleteAll = SystemFlashingCellDeleteAll;
162
161
  const SystemStatusMessageInfoAdd = (SystemStatusMessageInfo, MaxSystemStatusMessagesInStore) => ({
@@ -354,6 +354,11 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
354
354
  }
355
355
  return ret;
356
356
  }
357
+ case SystemRedux.SYSTEM_FLASHING_CELL_DELETE_ALL: {
358
+ let ret = next(action);
359
+ adaptable.redrawRenderedRows();
360
+ return ret;
361
+ }
357
362
  /*******************
358
363
  * ALERT ACTIONS
359
364
  *******************/
@@ -95,10 +95,10 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
95
95
  const flashingCellForRow = this.api.internalApi.getAdaptableFlashingCellFor(menuContext.primaryKeyValue);
96
96
  const flashingCellForCell = this.api.internalApi.getAdaptableFlashingCellFor(menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
97
97
  if (flashingCellForRow && flashingCellForRow.flashTarget === 'row') {
98
- items.push(this.createColumnMenuItemReduxAction('Clear Flashing Cell for Row', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForRow)));
98
+ items.push(this.createColumnMenuItemReduxAction('Clear Flashing Row', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForRow)));
99
99
  }
100
100
  else if (flashingCellForCell && flashingCellForCell.flashTarget === 'cell') {
101
- items.push(this.createColumnMenuItemReduxAction('Clear Flashing Cell for Cell', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForCell)));
101
+ items.push(this.createColumnMenuItemReduxAction('Clear Flashing Cell', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForCell)));
102
102
  }
103
103
  }
104
104
  }
@@ -298,7 +298,7 @@ function getNextWorkingDay(days = 1) {
298
298
  let counterDate = new Date();
299
299
  while (count < days) {
300
300
  counterDate.setDate(counterDate.getDate() + 1);
301
- if (this.isNotWorkingDay(counterDate)) {
301
+ if (isNotWorkingDay(counterDate)) {
302
302
  count++;
303
303
  }
304
304
  }
@@ -310,7 +310,7 @@ function getPreviousWorkingDay(days = 1) {
310
310
  let counterDate = new Date();
311
311
  while (count < days) {
312
312
  counterDate.setDate(counterDate.getDate() - 1);
313
- if (this.isNotWorkingDay(counterDate)) {
313
+ if (isNotWorkingDay(counterDate)) {
314
314
  count++;
315
315
  }
316
316
  }
@@ -319,14 +319,17 @@ function getPreviousWorkingDay(days = 1) {
319
319
  exports.getPreviousWorkingDay = getPreviousWorkingDay;
320
320
  // pretty sure this can be improved as pretty expensive - though rarely used to be honest
321
321
  function isNotWorkingDay(dateToCheck) {
322
- let currentCalendar = this.getGeneralOptions().currentCalendar;
322
+ /*
323
+ // Removing lookups to current calendar until we decide what to do
324
+ let currentCalendar: string = this.getGeneralOptions().currentCalendar;
323
325
  let currentHoliday = getAvailableCalendars().find((c) => c.Name == currentCalendar);
324
326
  for (let holiday of currentHoliday.CalendarEntries) {
325
- let holidayDate = new Date(holiday.HolidayDate);
326
- if (holidayDate.setHours(0, 0, 0, 0) == dateToCheck.setHours(0, 0, 0, 0)) {
327
- return false;
328
- }
327
+ let holidayDate = new Date(holiday.HolidayDate);
328
+ if (holidayDate.setHours(0, 0, 0, 0) == dateToCheck.setHours(0, 0, 0, 0)) {
329
+ return false;
330
+ }
329
331
  }
332
+ */
330
333
  return dateToCheck.getDay() != 0 && dateToCheck.getDay() != 6;
331
334
  }
332
335
  exports.isNotWorkingDay = isNotWorkingDay;
@@ -8,30 +8,4 @@ export declare const isValueValidDate: (data: any) => boolean;
8
8
  export declare const dateToISO: (date: Date | number | string) => string;
9
9
  export declare const parseToISO: (date: string | Date | number, dateFormat?: string) => string;
10
10
  export declare const parseDateValue: (dateValue: string | Date | number, dateFormat?: string) => Date | undefined;
11
- /**
12
- * Creates a date with the same day/month/year/hour with the current timezone.
13
- * '2022-06-01T17:00:00.000Z' => '2022-06-01T17:00:00.000+03:00' // RO time
14
- *
15
- * new Date() always creates the date using the current timezone.
16
- * To compare two dates, they need to be in the same timezone.
17
- *
18
- * @param date Date
19
- */
20
- export declare const utcDateToSameDateInLocale: (date: Date) => Date;
21
- /**
22
- * To make sure selected/input date is correct and in the current time-zone.
23
-
24
- *
25
- * '2022-06-14' is considered to be '2022-06-13 00:00:00.
26
- * And when date object is created it uses the current timezone.
27
- *
28
- * '2022-06-14' => Mon Jun 13 2022 20:00:00 GMT-0400 (Eastern Daylight Time)
29
- *
30
- * @param stringDate date string
31
- */
32
11
  export declare const parseFilterInputDate: (stringDate: string) => Date;
33
- /**
34
- * Used to parse the date from rowDate inside date predicates.
35
- * The date is parsed in moved to local timezone.
36
- */
37
- export declare const parseFilterValueDate: (value: any) => Date;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseFilterValueDate = exports.parseFilterInputDate = exports.utcDateToSameDateInLocale = exports.parseDateValue = exports.parseToISO = exports.dateToISO = exports.isValueValidDate = exports.isValidDate = void 0;
3
+ exports.parseFilterInputDate = exports.parseDateValue = exports.parseToISO = exports.dateToISO = exports.isValueValidDate = exports.isValidDate = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const parseISO_1 = tslib_1.__importDefault(require("date-fns/parseISO"));
6
6
  const parse_1 = tslib_1.__importDefault(require("date-fns/parse"));
@@ -63,35 +63,5 @@ const parseDateValue = (dateValue, dateFormat) => {
63
63
  return dateInstance;
64
64
  };
65
65
  exports.parseDateValue = parseDateValue;
66
- /**
67
- * Creates a date with the same day/month/year/hour with the current timezone.
68
- * '2022-06-01T17:00:00.000Z' => '2022-06-01T17:00:00.000+03:00' // RO time
69
- *
70
- * new Date() always creates the date using the current timezone.
71
- * To compare two dates, they need to be in the same timezone.
72
- *
73
- * @param date Date
74
- */
75
- const utcDateToSameDateInLocale = (date) => {
76
- return new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000);
77
- };
78
- exports.utcDateToSameDateInLocale = utcDateToSameDateInLocale;
79
- /**
80
- * To make sure selected/input date is correct and in the current time-zone.
81
-
82
- *
83
- * '2022-06-14' is considered to be '2022-06-13 00:00:00.
84
- * And when date object is created it uses the current timezone.
85
- *
86
- * '2022-06-14' => Mon Jun 13 2022 20:00:00 GMT-0400 (Eastern Daylight Time)
87
- *
88
- * @param stringDate date string
89
- */
90
- const parseFilterInputDate = (stringDate) => exports.utcDateToSameDateInLocale(new Date(stringDate));
66
+ const parseFilterInputDate = (stringDate) => new Date(stringDate);
91
67
  exports.parseFilterInputDate = parseFilterInputDate;
92
- /**
93
- * Used to parse the date from rowDate inside date predicates.
94
- * The date is parsed in moved to local timezone.
95
- */
96
- const parseFilterValueDate = (value) => exports.utcDateToSameDateInLocale(exports.parseDateValue(value));
97
- exports.parseFilterValueDate = parseFilterValueDate;
@@ -29,7 +29,7 @@ import { RowNode } from '@ag-grid-community/all-modules';
29
29
  import { AdaptableApi } from '../../types';
30
30
  import { ToastOptions } from '../components/Toastify';
31
31
  export declare function CreateEmptyCustomSort(): CustomSort;
32
- export declare function CreateEmptyCalculatedColumn(isFilterable: boolean): CalculatedColumn;
32
+ export declare function CreateEmptyCalculatedColumn(): CalculatedColumn;
33
33
  export declare function CreateEmptyNamedQuery(expression?: string): NamedQuery;
34
34
  export declare function CreateEmptyPlusMinusNudge(): PlusMinusNudge;
35
35
  export declare function CreateGenericAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition): AdaptableGenericAlert;
@@ -55,7 +55,7 @@ export declare function CreateEmptySchedule(): Schedule;
55
55
  export declare function CreateEmptyShortcut(): Shortcut;
56
56
  export declare function CreateEmptyConditionalStyle(): ConditionalStyle;
57
57
  export declare function CreateEmptyFormatColumn(): FormatColumn;
58
- export declare function CreateEmptyFreeTextColumn(isFilterable: boolean): FreeTextColumn;
58
+ export declare function CreateEmptyFreeTextColumn(): FreeTextColumn;
59
59
  export declare function CreateEmptyLayout(layout?: Partial<Layout> & {
60
60
  Name: string;
61
61
  }, adaptableColumns?: AdaptableColumn[]): Layout;
@@ -9,7 +9,7 @@ function CreateEmptyCustomSort() {
9
9
  return { Uuid: Uuid_1.createUuid(), ColumnId: GeneralConstants_1.EMPTY_STRING, SortedValues: [] };
10
10
  }
11
11
  exports.CreateEmptyCustomSort = CreateEmptyCustomSort;
12
- function CreateEmptyCalculatedColumn(isFilterable) {
12
+ function CreateEmptyCalculatedColumn() {
13
13
  return {
14
14
  Uuid: Uuid_1.createUuid(),
15
15
  ColumnId: GeneralConstants_1.EMPTY_STRING,
@@ -18,12 +18,12 @@ function CreateEmptyCalculatedColumn(isFilterable) {
18
18
  },
19
19
  // need to create some defaults - which we will change later
20
20
  CalculatedColumnSettings: {
21
- Filterable: isFilterable,
22
- Resizable: true,
23
- Groupable: true,
24
- Sortable: true,
25
- Pivotable: true,
26
- Aggregatable: true,
21
+ Filterable: false,
22
+ Resizable: false,
23
+ Groupable: false,
24
+ Sortable: false,
25
+ Pivotable: false,
26
+ Aggregatable: false,
27
27
  SuppressMenu: false,
28
28
  SuppressMovable: false,
29
29
  },
@@ -283,7 +283,7 @@ function CreateEmptyFormatColumn() {
283
283
  };
284
284
  }
285
285
  exports.CreateEmptyFormatColumn = CreateEmptyFormatColumn;
286
- function CreateEmptyFreeTextColumn(isFilterable) {
286
+ function CreateEmptyFreeTextColumn() {
287
287
  return {
288
288
  Uuid: Uuid_1.createUuid(),
289
289
  ColumnId: GeneralConstants_1.EMPTY_STRING,
@@ -292,12 +292,12 @@ function CreateEmptyFreeTextColumn(isFilterable) {
292
292
  TextEditor: 'Inline',
293
293
  DataType: 'String',
294
294
  FreeTextColumnSettings: {
295
- Filterable: isFilterable,
296
- Resizable: true,
297
- Groupable: true,
298
- Sortable: true,
299
- Pivotable: true,
300
- Aggregatable: true,
295
+ Filterable: false,
296
+ Resizable: false,
297
+ Groupable: false,
298
+ Sortable: false,
299
+ Pivotable: false,
300
+ Aggregatable: false,
301
301
  SuppressMenu: false,
302
302
  SuppressMovable: false,
303
303
  },
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCalculatedColumnSettingTags = void 0;
4
4
  const getCalculatedColumnSettingTags = (settings) => {
5
5
  const { DataType, Width, Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable } = settings !== null && settings !== void 0 ? settings : {};
6
+ const colTypes = (settings === null || settings === void 0 ? void 0 : settings.ColumnTypes) ? settings.ColumnTypes.join(', ') : '';
6
7
  return [
7
8
  DataType ? `DataType: ${DataType}` : null,
8
9
  Width ? `Width: ${Width}px` : null,
@@ -12,6 +13,7 @@ const getCalculatedColumnSettingTags = (settings) => {
12
13
  Groupable ? 'Groupable' : null,
13
14
  Sortable ? 'Sortable' : null,
14
15
  Aggregatable ? 'Aggregatable' : null,
16
+ colTypes ? `Column Types: ${colTypes}` : null,
15
17
  ].filter(Boolean);
16
18
  };
17
19
  exports.getCalculatedColumnSettingTags = getCalculatedColumnSettingTags;
@@ -66,10 +66,7 @@ const CalculatedColumnExpressionWizardSection = (props) => {
66
66
  const setCalculatedColumnExpression = (calculatedColumnQuery) => {
67
67
  const calculatedColumnExpressionService = api.internalApi.getCalculatedColumnExpressionService();
68
68
  const dataType = calculatedColumnExpressionService.getCalculatedColumnDataType(calculatedColumnQuery);
69
- const Pivotable = dataType == 'String';
70
- const Aggregatable = dataType == 'Number';
71
- props.onChange(Object.assign(Object.assign({}, data), { Query: calculatedColumnQuery, CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType, Pivotable,
72
- Aggregatable }) }));
69
+ props.onChange(Object.assign(Object.assign({}, data), { Query: calculatedColumnQuery, CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType }) }));
73
70
  };
74
71
  return (React.createElement(Tabs_1.Tabs, { onValueChange: setType, value: selectedTab, p: 2, style: { height: '100%', flex: 1, overflow: 'auto' } },
75
72
  React.createElement(QueryTab, { value: "ScalarExpression", type: type, label: "Scalar" }),
@@ -37,7 +37,7 @@ const isValidCalculatedColumnSettings = (data, api) => {
37
37
  return 'Column Id cannot be empty';
38
38
  }
39
39
  if (!((_a = data.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.DataType)) {
40
- return 'No data type specified for column';
40
+ return 'No data type is specified and it could not be inferred from the defined expression';
41
41
  }
42
42
  const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
43
43
  const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
@@ -29,7 +29,7 @@ const CalculatedColumnWizard = (props) => {
29
29
  return calculatedColumn;
30
30
  }
31
31
  }
32
- return ObjectFactory_1.default.CreateEmptyCalculatedColumn(adaptable.api.internalApi.getAdaptableOptions().filterOptions.enableFilterOnSpecialColumns);
32
+ return ObjectFactory_1.default.CreateEmptyCalculatedColumn();
33
33
  });
34
34
  const dispatch = react_redux_1.useDispatch();
35
35
  const isEdit = Boolean(props.data) || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
@@ -43,15 +43,6 @@ const CalculatedColumnWizard = (props) => {
43
43
  props.onCloseWizard();
44
44
  };
45
45
  return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: calculatedColumn, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
46
- {
47
- title: 'Expression',
48
- details: 'Specify the Calculated Column Expression',
49
- isValid: CalculatedColumnExpressionWizardSection_1.isValidCalculatedColumnExpression,
50
- renderSummary: CalculatedColumnExpressionWizardSection_1.renderCalculatedColumnExpressionSummary,
51
- render: () => {
52
- return React.createElement(CalculatedColumnExpressionWizardSection_1.CalculatedColumnExpressionWizardSection, { onChange: setCalculatedColumn });
53
- },
54
- },
55
46
  {
56
47
  title: 'Settings',
57
48
  details: 'Specify Column details and properties',
@@ -62,6 +53,15 @@ const CalculatedColumnWizard = (props) => {
62
53
  React.createElement(CalculatedColumnSettingsWizardSection_1.CalculatedColumnSettingsWizardSection, { isEdit: isEdit, onChange: setCalculatedColumn })));
63
54
  },
64
55
  },
56
+ {
57
+ title: 'Expression',
58
+ details: 'Specify the Calculated Column Expression',
59
+ isValid: CalculatedColumnExpressionWizardSection_1.isValidCalculatedColumnExpression,
60
+ renderSummary: CalculatedColumnExpressionWizardSection_1.renderCalculatedColumnExpressionSummary,
61
+ render: () => {
62
+ return React.createElement(CalculatedColumnExpressionWizardSection_1.CalculatedColumnExpressionWizardSection, { onChange: setCalculatedColumn });
63
+ },
64
+ },
65
65
  {
66
66
  details: 'Select Calculated Column tags',
67
67
  title: 'Tags',
@@ -21,7 +21,7 @@ const AdaptableDateInput = React.forwardRef((props, ref) => {
21
21
  });
22
22
  },
23
23
  });
24
- const dateValue = DateHelper_1.parseFilterInputDate(value);
24
+ const dateValue = value ? DateHelper_1.parseDateValue(value) : null;
25
25
  const datepickerProps = Object.assign({
26
26
  // this is OK as long as we do not support range datepicker
27
27
  value: dateValue, onChange: (dateValue) => { var _a;
@@ -49,8 +49,7 @@ class FreeTextColumnSummaryComponent extends React.Component {
49
49
  this.state.editedAdaptableObject && (React.createElement(FreeTextColumnWizard_1.FreeTextColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FreeTextColumns, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard }))));
50
50
  }
51
51
  onNew() {
52
- const specialColumnsAreFilterable = this.props.api.internalApi.getAdaptableOptions().filterOptions.enableFilterOnSpecialColumns;
53
- let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(specialColumnsAreFilterable);
52
+ let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn();
54
53
  configEntity.ColumnId = this.props.summarisedColumn.columnId;
55
54
  this.setState({
56
55
  editedAdaptableObject: configEntity,
@@ -2,7 +2,7 @@
2
2
  import { FreeTextColumn } from '../../../PredefinedConfig/FreeTextColumnState';
3
3
  import { AdaptableApi } from '../../../Api/AdaptableApi';
4
4
  export declare const renderFreeTextColumnSummary: (data: FreeTextColumn) => JSX.Element;
5
- export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "Column Id cannot be empty" | "No data type specified for column" | "A Column already exists with that id";
5
+ export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "Column Id cannot be empty" | "A Column already exists with that id" | "No data type specified for column";
6
6
  export declare type FreeTextColumnSettingsWizardSectionProps = {
7
7
  onChange: (data: FreeTextColumn) => void;
8
8
  isEdit: boolean;
@@ -23,7 +23,7 @@ const FreeTextColumnWizard = (props) => {
23
23
  if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
24
24
  return allFreeTextColumns.find((column) => column.ColumnId === props.popupParams.column.columnId);
25
25
  }
26
- return ObjectFactory_1.default.CreateEmptyFreeTextColumn(false);
26
+ return ObjectFactory_1.default.CreateEmptyFreeTextColumn();
27
27
  });
28
28
  const dispatch = react_redux_1.useDispatch();
29
29
  const isEdit = props.data || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
@@ -210,6 +210,7 @@ export declare class Adaptable implements IAdaptable {
210
210
  selectCells(columnIds: string[], startNode: RowNode, endNode: RowNode): void;
211
211
  isRowNodeVisible(rowNode: RowNode): boolean;
212
212
  redrawBody(): void;
213
+ redrawRenderedRows(): void;
213
214
  redrawHeader(): void;
214
215
  redrawRow(rowNode: RowNode): void;
215
216
  redrawRows(rowNodes: RowNode[]): void;