iguazio.dashboard-react-controls 2.2.19 → 2.2.21

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 (47) hide show
  1. package/dist/components/Backdrop/Backdrop.js +1 -1
  2. package/dist/components/Button/Button.js +4 -6
  3. package/dist/components/ConfirmDialog/ConfirmDialog.js +1 -1
  4. package/dist/components/FormCheckBox/FormCheckBox.js +4 -5
  5. package/dist/components/FormChipCell/FormChip/FormChip.js +1 -1
  6. package/dist/components/FormChipCell/FormChip/formChip.scss +6 -0
  7. package/dist/components/FormChipCell/FormChipCell.js +4 -5
  8. package/dist/components/FormChipCell/FormChipCellView.js +16 -11
  9. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.js +5 -6
  10. package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +11 -18
  11. package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +1 -1
  12. package/dist/components/FormChipCell/formChipCell.util.js +1 -2
  13. package/dist/components/FormCombobox/FormCombobox.js +12 -13
  14. package/dist/components/FormInput/FormInput.js +18 -21
  15. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +1 -1
  16. package/dist/components/FormKeyValueTable/FormKeyValueTable.js +5 -6
  17. package/dist/components/FormOnChange/FormOnChange.js +1 -1
  18. package/dist/components/FormRadio/FormRadio.js +3 -3
  19. package/dist/components/FormSelect/FormSelect.js +11 -12
  20. package/dist/components/FormSelect/FormSelect.test.js +6 -6
  21. package/dist/components/FormTextarea/FormTextarea.js +4 -5
  22. package/dist/components/FormToggle/FormToggle.js +4 -4
  23. package/dist/components/Modal/Modal.js +2 -2
  24. package/dist/components/PopUpDialog/PopUpDialog.js +8 -10
  25. package/dist/components/RoundedIcon/RoundedIcon.js +1 -1
  26. package/dist/components/Tip/Tip.js +6 -6
  27. package/dist/components/Tip/Tip.test.js +3 -3
  28. package/dist/components/Tooltip/Tooltip.js +9 -11
  29. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +1 -1
  30. package/dist/components/TooltipTemplate/TextTooltipTemplate.js +1 -1
  31. package/dist/components/Wizard/Wizard.js +5 -5
  32. package/dist/components/Wizard/WizardSteps/WizardSteps.js +1 -1
  33. package/dist/components/index.js +1 -1
  34. package/dist/elements/FormActionButton/FormActionButton.js +2 -2
  35. package/dist/elements/FormRowActions/FormRowActions.js +5 -6
  36. package/dist/elements/OptionsMenu/OptionsMenu.js +2 -2
  37. package/dist/elements/SelectOption/SelectOption.js +4 -5
  38. package/dist/elements/SelectOption/SelectOption.test.js +5 -5
  39. package/dist/elements/ValidationTemplate/ValidationTemplate.js +1 -1
  40. package/dist/elements/index.js +1 -1
  41. package/dist/hooks/useChipCell.hook.js +6 -10
  42. package/dist/hooks/useFormTable.hook.js +25 -40
  43. package/dist/hooks/useHiddenChipsBlock.hook.js +9 -9
  44. package/dist/types.js +1 -1
  45. package/dist/utils/generateChipsList.util.js +1 -1
  46. package/dist/utils/validation.util.js +6 -6
  47. package/package.json +1 -1
@@ -22,7 +22,7 @@ var _popout = require("../../images/popout.svg");
22
22
  var _warning = require("../../images/warning.svg");
23
23
  require("./formInput.scss");
24
24
  var _jsxRuntime = require("react/jsx-runtime");
