@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.
- package/dist/cjs/components/DrawerCustom/hooks/useDrawerResize.js +3 -6
- package/dist/esm/components/DrawerCustom/hooks/useDrawerResize.js +3 -6
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/DrawerCustom/hooks/useDrawerResize.tsx +3 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/ds-drawer",
|
|
3
|
-
"version": "2.0.1-preview-
|
|
3
|
+
"version": "2.0.1-preview-45edd66f.0",
|
|
4
4
|
"description": "Пакет выезжающих панелей — компоненты Drawer и DrawerCustom с едиными токенами позиции и ширины.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"react-remove-scroll": "^2.7.2",
|
|
42
42
|
"tabbable": "^6.5.0",
|
|
43
|
-
"@cloud-ru/ds-bottom-sheet": "2.0.1-preview-
|
|
43
|
+
"@cloud-ru/ds-bottom-sheet": "2.0.1-preview-45edd66f.0",
|
|
44
44
|
"@cloud-ru/ds-adaptive": "1.0.2",
|
|
45
45
|
"@cloud-ru/ds-materials": "2.0.1",
|
|
46
|
+
"@cloud-ru/ds-popup-private": "1.1.10-preview-45edd66f.0",
|
|
46
47
|
"@cloud-ru/ds-portal-context": "1.0.2",
|
|
47
48
|
"@cloud-ru/ds-scroll": "1.0.5",
|
|
48
|
-
"@cloud-ru/ds-tooltip": "1.0.12-preview-
|
|
49
|
-
"@cloud-ru/ds-popup-private": "1.1.10-preview-e8fab9b7.0",
|
|
49
|
+
"@cloud-ru/ds-tooltip": "1.0.12-preview-45edd66f.0",
|
|
50
50
|
"@cloud-ru/ds-utils": "1.2.0"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -62,10 +62,6 @@ export function useDrawerResize({ position, resizable: resizableProp }: UseDrawe
|
|
|
62
62
|
const { onResize, onResizeEnd, max, min } = resizableProp ?? {};
|
|
63
63
|
const resizeEnabled = Boolean(resizableProp);
|
|
64
64
|
|
|
65
|
-
// Ширина окна могла измениться, пока дровер был закрыт: хранимое значение режем по текущей ширине на каждом
|
|
66
|
-
// рендере. Иначе rc-drawer начинает ресайз от «виртуальной» ширины, которая больше видимой панели.
|
|
67
|
-
const effectiveWidth = width !== undefined && max === RESIZABLE_MAX_FULL ? Math.min(width, getFullMaxWidth()) : width;
|
|
68
|
-
|
|
69
65
|
const resizable = useMemo(
|
|
70
66
|
() =>
|
|
71
67
|
resizeEnabled
|
|
@@ -92,15 +88,15 @@ export function useDrawerResize({ position, resizable: resizableProp }: UseDrawe
|
|
|
92
88
|
setOpen(false);
|
|
93
89
|
setMuted(false);
|
|
94
90
|
|
|
95
|
-
onResizeEnd?.(
|
|
91
|
+
onResizeEnd?.(width ?? 0);
|
|
96
92
|
},
|
|
97
93
|
onResizeStart: () => {
|
|
98
94
|
setMuted(true);
|
|
99
95
|
},
|
|
100
96
|
} satisfies DrawerProps['resizable'])
|
|
101
97
|
: undefined,
|
|
102
|
-
[
|
|
98
|
+
[width, max, min, onResize, onResizeEnd, resizeEnabled],
|
|
103
99
|
);
|
|
104
100
|
|
|
105
|
-
return { tooltip, checkElement, resizable, width
|
|
101
|
+
return { tooltip, checkElement, resizable, width };
|
|
106
102
|
}
|