@adaptabletools/adaptable-cjs 20.2.0 → 20.2.1

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 (47) hide show
  1. package/base.css +7 -7
  2. package/base.css.map +1 -1
  3. package/index.css +7 -7
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableOptions/QuickSearchOptions.d.ts +1 -1
  7. package/src/AdaptableOptions/StateOptions.d.ts +60 -15
  8. package/src/AdaptableState/FormatColumnState.d.ts +11 -6
  9. package/src/AdaptableState/QuickSearchState.d.ts +3 -3
  10. package/src/Api/Implementation/ColumnApiImpl.js +3 -2
  11. package/src/Api/Implementation/StateApiImpl.d.ts +1 -0
  12. package/src/Api/Implementation/StateApiImpl.js +6 -5
  13. package/src/Api/Internal/ColumnInternalApi.d.ts +1 -0
  14. package/src/Api/Internal/ColumnInternalApi.js +5 -0
  15. package/src/Api/Internal/FormatColumnInternalApi.js +5 -5
  16. package/src/Api/StateApi.d.ts +9 -0
  17. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +14 -18
  18. package/src/Redux/Store/AdaptableStore.d.ts +2 -0
  19. package/src/Redux/Store/AdaptableStore.js +12 -4
  20. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +1 -0
  21. package/src/Redux/Store/Interface/IStorageEngine.d.ts +4 -4
  22. package/src/Redux/Store/buildAdaptableStateFunctionConfig.d.ts +3 -0
  23. package/src/Redux/Store/buildAdaptableStateFunctionConfig.js +13 -0
  24. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
  25. package/src/Utilities/Helpers/StyleHelper.d.ts +1 -1
  26. package/src/Utilities/Helpers/StyleHelper.js +11 -0
  27. package/src/Utilities/Services/LicenseService/index.js +1 -1
  28. package/src/Utilities/license/decode.js +1 -1
  29. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -3
  30. package/src/View/Components/EntityRulesEditor/index.js +3 -3
  31. package/src/View/Components/ExpressionWizard.js +1 -1
  32. package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
  33. package/src/View/GridFilter/GridFilterExpressionEditor.js +1 -1
  34. package/src/View/Layout/Wizard/sections/GridFilterSection.js +1 -1
  35. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +2 -2
  36. package/src/View/License/LicenseWatermark.js +1 -1
  37. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  38. package/src/View/QuickSearch/QuickSearchInput.js +3 -2
  39. package/src/agGrid/AdaptableAgGrid.js +2 -2
  40. package/src/agGrid/AgGridColumnAdapter.d.ts +1 -0
  41. package/src/agGrid/AgGridColumnAdapter.js +29 -9
  42. package/src/agGrid/AgGridExportAdapter.js +22 -10
  43. package/src/env.js +2 -2
  44. package/src/metamodel/adaptable.metamodel.d.ts +33 -16
  45. package/src/metamodel/adaptable.metamodel.js +1 -1
  46. package/src/types.d.ts +1 -1
  47. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -177,7 +177,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
177
177
  .filter((predicateDef) => this.getColumnScopeApi().isScopeInScope(scope, predicateDef.columnScope));
178
178
  }
