@progress/kendo-angular-conversational-ui 4.1.0 → 5.0.0-dev.202204131603
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/{dist/es2015/api → api}/action.interface.d.ts +0 -0
- package/{dist/es2015/api → api}/attachment.interface.d.ts +0 -0
- package/{dist/es2015/api → api}/execute-action-event.d.ts +1 -1
- package/{dist/es/api/user.interface.js → api/index.d.ts} +6 -0
- package/{dist/es2015/api → api}/message.interface.d.ts +0 -0
- package/{dist/es2015/api → api}/post-message-event.d.ts +0 -0
- package/{dist/es2015/api → api}/preventable-event.d.ts +0 -0
- package/{dist/es2015/api → api}/user.interface.d.ts +0 -0
- package/bundles/kendo-angular-conversational-ui.umd.js +5 -0
- package/{dist/es2015/cards → cards}/hero-card.component.d.ts +3 -0
- package/{dist/es2015/chat → chat}/attachment-template.directive.d.ts +3 -0
- package/{dist/es2015/chat → chat}/attachment.component.d.ts +9 -5
- package/{dist/es2015/chat → chat}/builtin-actions.d.ts +0 -0
- package/{dist/es2015/chat → chat}/chat-item.d.ts +0 -0
- package/{dist/es2015/chat → chat}/chat-view.d.ts +1 -1
- package/{dist/es2015/chat → chat}/chat.component.d.ts +7 -7
- package/{dist/es2015/chat → chat}/chat.directives.d.ts +0 -0
- package/chat/chat.module.d.ts +49 -0
- package/{dist/es2015/chat → chat}/l10n/custom-messages.component.d.ts +4 -1
- package/{dist/es2015/chat → chat}/l10n/localized-messages.directive.d.ts +3 -0
- package/{dist/es2015/chat → chat}/l10n/messages.d.ts +3 -0
- package/{dist/es2015/chat → chat}/message-attachments.component.d.ts +5 -2
- package/{dist/es2015/chat → chat}/message-box.component.d.ts +4 -1
- package/{dist/es2015/chat → chat}/message-box.directive.d.ts +3 -0
- package/{dist/es2015/chat → chat}/message-list.component.d.ts +9 -8
- package/{dist/es2015/chat → chat}/message-template.directive.d.ts +3 -0
- package/{dist/es2015/chat → chat}/message.component.d.ts +4 -1
- package/{dist/es2015/chat → chat}/suggested-actions.component.d.ts +4 -1
- package/common/focused-state.directive.d.ts +15 -0
- package/{dist/es2015/common → common}/keys.enum.d.ts +0 -0
- package/{dist/es2015/common → common}/models/message-box-options.d.ts +0 -0
- package/{dist/es2015/common → common}/scroll-anchor.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/utils.d.ts +0 -0
- package/{dist/es2015 → esm2015}/api/action.interface.js +2 -1
- package/{dist/es2015 → esm2015}/api/attachment.interface.js +1 -0
- package/{dist/es2015 → esm2015}/api/execute-action-event.js +0 -0
- package/{dist/es/api/attachment.interface.js → esm2015/api/index.js} +6 -0
- package/{dist/es → esm2015}/api/message.interface.js +1 -0
- package/{dist/es2015 → esm2015}/api/post-message-event.js +0 -0
- package/{dist/es2015 → esm2015}/api/preventable-event.js +0 -0
- package/{dist/es2015 → esm2015}/api/user.interface.js +1 -0
- package/esm2015/cards/hero-card.component.js +90 -0
- package/{dist/es2015 → esm2015}/chat/attachment-template.directive.js +14 -12
- package/esm2015/chat/attachment.component.js +83 -0
- package/{dist/es2015 → esm2015}/chat/builtin-actions.js +13 -16
- package/{dist/es2015 → esm2015}/chat/chat-item.js +0 -0
- package/{dist/es2015 → esm2015}/chat/chat-view.js +0 -6
- package/esm2015/chat/chat.component.js +246 -0
- package/{dist/es → esm2015}/chat/chat.directives.js +0 -0
- package/{dist/es2015 → esm2015}/chat/chat.module.js +43 -15
- package/esm2015/chat/l10n/custom-messages.component.js +42 -0
- package/esm2015/chat/l10n/localized-messages.directive.js +37 -0
- package/esm2015/chat/l10n/messages.js +25 -0
- package/{dist/es2015 → esm2015}/chat/message-attachments.component.js +71 -48
- package/esm2015/chat/message-box.component.js +141 -0
- package/esm2015/chat/message-box.directive.js +24 -0
- package/esm2015/chat/message-list.component.js +279 -0
- package/{dist/es2015 → esm2015}/chat/message-template.directive.js +14 -12
- package/esm2015/chat/message.component.js +140 -0
- package/esm2015/chat/suggested-actions.component.js +113 -0
- package/esm2015/common/focused-state.directive.js +37 -0
- package/{dist/es2015 → esm2015}/common/keys.enum.js +1 -0
- package/{dist/es → esm2015}/common/models/message-box-options.js +1 -0
- package/{dist/es2015 → esm2015}/common/scroll-anchor.directive.js +20 -26
- package/{dist/es2015 → esm2015}/common/utils.js +0 -0
- package/{dist/es/api/action.interface.js → esm2015/kendo-angular-conversational-ui.js} +4 -1
- package/esm2015/main.js +10 -0
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/fesm2015/kendo-angular-conversational-ui.js +1757 -0
- package/{dist/es2015/common/focused-state.directive.d.ts → kendo-angular-conversational-ui.d.ts} +3 -6
- package/main.d.ts +11 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +38 -107
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/dist/cdn/js/kendo-angular-conversational-ui.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/api/execute-action-event.js +0 -24
- package/dist/es/api/post-message-event.js +0 -18
- package/dist/es/api/preventable-event.js +0 -32
- package/dist/es/cards/hero-card.component.js +0 -54
- package/dist/es/chat/attachment-template.directive.js +0 -32
- package/dist/es/chat/attachment.component.js +0 -65
- package/dist/es/chat/builtin-actions.js +0 -28
- package/dist/es/chat/chat-item.js +0 -13
- package/dist/es/chat/chat-view.js +0 -92
- package/dist/es/chat/chat.component.js +0 -190
- package/dist/es/chat/chat.module.js +0 -80
- package/dist/es/chat/l10n/custom-messages.component.js +0 -45
- package/dist/es/chat/l10n/localized-messages.directive.js +0 -36
- package/dist/es/chat/l10n/messages.js +0 -26
- package/dist/es/chat/message-attachments.component.js +0 -148
- package/dist/es/chat/message-box.component.js +0 -124
- package/dist/es/chat/message-box.directive.js +0 -24
- package/dist/es/chat/message-list.component.js +0 -165
- package/dist/es/chat/message-template.directive.js +0 -32
- package/dist/es/chat/message.component.js +0 -77
- package/dist/es/chat/suggested-actions.component.js +0 -91
- package/dist/es/common/focused-state.directive.js +0 -43
- package/dist/es/common/keys.enum.js +0 -4
- package/dist/es/common/scroll-anchor.directive.js +0 -87
- package/dist/es/common/utils.js +0 -13
- package/dist/es/index.js +0 -22
- package/dist/es/main.js +0 -8
- package/dist/es/package-metadata.js +0 -15
- package/dist/es2015/api/message.interface.js +0 -4
- package/dist/es2015/cards/hero-card.component.js +0 -79
- package/dist/es2015/chat/attachment.component.js +0 -66
- package/dist/es2015/chat/chat.component.js +0 -214
- package/dist/es2015/chat/chat.directives.js +0 -8
- package/dist/es2015/chat/chat.module.d.ts +0 -27
- package/dist/es2015/chat/l10n/custom-messages.component.js +0 -37
- package/dist/es2015/chat/l10n/localized-messages.directive.js +0 -32
- package/dist/es2015/chat/l10n/messages.js +0 -20
- package/dist/es2015/chat/message-box.component.js +0 -157
- package/dist/es2015/chat/message-box.directive.js +0 -23
- package/dist/es2015/chat/message-list.component.js +0 -227
- package/dist/es2015/chat/message.component.js +0 -107
- package/dist/es2015/chat/suggested-actions.component.js +0 -105
- package/dist/es2015/common/focused-state.directive.js +0 -45
- package/dist/es2015/common/models/message-box-options.js +0 -4
- package/dist/es2015/index.d.ts +0 -22
- package/dist/es2015/index.js +0 -22
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/main.d.ts +0 -13
- package/dist/es2015/main.js +0 -8
- package/dist/fesm2015/index.js +0 -1554
- package/dist/fesm5/index.js +0 -1383
- package/dist/npm/api/action.interface.js +0 -7
- package/dist/npm/api/attachment.interface.js +0 -6
- package/dist/npm/api/execute-action-event.js +0 -26
- package/dist/npm/api/message.interface.js +0 -6
- package/dist/npm/api/post-message-event.js +0 -20
- package/dist/npm/api/preventable-event.js +0 -34
- package/dist/npm/api/user.interface.js +0 -6
- package/dist/npm/cards/hero-card.component.js +0 -56
- package/dist/npm/chat/attachment-template.directive.js +0 -34
- package/dist/npm/chat/attachment.component.js +0 -67
- package/dist/npm/chat/builtin-actions.js +0 -33
- package/dist/npm/chat/chat-item.js +0 -15
- package/dist/npm/chat/chat-view.js +0 -98
- package/dist/npm/chat/chat.component.js +0 -192
- package/dist/npm/chat/chat.directives.js +0 -14
- package/dist/npm/chat/chat.module.js +0 -82
- package/dist/npm/chat/l10n/custom-messages.component.js +0 -47
- package/dist/npm/chat/l10n/localized-messages.directive.js +0 -38
- package/dist/npm/chat/l10n/messages.js +0 -28
- package/dist/npm/chat/message-attachments.component.js +0 -150
- package/dist/npm/chat/message-box.component.js +0 -126
- package/dist/npm/chat/message-box.directive.js +0 -26
- package/dist/npm/chat/message-list.component.js +0 -167
- package/dist/npm/chat/message-template.directive.js +0 -34
- package/dist/npm/chat/message.component.js +0 -79
- package/dist/npm/chat/suggested-actions.component.js +0 -93
- package/dist/npm/common/focused-state.directive.js +0 -45
- package/dist/npm/common/keys.enum.js +0 -6
- package/dist/npm/common/models/message-box-options.js +0 -6
- package/dist/npm/common/scroll-anchor.directive.js +0 -89
- package/dist/npm/common/utils.js +0 -15
- package/dist/npm/index.js +0 -39
- package/dist/npm/main.js +0 -11
- package/dist/npm/package-metadata.js +0 -17
- package/dist/systemjs/kendo-angular-conversational-ui.js +0 -5
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, forwardRef } from '@angular/core';
|
|
6
|
+
import { Messages } from './messages';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
9
|
+
// eslint-disable no-forward-ref
|
|
10
|
+
/**
|
|
11
|
+
* Custom component messages override default component messages
|
|
12
|
+
* ([see example]({% slug globalization_chat %}#toc-custom-messages)).
|
|
13
|
+
*/
|
|
14
|
+
export class CustomMessagesComponent extends Messages {
|
|
15
|
+
constructor(service) {
|
|
16
|
+
super();
|
|
17
|
+
this.service = service;
|
|
18
|
+
}
|
|
19
|
+
get override() {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CustomMessagesComponent, selector: "kendo-chat-messages", providers: [
|
|
25
|
+
{
|
|
26
|
+
provide: Messages,
|
|
27
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
28
|
+
}
|
|
29
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{
|
|
33
|
+
providers: [
|
|
34
|
+
{
|
|
35
|
+
provide: Messages,
|
|
36
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
selector: 'kendo-chat-messages',
|
|
40
|
+
template: ``
|
|
41
|
+
}]
|
|
42
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, forwardRef } from '@angular/core';
|
|
6
|
+
import { Messages } from './messages';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
9
|
+
// eslint-disable no-forward-ref
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export class LocalizedMessagesDirective extends Messages {
|
|
14
|
+
constructor(service) {
|
|
15
|
+
super();
|
|
16
|
+
this.service = service;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
20
|
+
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: LocalizedMessagesDirective, selector: "[kendoChatLocalizedMessages]", providers: [
|
|
21
|
+
{
|
|
22
|
+
provide: Messages,
|
|
23
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
24
|
+
}
|
|
25
|
+
], usesInheritance: true, ngImport: i0 });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
27
|
+
type: Directive,
|
|
28
|
+
args: [{
|
|
29
|
+
providers: [
|
|
30
|
+
{
|
|
31
|
+
provide: Messages,
|
|
32
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
selector: '[kendoChatLocalizedMessages]'
|
|
36
|
+
}]
|
|
37
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, Input } from '@angular/core';
|
|
6
|
+
import { ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export class Messages extends ComponentMessages {
|
|
12
|
+
}
|
|
13
|
+
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
14
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Messages, selector: "kendoConversationalUIMessages", inputs: { messagePlaceholder: "messagePlaceholder", send: "send" }, usesInheritance: true, ngImport: i0 });
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, decorators: [{
|
|
16
|
+
type: Directive,
|
|
17
|
+
args: [{
|
|
18
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
19
|
+
selector: 'kendoConversationalUIMessages'
|
|
20
|
+
}]
|
|
21
|
+
}], propDecorators: { messagePlaceholder: [{
|
|
22
|
+
type: Input
|
|
23
|
+
}], send: [{
|
|
24
|
+
type: Input
|
|
25
|
+
}] } });
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import
|
|
6
|
-
var MessageAttachmentsComponent_1;
|
|
7
|
-
import { Component, ElementRef, forwardRef, HostBinding, Input, NgZone, QueryList, ViewChild, ViewChildren } from '@angular/core';
|
|
5
|
+
import { Component, ElementRef, forwardRef, HostBinding, Input, ViewChild, ViewChildren } from '@angular/core';
|
|
8
6
|
import { fromEvent } from 'rxjs';
|
|
9
7
|
import { debounceTime } from 'rxjs/operators';
|
|
10
8
|
import { ChatItem } from './chat-item';
|
|
11
|
-
import
|
|
12
|
-
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "./attachment.component";
|
|
11
|
+
import * as i2 from "@angular/common";
|
|
12
|
+
// eslint-disable no-forward-ref
|
|
13
13
|
/**
|
|
14
14
|
* @hidden
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
export class MessageAttachmentsComponent extends ChatItem {
|
|
17
17
|
constructor(zone) {
|
|
18
18
|
super();
|
|
19
19
|
this.zone = zone;
|
|
@@ -93,44 +93,52 @@ let MessageAttachmentsComponent = MessageAttachmentsComponent_1 = class MessageA
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
]
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
]
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
96
|
+
}
|
|
97
|
+
MessageAttachmentsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageAttachmentsComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
98
|
+
MessageAttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MessageAttachmentsComponent, selector: "kendo-chat-message-attachments", inputs: { attachments: "attachments", layout: "layout", tabbable: "tabbable", template: "template" }, host: { properties: { "class.k-card-deck-scrollwrap": "this.carousel" } }, providers: [{
|
|
99
|
+
provide: ChatItem,
|
|
100
|
+
useExisting: forwardRef(() => MessageAttachmentsComponent)
|
|
101
|
+
}], viewQueries: [{ propertyName: "deck", first: true, predicate: ["deck"], descendants: true, read: ElementRef, static: true }, { propertyName: "items", predicate: ["item"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: `
|
|
102
|
+
<button
|
|
103
|
+
*ngIf="carousel && scrollPosition > 0"
|
|
104
|
+
(click)="scrollTo(-1)"
|
|
105
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
106
|
+
tabindex="-1">
|
|
107
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-left"></span>
|
|
108
|
+
</button>
|
|
109
|
+
<div #deck [class.k-card-deck]="carousel">
|
|
110
|
+
<kendo-chat-attachment #item
|
|
111
|
+
*ngFor="let att of attachments; index as index; first as first; last as last"
|
|
112
|
+
[attachment]="att"
|
|
113
|
+
[template]="template"
|
|
114
|
+
[class.k-state-selected]="isSelected(index)"
|
|
115
|
+
[class.k-state-focused]="isSelected(index)"
|
|
116
|
+
[class.k-card-wrap]="true"
|
|
117
|
+
[class.k-first]="first"
|
|
118
|
+
[class.k-last]="last"
|
|
119
|
+
[attr.tabindex]="tabbable && isSelected(index) ? '0' : '-1'"
|
|
120
|
+
(click)="itemClick(index)"
|
|
121
|
+
(keydown)="itemKeydown($event, att)"
|
|
122
|
+
>
|
|
123
|
+
</kendo-chat-attachment>
|
|
124
|
+
</div>
|
|
125
|
+
<button
|
|
126
|
+
*ngIf="carousel && scrollPosition < 1"
|
|
127
|
+
(click)="scrollTo(1)"
|
|
128
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
129
|
+
tabindex="-1">
|
|
130
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-right"></span>
|
|
131
|
+
</button>
|
|
132
|
+
`, isInline: true, components: [{ type: i1.AttachmentComponent, selector: "kendo-chat-attachment", inputs: ["attachment", "template"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageAttachmentsComponent, decorators: [{
|
|
134
|
+
type: Component,
|
|
135
|
+
args: [{
|
|
136
|
+
providers: [{
|
|
137
|
+
provide: ChatItem,
|
|
138
|
+
useExisting: forwardRef(() => MessageAttachmentsComponent)
|
|
139
|
+
}],
|
|
140
|
+
selector: 'kendo-chat-message-attachments',
|
|
141
|
+
template: `
|
|
134
142
|
<button
|
|
135
143
|
*ngIf="carousel && scrollPosition > 0"
|
|
136
144
|
(click)="scrollTo(-1)"
|
|
@@ -162,7 +170,22 @@ MessageAttachmentsComponent = MessageAttachmentsComponent_1 = tslib_1.__decorate
|
|
|
162
170
|
<span class="k-icon k-button-icon k-i-arrow-chevron-right"></span>
|
|
163
171
|
</button>
|
|
164
172
|
`
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
173
|
+
}]
|
|
174
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { attachments: [{
|
|
175
|
+
type: Input
|
|
176
|
+
}], layout: [{
|
|
177
|
+
type: Input
|
|
178
|
+
}], tabbable: [{
|
|
179
|
+
type: Input
|
|
180
|
+
}], template: [{
|
|
181
|
+
type: Input
|
|
182
|
+
}], carousel: [{
|
|
183
|
+
type: HostBinding,
|
|
184
|
+
args: ['class.k-card-deck-scrollwrap']
|
|
185
|
+
}], deck: [{
|
|
186
|
+
type: ViewChild,
|
|
187
|
+
args: ['deck', { read: ElementRef, static: true }]
|
|
188
|
+
}], items: [{
|
|
189
|
+
type: ViewChildren,
|
|
190
|
+
args: ['item', { read: ElementRef }]
|
|
191
|
+
}] } });
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, EventEmitter, HostBinding, Input, Output, ViewChild } from '@angular/core';
|
|
6
|
+
import { SendMessageEvent } from '../api/post-message-event';
|
|
7
|
+
import { Keys } from '@progress/kendo-angular-common';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "@angular/common";
|
|
10
|
+
import * as i2 from "../common/focused-state.directive";
|
|
11
|
+
import * as i3 from "@progress/kendo-angular-buttons";
|
|
12
|
+
// tslint:disable-next-line:max-line-length
|
|
13
|
+
const sendIcon = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path d="M0,14.3c-0.1,0.6,0.3,0.8,0.8,0.6l14.8-6.5c0.5-0.2,0.5-0.6,0-0.8L0.8,1.1C0.3,0.9-0.1,1.1,0,1.7l0.7,4.2C0.8,6.5,1.4,7,1.9,7.1l8.8,0.8c0.6,0.1,0.6,0.1,0,0.2L1.9,8.9C1.4,9,0.8,9.5,0.7,10.1L0,14.3z"/></svg>';
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export class MessageBoxComponent {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.hostClasses = 'k-message-box k-input k-input-md k-rounded-md k-input-solid';
|
|
20
|
+
this.sendMessage = new EventEmitter();
|
|
21
|
+
}
|
|
22
|
+
get messageBoxValue() {
|
|
23
|
+
return this.type === 'textarea';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
sendClick() {
|
|
29
|
+
const input = this.messageBoxInput.nativeElement;
|
|
30
|
+
const value = input.value;
|
|
31
|
+
if (!value) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const message = {
|
|
35
|
+
author: this.user,
|
|
36
|
+
text: value,
|
|
37
|
+
timestamp: new Date()
|
|
38
|
+
};
|
|
39
|
+
this.sendMessage.emit(new SendMessageEvent(message));
|
|
40
|
+
input.value = null;
|
|
41
|
+
input.focus();
|
|
42
|
+
this.autoScroll = true;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*/
|
|
47
|
+
inputKeydown(e) {
|
|
48
|
+
if (e.keyCode === Keys.Enter) {
|
|
49
|
+
this.sendClick();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @hidden
|
|
54
|
+
*/
|
|
55
|
+
textAreaKeydown(e) {
|
|
56
|
+
const isEnter = e.keyCode === Keys.Enter;
|
|
57
|
+
if (!isEnter) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const newLine = (e.metaKey || e.ctrlKey);
|
|
61
|
+
const enterOnly = !(e.shiftKey || e.metaKey || e.ctrlKey);
|
|
62
|
+
if (enterOnly) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
this.sendClick();
|
|
65
|
+
}
|
|
66
|
+
if (newLine) {
|
|
67
|
+
this.messageBoxInput.nativeElement.value += `\r\n`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
textFor(key) {
|
|
74
|
+
return this.localization.get(key);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
MessageBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
+
MessageBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MessageBoxComponent, selector: "kendo-message-box", inputs: { user: "user", autoScroll: "autoScroll", type: "type", localization: "localization", messageBoxTemplate: "messageBoxTemplate" }, outputs: { sendMessage: "sendMessage" }, host: { properties: { "class": "this.hostClasses", "class.!k-align-items-end": "this.messageBoxValue" } }, viewQueries: [{ propertyName: "messageBoxInput", first: true, predicate: ["messageBoxInput"], descendants: true }], ngImport: i0, template: "\n <ng-container *ngIf=\"!messageBoxTemplate\">\n <input\n *ngIf=\"type === 'textbox'\"\n #messageBoxInput\n kendoChatFocusedState\n type=\"text\"\n class=\"k-textbox k-input k-input-md k-input-solid\"\n [placeholder]=\"textFor('messagePlaceholder')\"\n (keydown)=\"inputKeydown($event)\"\n />\n\n <textarea\n *ngIf=\"type === 'textarea'\"\n #messageBoxInput\n kendoChatFocusedState\n [rows]=\"3\"\n class=\"k-textarea k-input k-input-md k-input-solid !k-overflow-y-auto k-resize-none\"\n [placeholder]=\"textFor('messagePlaceholder')\"\n (keydown)=\"textAreaKeydown($event)\"\n ></textarea>\n\n <button\n kendoButton\n fillMode=\"flat\"\n class=\"k-button-send\"\n [tabindex]=\"0\"\n [attr.title]=\"textFor('send')\"\n (click)=\"sendClick()\"\n >\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" viewBox=\"0 0 16 16\"><path d=\"M0,14.3c-0.1,0.6,0.3,0.8,0.8,0.6l14.8-6.5c0.5-0.2,0.5-0.6,0-0.8L0.8,1.1C0.3,0.9-0.1,1.1,0,1.7l0.7,4.2C0.8,6.5,1.4,7,1.9,7.1l8.8,0.8c0.6,0.1,0.6,0.1,0,0.2L1.9,8.9C1.4,9,0.8,9.5,0.7,10.1L0,14.3z\"/></svg>\n </button>\n </ng-container>\n\n <ng-template *ngIf=\"messageBoxTemplate\" [ngTemplateOutlet]=\"messageBoxTemplate?.templateRef\"></ng-template>\n", isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.FocusedStateDirective, selector: "[kendoChatFocusedState]" }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
80
|
+
type: Component,
|
|
81
|
+
args: [{
|
|
82
|
+
selector: 'kendo-message-box',
|
|
83
|
+
template: `
|
|
84
|
+
<ng-container *ngIf="!messageBoxTemplate">
|
|
85
|
+
<input
|
|
86
|
+
*ngIf="type === 'textbox'"
|
|
87
|
+
#messageBoxInput
|
|
88
|
+
kendoChatFocusedState
|
|
89
|
+
type="text"
|
|
90
|
+
class="k-textbox k-input k-input-md k-input-solid"
|
|
91
|
+
[placeholder]="textFor('messagePlaceholder')"
|
|
92
|
+
(keydown)="inputKeydown($event)"
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<textarea
|
|
96
|
+
*ngIf="type === 'textarea'"
|
|
97
|
+
#messageBoxInput
|
|
98
|
+
kendoChatFocusedState
|
|
99
|
+
[rows]="3"
|
|
100
|
+
class="k-textarea k-input k-input-md k-input-solid !k-overflow-y-auto k-resize-none"
|
|
101
|
+
[placeholder]="textFor('messagePlaceholder')"
|
|
102
|
+
(keydown)="textAreaKeydown($event)"
|
|
103
|
+
></textarea>
|
|
104
|
+
|
|
105
|
+
<button
|
|
106
|
+
kendoButton
|
|
107
|
+
fillMode="flat"
|
|
108
|
+
class="k-button-send"
|
|
109
|
+
[tabindex]="0"
|
|
110
|
+
[attr.title]="textFor('send')"
|
|
111
|
+
(click)="sendClick()"
|
|
112
|
+
>
|
|
113
|
+
${sendIcon}
|
|
114
|
+
</button>
|
|
115
|
+
</ng-container>
|
|
116
|
+
|
|
117
|
+
<ng-template *ngIf="messageBoxTemplate" [ngTemplateOutlet]="messageBoxTemplate?.templateRef"></ng-template>
|
|
118
|
+
`
|
|
119
|
+
}]
|
|
120
|
+
}], propDecorators: { hostClasses: [{
|
|
121
|
+
type: HostBinding,
|
|
122
|
+
args: ['class']
|
|
123
|
+
}], messageBoxValue: [{
|
|
124
|
+
type: HostBinding,
|
|
125
|
+
args: ['class.\!k-align-items-end']
|
|
126
|
+
}], messageBoxInput: [{
|
|
127
|
+
type: ViewChild,
|
|
128
|
+
args: ['messageBoxInput', { static: false }]
|
|
129
|
+
}], user: [{
|
|
130
|
+
type: Input
|
|
131
|
+
}], autoScroll: [{
|
|
132
|
+
type: Input
|
|
133
|
+
}], type: [{
|
|
134
|
+
type: Input
|
|
135
|
+
}], localization: [{
|
|
136
|
+
type: Input
|
|
137
|
+
}], messageBoxTemplate: [{
|
|
138
|
+
type: Input
|
|
139
|
+
}], sendMessage: [{
|
|
140
|
+
type: Output
|
|
141
|
+
}] } });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Creates a message box area that overrides the default message box of the Conversational UI Component.
|
|
9
|
+
* To define a message-box template, nest an `<ng-template>` tag with the `kendoChatMessageBoxTemplate` directive inside the `<kendo-chat>` tag
|
|
10
|
+
* [see example]({% slug message_box %}#toc-message-box-template).
|
|
11
|
+
*/
|
|
12
|
+
export class ChatMessageBoxTemplateDirective {
|
|
13
|
+
constructor(templateRef) {
|
|
14
|
+
this.templateRef = templateRef;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
ChatMessageBoxTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatMessageBoxTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
18
|
+
ChatMessageBoxTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ChatMessageBoxTemplateDirective, selector: "[kendoChatMessageBoxTemplate]", ngImport: i0 });
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatMessageBoxTemplateDirective, decorators: [{
|
|
20
|
+
type: Directive,
|
|
21
|
+
args: [{
|
|
22
|
+
selector: '[kendoChatMessageBoxTemplate]'
|
|
23
|
+
}]
|
|
24
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|