iguazio.dashboard-react-controls 1.4.1 → 1.4.2

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.
@@ -47,6 +47,7 @@ var Tooltip = function Tooltip(_ref) {
47
47
  var children = _ref.children,
48
48
  className = _ref.className,
49
49
  hidden = _ref.hidden,
50
+ renderChildAsHtml = _ref.renderChildAsHtml,
50
51
  template = _ref.template,
51
52
  textShow = _ref.textShow;
52
53
  var _useState = (0, _react.useState)(false),
@@ -149,7 +150,14 @@ var Tooltip = function Tooltip(_ref) {
149
150
  };
150
151
  }, [clearStyles, style]);
151
152
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
152
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
153
+ children: [renderChildAsHtml ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
154
+ "data-testid": "tooltip-wrapper",
155
+ ref: parentRef,
156
+ className: tooltipClassNames,
157
+ dangerouslySetInnerHTML: {
158
+ __html: children
159
+ }
160
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
153
161
  "data-testid": "tooltip-wrapper",
154
162
  ref: parentRef,
155
163
  className: tooltipClassNames,
@@ -171,11 +179,13 @@ var Tooltip = function Tooltip(_ref) {
171
179
  };
172
180
  Tooltip.defaultProps = {
173
181
  hidden: false,
182
+ renderChildAsHtml: false,
174
183
  textShow: false
175
184
  };
176
185
  Tooltip.propTypes = {
177
186
  className: _propTypes.default.string,
178
187
  hidden: _propTypes.default.bool,
188
+ renderChildAsHtml: _propTypes.default.bool,
179
189
  template: _propTypes.default.element.isRequired,
180
190
  textShow: _propTypes.default.bool
181
191
  };
@@ -31,6 +31,7 @@ such restriction.
31
31
  */
32
32
 
33
33
  var SelectOption = function SelectOption(_ref) {
34
+ var _item$labelHtml;
34
35
  var item = _ref.item,
35
36
  name = _ref.name,
36
37
  _onClick = _ref.onClick,
@@ -64,7 +65,7 @@ var SelectOption = function SelectOption(_ref) {
64
65
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
65
66
  className: "data-ellipsis select__item-label",
66
67
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
67
- className: " select__item-main-label",
68
+ className: "select__item-main-label",
68
69
  children: [item.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
69
70
  "data-testid": "select-icon",
70
71
  className: "select__item-icon",
@@ -72,10 +73,11 @@ var SelectOption = function SelectOption(_ref) {
72
73
  }), item.status && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
73
74
  className: "state-".concat(item.status, "-job status")
74
75
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
76
+ renderChildAsHtml: ((_item$labelHtml = item.labelHtml) === null || _item$labelHtml === void 0 ? void 0 : _item$labelHtml.length) > 0,
75
77
  template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextTooltipTemplate, {
76
78
  text: item.label
77
79
  }),
78
- children: item.label
80
+ children: item.labelHtml ? item.labelHtml : item.label
79
81
  })]
80
82
  }), item.subLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
81
83
  className: "select__item-sub-label",
@@ -68,6 +68,7 @@
68
68
  }
69
69
 
70
70
  &-main-label {
71
+ width: 100%;
71
72
  display: flex;
72
73
  flex-flow: row nowrap;
73
74
  align-items: center;
package/dist/types.js CHANGED
@@ -90,6 +90,7 @@ var SELECT_OPTION = _propTypes.default.shape({
90
90
  icon: _propTypes.default.element,
91
91
  id: _propTypes.default.string.isRequired,
92
92
  label: _propTypes.default.string.isRequired,
93
+ labelHtml: _propTypes.default.string,
93
94
  status: _propTypes.default.string,
94
95
  subLabel: _propTypes.default.string
95
96
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
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",