179
179
  formatColumnWithColumnGroupStateShouldRender(formatColumn, column) {
180
- if (!formatColumn.ColumnGroupState) {
180
+ if (!formatColumn.ColumnGroupScope) {
181
181
  return true;
182
182
  }
183
183
  const agGridApi = this.getAdaptableApi().agGridApi;
@@ -199,13 +199,13 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
199
199
  columnGroupLeafColumns.length === 1 &&
200
200
  columnGroupLeafColumns[0] === agGridColumn;
201
201
  if (columnIsTopLevel) {
202
- // for top-level columns don't apply formatColumns that have an explicit ColumnGroupState defined
202
+ // for top-level columns don't apply formatColumns that have an explicit ColumnGroupScope defined
203
203
  return false;
204
204
  }
205
- if (formatColumn.ColumnGroupState === 'Both') {
205
+ if (formatColumn.ColumnGroupScope === 'Both') {
206
206
  return true;
207
207
  }
208
- return formatColumn.ColumnGroupState === columnGroupState;
208
+ return formatColumn.ColumnGroupScope === columnGroupState;
209
209
  }
210
210
  /**
211
211
  * Checks if format column is relevant for a given cell (intersection of given AdaptableColumn and RowNode)
@@ -237,7 +237,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
237
237
  return false;
238
238
  }
239
239
  }
240
- if (formatColumn.ColumnGroupState &&
240
+ if (formatColumn.ColumnGroupScope &&
241
241
  !this.formatColumnWithColumnGroupStateShouldRender(formatColumn, column)) {
242
242
  return false;
243
243
  }
@@ -210,4 +210,13 @@ export interface StateApi {
210
210
  * @param module Module which is Ready
211
211
  */
212
212
  dispatchStateReadyAction(module: AdaptableModule): void;
213
+ /**
214
+ * Persists the current Adaptable State to storage.
215
+ *
216
+ * This method first calls StateOption.saveState() to prepare the state
217
+ * and then StateOptions.persistState() to save it to the configured storage.
218
+ *
219
+ * @returns Promise<AdaptableState> - A promise that resolves to the persisted state
220
+ */
221
+ persistAdaptableState(): Promise<AdaptableState>;
213
222
  }
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
6
6
  const AdaptableReduxMerger_1 = require("./AdaptableReduxMerger");
7
7
  const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
8
+ const buildAdaptableStateFunctionConfig_1 = require("./buildAdaptableStateFunctionConfig");
8
9
  const checkStatus = (response) => {
9
10
  const error = new Error(response.statusText);
10
11
  if (response.status >= 200 && response.status < 300) {
@@ -46,12 +47,8 @@ class AdaptableReduxLocalStorageEngine {
46
47
  setStateKey(adaptableStateKey) {
47
48
  this.adaptableStateKey = adaptableStateKey;
48
49
  }
49
- load(initialState = this.initialState) {
50
- return (this.loadState || loadState)({
51
- adaptableId: this.adaptableId,
52
- adaptableStateKey: this.adaptableStateKey,
53
- userName: this.userName,
54
- }).then((parsedJsonState) => {
50
+ load(adaptableInstance, initialState = this.initialState) {
51
+ return (this.loadState || loadState)((0, buildAdaptableStateFunctionConfig_1.buildAdaptableStateFunctionConfig)(adaptableInstance)).then((parsedJsonState) => {
55
52
  // we need to merge the Initial Adaptable State
56
53
  return Promise.resolve(initialState)
57
54
  .then((parsedInitialState) => {
@@ -60,20 +57,19 @@ class AdaptableReduxLocalStorageEngine {
60
57
  .catch((err) => AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`AdaptableId: ${this.adaptableId}`, err));
61
58
  });
62
59
  }
63
- save(state, getState) {
64
- return this.saveNow(state, getState);
60
+ save(adaptableInstance, state, actionName) {
61
+ return this.saveNow(adaptableInstance, state, actionName);
65
62
  }
66
- saveNow(state, getState) {
67
- const config = {
68
- adaptableId: this.adaptableId,
69
- adaptableStateKey: this.adaptableStateKey,
70
- userName: this.userName,
71
- };
72
- let result = state;
73
- if (getState) {
74
- result = getState(state, config);
63
+ saveNow(adaptableInstance, state, actionName) {
64
+ const config = (0, buildAdaptableStateFunctionConfig_1.buildAdaptableStateFunctionConfig)(adaptableInstance);
65
+ config.actionName = actionName;
66
+ config.previousState = adaptableInstance.adaptableStore.getPreviousStorageState() || null;
67
+ let stateObject = structuredClone(state);
68
+ const getTransformedState = adaptableInstance.adaptableOptions.stateOptions.saveState;
69
+ if (getTransformedState) {
70
+ stateObject = getTransformedState(stateObject, config);
75
71
  }
76
- const promise = (this.persistState || persistState)(result, config)?.catch(rejectWithMessage);
72
+ const promise = (this.persistState || persistState)(stateObject, config)?.catch(rejectWithMessage);
77
73
  if (!(promise instanceof Promise)) {
78
74
  AdaptableLogger_1.AdaptableLogger.consoleWarnBase(`AdaptableId: ${this.adaptableId}`, 'stateOptions.persistState should return a promise, it returned', 'Error', promise);
79
75
  }
@@ -26,6 +26,7 @@ export declare class AdaptableStore implements IAdaptableStore {
26
26
  private emitter;
27
27
  private storageEngine;
28
28
  private currentStorageState?;
29
+ private previousStorageState?;
29
30
  private loadStorageInProgress;
30
31
  private loadStateOnStartup;
31
32
  on: (eventName: string, callback: EmitterCallback) => (() => void);
@@ -39,6 +40,7 @@ export declare class AdaptableStore implements IAdaptableStore {
39
40
  constructor(adaptable: IAdaptable);
40
41
  destroy(): void;
41
42
  getCurrentStorageState(): AdaptableState;
43
+ getPreviousStorageState(): AdaptableState;
42
44
  saveStateNow(adaptable: IAdaptable): Promise<any>;
43
45
  loadStore: (config: LoadStoreConfig) => Promise<any>;
44
46
  }
@@ -43,6 +43,7 @@ const TeamSharingRedux = tslib_1.__importStar(require("../ActionsReducers/TeamSh
43
43
  const ThemeRedux = tslib_1.__importStar(require("../ActionsReducers/ThemeRedux"));
44
44
  const ToolPanelRedux = tslib_1.__importStar(require("../ActionsReducers/ToolPanelRedux"));
45
45
  const TeamSharingState_1 = require("../../AdaptableState/TeamSharingState");
46
+ const buildAdaptableStateFunctionConfig_1 = require("./buildAdaptableStateFunctionConfig");
46
47
  exports.INIT_STATE = 'INIT_STATE';
47
48
  exports.LOAD_STATE = 'LOAD_STATE';
48
49
  const NON_PERSIST_ACTIONS = {
@@ -97,10 +98,10 @@ class AdaptableStore {
97
98
  // START STATE LOAD
98
99
  this.loadStorageInProgress = true;
99
100
  return (this.Load = this.storageEngine
100
- .load(initialState)
101
+ .load(adaptable, initialState)
101
102
  .then((storedState) => {
102
103
  if (storedState && this.loadStateOnStartup) {
103
- this.TheStore.dispatch((0, exports.LoadState)(postProcessState(adaptable.adaptableOptions.stateOptions.applyState(storedState))));
104
+ this.TheStore.dispatch((0, exports.LoadState)(postProcessState(adaptable.adaptableOptions.stateOptions.applyState(storedState, (0, buildAdaptableStateFunctionConfig_1.buildAdaptableStateFunctionConfig)(adaptable)))));
104
105
  }
105
106
  })
106
107
  .then(() => {
@@ -224,7 +225,11 @@ class AdaptableStore {
224
225
  delete storageState[key];
225
226
  });
226
227
  this.currentStorageState = storageState;
227
- storageEngine.save(storageState, adaptable.adaptableOptions.stateOptions.saveState);
228
+ this.previousStorageState = { ...state };
229
+ NON_PERSISTENT_STORE_KEYS.forEach((key) => {
230
+ delete this.previousStorageState[key];
231
+ });
232
+ storageEngine.save(adaptable, storageState, action.type);
228
233
  }
229
234
  return finalState;
230
235
  };
@@ -248,10 +253,13 @@ class AdaptableStore {
248
253
  getCurrentStorageState() {
249
254
  return this.currentStorageState;
250
255
  }
256
+ getPreviousStorageState() {
257
+ return this.previousStorageState;
258
+ }
251
259
  saveStateNow(adaptable) {
252
260
  const storageState = this.getCurrentStorageState();
253
261
  if (storageState) {
254
- return this.storageEngine.saveNow(storageState, adaptable.adaptableOptions.stateOptions.saveState);
262
+ return this.storageEngine.saveNow(adaptable, storageState, 'API_CALL_SAVE_STATE');
255
263
  }
256
264
  return Promise.resolve(true);
257
265
  }
@@ -13,6 +13,7 @@ export interface IAdaptableStore {
13
13
  Load: Promise<any>;
14
14
  loadStore: (config: LoadStoreConfig) => Promise<any>;
15
15
  getCurrentStorageState: () => AdaptableState | void;
16
+ getPreviousStorageState: () => AdaptableState | void;
16
17
  saveStateNow: (adaptable: IAdaptable) => Promise<any>;
17
18
  on: (eventName: string, callback: (data?: any) => any) => () => void;
18
19
  onAny: (callback: (eventName: string, data?: any) => any) => () => void;
@@ -1,9 +1,9 @@
1
- import { AdaptableSaveStateFunction } from '../../../AdaptableOptions/StateOptions';
2
1
  import { AdaptableState } from '../../../AdaptableState/AdaptableState';
3
2
  import { InitialState } from '../../../AdaptableState/InitialState';
3
+ import { IAdaptable } from '../../../AdaptableInterfaces/IAdaptable';
4
4
  export default interface IStorageEngine {
5
- load(initialState?: string | InitialState): Promise<any>;
6
- save(state: AdaptableState, getEnhancedState?: AdaptableSaveStateFunction): Promise<any>;
7
- saveNow(state: AdaptableState, getEnhancedState?: AdaptableSaveStateFunction): Promise<any>;
5
+ load(adaptable: IAdaptable, initialState?: string | InitialState): Promise<any>;
6
+ save(adaptable: IAdaptable, state: AdaptableState, actionName: string): Promise<any>;
7
+ saveNow(adaptable: IAdaptable, state: AdaptableState, actionName: string): Promise<any>;
8
8
  setStateKey(stateKey: string): void;
9
9
  }
@@ -0,0 +1,3 @@
1
+ import { AdaptableStateFunctionConfig } from '../../AdaptableOptions/StateOptions';
2
+ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
3
+ export declare function buildAdaptableStateFunctionConfig(adaptable: IAdaptable): AdaptableStateFunctionConfig;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildAdaptableStateFunctionConfig = void 0;
4
+ function buildAdaptableStateFunctionConfig(adaptable) {
5
+ return {
6
+ adaptableId: adaptable.adaptableOptions.adaptableId,
7
+ adaptableStateKey: adaptable.adaptableOptions.adaptableStateKey,
8
+ userName: adaptable.adaptableOptions.userName,
9
+ adaptableApi: adaptable.api,
10
+ adaptableContext: adaptable.api?.optionsApi?.getAdaptableContext(),
11
+ };
12
+ }
13
+ exports.buildAdaptableStateFunctionConfig = buildAdaptableStateFunctionConfig;
@@ -295,7 +295,7 @@ const getDataChangedInfoStub = (context) => {
295
295
  const rowNode = rowNodeStub;
296
296
  if (rowNode) {
297
297
  const primaryKeyValue = context.adaptableApi.gridApi.getPrimaryKeyValueForRowNode(rowNode);
298
- const columnId = context.adaptableApi.columnApi.getQueryableColumns()[0]?.columnId;
298
+ const columnId = context.adaptableApi.columnApi.internalApi.getQueryableColumnsForUIEditor()[0]?.columnId;
299
299
  const oldValue = context.adaptableApi.gridApi.getCellRawValue(primaryKeyValue, columnId);
300
300
  const column = context.adaptableApi.columnApi.getColumnWithColumnId(columnId);
301
301
  const newValue = oldValue;
@@ -1,5 +1,5 @@
1
1
  import { AdaptableStyle } from '../../types';
2
- export declare const AgGridCellStyleProperties: readonly ["backgroundColor", "color", "fontWeight", "fontStyle", "fontSize", "borderColor"];
2
+ export declare const AgGridCellStyleProperties: readonly ["backgroundColor", "color", "fontWeight", "fontStyle", "fontSize", "borderColor", "--ab-dynamic-background-color", "--ab-dynamic-color", "--ab-dynamic-font-weight", "--ab-dynamic-font-style", "--ab-dynamic-font-size", "--ab-dynamic-text-decoration", "--ab-dynamic-border-radius", "--ab-dynamic-border-color"];
3
3
  export declare const normalizeStyleForAgGrid: (style: Record<string, any>) => {
4
4
  [x: string]: any;
5
5
  };
@@ -10,6 +10,17 @@ exports.AgGridCellStyleProperties = [
10
10
  'fontStyle',
11
11
  'fontSize',
12
12
  'borderColor',
13
+ // needed for quick search
14
+ // as otherwise, the currentTextMatchStyle is not removed correctly
15
+ // from the cell when looping through the values, and the cell is no longer the current match
16
+ '--ab-dynamic-background-color',
17
+ '--ab-dynamic-color',
18
+ '--ab-dynamic-font-weight',
19
+ '--ab-dynamic-font-style',
20
+ '--ab-dynamic-font-size',
21
+ '--ab-dynamic-text-decoration',
22
+ '--ab-dynamic-border-radius',
23
+ '--ab-dynamic-border-color',
13
24
  ];
14
25
  // see https://github.com/AdaptableTools/adaptable/issues/2119
15
26
  // since v29 AG Grid ignores style properties with null or undefined values
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../../Redux/ActionsReducers/InternalRedux"),t=require("../../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../../ObjectFactory")),i=e.__importDefault(require("lodash/clamp")),o=require("../../Constants/DocumentationLinkConstants"),n=require("../../license/decode"),r=require("./shouldLogThankYouMessage"),l="sales@adaptabletools.com",c=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=p={}));const h=()=>"undefined"!=typeof window?window.location.origin:"",E=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===s},_=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.csb\.app)/g.exec(e)||[]);return"https"===t&&".csb.app"===s},I=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.adaptabletools\.com)/g.exec(e)||[]);return"https"===t&&".adaptabletools.com"===s};class O{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",(()=>{requestAnimationFrame((()=>{this.adaptable.isDestroyed||this.init()}))}))}init(){let e=null;if(this.licenseKey)try{e=(0,n.decode)(this.licenseKey)}catch(a){e=a}E()||_()||I()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}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),i=s<new Date,o=e.trial;let n=null;return n=i?s>t?o?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:o?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){const t=new Date;t.setHours(0,0,0,0);let s=0;e instanceof Error||!e?.end||(s=Math.floor((e?.end?.getTime()-t.getTime())/d),s=(0,i.default)(s,0,1/0));let p="",h="";!e||e instanceof Error||!e.appName||e.appName==n.GENERIC_APP_NAME||(p=e.appName,h=" for application [APP_NAME]");const E=(e,a=o.LicenseDocsLink,t=l,i=s,n=p)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",n).replace("[DAYS]",`${i}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(s<=c)this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{(0,r.shouldLogThankYouMessage)()&&this.adaptable.logger.consoleLogByMessageType(E(`Thank you for using a valid AdapTable license${h}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.LicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.LicenseDisablePersistence)())}destroy(){}}exports.LicenseService=O;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../../Redux/ActionsReducers/InternalRedux"),t=require("../../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../../ObjectFactory")),i=e.__importDefault(require("lodash/clamp")),o=require("../../Constants/DocumentationLinkConstants"),n=require("../../license/decode"),r=require("./shouldLogThankYouMessage"),l="sales@adaptabletools.com",c=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=p={}));const h=()=>"undefined"!=typeof window?window.location.origin:"",E=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===s},_=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.csb\.app)/g.exec(e)||[]);return"https"===t&&".csb.app"===s},I=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.adaptabletools\.com)/g.exec(e)||[]);return"https"===t&&".adaptabletools.com"===s};class O{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",()=>{requestAnimationFrame(()=>{this.adaptable.isDestroyed||this.init()})})}init(){let e=null;if(this.licenseKey)try{e=(0,n.decode)(this.licenseKey)}catch(a){e=a}E()||_()||I()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}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),i=s<new Date,o=e.trial;let n=null;return n=i?s>t?o?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:o?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){const t=new Date;t.setHours(0,0,0,0);let s=0;e instanceof Error||!e?.end||(s=Math.floor((e?.end?.getTime()-t.getTime())/d),s=(0,i.default)(s,0,1/0));let p="",h="";!e||e instanceof Error||!e.appName||e.appName==n.GENERIC_APP_NAME||(p=e.appName,h=" for application [APP_NAME]");const E=(e,a=o.LicenseDocsLink,t=l,i=s,n=p)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",n).replace("[DAYS]",`${i}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(s<=c)this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{(0,r.shouldLogThankYouMessage)()&&this.adaptable.logger.consoleLogByMessageType(E(`Thank you for using a valid AdapTable license${h}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.LicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.LicenseDisablePersistence)())}destroy(){}}exports.LicenseService=O;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.decode=exports.fieldsToLicenseDetails=exports.GENERIC_APP_NAME=void 0;const e=require("./hashing"),t=()=>new Error("Invalid License");exports.GENERIC_APP_NAME="GenericAdaptableApp";const r=e=>{const r=e.reduce(((e,t)=>(e.set(t.name,t.value),e)),new Map),o={start:new Date(r.get("StartDate")),end:new Date(r.get("EndDate")),owner:r.get("Owner"),appName:r.get("AppName")||exports.GENERIC_APP_NAME,timestamp:r.get("TS")?Number(r.get("TS")):0,trial:"true"===r.get("Trial"),ref:r.get("Ref")??""};if(!(o.start&&o.end&&o.owner&&"boolean"==typeof o.trial&&o.ref))throw t();return o};exports.fieldsToLicenseDetails=r;const o=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 a=o.split(",").reverse(),n=a.pop();a.forEach(((r,o)=>{const a=s[o];if((0,e.compute_string)(a.value)!==r)throw t()}));const p=[...s];p.pop();const i=p.map((e=>`${e.name}=${e.value}`)).join("|");if((0,e.compute_string)(i)!==n)throw t();return s=s.map((e=>({...e,value:decodeURI(e.value)}))),(0,exports.fieldsToLicenseDetails)(s)};exports.decode=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.decode=exports.fieldsToLicenseDetails=exports.GENERIC_APP_NAME=void 0;const e=require("./hashing"),t=()=>new Error("Invalid License");exports.GENERIC_APP_NAME="GenericAdaptableApp";const r=e=>{const r=e.reduce((e,t)=>(e.set(t.name,t.value),e),new Map),o={start:new Date(r.get("StartDate")),end:new Date(r.get("EndDate")),owner:r.get("Owner"),appName:r.get("AppName")||exports.GENERIC_APP_NAME,timestamp:r.get("TS")?Number(r.get("TS")):0,trial:"true"===r.get("Trial"),ref:r.get("Ref")??""};if(!(o.start&&o.end&&o.owner&&"boolean"==typeof o.trial&&o.ref))throw t();return o};exports.fieldsToLicenseDetails=r;const o=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 a=o.split(",").reverse(),n=a.pop();a.forEach((r,o)=>{const a=s[o];if((0,e.compute_string)(a.value)!==r)throw t()});const p=[...s];p.pop();const i=p.map(e=>`${e.name}=${e.value}`).join("|");if((0,e.compute_string)(i)!==n)throw t();return s=s.map(e=>({...e,value:decodeURI(e.value)})),(0,exports.fieldsToLicenseDetails)(s)};exports.decode=o;
@@ -58,9 +58,7 @@ const CalculatedColumnExpressionWizardSection = (props) => {
58
58
  return 'quantileAggregatedScalar';
59
59
  }
60
60
  };
61
- const columns = api.columnApi
62
- .getQueryableColumns()
63
- .filter((c) => !c.isGeneratedPivotResultColumn);
61
+ const columns = api.columnApi.internalApi.getQueryableColumnsForUIEditor();
64
62
  return (React.createElement(Tabs_1.Tabs, { autoFocus: false, height: "100%" },
65
63
  React.createElement(Tabs_1.Tabs.Tab, null, (0, StringExtensions_1.Humanize)(props.expressionType)),
66
64
  React.createElement(Tabs_1.Tabs.Content, null, (() => {
@@ -152,14 +152,14 @@ const EntityRulesEditor = (props) => {
152
152
  React.createElement(EntityRulePredicatesEditor_1.EntityRulePredicatesEditor, { enablePredicateColumnId: props.enablePredicateColumnId, data: data, descriptions: descriptions, predicateDefs: filteredPredicateDefs, getPredicateDefsForColId: props.getPredicateDefsForColId, onChange: props.onChange }))) : null,
153
153
  showBoolean ? (React.createElement(QueryTab, { showRadio: showRadioButtons, value: "BooleanExpression", type: type, label: "Boolean" })) : null,
154
154
  showBoolean ? (React.createElement(Tabs_1.Tabs.Content, { "data-name": "BooleanExpression", value: 'BooleanExpression' }, (() => {
155
- const editor = (React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'boolean', module: module, value: data.Rule?.BooleanExpression, onChange: setBooleanExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api, showQueryBuilder: props.showQueryBuilder }));
155
+ const editor = (React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'boolean', module: module, value: data.Rule?.BooleanExpression, onChange: setBooleanExpression, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api, showQueryBuilder: props.showQueryBuilder }));
156
156
  return props.showQueryBuilder ? React.createElement(Panel_1.default, null, editor) : editor;
157
157
  })())) : null,
158
158
  showObservable ? (React.createElement(QueryTab, { showRadio: showRadioButtons, value: "ObservableExpression", type: type, label: "Observable" })) : null,
159
159
  showObservable ? (React.createElement(Tabs_1.Tabs.Content, { "data-name": "ObservableExpression", value: 'ObservableExpression' },
160
- React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'observable', module: module, value: data.Rule?.ObservableExpression, onChange: setReactiveExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null,
160
+ React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'observable', module: module, value: data.Rule?.ObservableExpression, onChange: setReactiveExpression, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null,
161
161
  showAggregation ? (React.createElement(QueryTab, { showRadio: showRadioButtons, value: "AggregatedBooleanExpression", type: type, label: "Aggregated Boolean" })) : null,
162
162
  showAggregation ? (React.createElement(Tabs_1.Tabs.Content, { "data-name": "AggregatedBooleanExpression", value: 'AggregatedBooleanExpression' },
163
- React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'aggregatedBoolean', module: module, value: data.Rule?.AggregatedBooleanExpression, onChange: setAggregationExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null)));
163
+ React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'aggregatedBoolean', module: module, value: data.Rule?.AggregatedBooleanExpression, onChange: setAggregationExpression, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null)));
164
164
  };
