iguazio.dashboard-react-controls 0.0.39 → 1.2.0

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.
Files changed (79) hide show
  1. package/dist/components/Backdrop/Backdrop.js +4 -11
  2. package/dist/components/Button/Button.js +25 -28
  3. package/dist/components/ConfirmDialog/ConfirmDialog.js +10 -24
  4. package/dist/components/FormCheckBox/FormCheckBox.js +25 -25
  5. package/dist/components/FormChipCell/FormChip/FormChip.js +33 -33
  6. package/dist/components/FormChipCell/FormChipCell.js +66 -109
  7. package/dist/components/FormChipCell/FormChipCellView.js +19 -37
  8. package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +58 -90
  9. package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +24 -22
  10. package/dist/components/FormChipCell/formChipCell.util.js +0 -1
  11. package/dist/components/FormCombobox/FormCombobox.js +82 -140
  12. package/dist/components/FormInput/FormInput.js +110 -175
  13. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +6 -21
  14. package/dist/components/FormKeyValueTable/FormKeyValueTable.js +23 -39
  15. package/dist/components/FormRadio/FormRadio.js +23 -22
  16. package/dist/components/FormSelect/FormSelect.js +56 -92
  17. package/dist/components/FormSelect/FormSelect.test.js +19 -35
  18. package/dist/components/FormTextarea/FormTextarea.js +44 -69
  19. package/dist/components/Modal/Modal.js +8 -21
  20. package/dist/components/Modal/Modal.scss +2 -2
  21. package/dist/components/PopUpDialog/PopUpDialog.js +28 -43
  22. package/dist/components/RoundedIcon/RoundedIcon.js +7 -18
  23. package/dist/components/RoundedIcon/roundedIcon.scss +2 -2
  24. package/dist/components/Tip/Tip.js +25 -40
  25. package/dist/components/Tip/Tip.test.js +36 -45
  26. package/dist/components/Tooltip/Tooltip.js +40 -64
  27. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +2 -8
  28. package/dist/components/TooltipTemplate/TextTooltipTemplate.js +2 -12
  29. package/dist/components/Wizard/Wizard.js +35 -57
  30. package/dist/components/Wizard/Wizard.scss +1 -3
  31. package/dist/components/Wizard/WizardSteps/WizardSteps.js +4 -16
  32. package/dist/components/Wizard/WizardSteps/WizardSteps.scss +1 -0
  33. package/dist/components/index.js +0 -18
  34. package/dist/constants.js +4 -6
  35. package/dist/elements/FormActionButton/FormActionButton.js +6 -12
  36. package/dist/elements/FormRowActions/FormRowActions.js +6 -18
  37. package/dist/elements/HiddenChipsBlock/HiddenChipsBlock.js +37 -55
  38. package/dist/elements/OptionsMenu/OptionsMenu.js +4 -14
  39. package/dist/elements/SelectOption/SelectOption.js +6 -18
  40. package/dist/elements/SelectOption/SelectOption.test.js +19 -12
  41. package/dist/elements/SelectOption/selectOption.scss +5 -2
  42. package/dist/elements/ValidationTemplate/ValidationTemplate.js +2 -11
  43. package/dist/elements/index.js +0 -6
  44. package/dist/hooks/index.js +0 -1
  45. package/dist/hooks/useDebounce.js +1 -5
  46. package/dist/hooks/useDetectOutsideClick.js +4 -8
  47. package/dist/hooks/useFormTable.hook.js +31 -41
  48. package/dist/images/archive-icon.svg +3 -0
  49. package/dist/images/arrow.svg +1 -1
  50. package/dist/images/close.svg +2 -2
  51. package/dist/images/collapse.svg +2 -2
  52. package/dist/images/copy-to-clipboard-icon.svg +3 -0
  53. package/dist/images/deploy-icon.svg +4 -0
  54. package/dist/images/edit.svg +1 -1
  55. package/dist/images/edit_old.svg +3 -0
  56. package/dist/images/expand.svg +2 -2
  57. package/dist/images/eye-icon.svg +3 -0
  58. package/dist/images/link-icon.svg +5 -0
  59. package/dist/images/monitor-icon.svg +3 -0
  60. package/dist/images/refresh.svg +1 -1
  61. package/dist/images/tag-icon.svg +4 -0
  62. package/dist/images/unarchive-icon.svg +3 -0
  63. package/dist/images/yaml.svg +2 -3
  64. package/dist/images/yaml_old.svg +4 -0
  65. package/dist/index.js +0 -13
  66. package/dist/scss/borders.scss +1 -1
  67. package/dist/scss/colors.scss +2 -0
  68. package/dist/scss/common.scss +7 -3
  69. package/dist/scss/mixins.scss +6 -19
  70. package/dist/scss/shadows.scss +3 -3
  71. package/dist/scss/variables.scss +2 -0
  72. package/dist/types.js +19 -49
  73. package/dist/utils/common.util.js +3 -13
  74. package/dist/utils/form.util.js +20 -24
  75. package/dist/utils/generateChipsList.util.js +0 -3
  76. package/dist/utils/getFirstScrollableParent.util.js +0 -5
  77. package/dist/utils/validation.util.js +72 -94
  78. package/package.json +104 -104
  79. package/dist/images/eye.svg +0 -4
