iguazio.dashboard-react-controls 1.9.3 → 2.0.1

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 (55) hide show
  1. package/dist/components/Backdrop/Backdrop.js +7 -7
  2. package/dist/components/Button/Button.js +20 -26
  3. package/dist/components/ConfirmDialog/ConfirmDialog.js +18 -17
  4. package/dist/components/FormCheckBox/FormCheckBox.js +28 -32
  5. package/dist/components/FormChipCell/FormChip/FormChip.js +46 -50
  6. package/dist/components/FormChipCell/FormChipCell.js +122 -142
  7. package/dist/components/FormChipCell/FormChipCellView.js +44 -47
  8. package/dist/components/FormChipCell/HiddenChipsBlock/HiddenChipsBlock.js +23 -20
  9. package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +129 -152
  10. package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +24 -27
  11. package/dist/components/FormChipCell/formChipCell.util.js +6 -16
  12. package/dist/components/FormCombobox/FormCombobox.js +134 -195
  13. package/dist/components/FormInput/FormInput.js +134 -212
  14. package/dist/components/FormInput/InputNumberButtons/InputNumberButtons.js +15 -14
  15. package/dist/components/FormKeyValueTable/FormKeyValueTable.js +72 -72
  16. package/dist/components/FormRadio/FormRadio.js +21 -25
  17. package/dist/components/FormSelect/FormSelect.js +98 -126
  18. package/dist/components/FormSelect/FormSelect.test.js +56 -60
  19. package/dist/components/FormTextarea/FormTextarea.js +55 -71
  20. package/dist/components/FormToggle/FormToggle.js +25 -29
  21. package/dist/components/Modal/Modal.js +17 -18
  22. package/dist/components/PopUpDialog/PopUpDialog.js +53 -63
  23. package/dist/components/RoundedIcon/RoundedIcon.js +14 -13
  24. package/dist/components/Tip/Tip.js +58 -64
  25. package/dist/components/Tip/Tip.test.js +41 -64
  26. package/dist/components/Tooltip/Tooltip.js +75 -89
  27. package/dist/components/TooltipTemplate/ProducerTooltipTemplate.js +6 -5
  28. package/dist/components/TooltipTemplate/TextTooltipTemplate.js +10 -10
  29. package/dist/components/Wizard/Wizard.js +73 -107
  30. package/dist/components/Wizard/WizardSteps/WizardSteps.js +19 -20
  31. package/dist/components/index.js +18 -18
  32. package/dist/constants.js +26 -44
  33. package/dist/elements/FormActionButton/FormActionButton.js +12 -13
  34. package/dist/elements/FormRowActions/FormRowActions.js +19 -22
  35. package/dist/elements/OptionsMenu/OptionsMenu.js +10 -8
  36. package/dist/elements/SelectOption/SelectOption.js +14 -13
  37. package/dist/elements/SelectOption/SelectOption.test.js +39 -47
  38. package/dist/elements/ValidationTemplate/ValidationTemplate.js +7 -6
  39. package/dist/elements/index.js +5 -5
  40. package/dist/hooks/index.js +5 -5
  41. package/dist/hooks/useChipCell.hook.js +66 -85
  42. package/dist/hooks/useDebounce.hook.js +22 -24
  43. package/dist/hooks/useDetectOutsideClick.hook.js +4 -4
  44. package/dist/hooks/useFormTable.hook.js +99 -112
  45. package/dist/hooks/useHiddenChipsBlock.hook.js +40 -55
  46. package/dist/index.js +2 -3
  47. package/dist/scss/variables.scss +3 -1
  48. package/dist/types.js +43 -67
  49. package/dist/utils/common.util.js +19 -23
  50. package/dist/utils/form.util.js +33 -39
  51. package/dist/utils/generateChipsList.util.js +7 -7
  52. package/dist/utils/getFirstScrollableParent.util.js +4 -10
  53. package/dist/utils/math.util.js +3 -3
  54. package/dist/utils/validation.util.js +78 -131
  55. package/package.json +34 -34
@@ -27,11 +27,12 @@ under the Apache 2.0 license is conditioned upon your compliance with
27
27
  such restriction.
28
28
  */
29
29
 
