@adaptabletools/adaptable-react-aggrid-cjs 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-react-aggrid-cjs",
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",
@@ -8,7 +8,7 @@
8
8
  "typings": "src/index.d.ts",
9
9
  "dependencies": {
10
10
  "tslib": "^2.3.0",
11
- "@adaptabletools/adaptable-cjs": "18.1.9"
11
+ "@adaptabletools/adaptable-cjs": "18.1.11"
12
12
  },
13
13
  "peerDependencies": {
14
14
  "react": "^18.0.0",
@@ -12,6 +12,7 @@ const AdaptableReact = (_a) => {
12
12
  const seedId = (0, react_1.useMemo)(() => `${getRandomInt(1000)}-${Date.now()}`, []);
13
13
  // TODO: not sure this is used anywhere
14
14
  const adaptableContainerId = `adaptable-${seedId}`;
15
+ const [adaptableJSXElement, setAdaptableJSXElement] = (0, react_1.useState)(null);
15
16
  const containerRef = (0, react_1.useMemo)(() => {
16
17
  let adaptableApi;
17
18
  return (node) => {
@@ -26,6 +27,8 @@ const AdaptableReact = (_a) => {
26
27
  })
27
28
  .then((api) => {
28
29
  adaptableApi = api;
30
+ //see #no_additional_react_root
31
+ setAdaptableJSXElement(api.internalApi.getAdaptableJSXElement());
29
32
  if (onAdaptableReady) {
30
33
  adaptableApi.eventApi.on('AdaptableReady', onAdaptableReady);
31
34
  }
@@ -43,6 +46,6 @@ const AdaptableReact = (_a) => {
43
46
  }
44
47
  };
45
48
  }, []);
46
- return (React.createElement("div", { style: props.style, ref: containerRef, id: adaptableContainerId, className: (0, join_1.default)(props.className, 'ab__react-wrapper') }));
49
+ return (React.createElement("div", { style: props.style, ref: containerRef, id: adaptableContainerId, className: (0, join_1.default)(props.className, 'ab__react-wrapper') }, adaptableJSXElement));
47
50
  };
48
51
  exports.default = AdaptableReact;
@@ -11,6 +11,9 @@ const setupFrameworkComponents = (adaptableApi) => {
11
11
  if (command === 'create') {
12
12
  try {
13
13
  adaptableApi.logInfo(`Mounting custom framework component ${componentType}`, containerDomNode);
14
+ if (adaptableApi.gridApi.getVariant() === 'react') {
15
+ return;
16
+ }
14
17
  const ReactComponent = frameworkComponent;
15
18
  const unmount = adaptableApi.internalApi
16
19
  .getAdaptableInstance()
@@ -23,6 +26,9 @@ const setupFrameworkComponents = (adaptableApi) => {
23
26
  }
24
27
  else {
25
28
  adaptableApi.logInfo(`Unmounting custom framework component ${componentType}`, containerDomNode);
29
+ if (adaptableApi.gridApi.getVariant() === 'react') {
30
+ return;
31
+ }
26
32
  try {
27
33
  const unmount = weakMap.get(containerDomNode);
28
34
  weakMap.delete(containerDomNode);