Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: patch for chat typing users #28294

Closed
Closed
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
6 changes: 3 additions & 3 deletions packages/devextreme-angular/src/ui/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges

*/
@Input()
get typingUsers(): Array<User> {
get typingUsers(): Array<any | { avatarAlt?: string, avatarUrl?: string, id?: number | string, name?: string }> {
return this._getOption('typingUsers');
}
set typingUsers(value: Array<User>) {
set typingUsers(value: Array<any | { avatarAlt?: string, avatarUrl?: string, id?: number | string, name?: string }>) {
this._setOption('typingUsers', value);
}

Expand Down Expand Up @@ -586,7 +586,7 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
* This member supports the internal infrastructure and is not intended to be used directly from your code.

*/
@Output() typingUsersChange: EventEmitter<Array<User>>;
@Output() typingUsersChange: EventEmitter<Array<any | { avatarAlt?: string, avatarUrl?: string, id?: number | string, name?: string }>>;

/**

Expand Down
1 change: 0 additions & 1 deletion packages/devextreme-angular/src/ui/nested/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export * from './splitter-options';
export * from './tab-panel-options';
export * from './text-box-options';
export * from './text-editor-button-dxi';
export * from './user-dxi';
export * from './user';
export * from './vector-map-projection-config';
export * from './viz-font';
Expand Down
40 changes: 0 additions & 40 deletions packages/devextreme-angular/src/ui/nested/base/user-dxi.ts

This file was deleted.

48 changes: 37 additions & 11 deletions packages/devextreme-angular/src/ui/nested/typing-user-dxi.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* tslint:disable:max-line-length */

/* tslint:disable:use-input-property-decorator */

import {
Component,
NgModule,
Host,
SkipSelf
SkipSelf,
Input
} from '@angular/core';


Expand All @@ -16,22 +16,48 @@ import {
import {
NestedOptionHost,
} from 'devextreme-angular/core';
import { DxiUser } from './base/user-dxi';
import { CollectionNestedOption } from 'devextreme-angular/core';


@Component({
selector: 'dxi-typing-user',
template: '',
styles: [''],
providers: [NestedOptionHost],
inputs: [
'avatarAlt',
'avatarUrl',
'id',
'name'
]
providers: [NestedOptionHost]
})
export class DxiTypingUserComponent extends DxiUser {
export class DxiTypingUserComponent extends CollectionNestedOption {
@Input()
get avatarAlt(): string {
return this._getOption('avatarAlt');
}
set avatarAlt(value: string) {
this._setOption('avatarAlt', value);
}

@Input()
get avatarUrl(): string {
return this._getOption('avatarUrl');
}
set avatarUrl(value: string) {
this._setOption('avatarUrl', value);
}

@Input()
get id(): number | string {
return this._getOption('id');
}
set id(value: number | string) {
this._setOption('id', value);
}

@Input()
get name(): string {
return this._getOption('name');
}
set name(value: string) {
this._setOption('name', value);
}


protected get _optionPath() {
return 'typingUsers';
Expand Down
23 changes: 22 additions & 1 deletion packages/devextreme/js/ui/chat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,28 @@ export interface dxChatOptions extends WidgetOptions<dxChat> {
* @default []
* @public
*/
typingUsers?: Array<User>;
typingUsers?: Array<{
/**
* @docid
* @public
*/
id?: number | string;
/**
* @docid
* @public
*/
name?: string;
/**
* @docid
* @public
*/
avatarUrl?: string;
/**
* @docid
* @public
*/
avatarAlt?: string;
}>;
/**
* @docid
* @default true
Expand Down
19 changes: 18 additions & 1 deletion packages/devextreme/ts/dx.all.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9611,7 +9611,24 @@ declare module DevExpress.ui {
/**
* [descr:dxChatOptions.typingUsers]
*/
typingUsers?: Array<DevExpress.ui.dxChat.User>;
typingUsers?: Array<{
/**
* [descr:dxChatOptions.typingUsers.id]
*/
id?: number | string;
/**
* [descr:dxChatOptions.typingUsers.name]
*/
name?: string;
/**
* [descr:dxChatOptions.typingUsers.avatarUrl]
*/
avatarUrl?: string;
/**
* [descr:dxChatOptions.typingUsers.avatarAlt]
*/
avatarAlt?: string;
}>;
/**
* [descr:dxChatOptions.showDayHeaders]
*/
Expand Down
Loading