165
165
  exports.EntityRulesEditor = EntityRulesEditor;
@@ -31,7 +31,7 @@ class ExpressionWizard extends React.Component {
31
31
  render() {
32
32
  const initialData = (0, react_1.useMemo)(() => this.props.api.internalApi.getQueryPreviewData(), []);
33
33
  return (React.createElement(React.Fragment, null,
34
- React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'boolean', module: ModuleConstants_1.NamedQueryModuleId, value: this.state.expression, onChange: this.handleCustomExpressionChange, initialData: initialData, columns: this.props.api.columnApi.getQueryableColumns(), fields: this.props.api.expressionApi.internalApi.getAvailableFields(), namedQueries: this.props.api.namedQueryApi.getNamedQueries(), api: this.props.api }),
34
+ React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'boolean', module: ModuleConstants_1.NamedQueryModuleId, value: this.state.expression, onChange: this.handleCustomExpressionChange, initialData: initialData, columns: this.props.api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: this.props.api.expressionApi.internalApi.getAvailableFields(), namedQueries: this.props.api.namedQueryApi.getNamedQueries(), api: this.props.api }),
35
35
  ' ',
36
36
  React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 1, marginBottom: 2, marginLeft: 1, alignItems: "center", "data-name": "expression-wizard-save-option" },
