@rc-component/drawer 1.0.0 → 1.1.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/es/Drawer.d.ts +1 -1
- package/es/Drawer.js +2 -2
- package/es/DrawerPanel.d.ts +1 -4
- package/es/DrawerPopup.js +2 -2
- package/lib/Drawer.d.ts +1 -1
- package/lib/Drawer.js +2 -2
- package/lib/DrawerPanel.d.ts +1 -4
- package/lib/DrawerPopup.js +2 -2
- package/package.json +3 -2
package/es/Drawer.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface DrawerProps extends Omit<DrawerPopupProps, 'prefixCls' | 'inlin
|
|
|
8
8
|
prefixCls?: string;
|
|
9
9
|
open?: boolean;
|
|
10
10
|
onClose?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
11
|
-
|
|
11
|
+
destroyOnHidden?: boolean;
|
|
12
12
|
getContainer?: PortalProps['getContainer'];
|
|
13
13
|
panelRef?: React.Ref<HTMLDivElement>;
|
|
14
14
|
classNames?: DrawerClassNames;
|
package/es/Drawer.js
CHANGED
|
@@ -17,7 +17,7 @@ const Drawer = props => {
|
|
|
17
17
|
getContainer,
|
|
18
18
|
forceRender,
|
|
19
19
|
afterOpenChange,
|
|
20
|
-
|
|
20
|
+
destroyOnHidden,
|
|
21
21
|
onMouseEnter,
|
|
22
22
|
onMouseOver,
|
|
23
23
|
onMouseLeave,
|
|
@@ -67,7 +67,7 @@ const Drawer = props => {
|
|
|
67
67
|
}), [panelRef]);
|
|
68
68
|
|
|
69
69
|
// ============================ Render ============================
|
|
70
|
-
if (!forceRender && !animatedVisible && !mergedOpen &&
|
|
70
|
+
if (!forceRender && !animatedVisible && !mergedOpen && destroyOnHidden) {
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
73
73
|
const eventHandlers = {
|
package/es/DrawerPanel.d.ts
CHANGED
|
@@ -19,8 +19,5 @@ export interface DrawerPanelProps extends DrawerPanelEvents, DrawerPanelAccessib
|
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
containerRef?: React.Ref<HTMLDivElement>;
|
|
21
21
|
}
|
|
22
|
-
declare const DrawerPanel:
|
|
23
|
-
(props: DrawerPanelProps): React.JSX.Element;
|
|
24
|
-
displayName: string;
|
|
25
|
-
};
|
|
22
|
+
declare const DrawerPanel: React.FC<Readonly<DrawerPanelProps>>;
|
|
26
23
|
export default DrawerPanel;
|
package/es/DrawerPopup.js
CHANGED
|
@@ -14,7 +14,7 @@ const sentinelStyle = {
|
|
|
14
14
|
outline: 'none',
|
|
15
15
|
position: 'absolute'
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
const DrawerPopup = (props, ref) => {
|
|
18
18
|
const {
|
|
19
19
|
prefixCls,
|
|
20
20
|
open,
|
|
@@ -266,7 +266,7 @@ function DrawerPopup(props, ref) {
|
|
|
266
266
|
"aria-hidden": "true",
|
|
267
267
|
"data-sentinel": "end"
|
|
268
268
|
})));
|
|
269
|
-
}
|
|
269
|
+
};
|
|
270
270
|
const RefDrawerPopup = /*#__PURE__*/React.forwardRef(DrawerPopup);
|
|
271
271
|
if (process.env.NODE_ENV !== 'production') {
|
|
272
272
|
RefDrawerPopup.displayName = 'DrawerPopup';
|
package/lib/Drawer.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface DrawerProps extends Omit<DrawerPopupProps, 'prefixCls' | 'inlin
|
|
|
8
8
|
prefixCls?: string;
|
|
9
9
|
open?: boolean;
|
|
10
10
|
onClose?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
11
|
-
|
|
11
|
+
destroyOnHidden?: boolean;
|
|
12
12
|
getContainer?: PortalProps['getContainer'];
|
|
13
13
|
panelRef?: React.Ref<HTMLDivElement>;
|
|
14
14
|
classNames?: DrawerClassNames;
|
package/lib/Drawer.js
CHANGED
|
@@ -26,7 +26,7 @@ const Drawer = props => {
|
|
|
26
26
|
getContainer,
|
|
27
27
|
forceRender,
|
|
28
28
|
afterOpenChange,
|
|
29
|
-
|
|
29
|
+
destroyOnHidden,
|
|
30
30
|
onMouseEnter,
|
|
31
31
|
onMouseOver,
|
|
32
32
|
onMouseLeave,
|
|
@@ -76,7 +76,7 @@ const Drawer = props => {
|
|
|
76
76
|
}), [panelRef]);
|
|
77
77
|
|
|
78
78
|
// ============================ Render ============================
|
|
79
|
-
if (!forceRender && !animatedVisible && !mergedOpen &&
|
|
79
|
+
if (!forceRender && !animatedVisible && !mergedOpen && destroyOnHidden) {
|
|
80
80
|
return null;
|
|
81
81
|
}
|
|
82
82
|
const eventHandlers = {
|
package/lib/DrawerPanel.d.ts
CHANGED
|
@@ -19,8 +19,5 @@ export interface DrawerPanelProps extends DrawerPanelEvents, DrawerPanelAccessib
|
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
containerRef?: React.Ref<HTMLDivElement>;
|
|
21
21
|
}
|
|
22
|
-
declare const DrawerPanel:
|
|
23
|
-
(props: DrawerPanelProps): React.JSX.Element;
|
|
24
|
-
displayName: string;
|
|
25
|
-
};
|
|
22
|
+
declare const DrawerPanel: React.FC<Readonly<DrawerPanelProps>>;
|
|
26
23
|
export default DrawerPanel;
|
package/lib/DrawerPopup.js
CHANGED
|
@@ -23,7 +23,7 @@ const sentinelStyle = {
|
|
|
23
23
|
outline: 'none',
|
|
24
24
|
position: 'absolute'
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const DrawerPopup = (props, ref) => {
|
|
27
27
|
const {
|
|
28
28
|
prefixCls,
|
|
29
29
|
open,
|
|
@@ -275,7 +275,7 @@ function DrawerPopup(props, ref) {
|
|
|
275
275
|
"aria-hidden": "true",
|
|
276
276
|
"data-sentinel": "end"
|
|
277
277
|
})));
|
|
278
|
-
}
|
|
278
|
+
};
|
|
279
279
|
const RefDrawerPopup = /*#__PURE__*/React.forwardRef(DrawerPopup);
|
|
280
280
|
if (process.env.NODE_ENV !== 'production') {
|
|
281
281
|
RefDrawerPopup.displayName = 'DrawerPopup';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rc-component/drawer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "drawer component for react",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -53,9 +53,10 @@
|
|
|
53
53
|
"@rc-component/father-plugin": "^2.0.2",
|
|
54
54
|
"@rc-component/np": "^1.0.0",
|
|
55
55
|
"@testing-library/jest-dom": "^6.2.0",
|
|
56
|
-
"@testing-library/react": "^
|
|
56
|
+
"@testing-library/react": "^15.0.7",
|
|
57
57
|
"@types/classnames": "^2.2.9",
|
|
58
58
|
"@types/jest": "^29.5.11",
|
|
59
|
+
"@types/node": "^22.15.18",
|
|
59
60
|
"@types/raf": "^3.4.0",
|
|
60
61
|
"@types/react": "^19.0.0",
|
|
61
62
|
"@types/react-dom": "^19.0.0",
|