@adaptabletools/adaptable-react-aggrid 13.0.0-canary.1 → 13.0.0-canary.2

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",
3
- "version": "13.0.0-canary.1",
3
+ "version": "13.0.0-canary.2",
4
4
  "description": "React version of AdapTable - the powerful AG Grid add-on that provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [],
6
6
  "license": "contact sales@adaptabletools.com for details",
@@ -19,13 +19,13 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "tslib": "^2.3.0",
22
- "@adaptabletools/adaptable": "13.0.0-canary.1"
22
+ "@adaptabletools/adaptable": "13.0.0-canary.2"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@ag-grid-community/core": ">=28.1.0",
26
26
  "@ag-grid-community/react": ">=28.1.0",
27
- "react": "^16.8.0 || ^17.0.0",
28
- "react-dom": "^16.8.0 || ^17.0.0"
27
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
28
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=6.0.0"
@@ -8,6 +8,17 @@ export interface AdaptableReactProps extends React.HTMLProps<HTMLDivElement> {
8
8
  adaptableApi: AdaptableApi;
9
9
  gridOptions: GridOptions;
10
10
  }) => void;
11
+ /**
12
+ * Accepts any jsx content and an HTML node (container) and renders the jsx into the node.
13
+ *
14
+ * The return value should be a function that, when called, unmounts the jsx element/component from the node.
15
+ *
16
+ * This is useful when your app runs on React 18. Adaptable works with older versions of React as well, so we need to suport everyone.
17
+ * See details about React 18 changes at https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis
18
+ *
19
+ * Providing this function and using React 18 APIs to render elements will help you avoid a runtime warning.
20
+ */
21
+ renderReactRoot?: (el: JSX.Element, container: HTMLElement) => VoidFunction;
11
22
  }
12
23
  declare const AdaptableReact: React.FunctionComponent<AdaptableReactProps>;
13
24
  export default AdaptableReact;
@@ -18,14 +18,14 @@ if (package_json_1.version !== version_1.default) {
18
18
  }
19
19
  const getRandomInt = (max) => Math.floor(Math.random() * Math.floor(max));
20
20
  const AdaptableReact = (_a) => {
21
- var { adaptableOptions, gridOptions, onAdaptableReady } = _a, props = tslib_1.__rest(_a, ["adaptableOptions", "gridOptions", "onAdaptableReady"]);
21
+ var { adaptableOptions, gridOptions, onAdaptableReady, renderReactRoot } = _a, props = tslib_1.__rest(_a, ["adaptableOptions", "gridOptions", "onAdaptableReady", "renderReactRoot"]);
22
22
  const seedId = (0, react_1.useMemo)(() => `${getRandomInt(1000)}-${Date.now()}`, []);
23
23
  const adaptableContainerId = `adaptable-${seedId}`;
24
24
  const containerRef = (0, react_1.useMemo)(() => {
25
25
  let adaptableApi;
26
26
  return (node) => {
27
27
  if (node) {
28
- agGrid_1.default.initInternal(Object.assign(Object.assign({}, adaptableOptions), { containerOptions: Object.assign(Object.assign({}, adaptableOptions.containerOptions), { adaptableContainer: node }), gridOptions: gridOptions || adaptableOptions.gridOptions }), { waitForAgGrid: true }).then((api) => {
28
+ agGrid_1.default.initInternal(Object.assign(Object.assign({}, adaptableOptions), { containerOptions: Object.assign(Object.assign({}, adaptableOptions.containerOptions), { adaptableContainer: node }), gridOptions: gridOptions || adaptableOptions.gridOptions }), { waitForAgGrid: true, renderReactRoot }).then((api) => {
29
29
  adaptableApi = api;
30
30
  (0, logger_1.LogAdaptableInfo)('AdaptableReady');
31
31
  if (onAdaptableReady) {