Skip to content
Open
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
46 changes: 46 additions & 0 deletions packages/devextreme-angular/src/ui/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { DataSourceOptions } from 'devextreme/data/data_source';
import { Store } from 'devextreme/data/store';
import { Format } from 'devextreme/common/core/localization';
import { dxFileUploaderOptions } from 'devextreme/ui/file_uploader';
import { dxSpeechToTextOptions } from 'devextreme/ui/speech_to_text';

import DxChat from 'devextreme/ui/chat';

Expand Down Expand Up @@ -56,11 +57,14 @@ import { DxoUserModule } from 'devextreme-angular/ui/nested';
import { DxiChatAlertModule } from 'devextreme-angular/ui/chat/nested';
import { DxiChatAttachmentModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatAuthorModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatCustomSpeechRecognizerModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatDayHeaderFormatModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatEditingModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatFileUploaderOptionsModule } from 'devextreme-angular/ui/chat/nested';
import { DxiChatItemModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatMessageTimestampFormatModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatSpeechRecognitionConfigModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatSpeechToTextOptionsModule } from 'devextreme-angular/ui/chat/nested';
import { DxiChatTypingUserModule } from 'devextreme-angular/ui/chat/nested';
import { DxoChatUserModule } from 'devextreme-angular/ui/chat/nested';
import {
Expand Down Expand Up @@ -291,6 +295,16 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
}



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


/**
* [descr:dxChatOptions.items]

Expand Down Expand Up @@ -408,6 +422,16 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
}



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


/**
* [descr:dxChatOptions.typingUsers]

Expand Down Expand Up @@ -661,6 +685,13 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
*/
@Output() hoverStateEnabledChange: EventEmitter<boolean>;

/**

* This member supports the internal infrastructure and is not intended to be used directly from your code.

*/
@Output() inputFieldTextChange: EventEmitter<any>;

/**

* This member supports the internal infrastructure and is not intended to be used directly from your code.
Expand Down Expand Up @@ -724,6 +755,13 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
*/
@Output() showUserNameChange: EventEmitter<boolean>;

/**

* This member supports the internal infrastructure and is not intended to be used directly from your code.

*/
@Output() speechToTextOptionsChange: EventEmitter<dxSpeechToTextOptions>;

/**

* This member supports the internal infrastructure and is not intended to be used directly from your code.
Expand Down Expand Up @@ -792,6 +830,7 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
{ emit: 'heightChange' },
{ emit: 'hintChange' },
{ emit: 'hoverStateEnabledChange' },
{ emit: 'inputFieldTextChange' },
{ emit: 'itemsChange' },
{ emit: 'messageTemplateChange' },
{ emit: 'messageTimestampFormatChange' },
Expand All @@ -801,6 +840,7 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
{ emit: 'showDayHeadersChange' },
{ emit: 'showMessageTimestampChange' },
{ emit: 'showUserNameChange' },
{ emit: 'speechToTextOptionsChange' },
{ emit: 'typingUsersChange' },
{ emit: 'userChange' },
{ emit: 'visibleChange' },
Expand Down Expand Up @@ -869,11 +909,14 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
DxiChatAlertModule,
DxiChatAttachmentModule,
DxoChatAuthorModule,
DxoChatCustomSpeechRecognizerModule,
DxoChatDayHeaderFormatModule,
DxoChatEditingModule,
DxoChatFileUploaderOptionsModule,
DxiChatItemModule,
DxoChatMessageTimestampFormatModule,
DxoChatSpeechRecognitionConfigModule,
DxoChatSpeechToTextOptionsModule,
DxiChatTypingUserModule,
DxoChatUserModule,
DxIntegrationModule,
Expand All @@ -892,11 +935,14 @@ export class DxChatComponent extends DxComponent implements OnDestroy, OnChanges
DxiChatAlertModule,
DxiChatAttachmentModule,
DxoChatAuthorModule,
DxoChatCustomSpeechRecognizerModule,
DxoChatDayHeaderFormatModule,
DxoChatEditingModule,
DxoChatFileUploaderOptionsModule,
DxiChatItemModule,
DxoChatMessageTimestampFormatModule,
DxoChatSpeechRecognitionConfigModule,
DxoChatSpeechToTextOptionsModule,
DxiChatTypingUserModule,
DxoChatUserModule,
DxTemplateModule
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/* tslint:disable:max-line-length */


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





