From e373d38c846d8e5316e996cd3237e918549a8c43 Mon Sep 17 00:00:00 2001 From: hensonjunyuan Date: Fri, 3 Jan 2025 10:26:09 +0800 Subject: [PATCH 1/5] feat: added the popupProps and showOverlay properties --- src/action-sheet/action-sheet.md | 2 ++ src/action-sheet/props.ts | 12 +++++++++++- src/action-sheet/type.ts | 15 ++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/action-sheet/action-sheet.md b/src/action-sheet/action-sheet.md index 5886652e1..b2d2a31f5 100644 --- a/src/action-sheet/action-sheet.md +++ b/src/action-sheet/action-sheet.md @@ -10,7 +10,9 @@ cancelText | String | - | 设置取消按钮的文本 | N count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N description | String | - | 动作面板描述文字 | N items | Array | - | 必需。菜单项。TS 类型:`Array` `interface ActionSheetItem {label: string; color?: string; disabled?: boolean }`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | Y +popup-props | Object | {} | Typescript:`PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/hensonjunyuan/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N showCancel | Boolean | true | 是否显示取消按钮 | N +show-overlay | Boolean | true | \- | N theme | String | list | 展示类型,列表和表格形式展示。可选项:list/grid | N visible | Boolean | false | 必需。显示与隐藏。支持语法糖 `v-model` 或 `v-model:visible` | Y defaultVisible | Boolean | false | 必需。显示与隐藏。非受控属性 | Y diff --git a/src/action-sheet/props.ts b/src/action-sheet/props.ts index f9054fe49..321620224 100644 --- a/src/action-sheet/props.ts +++ b/src/action-sheet/props.ts @@ -4,8 +4,8 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ -import { TdActionSheetProps } from './type'; import { PropType } from 'vue'; +import { TdActionSheetProps } from './type'; export default { /** 水平对齐方式 */ @@ -38,11 +38,21 @@ export default { default: [], required: true, }, + /** popupProps透传 */ + popupProps: { + type: Object, + value: {}, + }, /** 是否显示取消按钮 */ showCancel: { type: Boolean, default: true, }, + /** 是否显示遮罩层 */ + showOverlay: { + type: Boolean, + value: true, + }, /** 展示类型,列表和表格形式展示 */ theme: { type: String as PropType, diff --git a/src/action-sheet/type.ts b/src/action-sheet/type.ts index 40600e119..76c30d903 100644 --- a/src/action-sheet/type.ts +++ b/src/action-sheet/type.ts @@ -3,8 +3,8 @@ /** * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ -import { TNode } from '../common'; import { TdBadgeProps } from '../badge/type'; +import { TNode } from '../common'; export interface TdActionSheetProps { /** * 水平对齐方式 @@ -30,11 +30,24 @@ export interface TdActionSheetProps { * 菜单项 */ items?: Array; + /** popupProps透传 */ + popupProps: { + type: Object; + value: {}; + }; /** * 是否显示取消按钮 * @default true */ showCancel?: boolean; + /** + * 是否显示遮罩层 + * @default true + */ + showOverlay?: { + type: BooleanConstructor; + value?: boolean; + }; /** * 展示类型,列表和表格形式展示 * @default list From 0f191e77ce9b12de92197432724dccc9597067f6 Mon Sep 17 00:00:00 2001 From: hensonjunyuan Date: Fri, 3 Jan 2025 11:04:16 +0800 Subject: [PATCH 2/5] feat: added the popupProps and showOverlay properties --- src/action-sheet/action-sheet.md | 4 ++-- src/action-sheet/action-sheet.tsx | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/action-sheet/action-sheet.md b/src/action-sheet/action-sheet.md index b2d2a31f5..c8137bded 100644 --- a/src/action-sheet/action-sheet.md +++ b/src/action-sheet/action-sheet.md @@ -10,9 +10,9 @@ cancelText | String | - | 设置取消按钮的文本 | N count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N description | String | - | 动作面板描述文字 | N items | Array | - | 必需。菜单项。TS 类型:`Array` `interface ActionSheetItem {label: string; color?: string; disabled?: boolean }`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | Y -popup-props | Object | {} | Typescript:`PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/hensonjunyuan/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/hensonjunyuan/tdesign-mobile-vue/tree/develop/src/action-sheet/type.ts) | N showCancel | Boolean | true | 是否显示取消按钮 | N -show-overlay | 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 diff --git a/src/action-sheet/action-sheet.tsx b/src/action-sheet/action-sheet.tsx index c243347fe..ce66a0aeb 100644 --- a/src/action-sheet/action-sheet.tsx +++ b/src/action-sheet/action-sheet.tsx @@ -1,13 +1,13 @@ -import { watch, defineComponent, computed } from 'vue'; -import { useDefault } from '../shared'; -import ActionSheetList from './action-sheet-list'; -import ActionSheetGrid from './action-sheet-grid'; -import TPopup from '../popup'; +import { computed, defineComponent, watch } from 'vue'; import TButton from '../button'; import config from '../config'; -import { TdActionSheetProps, ActionSheetItem } from './type'; +import { useConfig, usePrefixClass } from '../hooks/useClass'; +import TPopup from '../popup'; +import { useDefault } from '../shared'; +import ActionSheetGrid from './action-sheet-grid'; +import ActionSheetList from './action-sheet-list'; import props from './props'; -import { usePrefixClass, useConfig } from '../hooks/useClass'; +import { ActionSheetItem, TdActionSheetProps } from './type'; const { prefix } = config; @@ -120,11 +120,13 @@ export default defineComponent({ }; return ( {root()} From a92b20b240272fc11036936f9985cfe7468ac506 Mon Sep 17 00:00:00 2001 From: hensonjunyuan Date: Fri, 3 Jan 2025 11:54:02 +0800 Subject: [PATCH 3/5] feat: added the popupProps and showOverlay properties --- src/action-sheet/props.ts | 8 ++++---- src/action-sheet/type.ts | 13 ++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/action-sheet/props.ts b/src/action-sheet/props.ts index 321620224..0dabec03d 100644 --- a/src/action-sheet/props.ts +++ b/src/action-sheet/props.ts @@ -38,10 +38,10 @@ export default { default: [], required: true, }, - /** popupProps透传 */ + /** 弹出层的属性,透传至 popup */ popupProps: { - type: Object, - value: {}, + type: Object as PropType, + default: () => ({}), }, /** 是否显示取消按钮 */ showCancel: { @@ -51,7 +51,7 @@ export default { /** 是否显示遮罩层 */ showOverlay: { type: Boolean, - value: true, + default: true, }, /** 展示类型,列表和表格形式展示 */ theme: { diff --git a/src/action-sheet/type.ts b/src/action-sheet/type.ts index 76c30d903..954b9aad3 100644 --- a/src/action-sheet/type.ts +++ b/src/action-sheet/type.ts @@ -5,6 +5,7 @@ * */ import { TdBadgeProps } from '../badge/type'; import { TNode } from '../common'; +import { TdPopupProps } from '../popup/type'; export interface TdActionSheetProps { /** * 水平对齐方式 @@ -30,11 +31,8 @@ export interface TdActionSheetProps { * 菜单项 */ items?: Array; - /** popupProps透传 */ - popupProps: { - type: Object; - value: {}; - }; + /** 弹出层的属性,透传至 popup */ + popupProps: TdPopupProps; /** * 是否显示取消按钮 * @default true @@ -44,10 +42,7 @@ export interface TdActionSheetProps { * 是否显示遮罩层 * @default true */ - showOverlay?: { - type: BooleanConstructor; - value?: boolean; - }; + showOverlay?: boolean; /** * 展示类型,列表和表格形式展示 * @default list From dcca09b59ee3ce125c4cc80eb783992d4b99d48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 6 Jan 2025 15:27:14 +0800 Subject: [PATCH 4/5] docs: sync api --- src/action-sheet/action-sheet.en-US.md | 2 ++ src/action-sheet/action-sheet.md | 1 + src/action-sheet/action-sheet.tsx | 4 ++-- src/action-sheet/props.ts | 4 ++-- src/action-sheet/type.ts | 8 ++++++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/action-sheet/action-sheet.en-US.md b/src/action-sheet/action-sheet.en-US.md index 236a878ba..e3840e26c 100644 --- a/src/action-sheet/action-sheet.en-US.md +++ b/src/action-sheet/action-sheet.en-US.md @@ -11,7 +11,9 @@ cancelText | String | - | \- | N count | Number | 8 | \- | N description | String | - | \- | N items | Array | - | Typescript:`Array` `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 diff --git a/src/action-sheet/action-sheet.md b/src/action-sheet/action-sheet.md index 81e2f0f55..52e250a73 100644 --- a/src/action-sheet/action-sheet.md +++ b/src/action-sheet/action-sheet.md @@ -11,6 +11,7 @@ cancelText | String | - | 设置取消按钮的文本 | N count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N description | String | - | 动作面板描述文字 | N items | Array | - | 菜单项。TS 类型:`Array` `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 diff --git a/src/action-sheet/action-sheet.tsx b/src/action-sheet/action-sheet.tsx index 8ff5c0c21..8891c1832 100644 --- a/src/action-sheet/action-sheet.tsx +++ b/src/action-sheet/action-sheet.tsx @@ -2,9 +2,9 @@ import { computed, defineComponent, watch } from 'vue'; import TActionSheetGrid from './action-sheet-grid'; import TActionSheetList from './action-sheet-list'; import TButton from '../button'; +import TPopup from '../popup'; import config from '../config'; import { useConfig, usePrefixClass } from '../hooks/useClass'; -import TPopup from '../popup'; import { useDefault } from '../shared'; import props from './props'; import { ActionSheetItem, TdActionSheetProps } from './type'; @@ -114,7 +114,7 @@ export default defineComponent({ }; return ( , }, - /** 弹出层的属性,透传至 popup */ + /** popupProps透传 */ popupProps: { type: Object as PropType, default: () => ({}), diff --git a/src/action-sheet/type.ts b/src/action-sheet/type.ts index 0f2077fae..60ca00a26 100644 --- a/src/action-sheet/type.ts +++ b/src/action-sheet/type.ts @@ -5,6 +5,7 @@ * */ import { BadgeProps } from '../badge'; +import { PopupProps } from '../popup'; import { TNode } from '../common'; export interface TdActionSheetProps { @@ -32,8 +33,11 @@ export interface TdActionSheetProps { * 菜单项 */ items?: Array; - /** 弹出层的属性,透传至 popup */ - popupProps: TdPopupProps; + /** + * popupProps透传 + * @default {} + */ + popupProps?: PopupProps; /** * 是否显示取消按钮 * @default true From f6c9f3ce848af1020e00c2f8d66c8185ee392804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 6 Jan 2025 16:24:38 +0800 Subject: [PATCH 5/5] docs: sync api --- src/action-sheet/action-sheet.md | 2 +- src/action-sheet/props.ts | 2 +- src/action-sheet/type.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/action-sheet/action-sheet.md b/src/action-sheet/action-sheet.md index 52e250a73..d58e3ca3c 100644 --- a/src/action-sheet/action-sheet.md +++ b/src/action-sheet/action-sheet.md @@ -11,7 +11,7 @@ cancelText | String | - | 设置取消按钮的文本 | N count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N description | String | - | 动作面板描述文字 | N items | Array | - | 菜单项。TS 类型:`Array` `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 +popupProps | Object | {} | 透传 Popup 组件全部属性。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 diff --git a/src/action-sheet/props.ts b/src/action-sheet/props.ts index bb4b66ea5..e5c43c5b0 100644 --- a/src/action-sheet/props.ts +++ b/src/action-sheet/props.ts @@ -36,7 +36,7 @@ export default { items: { type: Array as PropType, }, - /** popupProps透传 */ + /** 透传 Popup 组件全部属性 */ popupProps: { type: Object as PropType, default: () => ({}), diff --git a/src/action-sheet/type.ts b/src/action-sheet/type.ts index 60ca00a26..822849002 100644 --- a/src/action-sheet/type.ts +++ b/src/action-sheet/type.ts @@ -34,7 +34,7 @@ export interface TdActionSheetProps { */ items?: Array; /** - * popupProps透传 + * 透传 Popup 组件全部属性 * @default {} */ popupProps?: PopupProps;