Skip to content
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
1 change: 0 additions & 1 deletion packages/pro-components/chat/attachments/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ 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
addable | Boolean | true | \- | N
image-viewer | Boolean | true | \- | N
items | Array | [] | required。Typescript: `FileItem[]` `interface FileItem { fileType: 'image'\|'video'\|'audio'\|'pdf'\|'doc'\|'ppt'\|'txt'; name: string; url: string; size: number; status?: 'success'\|'fail'\|'pending'\|'error'; progress?: number; errorMessage?: string; fileIcon?: string; width?: number; height?: number; mode?: 'aspectFit' \| 'aspectFill' \| 'widthFix' \| 'heightFix' \| 'scaleToFill'}`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/pro-components/chat/attachments/type.ts) | Y
removable | Boolean | true | \- | N
Expand Down
1 change: 0 additions & 1 deletion packages/pro-components/chat/attachments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ isComponent: true
-- | -- | -- | -- | --
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
addable | Boolean | true | 【讨论中】是否显示添加按钮 | N
image-viewer | Boolean | true | 是否启用图片预览功能 | N
items | Array | [] | 必需。附件列表。TS 类型:`FileItem[]` `interface FileItem { fileType: 'image'\|'video'\|'audio'\|'pdf'\|'doc'\|'ppt'\|'txt'; name: string; url: string; size: number; status?: 'success'\|'fail'\|'pending'\|'error'; progress?: number; errorMessage?: string; fileIcon?: string; width?: number; height?: number; mode?: 'aspectFit' \| 'aspectFill' \| 'widthFix' \| 'heightFix' \| 'scaleToFill'}`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/pro-components/chat/attachments/type.ts) | Y
removable | Boolean | true | 是否显示删除按钮 | N
Expand Down
5 changes: 0 additions & 5 deletions packages/pro-components/chat/attachments/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

