iguazio.dashboard-react-controls 2.0.5 → 2.0.7
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/dist/components/ConfirmDialog/ConfirmDialog.js +8 -2
- package/dist/components/ConfirmDialog/confirmDialog.scss +4 -0
- package/dist/components/FormCheckBox/FormCheckBox.js +1 -1
- package/dist/components/FormRadio/FormRadio.js +13 -1
- package/dist/components/Tooltip/Tooltip.js +31 -29
- package/dist/elements/SelectOption/SelectOption.js +1 -0
- package/dist/scss/mixins.scss +3 -3
- package/dist/types.js +1 -1
- package/package.json +1 -1
|
@@ -33,6 +33,7 @@ such restriction.
|
|
|
33
33
|
const ConfirmDialog = _ref => {
|
|
34
34
|
let {
|
|
35
35
|
cancelButton,
|
|
36
|
+
children,
|
|
36
37
|
className,
|
|
37
38
|
closePopUp,
|
|
38
39
|
confirmButton,
|
|
@@ -66,17 +67,22 @@ const ConfirmDialog = _ref => {
|
|
|
66
67
|
children: [message && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
67
68
|
className: messageClassNames,
|
|
68
69
|
children: message
|
|
70
|
+
}), children && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
|
+
className: "confirm-dialog__body",
|
|
72
|
+
children: children
|
|
69
73
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
70
74
|
className: "confirm-dialog__btn-container",
|
|
71
75
|
children: [cancelButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
72
76
|
className: "pop-up-dialog__btn_cancel",
|
|
73
77
|
label: cancelButton.label,
|
|
74
78
|
onClick: handleCancelDialog,
|
|
75
|
-
variant: cancelButton.variant
|
|
79
|
+
variant: cancelButton.variant,
|
|
80
|
+
disabled: cancelButton.disabled
|
|
76
81
|
}), confirmButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
77
82
|
label: confirmButton.label,
|
|
78
83
|
onClick: handleConfirmDialog,
|
|
79
|
-
variant: confirmButton.variant
|
|
84
|
+
variant: confirmButton.variant,
|
|
85
|
+
disabled: confirmButton.disabled
|
|
80
86
|
})]
|
|
81
87
|
})]
|
|
82
88
|
})
|
|
@@ -83,7 +83,7 @@ FormCheckBox.propTypes = {
|
|
|
83
83
|
className: _propTypes.default.string,
|
|
84
84
|
highlightLabel: _propTypes.default.bool,
|
|
85
85
|
name: _propTypes.default.string.isRequired,
|
|
86
|
-
label: _propTypes.default.string,
|
|
86
|
+
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
|
|
87
87
|
readOnly: _propTypes.default.bool
|
|
88
88
|
};
|
|
89
89
|
var _default = exports.default = /*#__PURE__*/_react.default.memo(FormCheckBox);
|
|
@@ -8,6 +8,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _reactFinalForm = require("react-final-form");
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
|
|
12
|
+
var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
|
|
11
13
|
require("./FormRadio.scss");
|
|
12
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -34,6 +36,7 @@ const FormRadio = _ref => {
|
|
|
34
36
|
name,
|
|
35
37
|
label,
|
|
36
38
|
readOnly,
|
|
39
|
+
tooltip,
|
|
37
40
|
...inputProps
|
|
38
41
|
} = _ref;
|
|
39
42
|
const formFieldClassNames = (0, _classnames.default)('form-field-radio', readOnly && 'form-field-radio_readonly', className);
|
|
@@ -56,7 +59,16 @@ const FormRadio = _ref => {
|
|
|
56
59
|
...inputProps,
|
|
57
60
|
checked: input.checked,
|
|
58
61
|
id: name + inputProps.value
|
|
59
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
62
|
+
}), tooltip ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
63
|
+
className: "label",
|
|
64
|
+
template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextTooltipTemplate.default, {
|
|
65
|
+
text: tooltip
|
|
66
|
+
}),
|
|
67
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
68
|
+
htmlFor: name + inputProps.value,
|
|
69
|
+
children: label
|
|
70
|
+
})
|
|
71
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
60
72
|
htmlFor: name + inputProps.value,
|
|
61
73
|
children: label
|
|
62
74
|
})]
|
|
@@ -66,36 +66,38 @@ const Tooltip = _ref => {
|
|
|
66
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
67
|
*/
|
|
68
68
|
child.nodeType === Node.TEXT_NODE && parentRef.current.scrollWidth > parentRef.current.offsetWidth));
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
69
|
+
setShow(show);
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
if (show) {
|
|
72
|
+
var _parentRef$current$ge, _parentRef$current, _tooltipRef$current$g, _tooltipRef$current;
|
|
73
|
+
let {
|
|
74
|
+
height,
|
|
75
|
+
top,
|
|
76
|
+
bottom
|
|
77
|
+
} = (_parentRef$current$ge = parentRef === null || parentRef === void 0 || (_parentRef$current = parentRef.current) === null || _parentRef$current === void 0 ? void 0 : _parentRef$current.getBoundingClientRect()) !== null && _parentRef$current$ge !== void 0 ? _parentRef$current$ge : {};
|
|
78
|
+
const {
|
|
79
|
+
height: tooltipHeight,
|
|
80
|
+
width: tooltipWidth
|
|
81
|
+
} = (_tooltipRef$current$g = (_tooltipRef$current = tooltipRef.current) === null || _tooltipRef$current === void 0 ? void 0 : _tooltipRef$current.getBoundingClientRect()) !== null && _tooltipRef$current$g !== void 0 ? _tooltipRef$current$g : {
|
|
82
|
+
height: 0,
|
|
83
|
+
width: 0
|
|
84
|
+
};
|
|
85
|
+
const leftPosition = event.x - (event.x + tooltipWidth - window.innerWidth + offset);
|
|
86
|
+
const left = event.x + tooltipWidth + offset > window.innerWidth ? leftPosition > offset ? leftPosition : offset : event.x + offset;
|
|
87
|
+
if (top + height + offset + tooltipHeight >= window.innerHeight) {
|
|
88
|
+
const topPosition = bottom - height - offset - tooltipHeight;
|
|
89
|
+
setStyle({
|
|
90
|
+
top: topPosition > 0 ? topPosition : offset,
|
|
91
|
+
left
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
setStyle({
|
|
95
|
+
top: top + height + offset,
|
|
96
|
+
left
|
|
97
|
+
});
|
|
98
|
+
}
|
|
97
99
|
}
|
|
98
|
-
}
|
|
100
|
+
}, 0);
|
|
99
101
|
}
|
|
100
102
|
}, [hidden, textShow, show]);
|
|
101
103
|
const clearStyles = (0, _lodash.debounce)(() => {
|
package/dist/scss/mixins.scss
CHANGED
|
@@ -1126,7 +1126,7 @@
|
|
|
1126
1126
|
pointer-events: none;
|
|
1127
1127
|
opacity: 0.5;
|
|
1128
1128
|
|
|
1129
|
-
~ label {
|
|
1129
|
+
~ label, ~ .label {
|
|
1130
1130
|
pointer-events: none;
|
|
1131
1131
|
opacity: 0.5;
|
|
1132
1132
|
}
|
|
@@ -1165,7 +1165,7 @@
|
|
|
1165
1165
|
border-color: currentColor;
|
|
1166
1166
|
}
|
|
1167
1167
|
|
|
1168
|
-
~ label {
|
|
1168
|
+
~ label, ~ .label {
|
|
1169
1169
|
color: $spunPearl;
|
|
1170
1170
|
cursor: not-allowed;
|
|
1171
1171
|
}
|
|
@@ -1192,7 +1192,7 @@
|
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
1194
|
|
|
1195
|
-
~ label {
|
|
1195
|
+
~ label, ~ .label {
|
|
1196
1196
|
display: flex;
|
|
1197
1197
|
flex: 1;
|
|
1198
1198
|
align-items: center;
|
package/dist/types.js
CHANGED
|
@@ -81,7 +81,7 @@ const SELECT_OPTION = exports.SELECT_OPTION = _propTypes.default.shape({
|
|
|
81
81
|
hidden: _propTypes.default.bool,
|
|
82
82
|
icon: _propTypes.default.element,
|
|
83
83
|
id: _propTypes.default.string.isRequired,
|
|
84
|
-
label: _propTypes.default.string.isRequired,
|
|
84
|
+
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]).isRequired,
|
|
85
85
|
labelHtml: _propTypes.default.string,
|
|
86
86
|
status: _propTypes.default.string,
|
|
87
87
|
subLabel: _propTypes.default.string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iguazio.dashboard-react-controls",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
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",
|