@cloud-ru/uikit-product-fields-predefined 3.0.1-preview-926fd6b4.0 → 3.0.1-preview-2d74a3b2.0

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.
@@ -29,6 +29,11 @@ exports.FieldMask = (0, react_1.forwardRef)((_a, ref) => {
29
29
  defaultValue: valueProp,
30
30
  onAccept: onChange,
31
31
  });
32
+ (0, react_1.useEffect)(() => {
33
+ if (valueProp !== undefined && valueProp !== value) {
34
+ setValue(valueProp);
35
+ }
36
+ }, [valueProp, setValue, value]);
32
37
  return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_fields_1.AdaptiveFieldText
33
38
  // @ts-expect-error maskedRef type is not compatible with ref type
34
39
  , Object.assign({
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import mergeRefs from 'merge-refs';
14
- import { forwardRef } from 'react';
14
+ import { forwardRef, useEffect } from 'react';
15
15
  import { useIMask } from 'react-imask';
16
16
  import { AdaptiveFieldText } from '@cloud-ru/uikit-product-mobile-fields';
17
17
  import { BASE_MASK_OPTIONS, MASK_OPTIONS } from './constants';
@@ -23,6 +23,11 @@ export const FieldMask = forwardRef((_a, ref) => {
23
23
  defaultValue: valueProp,
24
24
  onAccept: onChange,
25
25
  });
26
+ useEffect(() => {
27
+ if (valueProp !== undefined && valueProp !== value) {
28
+ setValue(valueProp);
29
+ }
30
+ }, [valueProp, setValue, value]);
26
31
  return (_jsx(AdaptiveFieldText
27
32
  // @ts-expect-error maskedRef type is not compatible with ref type
28
33
  , Object.assign({