@adaptabletools/adaptable 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",
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
  */
@@ -1930,12 +1930,18 @@ export class AdaptableAgGrid {
1930
1930
  }
1931
1931
  resolve(transaction === null || transaction === void 0 ? void 0 : transaction.update);
1932
1932
  });
1933
+ if (dataUpdateConfig.flushAsync) {
1934
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
1935
+ }
1933
1936
  });
1934
1937
  }
1935
1938
  else {
1936
1939
  const transaction = this.agGridAdapter.getAgGridApi().applyTransaction({
1937
1940
  update: dataRows,
1938
1941
  });
1942
+ if (dataUpdateConfig.flushAsync) {
1943
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
1944
+ }
1939
1945
  return Promise.resolve(transaction === null || transaction === void 0 ? void 0 : transaction.update);
1940
1946
  }
1941
1947
  }
@@ -1957,10 +1963,16 @@ export class AdaptableAgGrid {
1957
1963
  resolve(transaction === null || transaction === void 0 ? void 0 : transaction.add);
1958
1964
  this.updateRowGroupsExpandedState();
1959
1965
  });
1966
+ if (dataUpdateConfig.flushAsync) {
1967
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
1968
+ }
1960
1969
  });
1961
1970
  }
1962
1971
  else {
1963
1972
  const transaction = this.agGridAdapter.getAgGridApi().applyTransaction(newData);
1973
+ if (dataUpdateConfig.flushAsync) {
1974
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
1975
+ }
1964
1976
  this.updateRowGroupsExpandedState();
1965
1977
  return Promise.resolve(transaction === null || transaction === void 0 ? void 0 : transaction.add);
1966
1978
  }
@@ -1990,11 +2002,17 @@ export class AdaptableAgGrid {
1990
2002
  if (typeof dataUpdateConfig.callback === 'function') {
1991
2003
  dataUpdateConfig.callback(transaction);
1992
2004
  }
2005
+ if (transaction === null || transaction === void 0 ? void 0 : transaction.add) {
2006
+ this.updateRowGroupsExpandedState();
2007
+ }
1993
2008
  resolve({
1994
2009
  added: transaction === null || transaction === void 0 ? void 0 : transaction.add,
1995
2010
  updated: transaction === null || transaction === void 0 ? void 0 : transaction.update,
1996
2011
  });
1997
2012
  });
2013
+ if (dataUpdateConfig.flushAsync) {
2014
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2015
+ }
1998
2016
  });
1999
2017
  }
2000
2018
  else {
@@ -2003,6 +2021,12 @@ export class AdaptableAgGrid {
2003
2021
  add: addDataRows,
2004
2022
  addIndex: dataUpdateConfig.addIndex,
2005
2023
  });
2024
+ if (transaction === null || transaction === void 0 ? void 0 : transaction.add) {
2025
+ this.updateRowGroupsExpandedState();
2026
+ }
2027
+ if (dataUpdateConfig.flushAsync) {
2028
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2029
+ }
2006
2030
  return Promise.resolve({
2007
2031
  added: transaction === null || transaction === void 0 ? void 0 : transaction.add,
2008
2032
  updated: transaction === null || transaction === void 0 ? void 0 : transaction.update,
@@ -2021,12 +2045,18 @@ export class AdaptableAgGrid {
2021
2045
  }
2022
2046
  resolve(transaction === null || transaction === void 0 ? void 0 : transaction.remove);
2023
2047
  });
2048
+ if (dataUpdateConfig.flushAsync) {
2049
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2050
+ }
2024
2051
  });
2025
2052
  }
2026
2053
  else {
2027
2054
  const transaction = this.agGridAdapter.getAgGridApi().applyTransaction({
2028
2055
  remove: dataRows,
2029
2056
  });
2057
+ if (dataUpdateConfig.flushAsync) {
2058
+ this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
2059
+ }
2030
2060
  return Promise.resolve(transaction.remove);
2031
2061
  }
2032
2062
  }
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  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" || '',
3
- PUBLISH_TIMESTAMP: 1710513512221 || Date.now(),
4
- VERSION: "18.0.0-canary.5" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1710607821606 || Date.now(),
4
+ VERSION: "18.0.0-canary.6" || '--current-version--',
5
5
  };