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(Fab): add y-bounds props #408

Merged
merged 3 commits into from
Sep 10, 2024
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 @@ -9,10 +9,11 @@ name | type | default | description | required
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
button-props | Object | - | Typescript:`ButtonProps`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/fab/type.ts) | N
draggable | String / Boolean | false | \- | N
draggable | String / Boolean | false | Typescript:`boolean \| FabDirectionEnum ` `type FabDirectionEnum = 'all' \| 'vertical' \| 'horizontal'`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/fab/type.ts) | N
icon | String | - | \- | N
text | String | - | \- | N
using-custom-navbar | Boolean | false | \- | N
y-bounds | Array | - | Typescript:`Array<string \| number>` | N

### Fab Events

Expand Down
3 changes: 2 additions & 1 deletion packages/products/tdesign-miniprogram/src/fab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
button-props | Object | - | 透传至 Button 组件。TS 类型:`ButtonProps`,[Button API Documents](./button?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/fab/type.ts) | N
draggable | String / Boolean | false | `true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动 | N
draggable | String / Boolean | false | 是否可拖拽。`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动。TS 类型:`boolean \| FabDirectionEnum ` `type FabDirectionEnum = 'all' \| 'vertical' \| 'horizontal'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/fab/type.ts) | N
icon | String | - | 图标 | N
text | String | - | 文本内容 | N
using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
y-bounds | Array | - | 设置垂直方向边界限制,示例:[48, 48] 或 ['96rpx', 80]。TS 类型:`Array<string \| number>` | N

### Fab Events

Expand Down
6 changes: 5 additions & 1 deletion packages/products/tdesign-miniprogram/src/fab/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const props: TdFabProps = {
buttonProps: {
type: Object,
},
/** `true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动 */
/** 是否可拖拽。`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动 */
draggable: {
type: null,
value: false,
Expand All @@ -35,6 +35,10 @@ const props: TdFabProps = {
type: Boolean,
value: false,
},
/** 设置垂直方向边界限制,示例:[48, 48] 或 ['96rpx', 80] */
yBounds: {
type: Array,
},
};

export default props;
13 changes: 11 additions & 2 deletions packages/products/tdesign-miniprogram/src/fab/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export interface TdFabProps {
value?: ButtonProps;
};
/**
* `true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动
* 是否可拖拽。`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动
* @default false
*/
draggable?: {
type: null;
value?: string | boolean;
value?: boolean | FabDirectionEnum;
};
/**
* 图标
Expand Down Expand Up @@ -54,4 +54,13 @@ export interface TdFabProps {
type: BooleanConstructor;
value?: boolean;
};
/**
* 设置垂直方向边界限制,示例:[48, 48] 或 ['96rpx', 80]
*/
yBounds?: {
type: ArrayConstructor;
value?: Array<string | number>;
};
}

export type FabDirectionEnum = 'all' | 'vertical' | 'horizontal';
41 changes: 39 additions & 2 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -47418,14 +47418,14 @@
],
"field_default_value": "false",
"field_enum": "",
"field_desc_zh": "`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动",
"field_desc_zh": "是否可拖拽。`true` / `'all'`可拖动<br>`'vertical'`可垂直拖动<br>`'horizontal'`可水平拖动<br>`false`禁止拖动",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2024-04-01 10:59:27",
"update_time": "2024-04-01 10:59:27",
"event_output": null,
"custom_field_type": null,
"custom_field_type": "boolean | FabDirectionEnum 【type FabDirectionEnum = 'all' | 'vertical' | 'horizontal'】",
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
Expand Down Expand Up @@ -47677,6 +47677,43 @@
"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": 2505,
"platform_framework": [
Expand Down
Loading