@adaptabletools/adaptable 11.0.2 → 11.0.5

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 (44) hide show
  1. package/bundle.cjs.js +75 -72
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -0
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  7. package/src/AdaptableOptions/FilterOptions.d.ts +4 -1
  8. package/src/Api/CellSummaryApi.d.ts +4 -0
  9. package/src/Api/GridApi.d.ts +4 -0
  10. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +2 -0
  11. package/src/Api/Implementation/CellSummaryApiImpl.js +4 -0
  12. package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
  13. package/src/Api/Implementation/GridApiImpl.js +7 -0
  14. package/src/PredefinedConfig/Common/AdaptableMessageType.d.ts +2 -2
  15. package/src/PredefinedConfig/Selection/GridCell.d.ts +1 -1
  16. package/src/Strategy/AlertModule.js +1 -1
  17. package/src/Strategy/CellSummaryModule.js +4 -0
  18. package/src/Strategy/ConditionalStyleModule.js +1 -1
  19. package/src/Strategy/FlashingCellModule.js +1 -1
  20. package/src/Strategy/FormatColumnModule.js +4 -4
  21. package/src/Strategy/PlusMinusModule.js +1 -1
  22. package/src/Strategy/ShortcutModule.js +1 -1
  23. package/src/Strategy/Utilities/getExportColumnsViewItems.js +0 -13
  24. package/src/Strategy/Utilities/getScopeViewItems.d.ts +2 -2
  25. package/src/Strategy/Utilities/getScopeViewItems.js +3 -2
  26. package/src/Utilities/Services/LicenseService.js +1 -159
  27. package/src/Utilities/license/decode.js +1 -67
  28. package/src/Utilities/license/hashing.js +1 -47
  29. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +1 -1
  30. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -0
  31. package/src/View/License/LicenseWatermark.js +1 -65
  32. package/src/agGrid/Adaptable.d.ts +2 -0
  33. package/src/agGrid/Adaptable.js +24 -3
  34. package/src/agGrid/CheckboxRenderer.d.ts +2 -0
  35. package/src/agGrid/CheckboxRenderer.js +37 -4
  36. package/src/agGrid/PercentBarRenderer.d.ts +3 -0
  37. package/src/agGrid/PercentBarRenderer.js +83 -0
  38. package/src/agGrid/agGridHelper.d.ts +1 -1
  39. package/src/agGrid/agGridHelper.js +3 -74
  40. package/src/metamodel/adaptable.metamodel.d.ts +5 -9
  41. package/src/metamodel/adaptable.metamodel.js +22 -3
  42. package/src/types.d.ts +1 -0
  43. package/version.d.ts +1 -1
  44. package/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "11.0.2",
