-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(popover): mobile-react增加popover组件文档 (#426)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3ec0282
commit ebbbce7
Showing
6 changed files
with
189 additions
and
16 deletions.
There are no files selected for viewing
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
packages/products/tdesign-mobile-react/src/popover/defaultProps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TdPopoverProps } from './type'; | ||
|
||
export const popoverDefaultProps: TdPopoverProps = { | ||
closeOnClickOutside: true, | ||
placement: 'top', | ||
showArrow: true, | ||
theme: 'dark', | ||
}; |
20 changes: 20 additions & 0 deletions
20
packages/products/tdesign-mobile-react/src/popover/popover.en-US.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
|
||
### Popover Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
className | String | - | className of component | N | ||
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N | ||
children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
closeOnClickOutside | Boolean | true | \- | N | ||
content | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
placement | String | top | options: top/left/right/bottom/top-left/top-right/bottom-left/bottom-right/left-top/left-bottom/right-top/right-bottom | N | ||
showArrow | Boolean | true | \- | N | ||
theme | String | dark | options: dark/light/brand/success/warning/error | N | ||
triggerElement | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
visible | Boolean | - | \- | N | ||
onVisibleChange | Function | | Typescript:`(visible: boolean) => void`<br/> | N |
20 changes: 20 additions & 0 deletions
20
packages/products/tdesign-mobile-react/src/popover/popover.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
|
||
### Popover Props | ||
|
||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
className | String | - | 类名 | N | ||
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N | ||
children | TNode | - | 触发元素,同 triggerElement。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
closeOnClickOutside | Boolean | true | 是否在点击外部元素后关闭菜单 | N | ||
content | TNode | - | 确认框内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
placement | String | top | 浮层出现位置。可选项:top/left/right/bottom/top-left/top-right/bottom-left/bottom-right/left-top/left-bottom/right-top/right-bottom | N | ||
showArrow | Boolean | true | 是否显示浮层箭头 | N | ||
theme | String | dark | 弹出气泡主题。。可选项:dark/light/brand/success/warning/error | N | ||
triggerElement | TNode | - | 触发元素。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
visible | Boolean | - | 是否显示气泡确认框 | N | ||
onVisibleChange | Function | | TS 类型:`(visible: boolean) => void`<br/>确认框显示或隐藏时触发 | N |
66 changes: 66 additions & 0 deletions
66
packages/products/tdesign-mobile-react/src/popover/type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TNode } from '../common'; | ||
|
||
export interface TdPopoverProps { | ||
/** | ||
* 触发元素,同 triggerElement | ||
*/ | ||
children?: TNode; | ||
/** | ||
* 是否在点击外部元素后关闭菜单 | ||
* @default true | ||
*/ | ||
closeOnClickOutside?: boolean; | ||
/** | ||
* 确认框内容 | ||
*/ | ||
content?: TNode; | ||
/** | ||
* 浮层出现位置 | ||
* @default top | ||
*/ | ||
placement?: | ||
| 'top' | ||
| 'left' | ||
| 'right' | ||
| 'bottom' | ||
| 'top-left' | ||
| 'top-right' | ||
| 'bottom-left' | ||
| 'bottom-right' | ||
| 'left-top' | ||
| 'left-bottom' | ||
| 'right-top' | ||
| 'right-bottom'; | ||
/** | ||
* 是否显示浮层箭头 | ||
* @default true | ||
*/ | ||
showArrow?: boolean; | ||
/** | ||
* 弹出气泡主题。 | ||
* @default dark | ||
*/ | ||
theme?: 'dark' | 'light' | 'brand' | 'success' | 'warning' | 'error'; | ||
/** | ||
* 触发元素 | ||
*/ | ||
triggerElement?: TNode; | ||
/** | ||
* 是否显示气泡确认框 | ||
*/ | ||
visible?: boolean; | ||
/** | ||
* 是否显示气泡确认框,非受控属性 | ||
*/ | ||
defaultVisible?: boolean; | ||
/** | ||
* 确认框显示或隐藏时触发 | ||
*/ | ||
onVisibleChange?: (visible: boolean) => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters