@adaptabletools/adaptable-cjs 20.2.2 → 20.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "20.2.2",
3
+ "version": "20.2.3",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -346,10 +346,21 @@ export interface DataFormatDataType {
346
346
  date?: DataFormatType;
347
347
  }
348
348
  /**
349
- * Custom Export Parameters which extend AG Grid's base export parameters.
350
- * Use:
351
- * - `ExcelExportParams` for Excel format exports
352
- * - `CsvExportParams` for CSV, JSON and any custom format exports
353
- * These parameters allow overriding AdapTable's default export behavior.
349
+ * Custom Export Parameters which extend AG Grid's base export parameters, allowing overriding of AdapTable's default export behaviour.
350
+ * Use `ExcelExportParams` for Excel format exports and `CsvExportParams` for CSV, JSON and any custom format exports
354
351
  */
355
352
  export type CustomExportParams = ExcelExportParams | CsvExportParams;
353
+ /**
354
+ * Config used when Exporting via API, allows fine grained exporting
355
+ */
356
+ export interface ExportConfig {
357
+ /**
358
+ *
359
+ * Function to modify export params; receives default params & returns modified params
360
+ */
361
+ exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
362
+ /**
363
+ * Whether to show progress indicator
364
+ */
365
+ showProgressIndicator?: boolean;
366
+ }
@@ -1,6 +1,6 @@
1
1
  import { AdaptableForm } from '../AdaptableState/Common/AdaptableForm';
2
2
  import { ExportState, Report, ReportFormatType, ReportNameType, SystemReportFormat, SystemReportName } from '../AdaptableState/ExportState';
3
- import { CustomDestination, CustomExportParams, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../AdaptableOptions/ExportOptions';
3
+ import { CustomDestination, CustomExportParams, ExportConfig, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../AdaptableOptions/ExportOptions';
4
4
  import { AdaptableColumn } from '../types';
5
5
  /**
6
6
  * Provides run-time access to the Export Module and Report state
@@ -143,14 +143,9 @@ export interface ExportApi {
143
143
  * @param reportName - name of the report
144
144
  * @param format - format of the report
145
145
  * @param destination - destination to export to
146
- * @param config - optional configuration
147
- * @param config.exportParams - function to modify the default export parameters; it will be called with the default export parameters and should return the modified export parameters
148
- * @param config.showProgressIndicator - whether to show progress indicator
149
- */
150
- exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, config?: {
151
- exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
152
- showProgressIndicator?: boolean;
153
- }): Promise<void>;
146
+ * @param exportConfig - optional export configuration
147
+ */
148
+ exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, exportConfig?: ExportConfig): Promise<void>;
154
149
  /**
155
150
  * Gets the data for the Report with the given Name in the given Format
156
151
  * @param reportName - name of the report
@@ -2,7 +2,7 @@ import { ExportApi } from '../ExportApi';
2
2
  import { ExportState, Report, ReportFormatType, ReportNameType, SystemReportFormat, SystemReportName } from '../../AdaptableState/ExportState';
3
3
  import { ApiBase } from './ApiBase';
4
4
  import { AdaptableForm } from '../../AdaptableState/Common/AdaptableForm';
5
- import { CustomDestination, CustomExportParams, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../../AdaptableOptions/ExportOptions';
5
+ import { CustomDestination, CustomExportParams, ExportConfig, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../../AdaptableOptions/ExportOptions';
6
6
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
7
7
  import { ExportInternalApi } from '../Internal/ExportInternalApi';
8
8
  import { AdaptableColumn } from '../../types';
@@ -37,10 +37,7 @@ export declare class ExportApiImpl extends ApiBase implements ExportApi {
37
37
  getCustomReports(): Report[];
38
38
  isColumnExportable(adaptableColumn: AdaptableColumn): boolean;
39
39
  getSupportedExportDestinations(reportFormat: ReportFormatType): ExportDestinationType[];
40
- exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, config?: {
41
- exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
42
- showProgressIndicator?: boolean;
43
- }): Promise<void>;
40
+ exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, exportConfig?: ExportConfig): Promise<void>;
44
41
  getReportData(reportName: ReportNameType, format: ReportFormatType, config?: {
45
42
  exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
46
43
  showProgressIndicator?: boolean;
@@ -183,7 +183,7 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
183
183
  return true;
184
184
  });
185
185
  }
186
- async exportReport(reportName, format, destination = 'Download', config) {
186
+ async exportReport(reportName, format, destination = 'Download', exportConfig) {
187
187
  let report = this.getReportByName(reportName);
188
188
  if (!this.checkItemExists(report, reportName, 'Report')) {
189
189
  return;
@@ -201,8 +201,8 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
201
201
  report,
202
202
  format,
203
203
  destination,
204
- showProgressIndicator: config?.showProgressIndicator === false ? false : true,
205
- customExportParams: config?.exportParams,
204
+ showProgressIndicator: exportConfig?.showProgressIndicator === false ? false : true,
205
+ customExportParams: exportConfig?.exportParams,
206
206
  });
207
207
  if (!exportedReport) {
208
208
  // for destination 'Download' and format 'Excel', 'VisualExcel' or 'Csv', AG Grid handles the download as well
@@ -1,6 +1,10 @@
1
1
  import * as Redux from 'redux';
2
2
  import { QuickSearchState } from '../../AdaptableState/QuickSearchState';
3
3
  import { AdaptableStyle } from '../../AdaptableState/Common/AdaptableStyle';
4
+ export declare const QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT: {
5
+ BackColor: string;
6
+ ForeColor: string;
7
+ };
4
8
  /**
5
9
  * @ReduxAction Runs Quick Search
6
10
  */
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuickSearchReducer = exports.QuickSearchReady = exports.QuickSearchSetCellMatchingStyle = exports.QuickSearchRun = exports.QUICK_SEARCH_READY = exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE = exports.QUICK_SEARCH_RUN = void 0;
3
+ exports.QuickSearchReducer = exports.QuickSearchReady = exports.QuickSearchSetCellMatchingStyle = exports.QuickSearchRun = exports.QUICK_SEARCH_READY = exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE = exports.QUICK_SEARCH_RUN = exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT = void 0;
4
4
  const ReduxConstants_1 = require("../../Utilities/Constants/ReduxConstants");
