iguazio.dashboard-react-controls 2.2.21 → 2.2.22

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.
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _reactTransitionGroup = require("react-transition-group");
10
10
  require("./Backdrop.scss");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
15
  /*
14
16
  Copyright 2022 Iguazio Systems Ltd.
15
17
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -33,7 +35,9 @@ const Backdrop = _ref => {
33
35
  show = false,
34
36
  onClose
35
37
  } = _ref;
38
+ const nodeRef = (0, _react.useRef)(null);
36
39
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
40
+ nodeRef: nodeRef,
37
41
  in: show,
38
42
  timeout: duration,
39
43
  classNames: "backdrop-transition",
@@ -41,7 +45,8 @@ const Backdrop = _ref => {
41
45
  unmountOnExit: true,
42
46
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
43
47
  className: "backdrop",
44
- onClick: onClose
48
+ onClick: onClose,
49
+ ref: nodeRef
45
50
  })
46
51
  });
47
52
  };
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _reactTransitionGroup = require("react-transition-group");
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -16,6 +16,8 @@ var _close = require("../../images/close.svg");
16
16
  require("./Modal.scss");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
21
  /*
20
22
  Copyright 2022 Iguazio Systems Ltd.
21
23
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -46,12 +48,14 @@ const Modal = _ref => {
46
48
  subTitle = null,
47
49
  title = ''
48
50
  } = _ref;
51
+ const nodeRef = (0, _react.useRef)(null);
49
52
  const modalClassNames = (0, _classnames.default)('modal', className, size && `modal-${size}`);
50
53
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
51
54
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
52
55
  onClose: onClose,
53
56
  show: show
54
57
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
58
+ nodeRef: nodeRef,
55
59
  in: show,
56
60
  timeout: 300,
57
61
  classNames: "modal-transition",
@@ -59,6 +63,7 @@ const Modal = _ref => {
59
63
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
60
64
  className: modalClassNames,
61
65
  "data-testid": "modal",
66
+ ref: nodeRef,
62
67
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
63
68
  className: "modal__header-button",
64
69
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RoundedIcon.default, {
@@ -95,6 +95,7 @@ const Tip = _ref => {
95
95
  "data-testid": "tip-icon"
96
96
  })
97
97
  }), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
98
+ nodeRef: tipBodyRef,
98
99
  in: isShow,
99
100
  timeout: 200,
100
101
  classNames: "fade",
@@ -63,8 +63,8 @@ const Tooltip = _ref => {
63
63
  const [child] = parentRef.current.childNodes;
64
64
  let show = !hidden && (textShow ? true : !child ? false : child.nodeType !== Node.TEXT_NODE && child.childNodes?.[0]?.nodeType !== Node.TEXT_NODE || (
65
65
  /*
66
- If the child node is a text node and the text of the child node inside the container is greater than the width of the container, then show tooltip.
67
- */
66
+ If the child node is a text node and the text of the child node inside the container is greater than the width of the container, then show tooltip.
67
+ */
68
68
  (child.nodeType === Node.TEXT_NODE || child.childNodes?.[0]?.nodeType === Node.TEXT_NODE) && parentRef.current.scrollWidth > parentRef.current.offsetWidth));
69
69
  setShow(show);
70
70
  setTimeout(() => {
@@ -152,11 +152,11 @@ const Tooltip = _ref => {
152
152
  onClick: handleMouseLeave,
153
153
  children: children
154
154
  }), !hidden && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
155
+ nodeRef: tooltipRef,
155
156
  classNames: "fade",
156
157
  in: show,
157
158
  timeout: duration,
158
159
  unmountOnExit: true,
159
- nodeRef: tooltipRef,
160
160
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
161
161
  "data-testid": id ? `${id}-tooltip` : 'tooltip',
162
162
  ref: tooltipRef,
@@ -4,13 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _reactTransitionGroup = require("react-transition-group");
10
10
  var _components = require("../../components");
11
11
  require("./optionsMenu.scss");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
16
  /*
15
17
  Copyright 2022 Iguazio Systems Ltd.
16
18
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -34,15 +36,18 @@ const OptionsMenu = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
34
36
  show = false,
35
37
  timeout = 300
36
38
  } = _ref;
39
+ const nodeRef = (0, _react.useRef)(null);
37
40
  const {
38
41
  width: dropdownWidth
39
42
  } = ref.current ? ref.current.getBoundingClientRect() : {};
40
43
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
44
+ nodeRef: nodeRef,
41
45
  in: show,
42
46
  timeout: timeout,
43
47
  classNames: "options-menu-transition",
44
48
  unmountOnExit: true,
45
49
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PopUpDialog, {
50
+ ref: nodeRef,
46
51
  headerIsHidden: true,
47
52
  className: "options-menu",
48
53
  customPosition: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "2.2.21",
3
+ "version": "2.2.22",
4
4
  "description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",