iguazio.dashboard-react-controls 2.2.3 → 2.2.5

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.
@@ -122,13 +122,14 @@ const FormChipCell = _ref => {
122
122
  });
123
123
  event && event.preventDefault();
124
124
  }, [editConfig.isEdit, editConfig.chipIndex, showHiddenChips, formState.form.mutators, name, delimiter, setShowHiddenChips]);
125
- const handleRemoveChip = (0, _react.useCallback)((event, fields, chipIndex) => {
125
+ const handleRemoveChip = (0, _react.useCallback)(function (event, fields, chipIndex) {
126
+ let isOutsideClick = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
126
127
  checkChipsList(_lodash.default.chain(formState).get(['values', name]).filter((_, index) => index !== chipIndex).value());
127
128
  fields.remove(chipIndex);
128
129
  onExitEditModeCallback && onExitEditModeCallback();
129
- event && event.stopPropagation();
130
+ event && !isOutsideClick && event.stopPropagation();
130
131
  }, [checkChipsList, formState, name, onExitEditModeCallback]);
131
- const handleEditChip = (0, _react.useCallback)((event, fields, nameEvent) => {
132
+ const handleEditChip = (0, _react.useCallback)((event, fields, nameEvent, isOutsideClick) => {
132
133
  const {
133
134
  key,
134
135
  value
@@ -136,7 +137,7 @@ const FormChipCell = _ref => {
136
137
  const isChipNotEmpty = !!(key !== null && key !== void 0 && key.trim() && value !== null && value !== void 0 && value.trim());
137
138
  if (nameEvent === _constants.CLICK) {
138
139
  if (!isChipNotEmpty) {
139
- handleRemoveChip(event, fields, editConfig.chipIndex);
140
+ handleRemoveChip(event, fields, editConfig.chipIndex, isOutsideClick);
140
141
  }
141
142
  setEditConfig({
142
143
  chipIndex: null,
@@ -114,7 +114,7 @@ const FormChipCellView = /*#__PURE__*/_react.default.forwardRef((_ref, _ref2) =>
114
114
  chipIndex: index,
115
115
  chipOptions: chipOptions,
116
116
  editConfig: editConfig,
117
- handleEditChip: (event, nameEvent) => handleEditChip(event, fields, nameEvent),
117
+ handleEditChip: (event, nameEvent, isOutsideClick) => handleEditChip(event, fields, nameEvent, isOutsideClick),
118
118
  handleRemoveChip: (event, index) => handleRemoveChip(event, fields, index),
119
119
  handleToEditMode: handleToEditMode,
120
120
  isEditable: isEditable,
@@ -128,7 +128,7 @@ const NewChipForm = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
128
128
  var _event$path, _event$composedPath;
129
129
  const elementPath = (_event$path = event.path) !== null && _event$path !== void 0 ? _event$path : (_event$composedPath = event.composedPath) === null || _event$composedPath === void 0 ? void 0 : _event$composedPath.call(event);
130
130
  if (!elementPath.includes(refInputContainer.current)) {
131
- onChange(event, _constants.CLICK);
131
+ onChange(event, _constants.CLICK, true);
132
132
  window.getSelection().removeAllRanges();
133
133
  } else {
134
134
  event.stopPropagation();
@@ -206,7 +206,7 @@ const NewChipForm = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
206
206
  };
207
207
  });
208
208
  }
209
- }, [maxWidthInput, refInputKey, refInputValue, keyName]);
209
+ }, [keyName, minWidthInput, maxWidthInput, minWidthValueInput]);
210
210
  (0, _react.useLayoutEffect)(() => {
211
211
  if (editConfig.chipIndex === chipIndex) {
212
212
  setSelectedInput(editConfig.isKeyFocused ? 'key' : editConfig.isValueFocused ? 'value' : null);
@@ -55,7 +55,6 @@ const NewChipInput = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
55
55
  "data-testid": "input",
56
56
  ref: ref,
57
57
  type: "text",
58
- id: input.name,
59
58
  ...inputProps,
60
59
  ...input,
61
60
  onChange: handleInputChange,
@@ -59,7 +59,7 @@ const FormTextarea = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
59
59
  } = (0, _reactFinalForm.useField)(name);
60
60
  const [isInvalid, setIsInvalid] = (0, _react.useState)(false);
61
61
  const [textAreaCount, setTextAreaCount] = (0, _react.useState)(input.value.length);
62
- const textAreaRef = /*#__PURE__*/_react.default.createRef();
62
+ const textAreaRef = (0, _react.useRef)();
63
63
  const formFieldClassNames = (0, _classnames.default)('form-field-textarea', className);
64
64
  const labelClassNames = (0, _classnames.default)('form-field__label', disabled && 'form-field__label-disabled');
65
65
  const textAreaClassNames = (0, _classnames.default)('form-field__wrapper', disabled && 'form-field__wrapper-disabled', isInvalid && 'form-field__wrapper-invalid', withoutBorder && 'without-border');
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5.1 16.05C4.73333 15.4167 4.45833 14.7667 4.275 14.1C4.09167 13.4333 4 12.75 4 12.05C4 9.81667 4.775 7.91667 6.325 6.35C7.875 4.78333 9.76667 4 12 4H12.175L10.575 2.4L11.975 1L15.975 5L11.975 9L10.575 7.6L12.175 6H12C10.3333 6 8.91667 6.5875 7.75 7.7625C6.58333 8.9375 6 10.3667 6 12.05C6 12.4833 6.05 12.9083 6.15 13.325C6.25 13.7417 6.4 14.15 6.6 14.55L5.1 16.05ZM12.025 23L8.025 19L12.025 15L13.425 16.4L11.825 18H12C13.6667 18 15.0833 17.4125 16.25 16.2375C17.4167 15.0625 18 13.6333 18 11.95C18 11.5167 17.95 11.0917 17.85 10.675C17.75 10.2583 17.6 9.85 17.4 9.45L18.9 7.95C19.2667 8.58333 19.5417 9.23333 19.725 9.9C19.9083 10.5667 20 11.25 20 11.95C20 14.1833 19.225 16.0833 17.675 17.65C16.125 19.2167 14.2333 20 12 20H11.825L13.425 21.6L12.025 23Z" fill="#7F7989"/>
3
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",