Skip to content

Commit e92bd4c

Browse files
authored
feat(Drawer): add overlayProps attr (#809)
1 parent d026c3e commit e92bd4c

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

src/drawer/Drawer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const Drawer: React.FC<DrawerProps> = forwardRef((originProps, ref) => {
2626
title,
2727
footer,
2828
showOverlay,
29+
overlayProps,
2930
zIndex,
3031
isPlugin,
3132
closeOnOverlayClick,
@@ -97,6 +98,7 @@ const Drawer: React.FC<DrawerProps> = forwardRef((originProps, ref) => {
9798
placement={placement}
9899
destroyOnClose={destroyOnClose}
99100
showOverlay={showOverlay}
101+
overlayProps={overlayProps}
100102
zIndex={zIndex}
101103
onVisibleChange={handleOverlayClick}
102104
>

src/drawer/defaultProps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { TdDrawerProps } from './type';
77
export const drawerDefaultProps: TdDrawerProps = {
88
closeOnOverlayClick: true,
99
destroyOnClose: false,
10+
overlayProps: {},
1011
placement: 'right',
1112
showOverlay: true,
1213
visible: false,

src/drawer/drawer.en-US.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ closeOnOverlayClick | Boolean | true | \- | N
1313
destroyOnClose | Boolean | false | \- | N
1414
footer | TElement | - | Typescript:`TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
1515
items | Array | - | Typescript:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts) | N
16+
overlayProps | Object | {} | Typescript:`OverlayProps`[Overlay API Documents](./overlay?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts) | N
1617
placement | String | right | options: left/right | N
1718
showOverlay | Boolean | true | \- | N
1819
title | TNode | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
@@ -62,4 +63,4 @@ Name | Default Value | Description
6263
--td-drawer-title-color | @text-color-primary | -
6364
--td-drawer-title-font-size | 18px | -
6465
--td-drawer-title-padding | 24px 16px 8px | -
65-
--td-drawer-width | 280px | -
66+
--td-drawer-width | 280px | -

src/drawer/drawer.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ closeOnOverlayClick | Boolean | true | 点击蒙层时是否触发抽屉关闭
1313
destroyOnClose | Boolean | false | 抽屉关闭时是否销毁节点 | N
1414
footer | TElement | - | 抽屉的底部。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
1515
items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[] ` `interface DrawerItem { title: string; icon?: TNode; }`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts) | N
16+
overlayProps | Object | {} | 遮罩层的属性,透传至 overlay。TS 类型:`OverlayProps`[Overlay API Documents](./overlay?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/drawer/type.ts) | N
1617
placement | String | right | 抽屉方向。可选项:left/right | N
1718
showOverlay | Boolean | true | 是否显示遮罩层 | N
1819
title | TNode | - | 抽屉的标题。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
@@ -62,4 +63,4 @@ options | \- | - | TS 类型:`DrawerOptions`
6263
--td-drawer-title-color | @text-color-primary | -
6364
--td-drawer-title-font-size | 18px | -
6465
--td-drawer-title-padding | 24px 16px 8px | -
65-
--td-drawer-width | 280px | -
66+
--td-drawer-width | 280px | -

src/drawer/type.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55
* */
66

7+
import { OverlayProps } from '../overlay';
78
import { TNode, TElement, Styles, AttachNode } from '../common';
89
import { MouseEvent } from 'react';
910

@@ -30,6 +31,11 @@ export interface TdDrawerProps {
3031
* 抽屉里的列表项
3132
*/
3233
items?: DrawerItem[];
34+
/**
35+
* 遮罩层的属性,透传至 overlay
36+
* @default {}
37+
*/
38+
overlayProps?: OverlayProps;
3339
/**
3440
* 抽屉方向
3541
* @default right

0 commit comments

Comments
 (0)