Skip to content
Open
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 @@ -134,8 +134,10 @@ name | type | default | description | required
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
collapsePanelProps | Object | { destroyOnCollapse: false } | Typescript:`CollapsePanelProps`,[Collapse API Documents](./collapse?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N
expand | Boolean | - | \- | N
defaultExpand | Boolean | - | uncontrolled property | N
expandIcon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
expandIconPlacement | String | right | options: left/right | N
header | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
headerRightContent | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
onExpandChange | Function | | Typescript:`(value: CollapseValue) => void`<br/>Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts)。<br/>`import { CollapseValue } from '@Collapse'`<br/> | N
onExpandChange | Function | | Typescript:`(value: boolean) => void`<br/>Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ onStop | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) =
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
collapsePanelProps | Object | { destroyOnCollapse: false } | 透传给 CollapsePanel 组件的全部属性。TS 类型:`CollapsePanelProps`,[Collapse API Documents](./collapse?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N
expand | Boolean | - | \- | N
defaultExpand | Boolean | - | 非受控属性 | N
expandIcon | TElement | - | 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
expandIconPlacement | String | right | 展开图标位置,可选项:left/right。可选项:left/right | N
header | TElement | - | 折叠面板头内容。优先级低于collapsePanelProps.header。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
headerRightContent | TElement | - | 折叠面板尾内容。优先级低于collapsePanelProps.headerRightContent。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
onExpandChange | Function | | TS 类型:`(value: CollapseValue) => void`<br/>展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts)。<br/>`import { CollapseValue } from '@Collapse'`<br/> | N
onExpandChange | Function | | TS 类型:`(value: boolean) => void`<br/>展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { AvatarProps } from '../avatar';
import { TextareaProps } from '../textarea';
import { CollapsePanelProps } from '../collapse';
import { CollapseValue } from '../collapse';
import { TNode, TElement } from '../common';
import { MouseEvent, KeyboardEvent, FocusEvent, FormEvent } from 'react';