37
37
  React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, disabled: !this.isValidExpression(), marginBottom: 2, checked: this.state.saveToNamedQueries, onChange: (checked) => this.setState({
@@ -76,6 +76,6 @@ const ReportRowsWizardSection = (props) => {
76
76
  BooleanExpression,
77
77
  },
78
78
  });
79
- }, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })))));
79
+ }, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })))));
80
80
  };
81
81
  exports.ReportRowsWizardSection = ReportRowsWizardSection;
@@ -92,7 +92,7 @@ const GridFilterExpressionEditor = (props) => {
92
92
  },
93
93
  } },
94
94
  React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column" },
95
- React.createElement(ExpressionEditor_1.ExpressionEditor, { ...expressionEditorProps, type: 'boolean', module: ModuleConstants_1.GridFilterModuleId, value: expression, onChange: (expression) => setExpression(expression), initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }),
95
+ React.createElement(ExpressionEditor_1.ExpressionEditor, { ...expressionEditorProps, type: 'boolean', module: ModuleConstants_1.GridFilterModuleId, value: expression, onChange: (expression) => setExpression(expression), initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }),
96
96
  React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 1, alignItems: "center" },
97
97
  props.onDismiss && (React.createElement(SimpleButton_1.default, { margin: 1, variant: "text", "data-name": "action-close", onClick: () => {
98
98
  props.onDismiss();
@@ -38,7 +38,7 @@ const GridFilterSection = (props) => {
38
38
  Expression: expression,
39
39
  },
40
40
  });
41
- }, initialData: initialData, columns: api.columnApi.getQueryableColumns().filter((c) => !c.isGeneratedPivotResultColumn), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }));
41
+ }, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }));
42
42
  return React.createElement("div", null, expressionEditorContent);