25
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
26
26
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
27
27
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
28
  /*
@@ -55,7 +55,6 @@ const defaultProps = {
55
55
  rules: []
56
56
  };
57
57
  const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
58
- var _ref2;
59
58
  let {
60
59
  async = false,
61
60
  className = '',
@@ -96,14 +95,14 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
96
95
  const [validationRules, setValidationRules] = (0, _react.useState)(rules);
97
96
  const [showValidationRules, setShowValidationRules] = (0, _react.useState)(false);
98
97
  const wrapperRef = (0, _react.useRef)();
99
- (_ref2 = ref) !== null && _ref2 !== void 0 ? _ref2 : ref = wrapperRef;
98
+ ref ??= wrapperRef;
100
99
  const inputRef = (0, _react.useRef)();
101
100
  const errorsRef = (0, _react.useRef)();
102
101
  const isRequiredRulePresentRef = (0, _react.useRef)(false);
103
102
  (0, _hooks.useDetectOutsideClick)(ref, () => setShowValidationRules(false));
104
103
  const debounceAsync = (0, _hooks.useDebounce)();
105
104
  const formFieldClassNames = (0, _classnames.default)('form-field-input', className);
106
- const inputWrapperClassNames = (0, _classnames.default)('form-field__wrapper', "form-field__wrapper-".concat(density), disabled && 'form-field__wrapper-disabled', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
105
+ const inputWrapperClassNames = (0, _classnames.default)('form-field__wrapper', `form-field__wrapper-${density}`, disabled && 'form-field__wrapper-disabled', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
107
106
  const labelClassNames = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
108
107
  (0, _react.useEffect)(() => {
109
108
  setTypedValue(String(input.value)); // convert from number to string
@@ -146,12 +145,12 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
146
145
  });
147
146
  }, [rules]);
148
147
  const getValidationRules = () => {
149
- return validationRules.map(_ref3 => {
148
+ return validationRules.map(_ref2 => {
150
149
  let {
151
150
  isValid = false,
152
151
  label,
153
152
  name
154
- } = _ref3;
153
+ } = _ref2;
155
154
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ValidationTemplate.default, {
156
155
  valid: isValid,
157
156
  validationMessage: label
@@ -162,9 +161,8 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
162
161
  return !value && !required || disabled;
163
162
  };
164
163
  const handleInputBlur = event => {
165
- var _event$relatedTarget;
166
164
  input.onBlur && input.onBlur(event);
167
- if (!event.relatedTarget || !((_event$relatedTarget = event.relatedTarget) !== null && _event$relatedTarget !== void 0 && _event$relatedTarget.closest('.form-field__suggestion-list'))) {
165
+ if (!event.relatedTarget || !event.relatedTarget?.closest('.form-field__suggestion-list')) {
168
166
  setIsFocused(false);
169
167
  onBlur && onBlur(event);
170
168
  }
@@ -217,13 +215,13 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
217
215
  if (inputProps.max && +valueToValidate > +inputProps.max) {
218
216
  validationError = {
219
217
  name: 'maxValue',
220
- label: "The maximum value must be ".concat(inputProps.max)
218
+ label: `The maximum value must be ${inputProps.max}`
221
219
  };
222
220
  }
223
221
  if (inputProps.min && +valueToValidate < +inputProps.min) {
224
222
  validationError = {
225
223
  name: 'minValue',
226
- label: "The minimum value must be ".concat(inputProps.min)
224
+ label: `The minimum value must be ${inputProps.min}`
227
225
  };
228
226
  }
229
227
  }
@@ -269,19 +267,18 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
269
267
  validate: async ? validateFieldAsync : validateField,
270
268
  name: name,
271
269
  parse: parseField,
272
- children: _ref4 => {
273
- var _inputProps$autocompl, _errorsRef$current$la, _errorsRef$current;
270
+ children: _ref3 => {
274
271
  let {
275
272
  input
276
- } = _ref4;
273
+ } = _ref3;
277
274
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
278
275
  ref: ref,
279
276
  className: formFieldClassNames,
280
- "data-testid": name ? "".concat(name, "-form-field-input") : 'form-field-input',
277
+ "data-testid": name ? `${name}-form-field-input` : 'form-field-input',
281
278
  children: [label && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
282
279
  className: labelClassNames,
283
280
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
284
- "data-testid": name ? "".concat(name, "-form-label") : 'form-label',
281
+ "data-testid": name ? `${name}-form-label` : 'form-label',
285
282
  htmlFor: input.name,
286
283
  children: [label, (required || validationRules.find(rule => rule.name === 'required')) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
287
284
  className: "form-field__label-mandatory",
@@ -307,7 +304,7 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
307
304
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
308
305
  className: "form-field__control",
309
306
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
310
- "data-testid": name ? "".concat(name, "-form-input") : 'form-input',
307
+ "data-testid": name ? `${name}-form-input` : 'form-input',
311
308
  id: input.name,
312
309
  ref: inputRef,
313
310
  required: isInvalid || required,
@@ -316,7 +313,7 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
316
313
  type,
317
314
  ...inputProps,
318
315
  ...input,
319
- autoComplete: (_inputProps$autocompl = inputProps.autocomplete) !== null && _inputProps$autocompl !== void 0 ? _inputProps$autocompl : 'off',
316
+ autoComplete: inputProps.autocomplete ?? 'off',
320
317
  onBlur: handleInputBlur,
321
318
  onKeyDown: handleInputKeyDown,
322
319
  onFocus: handleInputFocus
@@ -326,7 +323,7 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
326
323
  children: [isInvalid && !Array.isArray(errorsRef.current) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
327
324
  className: "form-field__warning",
328
325
  template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextTooltipTemplate, {
329
- text: (_errorsRef$current$la = (_errorsRef$current = errorsRef.current) === null || _errorsRef$current === void 0 ? void 0 : _errorsRef$current.label) !== null && _errorsRef$current$la !== void 0 ? _errorsRef$current$la : invalidText,
326
+ text: errorsRef.current?.label ?? invalidText,
330
327
  warning: true
331
328
  }),
332
329
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_exclamationMark.ReactComponent, {})
@@ -349,7 +346,7 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
349
346
  ...input,
350
347
  disabled
351
348
  })]
352
- }), (suggestionList === null || suggestionList === void 0 ? void 0 : suggestionList.length) > 0 && isFocused && /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
349
+ }), suggestionList?.length > 0 && isFocused && /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
353
350
  className: "form-field__suggestion-list",
354
351
  children: suggestionList.map((item, index) => {
355
352
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
@@ -359,9 +356,9 @@ const FormInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
359
356
  },
360
357
  tabIndex: index,
361
358
  dangerouslySetInnerHTML: {
362
- __html: item.replace(new RegExp(typedValue, 'gi'), match => match ? "<b>".concat(match, "</b>") : match)
359
+ __html: item.replace(new RegExp(typedValue, 'gi'), match => match ? `<b>${match}</b>` : match)
363
360
  }
364
- }, "".concat(item).concat(index));
361
+ }, `${item}${index}`);
365
362
  })
366
363
  }), !(0, _lodash.isEmpty)(validationRules) && isInvalid && Array.isArray(errorsRef.current) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_OptionsMenu.default, {
367
364
  show: showValidationRules,
@@ -11,7 +11,7 @@ var _math = require("../../../utils/math.util");
11
11
  var _rangeArrowSmall = require("../../../images/range-arrow-small.svg");
12
12
  require("./InputNumberButtons.scss");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  /*
16
16
  Copyright 2022 Iguazio Systems Ltd.
17
17
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -13,7 +13,7 @@ var _elements = require("../../elements");
13
13
  var _hooks = require("../../hooks");
14
14
  var _types = require("../../types");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  /*
18
18
  Copyright 2022 Iguazio Systems Ltd.
19
19
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -100,7 +100,6 @@ const FormKeyValueTable = _ref => {
100
100
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, {
101
101
  name: fieldsPath,
102
102
  children: _ref3 => {
103
- var _editingItem$ui;
104
103
  let {
105
104
  fields
106
105
  } = _ref3;
@@ -112,14 +111,14 @@ const FormKeyValueTable = _ref => {
112
111
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
113
112
  className: "form-table__cell form-table__cell_1",
114
113
  children: keyOptions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FormSelect, {
115
- name: "".concat(rowPath, ".data.key"),
114
+ name: `${rowPath}.data.key`,
116
115
  density: "normal",
117
116
  options: keyOptions
118
117
  }) : isKeyEditable || editingItem.ui.isNew ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FormInput, {
119
118
  className: "input_edit",
120
119
  placeholder: keyLabel,
121
120
  density: "normal",
122
- name: "".concat(rowPath, ".data.key"),
121
+ name: `${rowPath}.data.key`,
123
122
  required: isKeyRequired,
124
123
  validationRules: [...keyValidationRules, {
125
124
  name: 'uniqueness',
@@ -133,7 +132,7 @@ const FormKeyValueTable = _ref => {
133
132
  className: "input_edit",
134
133
  placeholder: valueLabel,
135
134
  density: "normal",
136
- name: "".concat(rowPath, ".data.value"),
135
+ name: `${rowPath}.data.value`,
137
136
  type: valueType,
138
137
  required: isValueRequired,
139
138
  validationRules: valueValidationRules
@@ -172,7 +171,7 @@ const FormKeyValueTable = _ref => {
172
171
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.FormActionButton, {
173
172
  ref: bottomScrollRef,
174
173
  disabled: disabled,
175
- hidden: editingItem === null || editingItem === void 0 || (_editingItem$ui = editingItem.ui) === null || _editingItem$ui === void 0 ? void 0 : _editingItem$ui.isNew,
174
+ hidden: editingItem?.ui?.isNew,
176
175
  fields: fields,
177
176
  id: actionButtonId,
178
177
  label: addNewItemLabel,
@@ -8,7 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactFinalForm = require("react-final-form");
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
13
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
14
  /*
@@ -12,7 +12,7 @@ var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
12
12
  var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
13
13
  require("./FormRadio.scss");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  /*
17
17
  Copyright 2022 Iguazio Systems Ltd.
18
18
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -50,11 +50,11 @@ const FormRadio = _ref => {
50
50
  } = _ref2;
51
51
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
52
52
  className: formFieldClassNames,
53
- "data-testid": name ? "".concat(name, "-").concat(inputProps.value, "-form-radio") : 'form-field-radio',
53
+ "data-testid": name ? `${name}-${inputProps.value}-form-radio` : 'form-field-radio',
54
54
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
55
55
  className: (0, _classnames.default)(input.checked ? 'checked' : 'unchecked'),
56
56
  type: "radio",
57
- "data-testid": name ? "".concat(name, "-").concat(inputProps.value, "-radio") : 'form-radio',
57
+ "data-testid": name ? `${name}-${inputProps.value}-radio` : 'form-radio',
58
58
  ...input,
59
59
  ...inputProps,
60
60
  checked: input.checked,
@@ -18,7 +18,7 @@ var _constants = require("../../constants");
18
18
  var _dropdown = require("../../images/dropdown.svg");
19
19
  require("./formSelect.scss");
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
23
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
24
  /*
@@ -39,7 +39,6 @@ such restriction.
39
39
  */