@@ -1,95 +1,81 @@
1
1
  "use strict";
2
2
 
3
3
  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); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
11
  var _reactFinalForm = require("react-final-form");
17
-
18
12
  var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
19
-
20
13
  var _Tip = _interopRequireDefault(require("../Tip/Tip"));
21
-
22
14
  var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
23
-
24
15
  var _invalid = require("../../images/invalid.svg");
25
-
26
16
  require("./formTextarea.scss");
27
-
28
17
  var _jsxRuntime = require("react/jsx-runtime");
29
-
30
18
  var _excluded = ["className", "disabled", "focused", "iconClass", "invalidText", "label", "maxLength", "name", "onBlur", "onChange", "required", "textAreaIcon", "tip", "withoutBorder"];
31
-
19
+ /*
20
+ Copyright 2022 Iguazio Systems Ltd.
21
+ Licensed under the Apache License, Version 2.0 (the "License") with
22
+ an addition restriction as set forth herein. You may not use this
23
+ file except in compliance with the License. You may obtain a copy of
24
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
25
+ Unless required by applicable law or agreed to in writing, software
26
+ distributed under the License is distributed on an "AS IS" BASIS,
27
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
28
+ implied. See the License for the specific language governing
29
+ permissions and limitations under the License.
30
+ In addition, you may not use the software for any purposes that are
31
+ illegal under applicable law, and the grant of the foregoing license
32
+ under the Apache 2.0 license is conditioned upon your compliance with
33
+ such restriction.
34
+ */
32
35
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
-
34
36
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
-
36
37
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
-
38
38
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
39
-
40
39
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
41
-
42
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
43
-
40
+ 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; }
41
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
42
+ 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); }
44
43
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45
-
46
44
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
47
-
48
45
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
49
-
50
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
51
-
52
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
53
-
46
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
47
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
54
48
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
55
-
56
49
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
57
-
58
50
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
59
-
60
51
  var FormTextarea = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
61
52
  var className = _ref.className,
62
- disabled = _ref.disabled,
63
- focused = _ref.focused,
64
- iconClass = _ref.iconClass,
65
- invalidText = _ref.invalidText,
66
- label = _ref.label,
67
- maxLength = _ref.maxLength,
68
- name = _ref.name,
69
- onBlur = _ref.onBlur,
70
- onChange = _ref.onChange,
71
- required = _ref.required,
72
- textAreaIcon = _ref.textAreaIcon,
73
- tip = _ref.tip,
74
- withoutBorder = _ref.withoutBorder,
75
- textareaProps = _objectWithoutProperties(_ref, _excluded);
76
-
53
+ disabled = _ref.disabled,
54
+ focused = _ref.focused,
55
+ iconClass = _ref.iconClass,
56
+ invalidText = _ref.invalidText,
57
+ label = _ref.label,
58
+ maxLength = _ref.maxLength,
59
+ name = _ref.name,
60
+ onBlur = _ref.onBlur,
61
+ onChange = _ref.onChange,
62
+ required = _ref.required,
63
+ textAreaIcon = _ref.textAreaIcon,
64
+ tip = _ref.tip,
65
+ withoutBorder = _ref.withoutBorder,
66
+ textareaProps = _objectWithoutProperties(_ref, _excluded);
77
67
  var _useField = (0, _reactFinalForm.useField)(name),
78
- input = _useField.input,
79
- meta = _useField.meta;
80
-
68
+ input = _useField.input,
69
+ meta = _useField.meta;
81
70
  var _useState = (0, _react.useState)(false),