30
- var Backdrop = function Backdrop(_ref) {
31
- var _ref$duration = _ref.duration,
32
- duration = _ref$duration === void 0 ? 300 : _ref$duration,
33
- show = _ref.show,
34
- onClose = _ref.onClose;
30
+ const Backdrop = _ref => {
31
+ let {
32
+ duration = 300,
33
+ show,
34
+ onClose
35
+ } = _ref;
35
36
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
36
37
  in: show,
37
38
  timeout: duration,
@@ -51,5 +52,4 @@ Backdrop.defaultProps = {
51
52
  Backdrop.propTypes = {
52
53
  show: _propTypes.default.bool.isRequired
53
54
  };
54
- var _default = Backdrop;
55
- exports.default = _default;
55
+ var _default = exports.default = Backdrop;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
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
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -14,7 +13,9 @@ var _types = require("../../types");
14
13
  var _constants = require("../../constants");
15
14
  require("./Button.scss");
16
15
  var _jsxRuntime = require("react/jsx-runtime");
17
- var _excluded = ["className", "density", "icon", "id", "label", "tooltip", "variant"];
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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
+ 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; }
18
19
  /*
19
20
  Copyright 2022 Iguazio Systems Ltd.
20
21
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -31,27 +32,21 @@ illegal under applicable law, and the grant of the foregoing license
31
32
  under the Apache 2.0 license is conditioned upon your compliance with
32
33
  such restriction.
33
34
  */
34
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
- 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); }
36
- 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
- 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; }
38
- 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; }
39
- 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; }
40
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
41
- 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); }
42
- 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; }
43
- 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; }
44
- var Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
45
- var className = _ref.className,
46
- density = _ref.density,
47
- icon = _ref.icon,
48
- id = _ref.id,
49
- label = _ref.label,
50
- tooltip = _ref.tooltip,
51
- variant = _ref.variant,
52
- restProps = _objectWithoutProperties(_ref, _excluded);
53
- var buttonClassName = (0, _classnames.default)('btn', "btn-".concat(variant), "btn-".concat(density), className);
54
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", _objectSpread(_objectSpread({}, restProps), {}, {
35
+
36
+ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
37
+ let {
38
+ className,
39
+ density,
40
+ icon,
41
+ id,
42
+ label,
43
+ tooltip,
44
+ variant,
45
+ ...restProps
46
+ } = _ref;
47
+ const buttonClassName = (0, _classnames.default)('btn', "btn-".concat(variant), "btn-".concat(density), className);
48
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
49
+ ...restProps,
55
50
  className: buttonClassName,
56
51
  ref: ref,
57
52
  "data-testid": id,
@@ -65,7 +60,7 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
65
60
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
66
61
  children: label
67
62
  })]
68
- }));
63
+ });
69
64
  });
