indicator-ui 0.0.34 → 0.0.36

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
@@ -9422,7 +9422,7 @@ __webpack_require__.r(__webpack_exports__);
9422
9422
 
9423
9423
 
9424
9424
 
9425
- function SelectField({ value, onChange, options = [], placeholder, isError, isSearching = false, required = false, multiple = false, disabled = false, offOptionsSyncing = true, autoClose = true, onBlur, loadMoreOptions, className = _styles__WEBPACK_IMPORTED_MODULE_4__.SelectFieldStyle, }) {
9425
+ function SelectField({ value, onChange, options = [], placeholder, isError, isSearching = false, required = false, multiple = false, disabled = false, offOptionsSyncing = true, autoClose = true, onBlur, selectModalWindowAfterElement, loadMoreOptions, className = _styles__WEBPACK_IMPORTED_MODULE_4__.SelectFieldStyle, }) {
9426
9426
  const [isFocus, setIsFocus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
9427
9427
  const [searchingString, setSearchingString] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('');
9428
9428
  const [isShowModalWindow, setIsShowModalWindow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
@@ -9490,10 +9490,11 @@ function SelectField({ value, onChange, options = [], placeholder, isError, isSe
9490
9490
  const onScrollToBottom = async () => {
9491
9491
  if (loadMoreOptions) {
9492
9492
  const newOptions = await loadMoreOptions(optionsState?.length);
9493
- setOptionsState(prevState => [...prevState, ...newOptions]);
9493
+ if (newOptions !== undefined)
9494
+ setOptionsState(prevState => [...prevState, ...newOptions]);
9494
9495
  }
9495
9496
  };
9496
- return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className?.selectField, children: [getViewField(), isShowModalWindow && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: modalWindowRef, 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, onScrollToBottom: onScrollToBottom, className: className }) }))] }));
9497
+ return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className?.selectField, children: [getViewField(), isShowModalWindow && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: modalWindowRef, 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 }) }))] }));
9497
9498
  }
9498
9499
 
9499
9500
 
@@ -9550,7 +9551,7 @@ __webpack_require__.r(__webpack_exports__);
9550
9551
 
9551
9552
 
9552
9553
 
9553
- function SelectModalWindow({ value, onChange, options, onScrollToBottom, className, }) {
9554
+ function SelectModalWindow({ value, onChange, options, onScrollToBottom, afterElement, className, }) {
9554
9555
  const handleClick = (option) => {
9555
9556
  let newValue;
9556
9557
  if (value) {
@@ -9580,7 +9581,7 @@ function SelectModalWindow({ value, onChange, options, onScrollToBottom, classNa
9580
9581
  onScrollToBottom && onScrollToBottom();
9581
9582
  }
9582
9583
  };
9583
- return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { onScroll: handleScroll, className: className?.selectModalWindow, children: options.map((item, idx) => (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_SelectFieldOptionsItem__WEBPACK_IMPORTED_MODULE_3__["default"], { option: item, active: (0,_lib__WEBPACK_IMPORTED_MODULE_1__.isActiveOption)(value, item), onClick: () => handleClick(item), className: className }, idx)) }));
9584
+ return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { onScroll: handleScroll, className: className?.selectModalWindow, children: [options.map((item, idx) => (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_SelectFieldOptionsItem__WEBPACK_IMPORTED_MODULE_3__["default"], { option: item, active: (0,_lib__WEBPACK_IMPORTED_MODULE_1__.isActiveOption)(value, item), onClick: () => handleClick(item), className: className }, idx)), afterElement] }));
9584
9585
  }
9585
9586
 
9586
9587