Expand Down Expand Up @@ -326,6 +325,14 @@ export interface TdChatReasoningProps {
* @default { destroyOnCollapse: false }
*/
collapsePanelProps?: CollapsePanelProps;
/**
* null
*/
expand?: boolean;
/**
* null,非受控属性
*/
defaultExpand?: boolean;
/**
* 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon
*/
Expand All @@ -346,7 +353,7 @@ export interface TdChatReasoningProps {
/**
* 展开图标点击事件
*/
onExpandChange?: (value: CollapseValue) => void;
onExpandChange?: (value: boolean) => void;
}

export interface TdChatItemMeta {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ export default {
type: Object as PropType<TdChatReasoningProps['collapsePanelProps']>,
default: { destroyOnCollapse: false },
},
/** null */
expand: {
type: Boolean,
default: undefined,
},
/** null,非受控属性 */
defaultExpand: Boolean,
/** 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon */
expandIcon: {
type: Function as PropType<TdChatReasoningProps['expandIcon']>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,16 @@ stop | `(value:string, context: { e: MouseEvent })` | \-
name | type | default | description | required
-- | -- | -- | -- | --
collapsePanelProps | Object | { destroyOnCollapse: false } | Typescript:`CollapsePanelProps`,[Collapse API Documents](./collapse?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N
expand | Boolean | - | `v-model:expand` is supported | N
defaultExpand | Boolean | - | uncontrolled property | N
expandIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
expandIconPlacement | String | right | options: left/right | N
header | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
headerRightContent | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
onExpandChange | Function | | Typescript:`(value: CollapseValue) => void`<br/>Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。<br/>`import { CollapseValue } from '@Collapse'`<br/> | N
onExpandChange | Function | | Typescript:`(value: boolean) => void`<br/>Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N

### ChatReasoning Events

name | params | description
-- | -- | --
expand-change | `(value: CollapseValue)` | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。<br/>`import { CollapseValue } from '@Collapse'`<br/>
expand-change | `(value: boolean)` | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,16 @@ stop | `(value:string, context: { e: MouseEvent })` | 点击消息终止的回
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
collapsePanelProps | Object | { destroyOnCollapse: false } | 透传给 CollapsePanel 组件的全部属性。TS 类型:`CollapsePanelProps`,[Collapse API Documents](./collapse?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N
expand | Boolean | - | 支持语法糖 `v-model:expand` | N
defaultExpand | Boolean | - | 非受控属性 | N
expandIcon | Slot / Function | - | 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
expandIconPlacement | String | right | 展开图标位置,可选项:left/right。可选项:left/right | N
header | Slot / Function | - | 折叠面板头内容。优先级低于collapsePanelProps.header。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
headerRightContent | Slot / Function | - | 折叠面板尾内容。优先级低于collapsePanelProps.headerRightContent。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
onExpandChange | Function | | TS 类型:`(value: CollapseValue) => void`<br/>展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。<br/>`import { CollapseValue } from '@Collapse'`<br/> | N
onExpandChange | Function | | TS 类型:`(value: boolean) => void`<br/>展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N

### ChatReasoning Events

名称 | 参数 | 描述
-- | -- | --
expand-change | `(value: CollapseValue)` | 展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。<br/>`import { CollapseValue } from '@Collapse'`<br/>
expand-change | `(value: boolean)` | 展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { AvatarProps } from '../avatar';
import { TextareaProps } from '../textarea';
import { CollapsePanelProps } from '../collapse';
import { CollapseValue } from '../collapse';
import { TNode } from '../common';

export interface TdChatProps {
Expand Down Expand Up @@ -329,6 +328,14 @@ export interface TdChatReasoningProps {
* @default { destroyOnCollapse: false }
*/
collapsePanelProps?: CollapsePanelProps;
/**
* null
*/
expand?: boolean;
/**
* null,非受控属性
*/
defaultExpand?: boolean;
/**
* 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon
*/
Expand All @@ -349,7 +356,7 @@ export interface TdChatReasoningProps {
/**
* 展开图标点击事件
*/
onExpandChange?: (value: CollapseValue) => void;
onExpandChange?: (value: boolean) => void;
}

export interface TdChatItemMeta {
Expand Down
29 changes: 29 additions & 0 deletions packages/products/tdesign-vue/src/chat/chat-action-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdChatActionProps } from '../chat/type';
import { PropType } from 'vue';

export default {
/** 被复制的内容 */
content: {
type: String,
default: '',
},
/** 操作按钮是否可点击 */
disabled: Boolean,
/** 是否点踩 */
isBad: Boolean,
/** 是否点赞 */
isGood: Boolean,
/** 操作按钮配置项,可配置操作按钮选项和顺序 */
operationBtn: {
type: Array as PropType<TdChatActionProps['operationBtn']>,
default: (): TdChatActionProps['operationBtn'] => ["replay", "copy", "good", "bad"],
},
/** 点击点赞,点踩,复制,重新生成按钮时触发 */
onOperation: Function as PropType<TdChatActionProps['onOperation']>,
};
24 changes: 24 additions & 0 deletions packages/products/tdesign-vue/src/chat/chat-content-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdChatContentProps } from '../chat/type';
import { PropType } from 'vue';

export default {
/** 聊天内容,支持 markdown 格式 */
content: {
type: String,
default: '',
},
/** 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 */
role: {
type: String as PropType<TdChatContentProps['role']>,
validator(val: TdChatContentProps['role']): boolean {
if (!val) return true;
return ['user', 'assistant', 'error', 'model-change', 'system'].includes(val);
},
},
};
51 changes: 51 additions & 0 deletions packages/products/tdesign-vue/src/chat/chat-input-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdChatInputProps } from '../chat/type';
import { PropType } from 'vue';

export default {
/** 输入框是否自动聚焦 */
autofocus: Boolean,
/** 高度自动撑开。 autosize = true 表示组件高度自动撑开,同时,依旧允许手动拖高度。如果设置了 autosize.maxRows 或者 autosize.minRows 则不允许手动调整高度 */
autosize: {
type: [Boolean, Object] as PropType<TdChatInputProps['autosize']>,
default: { minRows: 1, maxRows: 5 },
},
/** 是否禁用输入框 */
disabled: Boolean,
/** 输入框默认文案 */
placeholder: {
type: String,
default: '',
},
/** 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 */
stopDisabled: Boolean,
/** 发送按钮的自定义扩展 */
suffixIcon: {
type: Function as PropType<TdChatInputProps['suffixIcon']>,
},
/** 输入框的值 */
value: {
type: String,
default: '',
},
/** 输入框的值,非受控属性 */
defaultValue: {
type: String,
default: '',
},
/** 输入框聚焦时触发 */
onBlur: Function as PropType<TdChatInputProps['onBlur']>,
/** 输入框值发生变化时触发 */
onChange: Function as PropType<TdChatInputProps['onChange']>,
/** 输入框聚焦时触发 */
onFocus: Function as PropType<TdChatInputProps['onFocus']>,
/** 点击消息发送的回调方法 */
onSend: Function as PropType<TdChatInputProps['onSend']>,
/** 点击消息终止的回调方法 */
onStop: Function as PropType<TdChatInputProps['onStop']>,
};
64 changes: 64 additions & 0 deletions packages/products/tdesign-vue/src/chat/chat-item-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdChatItemProps } from '../chat/type';
import { PropType } from 'vue';

export default {
/** 自定义的操作内容 */
actions: {
type: [String, Function] as PropType<TdChatItemProps['actions']>,
},
/** 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种 */
animation: {
type: String as PropType<TdChatItemProps['animation']>,
default: 'skeleton' as TdChatItemProps['animation'],
validator(val: TdChatItemProps['animation']): boolean {
if (!val) return true;
return ['skeleton', 'moving', 'gradient'].includes(val);
},
},
/** 自定义的头像配置 */
avatar: {
type: [String, Object, Function] as PropType<TdChatItemProps['avatar']>,
},
/** 对话单元的内容 */
content: {
type: [String, Function] as PropType<TdChatItemProps['content']>,
},
/** 对话单元的时间配置 */
datetime: {
type: [String, Function] as PropType<TdChatItemProps['datetime']>,
},
/** 自定义的昵称 */
name: {
type: [String, Function] as PropType<TdChatItemProps['name']>,
},
/** 值为false不显示思维链,为string则显示内置推理内容交互,为对象则单独配置推理内容 */
reasoning: {
type: [String, Boolean, Object] as PropType<TdChatItemProps['reasoning']>,
default: false,
},
/** 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 */
role: {
type: String as PropType<TdChatItemProps['role']>,
validator(val: TdChatItemProps['role']): boolean {
if (!val) return true;
return ['user', 'assistant', 'error', 'model-change', 'system'].includes(val);
},
},
/** 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false */
textLoading: Boolean,
/** 气泡框样式,支持基础、线框、文字三种类型 */
variant: {
type: String as PropType<TdChatItemProps['variant']>,
default: 'text' as TdChatItemProps['variant'],
validator(val: TdChatItemProps['variant']): boolean {
if (!val) return true;
return ['base', 'outline', 'text'].includes(val);
},
},
};
25 changes: 25 additions & 0 deletions packages/products/tdesign-vue/src/chat/chat-loading-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdChatLoadingProps } from '../chat/type';
import { PropType } from 'vue';

export default {
/** 加载的状态形式 */
animation: {
type: String as PropType<TdChatLoadingProps['animation']>,
default: 'gradient' as TdChatLoadingProps['animation'],
validator(val: TdChatLoadingProps['animation']): boolean {
if (!val) return true;
return ['moving', 'gradient'].includes(val);
},
},
/** 加载过程展示的文字内容 */
text: {
type: String,
default: '',
},
};
43 changes: 43 additions & 0 deletions packages/products/tdesign-vue/src/chat/chat-reasoning-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdChatReasoningProps } from '../chat/type';
import { PropType } from 'vue';

export default {
/** 透传给 CollapsePanel 组件的全部属性 */
collapsePanelProps: {
type: Object as PropType<TdChatReasoningProps['collapsePanelProps']>,
default: { destroyOnCollapse: false },
},
/** null */
expand: Boolean,
/** null,非受控属性 */
defaultExpand: Boolean,
/** 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon */
expandIcon: {
type: Function as PropType<TdChatReasoningProps['expandIcon']>,
},
/** 展开图标位置,可选项:left/right */
expandIconPlacement: {
type: String as PropType<TdChatReasoningProps['expandIconPlacement']>,
default: 'right' as TdChatReasoningProps['expandIconPlacement'],
validator(val: TdChatReasoningProps['expandIconPlacement']): boolean {
if (!val) return true;
return ['left', 'right'].includes(val);
},
},
/** 折叠面板头内容。优先级低于collapsePanelProps.header */
header: {
type: Function as PropType<TdChatReasoningProps['header']>,
},
/** 折叠面板尾内容。优先级低于collapsePanelProps.headerRightContent */
headerRightContent: {
type: Function as PropType<TdChatReasoningProps['headerRightContent']>,
},
/** 展开图标点击事件 */
onExpandChange: Function as PropType<TdChatReasoningProps['onExpandChange']>,
};
Loading