82
- _useState2 = _slicedToArray(_useState, 2),
83
- isInvalid = _useState2[0],
84
- setIsInvalid = _useState2[1];
85
-
71
+ _useState2 = _slicedToArray(_useState, 2),
72
+ isInvalid = _useState2[0],
73
+ setIsInvalid = _useState2[1];
86
74
  var _useState3 = (0, _react.useState)(input.value.length),
87
- _useState4 = _slicedToArray(_useState3, 2),
88
- textAreaCount = _useState4[0],
89
- setTextAreaCount = _useState4[1];
90
-
75
+ _useState4 = _slicedToArray(_useState3, 2),
76
+ textAreaCount = _useState4[0],
77
+ setTextAreaCount = _useState4[1];
91
78
  var textAreaRef = /*#__PURE__*/_react.default.createRef();
92
-
93
79
  var formFieldClassNames = (0, _classnames.default)('form-field-textarea', className);
94
80
  var labelClassNames = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
95
81
  var textAreaClassNames = (0, _classnames.default)('form-field__wrapper', disabled && 'form-field__wrapper-disabled', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
@@ -101,26 +87,21 @@ var FormTextarea = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
101
87
  (0, _react.useEffect)(function () {
102
88
  setIsInvalid(meta.invalid && (meta.validating || meta.modified || meta.submitFailed && meta.touched));
103
89
  }, [meta.invalid, meta.modified, meta.submitFailed, meta.touched, meta.validating]);
104
-
105
90
  var handleInputBlur = function handleInputBlur(event) {
106
91
  input.onBlur(event);
107
92
  onBlur && onBlur(event);
108
93
  };
109
-
110
94
  var handleInputChange = function handleInputChange(event) {
111
95
  input.onChange(event);
112
96
  setTextAreaCount(event.target.value.length);
113
97
  onChange && onChange(event.target.value);
114
98
  };
115
-
116
99
  var handleInputFocus = function handleInputFocus(event) {
117
100
  input.onFocus(event);
118
101
  };
119
-
120
102
  var validateField = function validateField(value) {
121
103
  var valueToValidate = value !== null && value !== void 0 ? value : '';
122
104
  var validationError = null;
123
-
124
105
  if (valueToValidate.startsWith(' ')) {
125
106
  validationError = {
126
107
  name: 'empty',
@@ -132,18 +113,15 @@ var FormTextarea = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
132
113
  label: 'This field is required'
133
114
  };
134
115
  }
135
-
136
116
  return validationError;
137
117
  };
138
-
139
118
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
140
119
  validate: validateField,
141
120
  name: name,
142
121
  children: function children(_ref2) {
143
122
  var _meta$error$label, _meta$error;
144
-
145
123
  var input = _ref2.input,
146
- meta = _ref2.meta;
124
+ meta = _ref2.meta;
147
125
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
148
126
  ref: ref,
149
127
  className: formFieldClassNames,
@@ -200,7 +178,6 @@ var FormTextarea = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
200
178
  }
201
179
  });
202
180
  });
203
-
204
181
  FormTextarea.defaultProps = {
205
182
  className: '',
206
183
  disabled: false,
@@ -233,7 +210,5 @@ FormTextarea.propTypes = {
233
210
  required: _propTypes.default.bool,
234
211
  tip: _propTypes.default.string
235
212
  };
236
-
237
213
  var _default = /*#__PURE__*/_react.default.memo(FormTextarea);
238
-
239
214
  exports.default = _default;
@@ -4,31 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _reactTransitionGroup = require("react-transition-group");
13
-
14
10
  var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
11
  var _Backdrop = _interopRequireDefault(require("../Backdrop/Backdrop"));
17
-
18
12
  var _RoundedIcon = _interopRequireDefault(require("../RoundedIcon/RoundedIcon"));
19
-
20
13
  var _constants = require("../../constants");
21
-
22
14
  var _types = require("../../types");
23
-
24
15
  var _close = require("../../images/close.svg");
25
-
26
16
  require("./Modal.scss");
27
-
28
17
  var _jsxRuntime = require("react/jsx-runtime");
29
-
30
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
-
32
19
  /*
33
20
  Copyright 2022 Iguazio Systems Ltd.
34
21
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -45,15 +32,16 @@ illegal under applicable law, and the grant of the foregoing license
45
32
  under the Apache 2.0 license is conditioned upon your compliance with
46
33
  such restriction.
47
34
  */
35
+
48
36
  var Modal = function Modal(_ref) {
49
37
  var actions = _ref.actions,
50
- children = _ref.children,
51
- className = _ref.className,
52
- onClose = _ref.onClose,
53
- size = _ref.size,
54
- show = _ref.show,
55
- subTitle = _ref.subTitle,
56
- title = _ref.title;
38
+ children = _ref.children,
39
+ className = _ref.className,
40
+ onClose = _ref.onClose,
41
+ size = _ref.size,
42
+ show = _ref.show,
43
+ subTitle = _ref.subTitle,
44
+ title = _ref.title;
57
45
  var modalClassNames = (0, _classnames.default)('modal', className, size && "modal-".concat(size));
58
46
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
59
47
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
@@ -105,7 +93,6 @@ var Modal = function Modal(_ref) {
105
93
  })]