70
65
  Button.defaultProps = {
71
66
  className: '',
@@ -84,5 +79,4 @@ Button.propTypes = {
84
79
  tooltip: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
85
80
  variant: _types.BUTTON_VARIANTS
86
81
  };
87
- var _default = Button;
88
- exports.default = _default;
82
+ var _default = exports.default = Button;
@@ -30,27 +30,29 @@ under the Apache 2.0 license is conditioned upon your compliance with
30
30
  such restriction.
31
31
  */
32
32
 
33
- var ConfirmDialog = function ConfirmDialog(_ref) {
34
- var cancelButton = _ref.cancelButton,
35
- className = _ref.className,
36
- closePopUp = _ref.closePopUp,
37
- confirmButton = _ref.confirmButton,
38
- customPosition = _ref.customPosition,
39
- header = _ref.header,
40
- isOpen = _ref.isOpen,
41
- message = _ref.message,
42
- messageOnly = _ref.messageOnly,
43
- onResolve = _ref.onResolve;
44
- var messageClassNames = (0, _classnames.default)('confirm-dialog__message', messageOnly && 'confirm-dialog__message-only');
45
- var handleCancelDialog = function handleCancelDialog(event) {
33
+ const ConfirmDialog = _ref => {
34
+ let {
35
+ cancelButton,
36
+ className,
37
+ closePopUp,
38
+ confirmButton,
39
+ customPosition,
40
+ header,
41
+ isOpen,
42
+ message,
43
+ messageOnly,
44
+ onResolve
45
+ } = _ref;
46
+ const messageClassNames = (0, _classnames.default)('confirm-dialog__message', messageOnly && 'confirm-dialog__message-only');
47
+ const handleCancelDialog = event => {
46
48
  onResolve && onResolve();
47
49
  cancelButton.handler && cancelButton.handler(event);
48
50
  };
49
- var handleCloseDialog = function handleCloseDialog(event) {
51
+ const handleCloseDialog = event => {
50
52
  onResolve && onResolve();
51
53
  closePopUp && closePopUp(event);
52
54
  };
53
- var handleConfirmDialog = function handleConfirmDialog(event) {
55
+ const handleConfirmDialog = event => {
54
56
  onResolve && onResolve();
55
57
  confirmButton.handler && confirmButton.handler(event);
56
58
  };
@@ -99,5 +101,4 @@ ConfirmDialog.propTypes = {
99
101
  message: _types.CONFIRM_DIALOG_MESSAGE,
100
102
  messageOnly: _propTypes.default.bool
101
103
  };
102
- var _default = ConfirmDialog;
103
- exports.default = _default;
104
+ var _default = exports.default = ConfirmDialog;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
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
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -11,7 +10,9 @@ var _reactFinalForm = require("react-final-form");
11
10
  var _classnames = _interopRequireDefault(require("classnames"));
12
11
  require("./formCheckBox.scss");
13
12
  var _jsxRuntime = require("react/jsx-runtime");
14
- var _excluded = ["children", "className", "highlightLabel", "label", "name", "readOnly"];
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ 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); }
15
+ 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; }
15
16
  /*
16
17
  Copyright 2022 Iguazio Systems Ltd.
17
18
  Licensed under the Apache License, Version 2.0 (the "License") with
@@ -28,49 +29,45 @@ illegal under applicable law, and the grant of the foregoing license
28
29
  under the Apache 2.0 license is conditioned upon your compliance with
29
30
  such restriction.
30
31
  */
31
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
- 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); }
33
- 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; }
34
- 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; }
35
- 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; }
36
- 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; }
37
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
38
- 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); }
39
- 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; }
40
- 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; }
41
- var FormCheckBox = function FormCheckBox(_ref) {
42
- var _children = _ref.children,
43
- className = _ref.className,
44
- highlightLabel = _ref.highlightLabel,
45
- label = _ref.label,
46
- name = _ref.name,
47
- readOnly = _ref.readOnly,
48
- inputProps = _objectWithoutProperties(_ref, _excluded);
49
- var formFieldClassNames = (0, _classnames.default)('form-field-checkbox', readOnly && 'form-field-checkbox_readonly', className);
50
- var labelClassNames = (0, _classnames.default)(highlightLabel && 'highlighted');
51
- var inputRef = (0, _react.useRef)();
32
+
33
+ const FormCheckBox = _ref => {
34
+ let {
35
+ children,
36
+ className,
37
+ highlightLabel,
38
+ label,
39
+ name,
40
+ readOnly,
41
+ ...inputProps
42
+ } = _ref;
43
+ const formFieldClassNames = (0, _classnames.default)('form-field-checkbox', readOnly && 'form-field-checkbox_readonly', className);
44
+ const labelClassNames = (0, _classnames.default)(highlightLabel && 'highlighted');
45
+ const inputRef = (0, _react.useRef)();
52
46
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
53
47
  name: name,
54
48
  value: inputProps.value,
55
49
  type: "checkbox",
56
- children: function children(_ref2) {
50
+ children: _ref2 => {
57
51
  var _inputProps$value, _inputProps$value2;
58
- var input = _ref2.input;
52
+ let {
53
+ input
54
+ } = _ref2;
59
55
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
60
56
  className: formFieldClassNames,
61
57
  "data-testid": "form-field-checkbox",
62
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread(_objectSpread({
58
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
63
59
  ref: inputRef,
64
60
  className: (0, _classnames.default)(input.checked ? 'checked' : 'unchecked'),
65
61
  type: "checkbox",
66
62
  "data-testid": name ? "".concat(name, "-form-checkbox") : 'form-checkbox',
67
- id: (_inputProps$value = inputProps.value) !== null && _inputProps$value !== void 0 ? _inputProps$value : name
68
- }, _objectSpread(_objectSpread({}, input), inputProps)), {}, {
63
+ id: (_inputProps$value = inputProps.value) !== null && _inputProps$value !== void 0 ? _inputProps$value : name,
64
+ ...input,
65
+ ...inputProps,
69
66
  value: String(input.checked)
70
- })), /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
67
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
71
68
  htmlFor: (_inputProps$value2 = inputProps.value) !== null && _inputProps$value2 !== void 0 ? _inputProps$value2 : name,
72
69
  className: labelClassNames,
73
- children: [label ? label : '', _children]
70
+ children: [label ? label : '', children]
74
71
  })]
75
72
  });
76
73
  }
@@ -89,5 +86,4 @@ FormCheckBox.propTypes = {
89
86
  label: _propTypes.default.string,
90
87
  readOnly: _propTypes.default.bool
91
88
  };
