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
|
-
|
|
67
|
-
|
|
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 =
|
|
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 -
|
|
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 -
|
|
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
|
-
|
|
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',
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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",
|
|
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
|
-
|
|
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
|
})]
|
package/dist/scss/mixins.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iguazio.dashboard-react-controls",
|
|
3
|
-
"version": "1.8.
|
|
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",
|