indicator-ui 0.0.37 → 0.0.38

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, offInitLoadMoreOptions = false, autoClose = true, onBlur, selectModalWindowAfterElement, loadMoreOptions, className = _styles__WEBPACK_IMPORTED_MODULE_4__.SelectFieldStyle, }) {
9425
+ function SelectField({ value, onChange, options = [], placeholder, isError, searching, required = false, multiple = false, disabled = false, offOptionsSyncing = true, offInitLoadMoreOptions = false, 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);
@@ -9480,8 +9480,11 @@ function SelectField({ value, onChange, options = [], placeholder, isError, isSe
9480
9480
  }
9481
9481
  };
9482
9482
  const getViewField = () => {
9483
- if (isSearching) {
9484
- return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FlexField__WEBPACK_IMPORTED_MODULE_2__.FlexField, { value: isFocus ? searchingString : (0,_lib__WEBPACK_IMPORTED_MODULE_3__.getStringValue)(value, optionsState), onChange: setSearchingString, disabled: disabled, onFocus: () => {
9483
+ if (searching !== undefined) {
9484
+ return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FlexField__WEBPACK_IMPORTED_MODULE_2__.FlexField, { value: isFocus ? searchingString : (0,_lib__WEBPACK_IMPORTED_MODULE_3__.getStringValue)(value, optionsState), onChange: (searchString) => {
9485
+ setSearchingString(searchString);
9486
+ searching(searchString, optionsState).then((newOptions) => newOptions !== undefined && setOptionsState(newOptions));
9487
+ }, disabled: disabled, onFocus: () => {
9485
9488
  setIsFocus(true);
9486
9489
  setIsShowModalWindow(true);
9487
9490
  }, onBlur: () => {
@@ -9494,7 +9497,7 @@ function SelectField({ value, onChange, options = [], placeholder, isError, isSe
9494
9497
  };
9495
9498
  const onScrollToBottom = async () => {
9496
9499
  if (loadMoreOptions) {
9497
- const newOptions = await loadMoreOptions(optionsState?.length || 0);
9500
+ const newOptions = await loadMoreOptions(optionsState?.length || 0, searchingString);
9498
9501
  if (newOptions !== undefined)
9499
9502
  setOptionsState(prevState => [...prevState, ...newOptions]);
9500
9503
  }