92
- var _default = /*#__PURE__*/_react.default.memo(FormCheckBox);
93
- exports.default = _default;
89
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(FormCheckBox);
@@ -11,59 +11,56 @@ var _types = require("../../../types");
11
11
  require("./formChip.scss");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- 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); }
15
- 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; }
16
- 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); }
17
- 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; }
18
- 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; }
19
- 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; }
20
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
21
- 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); } /*
22
- Copyright 2022 Iguazio Systems Ltd.
23
- Licensed under the Apache License, Version 2.0 (the "License") with
24
- an addition restriction as set forth herein. You may not use this
25
- file except in compliance with the License. You may obtain a copy of
26
- the License at http://www.apache.org/licenses/LICENSE-2.0.
27
- Unless required by applicable law or agreed to in writing, software
28
- distributed under the License is distributed on an "AS IS" BASIS,
29
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
30
- implied. See the License for the specific language governing
31
- permissions and limitations under the License.
32
- In addition, you may not use the software for any purposes that are
33
- illegal under applicable law, and the grant of the foregoing license
34
- under the Apache 2.0 license is conditioned upon your compliance with
35
- such restriction.
36
- */
37
- var FormChip = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
38
- var chip = _ref.chip,
39
- chipIndex = _ref.chipIndex,
40
- chipOptions = _ref.chipOptions,
41
- editConfig = _ref.editConfig,
42
- handleEditChip = _ref.handleEditChip,
43
- handleRemoveChip = _ref.handleRemoveChip,
44
- handleToEditMode = _ref.handleToEditMode,
45
- isDeleteMode = _ref.isDeleteMode,
46
- isEditable = _ref.isEditable,
47
- keyName = _ref.keyName,
48
- meta = _ref.meta,
49
- setChipsSizes = _ref.setChipsSizes,
50
- setEditConfig = _ref.setEditConfig,
51
- validationRules = _ref.validationRules,
52
- valueName = _ref.valueName;
53
- var chipRef = _react.default.useRef();
54
- (0, _react.useEffect)(function () {
55
- queueMicrotask(function () {
14
+ 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); }
15
+ 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; }
16
+ /*
17
+ Copyright 2022 Iguazio Systems Ltd.
18
+ Licensed under the Apache License, Version 2.0 (the "License") with
19
+ an addition restriction as set forth herein. You may not use this
20
+ file except in compliance with the License. You may obtain a copy of
21
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
22
+ Unless required by applicable law or agreed to in writing, software
23
+ distributed under the License is distributed on an "AS IS" BASIS,
24
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
25
+ implied. See the License for the specific language governing
26
+ permissions and limitations under the License.
27
+ In addition, you may not use the software for any purposes that are
28
+ illegal under applicable law, and the grant of the foregoing license
29
+ under the Apache 2.0 license is conditioned upon your compliance with
30
+ such restriction.
31
+ */
32
+
33
+ const FormChip = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
34
+ let {
35
+ chip,
36
+ chipIndex,
37
+ chipOptions,
38
+ editConfig,
39
+ handleEditChip,
40
+ handleRemoveChip,
41
+ handleToEditMode,
42
+ isDeleteMode,
43
+ isEditable,
44
+ keyName,
45
+ meta,
46
+ setChipsSizes,
47
+ setEditConfig,
48
+ validationRules,
49
+ valueName
50
+ } = _ref;
51
+ const chipRef = _react.default.useRef();
52
+ (0, _react.useEffect)(() => {
53
+ queueMicrotask(() => {
56
54
  if (chipRef.current && setChipsSizes) {
57
- setChipsSizes(function (state) {
58
- return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, chipIndex, chipRef.current.getBoundingClientRect().width));
59
- });
55
+ setChipsSizes(state => ({
56
+ ...state,
57
+ [chipIndex]: chipRef.current.getBoundingClientRect().width
58
+ }));
60
59
  }
61
60
  });
62
61
  }, [chipIndex, setChipsSizes]);
63
62
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
64
- onClick: function onClick(event) {
65
- return handleToEditMode(event, chipIndex, keyName);
66
- },
63
+ onClick: event => handleToEditMode(event, chipIndex, keyName),
67
64
  ref: chipRef,
68
65
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_NewChipForm.default, {
69
66
  chip: chip,
@@ -115,5 +112,4 @@ FormChip.propTypes = {
115
112
  validationRules: _propTypes.default.object,
116
113
  valueName: _propTypes.default.string
117
114
  };
118
- var _default = FormChip;
119
- exports.default = _default;
115
+ var _default = exports.default = FormChip;