@adaptabletools/adaptable-react-aggrid 18.1.9 → 18.1.11

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,13 +1,13 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-react-aggrid",
3
- "version": "18.1.9",
3
+ "version": "18.1.11",
4
4
  "description": "React version of AdapTable - the powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [],
6
6
  "license": "contact sales@adaptabletools.com for details",
7
7
  "typings": "src/index.d.ts",
8
8
  "dependencies": {
9
9
  "tslib": "^2.3.0",
10
- "@adaptabletools/adaptable": "18.1.9"
10
+ "@adaptabletools/adaptable": "18.1.11"
11
11
  },
12
12
  "peerDependencies": {
13
13
  "@ag-grid-community/core": ">=31.3.1",
@@ -1,6 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import * as React from 'react';
3
- import { useMemo } from 'react';
3
+ import { useMemo, useState } from 'react';
4
4
  import { _AdaptableAgGrid } from '@adaptabletools/adaptable/agGrid';
5
5
  import { setupFrameworkComponents } from '../setupFrameworkComponents';
6
6
  import join from '../utils/join';
@@ -10,6 +10,7 @@ const AdaptableReact = (_a) => {
10
10
  const seedId = useMemo(() => `${getRandomInt(1000)}-${Date.now()}`, []);
11
11
  // TODO: not sure this is used anywhere
12
12
  const adaptableContainerId = `adaptable-${seedId}`;
13
+ const [adaptableJSXElement, setAdaptableJSXElement] = useState(null);
13
14
  const containerRef = useMemo(() => {
14
15
  let adaptableApi;
15
16
  return (node) => {
@@ -24,6 +25,8 @@ const AdaptableReact = (_a) => {
24
25
  })
25
26
  .then((api) => {
26
27
  adaptableApi = api;
28
+ //see #no_additional_react_root
29
+ setAdaptableJSXElement(api.internalApi.getAdaptableJSXElement());
27
30
  if (onAdaptableReady) {
28
31
  adaptableApi.eventApi.on('AdaptableReady', onAdaptableReady);
29
32
  }
@@ -41,6 +44,6 @@ const AdaptableReact = (_a) => {
41
44
  }
42
45
  };
43
46
  }, []);
44
- return (React.createElement("div", { style: props.style, ref: containerRef, id: adaptableContainerId, className: join(props.className, 'ab__react-wrapper') }));
47
+ return (React.createElement("div", { style: props.style, ref: containerRef, id: adaptableContainerId, className: join(props.className, 'ab__react-wrapper') }, adaptableJSXElement));
45
48
  };
46
49
  export default AdaptableReact;
@@ -7,6 +7,9 @@ export const setupFrameworkComponents = (adaptableApi) => {
7
7
  if (command === 'create') {
8
8
  try {
9
9
  adaptableApi.logInfo(`Mounting custom framework component ${componentType}`, containerDomNode);
10
+ if (adaptableApi.gridApi.getVariant() === 'react') {
11
+ return;
12
+ }
10
13
  const ReactComponent = frameworkComponent;
11
14
  const unmount = adaptableApi.internalApi
12
15
  .getAdaptableInstance()
@@ -19,6 +22,9 @@ export const setupFrameworkComponents = (adaptableApi) => {
19
22
  }
20
23
  else {
21
24
  adaptableApi.logInfo(`Unmounting custom framework component ${componentType}`, containerDomNode);
25
+ if (adaptableApi.gridApi.getVariant() === 'react') {
26
+ return;
27
+ }
22
28
  try {
23
29
  const unmount = weakMap.get(containerDomNode);
24
30
  weakMap.delete(containerDomNode);