indicator-ui 0.0.60 → 0.0.62
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/index.js
CHANGED
|
@@ -9327,7 +9327,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9327
9327
|
/* harmony export */ "default": () => (/* binding */ getStringValue)
|
|
9328
9328
|
/* harmony export */ });
|
|
9329
9329
|
function getStringValue(value, options = []) {
|
|
9330
|
-
console.log(options, value);
|
|
9331
9330
|
if (Array.isArray(value)) {
|
|
9332
9331
|
const labels = options.filter(item => !!value.find(v => JSON.stringify(v) === JSON.stringify(item.value))).map(item => item.label);
|
|
9333
9332
|
return labels.join(', ');
|
|
@@ -9483,6 +9482,7 @@ function SelectField({ value, onChange, options = [], placeholder, isError, sear
|
|
|
9483
9482
|
const [isFocus, setIsFocus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
|
9484
9483
|
const [searchingString, setSearchingString] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('');
|
|
9485
9484
|
const [isShowModalWindow, setIsShowModalWindow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
|
9485
|
+
const optionsCounter = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(options.length);
|
|
9486
9486
|
const requestPromiseRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(undefined);
|
|
9487
9487
|
// Добавляем кэширование выбранных options
|
|
9488
9488
|
const optionsCacheRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]);
|
|
@@ -9546,11 +9546,10 @@ function SelectField({ value, onChange, options = [], placeholder, isError, sear
|
|
|
9546
9546
|
requestPromiseRef.current = loadMoreOptions(optionsState?.length || 0, searchingString);
|
|
9547
9547
|
}
|
|
9548
9548
|
const newOptions = await requestPromiseRef.current;
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
}
|
|
9552
|
-
if (newOptions !== undefined)
|
|
9549
|
+
requestPromiseRef.current = undefined;
|
|
9550
|
+
if (newOptions !== undefined) {
|
|
9553
9551
|
setOptionsState(prevState => [...prevState, ...newOptions]);
|
|
9552
|
+
}
|
|
9554
9553
|
}
|
|
9555
9554
|
};
|
|
9556
9555
|
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className?.selectField, children: [getViewField(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui__WEBPACK_IMPORTED_MODULE_6__.ModalWindowWrapper, { isShow: isShowModalWindow, setIsShow: setIsShowModalWindow, additionElements: [inputRef.current], className: className?.modalWindow, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_SelectModalWindow__WEBPACK_IMPORTED_MODULE_5__["default"], { value: value, options: optionsState, onChange: handleChange, afterElement: selectModalWindowAfterElement, onScrollToBottom: onScrollToBottom, className: className }) })] }));
|
|
@@ -9636,7 +9635,6 @@ function SelectModalWindow({ value, onChange, options, onScrollToBottom, afterEl
|
|
|
9636
9635
|
const scrollHeight = event.currentTarget.scrollHeight;
|
|
9637
9636
|
const clientHeight = event.currentTarget.clientHeight;
|
|
9638
9637
|
const scrollTop = event.currentTarget.scrollTop;
|
|
9639
|
-
console.log('catch');
|
|
9640
9638
|
if (scrollHeight - scrollTop - clientHeight < _config__WEBPACK_IMPORTED_MODULE_2__.DELTA_SCROLL_END) {
|
|
9641
9639
|
onScrollToBottom && onScrollToBottom();
|
|
9642
9640
|
}
|