@adaptabletools/adaptable-cjs 18.0.0-canary.5 → 18.0.0-canary.6

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": "18.0.0-canary.5",
3
+ "version": "18.0.0-canary.6",
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",
@@ -6,6 +6,14 @@ export interface DataUpdateConfig {
6
6
  * Whether data should be updated asynchronously
7
7
  */
8
8
  runAsync?: boolean;
9
+ /**
10
+ * Whether to flush async updates.
11
+ *
12
+ * If `true`, any async transactions will be flushed.
13
+ * This flag can be true even if you runAsync is `false`.
14
+ * So even if the currenct transaction/operation is synchronous, this will flush existing async transactions.
15
+ */
16
+ flushAsync?: boolean;
9
17
  /**
10
18
  * Callback function invoked when a batch successfully updates
11
19
  */
@@ -1934,12 +1934,18 @@ class AdaptableAgGrid {
1934
1934
  }
1935
1935
  resolve(transaction === null || transaction === void 0 ? void 0 : transaction.update);
1936
1936
  });
1937
+ if (dataUpdateConfig.flushAsync) {
1938
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
1939
+ }
1937
1940
  });
1938
1941
  }
1939
1942
  else {
1940
1943
  const transaction = this.agGridAdapter.getAgGridApi().applyTransaction({
1941
1944
  update: dataRows,
1942
1945
  });
1946
+ if (dataUpdateConfig.flushAsync) {
1947
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
1948
+ }
1943
1949
  return Promise.resolve(transaction === null || transaction === void 0 ? void 0 : transaction.update);
1944
1950
  }
1945
1951
  }
@@ -1961,10 +1967,16 @@ class AdaptableAgGrid {
1961
1967
  resolve(transaction === null || transaction === void 0 ? void 0 : transaction.add);
1962
1968
  this.updateRowGroupsExpandedState();
1963
1969
  });
1970
+ if (dataUpdateConfig.flushAsync) {
1971
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
1972
+ }
1964
1973
  });
1965
1974
  }
1966
1975
  else {
1967
1976
  const transaction = this.agGridAdapter.getAgGridApi().applyTransaction(newData);
1977
+ if (dataUpdateConfig.flushAsync) {
1978
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
1979
+ }
1968
1980
  this.updateRowGroupsExpandedState();
1969
1981
  return Promise.resolve(transaction === null || transaction === void 0 ? void 0 : transaction.add);
1970
1982
  }
@@ -1994,11 +2006,17 @@ class AdaptableAgGrid {
1994
2006
  if (typeof dataUpdateConfig.callback === 'function') {
1995
2007
  dataUpdateConfig.callback(transaction);
1996
2008
  }
2009
+ if (transaction === null || transaction === void 0 ? void 0 : transaction.add) {
2010
+ this.updateRowGroupsExpandedState();
2011
+ }
1997
2012
  resolve({
1998
2013
  added: transaction === null || transaction === void 0 ? void 0 : transaction.add,
1999
2014
  updated: transaction === null || transaction === void 0 ? void 0 : transaction.update,
2000
2015
  });
2001
2016
  });
2017
+ if (dataUpdateConfig.flushAsync) {
2018
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2019
+ }
2002
2020
  });
2003
2021
  }
2004
2022
  else {
@@ -2007,6 +2025,12 @@ class AdaptableAgGrid {
2007
2025
  add: addDataRows,
2008
2026
  addIndex: dataUpdateConfig.addIndex,
2009
2027
  });
2028
+ if (transaction === null || transaction === void 0 ? void 0 : transaction.add) {
2029
+ this.updateRowGroupsExpandedState();
2030
+ }
2031
+ if (dataUpdateConfig.flushAsync) {
2032
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2033
+ }
2010
2034
  return Promise.resolve({
2011
2035
  added: transaction === null || transaction === void 0 ? void 0 : transaction.add,
2012
2036
  updated: transaction === null || transaction === void 0 ? void 0 : transaction.update,
@@ -2025,12 +2049,18 @@ class AdaptableAgGrid {
2025
2049
  }
2026
2050
  resolve(transaction === null || transaction === void 0 ? void 0 : transaction.remove);
2027
2051
  });
2052
+ if (dataUpdateConfig.flushAsync) {
2053
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2054
+ }
2028
2055
  });
2029
2056
  }
2030
2057
  else {
2031
2058
  const transaction = this.agGridAdapter.getAgGridApi().applyTransaction({
2032
2059
  remove: dataRows,
2033
2060
  });
2061
+ if (dataUpdateConfig.flushAsync) {
2062
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2063
+ }
2034
2064
  return Promise.resolve(transaction.remove);
2035
2065
  }
2036
2066
  }
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  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: 1710513543012 || Date.now(),
6
- VERSION: "18.0.0-canary.5" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1710607851386 || Date.now(),
6
+ VERSION: "18.0.0-canary.6" || '--current-version--',
7
7
  };