@adaptabletools/adaptable 16.2.0-canary.3 → 16.2.0

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",
3
- "version": "16.2.0-canary.3",
3
+ "version": "16.2.0",
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",
@@ -1,2 +1,2 @@
1
- declare const _default: 1700578109539;
1
+ declare const _default: 1700657829772;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1700578109539;
3
+ exports.default = 1700657829772;
@@ -19,17 +19,17 @@ export interface DataImportOptions<T = Record<string, unknown>> {
19
19
  /**
20
20
  * Function to handle the Imported Data and apply it to the Grid. If not provided then the Data will be applied to the Grid automatically.
21
21
  */
22
- handleImportedData?: (context: HandleImportedDataContext<T>) => Promise<HandleImportedDataResolution>;
22
+ handleImportedData?: (context: HandleImportedDataContext<T>) => Promise<void | HandleImportedDataResolution>;
23
23
  /**
24
24
  * Function to pre-process the data before it is imported
25
25
  *
26
- * @experimental might change in a future version
26
+ * @experimental It might change in a future version
27
27
  */
28
28
  _preprocessData?: (context: PreprocessDataContext<T>) => Record<string, unknown>[];
29
29
  /**
30
30
  * Function to get the Primary Key value for a data row (defaults to value of the primaryKey column)
31
31
  *
32
- * @experimental might change in a future version
32
+ * @experimental It might change in a future version
33
33
  */
34
34
  _getPrimaryKeyValue?: (context: GetPrimaryKeyValueContext<T>) => string | number;
35
35
  }
@@ -78,16 +78,16 @@ export interface DataImportValidationError {
78
78
  error: string;
79
79
  }
80
80
  /**
81
- * Context that manages Data Validation
81
+ * Context passed to the `validate` function
82
82
  */
83
83
  export interface DataImportValidateContext<T = Record<string, unknown>> extends BaseContext {
84
84
  /**
85
- * Data being validated
85
+ * Imported Row Data
86
86
  */
87
87
  rowData: T;
88
88
  }
89
89
  /**
90
- * Context used to define the Primary Key for a row
90
+ * Context passed to the `getPrimaryKeyValue` function
91
91
  */
92
92
  export interface GetPrimaryKeyValueContext<T = Record<string, unknown>> extends BaseContext {
93
93
  /**
@@ -102,7 +102,7 @@ export interface HandleImportedDataResolution {
102
102
  /**
103
103
  * Whether to emit the `DataImported` event
104
104
  */
105
- emitDataImportedEvent?: boolean;
105
+ emitDataImportedEvent: boolean;
106
106
  /**
107
107
  * Rows that were added
108
108
  */
@@ -12,9 +12,9 @@ class DataImportInternalApi extends ApiBase_1.ApiBase {
12
12
  importData = dataImportOptions._preprocessData(Object.assign({ data: partialRows }, (0, ObjectFactory_1.createBaseContext)(this.getAdaptableApi())));
13
13
  }
14
14
  if (typeof dataImportOptions.handleImportedData === 'function') {
15
- const { emitDataImportedEvent, updatedRows, addedRows } = await dataImportOptions.handleImportedData(Object.assign({ data: importData }, (0, ObjectFactory_1.createBaseContext)(this.getAdaptableApi())));
16
- if (emitDataImportedEvent) {
17
- this.publishDataImportedEvent(importData, addedRows, updatedRows);
15
+ const resolution = await dataImportOptions.handleImportedData(Object.assign({ data: importData }, (0, ObjectFactory_1.createBaseContext)(this.getAdaptableApi())));
16
+ if (resolution && (resolution === null || resolution === void 0 ? void 0 : resolution.emitDataImportedEvent)) {
17
+ this.publishDataImportedEvent(importData, resolution.addedRows, resolution.updatedRows);
18
18
  }
19
19
  return;
20
20
  }
@@ -3503,17 +3503,11 @@ export declare const ADAPTABLE_METAMODEL: {
3503
3503
  name: string;
3504
3504
  kind: string;
3505
3505
  desc: string;
3506
- props: ({
3507
- name: string;
3508
- kind: string;
3509
- desc: string;
3510
- isOpt?: undefined;
3511
- } | {
3506
+ props: {
3512
3507
  name: string;
3513
3508
  kind: string;
3514
3509
  desc: string;
3515
- isOpt: boolean;
3516
- })[];
3510
+ }[];
3517
3511
  };
3518
3512
  IAdaptableNoCodeWizard: {
3519
3513
  name: string;