@cloud-ru/ds-drawer 2.0.1-preview-e8fab9b7.0 → 2.0.1-preview-45edd66f.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.
@@ -34,9 +34,6 @@ function useDrawerResize({ position, resizable: resizableProp }) {
34
34
  } })) : null;
35
35
  const { onResize, onResizeEnd, max, min } = resizableProp ?? {};
36
36
  const resizeEnabled = Boolean(resizableProp);
37
- // Ширина окна могла измениться, пока дровер был закрыт: хранимое значение режем по текущей ширине на каждом
38
- // рендере. Иначе rc-drawer начинает ресайз от «виртуальной» ширины, которая больше видимой панели.
39
- const effectiveWidth = width !== undefined && max === constants_1.RESIZABLE_MAX_FULL ? Math.min(width, getFullMaxWidth()) : width;
40
37
  const resizable = (0, react_1.useMemo)(() => resizeEnabled
41
38
  ? {
42
39
  onResize: value => {
@@ -56,12 +53,12 @@ function useDrawerResize({ position, resizable: resizableProp }) {
56
53
  onResizeEnd: () => {
57
54
  setOpen(false);
58
55
  setMuted(false);
59
- onResizeEnd?.(effectiveWidth ?? 0);
56
+ onResizeEnd?.(width ?? 0);
60
57
  },
61
58
  onResizeStart: () => {
62
59
  setMuted(true);
63
60
  },
64
61
  }
65
- : undefined, [effectiveWidth, max, min, onResize, onResizeEnd, resizeEnabled]);
66
- return { tooltip, checkElement, resizable, width: effectiveWidth };
62
+ : undefined, [width, max, min, onResize, onResizeEnd, resizeEnabled]);
63
+ return { tooltip, checkElement, resizable, width };
67
64
  }
@@ -28,9 +28,6 @@ export function useDrawerResize({ position, resizable: resizableProp }) {
28
28
  } })) : null;
29
29
  const { onResize, onResizeEnd, max, min } = resizableProp ?? {};
30
30
  const resizeEnabled = Boolean(resizableProp);
31
- // Ширина окна могла измениться, пока дровер был закрыт: хранимое значение режем по текущей ширине на каждом
32
- // рендере. Иначе rc-drawer начинает ресайз от «виртуальной» ширины, которая больше видимой панели.
33
- const effectiveWidth = width !== undefined && max === RESIZABLE_MAX_FULL ? Math.min(width, getFullMaxWidth()) : width;
34
31
  const resizable = useMemo(() => resizeEnabled
35
32
  ? {
36
33
  onResize: value => {
@@ -50,12 +47,12 @@ export function useDrawerResize({ position, resizable: resizableProp }) {
50
47
  onResizeEnd: () => {
51
48
  setOpen(false);
52
49
  setMuted(false);
53
- onResizeEnd?.(effectiveWidth ?? 0);
50
+ onResizeEnd?.(width ?? 0);
54
51
  },
55
52
  onResizeStart: () => {
56
53
  setMuted(true);
57
54
  },
58
55
  }
59
- : undefined, [effectiveWidth, max, min, onResize, onResizeEnd, resizeEnabled]);
60
- return { tooltip, checkElement, resizable, width: effectiveWidth };
56
+ : undefined, [width, max, min, onResize, onResizeEnd, resizeEnabled]);
57
+ return { tooltip, checkElement, resizable, width };
61
58
  }