Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Popup): add duration #533

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const popupDefaultProps: TdPopupProps = {
attach: 'body',
closeOnOverlayClick: true,
destroyOnClose: false,
duration: 240,
overlayProps: {},
placement: 'top',
preventScrollThrough: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ children | TNode | - | Typescript:`string \| TNode`。[see more ts definition]
closeBtn | TNode | - | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
closeOnOverlayClick | Boolean | true | \- | N
destroyOnClose | Boolean | false | \- | N
duration | Number | 240 | \- | N
overlayProps | Object | {} | Typescript:`OverlayProps`,[Overlay API Documents](./overlay?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/popup/type.ts) | N
placement | String | top | options: top/left/right/bottom/center | N
preventScrollThrough | Boolean | true | \- | N
Expand Down
3 changes: 2 additions & 1 deletion packages/products/tdesign-mobile-react/src/popup/popup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
attach | String / Function | 'body' | 制定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
attach | String / Function | 'body' | 指定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
children | TNode | - | 触发元素,同 triggerElement。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
closeBtn | TNode | - | 是否展示关闭按钮,值为 `true` 显示默认关闭按钮;值为 `false` 则不显示关闭按钮;也可以自定义关闭按钮。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
closeOnOverlayClick | Boolean | true | 点击遮罩层是否关闭 | N
destroyOnClose | Boolean | false | 是否在关闭浮层时销毁浮层 | N
duration | Number | 240 | 动画过渡时间 | N
overlayProps | Object | {} | 遮罩层的属性,透传至 overlay。TS 类型:`OverlayProps`,[Overlay API Documents](./overlay?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/popup/type.ts) | N
placement | String | top | 浮层出现位置。可选项:top/left/right/bottom/center | N
preventScrollThrough | Boolean | true | 是否阻止背景滚动 | N
Expand Down
7 changes: 6 additions & 1 deletion packages/products/tdesign-mobile-react/src/popup/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { MouseEvent } from 'react';

export interface TdPopupProps {
/**
* 制定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body
* 指定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body
* @default 'body'
*/
attach?: AttachNode;
Expand All @@ -32,6 +32,11 @@ export interface TdPopupProps {
* @default false
*/
destroyOnClose?: boolean;
/**
* 动画过渡时间
* @default 240
*/
duration?: number;
/**
* 遮罩层的属性,透传至 overlay
* @default {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ attach | String / Function | 'body' | Typescript:`AttachNode`。[see more ts d
closeBtn | Boolean / Slot / Function | - | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
closeOnOverlayClick | Boolean | true | \- | N
destroyOnClose | Boolean | false | \- | N
duration | Number | 240 | \- | N
overlayProps | Object | {} | Typescript:`OverlayProps`,[Overlay API Documents](./overlay?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/popup/type.ts) | N
placement | String | top | options: top/left/right/bottom/center | N
preventScrollThrough | Boolean | true | \- | N
Expand Down
3 changes: 2 additions & 1 deletion packages/products/tdesign-mobile-vue/src/popup/popup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
attach | String / Function | 'body' | 制定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
attach | String / Function | 'body' | 指定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
closeBtn | Boolean / Slot / Function | - | 是否展示关闭按钮,值为 `true` 显示默认关闭按钮;值为 `false` 则不显示关闭按钮;也可以自定义关闭按钮。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
closeOnOverlayClick | Boolean | true | 点击遮罩层是否关闭 | N
destroyOnClose | Boolean | false | 是否在关闭浮层时销毁浮层 | N
duration | Number | 240 | 动画过渡时间 | N
overlayProps | Object | {} | 遮罩层的属性,透传至 overlay。TS 类型:`OverlayProps`,[Overlay API Documents](./overlay?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/popup/type.ts) | N
placement | String | top | 浮层出现位置。可选项:top/left/right/bottom/center | N
preventScrollThrough | Boolean | true | 是否阻止背景滚动 | N
Expand Down
7 changes: 6 additions & 1 deletion packages/products/tdesign-mobile-vue/src/popup/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TdPopupProps } from './type';
import { PropType } from 'vue';

export default {
/** 制定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body */
/** 指定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body */
attach: {
type: [String, Function] as PropType<TdPopupProps['attach']>,
default: 'body',
Expand All @@ -24,6 +24,11 @@ export default {
},
/** 是否在关闭浮层时销毁浮层 */
destroyOnClose: Boolean,
/** 动画过渡时间 */
duration: {
type: Number,
default: 240,
},
/** 遮罩层的属性,透传至 overlay */
overlayProps: {
type: Object as PropType<TdPopupProps['overlayProps']>,
Expand Down
7 changes: 6 additions & 1 deletion packages/products/tdesign-mobile-vue/src/popup/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TNode, AttachNode } from '../common';

export interface TdPopupProps {
/**
* 制定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body
* 指定挂载节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body
* @default 'body'
*/
attach?: AttachNode;
Expand All @@ -27,6 +27,11 @@ export interface TdPopupProps {
* @default false
*/
destroyOnClose?: boolean;
/**
* 动画过渡时间
* @default 240
*/
duration?: number;
/**
* 遮罩层的属性,透传至 overlay
* @default {}
Expand Down
6 changes: 6 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -82386,6 +82386,9 @@
{
"id": 3416,
"platform_framework": [
"8",
"16",
"32",
"64"
],
"component": "Popup",
Expand Down Expand Up @@ -82414,6 +82417,9 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
"field_type_text": [
Expand Down