@dhis2-ui/portal 9.11.0 → 9.11.1-beta.1

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.
@@ -9,5 +9,4 @@ Object.defineProperty(exports, "Portal", {
9
9
  return _portal.Portal;
10
10
  }
11
11
  });
12
-
13
12
  var _portal = require("./portal.js");
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Portal = void 0;
7
-
8
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
-
10
8
  var _react = require("react");
11
-
12
9
  var _reactDom = require("react-dom");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
11
  /*
17
12
  * #dhis2-portal-root is provided by the App Platform and will be used by
18
13
  * default.
@@ -25,7 +20,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
25
20
  * This needs to be a function so that it works in tests as well.
26
21
  */
27
22
  const getDefaultNode = () => document.getElementById('dhis2-portal-root') || document.body;
28
-
29
23
  const Portal = _ref => {
30
24
  let {
31
25
  children,
@@ -36,14 +30,11 @@ const Portal = _ref => {
36
30
  (0, _react.useEffect)(() => {
37
31
  setMountNode(node || getDefaultNode());
38
32
  }, [node]);
39
-
40
33
  if (disable) {
41
34
  return children;
42
35
  }
43
-
44
36
  return mountNode ? /*#__PURE__*/(0, _reactDom.createPortal)(children, mountNode) : mountNode;
45
37
  };
46
-
47
38
  exports.Portal = Portal;
48
39
  Portal.propTypes = {
49
40
  children: _propTypes.default.node,
@@ -1,6 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import { useState, useEffect } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
+
4
5
  /*
5
6
  * #dhis2-portal-root is provided by the App Platform and will be used by
6
7
  * default.
@@ -12,9 +13,7 @@ import { createPortal } from 'react-dom';
12
13
  *
13
14
  * This needs to be a function so that it works in tests as well.
14
15
  */
15
-
16
16
  const getDefaultNode = () => document.getElementById('dhis2-portal-root') || document.body;
17
-
18
17
  export const Portal = _ref => {
19
18
  let {
20
19
  children,
@@ -25,11 +24,9 @@ export const Portal = _ref => {
25
24
  useEffect(() => {
26
25
  setMountNode(node || getDefaultNode());
27
26
  }, [node]);
28
-
29
27
  if (disable) {
30
28
  return children;
31
29
  }
32
-
33
30
  return mountNode ? /*#__PURE__*/createPortal(children, mountNode) : mountNode;
34
31
  };
35
32
  Portal.propTypes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/portal",
3
- "version": "9.11.0",
3
+ "version": "9.11.1-beta.1",
4
4
  "description": "UI Portal",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,13 +22,13 @@
22
22
  "access": "public"
23
23
  },
24
24
  "scripts": {
25
- "start": "start-storybook -c ../../storybook/config --port 5000",
25
+ "start": "storybook dev -c ../../storybook/config --port 5000",
26
26
  "build": "d2-app-scripts build",
27
27
  "test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
28
28
  },
29
29
  "peerDependencies": {
30
- "react": "^16.8",
31
- "react-dom": "^16.8",
30
+ "react": "^16.13",
31
+ "react-dom": "^16.13",
32
32
  "styled-jsx": "^4"
33
33
  },
34
34
  "dependencies": {