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

chore(Fab): update multiple event parameters #552

Merged
merged 1 commit into from
Feb 14, 2025
Merged
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 @@ -19,6 +19,6 @@ y-bounds | Array | - | Typescript:`Array<string \| number>` | N

name | params | description
-- | -- | --
click | `({e: Event})` | \-
drag-end | `(e: TouchEvent)` | \-
drag-start | `(e: TouchEvent)` | \-
click | `(detail: {e: Event})` | \-
drag-end | `(detail: { e: TouchEvent })` | \-
drag-start | `(detail: { e: TouchEvent })` | \-
8 changes: 4 additions & 4 deletions packages/products/tdesign-miniprogram/src/fab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ draggable | String / Boolean | false | 是否可拖拽。`true` / `'all'`可拖
icon | String | - | 图标 | N
text | String | - | 文本内容 | N
using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
y-bounds | Array | - | 设置垂直方向边界限制,示例:[48, 48] 或 ['96rpx', 80]。TS 类型:`Array<string \| number>` | N
y-bounds | Array | - | 设置垂直方向边界限制,示例:[48, 48] 或 ['96px', 80]。TS 类型:`Array<string \| number>` | N

### Fab Events

名称 | 参数 | 描述
-- | -- | --
click | `({e: Event})` | 悬浮按钮点击事件
drag-end | `(e: TouchEvent)` | 结束拖拽时触发
drag-start | `(e: TouchEvent)` | 开始拖拽时触发
click | `(detail: {e: Event})` | 悬浮按钮点击事件
drag-end | `(detail: { e: TouchEvent })` | 结束拖拽时触发
drag-start | `(detail: { e: TouchEvent })` | 开始拖拽时触发
2 changes: 1 addition & 1 deletion packages/products/tdesign-miniprogram/src/fab/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const props: TdFabProps = {
type: Boolean,
value: false,
},
/** 设置垂直方向边界限制,示例:[48, 48] 或 ['96rpx', 80] */
/** 设置垂直方向边界限制,示例:[48, 48] 或 ['96px', 80] */
yBounds: {
type: Array,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-miniprogram/src/fab/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface TdFabProps {
value?: boolean;
};
/**
* 设置垂直方向边界限制,示例:[48, 48] 或 ['96rpx', 80]
* 设置垂直方向边界限制,示例:[48, 48] 或 ['96px', 80]
*/
yBounds?: {
type: ArrayConstructor;
Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-mobile-react/src/fab/fab.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ buttonProps | Object | - | Typescript:`ButtonProps`,[Button API Documents](.
icon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
text | String | - | \- | N
onClick | Function | | Typescript:`(context: {e: MouseEvent}) => void`<br/> | N
onDragEnd | Function | | Typescript:`(e: TouchEvent) => void`<br/> | N
onDragStart | Function | | Typescript:`(e: TouchEvent) => void`<br/> | N
onDragEnd | Function | | Typescript:`(context: { e: TouchEvent }) => void`<br/> | N
onDragStart | Function | | Typescript:`(context: { e: TouchEvent }) => void`<br/> | N
4 changes: 2 additions & 2 deletions packages/products/tdesign-mobile-react/src/fab/fab.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ buttonProps | Object | - | 透传至 Button 组件。TS 类型:`ButtonProps`
icon | TElement | - | 图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
text | String | - | 文本内容 | N
onClick | Function | | TS 类型:`(context: {e: MouseEvent}) => void`<br/>悬浮按钮点击事件 | N
onDragEnd | Function | | TS 类型:`(e: TouchEvent) => void`<br/>结束拖拽时触发 | N
onDragStart | Function | | TS 类型:`(e: TouchEvent) => void`<br/>开始拖拽时触发 | N
onDragEnd | Function | | TS 类型:`(context: { e: TouchEvent }) => void`<br/>结束拖拽时触发 | N
onDragStart | Function | | TS 类型:`(context: { e: TouchEvent }) => void`<br/>开始拖拽时触发 | N
4 changes: 2 additions & 2 deletions packages/products/tdesign-mobile-react/src/fab/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export interface TdFabProps {
/**
* 结束拖拽时触发
*/
onDragEnd?: (e: TouchEvent<HTMLDivElement>) => void;
onDragEnd?: (context: { e: TouchEvent<HTMLDivElement> }) => void;
/**
* 开始拖拽时触发
*/
onDragStart?: (e: TouchEvent<HTMLDivElement>) => void;
onDragStart?: (context: { e: TouchEvent<HTMLDivElement> }) => void;
}
8 changes: 4 additions & 4 deletions packages/products/tdesign-mobile-vue/src/fab/fab.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ style | String | right: 16px; bottom: 32px; | \- | N
text | String | - | \- | N
yBounds | Array | - | Typescript:`Array<string \| number>` | N
onClick | Function | | Typescript:`(context: {e: MouseEvent}) => void`<br/> | N
onDragEnd | Function | | Typescript:`(e: TouchEvent) => void`<br/> | N
onDragStart | Function | | Typescript:`(e: TouchEvent) => void`<br/> | N
onDragEnd | Function | | Typescript:`(context: { e: TouchEvent }) => void`<br/> | N
onDragStart | Function | | Typescript:`(context: { e: TouchEvent }) => void`<br/> | N

### Fab Events

name | params | description
-- | -- | --
click | `(context: {e: MouseEvent})` | \-
drag-end | `(e: TouchEvent)` | \-
drag-start | `(e: TouchEvent)` | \-
drag-end | `(context: { e: TouchEvent })` | \-
drag-start | `(context: { e: TouchEvent })` | \-
8 changes: 4 additions & 4 deletions packages/products/tdesign-mobile-vue/src/fab/fab.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ style | String | right: 16px; bottom: 32px; | 悬浮按钮的样式,常用于
text | String | - | 文本内容 | N
yBounds | Array | - | 设置垂直方向边界限制,示例:[48, 48] 或 ['96px', 80]。TS 类型:`Array<string \| number>` | N
onClick | Function | | TS 类型:`(context: {e: MouseEvent}) => void`<br/>悬浮按钮点击事件 | N
onDragEnd | Function | | TS 类型:`(e: TouchEvent) => void`<br/>结束拖拽时触发 | N
onDragStart | Function | | TS 类型:`(e: TouchEvent) => void`<br/>开始拖拽时触发 | N
onDragEnd | Function | | TS 类型:`(context: { e: TouchEvent }) => void`<br/>结束拖拽时触发 | N
onDragStart | Function | | TS 类型:`(context: { e: TouchEvent }) => void`<br/>开始拖拽时触发 | N

### Fab Events

名称 | 参数 | 描述
-- | -- | --
click | `(context: {e: MouseEvent})` | 悬浮按钮点击事件
drag-end | `(e: TouchEvent)` | 结束拖拽时触发
drag-start | `(e: TouchEvent)` | 开始拖拽时触发
drag-end | `(context: { e: TouchEvent })` | 结束拖拽时触发
drag-start | `(context: { e: TouchEvent })` | 开始拖拽时触发
4 changes: 2 additions & 2 deletions packages/products/tdesign-mobile-vue/src/fab/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ export interface TdFabProps {
/**
* 结束拖拽时触发
*/
onDragEnd?: (e: TouchEvent) => void;
onDragEnd?: (context: { e: TouchEvent }) => void;
/**
* 开始拖拽时触发
*/
onDragStart?: (e: TouchEvent) => void;
onDragStart?: (context: { e: TouchEvent }) => void;
}

export type FabDirectionEnum = 'all' | 'vertical' | 'horizontal';
49 changes: 7 additions & 42 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -48176,47 +48176,11 @@
"Boolean"
]
},
{
"id": 1725534756,
"platform_framework": [
"64"
],
"component": "Fab",
"field_category": 1,
"field_name": "yBounds",
"field_type": [
"16"
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "设置垂直方向边界限制,示例:[48, 48] 或 ['96rpx', 80]",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2024-09-05 11:12:36",
"update_time": "2024-09-05 11:12:36",
"event_output": null,
"custom_field_type": "Array<string | number>",
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Miniprogram"
],
"field_type_text": [
"Array"
]
},
{
"id": 1739415473,
"platform_framework": [
"8"
"8",
"64"
],
"component": "Fab",
"field_category": 1,
Expand Down Expand Up @@ -48244,7 +48208,8 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)"
"Vue(Mobile)",
"Miniprogram"
],
"field_type_text": [
"Array"
Expand All @@ -48264,7 +48229,7 @@
"field_desc_zh": "悬浮按钮点击事件",
"field_desc_en": null,
"field_required": 0,
"event_input": "({e: Event})",
"event_input": "(context: {e: Event})",
"create_time": "2022-03-31 10:47:02",
"update_time": "2022-07-06 02:09:20",
"event_output": null,
Expand Down Expand Up @@ -48336,7 +48301,7 @@
"field_desc_zh": "结束拖拽时触发",
"field_desc_en": null,
"field_required": 0,
"event_input": "(e: TouchEvent)",
"event_input": "(context: { e: TouchEvent })",
"create_time": "2024-12-23 11:34:14",
"update_time": "2024-12-23 11:34:14",
"event_output": null,
Expand Down Expand Up @@ -48373,7 +48338,7 @@
"field_desc_zh": "开始拖拽时触发",
"field_desc_en": null,
"field_required": 0,
"event_input": "(e: TouchEvent)",
"event_input": "(context: { e: TouchEvent })",
"create_time": "2024-12-23 11:33:43",
"update_time": "2024-12-23 11:33:43",
"event_output": null,
Expand Down