43
43
  };
44
44
  exports.GridFilterSection = GridFilterSection;
@@ -23,8 +23,8 @@ const RowGroupingSectionSummary = () => {
23
23
  React.createElement(Tag_1.Tag, null, "Row Grouping is not available in Tree Grids")));
24
24
  }
25
25
  return (React.createElement(rebass_1.Box, { display: 'flex', flexDirection: 'row' }, layout.RowGroupedColumns?.length ? (layout.RowGroupedColumns.map((columnId) => {
26
- return (React.createElement(rebass_1.Box, { mb: 2, mr: 2 },
27
- React.createElement(Tag_1.Tag, { key: columnId }, adaptable.api.columnApi.getFriendlyNameForColumnId(columnId))));
26
+ return (React.createElement(rebass_1.Box, { key: columnId, mb: 2, mr: 2 },
27
+ React.createElement(Tag_1.Tag, null, adaptable.api.columnApi.getFriendlyNameForColumnId(columnId))));
28
28
  })) : (React.createElement(Tag_1.Tag, null, "No Row Grouping"))));
29
29
  };
30
30
  exports.RowGroupingSectionSummary = RowGroupingSectionSummary;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseWatermark=void 0;const e=require("tslib"),t=e.__importStar(require("react")),r=require("../../components/Logo"),o=require("rebass"),n={border:"1px solid var(--ab-color-error)",padding:"5px",fontWeight:600,margin:"5px",fontSize:"14px",alignItems:"center",color:"var(--ab-color-text-on-defaultbackground)",background:"var(--ab-color-defaultbackground)"},i=e=>{const t=[["display","none"],["opacity","0"],["position","absolute"],["position","fixed"],["position","relative"],["visibility","hidden"]];for(const[r,o]of t)if(e.style[r]===o)return!1;return!0},l=e=>{const l=t.useRef(null);return t.useEffect((()=>{const e=setInterval((()=>{l.current?.isConnected||alert("It is not allowed to remove the Adaptable watermark."),i(l.current)||alert("It is not allowed to modify the Adaptable watermark."),l?.current?.style&&(l.current.style.border=n.border,l.current.style.padding=n.padding,l.current.style.fontWeight=`${n.fontWeight}`,l.current.style.margin=n.margin,l.current.style.fontSize=n.fontSize,l.current.style.color=n.color,l.current.style.background=n.background,l.current.style.display="flex",l.current.style.position="static",l.current.style.opacity="1",l.current.style.visibility="visible")}),5e3);return()=>clearTimeout(e)}),[]),t.createElement(o.Flex,{style:n,ref:l},t.createElement(r.Logo,{style:{marginRight:10}}),t.createElement("div",null,e.children))};exports.LicenseWatermark=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseWatermark=void 0;const e=require("tslib"),t=e.__importStar(require("react")),r=require("../../components/Logo"),o=require("rebass"),n={border:"1px solid var(--ab-color-error)",padding:"5px",fontWeight:600,margin:"5px",fontSize:"14px",alignItems:"center",color:"var(--ab-color-text-on-defaultbackground)",background:"var(--ab-color-defaultbackground)"},i=e=>{const t=[["display","none"],["opacity","0"],["position","absolute"],["position","fixed"],["position","relative"],["visibility","hidden"]];for(const[r,o]of t)if(e.style[r]===o)return!1;return!0},l=e=>{const l=t.useRef(null);return t.useEffect(()=>{const e=setInterval(()=>{l.current?.isConnected||alert("It is not allowed to remove the Adaptable watermark."),i(l.current)||alert("It is not allowed to modify the Adaptable watermark."),l?.current?.style&&(l.current.style.border=n.border,l.current.style.padding=n.padding,l.current.style.fontWeight=`${n.fontWeight}`,l.current.style.margin=n.margin,l.current.style.fontSize=n.fontSize,l.current.style.color=n.color,l.current.style.background=n.background,l.current.style.display="flex",l.current.style.position="static",l.current.style.opacity="1",l.current.style.visibility="visible")},5e3);return()=>clearTimeout(e)},[]),t.createElement(o.Flex,{style:n,ref:l},t.createElement(r.Logo,{style:{marginRight:10}}),t.createElement("div",null,e.children))};exports.LicenseWatermark=l;