40
40
 
41
41
  const FormSelect = _ref => {
42
- var _selectRef$current;
43
42
  let {
44
43
  className = '',
45
44
  density = 'normal',
@@ -73,8 +72,8 @@ const FormSelect = _ref => {
73
72
  const searchRef = (0, _react.useRef)();
74
73
  const {
75
74
  width: selectWidth
76
- } = (selectRef === null || selectRef === void 0 || (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.getBoundingClientRect()) || {};
77
- const selectWrapperClassNames = (0, _classnames.default)('form-field__wrapper', "form-field__wrapper-".concat(density), disabled && 'form-field__wrapper-disabled', isOpen && 'form-field__wrapper-active', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
75
+ } = selectRef?.current?.getBoundingClientRect() || {};
76
+ const selectWrapperClassNames = (0, _classnames.default)('form-field__wrapper', `form-field__wrapper-${density}`, disabled && 'form-field__wrapper-disabled', isOpen && 'form-field__wrapper-active', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
78
77
  const selectLabelClassName = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
79
78
  const selectValueClassName = (0, _classnames.default)('form-field__select-value', !input.value && 'form-field__select-placeholder');
80
79
  const selectedOption = options.find(option => option.id === input.value);
@@ -99,10 +98,10 @@ const FormSelect = _ref => {
99
98
  }, [input.value, getFilteredOptions, options, scrollToView]);
100
99
  const getSelectValue = () => {
101
100
  if (!input.value || !input.value.length) {
102
- return "Select Option".concat(multiple ? 's' : '');
101
+ return `Select Option${multiple ? 's' : ''}`;
103
102
  }
104
103
  const multipleValue = multiple && input.value.includes('all') && input.value.length > 1 ? options.filter(option => option.id !== 'all').filter(option => input.value.includes(option.id)).map(option => option.label).join(', ') : options.filter(option => input.value.includes(option.id)).map(option => option.label).join(', ');
105
- return !multiple ? selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label : input.value.length <= 2 ? multipleValue : "".concat(input.value.length, " items selected");
104
+ return !multiple ? selectedOption?.label : input.value.length <= 2 ? multipleValue : `${input.value.length} items selected`;
106
105
  };
107
106
  (0, _react.useEffect)(() => {
108
107
  setIsInvalid(meta.invalid && (meta.validating || meta.modified || meta.submitFailed && meta.touched));
@@ -140,7 +139,7 @@ const FormSelect = _ref => {
140
139
  };
141
140
  }, [clickHandler, handleScroll, isOpen]);
142
141
  const scrollOptionToView = (0, _react.useCallback)(() => {
143
- const selectedOptionEl = optionsListRef.current.querySelector("[data-custom-id=\"".concat(input.value, "\"]"));
142
+ const selectedOptionEl = optionsListRef.current.querySelector(`[data-custom-id="${input.value}"]`);
144
143
  if (!selectedOptionEl) return;
145
144
  searchValue ? optionsListRef.current.scrollTo({
146
145
  top: 0,
@@ -207,14 +206,14 @@ const FormSelect = _ref => {
207
206
  }),
208
207
  hidden: !tooltip,
209
208
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
210
- "data-testid": name ? "".concat(name, "-form-field-select") : 'form-field-select',
209
+ "data-testid": name ? `${name}-form-field-select` : 'form-field-select',
211
210
  ref: selectRef,
212
- className: "form-field-select ".concat(className),
211
+ className: `form-field-select ${className}`,
213
212
  onClick: toggleOpen,
214
213
  children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
215
214
  className: selectLabelClassName,
216
215
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
217
- "data-testid": name ? "".concat(name, "-form-select-label") : 'form-select-label',
216
+ "data-testid": name ? `${name}-form-select-label` : 'form-select-label',
218
217
  children: [label, meta.error && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
219
218
  className: "form-field__label-mandatory",
220
219
  children: " *"
@@ -292,8 +291,8 @@ const FormSelect = _ref => {
292
291
  autoHorizontalPosition: true
293
292
  },
294
293
  style: {
295
- maxWidth: "".concat(selectWidth < 500 && !preventWidthOverflow ? 500 : selectWidth, "px"),
296
- minWidth: "".concat(selectWidth, "px")
294
+ maxWidth: `${selectWidth < 500 && !preventWidthOverflow ? 500 : selectWidth}px`,
295
+ minWidth: `${selectWidth}px`
297
296
  },
298
297
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
299
298
  "data-testid": "select-body",
@@ -4,7 +4,7 @@ var _react = _interopRequireDefault(require("react"));
4
4
  var _Select = _interopRequireDefault(require("./Select"));
5
5
  var _react2 = require("@testing-library/react");
6
6
  var _jsxRuntime = require("react/jsx-runtime");
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
8
  /*
9
9
  Copyright 2022 Iguazio Systems Ltd.
10
10
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -25,7 +25,7 @@ such restriction.
25
25
  jest.mock('../../images/dropdown.svg', () => ({
26
26
  ReactComponent: 'caret-icon'
27
27
  }));
28
- const renderComponent = props => (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
28
+ const renderComponent = props => (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
29
29
  ...props
30
30
  }));
31
31
  describe('Select component', () => {
@@ -76,7 +76,7 @@ describe('Select component', () => {
76
76
  }],
77
77
  disabledOptions: ['test1']
78
78
  };
79
- wrapper.rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
79
+ wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
80
80
  ...props
81
81
  }));
82
82
  const select = wrapper.getByTestId('select');
@@ -91,7 +91,7 @@ describe('Select component', () => {
91
91
  const selectOption = wrapper.getByTestId('select-option');
92
92
  _react2.fireEvent.click(selectOption);
93
93
  expect(mockClick).toHaveBeenCalledWith('test1');
94
- wrapper.rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
94
+ wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
95
95
  options: [{
96
96
  label: 'Test1',
97
97
  id: 'test1'
@@ -105,7 +105,7 @@ describe('Select component', () => {
105
105
  expect(wrapper.getByTestId('select-label').className).toMatch('select__label_floating');
106
106
  });
107
107
  it('should not open select body if props disabled set to "true"', () => {
108
- wrapper.rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
108
+ wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
109
109
  options: [{
110
110
  label: 'Test1',
111
111
  id: 'test1'
@@ -122,7 +122,7 @@ describe('Select component', () => {
122
122
  });
123
123
  it('should call handler callback if it exists in the option', () => {
124
124
  const mockHandler = jest.fn();
125
- wrapper.rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
125
+ wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
126
126
  options: [{
127
127
  label: 'Test1',
128
128
  id: 'test1',
@@ -14,7 +14,7 @@ var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
14
14
  var _exclamationMark = require("../../images/exclamation-mark.svg");
15
15
  require("./formTextarea.scss");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
19
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
20
  /*
@@ -86,7 +86,7 @@ const FormTextarea = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
86
86
  input.onFocus(event);
87
87
  };
88
88
  const validateField = value => {
89
- const valueToValidate = value !== null && value !== void 0 ? value : '';
89
+ const valueToValidate = value ?? '';
90
90
  let validationError = null;
91
91
  if (valueToValidate.startsWith(' ')) {
92
92
  validationError = {
@@ -105,7 +105,6 @@ const FormTextarea = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
105
105
  validate: validateField,
106
106
  name: name,
107
107
  children: _ref2 => {
108
- var _meta$error$label, _meta$error;
109
108
  let {
110
109
  input,
111
110
  meta
@@ -146,7 +145,7 @@ const FormTextarea = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
146
145
  children: [isInvalid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
147
146
  className: "form-field__warning",
148
147
  template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextTooltipTemplate.default, {
149
- text: (_meta$error$label = (_meta$error = meta.error) === null || _meta$error === void 0 ? void 0 : _meta$error.label) !== null && _meta$error$label !== void 0 ? _meta$error$label : invalidText,
148
+ text: meta.error?.label ?? invalidText,
150
149
  warning: true
151
150
  }),
152
151
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_exclamationMark.ReactComponent, {})
@@ -161,7 +160,7 @@ const FormTextarea = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
161
160
  })]
162
161
  }), maxLength && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
163
162
  className: "form-field__counter",
164
- children: "".concat(maxLength - textAreaCount, " ").concat(maxLength - textAreaCount !== 1 ? 'characters' : 'character', " left")
163
+ children: `${maxLength - textAreaCount} ${maxLength - textAreaCount !== 1 ? 'characters' : 'character'} left`
165
164
  })]
166
165
  });
167
166
  }
@@ -10,7 +10,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _reactFinalForm = require("react-final-form");
11
11
  require("./formToggle.scss");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  /*
15
15
  Copyright 2022 Iguazio Systems Ltd.
16
16
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -37,7 +37,7 @@ const FormToggle = _ref => {
37
37
  onChange = () => {},
38
38
  ...inputProps
39
39
  } = _ref;
40
- const toggleWrapperClassNames = (0, _classnames.default)('form-field__wrapper', density && "form-field__wrapper-".concat(density));
40
+ const toggleWrapperClassNames = (0, _classnames.default)('form-field__wrapper', density && `form-field__wrapper-${density}`);
41
41
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
42
42
  name: name,
43
43
  value: inputProps.value,
@@ -48,12 +48,12 @@ const FormToggle = _ref => {
48
48
  } = _ref2;
49
49
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
50
50
  className: "form-field-toggle",
51
- "data-testid": name ? "".concat(name, "-form-field-toggle") : 'form-field-toggle',
51
+ "data-testid": name ? `${name}-form-field-toggle` : 'form-field-toggle',
52
52
  children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
53
53
  className: "form-field__label",
54
54
  children: label
55
55
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
56
- "data-testid": name ? "".concat(name, "-form-toggle") : 'form-toggle',
56
+ "data-testid": name ? `${name}-form-toggle` : 'form-toggle',
57
57
  id: name,
58
58
  ...input,
59
59
  ...inputProps,
@@ -15,7 +15,7 @@ var _types = require("../../types");
15
15
  var _close = require("../../images/close.svg");
16
16
  require("./Modal.scss");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
19
  /*
20
20
  Copyright 2022 Iguazio Systems Ltd.
21
21
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -46,7 +46,7 @@ const Modal = _ref => {
46
46
  subTitle = null,
47
47
  title = ''
48
48
  } = _ref;
49
- const modalClassNames = (0, _classnames.default)('modal', className, size && "modal-".concat(size));
49
+ const modalClassNames = (0, _classnames.default)('modal', className, size && `modal-${size}`);
50
50
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
51
51
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
52
52
  onClose: onClose,
@@ -16,7 +16,7 @@ var _types = require("../../types");
16
16
  var _close = require("../../images/close.svg");
17
17
  require("./popUpDialog.scss");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
22
  /*
@@ -37,7 +37,6 @@ such restriction.
37
37
  */
38
38
 
39
39
  const PopUpDialog = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
40
- var _ref2;
41
40
  let {
42
41
  children,
43
42
  className = '',
@@ -49,17 +48,16 @@ const PopUpDialog = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
49
48
  style = {},
50
49
  tooltipText = ''
51
50
  } = _ref;
52
- const [showPopUp, setShowPopUp] = (0, _react.useState)(showPopUpDialog !== null && showPopUpDialog !== void 0 ? showPopUpDialog : true);
51
+ const [showPopUp, setShowPopUp] = (0, _react.useState)(showPopUpDialog ?? true);
53
52
  const popUpOverlayRef = (0, _react.useRef)(null);
54
- (_ref2 = ref) !== null && _ref2 !== void 0 ? _ref2 : ref = popUpOverlayRef;
53
+ ref ??= popUpOverlayRef;
55
54
  const popUpClassNames = (0, _classnames.default)(className, 'pop-up-dialog__overlay', customPosition.element && 'custom-position');
56
55
  const handleClosePopUp = (0, _react.useCallback)(() => {
57
56
  closePopUp && closePopUp();
58
57
  setShowPopUp(false);
59
58
  }, [closePopUp]);
60
59
  const calculateCustomPopUpPosition = (0, _react.useCallback)(() => {
61
- var _customPosition$eleme, _ref3;
62
- 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) {
60
+ if (customPosition?.element?.current && ref?.current) {
63
61
  const elementRect = customPosition.element.current.getBoundingClientRect();
64
62
  const popUpRect = ref.current.getBoundingClientRect();
65
63
  const [verticalPosition, horizontalPosition] = customPosition.position.split('-');
@@ -102,11 +100,11 @@ const PopUpDialog = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
102
100
  }
103
101
  }
104
102
  }
105
- ref.current.style.top = "".concat(topPosition, "px");
103
+ ref.current.style.top = `${topPosition}px`;
106
104
  if (style.left && !(customPosition.autoHorizontalPosition && isEnoughSpaceFromRight)) {
107
- ref.current.style.left = "calc(".concat(leftPosition, "px + ").concat(style.left, ")");
105
+ ref.current.style.left = `calc(${leftPosition}px + ${style.left})`;
108
106
  } else {
109
- ref.current.style.left = "".concat(leftPosition, "px");
107
+ ref.current.style.left = `${leftPosition}px`;
110
108
  }
111
109
  }
112
110
  }, [customPosition, style.left, ref]);
@@ -129,7 +127,7 @@ const PopUpDialog = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
129
127
  };
130
128
  }
131
129
  }, [calculateCustomPopUpPosition, ref, showPopUp]);
132
- return showPopUp ? /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
130
+ return showPopUp ? /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
133
131
  ref: ref,
134
132
  className: popUpClassNames,
135
133
  style: style,
@@ -11,7 +11,7 @@ var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
11
11
  var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
12
12
  require("./roundedIcon.scss");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  /*
16
16
  Copyright 2022 Iguazio Systems Ltd.
17
17
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -13,7 +13,7 @@ var _questionMark = require("../../images/question-mark.svg");
13
13
  var _exclamationMark = require("../../images/exclamation-mark.svg");
14
14
  var _tip = _interopRequireDefault(require("./tip.scss"));
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
19
  /*
@@ -58,15 +58,15 @@ const Tip = _ref => {
58
58
  const tipRect = tipBodyRef.current.getBoundingClientRect();
59
59
  const widthPosition = iconRect.left > tipRect.width - arrowOffset ? 'tip_left' : 'tip_right';
60
60
  const heightPosition = iconRect.top > tipRect.height + arrowLength ? 'tip_top' : 'tip_bottom';
61
- setTipClassName("".concat(heightPosition, " ").concat(widthPosition));
61
+ setTipClassName(`${heightPosition} ${widthPosition}`);
62
62
  if (widthPosition === 'tip_left') {
63
63
  const computedArrowOffset = arrowOffset + (iconLength + arrowLength) / 2;
64
- tipBodyRef.current.style.left = "".concat(iconRect.left - (tipRect.width - computedArrowOffset), "px");
64
+ tipBodyRef.current.style.left = `${iconRect.left - (tipRect.width - computedArrowOffset)}px`;
65
65
  } else {
66
66
  const computedArrowOffset = arrowOffset - (iconLength - arrowLength) / 2;
67
- tipBodyRef.current.style.left = "".concat(iconRect.left - computedArrowOffset, "px");
67
+ tipBodyRef.current.style.left = `${iconRect.left - computedArrowOffset}px`;
68
68
  }
69
- tipBodyRef.current.style.top = heightPosition === 'tip_top' ? "".concat(iconRect.top - tipRect.height - arrowLength, "px") : "".concat(iconRect.bottom + arrowLength, "px");
69
+ tipBodyRef.current.style.top = heightPosition === 'tip_top' ? `${iconRect.top - tipRect.height - arrowLength}px` : `${iconRect.bottom + arrowLength}px`;
70
70
  }
71
71
  }, [isShow]);
72
72
  const handleMouseLeave = () => {
@@ -94,7 +94,7 @@ const Tip = _ref => {
94
94
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_questionMark.ReactComponent, {
95
95
  "data-testid": "tip-icon"
96
96
  })
97
- }), /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
97
+ }), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
98
98
  in: isShow,
99
99
  timeout: 200,
100
100
  classNames: "fade",
@@ -4,7 +4,7 @@ var _react = _interopRequireDefault(require("react"));
4
4
  var _react2 = require("@testing-library/react");
5
5
  var _Tip = _interopRequireDefault(require("./Tip"));
6
6
  var _jsxRuntime = require("react/jsx-runtime");
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
8
  /*
9
9
  Copyright 2022 Iguazio Systems Ltd.
10
10
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -25,7 +25,7 @@ such restriction.
25
25
  jest.mock('../../images/question-mark.svg', () => ({
26
26
  ReactComponent: 'Question-icon'
27
27
  }));
28
- const renderComponent = props => (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tip.default, {
28
+ const renderComponent = props => (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tip.default, {
29
29
  ...props
30
30
  }));
31
31
  describe('Tip component', () => {
@@ -53,7 +53,7 @@ describe('Tip component', () => {
53
53
  expect(tipText).toBeUndefined();
54
54
  });
55
55
  it('should add the class "tip_big" if the length of the prop text is more than 40 characters', () => {
56
- wrapper.rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tip.default, {
56
+ wrapper.rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tip.default, {
57
57
  text: "Lorem Ipsum is simply dummy text of the printing and typesetting"
58
58
  }));
59
59
  const tipIcon = wrapper.getByTestId('tip-icon');