106
94
  });
107
95
  };
108
-
109
96
  Modal.defaultProps = {
110
97
  actions: [],
111
98
  show: false,
@@ -60,8 +60,8 @@
60
60
  &__header {
61
61
  position: relative;
62
62
  border-bottom: $primaryBorder;
63
- height: 92px;
64
- padding: 0 3rem;
63
+ min-height: 92px;
64
+ padding: 1rem 3rem;
65
65
  display: flex;
66
66
  align-items: center;
67
67
  justify-content: center;
@@ -1,89 +1,75 @@
1
1
  "use strict";
2
2
 
3
3
  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); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
10
  var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
11
  var _reactDom = require("react-dom");
17
-
18
12
  var _RoundedIcon = _interopRequireDefault(require("../RoundedIcon/RoundedIcon"));
19
-
20
13
  var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
21
-
22
14
  var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
23
-
24
15
  var _types = require("../../types");
25
-
26
16
  var _close = require("../../images/close.svg");
27
-
28
17
  require("./popUpDialog.scss");
29
-
30
18
  var _jsxRuntime = require("react/jsx-runtime");
31
-
32
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
-
34
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
-
36
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
-
38
22
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
-
40
23
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
41
-
42
24
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
43
-
44
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
45
-
46
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
47
-
48
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
-
25
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
26
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
27
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /*
28
+ Copyright 2022 Iguazio Systems Ltd.
29
+ Licensed under the Apache License, Version 2.0 (the "License") with
30
+ an addition restriction as set forth herein. You may not use this
31
+ file except in compliance with the License. You may obtain a copy of
32
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
33
+ Unless required by applicable law or agreed to in writing, software
34
+ distributed under the License is distributed on an "AS IS" BASIS,
35
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
36
+ implied. See the License for the specific language governing
37
+ permissions and limitations under the License.
38
+ In addition, you may not use the software for any purposes that are
39
+ illegal under applicable law, and the grant of the foregoing license
40
+ under the Apache 2.0 license is conditioned upon your compliance with
41
+ such restriction.
42
+ */
50
43
  var PopUpDialog = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
51
44
  var _ref2;
52
-
53
45
  var children = _ref.children,
54
- className = _ref.className,
55
- closePopUp = _ref.closePopUp,
56
- customPosition = _ref.customPosition,
57
- headerIsHidden = _ref.headerIsHidden,
58
- headerText = _ref.headerText,
59
- style = _ref.style,
60
- tooltipText = _ref.tooltipText;
46
+ className = _ref.className,
47
+ closePopUp = _ref.closePopUp,
48
+ customPosition = _ref.customPosition,
49
+ headerIsHidden = _ref.headerIsHidden,
50
+ headerText = _ref.headerText,
51
+ style = _ref.style,
52
+ tooltipText = _ref.tooltipText;
61
53
  var popUpOverlayRef = (0, _react.useRef)(null);
62
54
  (_ref2 = ref) !== null && _ref2 !== void 0 ? _ref2 : ref = popUpOverlayRef;
63
55
  var popUpClassNames = (0, _classnames.default)(className, 'pop-up-dialog__overlay', customPosition.element && 'custom-position');
64
56
  var calculateCustomPopUpPosition = (0, _react.useCallback)(function () {
65
57
  if (customPosition && customPosition.element) {
66
58
  var _ref3;
67
-
68
59
  var elementRect = customPosition.element.current.getBoundingClientRect();
69
60
  var popUpRect = (_ref3 = ref) === null || _ref3 === void 0 ? void 0 : _ref3.current.getBoundingClientRect();
70
-
71
61
  var _customPosition$posit = customPosition.position.split('-'),
72
- _customPosition$posit2 = _slicedToArray(_customPosition$posit, 2),
73
- verticalPosition = _customPosition$posit2[0],
74
- horizontalPosition = _customPosition$posit2[1];
75
-
62
+ _customPosition$posit2 = _slicedToArray(_customPosition$posit, 2),
63
+ verticalPosition = _customPosition$posit2[0],
64
+ horizontalPosition = _customPosition$posit2[1];
76
65
  var leftPosition = horizontalPosition === 'left' ? elementRect.right - popUpRect.width : elementRect.left;
77
66
  var topPosition;
78
-
79
67
  if (verticalPosition === 'top') {
80
68
  topPosition = elementRect.top > popUpRect.height ? elementRect.top - popUpRect.height - 5 : 5;
81
69
  } else {
82
70
  topPosition = popUpRect.height + elementRect.bottom > window.innerHeight ? window.innerHeight - popUpRect.height - 5 : elementRect.bottom + 5;
83
71
  }
84
-
85
72
  ref.current.style.top = "".concat(topPosition, "px");
86
-
87
73
  if (style.left) {
88
74
  ref.current.style.left = "calc(".concat(leftPosition, "px + ").concat(style.left, ")");
89
75
  } else {
@@ -131,7 +117,6 @@ var PopUpDialog = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
131
117
  })
132
118
  }), document.getElementById('overlay_container'));
