indicator-ui 0.0.110 → 0.0.112

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
@@ -8571,8 +8571,6 @@ __webpack_require__.r(__webpack_exports__);
8571
8571
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
8572
8572
  /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/lib */ "./src/lib/index.ts");
8573
8573
  /* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/ui */ "./src/ui/index.ts");
8574
- /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../consts */ "./src/ui/FormBuilder/consts/index.ts");
8575
-
8576
8574
 
8577
8575
 
8578
8576
 
@@ -8673,6 +8671,10 @@ const getOnChange = (schema, keyWay, additionProps) => {
8673
8671
  serializeValue ? additionProps.setValue(serializeValue(data), keyWay) : additionProps.setValue(data, keyWay);
8674
8672
  };
8675
8673
  };
8674
+ const getValueProcess = (schema, keyWay, additionProps) => {
8675
+ const deserializeValue = schema.props.deserializeValue;
8676
+ return deserializeValue ? deserializeValue(additionProps.getValue(keyWay)) : additionProps.getValue(keyWay);
8677
+ };
8676
8678
  const inputFieldComponent = (schema, key, additionProps) => {
8677
8679
  let onChange = undefined;
8678
8680
  let value = undefined;
@@ -8681,16 +8683,15 @@ const inputFieldComponent = (schema, key, additionProps) => {
8681
8683
  let onBlur = undefined;
8682
8684
  let keyWay = getKeyWay(schema, additionProps);
8683
8685
  if (keyWay) {
8684
- const deserializeValue = schema.props.deserializeValue;
8685
- value = deserializeValue ? deserializeValue(additionProps.getValue(keyWay)) : additionProps.getValue(keyWay);
8686
+ value = getValueProcess(schema, keyWay, additionProps);
8686
8687
  onChange = getOnChange(schema, keyWay, additionProps);
8687
8688
  isError = additionProps.isErrorField(keyWay);
8688
8689
  isErrorHintText = additionProps.getErrorMessage(keyWay);
8689
8690
  onBlur = getOnBlurValidation(schema, additionProps, keyWay);
8690
8691
  // Поиск инициализированных полей
8691
- const initFields = additionProps.getPrivateRefStoreValue(_consts__WEBPACK_IMPORTED_MODULE_4__.INIT_FIELDS_NAME) || [];
8692
+ const initFields = additionProps.getPrivateRefStoreValue(_ui__WEBPACK_IMPORTED_MODULE_3__.INIT_FIELDS_NAME) || [];
8692
8693
  if (!initFields.find(item => JSON.stringify(item) === JSON.stringify(keyWay))) {
8693
- additionProps.addPrivateRefStoreValue([...initFields, keyWay], _consts__WEBPACK_IMPORTED_MODULE_4__.INIT_FIELDS_NAME);
8694
+ additionProps.addPrivateRefStoreValue([...initFields, keyWay], _ui__WEBPACK_IMPORTED_MODULE_3__.INIT_FIELDS_NAME);
8694
8695
  onChange(value !== undefined ? value : schema.props.defaultValue);
8695
8696
  }
8696
8697
  }
@@ -10105,7 +10106,11 @@ function SelectField({ value, onChange, options = [], placeholder, isError, sear
10105
10106
  }
10106
10107
  };
10107
10108
  }, []);
10109
+ const fillOptionsCache = (data) => {
10110
+ optionsCacheRef.current = data.length > 0 ? optionsState.filter(item => data.includes(item.value)) : optionsState;
10111
+ };
10108
10112
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
10113
+ fillOptionsCache(value);
10109
10114
  if (!offInitLoadMoreOptions) {
10110
10115
  onScrollToBottom();
10111
10116
  }
@@ -10115,7 +10120,7 @@ function SelectField({ value, onChange, options = [], placeholder, isError, sear
10115
10120
  setOptionsState(options);
10116
10121
  }, [options]);
10117
10122
  const handleChange = (data) => {
10118
- optionsCacheRef.current = data.length > 0 ? optionsState.filter(item => data.includes(item.value)) : optionsState;
10123
+ fillOptionsCache(data);
10119
10124
  if (data.length === 0 && required) {
10120
10125
  let newValue;
10121
10126
  if (Array.isArray(value)) {