From 2798469b26704c576efc9910cad993f611acc569 Mon Sep 17 00:00:00 2001 From: alexlavrov Date: Fri, 1 Nov 2024 21:04:09 +0400 Subject: [PATCH] Create collection item using User fields. Regenerate angular --- .../devextreme-angular/src/ui/chat/index.ts | 6 +-- .../src/ui/nested/base/index.ts | 1 - .../src/ui/nested/base/user-dxi.ts | 40 ---------------- .../src/ui/nested/typing-user-dxi.ts | 48 ++++++++++++++----- packages/devextreme/js/ui/chat.d.ts | 23 ++++++++- packages/devextreme/ts/dx.all.d.ts | 19 +++++++- 6 files changed, 80 insertions(+), 57 deletions(-) delete mode 100644 packages/devextreme-angular/src/ui/nested/base/user-dxi.ts diff --git a/packages/devextreme-angular/src/ui/chat/index.ts b/packages/devextreme-angular/src/ui/chat/index.ts index a66163fb4c9c..4eef3fabeb1c 100644 --- a/packages/devextreme-angular/src/ui/chat/index.ts +++ b/packages/devextreme-angular/src/ui/chat/index.ts @@ -347,10 +347,10 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges */ @Input() - get typingUsers(): Array { + get typingUsers(): Array { return this._getOption('typingUsers'); } - set typingUsers(value: Array) { + set typingUsers(value: Array) { this._setOption('typingUsers', value); } @@ -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>; + @Output() typingUsersChange: EventEmitter>; /** diff --git a/packages/devextreme-angular/src/ui/nested/base/index.ts b/packages/devextreme-angular/src/ui/nested/base/index.ts index a6e272d7e18a..73d1cd4c8b95 100644 --- a/packages/devextreme-angular/src/ui/nested/base/index.ts +++ b/packages/devextreme-angular/src/ui/nested/base/index.ts @@ -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'; diff --git a/packages/devextreme-angular/src/ui/nested/base/user-dxi.ts b/packages/devextreme-angular/src/ui/nested/base/user-dxi.ts deleted file mode 100644 index 42185f061230..000000000000 --- a/packages/devextreme-angular/src/ui/nested/base/user-dxi.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* tslint:disable:max-line-length */ - -import { CollectionNestedOption } from 'devextreme-angular/core'; -import { - Component, -} from '@angular/core'; - - -@Component({ - template: '' -}) -export abstract class DxiUser extends CollectionNestedOption { - get avatarAlt(): string { - return this._getOption('avatarAlt'); - } - set avatarAlt(value: string) { - this._setOption('avatarAlt', value); - } - - get avatarUrl(): string { - return this._getOption('avatarUrl'); - } - set avatarUrl(value: string) { - this._setOption('avatarUrl', value); - } - - get id(): number | string { - return this._getOption('id'); - } - set id(value: number | string) { - this._setOption('id', value); - } - - get name(): string { - return this._getOption('name'); - } - set name(value: string) { - this._setOption('name', value); - } -} diff --git a/packages/devextreme-angular/src/ui/nested/typing-user-dxi.ts b/packages/devextreme-angular/src/ui/nested/typing-user-dxi.ts index 552f1ed8f00d..6bd4f4111d1d 100644 --- a/packages/devextreme-angular/src/ui/nested/typing-user-dxi.ts +++ b/packages/devextreme-angular/src/ui/nested/typing-user-dxi.ts @@ -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'; @@ -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'; diff --git a/packages/devextreme/js/ui/chat.d.ts b/packages/devextreme/js/ui/chat.d.ts index 086fbd727e1c..e5309947f628 100644 --- a/packages/devextreme/js/ui/chat.d.ts +++ b/packages/devextreme/js/ui/chat.d.ts @@ -237,7 +237,28 @@ export interface dxChatOptions extends WidgetOptions { * @default [] * @public */ - typingUsers?: Array; + typingUsers?: Array<{ + /** + * @docid + * @public + */ + id?: number | string; + /** + * @docid + * @public + */ + name?: string; + /** + * @docid + * @public + */ + avatarUrl?: string; + /** + * @docid + * @public + */ + avatarAlt?: string; + }>; /** * @docid * @default true diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index dc814cfc5fde..703828b63bbb 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -9611,7 +9611,24 @@ declare module DevExpress.ui { /** * [descr:dxChatOptions.typingUsers] */ - typingUsers?: Array; + 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] */