@@ -32,6 +32,6 @@ const NamedQueryExpressionWizardSection = (props) => {
32
32
  const initialData = (0, react_1.useMemo)(() => api.internalApi.getQueryPreviewData(), []);
33
33
  return (React.createElement(ExpressionEditor_1.ExpressionEditor, { allowSaveNamedQuery: false, showQueryBuilder: true, type: 'boolean', module: moduleInfo.ModuleName, value: data.BooleanExpression, onChange: (BooleanExpression) => {
34
34
  props.onChange({ ...data, BooleanExpression });
35
- }, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }));
35
+ }, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }));
36
36
  };
37
37
  exports.NamedQueryExpressionWizardSection = NamedQueryExpressionWizardSection;
@@ -16,12 +16,13 @@ const QuickSearchInput = (props) => {
16
16
  const QuickSearchText = (0, react_redux_1.useSelector)((state) => state.QuickSearch.QuickSearchText);
17
17
  const dispatch = (0, react_redux_1.useDispatch)();
18
18
  const onRunQuickSearch = react_1.default.useCallback((newQuickSearchText) => dispatch(QuickSearchRedux.QuickSearchRun(newQuickSearchText)), []);
19
+ const isServerSideRowModel = adaptable.api.gridApi.getAgGridRowModelType() === 'serverSide';
19
20
  const [searchText, search] = (0, useQuickSearchDebounced_1.useQuickSearchDebounced)({
20
21
  QuickSearchText,
21
22
  onRunQuickSearch,
22
23
  });
23
- return (react_1.default.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { "aria-label": 'Quick Search', type: "text", autoFocus: props.autoFocus, placeholder: adaptable.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, className: (0, join_1.default)('ab-DashboardToolbar__QuickSearch__text', props.className), value: searchText, OnTextChange: search, style: { height: '100%' }, inputStyle: { width: props.width ?? '10rem' }, actionTools: react_1.default.createElement(rebass_1.Box, { display: "flex", flexDirection: "row", alignItems: "center", flex: 'none' },
24
+ return (react_1.default.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { "aria-label": 'Quick Search', type: "text", autoFocus: props.autoFocus, placeholder: adaptable.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, className: (0, join_1.default)('ab-DashboardToolbar__QuickSearch__text', props.className), value: searchText, OnTextChange: search, style: { height: '100%' }, inputStyle: { width: props.width ?? '10rem' }, actionTools: isServerSideRowModel ? null : (react_1.default.createElement(rebass_1.Box, { display: "flex", flexDirection: "row", alignItems: "center", flex: 'none' },
24
25
  react_1.default.createElement(SimpleButton_1.default, { "aria-label": 'Previous Match', icon: "arrow-up", px: 0, py: 0, mr: 1, disabled: !searchText, variant: "text", onClick: () => adaptable.api.quickSearchApi.gotoPreviousMatch() }),
25
- react_1.default.createElement(SimpleButton_1.default, { "aria-label": 'Next Match', icon: "arrow-down", px: 0, py: 0, mr: 1, disabled: !searchText, variant: "text", onClick: () => adaptable.api.quickSearchApi.gotoNextMatch() })) }));
26
+ react_1.default.createElement(SimpleButton_1.default, { "aria-label": 'Next Match', icon: "arrow-down", px: 0, py: 0, mr: 1, disabled: !searchText, variant: "text", onClick: () => adaptable.api.quickSearchApi.gotoNextMatch() }))) }));
26
27
  };
