@adaptabletools/adaptable 14.0.0-canary.3 → 14.0.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": "14.0.0-canary.3",
3
+ "version": "14.0.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: 1671805663015;
1
+ declare const _default: 1671833413485;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1671805663015;
3
+ exports.default = 1671833413485;
@@ -115,7 +115,7 @@ export interface IAdaptable {
115
115
  columnId: string;
116
116
  updateValueCallback: (updatedValue: any) => void;
117
117
  }): Promise<any>;
118
- _emit(eventName: 'FrameworkComponentChange', data: {
118
+ _emitSync(eventName: 'FrameworkComponentChange', data: {
119
119
  command: 'create' | 'destroy';
120
120
  containerDomNode: HTMLElement;
121
121
  frameworkComponent: AdaptableFrameworkComponent;
@@ -3,14 +3,6 @@ import { AdaptableFDC3EventInfo, SelectionChangedInfo, LiveDataChangedInfo, Dash
3
3
  * Responsible for publishing the many Events that AdapTable fires
4
4
  */
5
5
  export interface EventApi {
6
- /**
7
- * @deprecated - use `FilterApplied`, `QueryRun` or `GridSorted` instead
8
- */
9
- on(eventName: 'SearchChanged', callback: (searchChangedInfo: SearchChangedInfo) => void): VoidFunction;
10
- /**
11
- *@deprecated - use `FilterApplied`, `QueryRun` or `GridSorted` instead
12
- */
13
- off(eventName: 'SearchChanged', callback: (searchChangedInfo: SearchChangedInfo) => void): void;
14
6
  /**
15
7
  * Event fired whenever AdapTable is Sorted
16
8
  * @param eventName GridSorted
@@ -289,6 +281,14 @@ export interface EventApi {
289
281
  * Unsubscribe from FDC3MessageSent
290
282
  */
291
283
  off(eventName: 'FDC3MessageSent', callback: (eventInfo: AdaptableFDC3EventInfo) => void): void;
284
+ /**
285
+ * @deprecated - use `FilterApplied`, `QueryRun` or `GridSorted` instead
286
+ */
287
+ on(eventName: 'SearchChanged', callback: (searchChangedInfo: SearchChangedInfo) => void): VoidFunction;
288
+ /**
289
+ * @deprecated - use `FilterApplied`, `QueryRun` or `GridSorted` instead
290
+ */
291
+ off(eventName: 'SearchChanged', callback: (searchChangedInfo: SearchChangedInfo) => void): void;
292
292
  emitSync(eventName: 'DashboardChanged', data?: any): any[];
293
293
  emitSync(eventName: 'FlashingCellDisplayed', data?: any): any[];
294
294
  emitSync(eventName: 'AdaptableDestroy'): any[];
@@ -231,7 +231,7 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
231
231
  createFrameworkComponent(containerDomNode, frameworkComponent, componentType) {
232
232
  const createComponentFn = () =>
233
233
  // delegate the logic to framework wrapper
234
- this.adaptable._emit('FrameworkComponentChange', {
234
+ this.adaptable._emitSync('FrameworkComponentChange', {
235
235
  command: 'create',
236
236
  containerDomNode,
237
237
  frameworkComponent,
@@ -249,7 +249,7 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
249
249
  }
250
250
  }
251
251
  destroyFrameworkComponent(containerDomNode, frameworkComponent, componentType) {
252
- this.adaptable._emit('FrameworkComponentChange', {
252
+ this.adaptable._emitSync('FrameworkComponentChange', {
253
253
  command: 'destroy',
254
254
  containerDomNode,
255
255
  frameworkComponent,
@@ -43,9 +43,15 @@ const CustomToolbarWrapper = (props) => {
43
43
  if (props.customToolbar.frameworkComponent) {
44
44
  adaptableApi.internalApi.createFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
45
45
  }
46
+ const destroyUnsubscribe = adaptableApi.eventApi.on('AdaptableDestroy', () => {
47
+ var _a;
48
+ (_a = adaptableApi === null || adaptableApi === void 0 ? void 0 : adaptableApi.internalApi) === null || _a === void 0 ? void 0 : _a.destroyFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
49
+ });
46
50
  return () => {
51
+ var _a;
52
+ destroyUnsubscribe();
47
53
  if (props.customToolbar.frameworkComponent) {
48
- adaptableApi.internalApi.destroyFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
54
+ (_a = adaptableApi === null || adaptableApi === void 0 ? void 0 : adaptableApi.internalApi) === null || _a === void 0 ? void 0 : _a.destroyFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
49
55
  }
50
56
  };
51
57
  }, []);
@@ -363,7 +363,10 @@ class Adaptable {
363
363
  // but we might need to do this again in the future for some other components that are not native React
364
364
  // captureReactWarnings();
365
365
  if (typeof unmount === 'function') {
366
- unmount();
366
+ // rAF is required, otherwise the unmount would be performed during the rendering phase and React doesn't like that
367
+ requestAnimationFrame(() => {
368
+ unmount();
369
+ });
367
370
  }
368
371
  // releaseReactWarnings();
369
372
  };
@@ -154,6 +154,9 @@ class agGridHelper {
154
154
  return (0, PercentBarRenderer_1.getPercentBarRendererForColumn)(styledColumn, abColumn, this.adaptable.api);
155
155
  }
156
156
  getCleanValue(value) {
157
+ if (typeof value === 'string') {
158
+ return value;
159
+ }
157
160
  if (value == null || value == 'null' || value == undefined || value == 'undefined') {
158
161
  return undefined;
159
162
  }