Skip to content

Commit

Permalink
feat(action-sheet): h5 add showOverlay & popupProps API (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 authored Jan 6, 2025
1 parent 159eb37 commit ffe6803
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 0 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ cancelText | String | - | \- | N
count | Number | 8 | \- | N
description | String | - | \- | N
items | Array | - | Typescript:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[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/action-sheet/type.ts) | N
popupProps | Object | {} | Typescript:`PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
showCancel | Boolean | true | \- | N
showOverlay | Boolean | true | \- | N
theme | String | list | options: list/grid | N
visible | Boolean | false | required | Y
defaultVisible | Boolean | false | required。uncontrolled property | Y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ cancelText | String | - | 设置取消按钮的文本 | N
count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N
description | String | - | 动作面板描述文字 | N
items | Array | - | 菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
popupProps | Object | {} | popupProps透传。TS 类型:`PopupProps`[Popup API Documents](./popup?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/action-sheet/type.ts) | N
showCancel | Boolean | true | 是否显示取消按钮 | N
showOverlay | Boolean | true | 是否显示遮罩层 | N
theme | String | list | 展示类型,列表和表格形式展示。可选项:list/grid | N
visible | Boolean | false | 必需。显示与隐藏 | Y
defaultVisible | Boolean | false | 必需。显示与隐藏。非受控属性 | Y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { TdActionSheetProps } from './type';
export const actionSheetDefaultProps: TdActionSheetProps = {
align: 'center',
count: 8,
popupProps: {},
showCancel: true,
showOverlay: true,
theme: 'list',
defaultVisible: false,
};
11 changes: 11 additions & 0 deletions packages/products/tdesign-mobile-react/src/action-sheet/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* */

import { BadgeProps } from '../badge';
import { PopupProps } from '../popup';
import { TNode } from '../common';
import { MouseEvent } from 'react';

Expand Down Expand Up @@ -33,11 +34,21 @@ export interface TdActionSheetProps {
* 菜单项
*/
items?: Array<string | ActionSheetItem>;
/**
* popupProps透传
* @default {}
*/
popupProps?: PopupProps;
/**
* 是否显示取消按钮
* @default true
*/
showCancel?: boolean;
/**
* 是否显示遮罩层
* @default true
*/
showOverlay?: boolean;
/**
* 展示类型,列表和表格形式展示
* @default list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ cancelText | String | - | \- | N
count | Number | 8 | \- | N
description | String | - | \- | N
items | Array | - | Typescript:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
popupProps | Object | {} | Typescript:`PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
showCancel | Boolean | true | \- | N
showOverlay | Boolean | true | \- | N
theme | String | list | options: list/grid | N
visible | Boolean | false | required。`v-model` and `v-model:visible` is supported | Y
defaultVisible | Boolean | false | required。uncontrolled property | Y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ cancelText | String | - | 设置取消按钮的文本 | N
count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N
description | String | - | 动作面板描述文字 | N
items | Array | - | 菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; color?: string; disabled?: boolean; icon?: TNode; badge?: BadgeProps }`[Badge API Documents](./badge?tab=api)[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
popupProps | Object | {} | popupProps透传。TS 类型:`PopupProps`[Popup API Documents](./popup?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N
showCancel | Boolean | true | 是否显示取消按钮 | N
showOverlay | Boolean | true | 是否显示遮罩层 | N
theme | String | list | 展示类型,列表和表格形式展示。可选项:list/grid | N
visible | Boolean | false | 必需。显示与隐藏。支持语法糖 `v-model``v-model:visible` | Y
defaultVisible | Boolean | false | 必需。显示与隐藏。非受控属性 | Y
Expand Down
10 changes: 10 additions & 0 deletions packages/products/tdesign-mobile-vue/src/action-sheet/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,21 @@ export default {
items: {
type: Array as PropType<TdActionSheetProps['items']>,
},
/** popupProps透传 */
popupProps: {
type: Object as PropType<TdActionSheetProps['popupProps']>,
default: () => ({}),
},
/** 是否显示取消按钮 */
showCancel: {
type: Boolean,
default: true,
},
/** 是否显示遮罩层 */
showOverlay: {
type: Boolean,
default: true,
},
/** 展示类型,列表和表格形式展示 */
theme: {
type: String as PropType<TdActionSheetProps['theme']>,
Expand Down
11 changes: 11 additions & 0 deletions packages/products/tdesign-mobile-vue/src/action-sheet/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* */

import { BadgeProps } from '../badge';
import { PopupProps } from '../popup';
import { TNode } from '../common';

export interface TdActionSheetProps {
Expand Down Expand Up @@ -32,11 +33,21 @@ export interface TdActionSheetProps {
* 菜单项
*/
items?: Array<string | ActionSheetItem>;
/**
* popupProps透传
* @default {}
*/
popupProps?: PopupProps;
/**
* 是否显示取消按钮
* @default true
*/
showCancel?: boolean;
/**
* 是否显示遮罩层
* @default true
*/
showOverlay?: boolean;
/**
* 展示类型,列表和表格形式展示
* @default list
Expand Down
12 changes: 12 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2277,6 +2277,9 @@
{
"id": 1712054580,
"platform_framework": [
"8",
"16",
"32",
"64"
],
"component": "ActionSheet",
Expand Down Expand Up @@ -2305,6 +2308,9 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
"field_type_text": [
Expand Down Expand Up @@ -2357,6 +2363,9 @@
{
"id": 1712054606,
"platform_framework": [
"8",
"16",
"32",
"64"
],
"component": "ActionSheet",
Expand Down Expand Up @@ -2385,6 +2394,9 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
"field_type_text": [
Expand Down

0 comments on commit ffe6803

Please sign in to comment.