Skip to content

Commit 7ed9e68

Browse files
author
Ruslan Farkhutdinov
committed
Chat: WIP Add mainButton option
1 parent 2b661ce commit 7ed9e68

3 files changed

Lines changed: 77 additions & 0 deletions

File tree

packages/devextreme/js/ui/chat.d.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,43 @@ export type AttachmentDownloadClickEvent = EventInfo<dxChat> & {
173173
*/
174174
export type InputFieldTextChangedEvent = NativeEventInfo<dxChat, InteractionEvent | Event> & ValueChangedInfo;
175175

176+
/**
177+
* @docid _ui_chat_MainButtonClickEvent
178+
* @public
179+
* @type object
180+
* @inherits NativeEventInfo
181+
*/
182+
export type MainButtonClickEvent = NativeEventInfo<dxChat, InteractionEvent>;
183+
184+
/**
185+
* @docid
186+
* @namespace DevExpress.ui.dxChat
187+
* @public
188+
*/
189+
export type MainButton = {
190+
/**
191+
* @docid
192+
* @public
193+
*/
194+
icon?: string;
195+
/**
196+
* @docid
197+
* @public
198+
*/
199+
hint?: string;
200+
/**
201+
* @docid
202+
* @public
203+
*/
204+
action: 'default' | 'custom';
205+
/**
206+
* @docid
207+
* @type_function_param1 e:{ui/chat:MainButtonClickEvent}
208+
* @public
209+
*/
210+
onClick: ((e: MainButtonClickEvent) => void);
211+
};
212+
176213
/**
177214
* @docid
178215
* @namespace DevExpress.ui.dxChat
@@ -446,6 +483,11 @@ export interface dxChatOptions extends WidgetOptions<dxChat> {
446483
* @public
447484
*/
448485
inputFieldText?: TextAreaProperties['value'];
486+
/**
487+
* @docid
488+
* @public
489+
*/
490+
mainButton?: MainButton;
449491
/**
450492
* @docid
451493
* @default null

packages/devextreme/js/ui/chat_types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export {
1313
MessageUpdatedEvent,
1414
AttachmentDownloadClickEvent,
1515
InputFieldTextChangedEvent,
16+
MainButtonClickEvent,
17+
MainButton,
1618
User,
1719
Alert,
1820
Attachment,

packages/devextreme/ts/dx.all.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11238,6 +11238,14 @@ declare module DevExpress.ui {
1123811238
DevExpress.events.InteractionEvent | Event
1123911239
> &
1124011240
DevExpress.ui.Editor.ValueChangedInfo;
11241+
/**
11242+
* [descr:_ui_chat_MainButtonClickEvent]
11243+
*/
11244+
export type MainButtonClickEvent =
11245+
DevExpress.common.core.events.NativeEventInfo<
11246+
dxChat,
11247+
DevExpress.events.InteractionEvent
11248+
>;
1124111249
/**
1124211250
* [descr:_ui_chat_MessageDeletedEvent]
1124311251
*/
@@ -11442,6 +11450,10 @@ declare module DevExpress.ui {
1144211450
* [descr:dxChatOptions.inputFieldText]
1144311451
*/
1144411452
inputFieldText?: DevExpress.ui.dxTextArea.Properties['value'];
11453+
/**
11454+
* [descr:dxChatOptions.mainButton]
11455+
*/
11456+
mainButton?: DevExpress.ui.dxChat.MainButton;
1144511457
/**
1144611458
* [descr:dxChatOptions.messageTemplate]
1144711459
*/
@@ -34134,6 +34146,27 @@ declare module DevExpress.ui.dxChat {
3413434146
*/
3413534147
alt?: string;
3413634148
};
34149+
/**
34150+
* [descr:MainButton]
34151+
*/
34152+
export type MainButton = {
34153+
/**
34154+
* [descr:MainButton.icon]
34155+
*/
34156+
icon?: string;
34157+
/**
34158+
* [descr:MainButton.hint]
34159+
*/
34160+
hint?: string;
34161+
/**
34162+
* [descr:MainButton.action]
34163+
*/
34164+
action: 'default' | 'custom';
34165+
/**
34166+
* [descr:MainButton.onClick]
34167+
*/
34168+
onClick: (e: MainButtonClickEvent) => void;
34169+
};
3413734170
/**
3413834171
* [descr:Message]
3413934172
*/

0 commit comments

Comments
 (0)