133
119
  });
134
-
135
120
  PopUpDialog.defaultProps = {
136
121
  className: '',
137
122
  closePopUp: function closePopUp() {},
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
15
-
16
11
  var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
17
-
18
12
  require("./roundedIcon.scss");
19
-
20
13
  var _jsxRuntime = require("react/jsx-runtime");
21
-
22
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
24
15
  /*
25
16
  Copyright 2022 Iguazio Systems Ltd.
26
17
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -37,14 +28,15 @@ illegal under applicable law, and the grant of the foregoing license
37
28
  under the Apache 2.0 license is conditioned upon your compliance with
38
29
  such restriction.
39
30
  */
31
+
40
32
  var RoundedIcon = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
41
33
  var children = _ref.children,
42
- className = _ref.className,
43
- disabled = _ref.disabled,
44
- id = _ref.id,
45
- isActive = _ref.isActive,
46
- onClick = _ref.onClick,
47
- tooltipText = _ref.tooltipText;
34
+ className = _ref.className,
35
+ disabled = _ref.disabled,
36
+ id = _ref.id,
37
+ isActive = _ref.isActive,
38
+ onClick = _ref.onClick,
39
+ tooltipText = _ref.tooltipText;
48
40
  var wrapperClassNames = (0, _classnames.default)('round-icon-cp', className);
49
41
  var IconClassNames = (0, _classnames.default)('round-icon-cp__circle', isActive && 'round-icon-cp__circle-active', disabled && 'round-icon-cp__circle-disabled');
50
42
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -65,7 +57,6 @@ var RoundedIcon = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
65
57
  })
66
58
  });
67
59
  });