import {
DxIntegrationModule,
NestedOptionHost,
} from 'devextreme-angular/core';
import { NestedOption } from 'devextreme-angular/core';


@Component({
selector: 'dxo-chat-custom-speech-recognizer',
standalone: true,
template: '',
styles: [''],
imports: [ DxIntegrationModule ],
providers: [NestedOptionHost]
})
export class DxoChatCustomSpeechRecognizerComponent extends NestedOption implements OnDestroy, OnInit {
@Input()
get enabled(): boolean {
return this._getOption('enabled');
}
set enabled(value: boolean) {
this._setOption('enabled', value);
}

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


protected get _optionPath() {
return 'customSpeechRecognizer';
}


constructor(@SkipSelf() @Host() parentOptionHost: NestedOptionHost,
@Host() optionHost: NestedOptionHost) {
super();
parentOptionHost.setNestedOption(this);
optionHost.setHost(this, this._fullOptionPath.bind(this));
}


ngOnInit() {
this._addRecreatedComponent();
}

ngOnDestroy() {
this._addRemovedOption(this._getOptionPath());
}


}

@NgModule({
imports: [
DxoChatCustomSpeechRecognizerComponent
],
exports: [
DxoChatCustomSpeechRecognizerComponent
],
})
export class DxoChatCustomSpeechRecognizerModule { }
3 changes: 3 additions & 0 deletions packages/devextreme-angular/src/ui/chat/nested/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
export * from './alert-dxi';
export * from './attachment-dxi';
export * from './author';
export * from './custom-speech-recognizer';
export * from './day-header-format';
export * from './editing';
export * from './file-uploader-options';
export * from './item-dxi';
export * from './message-timestamp-format';
export * from './speech-recognition-config';
export * from './speech-to-text-options';
export * from './typing-user-dxi';
export * from './user';

Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/* tslint:disable:max-line-length */


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





import {
DxIntegrationModule,
NestedOptionHost,
} from 'devextreme-angular/core';
import { NestedOption } from 'devextreme-angular/core';


@Component({
selector: 'dxo-chat-speech-recognition-config',
standalone: true,
template: '',
styles: [''],
imports: [ DxIntegrationModule ],
providers: [NestedOptionHost]
})
export class DxoChatSpeechRecognitionConfigComponent extends NestedOption implements OnDestroy, OnInit {
@Input()
get continuous(): boolean {
return this._getOption('continuous');
}
set continuous(value: boolean) {
this._setOption('continuous', value);
}

@Input()
get grammars(): Array<string> {
return this._getOption('grammars');
}
set grammars(value: Array<string>) {
this._setOption('grammars', value);
}

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

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

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


protected get _optionPath() {
return 'speechRecognitionConfig';
}


constructor(@SkipSelf() @Host() parentOptionHost: NestedOptionHost,
@Host() optionHost: NestedOptionHost) {
super();
parentOptionHost.setNestedOption(this);
optionHost.setHost(this, this._fullOptionPath.bind(this));
}


ngOnInit() {
this._addRecreatedComponent();
}

ngOnDestroy() {
this._addRemovedOption(this._getOptionPath());
}


}

@NgModule({
imports: [
DxoChatSpeechRecognitionConfigComponent
],
exports: [
DxoChatSpeechRecognitionConfigComponent
],
})
export class DxoChatSpeechRecognitionConfigModule { }
Loading
Loading