@tencent-rtc/mcp 1.3.4 → 1.3.6
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/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/resource/doc/chatuikit/android/features/theme.md +363 -0
- package/resource/doc/chatuikit/{android/client_api_Android.md → faq/android_sdk/client-api.md} +0 -2
- package/resource/doc/chatuikit/faq/common/product.md +8 -0
- package/resource/doc/chatuikit/faq/flutter_sdk/faq.md +53 -0
- package/resource/doc/chatuikit/{iOS/client_api_iOS.md → faq/ios_sdk/client-api.md} +0 -2
- package/resource/doc/chatuikit/flutter/features/theme.md +379 -0
- package/resource/doc/chatuikit/flutter/integration.md +413 -0
- package/resource/doc/chatuikit/flutter/workflow.md +941 -0
- package/resource/doc/chatuikit/iOS/features/theme.md +416 -0
- package/resource/doc/chatuikit/react/components/chat-setting.md +86 -0
- package/resource/doc/chatuikit/react/components/contact-list.md +1093 -0
- package/resource/doc/chatuikit/react/components/search.md +745 -0
- package/resource/doc/chatuikit/vue/components/chat-setting.md +64 -0
- package/resource/doc/chatuikit/vue/components/contact-list.md +679 -0
- package/resource/doc/chatuikit/vue/components/search.md +1384 -0
- package/resource/doc/livekit/live/android/workflow.md +137 -6
- package/resource/doc/livekit/live/ios/live-audience-list.md +339 -0
- package/resource/doc/livekit/live/ios/live-audio-effect.md +370 -0
- package/resource/doc/livekit/live/ios/live-barrage.md +517 -0
- package/resource/doc/livekit/live/ios/live-base-beauty.md +247 -0
- package/resource/doc/livekit/live/ios/live-co-guest-interaction.md +518 -0
- package/resource/doc/livekit/live/ios/live-gift.md +783 -0
- package/resource/doc/livekit/live/ios/live-host-interaction.md +815 -0
- package/resource/doc/livekit/live/ios/live-integration.md +931 -0
- package/resource/doc/livekit/live/ios/live-live-list.md +485 -0
- package/resource/doc/livekit/live/ios/workflow.md +454 -0
- package/resource/doc/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +87 -0
- package/resource/doc/rtcengine/web/plugin/21-advanced-auto-play-policy.md +87 -0
- package/resource/doc/rtcengine/web/plugin/22-advanced-audio-mixer.md +175 -0
- package/resource/doc/rtcengine/web/plugin/23-advanced-support-detection.md +221 -0
- package/resource/doc/rtcengine/web/plugin/24-advanced-network-quality.md +140 -0
- package/resource/doc/rtcengine/web/plugin/25-advanced-device-change.md +99 -0
- package/resource/doc/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +451 -0
- package/resource/doc/rtcengine/web/plugin/27-advanced-small-stream.md +151 -0
- package/resource/doc/rtcengine/web/plugin/28-advanced-beauty.md +322 -0
- package/resource/doc/rtcengine/web/plugin/29-advanced-water-mark.md +149 -0
- package/resource/doc/rtcengine/web/plugin/30-advanced-cross-room-link.md +96 -0
- package/resource/doc/rtcengine/web/plugin/31-advanced-plugins-overview.md +330 -0
- package/resource/doc/rtcengine/web/plugin/34-advanced-proxy.md +248 -0
- package/resource/doc/rtcengine/web/plugin/35-advanced-ai-denoiser.md +81 -0
- package/resource/doc/rtcengine/web/plugin/36-advanced-virtual-background.md +242 -0
- package/resource/doc/rtcengine/web/plugin/37-advanced-voice-changer.md +99 -0
- package/resource/doc/rtcengine/web/plugin/39-advanced-video-decoder.md +33 -0
- package/resource/doc/rtcengine/web/plugin/40-advanced-video-mixer.md +379 -0
- package/resource/doc/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +91 -0
- package/resource/doc/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +315 -0
- package/resource/doc/rtcengine/web/plugin/43-advanced-face-detection.md +180 -0
- package/resource/doc/tuicallkit/android/workflow.md +0 -0
- package/resource/doc/tuicallkit/flutter/workflow.md +331 -0
- package/tools/call/get-native-call-integration.js +27 -11
- package/tools/call/get-native-call-integration.js.map +1 -1
- package/tools/chat/get-native-chat-feature-detail.js +30 -0
- package/tools/chat/get-native-chat-feature-detail.js.map +1 -0
- package/tools/chat/get-native-chat-integration.js +30 -12
- package/tools/chat/get-native-chat-integration.js.map +1 -1
- package/tools/common/get-faq.js +2 -4
- package/tools/common/get-faq.js.map +1 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js +17 -7
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_chat_feature_detail_def.js +32 -0
- package/tools/definitions/get_native_chat_feature_detail_def.js.map +1 -0
- package/tools/definitions/get_native_chat_uikit_integration_def.js +19 -7
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/{get_native_live_extra_features_def.js → get_native_live_uikit_extra_features_def.js} +3 -3
- package/tools/definitions/get_native_live_uikit_extra_features_def.js.map +1 -0
- package/tools/definitions/{get_native_live_interaction_def.js → get_native_live_uikit_interaction_def.js} +3 -3
- package/tools/definitions/get_native_live_uikit_interaction_def.js.map +1 -0
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +49 -10
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -1
- package/tools/index.js +6 -4
- package/tools/index.js.map +1 -1
- package/tools/live/{get_native_live_extra_features.js → get_native_live_uikit_extra_features.js} +4 -4
- package/tools/live/get_native_live_uikit_extra_features.js.map +1 -0
- package/tools/live/{get_native_live_interaction.js → get_native_live_uikit_interaction.js} +4 -4
- package/tools/live/get_native_live_uikit_interaction.js.map +1 -0
- package/tools/rtcengine/get-rtcengine-web-sdk-integration.js.map +1 -1
- package/tools/rtcengine/get-trtc-sdk-faq.js +32 -0
- package/tools/rtcengine/get-trtc-sdk-faq.js.map +1 -0
- package/tools/rtcengine/get-trtc-web-sdk-faq.js +1 -1
- package/tools/rtcengine/get-trtc-web-sdk-integration.js.map +1 -1
- package/tools/rtcengine/get-trtc-web-sdk-plugin.js +45 -0
- package/tools/rtcengine/get-trtc-web-sdk-plugin.js.map +1 -0
- package/utils/handle-component-name.js +0 -16
- package/utils/handle-component-name.js.map +1 -1
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/doc/chatuikit/android/generate_UserSig.md +0 -306
- package/resource/doc/chatuikit/android/integrarte_only_tuichat_Android.md +0 -290
- package/resource/doc/chatuikit/android/quick_start_Android.md +0 -138
- package/resource/doc/chatuikit/android/show_typing_Android.md +0 -43
- package/resource/doc/chatuikit/flutter/generate_UserSig.md +0 -306
- package/resource/doc/chatuikit/flutter/integrate_tuikit_Flutter.md +0 -133
- package/resource/doc/chatuikit/iOS/generate_UserSig.md +0 -306
- package/resource/doc/chatuikit/iOS/integrate_only_tuichat_iOS.md +0 -748
- package/resource/doc/chatuikit/iOS/quick_start_iOS.md +0 -163
- package/resource/doc/chatuikit/iOS/show_typing_iOS.md +0 -52
- package/resource/doc/tuicallkit/flutter/how_to_run_flutter_callkit_demo.md +0 -101
- package/resource/doc/tuicallkit/iOS/how_to_run_iOS_callkit_demo.md +0 -98
- package/tools/definitions/get_native_live_extra_features_def.js.map +0 -1
- package/tools/definitions/get_native_live_interaction_def.js.map +0 -1
- package/tools/live/get_native_live_extra_features.js.map +0 -1
- package/tools/live/get_native_live_interaction.js.map +0 -1
- /package/resource/doc/chatuikit/android/{integrate_tuikit_Android.md → integration.md} +0 -0
- /package/resource/doc/chatuikit/{faq/native_sdk/faq.md → android/workflow.md} +0 -0
- /package/resource/doc/chatuikit/{flutter/client_api_Flutter.md → faq/flutter_sdk/client-api.md} +0 -0
- /package/resource/doc/chatuikit/iOS/{integrate_tuikit_iOS.md → integration.md} +0 -0
- /package/resource/doc/{tuicallkit/android/.gitkeep → chatuikit/iOS/workflow.md} +0 -0
- /package/resource/doc/chatuikit/react/components/{chatheader.md → chat-header.md} +0 -0
- /package/resource/doc/chatuikit/vue/components/{chatheader.md → chat-header.md} +0 -0
- /package/resource/doc/tuicallkit/android/{how_to_integrated_android_callkit.md → integration.md} +0 -0
- /package/resource/doc/tuicallkit/{android/api_TUICallObserver.md → faq/android_sdk/call-observer-api.md} +0 -0
- /package/resource/doc/tuicallkit/{android/api_TUICallKit.md → faq/android_sdk/callkit-api.md} +0 -0
- /package/resource/doc/tuicallkit/{flutter/api_TUICallDefine.md → faq/flutter_sdk/call-define-api.md} +0 -0
- /package/resource/doc/tuicallkit/{flutter/api_TUICallObserver.md → faq/flutter_sdk/call-observer-api.md} +0 -0
- /package/resource/doc/tuicallkit/{flutter/api_TUICallKit.md → faq/flutter_sdk/callkit-api.md} +0 -0
- /package/resource/doc/tuicallkit/{iOS/api_TUICallObserver.md → faq/ios_sdk/call-observer-api.md} +0 -0
- /package/resource/doc/tuicallkit/{iOS/api_TUICallKit.md → faq/ios_sdk/callkit-api.md} +0 -0
- /package/resource/doc/tuicallkit/flutter/{how_to_integrated_flutter_callkit.md → integration.md} +0 -0
- /package/resource/doc/tuicallkit/iOS/{how_to_integrated_iOS_callkit.md → integration.md} +0 -0
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
## Component Overview
|
|
2
|
+
|
|
3
|
+
Search is a complete search solution with a full set of components, including search bar, result display, advanced search, and other features. It is suitable for user, group, and message search in instant messaging, online meeting, and online education scenarios.
|
|
4
|
+
|
|
5
|
+
> **Note:**
|
|
6
|
+
>
|
|
7
|
+
|
|
8
|
+
> Note: This feature belongs to VAS. You need to purchase cloud search plugin. Please click [purchase](https://console.trtc.io/chat/plugin/TUICloudSearch).
|
|
9
|
+
>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Component Architecture
|
|
16
|
+
``` bash
|
|
17
|
+
Search (main component)
|
|
18
|
+
├── SearchBar # Search bar component
|
|
19
|
+
├── SearchResults # Search result component
|
|
20
|
+
├── SearchAdvanced # Advanced search component
|
|
21
|
+
└── SearchResultsItem # Search result item component
|
|
22
|
+
├── User # User result item
|
|
23
|
+
├── Group # Group result item
|
|
24
|
+
├── Message # Message result item
|
|
25
|
+
└── Conversation # Session result item
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Search Mode
|
|
29
|
+
<table>
|
|
30
|
+
<tr>
|
|
31
|
+
<td rowspan="1" colSpan="1" >**Mini Mode**</td>
|
|
32
|
+
|
|
33
|
+
<td rowspan="1" colSpan="1" >**Standard Mode**</td>
|
|
34
|
+
|
|
35
|
+
<td rowspan="1" colSpan="1" >**Embedded Mode**</td>
|
|
36
|
+
</tr>
|
|
37
|
+
|
|
38
|
+
<tr>
|
|
39
|
+
<td rowspan="1" colSpan="1" >- Suitable for sidebar or small container<br>- Display finite number of results<br>- Support expand to view more</td>
|
|
40
|
+
|
|
41
|
+
<td rowspan="1" colSpan="1" >- Suitable for full-screen search UI<br>- Feature demonstration<br>- Advanced Search Support</td>
|
|
42
|
+
|
|
43
|
+
<td rowspan="1" colSpan="1" >- Suitable for chat UI<br>- Focus on message search<br>- Optimized layout</td>
|
|
44
|
+
</tr>
|
|
45
|
+
|
|
46
|
+
<tr>
|
|
47
|
+
<td rowspan="1" colSpan="1" ><br></td>
|
|
48
|
+
|
|
49
|
+
<td rowspan="1" colSpan="1" ><br></td>
|
|
50
|
+
|
|
51
|
+
<td rowspan="1" colSpan="1" ><br></td>
|
|
52
|
+
</tr>
|
|
53
|
+
</table>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Props
|
|
57
|
+
<table>
|
|
58
|
+
<tr>
|
|
59
|
+
<td rowspan="1" colSpan="1" >Attribute Name</td>
|
|
60
|
+
|
|
61
|
+
<td rowspan="1" colSpan="1" >Type</td>
|
|
62
|
+
|
|
63
|
+
<td rowspan="1" colSpan="1" >Default Value</td>
|
|
64
|
+
|
|
65
|
+
<td rowspan="1" colSpan="1" >Description</td>
|
|
66
|
+
</tr>
|
|
67
|
+
|
|
68
|
+
<tr>
|
|
69
|
+
<td rowspan="1" colSpan="1" >variant</td>
|
|
70
|
+
|
|
71
|
+
<td rowspan="1" colSpan="1" >VariantType</td>
|
|
72
|
+
|
|
73
|
+
<td rowspan="1" colSpan="1" >VariantType.MINI</td>
|
|
74
|
+
|
|
75
|
+
<td rowspan="1" colSpan="1" >Search mode: mini, standard, embedded</td>
|
|
76
|
+
</tr>
|
|
77
|
+
|
|
78
|
+
<tr>
|
|
79
|
+
<td rowspan="1" colSpan="1" >SearchBar</td>
|
|
80
|
+
|
|
81
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<SearchBarProps></td>
|
|
82
|
+
|
|
83
|
+
<td rowspan="1" colSpan="1" >DefaultSearchBar</td>
|
|
84
|
+
|
|
85
|
+
<td rowspan="1" colSpan="1" >Custom search box component</td>
|
|
86
|
+
</tr>
|
|
87
|
+
|
|
88
|
+
<tr>
|
|
89
|
+
<td rowspan="1" colSpan="1" >SearchResults</td>
|
|
90
|
+
|
|
91
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<SearchResultsProps></td>
|
|
92
|
+
|
|
93
|
+
<td rowspan="1" colSpan="1" >DefaultSearchResults</td>
|
|
94
|
+
|
|
95
|
+
<td rowspan="1" colSpan="1" >Custom search result component</td>
|
|
96
|
+
</tr>
|
|
97
|
+
|
|
98
|
+
<tr>
|
|
99
|
+
<td rowspan="1" colSpan="1" >SearchAdvanced</td>
|
|
100
|
+
|
|
101
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<SearchAdvancedProps></td>
|
|
102
|
+
|
|
103
|
+
<td rowspan="1" colSpan="1" >DefaultSearchAdvanced</td>
|
|
104
|
+
|
|
105
|
+
<td rowspan="1" colSpan="1" >Custom advanced search component</td>
|
|
106
|
+
</tr>
|
|
107
|
+
|
|
108
|
+
<tr>
|
|
109
|
+
<td rowspan="1" colSpan="1" >SearchResultsPresearch</td>
|
|
110
|
+
|
|
111
|
+
<td rowspan="1" colSpan="1" >React.ComponentType</td>
|
|
112
|
+
|
|
113
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
114
|
+
|
|
115
|
+
<td rowspan="1" colSpan="1" >Search placeholder component</td>
|
|
116
|
+
</tr>
|
|
117
|
+
|
|
118
|
+
<tr>
|
|
119
|
+
<td rowspan="1" colSpan="1" >SearchResultsLoading</td>
|
|
120
|
+
|
|
121
|
+
<td rowspan="1" colSpan="1" >React.ComponentType</td>
|
|
122
|
+
|
|
123
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
124
|
+
|
|
125
|
+
<td rowspan="1" colSpan="1" >Loading placeholder component</td>
|
|
126
|
+
</tr>
|
|
127
|
+
|
|
128
|
+
<tr>
|
|
129
|
+
<td rowspan="1" colSpan="1" >SearchResultsEmpty</td>
|
|
130
|
+
|
|
131
|
+
<td rowspan="1" colSpan="1" >React.ComponentType</td>
|
|
132
|
+
|
|
133
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
134
|
+
|
|
135
|
+
<td rowspan="1" colSpan="1" >Empty result placeholder component</td>
|
|
136
|
+
</tr>
|
|
137
|
+
|
|
138
|
+
<tr>
|
|
139
|
+
<td rowspan="1" colSpan="1" >SearchResultItem</td>
|
|
140
|
+
|
|
141
|
+
<td rowspan="1" colSpan="1" >React.ComponentType<ResultItemProps></td>
|
|
142
|
+
|
|
143
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
144
|
+
|
|
145
|
+
<td rowspan="1" colSpan="1" >Custom search result item component</td>
|
|
146
|
+
</tr>
|
|
147
|
+
|
|
148
|
+
<tr>
|
|
149
|
+
<td rowspan="1" colSpan="1" >debounceTime</td>
|
|
150
|
+
|
|
151
|
+
<td rowspan="1" colSpan="1" >number</td>
|
|
152
|
+
|
|
153
|
+
<td rowspan="1" colSpan="1" >300</td>
|
|
154
|
+
|
|
155
|
+
<td rowspan="1" colSpan="1" >Search debounce time (ms)</td>
|
|
156
|
+
</tr>
|
|
157
|
+
|
|
158
|
+
<tr>
|
|
159
|
+
<td rowspan="1" colSpan="1" >autoFocus</td>
|
|
160
|
+
|
|
161
|
+
<td rowspan="1" colSpan="1" >boolean</td>
|
|
162
|
+
|
|
163
|
+
<td rowspan="1" colSpan="1" >false</td>
|
|
164
|
+
|
|
165
|
+
<td rowspan="1" colSpan="1" >Auto-focus search box</td>
|
|
166
|
+
</tr>
|
|
167
|
+
|
|
168
|
+
<tr>
|
|
169
|
+
<td rowspan="1" colSpan="1" >className</td>
|
|
170
|
+
|
|
171
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
172
|
+
|
|
173
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
174
|
+
|
|
175
|
+
<td rowspan="1" colSpan="1" >Custom style class name</td>
|
|
176
|
+
</tr>
|
|
177
|
+
|
|
178
|
+
<tr>
|
|
179
|
+
<td rowspan="1" colSpan="1" >style</td>
|
|
180
|
+
|
|
181
|
+
<td rowspan="1" colSpan="1" >React.CSSProperties</td>
|
|
182
|
+
|
|
183
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
184
|
+
|
|
185
|
+
<td rowspan="1" colSpan="1" >custom style</td>
|
|
186
|
+
</tr>
|
|
187
|
+
|
|
188
|
+
<tr>
|
|
189
|
+
<td rowspan="1" colSpan="1" >onKeywordChange</td>
|
|
190
|
+
|
|
191
|
+
<td rowspan="1" colSpan="1" >(keyword: string) => void</td>
|
|
192
|
+
|
|
193
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
194
|
+
|
|
195
|
+
<td rowspan="1" colSpan="1" >search keyword change callback</td>
|
|
196
|
+
</tr>
|
|
197
|
+
|
|
198
|
+
<tr>
|
|
199
|
+
<td rowspan="1" colSpan="1" >onSearchComplete</td>
|
|
200
|
+
|
|
201
|
+
<td rowspan="1" colSpan="1" >(results: Map<SearchType, SearchResult>) => void</td>
|
|
202
|
+
|
|
203
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
204
|
+
|
|
205
|
+
<td rowspan="1" colSpan="1" >search complete callback</td>
|
|
206
|
+
</tr>
|
|
207
|
+
|
|
208
|
+
<tr>
|
|
209
|
+
<td rowspan="1" colSpan="1" >onResultItemClick</td>
|
|
210
|
+
|
|
211
|
+
<td rowspan="1" colSpan="1" >(data: SearchResultItem, type: SearchType) => void</td>
|
|
212
|
+
|
|
213
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
214
|
+
|
|
215
|
+
<td rowspan="1" colSpan="1" >search result click callback</td>
|
|
216
|
+
</tr>
|
|
217
|
+
|
|
218
|
+
<tr>
|
|
219
|
+
<td rowspan="1" colSpan="1" >onError</td>
|
|
220
|
+
|
|
221
|
+
<td rowspan="1" colSpan="1" >(error: Error) => void</td>
|
|
222
|
+
|
|
223
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
224
|
+
|
|
225
|
+
<td rowspan="1" colSpan="1" >search error callback</td>
|
|
226
|
+
</tr>
|
|
227
|
+
</table>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
## Basic Usage
|
|
231
|
+
``` typescript
|
|
232
|
+
import { Search, VariantType } from '@tencentcloud/chat-uikit-react';
|
|
233
|
+
|
|
234
|
+
function App() {
|
|
235
|
+
return (
|
|
236
|
+
<Search
|
|
237
|
+
variant={VariantType.STANDARD}
|
|
238
|
+
onResultItemClick={(data, type) => {
|
|
239
|
+
console.log('Search result click:', data, type);
|
|
240
|
+
}}
|
|
241
|
+
/>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Custom Capabilities
|
|
247
|
+
|
|
248
|
+
`Search` provides users with various and dimensional Props APIs, allowing them to customize features, UI, and modules.
|
|
249
|
+
|
|
250
|
+
`Search` component provides multiple replaceable subcomponents, allowing users to customize `SearchBar`, `SearchResults`, `SearchAdvanced`, `SearchResultItem`, `SearchResultsPresearch`, `SearchResultsLoading`, `SearchResultsEmpty`. Users can also leverage default subcomponents for secondary development customization.
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
【Custom SearchBar】
|
|
255
|
+
|
|
256
|
+
**Props**
|
|
257
|
+
<table>
|
|
258
|
+
<tr>
|
|
259
|
+
<td rowspan="1" colSpan="1" >Attribute Name</td>
|
|
260
|
+
|
|
261
|
+
<td rowspan="1" colSpan="1" >Type</td>
|
|
262
|
+
|
|
263
|
+
<td rowspan="1" colSpan="1" >Default Value</td>
|
|
264
|
+
|
|
265
|
+
<td rowspan="1" colSpan="1" >Description</td>
|
|
266
|
+
</tr>
|
|
267
|
+
|
|
268
|
+
<tr>
|
|
269
|
+
<td rowspan="1" colSpan="1" >data</td>
|
|
270
|
+
|
|
271
|
+
<td rowspan="1" colSpan="1" >SearchResultItem</td>
|
|
272
|
+
|
|
273
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
274
|
+
|
|
275
|
+
<td rowspan="1" colSpan="1" >search result data</td>
|
|
276
|
+
</tr>
|
|
277
|
+
|
|
278
|
+
<tr>
|
|
279
|
+
<td rowspan="1" colSpan="1" >type</td>
|
|
280
|
+
|
|
281
|
+
<td rowspan="1" colSpan="1" >SearchType</td>
|
|
282
|
+
|
|
283
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
284
|
+
|
|
285
|
+
<td rowspan="1" colSpan="1" >search result type</td>
|
|
286
|
+
</tr>
|
|
287
|
+
|
|
288
|
+
<tr>
|
|
289
|
+
<td rowspan="1" colSpan="1" >keyword</td>
|
|
290
|
+
|
|
291
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
292
|
+
|
|
293
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
294
|
+
|
|
295
|
+
<td rowspan="1" colSpan="1" >search keyword</td>
|
|
296
|
+
</tr>
|
|
297
|
+
|
|
298
|
+
<tr>
|
|
299
|
+
<td rowspan="1" colSpan="1" >onClick</td>
|
|
300
|
+
|
|
301
|
+
<td rowspan="1" colSpan="1" >(data: SearchResultItem, type: SearchType) => void</td>
|
|
302
|
+
|
|
303
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
304
|
+
|
|
305
|
+
<td rowspan="1" colSpan="1" >click callback</td>
|
|
306
|
+
</tr>
|
|
307
|
+
|
|
308
|
+
<tr>
|
|
309
|
+
<td rowspan="1" colSpan="1" >className</td>
|
|
310
|
+
|
|
311
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
312
|
+
|
|
313
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
314
|
+
|
|
315
|
+
<td rowspan="1" colSpan="1" >Custom style class name</td>
|
|
316
|
+
</tr>
|
|
317
|
+
</table>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
**Example**
|
|
321
|
+
``` typescript
|
|
322
|
+
const CustomSearchBar = ({ value, onChange, onClear, placeholder }) => (
|
|
323
|
+
<div className="custom-search-bar">
|
|
324
|
+
<input
|
|
325
|
+
type="text"
|
|
326
|
+
value={value}
|
|
327
|
+
onChange={onChange}
|
|
328
|
+
placeholder={placeholder}
|
|
329
|
+
/>
|
|
330
|
+
{value && <button onClick={onClear}>Clear</button>}
|
|
331
|
+
</div>
|
|
332
|
+
);
|
|
333
|
+
|
|
334
|
+
<Search SearchBar={CustomSearchBar} />
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
【Custom Search Results】
|
|
338
|
+
|
|
339
|
+
**Props**
|
|
340
|
+
<table>
|
|
341
|
+
<tr>
|
|
342
|
+
<td rowspan="1" colSpan="1" >Attribute Name</td>
|
|
343
|
+
|
|
344
|
+
<td rowspan="1" colSpan="1" >Type</td>
|
|
345
|
+
|
|
346
|
+
<td rowspan="1" colSpan="1" >Default Value</td>
|
|
347
|
+
|
|
348
|
+
<td rowspan="1" colSpan="1" >Description</td>
|
|
349
|
+
</tr>
|
|
350
|
+
|
|
351
|
+
<tr>
|
|
352
|
+
<td rowspan="1" colSpan="1" >results</td>
|
|
353
|
+
|
|
354
|
+
<td rowspan="1" colSpan="1" >`Map<SearchType, SearchResult>`</td>
|
|
355
|
+
|
|
356
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
357
|
+
|
|
358
|
+
<td rowspan="1" colSpan="1" >search result data</td>
|
|
359
|
+
</tr>
|
|
360
|
+
|
|
361
|
+
<tr>
|
|
362
|
+
<td rowspan="1" colSpan="1" >isLoading</td>
|
|
363
|
+
|
|
364
|
+
<td rowspan="1" colSpan="1" >`boolean`</td>
|
|
365
|
+
|
|
366
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
367
|
+
|
|
368
|
+
<td rowspan="1" colSpan="1" >whether loading</td>
|
|
369
|
+
</tr>
|
|
370
|
+
|
|
371
|
+
<tr>
|
|
372
|
+
<td rowspan="1" colSpan="1" >error</td>
|
|
373
|
+
|
|
374
|
+
<td rowspan="1" colSpan="1" >`Error \| null`</td>
|
|
375
|
+
|
|
376
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
377
|
+
|
|
378
|
+
<td rowspan="1" colSpan="1" >Error Message</td>
|
|
379
|
+
</tr>
|
|
380
|
+
|
|
381
|
+
<tr>
|
|
382
|
+
<td rowspan="1" colSpan="1" >keyword</td>
|
|
383
|
+
|
|
384
|
+
<td rowspan="1" colSpan="1" >`string`</td>
|
|
385
|
+
|
|
386
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
387
|
+
|
|
388
|
+
<td rowspan="1" colSpan="1" >search keyword</td>
|
|
389
|
+
</tr>
|
|
390
|
+
|
|
391
|
+
<tr>
|
|
392
|
+
<td rowspan="1" colSpan="1" >typeLabels</td>
|
|
393
|
+
|
|
394
|
+
<td rowspan="1" colSpan="1" >`Record<SearchType, string>`</td>
|
|
395
|
+
|
|
396
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
397
|
+
|
|
398
|
+
<td rowspan="1" colSpan="1" >search type tag</td>
|
|
399
|
+
</tr>
|
|
400
|
+
|
|
401
|
+
<tr>
|
|
402
|
+
<td rowspan="1" colSpan="1" >onLoadMore</td>
|
|
403
|
+
|
|
404
|
+
<td rowspan="1" colSpan="1" >`(type: SearchType) => void`</td>
|
|
405
|
+
|
|
406
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
407
|
+
|
|
408
|
+
<td rowspan="1" colSpan="1" >Load more callback</td>
|
|
409
|
+
</tr>
|
|
410
|
+
|
|
411
|
+
<tr>
|
|
412
|
+
<td rowspan="1" colSpan="1" >onResultItemClick</td>
|
|
413
|
+
|
|
414
|
+
<td rowspan="1" colSpan="1" >`(data: SearchResultItem, type: SearchType) => void`</td>
|
|
415
|
+
|
|
416
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
417
|
+
|
|
418
|
+
<td rowspan="1" colSpan="1" >result item click callback</td>
|
|
419
|
+
</tr>
|
|
420
|
+
|
|
421
|
+
<tr>
|
|
422
|
+
<td rowspan="1" colSpan="1" >SearchResultsLoading</td>
|
|
423
|
+
|
|
424
|
+
<td rowspan="1" colSpan="1" >`React.ComponentType`</td>
|
|
425
|
+
|
|
426
|
+
<td rowspan="1" colSpan="1" >`Loading`</td>
|
|
427
|
+
|
|
428
|
+
<td rowspan="1" colSpan="1" >Custom load component</td>
|
|
429
|
+
</tr>
|
|
430
|
+
|
|
431
|
+
<tr>
|
|
432
|
+
<td rowspan="1" colSpan="1" >SearchResultsPresearch</td>
|
|
433
|
+
|
|
434
|
+
<td rowspan="1" colSpan="1" >`React.ComponentType`</td>
|
|
435
|
+
|
|
436
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
437
|
+
|
|
438
|
+
<td rowspan="1" colSpan="1" >Search placeholder component</td>
|
|
439
|
+
</tr>
|
|
440
|
+
|
|
441
|
+
<tr>
|
|
442
|
+
<td rowspan="1" colSpan="1" >SearchResultsEmpty</td>
|
|
443
|
+
|
|
444
|
+
<td rowspan="1" colSpan="1" >`React.ComponentType`</td>
|
|
445
|
+
|
|
446
|
+
<td rowspan="1" colSpan="1" >`EmptyResult`</td>
|
|
447
|
+
|
|
448
|
+
<td rowspan="1" colSpan="1" >Empty result placeholder component</td>
|
|
449
|
+
</tr>
|
|
450
|
+
|
|
451
|
+
<tr>
|
|
452
|
+
<td rowspan="1" colSpan="1" >SearchResultItem</td>
|
|
453
|
+
|
|
454
|
+
<td rowspan="1" colSpan="1" >`React.ComponentType<ResultItemProps>`</td>
|
|
455
|
+
|
|
456
|
+
<td rowspan="1" colSpan="1" >`DefaultSearchResultsItem`</td>
|
|
457
|
+
|
|
458
|
+
<td rowspan="1" colSpan="1" >Custom result item component</td>
|
|
459
|
+
</tr>
|
|
460
|
+
|
|
461
|
+
<tr>
|
|
462
|
+
<td rowspan="1" colSpan="1" >variant</td>
|
|
463
|
+
|
|
464
|
+
<td rowspan="1" colSpan="1" >`VariantType`</td>
|
|
465
|
+
|
|
466
|
+
<td rowspan="1" colSpan="1" >`VariantType.STANDARD`</td>
|
|
467
|
+
|
|
468
|
+
<td rowspan="1" colSpan="1" >Display Mode</td>
|
|
469
|
+
</tr>
|
|
470
|
+
|
|
471
|
+
<tr>
|
|
472
|
+
<td rowspan="1" colSpan="1" >searchType</td>
|
|
473
|
+
|
|
474
|
+
<td rowspan="1" colSpan="1" >`SearchType \| 'all'`</td>
|
|
475
|
+
|
|
476
|
+
<td rowspan="1" colSpan="1" >`'all'`</td>
|
|
477
|
+
|
|
478
|
+
<td rowspan="1" colSpan="1" >Current search type</td>
|
|
479
|
+
</tr>
|
|
480
|
+
</table>
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
**Example**
|
|
484
|
+
``` typescript
|
|
485
|
+
const CustomSearchResults = ({ results, keyword, onResultItemClick }) => (
|
|
486
|
+
<div className="custom-results">
|
|
487
|
+
{Array.from(results.entries()).map(([type, result]) => (
|
|
488
|
+
<div key={type}>
|
|
489
|
+
<h3>{type}</h3>
|
|
490
|
+
{result.resultList.map((item, index) => (
|
|
491
|
+
<div key={index} onClick={() => onResultItemClick(item, type)}>
|
|
492
|
+
{/* Custom result item */}
|
|
493
|
+
</div>
|
|
494
|
+
))}
|
|
495
|
+
</div>
|
|
496
|
+
))}
|
|
497
|
+
</div>
|
|
498
|
+
);
|
|
499
|
+
|
|
500
|
+
<Search SearchResults={CustomSearchResults} />
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
【Custom Search Advanced】
|
|
504
|
+
|
|
505
|
+
**Props**
|
|
506
|
+
<table>
|
|
507
|
+
<tr>
|
|
508
|
+
<td rowspan="1" colSpan="1" >Attribute Name</td>
|
|
509
|
+
|
|
510
|
+
<td rowspan="1" colSpan="1" >Type</td>
|
|
511
|
+
|
|
512
|
+
<td rowspan="1" colSpan="1" >Default Value</td>
|
|
513
|
+
|
|
514
|
+
<td rowspan="1" colSpan="1" >Description</td>
|
|
515
|
+
</tr>
|
|
516
|
+
|
|
517
|
+
<tr>
|
|
518
|
+
<td rowspan="1" colSpan="1" >variant</td>
|
|
519
|
+
|
|
520
|
+
<td rowspan="1" colSpan="1" >`VariantType`</td>
|
|
521
|
+
|
|
522
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
523
|
+
|
|
524
|
+
<td rowspan="1" colSpan="1" >Display Mode</td>
|
|
525
|
+
</tr>
|
|
526
|
+
|
|
527
|
+
<tr>
|
|
528
|
+
<td rowspan="1" colSpan="1" >searchType</td>
|
|
529
|
+
|
|
530
|
+
<td rowspan="1" colSpan="1" >`SearchTabType`</td>
|
|
531
|
+
|
|
532
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
533
|
+
|
|
534
|
+
<td rowspan="1" colSpan="1" >Current search type</td>
|
|
535
|
+
</tr>
|
|
536
|
+
|
|
537
|
+
<tr>
|
|
538
|
+
<td rowspan="1" colSpan="1" >advancedParams</td>
|
|
539
|
+
|
|
540
|
+
<td rowspan="1" colSpan="1" >`Map<SearchType, SearchParamsMap[SearchType]>`</td>
|
|
541
|
+
|
|
542
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
543
|
+
|
|
544
|
+
<td rowspan="1" colSpan="1" >Advanced search parameters</td>
|
|
545
|
+
</tr>
|
|
546
|
+
|
|
547
|
+
<tr>
|
|
548
|
+
<td rowspan="1" colSpan="1" >onAdvancedParamsChange</td>
|
|
549
|
+
|
|
550
|
+
<td rowspan="1" colSpan="1" >`(type: SearchType, params: SearchParamsMap[SearchType]) => void`</td>
|
|
551
|
+
|
|
552
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
553
|
+
|
|
554
|
+
<td rowspan="1" colSpan="1" >Parameter change callback</td>
|
|
555
|
+
</tr>
|
|
556
|
+
</table>
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
**Example**
|
|
560
|
+
``` typescript
|
|
561
|
+
const CustomSearchAdvanced = ({ variant, searchType, advancedParams, onAdvancedParamsChange }) => (
|
|
562
|
+
<div className="custom-advanced">
|
|
563
|
+
{/* Custom advanced search function */}
|
|
564
|
+
</div>
|
|
565
|
+
);
|
|
566
|
+
|
|
567
|
+
<Search SearchAdvanced={CustomSearchAdvanced} />
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
【Custom Search Result Item】
|
|
571
|
+
|
|
572
|
+
**Props**
|
|
573
|
+
<table>
|
|
574
|
+
<tr>
|
|
575
|
+
<td rowspan="1" colSpan="1" >Attribute Name</td>
|
|
576
|
+
|
|
577
|
+
<td rowspan="1" colSpan="1" >Type</td>
|
|
578
|
+
|
|
579
|
+
<td rowspan="1" colSpan="1" >Default Value</td>
|
|
580
|
+
|
|
581
|
+
<td rowspan="1" colSpan="1" >Description</td>
|
|
582
|
+
</tr>
|
|
583
|
+
|
|
584
|
+
<tr>
|
|
585
|
+
<td rowspan="1" colSpan="1" >data</td>
|
|
586
|
+
|
|
587
|
+
<td rowspan="1" colSpan="1" >`SearchResultItem`</td>
|
|
588
|
+
|
|
589
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
590
|
+
|
|
591
|
+
<td rowspan="1" colSpan="1" >search result data</td>
|
|
592
|
+
</tr>
|
|
593
|
+
|
|
594
|
+
<tr>
|
|
595
|
+
<td rowspan="1" colSpan="1" >type</td>
|
|
596
|
+
|
|
597
|
+
<td rowspan="1" colSpan="1" >`SearchType`</td>
|
|
598
|
+
|
|
599
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
600
|
+
|
|
601
|
+
<td rowspan="1" colSpan="1" >search result type</td>
|
|
602
|
+
</tr>
|
|
603
|
+
|
|
604
|
+
<tr>
|
|
605
|
+
<td rowspan="1" colSpan="1" >keyword</td>
|
|
606
|
+
|
|
607
|
+
<td rowspan="1" colSpan="1" >`string`</td>
|
|
608
|
+
|
|
609
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
610
|
+
|
|
611
|
+
<td rowspan="1" colSpan="1" >search keyword</td>
|
|
612
|
+
</tr>
|
|
613
|
+
|
|
614
|
+
<tr>
|
|
615
|
+
<td rowspan="1" colSpan="1" >onClick</td>
|
|
616
|
+
|
|
617
|
+
<td rowspan="1" colSpan="1" >`(data: SearchResultItem, type: SearchType) => void`</td>
|
|
618
|
+
|
|
619
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
620
|
+
|
|
621
|
+
<td rowspan="1" colSpan="1" >click callback</td>
|
|
622
|
+
</tr>
|
|
623
|
+
|
|
624
|
+
<tr>
|
|
625
|
+
<td rowspan="1" colSpan="1" >className</td>
|
|
626
|
+
|
|
627
|
+
<td rowspan="1" colSpan="1" >`string`</td>
|
|
628
|
+
|
|
629
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
630
|
+
|
|
631
|
+
<td rowspan="1" colSpan="1" >Custom style class name</td>
|
|
632
|
+
</tr>
|
|
633
|
+
</table>
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
**Example**
|
|
637
|
+
``` typescript
|
|
638
|
+
const CustomSearchItem = ({ data, type, keyword, onClick }) => (
|
|
639
|
+
<div className="custom-item">
|
|
640
|
+
{type === SearchType.MESSAGE && (
|
|
641
|
+
<Conversation
|
|
642
|
+
data={data}
|
|
643
|
+
keyword={keyword}
|
|
644
|
+
onClick={onClick}
|
|
645
|
+
/>
|
|
646
|
+
)}
|
|
647
|
+
{type === SearchType.USER && (
|
|
648
|
+
<User
|
|
649
|
+
data={data}
|
|
650
|
+
keyword={keyword}
|
|
651
|
+
onClick={onClick}
|
|
652
|
+
/>
|
|
653
|
+
)}
|
|
654
|
+
{type === SearchType.GROUP && (
|
|
655
|
+
<Group
|
|
656
|
+
data={data}
|
|
657
|
+
keyword={keyword}
|
|
658
|
+
onClick={onClick}
|
|
659
|
+
/>
|
|
660
|
+
)}
|
|
661
|
+
{type === SearchType.CHAT_MESSAGE && (
|
|
662
|
+
<Message
|
|
663
|
+
data={data}
|
|
664
|
+
keyword={keyword}
|
|
665
|
+
onClick={onClick}
|
|
666
|
+
/>
|
|
667
|
+
)}
|
|
668
|
+
</div>
|
|
669
|
+
);
|
|
670
|
+
|
|
671
|
+
<Search SearchResultItem={CustomSearchItem} />
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
【Custom Placeholder Component】
|
|
675
|
+
|
|
676
|
+
**Props**
|
|
677
|
+
<table>
|
|
678
|
+
<tr>
|
|
679
|
+
<td rowspan="1" colSpan="1" >Attribute Name</td>
|
|
680
|
+
|
|
681
|
+
<td rowspan="1" colSpan="1" >Type</td>
|
|
682
|
+
|
|
683
|
+
<td rowspan="1" colSpan="1" >Default Value</td>
|
|
684
|
+
|
|
685
|
+
<td rowspan="1" colSpan="1" >Description</td>
|
|
686
|
+
</tr>
|
|
687
|
+
|
|
688
|
+
<tr>
|
|
689
|
+
<td rowspan="1" colSpan="1" >SearchResultsPresearch</td>
|
|
690
|
+
|
|
691
|
+
<td rowspan="1" colSpan="1" >`React.ComponentType`</td>
|
|
692
|
+
|
|
693
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
694
|
+
|
|
695
|
+
<td rowspan="1" colSpan="1" >Search placeholder component</td>
|
|
696
|
+
</tr>
|
|
697
|
+
|
|
698
|
+
<tr>
|
|
699
|
+
<td rowspan="1" colSpan="1" >SearchResultsLoading</td>
|
|
700
|
+
|
|
701
|
+
<td rowspan="1" colSpan="1" >`React.ComponentType`</td>
|
|
702
|
+
|
|
703
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
704
|
+
|
|
705
|
+
<td rowspan="1" colSpan="1" >Loading placeholder component</td>
|
|
706
|
+
</tr>
|
|
707
|
+
|
|
708
|
+
<tr>
|
|
709
|
+
<td rowspan="1" colSpan="1" >SearchResultsEmpty</td>
|
|
710
|
+
|
|
711
|
+
<td rowspan="1" colSpan="1" >`React.ComponentType`</td>
|
|
712
|
+
|
|
713
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
714
|
+
|
|
715
|
+
<td rowspan="1" colSpan="1" >Empty result placeholder component</td>
|
|
716
|
+
</tr>
|
|
717
|
+
</table>
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
**Example**
|
|
721
|
+
``` typescript
|
|
722
|
+
<Search
|
|
723
|
+
SearchResultsPresearch={() => <div>Enter keywords to start search</div>}
|
|
724
|
+
SearchResultsLoading={() => <div>Searching...</div>}
|
|
725
|
+
SearchResultsEmpty={() => <div>No result found</div>}
|
|
726
|
+
/>
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
## FAQs
|
|
730
|
+
|
|
731
|
+
### How to Customize the Search Result Display Format
|
|
732
|
+
|
|
733
|
+
A: Use the `SearchResultItem` property to import a customize component.
|
|
734
|
+
|
|
735
|
+
### How to Handle Search Performance Issues
|
|
736
|
+
|
|
737
|
+
A: Adjust `debounceTime`, use React.memo, and consider result cache.
|
|
738
|
+
|
|
739
|
+
### How to Optimize Mobile Terminal
|
|
740
|
+
|
|
741
|
+
A: The component automatically adapts to mobile terminals and can be further customized via CSS.
|
|
742
|
+
|
|
743
|
+
### How to Support Multilingual
|
|
744
|
+
|
|
745
|
+
A: The component has built-in internationalization support. Use `useUIKit` to get translations.
|