68
-
69
60
  RoundedIcon.defaultProps = {
70
61
  className: '',
71
62
  disabled: false,
@@ -83,7 +74,5 @@ RoundedIcon.propTypes = {
83
74
  onClick: _propTypes.default.func,
84
75
  tooltipText: _propTypes.default.string
85
76
  };
86
-
87
77
  var _default = /*#__PURE__*/_react.default.memo(RoundedIcon);
88
-
89
78
  exports.default = _default;
@@ -10,8 +10,8 @@
10
10
  display: flex;
11
11
  align-items: center;
12
12
  justify-content: center;
13
- width: 30px;
14
- height: 30px;
13
+ width: 36px;
14
+ height: 36px;
15
15
  padding: 4px;
16
16
 
17
17
  & > * {
@@ -1,65 +1,57 @@
1
1
  "use strict";
2
2
 
3
3
  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); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
10
  var _reactTransitionGroup = require("react-transition-group");
15
-
16
11
  var _classnames = _interopRequireDefault(require("classnames"));
17
-
18
12
  var _reactDom = require("react-dom");
19
-
20
13
  var _questionMark = require("../../images/question-mark.svg");
21
-
22
14
  var _tip = _interopRequireDefault(require("./tip.scss"));
23
-
24
15
  var _jsxRuntime = require("react/jsx-runtime");
25
-
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
-
30
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
32
19
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
-
34
20
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
35
-
36
21
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
37
-
38
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
39
-
40
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
41
-
42
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
-
22
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
23
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
24
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /*
25
+ Copyright 2022 Iguazio Systems Ltd.
26
+ Licensed under the Apache License, Version 2.0 (the "License") with
27
+ an addition restriction as set forth herein. You may not use this
28
+ file except in compliance with the License. You may obtain a copy of
29
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
30
+ Unless required by applicable law or agreed to in writing, software
31
+ distributed under the License is distributed on an "AS IS" BASIS,
32
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
33
+ implied. See the License for the specific language governing
34
+ permissions and limitations under the License.
35
+ In addition, you may not use the software for any purposes that are
36
+ illegal under applicable law, and the grant of the foregoing license
37
+ under the Apache 2.0 license is conditioned upon your compliance with
38
+ such restriction.
39
+ */
44
40
  var arrowOffset = parseInt(_tip.default.arrowoffset);
45
41
  var arrowLength = parseInt(_tip.default.arrowlength);
46
42
  var iconLength = parseInt(_tip.default.iconlength);
47
43
  var minTextLength = 40;
48
-
49
44
  var Tip = function Tip(_ref) {
50
45
  var className = _ref.className,
51
- text = _ref.text;
52
-
46
+ text = _ref.text;
53
47
  var _useState = (0, _react.useState)(false),
54
- _useState2 = _slicedToArray(_useState, 2),
55
- isShow = _useState2[0],
56
- setIsShow = _useState2[1];
57
-
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ isShow = _useState2[0],
50
+ setIsShow = _useState2[1];
58
51
  var _useState3 = (0, _react.useState)('tip_top tip_left'),
59
- _useState4 = _slicedToArray(_useState3, 2),
60
- tipClassName = _useState4[0],
61
- setTipClassName = _useState4[1];
62
-
52
+ _useState4 = _slicedToArray(_useState3, 2),
53
+ tipClassName = _useState4[0],
54
+ setTipClassName = _useState4[1];
63
55
  var iconRef = (0, _react.useRef)();
64
56
  var tipBodyRef = (0, _react.useRef)();
65
57
  var tipContainerClassNames = (0, _classnames.default)(className, 'tip-container');
@@ -71,26 +63,20 @@ var Tip = function Tip(_ref) {
71
63
  var widthPosition = iconRect.left > tipRect.width - arrowOffset ? 'tip_left' : 'tip_right';
72
64
  var heightPosition = iconRect.top > tipRect.height + arrowLength ? 'tip_top' : 'tip_bottom';
73
65
  setTipClassName("".concat(heightPosition, " ").concat(widthPosition));
74
-
75
66
  if (widthPosition === 'tip_left') {
76
67
  var computedArrowOffset = arrowOffset + (iconLength + arrowLength) / 2;
77
68
  tipBodyRef.current.style.left = "".concat(iconRect.left - (tipRect.width - computedArrowOffset), "px");
78
69
  } else {
79
70
  var _computedArrowOffset = arrowOffset - (iconLength - arrowLength) / 2;
80
-
81
71
  tipBodyRef.current.style.left = "".concat(iconRect.left - _computedArrowOffset, "px");
82
72
  }
83
-
84
73
  tipBodyRef.current.style.top = heightPosition === 'tip_top' ? "".concat(iconRect.top - tipRect.height - arrowLength, "px") : "".concat(iconRect.bottom + arrowLength, "px");
85
74
  }, []);
86
-
87
75
  var handleMouseLeave = function handleMouseLeave() {
88
76
  setIsShow(false);
89
77
  };
90
-
91
78
  (0, _react.useEffect)(function () {
92
79
  var node = iconRef.current;
93
-
94
80
  if (iconRef.current) {
95
81
  node.addEventListener('mouseenter', handleMouseEnter);
96
82
  node.addEventListener('mouseleave', handleMouseLeave);
@@ -123,7 +109,6 @@ var Tip = function Tip(_ref) {
123
109
  }), document.getElementById('overlay_container'))]
124
110
  });
125
111
  };
126
-
127
112
  Tip.defaultProps = {
128
113
  className: ''
129
114
  };