diff --git a/db/TDesign.db b/db/TDesign.db index eef51082..89d7e6ac 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-mobile-react/src/popover/defaultProps.ts b/packages/products/tdesign-mobile-react/src/popover/defaultProps.ts new file mode 100644 index 00000000..4a3031bb --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/popover/defaultProps.ts @@ -0,0 +1,12 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdPopoverProps } from './type'; + +export const popoverDefaultProps: TdPopoverProps = { + closeOnClickOutside: true, + placement: 'top', + showArrow: true, + theme: 'dark', +}; diff --git a/packages/products/tdesign-mobile-react/src/popover/popover.en-US.md b/packages/products/tdesign-mobile-react/src/popover/popover.en-US.md new file mode 100644 index 00000000..415b8b77 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/popover/popover.en-US.md @@ -0,0 +1,20 @@ +:: BASE_DOC :: + +## API + + +### Popover Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N +children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +closeOnClickOutside | Boolean | true | \- | N +content | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +placement | String | top | options: top/left/right/bottom/top-left/top-right/bottom-left/bottom-right/left-top/left-bottom/right-top/right-bottom | N +showArrow | Boolean | true | \- | N +theme | String | dark | options: dark/light/brand/success/warning/error | N +triggerElement | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +visible | Boolean | - | \- | N +onVisibleChange | Function | | Typescript:`(visible: boolean) => void`
| N diff --git a/packages/products/tdesign-mobile-react/src/popover/popover.md b/packages/products/tdesign-mobile-react/src/popover/popover.md new file mode 100644 index 00000000..97bbab04 --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/popover/popover.md @@ -0,0 +1,20 @@ +:: BASE_DOC :: + +## API + + +### Popover Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +children | TNode | - | 触发元素,同 triggerElement。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +closeOnClickOutside | Boolean | true | 是否在点击外部元素后关闭菜单 | N +content | TNode | - | 确认框内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +placement | String | top | 浮层出现位置。可选项:top/left/right/bottom/top-left/top-right/bottom-left/bottom-right/left-top/left-bottom/right-top/right-bottom | N +showArrow | Boolean | true | 是否显示浮层箭头 | N +theme | String | dark | 弹出气泡主题。。可选项:dark/light/brand/success/warning/error | N +triggerElement | TNode | - | 触发元素。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N +visible | Boolean | - | 是否显示气泡确认框 | N +onVisibleChange | Function | | TS 类型:`(visible: boolean) => void`
确认框显示或隐藏时触发 | N diff --git a/packages/products/tdesign-mobile-react/src/popover/type.ts b/packages/products/tdesign-mobile-react/src/popover/type.ts new file mode 100644 index 00000000..30684fbf --- /dev/null +++ b/packages/products/tdesign-mobile-react/src/popover/type.ts @@ -0,0 +1,66 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TNode } from '../common'; + +export interface TdPopoverProps { + /** + * 触发元素,同 triggerElement + */ + children?: TNode; + /** + * 是否在点击外部元素后关闭菜单 + * @default true + */ + closeOnClickOutside?: boolean; + /** + * 确认框内容 + */ + content?: TNode; + /** + * 浮层出现位置 + * @default top + */ + placement?: + | 'top' + | 'left' + | 'right' + | 'bottom' + | 'top-left' + | 'top-right' + | 'bottom-left' + | 'bottom-right' + | 'left-top' + | 'left-bottom' + | 'right-top' + | 'right-bottom'; + /** + * 是否显示浮层箭头 + * @default true + */ + showArrow?: boolean; + /** + * 弹出气泡主题。 + * @default dark + */ + theme?: 'dark' | 'light' | 'brand' | 'success' | 'warning' | 'error'; + /** + * 触发元素 + */ + triggerElement?: TNode; + /** + * 是否显示气泡确认框 + */ + visible?: boolean; + /** + * 是否显示气泡确认框,非受控属性 + */ + defaultVisible?: boolean; + /** + * 确认框显示或隐藏时触发 + */ + onVisibleChange?: (visible: boolean) => void; +} diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 5563998f..36ec1fd9 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -80880,10 +80880,50 @@ "Object" ] }, + { + "id": 1726067019, + "platform_framework": [ + "16" + ], + "component": "Popover", + "field_category": 1, + "field_name": "children", + "field_type": [ + "1", + "64" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "触发元素,同 triggerElement", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2024-09-11 15:03:39", + "update_time": "2024-09-11 15:03:39", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "MouseEvent", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "React(Mobile)" + ], + "field_type_text": [ + "String", + "TNode" + ] + }, { "id": 3526, "platform_framework": [ - "8" + "8", + "16" ], "component": "Popover", "field_category": 1, @@ -80911,7 +80951,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "Boolean" @@ -80920,7 +80961,8 @@ { "id": 942, "platform_framework": [ - "8" + "8", + "16" ], "component": "Popover", "field_category": 1, @@ -80949,7 +80991,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "String", @@ -80998,7 +81041,8 @@ { "id": 3514, "platform_framework": [ - "8" + "8", + "16" ], "component": "Popover", "field_category": 1, @@ -81026,7 +81070,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "String" @@ -81035,7 +81080,8 @@ { "id": 3513, "platform_framework": [ - "8" + "8", + "16" ], "component": "Popover", "field_category": 1, @@ -81063,7 +81109,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "Boolean" @@ -81072,7 +81119,8 @@ { "id": 3516, "platform_framework": [ - "8" + "8", + "16" ], "component": "Popover", "field_category": 1, @@ -81100,7 +81148,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "String" @@ -81109,7 +81158,8 @@ { "id": 3517, "platform_framework": [ - "8" + "8", + "16" ], "component": "Popover", "field_category": 1, @@ -81138,7 +81188,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "String", @@ -81148,7 +81199,8 @@ { "id": 1160, "platform_framework": [ - "8" + "8", + "16" ], "component": "Popover", "field_category": 1, @@ -81176,7 +81228,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [ "Boolean" @@ -81185,7 +81238,8 @@ { "id": 3519, "platform_framework": [ - "8" + "8", + "16" ], "component": "Popover", "field_category": 2, @@ -81211,7 +81265,8 @@ "support_default_value": 0, "field_category_text": "Events", "platform_framework_text": [ - "Vue(Mobile)" + "Vue(Mobile)", + "React(Mobile)" ], "field_type_text": [] },