3
+ "version": "11.0.5",
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: 1646406406997;
1
+ declare const _default: 1647181545760;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1646406406997;
3
+ exports.default = 1647181545760;
@@ -12,6 +12,7 @@ export interface AdaptableNoCodeWizardOptions {
12
12
  defaultActionMessage?: React.ReactNode;
13
13
  dragOverActionMessage?: React.ReactNode;
14
14
  fetchData?: () => Promise<any>;
15
+ showFetchDataWizard?: boolean;
15
16
  helpText?: React.ReactNode;
16
17
  fileContentsToJSON?: (str: string) => Promise<any> | any;
17
18
  readFile?: (file: File) => Promise<any>;
@@ -167,6 +167,7 @@ export interface IAdaptable {
167
167
  cancelEdit(): any;
168
168
  isCellEditable(rowNode: RowNode, column: Column): boolean;
169
169
  getFirstRowNode(): RowNode;
170
+ getFirstDisplayedRowNode(): RowNode;
170
171
  forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
171
172
  forAllVisibleRowNodesDo(func: (rowNode: RowNode) => void): void;
172
173
  getVisibleRowNodes(): RowNode[];
@@ -66,7 +66,10 @@ export interface FilterOptions {
66
66
  */
67
67
  quickFilterValuesTrigger?: 'mouseenter' | 'click';
68
68
  /**
69
- * TODO: add comment
69
+ * Sets a height for Quick Filter Bar (if not provided AG Grid's default is used)
70
+ *
71
+ * @defaultValue null
72
+ * @gridInfoItem
70
73
  */
71
74
  quickFilterHeight?: number;
72
75
  /**
@@ -7,6 +7,10 @@ export interface CellSummaryApi {
7
7
  * Retrieves currently selected Cell Summary Operation
8
8
  */
9
9
  getCurrentCellSummaryOperation(): CellSummaryOperation | string;
10
+ /**
11
+ * Sets the currently selected Cell Summary Operation
12
+ */
13
+ setCurrentCellSummaryOperation(operation: CellSummaryOperation | string): void;
10
14
  /**
11
15
  * Retrieves all Cell Summary Definitions from Cell Summary State
12
16
  */
@@ -191,6 +191,10 @@ export interface GridApi {
191
191
  * Retrieves the first Row Node in AdapTable
192
192
  */
193
193
  getFirstRowNode(): RowNode;
194
+ /**
195
+ * Retrieves the first Displayed Row Node in AdapTable
196
+ */
197
+ getFirstDisplayedRowNode(): RowNode;
194
198
  /**
195
199
  * Retrieves all Row Nodes currently in the Grid (i.e. filtered)
196
200
  */
@@ -1,8 +1,10 @@
1
1
  import { ApiBase } from './ApiBase';
2
2
  import { CellSummaryApi } from '../CellSummaryApi';
3
3
  import { CellSummaryOperation } from '../../PredefinedConfig/Common/CellSummary';
4
+ import { SummaryOperation } from '../../PredefinedConfig/Common/Enums';
4
5
  export declare class CellSummaryApiImpl extends ApiBase implements CellSummaryApi {
5
6
  getCurrentCellSummaryOperation(): CellSummaryOperation | string;
6
7
  getCellSummaryOperationDefinitions(): CellSummaryOperation[];
7
8
  showCellSummaryPopup(): void;
9
+ setCurrentCellSummaryOperation(operation: SummaryOperation | string): void;
8
10
  }
@@ -4,6 +4,7 @@ exports.CellSummaryApiImpl = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
7
+ const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
7
8
  class CellSummaryApiImpl extends ApiBase_1.ApiBase {
8
9
  getCurrentCellSummaryOperation() {
9
10
  return this.getAdaptableState().System.CellSummaryOperation;
@@ -14,5 +15,8 @@ class CellSummaryApiImpl extends ApiBase_1.ApiBase {
14
15
  showCellSummaryPopup() {
15
16
  this.showModulePopup(ModuleConstants.CellSummaryModuleId);
16
17
  }
18
+ setCurrentCellSummaryOperation(operation) {
19
+ this.dispatchAction(SystemRedux.SystemCellSummaryChangeOperation(operation));
20
+ }
17
21
  }
18
22
  exports.CellSummaryApiImpl = CellSummaryApiImpl;
@@ -54,6 +54,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
54
54
  selectColumn(columnId: string): void;
55
55
  selectColumns(columnIds: string[]): void;
56
56
  getFirstRowNode(): RowNode;
57
+ getFirstDisplayedRowNode(): RowNode;
57
58
  getVisibleRowNodes(): RowNode[];
58
59
  getGridCellFromRowNode(rowwNode: RowNode, columnId: string): GridCell | undefined;
59
60
  getRawValueFromRowNode(rowwNode: RowNode, columnId: string): any | undefined;
@@ -187,6 +187,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
187
187
  getFirstRowNode() {
188
188
  return this.adaptable.getFirstRowNode();
189
189
  }
190
+ getFirstDisplayedRowNode() {
191
+ return this.adaptable.getFirstDisplayedRowNode();
192
+ }
190
193
  getVisibleRowNodes() {
191
194
  return this.adaptable.getVisibleRowNodes();
192
195
  }
@@ -341,6 +344,10 @@ class GridApiImpl extends ApiBase_1.ApiBase {
341
344
  }
342
345
  areCellsEditable(gridCells) {
343
346
  for (let gridCell of gridCells) {
347
+ if (!gridCell.column) {
348
+ // GridCell.column may be undefined for cells from synthetic columns created by AG Grid (ex. autoGroup columns)
349
+ return false;
350
+ }
344
351
  if (gridCell.column.readOnly) {
345
352
  return false;
346
353
  }
@@ -7,11 +7,11 @@ export declare type AdaptableMessageType =
7
7
  */
8
8
  'Success'
9
9
  /**
10
- * A success message - shows in blue
10
+ * An info message - shows in blue
11
11
  */
12
12
  | 'Info'
13
13
  /**
14
- * A success message - shows in yellow
14
+ * A warning message - shows in orange
15
15
  */
16
16
  | 'Warning'
17
17
  /**
@@ -5,7 +5,7 @@ import { AdaptableColumn } from '../Common/AdaptableColumn';
5
5
  */
6
6
  export interface GridCell {
7
7
  /**
8
- * Column in which cell is situtated
8
+ * Column in which cell is situated
9
9
  */
10
10
  column: AdaptableColumn;
11
11
  /**
@@ -178,7 +178,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
178
178
  toView(alert) {
179
179
  return {
180
180
  items: [
181
- getScopeViewItems_1.getScopeViewItems(alert.Scope),
181
+ getScopeViewItems_1.getScopeViewItems(alert.Scope, this.api),
182
182
  getRuleViewItems_1.getRuleViewItems(alert.Rule, this.api),
183
183
  getAlertBehaviourViewItems_1.getAlertBehaviourViewItems(),
184
184
  getAlertPreviewViewItems_1.getAlertPreviewViewItems(alert, this.api),
@@ -45,6 +45,10 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
45
45
  selectedCellInfo.gridCells.forEach((selectedCell) => {
46
46
  let value = selectedCell.rawValue;
47
47
  allValues.push(value);
48
+ if (!selectedCell.column) {
49
+ // GridCell.column may be undefined for cells from synthetic columns created by AG Grid (ex. autoGroup columns)
50
+ return;
51
+ }
48
52
  if (ArrayExtensions_1.ArrayExtensions.ContainsItem(numericColumns, selectedCell.column.columnId)) {
49
53
  let valueAsNumber = Number(value);
50
54
  // possible that its not a number despite it being a numeric column
@@ -188,7 +188,7 @@ class ConditionalStyleModule extends AdaptableModuleBase_1.AdaptableModuleBase {
188
188
  toView(conditionalStyle) {
189
189
  return {
190
190
  items: [
191
- getScopeViewItems_1.getScopeViewItems(conditionalStyle.Scope),
191
+ getScopeViewItems_1.getScopeViewItems(conditionalStyle.Scope, this.api),
192
192
  getStyleViewItems_1.getStyleViewItems(),
193
193
  getRuleViewItems_1.getRuleViewItems(conditionalStyle.Rule, this.api),
194
194
  {
@@ -209,7 +209,7 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
209
209
  toView(flashingCell) {
210
210
  return {
211
211
  items: [
212
- Object.assign(Object.assign({}, getScopeViewItems_1.getScopeViewItems(flashingCell.Scope)), { label: 'Trigger' }),
212
+ Object.assign(Object.assign({}, getScopeViewItems_1.getScopeViewItems(flashingCell.Scope, this.api)), { label: 'Trigger' }),
213
213
  Object.assign(Object.assign({}, getRuleViewItems_1.getRuleViewItems(flashingCell.Rule, this.api)), { label: 'Rule', name: 'Rule' }),
214
214
  getFlashingCellDurationViewItems_1.getFlashingCellDurationViewItems(flashingCell),
215
215
  getFlashingTargetViewItems_1.getFlashingTargetViewItems(flashingCell),
@@ -19,7 +19,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
19
19
  * Use Case: Data (cell/row) has changed
20
20
  * Action: Any CheckboxFormatColumns need to be updated, as their disabled state may have changed
21
21
  */
22
- this.api.internalApi.getDataService().on('DataChanged', () => {
22
+ this.api.internalApi.getDataService().on('DataChanged', (dataChangedInfo) => {
23
23
  const activeCheckboxColumnIds = this.api.columnApi
24
24
  .getColumns()
25
25
  .filter((aColumn) => {
@@ -27,8 +27,8 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
27
27
  return checkboxFormatColumn && !checkboxFormatColumn.IsSuspended;
28
28
  })
29
29
  .map((aColumn) => aColumn.columnId);
30
- if (activeCheckboxColumnIds.length) {
31
- console.log('update ', activeCheckboxColumnIds);
30
+ // no need to refresh the CheckboxColumns if the change was triggered by one of them
31
+ if (!activeCheckboxColumnIds.includes(dataChangedInfo.column.columnId)) {
32
32
  this.api.internalApi
33
33
  .getAdaptableInstance()
34
34
  .refreshCells(null, activeCheckboxColumnIds, true, true);
@@ -237,7 +237,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
237
237
  return {
238
238
  abObject: formatColumn,
239
239
  items: [
240
- getScopeViewItems_1.getScopeViewItems(formatColumn.Scope),
240
+ getScopeViewItems_1.getScopeViewItems(formatColumn.Scope, this.api),
241
241
  {
242
242
  name: 'Style',
243
243
  view: () => getFormatColumnStyleViewItems_1.getFormatColumnStyleViewItems(formatColumn, this.api),
@@ -186,7 +186,7 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
186
186
  return {
187
187
  abObject: plusMinus,
188
188
  items: [
189
- Object.assign({ name: 'Target' }, getScopeViewItems_1.getScopeViewItems(plusMinus.Scope)),
189
+ Object.assign({ name: 'Target' }, getScopeViewItems_1.getScopeViewItems(plusMinus.Scope, this.api)),
190
190
  plusMinus.Rule && {
191
191
  name: 'Settings',
192
192
  label: 'Rule',
@@ -74,7 +74,7 @@ class ShortcutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
74
74
  toView(shortcut) {
75
75
  return {
76
76
  abObject: shortcut,
77
- items: [getScopeViewItems_1.getScopeViewItems(shortcut.Scope), getShortcutSettingsViewItems_1.getShortcutSettingsViewItems(shortcut)],
77
+ items: [getScopeViewItems_1.getScopeViewItems(shortcut.Scope, this.api), getShortcutSettingsViewItems_1.getShortcutSettingsViewItems(shortcut)],
78
78
  };
79
79
  }
80
80
  toViewAll() {
@@ -1,19 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExportColumnsViewItems = void 0;
4
- const getScopeViewItems_1 = require("./getScopeViewItems");
5
- const getValues = (report) => {
6
- switch (report.ReportColumnScope) {
7
- case 'AllColumns':
8
- return ['All Columns'];
9
- case 'VisibleColumns':
10
- return ['Visible Columns'];
11
- case 'ScopeColumns':
12
- return getScopeViewItems_1.getScopeViewItems(report.Scope).values;
13
- default:
14
- return [''];
15
- }
16
- };
17
4
  exports.getExportColumnsViewItems = (report, api) => {
18
5
  return {
19
6
  name: 'Columns',
@@ -1,3 +1,3 @@
1
- import { AdaptableScope } from '../../../types';
1
+ import { AdaptableApi, AdaptableScope } from '../../../types';
2
2
  import { AdaptableObjectItemView } from '../Interface/IModule';
3
- export declare const getScopeViewItems: (scope: AdaptableScope) => AdaptableObjectItemView;
3
+ export declare const getScopeViewItems: (scope: AdaptableScope, api: AdaptableApi) => AdaptableObjectItemView;
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getScopeViewItems = void 0;
4
- exports.getScopeViewItems = (scope) => {
4
+ exports.getScopeViewItems = (scope, api) => {
5
5
  let values = [];
6
- if ('ColumnIds' in scope) {
6
+ if ('ColumnIds' in scope && Array.isArray(scope.ColumnIds)) {
7
7
  values = scope.ColumnIds;
8
+ values = scope.ColumnIds.map((columnId) => api.columnApi.getFriendlyNameFromColumnId(columnId)).filter(Boolean);
8
9
  }
9
10
  if ('DataTypes' in scope) {
10
11
  values = scope.DataTypes;
@@ -1,159 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LicenseService = exports.LicenseValidityType = void 0;
4
- const tslib_1 = require("tslib");
5
- const SystemRedux_1 = require("../../Redux/ActionsReducers/SystemRedux");
6
- const PopupRedux_1 = require("../../Redux/ActionsReducers/PopupRedux");
7
- const ObjectFactory_1 = tslib_1.__importDefault(require("../ObjectFactory"));
8
- const LoggingHelper_1 = require("../Helpers/LoggingHelper");
9
- const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
10
- const DocumentationLinkConstants_1 = require("../Constants/DocumentationLinkConstants");
11
- const decode_1 = require("../license/decode");
12
- const EMAIL = 'sales@adaptabletools.com';
13
- const COMMERCIAL_LICENSE_SHOW_INFO_DAYS_BEFORE_EXPIRE = 10;
14
- const DAY_IN_MS = 1000 * 60 * 60 * 24;
15
- var LicenseValidityType;
16
- (function (LicenseValidityType) {
17
- LicenseValidityType["INVALID_LICENSE"] = "INVALID_LICENSE";
18
- LicenseValidityType["NO_LICENSE"] = "NO_LICENSE";
19
- LicenseValidityType["NON_PRODUCTION_VALID"] = "NON_PRODUCTION_VALID";
20
- LicenseValidityType["NON_PRODUCTION_EXPIRED_IN_SCOPE"] = "NON_PRODUCTION_EXPIRED_IN_SCOPE";
21
- LicenseValidityType["NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE"] = "NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE";
22
- LicenseValidityType["COMMERCIAL_VALID"] = "COMMERCIAL_VALID";
23
- LicenseValidityType["COMMERCIAL_EXPIRED_IN_SCOPE"] = "COMMERCIAL_EXPIRED_IN_SCOPE";
24
- LicenseValidityType["COMMERCIAL_EXPIRED_OUT_OF_SCOPE"] = "COMMERCIAL_EXPIRED_OUT_OF_SCOPE";
25
- })(LicenseValidityType = exports.LicenseValidityType || (exports.LicenseValidityType = {}));
26
- const SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
27
- const SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
28
- const origin = typeof window !== 'undefined' ? window.location.origin : '';
29
- const isInsideSandpack = () => {
30
- const [_fullUrl, protocol, sandpackUrl] = Array.from(SANDPACK_REGEX.exec(origin) || []);
31
- return protocol === 'https' && sandpackUrl === 'sandpack.codesandbox.io';
32
- };
33
- const isInsideSandbox = () => {
34
- const [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
35
- return protocol === 'https' && sandboxUrl === '.csb.app';
36
- };
37
- class LicenseService {
38
- constructor(adaptable, licenseKey, packageDetails) {
39
- this.adaptable = adaptable;
40
- this.adaptable = adaptable;
41
- let details = null;
42
- if (licenseKey) {
43
- try {
44
- details = decode_1.decode(licenseKey);
45
- }
46
- catch (error) {
47
- details = error;
48
- }
49
- }
50
- if (!isInsideSandpack() && !isInsideSandbox()) {
51
- this.handleLicenseValidation(details, this.getValidityType(details, packageDetails));
52
- }
53
- }
54
- getValidityType(details, packageDetails) {
55
- if (!details) {
56
- return LicenseValidityType.NO_LICENSE;
57
- }
58
- if (details instanceof Error) {
59
- return LicenseValidityType.INVALID_LICENSE;
60
- }
61
- const currentVersionReleaseDate = new Date(packageDetails.publishedAt);
62
- const licenseEndDate = new Date(details.end);
63
- const currentDate = new Date();
64
- const isExpired = licenseEndDate < currentDate;
65
- const isTrial = details.trial;
66
- const isScope = licenseEndDate > currentVersionReleaseDate;
67
- let validityType = null;
68
- if (isExpired) {
69
- if (isScope) {
70
- if (isTrial) {
71
- validityType = LicenseValidityType.NON_PRODUCTION_EXPIRED_IN_SCOPE;
72
- }
73
- else {
74
- validityType = LicenseValidityType.COMMERCIAL_EXPIRED_IN_SCOPE;
75
- }
76
- }
77
- else {
78
- if (isTrial) {
79
- validityType = LicenseValidityType.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE;
80
- }
81
- else {
82
- validityType = LicenseValidityType.COMMERCIAL_EXPIRED_OUT_OF_SCOPE;
83
- }
84
- }
85
- }
86
- else {
87
- if (isTrial) {
88
- validityType = LicenseValidityType.NON_PRODUCTION_VALID;
89
- }
90
- else {
91
- validityType = LicenseValidityType.COMMERCIAL_VALID;
92
- }
93
- }
94
- return validityType;
95
- }
96
- handleLicenseValidation(details, validityType) {
97
- var _a;
98
- const nowAtMidnight = new Date();
99
- nowAtMidnight.setHours(0, 0, 0, 0);
100
- let daysLeft = 0;
101
- if (!(details instanceof Error) && (details === null || details === void 0 ? void 0 : details.end)) {
102
- daysLeft = Math.floor((((_a = details === null || details === void 0 ? void 0 : details.end) === null || _a === void 0 ? void 0 : _a.getTime()) - nowAtMidnight.getTime()) / DAY_IN_MS);
103
- daysLeft = clamp_1.default(daysLeft, 0, Infinity);
104
- }
105
- const annotateMessage = (message, link = DocumentationLinkConstants_1.LicenseDocsLink, email = EMAIL, days = daysLeft) => {
106
- return message.replace('[LINK]', link).replace('[EMAIL]', email).replace('[DAYS]', `${days}`);
107
- };
108
- switch (validityType) {
109
- case 'NO_LICENSE':
110
- case 'NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE':
111
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK].'), 'Error');
112
- this.showNotification('No AdapTable License found.');
113
- this.showWatermark('This instance of AdapTable does not have a license, and some functionality has therefore been removed.');
114
- this.disableStatePersistence();
115
- break;
116
- case 'INVALID_LICENSE':
117
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK].'), 'Error');
118
- this.showNotification('Corrupted AdapTable License found.');
119
- this.showWatermark('This instance of AdapTable has a corrupted License, and some functionality has therefore been removed.');
120
- this.disableStatePersistence();
121
- break;
122
- case 'NON_PRODUCTION_VALID':
123
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK].'), 'Info');
124
- break;
125
- case 'NON_PRODUCTION_EXPIRED_IN_SCOPE':
126
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK].'), 'Warning');
127
- this.showWatermark('AdapTable License has expired');
128
- break;
129
- case 'COMMERCIAL_VALID':
130
- if (daysLeft <= COMMERCIAL_LICENSE_SHOW_INFO_DAYS_BEFORE_EXPIRE) {
131
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage(`This AdapTable license expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`), 'Info');
132
- }
133
- break;
134
- case 'COMMERCIAL_EXPIRED_IN_SCOPE':
135
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('This AdapTable license has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)'), 'Warning');
136
- break;
137
- case 'COMMERCIAL_EXPIRED_OUT_OF_SCOPE':
138
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('This AdapTable license has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.'), 'Error');
139
- this.showNotification('Adaptable License has expired');
140
- this.showWatermark('Adaptable License has expired');
141
- break;
142
- }
143
- }
144
- showNotification(text) {
145
- this.adaptable.api.internalApi.dispatchReduxAction(PopupRedux_1.PopupShowAlert({
146
- header: 'License Error',
147
- message: text,
148
- alertDefinition: ObjectFactory_1.default.CreateInternalAlertDefinitionForMessages('Error'),
149
- }));
150
- }
151
- showWatermark(text) {
152
- this.adaptable.api.internalApi.dispatchReduxAction(SystemRedux_1.SystemLicenseShowWatermark(text));
153
- }
154
- disableStatePersistence() {
155
- this.adaptable.api.internalApi.dispatchReduxAction(SystemRedux_1.SystemLicenseDisablePersistence());
156
- }
157
- destroy() { }
158
- }
159
- exports.LicenseService = LicenseService;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../Redux/ActionsReducers/SystemRedux"),t=require("../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../ObjectFactory")),o=require("../Helpers/LoggingHelper"),i=e.__importDefault(require("lodash/clamp")),n=require("../Constants/DocumentationLinkConstants"),r=require("../license/decode"),c="sales@adaptabletools.com",l=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const E=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,I=/(https):\/\/\S+(\.csb\.app)/g,_=/(https):\/\/\S+(\.adaptabletools\.com)/g,O="undefined"!=typeof window?window.location.origin:"",h=()=>{const[e,a,t]=Array.from(E.exec(O)||[]);return"https"===a&&"sandpack.codesandbox.io"===t},u=()=>{const[e,a,t]=Array.from(I.exec(O)||[]);return"https"===a&&".csb.app"===t},L=()=>{const[e,a,t]=Array.from(_.exec(O)||[]);return"https"===a&&".adaptabletools.com"===t};class A{constructor(e,a,t){this.adaptable=e,this.adaptable=e;let s=null;if(a)try{s=r.decode(a)}catch(e){s=e}h()||u()||L()||this.handleLicenseValidation(s,this.getValidityType(s,t))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),o=s<new Date,i=e.trial;let n=null;return n=o?s>t?i?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:i?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:i?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let r=0;e instanceof Error||!(null==e?void 0:e.end)||(r=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/864e5),r=i.default(r,0,1/0));const l=(e,a=n.LicenseDocsLink,t=c,s=r)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":o.ConsoleLogByMessageType(l("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":o.ConsoleLogByMessageType(l("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":o.ConsoleLogByMessageType(l("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":r<=10&&o.ConsoleLogByMessageType(l("This AdapTable license expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)"),"Info");break;case"COMMERCIAL_EXPIRED_IN_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable license has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)"),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable license has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license."),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction(t.PopupShowAlert({header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction(a.SystemLicenseShowWatermark(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction(a.SystemLicenseDisablePersistence())}destroy(){}}exports.LicenseService=A;
@@ -1,67 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decode = exports.fieldsToLicenseDetails = void 0;
4
- const hashing_1 = require("./hashing");
5
- const getGenericError = () => new Error('Invalid License');
6
- exports.fieldsToLicenseDetails = (fields) => {
7
- var _a;
8
- const fieldsMap = fields.reduce((acc, field) => {
9
- acc.set(field.name, field.value);
10
- return acc;
11
- }, new Map());
12
- const details = {
13
- count: fieldsMap.get('DeveloperCount') ? Number(fieldsMap.get('DeveloperCount')) : 0,
14
- start: new Date(fieldsMap.get('StartDate')),
15
- end: new Date(fieldsMap.get('EndDate')),
16
- owner: fieldsMap.get('Owner'),
17
- timestamp: fieldsMap.get('TS') ? Number(fieldsMap.get('TS')) : 0,
18
- trial: fieldsMap.get('Trial') === 'true' ? true : false,
19
- ref: (_a = fieldsMap.get('Ref')) !== null && _a !== void 0 ? _a : '',
20
- };
21
- if (!details.start ||
22
- !details.end ||
23
- !details.owner ||
24
- typeof details.trial !== 'boolean' ||
25
- !details.ref) {
26
- throw getGenericError();
27
- }
28
- return details;
29
- };
30
- exports.decode = (licenseKey) => {
31
- let crc = '';
32
- let fields = licenseKey.split('|').map((part) => {
33
- let [name, value] = part.split('=');
34
- if (name === 'C') {
35
- crc = value;
36
- }
37
- return {
38
- name,
39
- value,
40
- };
41
- });
42
- if (!crc) {
43
- throw getGenericError();
44
- }
45
- const crcParts = crc.split(',').reverse();
46
- const overallCrc = crcParts.pop();
47
- crcParts.forEach((fieldCrc, index) => {
48
- const field = fields[index];
49
- if (hashing_1.compute_string(field.value) !== fieldCrc) {
50
- throw getGenericError();
51
- }
52
- });
53
- const fieldsWithoutC = [...fields];
54
- fieldsWithoutC.pop();
55
- const fieldsWithoutCString = fieldsWithoutC
56
- .map((field) => {
57
- return `${field.name}=${field.value}`;
58
- })
59
- .join('|');
60
- if (hashing_1.compute_string(fieldsWithoutCString) !== overallCrc) {
61
- throw getGenericError();
62
- }
63
- fields = fields.map((f) => {
64
- return Object.assign(Object.assign({}, f), { value: decodeURI(f.value) });
65
- });
66
- return exports.fieldsToLicenseDetails(fields);
67
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.decode=exports.fieldsToLicenseDetails=void 0;const e=require("./hashing"),t=()=>new Error("Invalid License");exports.fieldsToLicenseDetails=e=>{var r;const o=e.reduce(((e,t)=>(e.set(t.name,t.value),e)),new Map),s={count:o.get("DeveloperCount")?Number(o.get("DeveloperCount")):0,start:new Date(o.get("StartDate")),end:new Date(o.get("EndDate")),owner:o.get("Owner"),timestamp:o.get("TS")?Number(o.get("TS")):0,trial:"true"===o.get("Trial"),ref:null!==(r=o.get("Ref"))&&void 0!==r?r:""};if(!(s.start&&s.end&&s.owner&&"boolean"==typeof s.trial&&s.ref))throw t();return s},exports.decode=r=>{let o="",s=r.split("|").map((e=>{let[t,r]=e.split("=");return"C"===t&&(o=r),{name:t,value:r}}));if(!o)throw t();const n=o.split(",").reverse(),a=n.pop();n.forEach(((r,o)=>{const n=s[o];if(e.compute_string(n.value)!==r)throw t()}));const i=[...s];i.pop();const l=i.map((e=>`${e.name}=${e.value}`)).join("|");if(e.compute_string(l)!==a)throw t();return s=s.map((e=>Object.assign(Object.assign({},e),{value:decodeURI(e.value)}))),exports.fieldsToLicenseDetails(s)};
@@ -1,47 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compute_string = void 0;
4
- const DEFAULT_ReversedPolynomial = 0xedb88320;
5
- /*
6
- * CRC-32 implementation
7
- */
8
- function generate(reversedPolynomial = DEFAULT_ReversedPolynomial) {
9
- var table = new Array();
10
- var i, j, n;
11
- for (i = 0; i < 256; i++) {
12
- n = i;
13
- for (j = 8; j > 0; j--) {
14
- if ((n & 1) == 1) {
15
- n = (n >>> 1) ^ reversedPolynomial;
16
- }
17
- else {
18
- n = n >>> 1;
19
- }
20
- }
21
- table[i] = n;
22
- }
23
- return table;
24
- }
25
- function crc32_initial() {
26
- return 0xffffffff;
27
- }
28
- function crc32_add_byte(table, crc, byte) {
29
- crc = (crc >>> 8) ^ table[byte ^ (crc & 0x000000ff)];
30
- return crc;
31
- }
32
- function crc32_final(crc) {
33
- crc = ~crc;
34
- crc = crc < 0 ? 0xffffffff + crc + 1 : crc;
35
- return crc;
36
- }
37
- function compute_string(str, reversedPolynomial = DEFAULT_ReversedPolynomial) {
38
- var table = generate(reversedPolynomial);
39
- var crc = 0;
40
- var i;
41
- crc = crc32_initial();
42
- for (i = 0; i < str.length; i++)
43
- crc = crc32_add_byte(table, crc, str.charCodeAt(i));
44
- crc = crc32_final(crc);
45
- return `${crc}`;
46
- }
47
- exports.compute_string = compute_string;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compute_string=void 0;const r=3988292384;function t(r=3988292384){var t,e,n,o=new Array;for(t=0;t<256;t++){for(n=t,e=8;e>0;e--)1==(1&n)?n=n>>>1^r:n>>>=1;o[t]=n}return o}function e(){return 4294967295}function n(r,t,e){return t=t>>>8^r[e^255&t]}function o(r){return r=(r=~r)<0?4294967295+r+1:r}function u(r,u=3988292384){var c,i=t(u),f=0;for(f=e(),c=0;c<r.length;c++)f=n(i,f,r.charCodeAt(c));return`${f=o(f)}`}exports.compute_string=u;
@@ -47,7 +47,7 @@ const ConfigurationDialog = (props) => {
47
47
  padding: 0,
48
48
  style: { overflow: 'auto', display: 'flex', flexFlow: 'column' },
49
49
  }, borderRadius: "none", style: { fontSize: 16, flex: 1 } },
50
- React.createElement(Panel_1.default, { border: "none" },
50
+ React.createElement(Panel_1.default, { style: { minHeight: 50 }, border: "none" },
51
51
  React.createElement(FormLayout_1.default, null,
52
52
  React.createElement(FormLayout_1.FormRow, { label: "AdaptableId" },
53
53
  React.createElement(Input_1.default, { value: abOptions.adaptableId, onChange: onadaptableIdChange, style: { minWidth: '20rem' } })))),
@@ -15,6 +15,7 @@ exports.renderAlertBehaviourSummary = (alert, api, allowWrap = false) => {
15
15
  const values = [
16
16
  AlertProperties.PreventEdit ? { label: 'Prevent Cell Edit', id: 'preventCellEdit' } : null,
17
17
  AlertProperties.HighlightCell ? { label: 'Highlight Cell', id: 'highlightCell' } : null,
18
+ AlertProperties.HighlightRow ? { label: 'Highlight Row', id: 'highlightRow' } : null,
18
19
  AlertProperties.JumpToCell ? { label: 'Jump To Cell', id: 'jumptocell' } : null,
19
20
  AlertProperties.ShowInDiv
20
21
  ? {