import { TdAttachmentsProps } from './type';
const props: TdAttachmentsProps = {
/** 【讨论中】是否显示添加按钮 */
addable: {
type: Boolean,
value: true,
},
/** 是否启用图片预览功能 */
imageViewer: {
type: Boolean,
Expand Down
8 changes: 0 additions & 8 deletions packages/pro-components/chat/attachments/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
* */

export interface TdAttachmentsProps {
/**
* 【讨论中】是否显示添加按钮
* @default true
*/
addable?: {
type: BooleanConstructor;
value?: boolean;
};
/**
* 是否启用图片预览功能
* @default true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Component({
items: [],
removable: true,
imageViewer: true,
addable: false,
},
renderPresets: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ Component({
items: [],
removable: true,
imageViewer: true,
addable: false,
},
contentHeight: '100vh', // 内容高度
activePopoverId: '', // 当前打开悬浮actionbar的chatId
Expand Down
19 changes: 9 additions & 10 deletions packages/pro-components/chat/chat-sender/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ visible | Boolean | false | \- | N

name | params | description
-- | -- | --
blur | `(value:string, context: { e: FocusEvent })` | \-
change | `(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | \-
file-add | \- | \-
file-change | `(file:FileItem)` | \-
file-click | `(file:FileItem)` | \-
file-delete | `(file:FileItem)` | \-
file-select | `(detail: {files: FileList, name: UploadActionType})` | \-
focus | `(value:string, context: { e: FocusEvent }) ` | \-
blur | `(value: string, context: { e: FocusEvent })` | \-
change | `(value: string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | \-
file-change | `(file: FileItem)` | \-
file-click | `(file: FileItem)` | \-
file-delete | `(file: FileItem)` | \-
file-select | `(detail: {files: FileList, name: UploadActionType}) ` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/chat-sender/type.ts)。<br/>`type UploadActionType = 'uploadAttachment' \| 'uploadImage'`<br/>
focus | `(value: string, context: { e: FocusEvent }) ` | \-
keyboardheightchange | `(detail: {height: number, duration: number})` | \-
send | `(value:string, context: {\| KeyboardEvent })` | \-
stop | `(value:string)` | \-
send | `(value: string, context: {\| KeyboardEvent })` | \-
stop | `(value: string)` | \-
upload-click | \- | \-
19 changes: 9 additions & 10 deletions packages/pro-components/chat/chat-sender/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ visible | Boolean | false | 上传面板是否可见 | N

名称 | 参数 | 描述
-- | -- | --
blur | `(value:string, context: { e: FocusEvent })` | 输入框聚焦时触发
change | `(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | 输入框值发生变化时触发
file-add | \- | 添加附件时触发
file-change | `(file:FileItem)` | 附件列表变化时触发
file-click | `(file:FileItem)` | 点击附件时触发
file-delete | `(file:FileItem)` | 删除附件时触发
file-select | `(detail: {files: FileList, name: UploadActionType})` | 选择文件(图片/微信文件)时触发
focus | `(value:string, context: { e: FocusEvent }) ` | 输入框聚焦时触发
blur | `(value: string, context: { e: FocusEvent })` | 输入框聚焦时触发
change | `(value: string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | 输入框值发生变化时触发
file-change | `(file: FileItem)` | 附件列表变化时触发
file-click | `(file: FileItem)` | 点击附件时触发
file-delete | `(file: FileItem)` | 删除附件时触发
file-select | `(detail: {files: FileList, name: UploadActionType}) ` | 选择文件(图片/微信文件)时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/chat-sender/type.ts)。<br/>`type UploadActionType = 'uploadAttachment' \| 'uploadImage'`<br/>
focus | `(value: string, context: { e: FocusEvent }) ` | 输入框聚焦时触发
keyboardheightchange | `(detail: {height: number, duration: number})` | 选择文件(图片/微信文件)时触发
send | `(value:string, context: {\| KeyboardEvent })` | 点击消息发送的回调方法
stop | `(value:string)` | 点击消息终止的回调方法
send | `(value: string, context: {\| KeyboardEvent })` | 点击消息发送的回调方法
stop | `(value: string)` | 点击消息终止的回调方法
upload-click | \- | 【实验】点击上传按钮时触发
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Page({
],
removable: true,
imageViewer: true,
addable: false,
},
renderPresets: [
{
Expand Down Expand Up @@ -157,10 +156,6 @@ Page({
this.setData({ fileList: files });
},

// 添加文件
onFileAdd() {
console.log('添加文件');
},

// 选择文件
onFileSelect(e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
bind:fileClick="onFileClick"
bind:fileDelete="onFileDelete"
bind:fileChange="onFileChange"
bind:fileAdd="onFileAdd"
bind:fileSelect="onFileSelect"
bind:updateVisible="onUpdateVisible"
bind:keyboardheightchange="onKeyboardHeightChange"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Page({
items: [],
removable: true,
imageViewer: true,
addable: false,
},
renderPresets: [
{
Expand Down Expand Up @@ -123,10 +122,6 @@ Page({
this.setData({ fileList: files });
},

// 添加文件
onFileAdd() {
console.log('添加文件');
},

// 选择文件
onFileSelect(e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
bind:fileClick="onFileClick"
bind:fileDelete="onFileDelete"
bind:fileChange="onFileChange"
bind:fileAdd="onFileAdd"
bind:fileSelect="onFileSelect"
bind:updateVisible="onUpdateVisible"
bind:keyboardheightchange="onKeyboardHeightChange"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Page({
items: [],
removable: true,
imageViewer: true,
addable: false,
},
renderPresets: [
{
Expand Down Expand Up @@ -125,11 +124,6 @@ Page({
this.setData({ fileList: files });
},

// 添加文件
onFileAdd() {
console.log('添加文件');
},

// 选择文件
onFileSelect(e) {
const { name, files } = e.detail;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
bind:fileClick="onFileClick"
bind:fileDelete="onFileDelete"
bind:fileChange="onFileChange"
bind:fileAdd="onFileAdd"
bind:fileSelect="onFileSelect"
bind:updateVisible="onUpdateVisible"
bind:keyboardheightchange="onKeyboardHeightChange"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Page({
items: [],
removable: true,
imageViewer: true,
addable: false,
},
renderPresets: [
{
Expand Down Expand Up @@ -124,11 +123,6 @@ Page({
this.setData({ fileList: files });
},

// 添加文件
onFileAdd() {
console.log('添加文件');
},

// 选择文件
onFileSelect(e) {
const { name, files } = e.detail;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
bind:fileClick="onFileClick"
bind:fileDelete="onFileDelete"
bind:fileChange="onFileChange"
bind:fileAdd="onFileAdd"
bind:fileSelect="onFileSelect"
bind:updateVisible="onUpdateVisible"
bind:keyboardheightchange="onKeyboardHeightChange"
Expand Down
4 changes: 0 additions & 4 deletions packages/pro-components/chat/chat-sender/chat-sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@ export default class ChatSender extends SuperComponent {
this.triggerEvent('fileChange', { files }); // 确保传递新数组
},

handleFileAdd() {
this.triggerEvent('fileAdd');
},

async handleImageUpload(e) {
const { type } = e.currentTarget.dataset;
const sourceType = [type];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
imageViewer="{{attachmentsProps.imageViewer}}"
bind:fileClick="handleFileClick"
bind:remove="handleFileRemove"
bind:add="handleFileAdd"
>
</attachments>
</view>
Expand Down
7 changes: 7 additions & 0 deletions packages/tdesign-miniprogram/.changelog/pr-4331.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
pr_number: 4331
contributor: zydemail
---

- break(ChatSender): 附件末尾没有添加入口,移除无实际意义的 `fileAdd` 事件 @zydemail ([#4331](https://github.com/Tencent/tdesign-miniprogram/pull/4331))
- docs(Attachments): 移除 `addable` 属性相关文档描述 @zydemail ([#4331](https://github.com/Tencent/tdesign-miniprogram/pull/4331))
7 changes: 7 additions & 0 deletions packages/tdesign-uniapp-chat/.changelog/pr-4331.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
pr_number: 4331
contributor: zydemail
---

- break(ChatSender): 附件末尾没有添加入口,移除无实际意义的 `fileAdd` 事件 @zydemail ([#4331](https://github.com/Tencent/tdesign-miniprogram/pull/4331))
- docs(Attachments): 移除 `addable` 属性相关文档描述 @zydemail ([#4331](https://github.com/Tencent/tdesign-miniprogram/pull/4331))
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
name | type | default | description | required
-- | -- | -- | -- | --
custom-style | Object | - | CSS(Cascading Style Sheets) | N
addable | Boolean | true | \- | N
image-viewer | Boolean | true | \- | N
items | Array | [] | required。Typescript: `FileItem[]` `interface FileItem { fileType: 'image'\|'video'\|'audio'\|'pdf'\|'doc'\|'ppt'\|'txt'; name: string; url: string; size: number; status?: 'success'\|'fail'\|'pending'\|'error'; progress?: number; errorMessage?: string; fileIcon?: string; width?: number; height?: number; mode?: 'aspectFit' \| 'aspectFill' \| 'widthFix' \| 'heightFix' \| 'scaleToFill'}`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-pro-components/chat/attachments/type.ts) | Y
items | Array | [] | required。Typescript: `FileItem[]` `interface FileItem { fileType: 'image'\|'video'\|'audio'\|'pdf'\|'doc'\|'ppt'\|'txt'; name: string; url: string; size: number; status?: 'success'\|'fail'\|'pending'\|'error'; progress?: number; errorMessage?: string; fileIcon?: string; width?: number; height?: number; mode?: 'aspectFit' \| 'aspectFill' \| 'widthFix' \| 'heightFix' \| 'scaleToFill'}`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-pro-components/chat/attachments/type.ts) | Y
removable | Boolean | true | \- | N

### Attachments Events
Expand Down
3 changes: 1 addition & 2 deletions packages/uniapp-pro-components/chat/attachments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ import TAttachments from '@tdesign/uniapp-chat/attachments/attachments.vue';
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
custom-style | Object | - | 自定义样式 | N
addable | Boolean | true | 【讨论中】是否显示添加按钮 | N
image-viewer | Boolean | true | 是否启用图片预览功能 | N
items | Array | [] | 必需。附件列表。TS 类型:`FileItem[]` `interface FileItem { fileType: 'image'\|'video'\|'audio'\|'pdf'\|'doc'\|'ppt'\|'txt'; name: string; url: string; size: number; status?: 'success'\|'fail'\|'pending'\|'error'; progress?: number; errorMessage?: string; fileIcon?: string; width?: number; height?: number; mode?: 'aspectFit' \| 'aspectFill' \| 'widthFix' \| 'heightFix' \| 'scaleToFill'}`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-pro-components/chat/attachments/type.ts) | Y
items | Array | [] | 必需。附件列表。TS 类型:`FileItem[]` `interface FileItem { fileType: 'image'\|'video'\|'audio'\|'pdf'\|'doc'\|'ppt'\|'txt'; name: string; url: string; size: number; status?: 'success'\|'fail'\|'pending'\|'error'; progress?: number; errorMessage?: string; fileIcon?: string; width?: number; height?: number; mode?: 'aspectFit' \| 'aspectFill' \| 'widthFix' \| 'heightFix' \| 'scaleToFill'}`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-pro-components/chat/attachments/type.ts) | Y
removable | Boolean | true | 是否显示删除按钮 | N

### Attachments Events
Expand Down
5 changes: 0 additions & 5 deletions packages/uniapp-pro-components/chat/attachments/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

import type { TdAttachmentsProps } from './type';
export default {
/** 【讨论中】是否显示添加按钮 */
addable: {
type: Boolean,
default: true,
},
/** 是否启用图片预览功能 */
imageViewer: {
type: Boolean,
Expand Down
5 changes: 0 additions & 5 deletions packages/uniapp-pro-components/chat/attachments/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
* */

export interface TdAttachmentsProps {
/**
* 【讨论中】是否显示添加按钮
* @default true
*/
addable?: boolean;
/**
* 是否启用图片预览功能
* @default true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export default {
items: [],
removable: true,
imageViewer: true,
addable: false,
},

renderPresets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ export default {
items: [],
removable: true,
imageViewer: true,
addable: false,
},

// 内容高度
Expand Down
23 changes: 11 additions & 12 deletions packages/uniapp-pro-components/chat/chat-sender/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ name | type | default | description | required
-- | -- | -- | -- | --
custom-style | Object | - | CSS(Cascading Style Sheets) | N
adjust-position | Boolean | false | \- | N
attachments-props | Object | - | Typescript: `AttachmentsProps`,[Attachments API Documents](./attachments?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-pro-components/chat/chat-sender/type.ts) | N
attachments-props | Object | - | Typescript: `AttachmentsProps`,[Attachments API Documents](./attachments?tab=api)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-pro-components/chat/chat-sender/type.ts) | N
auto-rise-with-keyboard | Boolean | false | \- | N
disabled | Boolean | false | \- | N
file-list | Array | [] | Typescript: `FileItem[]` | N
loading | Boolean | false | \- | N
placeholder | String | 请输入消息... | \- | N
render-presets | Array | [{name: 'upload', presets: ['uploadCamera', 'uploadImage', 'uploadAttachment'], status: ''},{ name: 'send', type: 'icon'}] | Typescript: `ChatActionButtons` `type ChatActionButtons = Array<ChatActionButton>` `type ChatActionButton = UploadButton \| SendButton` `interface UploadButton { name: 'upload'; presets: string[]; status?: string; }` `interface SendButton { name: 'send'; type: 'icon' \| 'text';}`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-pro-components/chat/chat-sender/type.ts) | N
render-presets | Array | [{name: 'upload', presets: ['uploadCamera', 'uploadImage', 'uploadAttachment'], status: ''},{ name: 'send', type: 'icon'}] | Typescript: `ChatActionButtons` `type ChatActionButtons = Array<ChatActionButton>` `type ChatActionButton = UploadButton \| SendButton` `interface UploadButton { name: 'upload'; presets: string[]; status?: string; }` `interface SendButton { name: 'send'; type: 'icon' \| 'text';}`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-pro-components/chat/chat-sender/type.ts) | N
textarea-props | Boolean / Object | { autosize: { maxHeight: 264, minHeight: 48 } } | \- | N
value | String | - | input value | N
visible | Boolean | false | \- | N
Expand All @@ -23,17 +23,16 @@ visible | Boolean | false | \- | N

name | params | description
-- | -- | --
blur | `(value:string, context: { e: FocusEvent })` | \-
change | `(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | \-
file-add | \- | \-
file-change | `(file:FileItem)` | \-
file-click | `(file:FileItem)` | \-
file-delete | `(file:FileItem)` | \-
file-select | `(context: {files: FileList, name: UploadActionType})` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/chat-sender/type.ts)。<br/>`type UploadActionType = 'uploadAttachment' \| 'uploadImage'`<br/>
focus | `(value:string, context: { e: FocusEvent }) ` | \-
blur | `(value: string, context: { e: FocusEvent })` | \-
change | `(value: string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | \-
file-change | `(file: FileItem)` | \-
file-click | `(file: FileItem)` | \-
file-delete | `(file: FileItem)` | \-
file-select | `(context: {files: FileList, name: UploadActionType}) ` | [see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/chat-sender/type.ts)。<br/>`type UploadActionType = 'uploadAttachment' \| 'uploadImage'`<br/>
focus | `(value: string, context: { e: FocusEvent }) ` | \-
keyboardheightchange | `(context: {height: number, duration: number})` | \-
send | `(value:string, context: { e: MouseEvent \| KeyboardEvent })` | \-
stop | `(value:string, context: { e: MouseEvent })` | \-
send | `(value: string, context: { e: MouseEvent \| KeyboardEvent })` | \-
stop | `(value: string, context: { e: MouseEvent })` | \-
update-value | `(value: boolean)` | \-
update-visible | `(value: boolean)` | \-
upload-click | \- | \-
Loading
Loading