5
5
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
6
+ exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT = {
7
+ BackColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_BACK_COLOR,
8
+ ForeColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_FORE_COLOR,
9
+ };
6
10
  /**
7
11
  * @ReduxAction Runs Quick Search
8
12
  */
@@ -32,10 +36,6 @@ const QuickSearchReady = (quickSearchState) => ({
32
36
  exports.QuickSearchReady = QuickSearchReady;
33
37
  const initialState = {
34
38
  QuickSearchText: GeneralConstants_1.EMPTY_STRING,
35
- CellMatchStyle: {
36
- BackColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_BACK_COLOR,
37
- ForeColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_FORE_COLOR,
38
- },
39
39
  };
40
40
  const QuickSearchReducer = (state = initialState, action) => {
41
41
  switch (action.type) {
@@ -4,4 +4,5 @@ import { AdaptableApi } from '../Api/AdaptableApi';
4
4
  export declare class QuickSearchModule extends AdaptableModuleBase implements IModule {
5
5
  constructor(api: AdaptableApi);
6
6
  getViewProperties(): AdaptableModuleView;
7
+ onAdaptableReady(): void;
7
8
  }
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
7
  const QuickSearchStatusBarContent_1 = require("../View/QuickSearch/QuickSearchStatusBarContent");
8
+ const QuickSearchRedux_1 = require("../Redux/ActionsReducers/QuickSearchRedux");
8
9
  class QuickSearchModule extends AdaptableModuleBase_1.AdaptableModuleBase {
9
10
  constructor(api) {
10
11
  super(ModuleConstants.QuickSearchModuleId, ModuleConstants.QuickSearchFriendlyName, 'search-table', 'QuickSearchPopup', 'Quickly highlight all cells in the grid that contain matching query text', api);
@@ -18,5 +19,18 @@ class QuickSearchModule extends AdaptableModuleBase_1.AdaptableModuleBase {
18
19
  },
19
20
  };
20
21
  }
22
+ onAdaptableReady() {
23
+ const { api } = this;
24
+ const { internalApi, agGridApi } = api;
25
+ const isServerSideRowModel = agGridApi.getGridOption('rowModelType') === 'serverSide';
26
+ if (isServerSideRowModel &&
27
+ internalApi.getAdaptableState().QuickSearch.CellMatchStyle === undefined) {
28
+ // for server side row model,
29
+ // let's setup some defaults if there are no styles set
30
+ // as there are no defaults in the AG Grid find functionality (as it only works for non ssrm)
31
+ // so we need to set the defaults here
32
+ this.api.internalApi.dispatchReduxAction((0, QuickSearchRedux_1.QuickSearchSetCellMatchingStyle)(QuickSearchRedux_1.QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT));
33
+ }
34
+ }
21
35
  }
22
36
  exports.QuickSearchModule = QuickSearchModule;
@@ -48,7 +48,7 @@ const QuickSearchPopupComponent = (props) => {
48
48
  function mapStateToProps(state, ownProps) {
49
49
  return {
50
50
  QuickSearchText: state.QuickSearch.QuickSearchText,
51
- QuickSearchStyle: state.QuickSearch.CellMatchStyle,
51
+ QuickSearchStyle: state.QuickSearch.CellMatchStyle ?? {},
52
52
  };
53
53
  }
54
54
  function mapDispatchToProps(dispatch) {
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: 1750863018496 || Date.now(),
6
- VERSION: "20.2.2" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1750939331799 || Date.now(),
6
+ VERSION: "20.2.3" || '--current-version--',
7
7
  };
@@ -3074,6 +3074,17 @@ export declare const ADAPTABLE_METAMODEL: {
3074
3074
  ref: string;
3075
3075
  })[];
3076
3076
  };
3077
+ ExportConfig: {
3078
+ name: string;
3079
+ kind: string;
3080
+ desc: string;
3081
+ props: {
3082
+ name: string;
3083
+ kind: string;
3084
+ desc: string;
3085
+ isOpt: boolean;
3086
+ }[];
3087
+ };
3077
3088
  ExportDataFormatContext: {
3078
3089
  name: string;
3079
3090
  kind: string;
@@ -4718,19 +4729,12 @@ export declare const ADAPTABLE_METAMODEL: {
4718
4729
  name: string;
4719
4730
  kind: string;
4720
4731
  desc: string;
4721
- props: ({
4722
- name: string;
4723
- kind: string;
4724
- desc: string;
4725
- isOpt: boolean;
4726
- ref?: undefined;
4727
- } | {
4732
+ props: {
4728
4733
  name: string;
4729
4734
  kind: string;
4730
4735
  desc: string;
4731
4736
  isOpt: boolean;
4732
- ref: string;
4733
- })[];
4737
+ }[];
4734
4738
  };
4735
4739
  RaiseIntentConfig: {
4736
4740
  name: string;