tuikit-atomicx-vue3 3.3.0-beta.3 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AttachmentPicker.module-BesmtGyl.js +11 -0
- package/dist/FilePicker.vue_vue_type_script_setup_true_lang-CdJ4DUzE.js +76 -0
- package/dist/ImagePicker.vue_vue_type_script_setup_true_lang-CbNUofpK.js +76 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-XRL7A5Gj.js → MessageInput.vue_vue_type_script_setup_true_lang-wUJPjWbx.js} +23 -18
- package/dist/VideoPicker.vue_vue_type_script_setup_true_lang-CmxjbNDJ.js +76 -0
- package/dist/chat/index.d.ts +3747 -2386
- package/dist/chat/index.js +12 -11
- package/dist/components/BarrageInput/BarrageInputH5.js +32 -8
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +9 -5
- package/dist/components/BarrageInput/TextEditor/index.js +14 -6
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +4 -4
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +12 -4
- package/dist/components/BarrageList/i18n/en-US/index.d.ts +1 -0
- package/dist/components/BarrageList/i18n/en-US/index.js +2 -1
- package/dist/components/BarrageList/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/BarrageList/i18n/zh-CN/index.js +2 -1
- package/dist/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.js +5 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupChatSetting.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupInfo/GroupInfo.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupManagement/GroupManagement.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupMembers/GroupMembers.js +3 -3
- package/dist/components/ChatSetting/SettingItem/SettingItem.js +21 -21
- package/dist/components/ChatSetting/i18n/en-US.js +3 -3
- package/dist/components/ChatSetting/i18n/zh-CN.js +3 -3
- package/dist/components/ChatSetting/index.d.ts +1 -4
- package/dist/components/ChatSetting/index.js +3 -6
- package/dist/components/CoGuestPanel/CoGuestPanel.js +1 -1
- package/dist/components/ContactList/ContactInfo/ContactInfo.js +17 -17
- package/dist/components/ContactList/ContactInfo/ContactInfo.vue.d.ts +26 -2
- package/dist/components/ContactList/ContactInfo/GroupInfo/GroupInfo.js +2 -1
- package/dist/components/ContactList/ContactList.js +19 -10
- package/dist/components/ContactList/ContactList.vue.d.ts +109 -1
- package/dist/components/ContactList/index.d.ts +158 -26
- package/dist/components/ConversationList/ConversationActions/ConversationActions.js +8 -9
- package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +2 -1
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.js +8 -8
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.js +1 -2
- package/dist/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.js +8 -8
- package/dist/components/ConversationList/ConversationList.js +18 -44
- package/dist/components/ConversationList/ConversationList.vue.d.ts +197 -1535
- package/dist/components/ConversationList/ConversationListContent/ConversationListContent.js +8 -11
- package/dist/components/ConversationList/ConversationListContent/ConversationListContent.vue.d.ts +22 -340
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +80 -134
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +19 -30
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue.d.ts +0 -2
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +14 -15
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +12 -24
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/index.d.ts +1 -1
- package/dist/components/ConversationList/ConversationPreview/index.js +17 -21
- package/dist/components/ConversationList/ConversationSearch/ConversationSearch.js +1 -0
- package/dist/components/ConversationList/index.d.ts +468 -2400
- package/dist/components/ConversationList/index.js +1 -1
- package/dist/components/LiveAudienceList/LiveAudienceListH5.js +1 -1
- package/dist/components/LiveCoreView/index.js +113 -58
- package/dist/components/LiveCoreView/index.vue.d.ts +9 -0
- package/dist/components/LiveList/LiveList.js +7 -5
- package/dist/components/LiveList/LiveListH5.js +77 -71
- package/dist/components/LiveList/i18n/en-US/index.d.ts +5 -0
- package/dist/components/LiveList/i18n/en-US/index.js +6 -1
- package/dist/components/LiveList/i18n/zh-CN/index.d.ts +5 -0
- package/dist/components/LiveList/i18n/zh-CN/index.js +6 -1
- package/dist/components/LiveList/pullToRefresh.js +204 -0
- package/dist/components/LiveList/pullToRefresh.vue.d.ts +86 -0
- package/dist/components/LiveScenePanel/CameraSettingDialog.js +6 -5
- package/dist/components/LiveScenePanel/index.js +3 -3
- package/dist/components/MessageInput/AttachmentPicker/AttachmentPicker.vue.d.ts +0 -4
- package/dist/components/MessageInput/AttachmentPicker/FilePicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/ImagePicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/VideoPicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/index.js +14 -19
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +3 -3
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/MessageInput.vue.d.ts +6 -9
- package/dist/components/MessageInput/TextEditor/TextEditor.vue.d.ts +2 -2
- package/dist/components/MessageInput/TextEditor/index.js +18 -9
- package/dist/components/MessageInput/index.d.ts +5 -41
- package/dist/components/MessageInput/index.js +4 -4
- package/dist/components/MessageList/Message/CustomMessage/index.js +2 -2
- package/dist/components/MessageList/Message/FaceMessage/FaceMessage.js +7 -5
- package/dist/components/MessageList/Message/FaceMessage/FaceMessage.vue.d.ts +8 -8
- package/dist/components/MessageList/Message/LocationMessage/LocationMessage.js +2 -1
- package/dist/components/MessageList/Message/MergerMessage/MergerMessage.js +2 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +12 -4
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.vue.d.ts +3 -3
- package/dist/components/MessageList/MessageForward/MessageForward.js +2 -3
- package/dist/components/MessageList/MessageList.js +14 -7
- package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
- package/dist/components/MessageList/MessageTimeDivider/MessageTimeDivider.js +5 -5
- package/dist/components/MessageList/MessageTimeDivider/MessageTimeDivider.vue.d.ts +10 -10
- package/dist/components/MessageList/index.d.ts +143 -5
- package/dist/components/MessageList/index.js +5 -5
- package/dist/components/Search/Search.js +1 -3
- package/dist/components/Search/SearchResults/EmptyResult/EmptyResult.js +4 -6
- package/dist/components/Search/SearchResults/Loading/Loading.js +2 -4
- package/dist/components/Search/SearchResults/SearchResults.js +20 -22
- package/dist/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.js +6 -8
- package/dist/components/Search/SearchResults/SearchResultsItem/Group/Group.js +5 -7
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +19 -21
- package/dist/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.js +1 -3
- package/dist/components/Search/SearchResults/SearchResultsItem/User/User.js +5 -7
- package/dist/components/StreamMixer/LocalMixer/index.js +11 -5
- package/dist/components/StreamView/manager/mediaManager.js +1 -1
- package/dist/components/UserPicker/UserPicker.js +2 -2
- package/dist/components/UserPicker/UserPicker.vue.d.ts +7 -8
- package/dist/components/UserPicker/components/ListMode/ListMode.js +14 -17
- package/dist/components/UserPicker/components/ListMode/ListMode.vue.d.ts +2 -2
- package/dist/components/UserPicker/components/SelectedPanel/SelectedPanel.vue.d.ts +2 -2
- package/dist/components/UserPicker/components/TreeMode/TreeMode.vue.d.ts +3 -3
- package/dist/components/UserPicker/components/TreeMode/TreeNode.vue.d.ts +4 -4
- package/dist/components/UserPicker/hooks/useSearchFilter.d.ts +3 -3
- package/dist/components/UserPicker/hooks/useSelection.d.ts +8 -8
- package/dist/components/UserPicker/hooks/useTreeState.d.ts +3 -3
- package/dist/components/UserPicker/index.d.ts +134 -3
- package/dist/components/UserPicker/index.js +3 -2
- package/dist/components/UserPicker/type.d.ts +18 -18
- package/dist/index.js +6 -3
- package/dist/rtc/index.d.ts +9 -0
- package/dist/states/GroupSettingState/GroupSettingState.js +3 -3
- package/dist/states/LiveSeatState/usePlayStream/MixStreamPlayer.js +3 -0
- package/dist/states/LoginState.js +1 -0
- package/dist/states/MessageInputState/MessageInputState.js +25 -5
- package/dist/styles/index.css +1294 -3578
- package/dist/types/contact.d.ts +13 -12
- package/dist/types/conversation.d.ts +12 -14
- package/dist/types/engine.d.ts +12 -0
- package/dist/types/engine.js +15 -0
- package/dist/types/index.js +2 -1
- package/dist/utils/json.js +0 -1
- package/package.json +7 -3
- package/src/chat/index.ts +12 -4
- package/src/components/BarrageInput/BarrageInputH5.vue +50 -4
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.module.scss +1 -0
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.vue +1 -1
- package/src/components/BarrageInput/TextEditor/Editor.scss +1 -1
- package/src/components/BarrageInput/TextEditor/TextEditor.module.scss +2 -0
- package/src/components/BarrageInput/TextEditor/TextEditor.vue +6 -0
- package/src/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue +8 -8
- package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +10 -0
- package/src/components/BarrageList/i18n/en-US/index.ts +1 -0
- package/src/components/BarrageList/i18n/zh-CN/index.ts +1 -0
- package/src/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.vue +5 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupChatSetting.vue +5 -4
- package/src/components/ChatSetting/GroupChatSetting/GroupInfo/GroupInfo.vue +2 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupManagement/GroupManagement.vue +3 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupMembers/GroupMembers.vue +3 -3
- package/src/components/ChatSetting/SettingItem/SettingItem.vue +10 -7
- package/src/components/ChatSetting/i18n/en-US.ts +3 -3
- package/src/components/ChatSetting/i18n/zh-CN.ts +3 -3
- package/src/components/ChatSetting/index.ts +3 -3
- package/src/components/CoGuestPanel/CoGuestPanel.vue +9 -0
- package/src/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/ContactInfo.vue +17 -9
- package/src/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/FriendInfo/FriendInfo.scss +4 -3
- package/src/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.vue +1 -0
- package/src/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.scss +2 -2
- package/src/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.scss +3 -2
- package/src/components/ContactList/ContactList.scss +2 -1
- package/src/components/ContactList/ContactList.vue +18 -3
- package/src/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.scss +3 -3
- package/src/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.scss +5 -6
- package/src/components/ContactList/ContactListItem/FriendItem/FriendItem.scss +3 -3
- package/src/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.scss +5 -6
- package/src/components/ContactList/ContactListItem/GroupItem/GroupItem.scss +3 -3
- package/src/components/ConversationList/ConversationActions/ConversationActions.scss +2 -12
- package/src/components/ConversationList/ConversationActions/ConversationActions.vue +2 -2
- package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +1 -0
- package/src/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.scss +2 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.vue +2 -2
- package/src/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.scss +2 -1
- package/src/components/ConversationList/ConversationList.scss +0 -5
- package/src/components/ConversationList/ConversationList.vue +15 -41
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.scss +1 -0
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.vue +13 -18
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +11 -9
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.vue +14 -16
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +2 -14
- package/src/components/ConversationList/ConversationPreview/index.ts +1 -1
- package/src/components/ConversationList/ConversationSearch/ConversationSearch.vue +1 -0
- package/src/components/LiveAudienceList/LiveAudienceListH5.vue +2 -2
- package/src/components/LiveCoreView/index.vue +145 -79
- package/src/components/LiveList/LiveList.vue +3 -0
- package/src/components/LiveList/LiveListH5.vue +60 -85
- package/src/components/LiveList/i18n/en-US/index.ts +5 -0
- package/src/components/LiveList/i18n/zh-CN/index.ts +5 -0
- package/src/components/LiveList/pullToRefresh.vue +364 -0
- package/src/components/LiveScenePanel/CameraSettingDialog.vue +6 -5
- package/src/components/LiveScenePanel/index.vue +2 -2
- package/src/components/MessageInput/AttachmentPicker/AttachmentPicker.module.scss +4 -0
- package/src/components/MessageInput/AttachmentPicker/AttachmentPicker.vue +12 -17
- package/src/components/MessageInput/AttachmentPicker/FilePicker.vue +3 -2
- package/src/components/MessageInput/AttachmentPicker/ImagePicker.vue +3 -2
- package/src/components/MessageInput/AttachmentPicker/VideoPicker.vue +3 -2
- package/src/components/MessageInput/EmojiPicker/EmojiPicker.module.scss +1 -0
- package/src/components/MessageInput/MessageInput.vue +21 -15
- package/src/components/MessageInput/TextEditor/Editor.scss +1 -0
- package/src/components/MessageInput/TextEditor/TextEditor.vue +16 -6
- package/src/components/MessageInput/types.d.ts +3 -4
- package/src/components/MessageList/Message/CustomMessage/CustomMessage.vue +1 -1
- package/src/components/MessageList/Message/FaceMessage/FaceMessage.vue +10 -7
- package/src/components/MessageList/Message/LocationMessage/LocationMessage.vue +3 -1
- package/src/components/MessageList/Message/MergerMessage/MergerMessage.vue +1 -1
- package/src/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.vue +2 -2
- package/src/components/MessageList/MessageForward/MessageForward.vue +3 -3
- package/src/components/MessageList/MessageList.vue +17 -5
- package/src/components/MessageList/MessageTimeDivider/MessageTimeDivider.vue +9 -9
- package/src/components/MessageList/index.ts +5 -4
- package/src/components/Search/Search.scss +0 -3
- package/src/components/Search/SearchResults/EmptyResult/EmptyResult.scss +0 -3
- package/src/components/Search/SearchResults/Loading/Loading.scss +0 -3
- package/src/components/Search/SearchResults/SearchResults.scss +7 -16
- package/src/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/Group/Group.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.scss +0 -3
- package/src/components/Search/SearchResults/SearchResultsItem/User/User.scss +5 -6
- package/src/components/StreamMixer/LocalMixer/index.vue +9 -4
- package/src/components/StreamView/manager/mediaManager.ts +1 -1
- package/src/components/UserPicker/UserPicker.vue +6 -9
- package/src/components/UserPicker/components/ListMode/ListMode.vue +3 -7
- package/src/components/UserPicker/components/SelectedPanel/SelectedPanel.vue +2 -2
- package/src/components/UserPicker/components/TreeMode/TreeMode.vue +3 -3
- package/src/components/UserPicker/components/TreeMode/TreeNode.vue +3 -3
- package/src/components/UserPicker/hooks/useSearchFilter.ts +15 -14
- package/src/components/UserPicker/hooks/useSelection.ts +32 -32
- package/src/components/UserPicker/hooks/useTreeState.ts +4 -4
- package/src/components/UserPicker/index.ts +16 -14
- package/src/components/UserPicker/type.ts +18 -18
- package/src/types/contact.ts +13 -12
- package/src/types/conversation.ts +12 -14
- package/src/types/engine.ts +15 -0
- package/src/utils/json.ts +0 -4
- package/dist/AttachmentPicker.module-0_DWsAtr.js +0 -11
- package/dist/FilePicker.vue_vue_type_script_setup_true_lang-CaSj3Gh_.js +0 -72
- package/dist/ImagePicker.vue_vue_type_script_setup_true_lang-CrzGMmrh.js +0 -72
- package/dist/VideoPicker.vue_vue_type_script_setup_true_lang-DTv6TJKr.js +0 -72
- package/dist/states/UIOpenControlState/UIOpenControlState.d.ts +0 -15
- package/dist/states/UIOpenControlState/UIOpenControlState.js +0 -28
- package/dist/states/UIOpenControlState/index.d.ts +0 -1
- package/dist/states/UIOpenControlState/index.js +0 -4
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="[styles['input-wrapper'], props.disabled && styles.disabled]">
|
|
3
3
|
<div :class="styles['input-prefix']">
|
|
4
|
-
<slot name="
|
|
4
|
+
<slot name="inputPrefix" />
|
|
5
5
|
</div>
|
|
6
6
|
<div
|
|
7
|
-
ref="
|
|
7
|
+
ref="editorDomRef"
|
|
8
|
+
:key="props.disabled ? 'disabled' : 'enabled'"
|
|
8
9
|
:class="styles['editor']"
|
|
9
10
|
/>
|
|
10
11
|
<div :class="styles['input-suffix']">
|
|
11
|
-
<slot name="
|
|
12
|
+
<slot name="inputSuffix" />
|
|
12
13
|
</div>
|
|
13
14
|
</div>
|
|
14
15
|
</template>
|
|
@@ -38,7 +39,7 @@ const { t } = useUIKit();
|
|
|
38
39
|
const { activeConversation } = useConversationListState();
|
|
39
40
|
const { updateRawValue, sendMessage, setEditorInstance, setContent } = useMessageInputState();
|
|
40
41
|
|
|
41
|
-
const
|
|
42
|
+
const editorDomRef = ref<HTMLDivElement | null>(null);
|
|
42
43
|
const isFocused = ref(props.autoFocus);
|
|
43
44
|
|
|
44
45
|
const placeholderText = computed(() => (props.disabled ? '' : props.placeholder || t('MessageInput.enter_a_message')));
|
|
@@ -46,7 +47,7 @@ const placeholderText = computed(() => (props.disabled ? '' : props.placeholder
|
|
|
46
47
|
let editorInstance: Editor | null = null;
|
|
47
48
|
|
|
48
49
|
onMounted(() => {
|
|
49
|
-
const element =
|
|
50
|
+
const element = editorDomRef.value;
|
|
50
51
|
if (!element) {
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
@@ -79,7 +80,7 @@ onMounted(() => {
|
|
|
79
80
|
});
|
|
80
81
|
|
|
81
82
|
onUnmounted(() => {
|
|
82
|
-
const element =
|
|
83
|
+
const element = editorDomRef.value;
|
|
83
84
|
if (editorInstance && element) {
|
|
84
85
|
editorInstance.destroy();
|
|
85
86
|
element.removeAttribute('data-editor-created');
|
|
@@ -92,4 +93,13 @@ watch(activeConversation, (newConversation, oldConversation) => {
|
|
|
92
93
|
setContent('');
|
|
93
94
|
}
|
|
94
95
|
});
|
|
96
|
+
|
|
97
|
+
watch(() => props.disabled, (newDisabled) => {
|
|
98
|
+
if (editorInstance) {
|
|
99
|
+
editorInstance.setEditable(!newDisabled);
|
|
100
|
+
if (newDisabled) {
|
|
101
|
+
setContent('');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
95
105
|
</script>
|
|
@@ -20,13 +20,11 @@ export type MessageInputActions = Array<BuiltInAction | CustomAction>;
|
|
|
20
20
|
|
|
21
21
|
export type MessageInputAttachmentPickerMode = 'collapsed' | 'expanded';
|
|
22
22
|
|
|
23
|
-
export interface
|
|
23
|
+
export interface MessageInputProps {
|
|
24
24
|
autoFocus?: boolean;
|
|
25
25
|
disabled?: boolean;
|
|
26
26
|
hideSendButton?: boolean;
|
|
27
27
|
placeholder?: string;
|
|
28
|
-
className?: string;
|
|
29
|
-
style?: CSSProperties;
|
|
30
28
|
attachmentPickerMode?: MessageInputAttachmentPickerMode;
|
|
31
29
|
actions?: MessageInputActions;
|
|
32
30
|
slots?: MessageInputSlots;
|
|
@@ -39,4 +37,5 @@ export interface MessageInputSlots {
|
|
|
39
37
|
rightInline?: () => VNode[];
|
|
40
38
|
inputPrefix?: () => VNode[];
|
|
41
39
|
inputSuffix?: () => VNode[];
|
|
42
|
-
|
|
40
|
+
textEditor?: () => VNode[];
|
|
41
|
+
}
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
<script lang="ts" setup>
|
|
11
11
|
import cs from 'classnames';
|
|
12
|
-
import type {
|
|
12
|
+
import type { MessageModel } from '../../../../types/engine';
|
|
13
13
|
|
|
14
|
-
interface
|
|
15
|
-
message:
|
|
14
|
+
interface FaceMessageProps {
|
|
15
|
+
message: MessageModel;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
interface
|
|
18
|
+
interface FaceMessageContent {
|
|
19
19
|
/** sender show name */
|
|
20
20
|
showName: string;
|
|
21
21
|
/** face image name [yz00@2x] */
|
|
@@ -26,11 +26,14 @@ interface IFaceMessageContent {
|
|
|
26
26
|
url: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const props = withDefaults(defineProps<
|
|
30
|
-
message: () => ({} as
|
|
29
|
+
const props = withDefaults(defineProps<FaceMessageProps>(), {
|
|
30
|
+
message: () => ({} as MessageModel),
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
const messageContent =
|
|
33
|
+
const messageContent = {
|
|
34
|
+
url: 'https://web.sdk.qcloud.com/im/assets/face-elem/yz13@2x.png',
|
|
35
|
+
name: 'yz13@2x',
|
|
36
|
+
};
|
|
34
37
|
</script>
|
|
35
38
|
|
|
36
39
|
<style lang="scss" scoped>
|
|
@@ -14,12 +14,12 @@ import classes from './MessageActionDropdown.module.scss';
|
|
|
14
14
|
import type { MessageAction } from '../../../../../hooks/useMessageActions';
|
|
15
15
|
import type { IMessageModel as MessageModel } from '@tencentcloud/chat-uikit-engine';
|
|
16
16
|
|
|
17
|
-
interface
|
|
17
|
+
interface MessageActionDropdownProps {
|
|
18
18
|
message: MessageModel;
|
|
19
19
|
messageActionList?: MessageAction[] | undefined;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const props = withDefaults(defineProps<
|
|
22
|
+
const props = withDefaults(defineProps<MessageActionDropdownProps>(), {
|
|
23
23
|
messageActionList: undefined,
|
|
24
24
|
message: () => ({}) as MessageModel,
|
|
25
25
|
});
|
|
@@ -8,7 +8,7 @@ import { View } from '../../../baseComp/View';
|
|
|
8
8
|
import { useConversationListState } from '../../../states/ConversationListState';
|
|
9
9
|
import { useMessageActionState } from '../../../states/MessageActionState';
|
|
10
10
|
import { UserPicker } from '../../UserPicker';
|
|
11
|
-
import type {
|
|
11
|
+
import type { UserPickerRef, UserPickerRow } from '../../UserPicker/type';
|
|
12
12
|
import type { IConversationModel } from '@tencentcloud/chat-uikit-engine';
|
|
13
13
|
|
|
14
14
|
const { t } = useUIKit();
|
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
} = useConversationListState();
|
|
25
25
|
|
|
26
26
|
// UserPicker ref
|
|
27
|
-
const userPickerRef = ref<
|
|
27
|
+
const userPickerRef = ref<UserPickerRef<undefined> | null>(null);
|
|
28
28
|
|
|
29
29
|
// Convert conversation list to UserPicker data format
|
|
30
30
|
const forwardListDataSource = computed((): any[] => {
|
|
@@ -34,7 +34,7 @@ const forwardListDataSource = computed((): any[] => {
|
|
|
34
34
|
|
|
35
35
|
return conversationList.value.map((conversation: IConversationModel) => {
|
|
36
36
|
const { type, remark, groupProfile, userProfile } = conversation;
|
|
37
|
-
const userPickerRow:
|
|
37
|
+
const userPickerRow: UserPickerRow<undefined> = {
|
|
38
38
|
key: conversation.conversationID,
|
|
39
39
|
label: '',
|
|
40
40
|
avatarUrl: conversation.getAvatar() || '',
|
|
@@ -77,6 +77,7 @@ const {
|
|
|
77
77
|
activeConversationID,
|
|
78
78
|
isDisableScroll,
|
|
79
79
|
setIsDisableScroll,
|
|
80
|
+
setEnableReadReceipt,
|
|
80
81
|
} = useMessageListState();
|
|
81
82
|
|
|
82
83
|
const { scrollToBottom } = useScroll();
|
|
@@ -109,13 +110,18 @@ const messageChunks = computed(() => {
|
|
|
109
110
|
|
|
110
111
|
filteredMessageList.forEach((message, index, messages) => {
|
|
111
112
|
const messageTime = message.time;
|
|
112
|
-
const lastChunk = chunks[chunks.length - 1];
|
|
113
|
+
const lastChunk = chunks.length > 0 ? chunks[chunks.length - 1] : undefined;
|
|
114
|
+
const lastMessage = index > 0 ? messages[index - 1] : undefined;
|
|
113
115
|
|
|
114
116
|
const shouldCreateNewChunk = !lastChunk
|
|
115
117
|
|| messageTime - lastChunk.timestamp > MAX_TIME_BETWEEN_MESSAGE_GROUP
|
|
116
118
|
|| lastChunk.messages[0].from !== message.from
|
|
117
119
|
|| message.isRevoked
|
|
118
|
-
|| (
|
|
120
|
+
|| (lastMessage && lastMessage.isRevoked)
|
|
121
|
+
|| message.status === 'fail'
|
|
122
|
+
|| (lastMessage && lastMessage.status === 'fail')
|
|
123
|
+
|| message.hasRiskContent
|
|
124
|
+
|| (lastMessage && lastMessage.hasRiskContent);
|
|
119
125
|
|
|
120
126
|
if (shouldCreateNewChunk) {
|
|
121
127
|
chunks.push({
|
|
@@ -239,6 +245,12 @@ watch(messageList, (newMessages, oldMessages) => {
|
|
|
239
245
|
}
|
|
240
246
|
});
|
|
241
247
|
|
|
248
|
+
watch(() => props.enableReadReceipt, (newEnableReadReceipt) => {
|
|
249
|
+
setEnableReadReceipt(newEnableReadReceipt);
|
|
250
|
+
}, {
|
|
251
|
+
immediate: true,
|
|
252
|
+
});
|
|
253
|
+
|
|
242
254
|
onMounted(() => {
|
|
243
255
|
if (scrollContainer.value) {
|
|
244
256
|
scrollContainer.value.addEventListener('scroll', handleScroll);
|
|
@@ -277,8 +289,8 @@ onUnmounted(() => {
|
|
|
277
289
|
<!-- Time Divider -->
|
|
278
290
|
<component
|
|
279
291
|
:is="props.MessageTimeDivider || DefaultMessageTimeDivider"
|
|
280
|
-
:
|
|
281
|
-
:
|
|
292
|
+
:previousMessage="chunkIndex > 0 ? messageChunks[chunkIndex-1].messages[0] : undefined"
|
|
293
|
+
:currentMessage="chunk.messages[0]"
|
|
282
294
|
/>
|
|
283
295
|
|
|
284
296
|
<!-- Message Chunk -->
|
|
@@ -392,7 +404,7 @@ onUnmounted(() => {
|
|
|
392
404
|
|
|
393
405
|
.scroll-to-bottom {
|
|
394
406
|
position: absolute;
|
|
395
|
-
bottom:
|
|
407
|
+
bottom: 95px;
|
|
396
408
|
right: 8px;
|
|
397
409
|
}
|
|
398
410
|
</style>
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { h, computed, Fragment } from 'vue';
|
|
3
3
|
import { getTimeStampAuto } from '../../../utils/time';
|
|
4
|
-
import type {
|
|
4
|
+
import type { MessageModel } from '../../../types';
|
|
5
5
|
|
|
6
|
-
interface
|
|
7
|
-
previousMessage:
|
|
8
|
-
|
|
6
|
+
interface MessageTimeDividerProps {
|
|
7
|
+
previousMessage: MessageModel | undefined;
|
|
8
|
+
currentMessage: MessageModel;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const props = withDefaults(defineProps<
|
|
11
|
+
const props = withDefaults(defineProps<MessageTimeDividerProps>(), {
|
|
12
12
|
previousMessage: undefined,
|
|
13
|
-
|
|
13
|
+
currentMessage: () => ({}) as MessageModel,
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
const shouldShowTimeDivider = computed(() => {
|
|
17
|
-
if (!props.
|
|
17
|
+
if (!props.currentMessage?.time) {
|
|
18
18
|
return false;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const prevTime = props.previousMessage?.time || 0;
|
|
22
|
-
const currentTime = props.
|
|
22
|
+
const currentTime = props.currentMessage.time;
|
|
23
23
|
|
|
24
24
|
return currentTime - prevTime > 5 * 60;
|
|
25
25
|
});
|
|
@@ -29,7 +29,7 @@ const renderDefaultContent = () => {
|
|
|
29
29
|
return h(Fragment, null, []);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const currentTime = props.
|
|
32
|
+
const currentTime = props.currentMessage.time;
|
|
33
33
|
|
|
34
34
|
return h('div', { class: 'message-time-divider' }, [
|
|
35
35
|
h('span', {}, getTimeStampAuto(currentTime * 1000)),
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Message } from './Message';
|
|
2
|
-
import
|
|
3
|
-
import MessageList from './MessageList.vue';
|
|
1
|
+
import { Message as MessageComponent } from './Message';
|
|
2
|
+
import MessageListComponent from './MessageList.vue';
|
|
4
3
|
import { addI18n } from '../../i18n';
|
|
5
4
|
import { resources } from './i18n';
|
|
6
5
|
|
|
7
6
|
addI18n('en-US', { translation: { MessageList: resources['en-US'] } });
|
|
8
7
|
addI18n('zh-CN', { translation: { MessageList: resources['zh-CN'] } });
|
|
9
8
|
|
|
9
|
+
const Message = MessageComponent;
|
|
10
|
+
const MessageList = MessageListComponent;
|
|
11
|
+
|
|
10
12
|
export {
|
|
11
13
|
Message,
|
|
12
14
|
MessageList,
|
|
13
|
-
MessageActionDropdown,
|
|
14
15
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use "@tencentcloud/uikit-base-component-vue3/src/providers/UIKitProvider/styles/variables.scss" as *;
|
|
3
|
-
|
|
1
|
+
@use '../../../styles/mixins' as mixins;
|
|
4
2
|
.SearchResults {
|
|
5
3
|
flex: 1;
|
|
6
4
|
overflow: hidden;
|
|
@@ -64,11 +62,8 @@
|
|
|
64
62
|
display: flex;
|
|
65
63
|
flex-direction: column;
|
|
66
64
|
gap: 8px;
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
&::-webkit-scrollbar {
|
|
70
|
-
display: none;
|
|
71
|
-
}
|
|
65
|
+
|
|
66
|
+
@include mixins.scrollbar-hidden();
|
|
72
67
|
}
|
|
73
68
|
|
|
74
69
|
.SearchResults__error {
|
|
@@ -155,19 +150,15 @@
|
|
|
155
150
|
text-align: center;
|
|
156
151
|
margin: 0;
|
|
157
152
|
padding: 0 12px;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
text-overflow: ellipsis;
|
|
153
|
+
|
|
154
|
+
@include mixins.text-ellipsis();
|
|
161
155
|
}
|
|
162
156
|
|
|
163
157
|
.SearchResults__message-detail-content {
|
|
164
158
|
flex: 1;
|
|
165
159
|
overflow-y: auto;
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
&::-webkit-scrollbar {
|
|
169
|
-
display: none;
|
|
170
|
-
}
|
|
160
|
+
|
|
161
|
+
@include mixins.scrollbar-hidden();
|
|
171
162
|
}
|
|
172
163
|
|
|
173
164
|
.SearchResults__result-section {
|
package/src/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.scss
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use "@tencentcloud/uikit-base-component-vue3/src/providers/UIKitProvider/styles/variables.scss" as *;
|
|
3
|
-
|
|
1
|
+
@use '../../../../../styles/mixins' as mixins;
|
|
4
2
|
.conversationItem {
|
|
5
3
|
display: flex;
|
|
6
4
|
align-items: flex-start;
|
|
@@ -28,20 +26,16 @@
|
|
|
28
26
|
.name {
|
|
29
27
|
font-weight: 500;
|
|
30
28
|
font-size: 14px;
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
text-overflow: ellipsis;
|
|
33
|
-
white-space: nowrap;
|
|
34
29
|
color: var(--text-color-primary);
|
|
30
|
+
|
|
31
|
+
@include mixins.text-ellipsis();
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
.showText {
|
|
38
35
|
font-size: 12px;
|
|
39
36
|
line-height: 1.5;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
text-overflow: ellipsis;
|
|
42
|
-
display: -webkit-box;
|
|
43
|
-
-webkit-line-clamp: 3;
|
|
44
|
-
-webkit-box-orient: vertical;
|
|
45
37
|
word-break: break-word;
|
|
46
38
|
color: var(--text-color-secondary);
|
|
39
|
+
|
|
40
|
+
@include mixins.multi-line-ellipsis(3);
|
|
47
41
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use "@tencentcloud/uikit-base-component-vue3/src/providers/UIKitProvider/styles/variables.scss" as *;
|
|
3
|
-
|
|
1
|
+
@use '../../../../../styles/mixins' as mixins;
|
|
4
2
|
.SearchGroup {
|
|
5
3
|
display: flex;
|
|
6
4
|
align-items: flex-start;
|
|
@@ -27,22 +25,18 @@
|
|
|
27
25
|
font-weight: 500;
|
|
28
26
|
font-size: 14px;
|
|
29
27
|
margin-bottom: 4px;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
text-overflow: ellipsis;
|
|
32
|
-
white-space: nowrap;
|
|
33
28
|
color: var(--text-color-primary);
|
|
29
|
+
|
|
30
|
+
@include mixins.text-ellipsis();
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
.SearchGroup__intro {
|
|
37
34
|
font-size: 12px;
|
|
38
35
|
line-height: 1.5;
|
|
39
|
-
overflow: hidden;
|
|
40
|
-
text-overflow: ellipsis;
|
|
41
|
-
display: -webkit-box;
|
|
42
|
-
-webkit-line-clamp: 3;
|
|
43
|
-
-webkit-box-orient: vertical;
|
|
44
36
|
word-break: break-word;
|
|
45
37
|
color: var(--text-color-secondary);
|
|
38
|
+
|
|
39
|
+
@include mixins.multi-line-ellipsis(3);
|
|
46
40
|
}
|
|
47
41
|
|
|
48
42
|
:global(.SearchGroup__highlight) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use "@tencentcloud/uikit-base-component-vue3/src/providers/UIKitProvider/styles/variables.scss" as *;
|
|
3
|
-
|
|
1
|
+
@use '../../../../../styles/mixins' as mixins;
|
|
4
2
|
.SearchMessage {
|
|
5
3
|
display: flex;
|
|
6
4
|
align-items: flex-start;
|
|
@@ -35,10 +33,9 @@
|
|
|
35
33
|
.SearchMessage__name {
|
|
36
34
|
font-weight: 500;
|
|
37
35
|
font-size: 14px;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
text-overflow: ellipsis;
|
|
40
|
-
white-space: nowrap;
|
|
41
36
|
color: var(--text-color-primary);
|
|
37
|
+
|
|
38
|
+
@include mixins.text-ellipsis();
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
.SearchMessage__time {
|
|
@@ -85,13 +82,10 @@
|
|
|
85
82
|
.SearchMessage__text {
|
|
86
83
|
font-size: 12px;
|
|
87
84
|
line-height: 1.5;
|
|
88
|
-
overflow: hidden;
|
|
89
|
-
text-overflow: ellipsis;
|
|
90
|
-
display: -webkit-box;
|
|
91
|
-
-webkit-line-clamp: 3;
|
|
92
|
-
-webkit-box-orient: vertical;
|
|
93
85
|
word-break: break-word;
|
|
94
86
|
color: var(--text-color-primary);
|
|
87
|
+
|
|
88
|
+
@include mixins.multi-line-ellipsis(3);
|
|
95
89
|
}
|
|
96
90
|
|
|
97
91
|
.SearchMessage__emoji-img {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use "@tencentcloud/uikit-base-component-vue3/src/providers/UIKitProvider/styles/variables.scss" as *;
|
|
3
|
-
|
|
1
|
+
@use '../../../../../styles/mixins' as mixins;
|
|
4
2
|
.SearchUser {
|
|
5
3
|
display: flex;
|
|
6
4
|
align-items: flex-start;
|
|
@@ -26,10 +24,9 @@
|
|
|
26
24
|
font-weight: 500;
|
|
27
25
|
font-size: 14px;
|
|
28
26
|
margin-bottom: 4px;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
text-overflow: ellipsis;
|
|
31
|
-
white-space: nowrap;
|
|
32
27
|
color: var(--text-color-primary);
|
|
28
|
+
|
|
29
|
+
@include mixins.text-ellipsis();
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
.SearchUser__signature {
|
|
@@ -42,6 +39,8 @@
|
|
|
42
39
|
-webkit-box-orient: vertical;
|
|
43
40
|
word-break: break-word;
|
|
44
41
|
color: var(--text-color-secondary);
|
|
42
|
+
|
|
43
|
+
@include mixins.multi-line-ellipsis(3);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
:global(.SearchUser__highlight) {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
<script setup lang="ts">
|
|
26
26
|
import type { Ref } from 'vue';
|
|
27
|
-
import { ref, onMounted, watch,
|
|
27
|
+
import { ref, onMounted, watch, onBeforeUnmount, computed, nextTick } from 'vue';
|
|
28
28
|
import TUIRoomEngine, {
|
|
29
29
|
TRTCVideoResolutionMode,
|
|
30
30
|
TRTCVideoRotation,
|
|
@@ -213,20 +213,25 @@ onMounted(() => {
|
|
|
213
213
|
re.observe(localMixerRef.value);
|
|
214
214
|
TUIRoomEngine.once('ready', async () => {
|
|
215
215
|
const mediaSourceManager = roomEngine.instance?.getTRTCCloud().getMediaMixingManager();
|
|
216
|
-
await mediaSourceManager.
|
|
216
|
+
await mediaSourceManager.bindPreviewArea(document.getElementById('local-video-mixer') as HTMLElement);
|
|
217
217
|
getMixControlStyle();
|
|
218
218
|
});
|
|
219
219
|
|
|
220
220
|
watch(localLiveStatus, async (newVal) => {
|
|
221
|
+
const mediaSourceManager = roomEngine.instance?.getTRTCCloud().getMediaMixingManager();
|
|
221
222
|
if (newVal === LiveStatus.Live) {
|
|
222
|
-
const mediaSourceManager = roomEngine.instance?.getTRTCCloud().getMediaMixingManager();
|
|
223
223
|
await mediaSourceManager?.startPublish();
|
|
224
224
|
}
|
|
225
|
+
if (newVal === LiveStatus.IDLE) {
|
|
226
|
+
await mediaSourceManager?.stopPublish();
|
|
227
|
+
}
|
|
225
228
|
});
|
|
226
229
|
});
|
|
227
230
|
|
|
228
|
-
|
|
231
|
+
onBeforeUnmount(async () => {
|
|
229
232
|
re.unobserve(localMixerRef.value);
|
|
233
|
+
const mediaSourceManager = roomEngine.instance?.getTRTCCloud().getMediaMixingManager();
|
|
234
|
+
await mediaSourceManager?.destroy();
|
|
230
235
|
});
|
|
231
236
|
</script>
|
|
232
237
|
|
|
@@ -250,7 +250,7 @@ export class MediaManager {
|
|
|
250
250
|
if (streamType === TUIVideoStreamType.kCameraStream) {
|
|
251
251
|
if (isVideoMixerEnabled.value) {
|
|
252
252
|
const mediaSourceManager = roomEngine.instance?.getTRTCCloud().getMediaMixingManager();
|
|
253
|
-
mediaSourceManager.
|
|
253
|
+
mediaSourceManager.bindPreviewArea(document.getElementById(viewIdList[0]) as HTMLElement);
|
|
254
254
|
// const publishParams = {
|
|
255
255
|
// videoEncoderParams: {
|
|
256
256
|
// videoResolution: TRTCVideoResolution.TRTCVideoResolution_1280_720,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
<ListMode
|
|
23
23
|
v-else-if="!isTreeMode"
|
|
24
|
-
:data-source="searchManager.filteredData.value as
|
|
24
|
+
:data-source="searchManager.filteredData.value as UserPickerRow<any>[]"
|
|
25
25
|
:selected-keys="selectionManager.selectedKeys.value"
|
|
26
26
|
:locked-keys="selectionManager.lockedKeys.value"
|
|
27
27
|
:on-item-click="selectionManager.toggle"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
/>
|
|
31
31
|
<TreeMode
|
|
32
32
|
v-else
|
|
33
|
-
:data-source="searchManager.filteredData.value as
|
|
33
|
+
:data-source="searchManager.filteredData.value as UserPickerNode<any>[]"
|
|
34
34
|
:selected-keys="selectionManager.selectedKeys.value"
|
|
35
35
|
:half-selected-keys="selectionManager.halfSelectedKeys.value"
|
|
36
36
|
:locked-keys="selectionManager.lockedKeys.value"
|
|
@@ -64,10 +64,7 @@ import TreeMode from './components/TreeMode';
|
|
|
64
64
|
import { useSearchFilter } from './hooks/useSearchFilter';
|
|
65
65
|
import { useSelection } from './hooks/useSelection';
|
|
66
66
|
import { useTreeState } from './hooks/useTreeState';
|
|
67
|
-
import type {
|
|
68
|
-
|
|
69
|
-
// Define type for props (without generics for Vue3 compatibility)
|
|
70
|
-
type UserPickerProps = IUserPickerProps<any>;
|
|
67
|
+
import type { UserPickerProps, UserPickerRef, UserPickerNode, UserPickerRow } from './type';
|
|
71
68
|
|
|
72
69
|
const props = withDefaults(defineProps<UserPickerProps>(), {
|
|
73
70
|
dataSource: () => [],
|
|
@@ -129,7 +126,7 @@ watch(
|
|
|
129
126
|
);
|
|
130
127
|
|
|
131
128
|
// Generic node update function - can update any properties of a node
|
|
132
|
-
const updateNodeByKey = (nodeKey: string, partialNode: Partial<
|
|
129
|
+
const updateNodeByKey = (nodeKey: string, partialNode: Partial<UserPickerNode<any>>) => {
|
|
133
130
|
if (!isTreeMode.value) {
|
|
134
131
|
return;
|
|
135
132
|
}
|
|
@@ -187,7 +184,7 @@ const updateNodeByKey = (nodeKey: string, partialNode: Partial<IUserPickerNode<a
|
|
|
187
184
|
};
|
|
188
185
|
|
|
189
186
|
// Implement methods exposed by ref
|
|
190
|
-
const refMethods:
|
|
187
|
+
const refMethods: UserPickerRef<any> = {
|
|
191
188
|
getSelectedItems: () => selectionManager.getSelectedItems(),
|
|
192
189
|
updateListData: (newDataSource: any[]) => {
|
|
193
190
|
// Update list data
|
|
@@ -195,7 +192,7 @@ const refMethods: IUserPickerRef<any> = {
|
|
|
195
192
|
internalDataSource.value = newDataSource;
|
|
196
193
|
}
|
|
197
194
|
},
|
|
198
|
-
updateTreeData: (nodeKey: string, partialNode: Partial<
|
|
195
|
+
updateTreeData: (nodeKey: string, partialNode: Partial<UserPickerNode<any>>) => {
|
|
199
196
|
// Use generic update function
|
|
200
197
|
updateNodeByKey(nodeKey, partialNode);
|
|
201
198
|
},
|
|
@@ -27,10 +27,7 @@
|
|
|
27
27
|
<!-- Checkbox -->
|
|
28
28
|
<div :class="$style['list__checkbox-wrapper']">
|
|
29
29
|
<div :class="[$style.list__checkbox, { [$style['list__checkbox--checked']]: isSelected(item.key) }]">
|
|
30
|
-
<IconCheckSm
|
|
31
|
-
v-if="isSelected(item.key)"
|
|
32
|
-
name="check"
|
|
33
|
-
/>
|
|
30
|
+
<IconCheckSm v-if="isSelected(item.key)" />
|
|
34
31
|
</div>
|
|
35
32
|
</div>
|
|
36
33
|
|
|
@@ -61,10 +58,10 @@
|
|
|
61
58
|
import { defineProps } from 'vue';
|
|
62
59
|
import { useUIKit, IconCheckSm } from '@tencentcloud/uikit-base-component-vue3';
|
|
63
60
|
import { Avatar } from '../../../Avatar';
|
|
64
|
-
import type {
|
|
61
|
+
import type { UserPickerRow } from '../../type';
|
|
65
62
|
|
|
66
63
|
interface ListModeProps<T = unknown> {
|
|
67
|
-
dataSource:
|
|
64
|
+
dataSource: UserPickerRow<T>[];
|
|
68
65
|
selectedKeys: Set<string>;
|
|
69
66
|
lockedKeys: Set<string>;
|
|
70
67
|
onItemClick: (key: string) => void;
|
|
@@ -150,7 +147,6 @@ const handleScroll = (e: Event) => {
|
|
|
150
147
|
align-items: center;
|
|
151
148
|
justify-content: center;
|
|
152
149
|
transition: all 0.3s;
|
|
153
|
-
color: #fff;
|
|
154
150
|
border: 2px solid #d9d9d9;
|
|
155
151
|
|
|
156
152
|
&--checked {
|