iguazio.dashboard-react-controls 1.8.7 → 1.8.9

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,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _reactDom = require("react-dom");
12
+ var _lodash = require("lodash");
12
13
  var _RoundedIcon = _interopRequireDefault(require("../RoundedIcon/RoundedIcon"));
13
14
  var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
14
15
  var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
@@ -63,20 +64,22 @@ var PopUpDialog = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
63
64
  setShowPopUp(false);
64
65
  }, [closePopUp]);
65
66
  var calculateCustomPopUpPosition = (0, _react.useCallback)(function () {
66
- if (customPosition && customPosition.element) {
67
- var _ref3;
67
+ var _customPosition$eleme, _ref3;
68
+ if (customPosition !== null && customPosition !== void 0 && (_customPosition$eleme = customPosition.element) !== null && _customPosition$eleme !== void 0 && _customPosition$eleme.current && (_ref3 = ref) !== null && _ref3 !== void 0 && _ref3.current) {
68
69
  var elementRect = customPosition.element.current.getBoundingClientRect();
69
- var popUpRect = (_ref3 = ref) === null || _ref3 === void 0 ? void 0 : _ref3.current.getBoundingClientRect();
70
+ var popUpRect = ref.current.getBoundingClientRect();
70
71
  var _customPosition$posit = customPosition.position.split('-'),
71
72
  _customPosition$posit2 = _slicedToArray(_customPosition$posit, 2),
72
73
  verticalPosition = _customPosition$posit2[0],
73
74
  horizontalPosition = _customPosition$posit2[1];
75
+ var popupMargin = 15;
76
+ var elementMargin = 5;
74
77
  var leftPosition = horizontalPosition === 'left' ? elementRect.right - popUpRect.width : elementRect.left;
75
78
  var topPosition;
76
79
  if (verticalPosition === 'top') {
77
- topPosition = elementRect.top > popUpRect.height ? elementRect.top - popUpRect.height - 5 : 5;
80
+ topPosition = elementRect.top > popUpRect.height + popupMargin ? elementRect.top - popUpRect.height - elementMargin : popupMargin;
78
81
  } else {
79
- topPosition = popUpRect.height + elementRect.bottom > window.innerHeight ? window.innerHeight - popUpRect.height - 5 : elementRect.bottom + 5;
82
+ topPosition = popUpRect.height + elementRect.bottom + popupMargin > window.innerHeight ? window.innerHeight - popUpRect.height - popupMargin : elementRect.bottom + elementMargin;
80
83
  }
81
84
  ref.current.style.top = "".concat(topPosition, "px");
82
85
  if (style.left) {
@@ -90,9 +93,13 @@ var PopUpDialog = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
90
93
  calculateCustomPopUpPosition();
91
94
  }, [calculateCustomPopUpPosition]);
92
95
  (0, _react.useEffect)(function () {
93
- window.addEventListener('resize', calculateCustomPopUpPosition);
96
+ var throttledCalculatedCustomPopUpPosition = (0, _lodash.throttle)(calculateCustomPopUpPosition, 100, {
97
+ trailing: true,
98
+ leading: true
99
+ });
100
+ window.addEventListener('resize', throttledCalculatedCustomPopUpPosition);
94
101
  return function () {
95
- window.removeEventListener('resize', calculateCustomPopUpPosition);
102
+ window.removeEventListener('resize', throttledCalculatedCustomPopUpPosition);
96
103
  };
97
104
  });
98
105
  return showPopUp ? /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -165,6 +165,7 @@ var Wizard = function Wizard(_ref) {
165
165
  if (getActions) {
166
166
  var actions = getActions({
167
167
  allStepsAreEnabled: allStepsAreEnabled,
168
+ jumpToStep: jumpToStep,
168
169
  goToFirstInvalidStep: goToFirstInvalidStep
169
170
  });
170
171
  var mainActions = actions.map(function (action) {
@@ -9,30 +9,27 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _plus = require("../../images/plus.svg");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
13
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*
16
- Copyright 2019 Iguazio Systems Ltd.
17
-
18
- Licensed under the Apache License, Version 2.0 (the "License") with
19
- an addition restriction as set forth herein. You may not use this
20
- file except in compliance with the License. You may obtain a copy of
21
- the License at http://www.apache.org/licenses/LICENSE-2.0.
22
-
23
- Unless required by applicable law or agreed to in writing, software
24
- distributed under the License is distributed on an "AS IS" BASIS,
25
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
26
- implied. See the License for the specific language governing
27
- permissions and limitations under the License.
28
-
29
- In addition, you may not use the software for any purposes that are
30
- illegal under applicable law, and the grant of the foregoing license
31
- under the Apache 2.0 license is conditioned upon your compliance with
32
- such restriction.
33
- */
12
+ /*
13
+ Copyright 2019 Iguazio Systems Ltd.
14
+
15
+ Licensed under the Apache License, Version 2.0 (the "License") with
16
+ an addition restriction as set forth herein. You may not use this
17
+ file except in compliance with the License. You may obtain a copy of
18
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
19
+
20
+ Unless required by applicable law or agreed to in writing, software
21
+ distributed under the License is distributed on an "AS IS" BASIS,
22
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
23
+ implied. See the License for the specific language governing
24
+ permissions and limitations under the License.
25
+
26
+ In addition, you may not use the software for any purposes that are
27
+ illegal under applicable law, and the grant of the foregoing license
28
+ under the Apache 2.0 license is conditioned upon your compliance with
29
+ such restriction.
30
+ */
31
+
34
32
  var FormActionButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
35
- var _jsxs2;
36
33
  var disabled = _ref.disabled,
37
34
  fields = _ref.fields,
38
35
  fieldsPath = _ref.fieldsPath,
@@ -43,13 +40,14 @@ var FormActionButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, re
43
40
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
44
41
  children: [!hidden && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
45
42
  className: "form-table__row form-table__action-row no-hover",
46
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", (_jsxs2 = {
47
- "data-testid": "".concat(fieldsPath, "-add-btn"),
43
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
44
+ "data-testid": id ? id : "".concat(fieldsPath, "-add-btn"),
48
45
  onClick: function onClick(event) {
49
46
  return _onClick(event, fields, fieldsPath);
50
47
  },
51
- disabled: disabled
52
- }, _defineProperty(_jsxs2, "data-testid", id), _defineProperty(_jsxs2, "children", [/*#__PURE__*/(0, _jsxRuntime.jsx)(_plus.ReactComponent, {}), label]), _jsxs2))
48
+ disabled: disabled,
49
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_plus.ReactComponent, {}), label]
50
+ })
53
51
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
54
52
  ref: ref
55
53
  })]
@@ -95,6 +95,7 @@
95
95
  display: inline-block;
96
96
  width: 8px;
97
97
  height: 8px;
98
+ min-width: 8px;
98
99
  background-color: $color;
99
100
  border-radius: 50%;
100
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "1.8.7",
3
+ "version": "1.8.9",
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",