iguazio.dashboard-react-controls 2.2.4 → 2.2.6
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.
- package/dist/components/FormChipCell/FormChipCell.js +5 -4
- package/dist/components/FormChipCell/FormChipCellView.js +1 -1
- package/dist/components/FormChipCell/NewChipForm/NewChipForm.js +2 -2
- package/dist/components/FormChipCell/NewChipInput/NewChipInput.js +0 -1
- package/dist/components/FormTextarea/FormTextarea.js +1 -1
- package/dist/components/Modal/Modal.js +2 -1
- package/dist/components/Tooltip/Tooltip.js +1 -0
- package/package.json +1 -1
|
@@ -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
|
-
}, [
|
|
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);
|
|
@@ -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 =
|
|
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');
|
|
@@ -38,6 +38,7 @@ const Modal = _ref => {
|
|
|
38
38
|
actions = [],
|
|
39
39
|
children,
|
|
40
40
|
className,
|
|
41
|
+
noHeader = false,
|
|
41
42
|
onClose,
|
|
42
43
|
previewText = '',
|
|
43
44
|
size = _constants.MODAL_MD,
|
|
@@ -68,7 +69,7 @@ const Modal = _ref => {
|
|
|
68
69
|
})
|
|
69
70
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
70
71
|
className: "modal__content",
|
|
71
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
72
|
+
children: [!noHeader && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
72
73
|
className: "modal__header",
|
|
73
74
|
children: [previewText && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
74
75
|
className: "modal__header-preview-text",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iguazio.dashboard-react-controls",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
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",
|