27
28
  exports.QuickSearchInput = QuickSearchInput;
@@ -1326,12 +1326,12 @@ You need to define at least one Layout!`);
1326
1326
  this.autoSizeLayoutIfNeeded();
1327
1327
  }));
1328
1328
  /**
1329
- * Use Case: A format column that has ColumnGroupState needs to be re-evaluated
1329
+ * Use Case: A format column that has ColumnGroupScope needs to be re-evaluated
1330
1330
  * whenever a column group is expanded or collapsed
1331
1331
  */
1332
1332
  this.agGridAdapter.getAgGridApi().addEventListener('columnGroupOpened', (this.listenerColumnGroupOpened = () => {
1333
1333
  if (this.api.formatColumnApi.getActiveFormatColumns().some((fc) => {
1334
- return fc.ColumnGroupState != null;
1334
+ return fc.ColumnGroupScope != null;
1335
1335
  })) {
1336
1336
  this.updateColumnModelAndRefreshGrid();
1337
1337
  }
@@ -36,6 +36,7 @@ export declare class AgGridColumnAdapter {
36
36
  private setupColumnValueSetter;
37
37
  private setupColumnComparator;
38
38
  private setupColumnGetFindText;
39
+ private getCellSearchText;
39
40
  private isCellSearchable;
40
41
  private isQuickSearchActive;
41
42
  private getEditableCellClass;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgGridColumnAdapter = exports.getEditorForColumnDataType = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
5
6
  const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
6
7
  const FilterWrapper_1 = require("./FilterWrapper");
7
8
  const FloatingFilterWrapper_1 = require("./FloatingFilterWrapper");
@@ -215,15 +216,17 @@ class AgGridColumnAdapter {
215
216
  const quickSearchCurrentTextMatchStyle = this.getQuickSearchCurrentTextMatchStyle();
216
217
  const textMatchStyle = quickSearchTextMatchStyle
217
218
  ? Object.entries(quickSearchTextMatchStyle).reduce((acc, [key, value]) => {
219
+ // needed as AG-Grid vanilla turns all CSS props
220
+ // to kebab, while AG Grid React does not
218
221
  // @ts-ignore
219
- acc[`--ab-dynamic-${key}`] = value;
222
+ acc[`--ab-dynamic-${(0, kebabCase_1.default)(key)}`] = value;
220
223
  return acc;
221
224
  }, {})
222
225
  : undefined;
223
226
  const currentTextMatchStyle = quickSearchCurrentTextMatchStyle
224
227
  ? Object.entries(quickSearchCurrentTextMatchStyle).reduce((acc, [key, value]) => {
225
228
  // @ts-ignore
226
- acc[`--ab-dynamic-${key}`] = value;
229
+ acc[`--ab-dynamic-${(0, kebabCase_1.default)(key)}`] = value;
227
230
  return acc;
228
231
  }, {})
229
232
  : undefined;
@@ -690,18 +693,25 @@ class AgGridColumnAdapter {
690
693
  }
691
694
  const getCellSearchText = this.adaptableOptions.quickSearchOptions.getCellSearchText;
692
695
  if (getCellSearchText) {
693
- const quickSearchValue = this.adaptableApi.quickSearchApi.getQuickSearchValue();
694
- const quickSearchContext = {
695
- ...this.adaptableApi.internalApi.buildBaseContext(),
696
- gridCell,
697
- quickSearchValue,
698
- };
699
- return getCellSearchText(quickSearchContext);
696
+ return this.getCellSearchText(gridCell);
700
697
  }
701
698
  return userGetFindText?.(params) ?? gridCell.displayValue;
702
699
  };
703
700
  });
704
701
  }
702
+ getCellSearchText(gridCell) {
703
+ const getCellSearchText = this.adaptableOptions.quickSearchOptions.getCellSearchText;
704
+ if (getCellSearchText) {
705
+ const quickSearchValue = this.adaptableApi.quickSearchApi.getQuickSearchValue();
706
+ const quickSearchContext = {
707
+ ...this.adaptableApi.internalApi.buildBaseContext(),
708
+ gridCell,
709
+ quickSearchValue,
710
+ };
711
+ return getCellSearchText(quickSearchContext);
712
+ }
713
+ return gridCell.displayValue;
714
+ }
705
715
  isCellSearchable(gridCell) {
706
716
  const isCellSearchableFn = this.adaptableOptions.quickSearchOptions.isCellSearchable;
707
717
  if (!gridCell.column) {
@@ -737,6 +747,16 @@ class AgGridColumnAdapter {
737
747
  if (!column) {
738
748
  return false;
739
749
  }
750
+ const isServerSideRowModel = this.adaptableApi.gridApi.getAgGridRowModelType() === 'serverSide';
751
+ if (isServerSideRowModel) {
752
+ const isCaseSensitive = this.adaptableOptions.quickSearchOptions.isQuickSearchCaseSensitive;
753
+ const cellDisplayValue = String(this.getCellSearchText(gridCell));
754
+ const displayValue = isCaseSensitive
755
+ ? cellDisplayValue
756
+ : cellDisplayValue.toLocaleLowerCase();
757
+ const searchText = isCaseSensitive ? quickSearchValue : quickSearchValue.toLocaleLowerCase();
758
+ return displayValue.indexOf(searchText) !== -1;
759
+ }
740
760
  return (this.agGridApi.findGetNumMatches({
741
761
  column,
742
762
  node: gridCell.rowNode,
@@ -184,19 +184,19 @@ class AgGridExportAdapter {
184
184
  // recreating the standard AG Grid styling for row groups: 'Parent -> Child'
185
185
  // additionally the values are formatted
186
186
  let rowGroupNode = params.node;
187
- const isFooterRow = rowGroupNode.footer;
187
+ const agColumn = params.column;
188
188
  const rowGroupSummary = [
189
- this.processRowGroupForExcelExport(rowGroupNode, exportContext) ?? '',
189
+ this.processRowGroupForExcelExport(rowGroupNode, exportContext, agColumn) ?? '',
190
190
  ];
191
191
  while (rowGroupNode.parent) {
192
192
  rowGroupNode = rowGroupNode.parent;
193
- const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode, exportContext);
193
+ const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode, exportContext, agColumn);
194
194
  if (formattedParentNode) {
195
195
  rowGroupSummary.push(formattedParentNode);
196
196
  }
197
197
  }
198
198
  let summary = rowGroupSummary.reverse().join(' -> ');
199
- if (isFooterRow) {
199
+ if (agColumn?.getColId() === GeneralConstants_1.AG_GRID_GROUPED_COLUMN && rowGroupNode.footer) {
200
200
  summary = `Total: ${summary}`;
201
201
  }
202
202
  return summary;
@@ -411,17 +411,29 @@ class AgGridExportAdapter {
411
411
  }
412
412
  return this.getCellExportValueFromRawValue(rowNode, this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId), columnId, exportContext);
413
413
  }
414
- processRowGroupForExcelExport(rowNode, exportContext) {
414
+ processRowGroupForExcelExport(rowNode, exportContext, agColumn) {
415
415
  if (this.isTreeDataGrid()) {
416
416
  return rowNode.key;
417
417
  }
418
- const columnId = rowNode.field ??
419
- rowNode.rowGroupColumn?.getColId() ??
420
- rowNode.rowGroupColumn?.getColDef()?.field;
421
- if (!columnId || !rowNode.key) {
418
+ const getColIdAndRawValue = () => {
419
+ if (this.adaptableApi.columnApi.isAutoRowGroupColumn(agColumn?.getColId())) {
420
+ const columnId = rowNode.field ??
421
+ rowNode.rowGroupColumn?.getColId() ??
422
+ rowNode.rowGroupColumn?.getColDef()?.field;
423
+ let rawValue = rowNode.key;
424
+ return { columnId, rawValue };
425
+ }
426
+ if (this.adaptableApi.columnApi.isPivotResultColumn(agColumn.getColId())) {
427
+ const columnId = agColumn.getColId();
428
+ const rawValue = rowNode.aggData?.[columnId];
429
+ return { columnId, rawValue };
430
+ }
431
+ return {};
432
+ };
433
+ let { columnId, rawValue } = getColIdAndRawValue();
434
+ if (!columnId || rawValue == null) {
422
435
  return;
423
436
  }
424
- let rawValue = rowNode.key;
425
437
  const columnDataType = this.adaptableApi.columnApi.getColumnDataTypeForColumnId(columnId);
426
438
  if ((columnDataType === 'date' || columnDataType === 'dateString') &&
427
439
  typeof rawValue === 'string' &&
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
5
- PUBLISH_TIMESTAMP: 1749810340250 || Date.now(),
6
- VERSION: "20.2.0" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1750416454142 || Date.now(),
6
+ VERSION: "20.2.1" || '--current-version--',
7
7
  };