@progress/kendo-angular-conversational-ui 4.0.2-dev.202203091004 → 5.0.0-next.202203171033

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.
Files changed (148) hide show
  1. package/{dist/es2015/api → api}/action.interface.d.ts +4 -4
  2. package/{dist/es2015/api → api}/attachment.interface.d.ts +0 -0
  3. package/{dist/es2015/api → api}/execute-action-event.d.ts +1 -1
  4. package/{dist/es/api/user.interface.js → api/index.d.ts} +6 -0
  5. package/{dist/es2015/api → api}/message.interface.d.ts +0 -0
  6. package/{dist/es2015/api → api}/post-message-event.d.ts +0 -0
  7. package/{dist/es2015/api → api}/preventable-event.d.ts +0 -0
  8. package/{dist/es2015/api → api}/user.interface.d.ts +0 -0
  9. package/bundles/kendo-angular-conversational-ui.umd.js +5 -0
  10. package/{dist/es2015/cards → cards}/hero-card.component.d.ts +3 -0
  11. package/{dist/es2015/chat → chat}/attachment-template.directive.d.ts +3 -0
  12. package/{dist/es2015/chat → chat}/attachment.component.d.ts +9 -5
  13. package/{dist/es2015/chat → chat}/builtin-actions.d.ts +0 -0
  14. package/{dist/es2015/chat → chat}/chat-item.d.ts +0 -0
  15. package/{dist/es2015/chat → chat}/chat-view.d.ts +1 -1
  16. package/{dist/es2015/chat → chat}/chat.component.d.ts +6 -6
  17. package/{dist/es2015/chat → chat}/chat.directives.d.ts +0 -0
  18. package/chat/chat.module.d.ts +47 -0
  19. package/{dist/es2015/chat → chat}/l10n/custom-messages.component.d.ts +4 -1
  20. package/{dist/es2015/chat → chat}/l10n/localized-messages.directive.d.ts +3 -0
  21. package/{dist/es2015/chat → chat}/l10n/messages.d.ts +3 -0
  22. package/{dist/es2015/chat → chat}/message-attachments.component.d.ts +5 -2
  23. package/{dist/es2015/chat → chat}/message-list.component.d.ts +8 -7
  24. package/{dist/es2015/chat → chat}/message-template.directive.d.ts +3 -0
  25. package/{dist/es2015/chat → chat}/message.component.d.ts +4 -1
  26. package/{dist/es2015/chat → chat}/suggested-actions.component.d.ts +4 -1
  27. package/common/focused-state.directive.d.ts +15 -0
  28. package/{dist/es2015/common → common}/keys.enum.d.ts +0 -0
  29. package/{dist/es2015/common → common}/scroll-anchor.directive.d.ts +3 -0
  30. package/{dist/es2015/common → common}/utils.d.ts +0 -0
  31. package/{dist/es2015 → esm2015}/api/action.interface.js +2 -1
  32. package/{dist/es2015 → esm2015}/api/attachment.interface.js +1 -0
  33. package/{dist/es2015 → esm2015}/api/execute-action-event.js +0 -0
  34. package/{dist/es/api/attachment.interface.js → esm2015/api/index.js} +6 -0
  35. package/{dist/es → esm2015}/api/message.interface.js +1 -0
  36. package/{dist/es2015 → esm2015}/api/post-message-event.js +0 -0
  37. package/{dist/es2015 → esm2015}/api/preventable-event.js +0 -0
  38. package/{dist/es2015 → esm2015}/api/user.interface.js +1 -0
  39. package/esm2015/cards/hero-card.component.js +88 -0
  40. package/{dist/es2015 → esm2015}/chat/attachment-template.directive.js +14 -12
  41. package/esm2015/chat/attachment.component.js +83 -0
  42. package/{dist/es2015 → esm2015}/chat/builtin-actions.js +13 -16
  43. package/{dist/es2015 → esm2015}/chat/chat-item.js +0 -0
  44. package/{dist/es2015 → esm2015}/chat/chat-view.js +0 -6
  45. package/esm2015/chat/chat.component.js +225 -0
  46. package/{dist/es → esm2015}/chat/chat.directives.js +0 -0
  47. package/{dist/es2015 → esm2015}/chat/chat.module.js +40 -15
  48. package/esm2015/chat/l10n/custom-messages.component.js +42 -0
  49. package/esm2015/chat/l10n/localized-messages.directive.js +37 -0
  50. package/esm2015/chat/l10n/messages.js +24 -0
  51. package/{dist/es2015 → esm2015}/chat/message-attachments.component.js +71 -48
  52. package/esm2015/chat/message-list.component.js +279 -0
  53. package/{dist/es2015 → esm2015}/chat/message-template.directive.js +14 -12
  54. package/esm2015/chat/message.component.js +140 -0
  55. package/esm2015/chat/suggested-actions.component.js +111 -0
  56. package/esm2015/common/focused-state.directive.js +37 -0
  57. package/{dist/es2015 → esm2015}/common/keys.enum.js +1 -0
  58. package/{dist/es2015 → esm2015}/common/scroll-anchor.directive.js +20 -26
  59. package/{dist/es2015 → esm2015}/common/utils.js +0 -0
  60. package/{dist/es/api/action.interface.js → esm2015/kendo-angular-conversational-ui.js} +4 -1
  61. package/{dist/npm/chat/chat-item.js → esm2015/main.js} +5 -11
  62. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  63. package/fesm2015/kendo-angular-conversational-ui.js +1575 -0
  64. package/{dist/es2015/common/focused-state.directive.d.ts → kendo-angular-conversational-ui.d.ts} +3 -6
  65. package/main.d.ts +9 -0
  66. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  67. package/package.json +34 -101
  68. package/schematics/ngAdd/index.js +5 -2
  69. package/schematics/ngAdd/index.js.map +1 -1
  70. package/dist/cdn/js/kendo-angular-conversational-ui.js +0 -20
  71. package/dist/cdn/main.js +0 -5
  72. package/dist/es/api/execute-action-event.js +0 -24
  73. package/dist/es/api/post-message-event.js +0 -18
  74. package/dist/es/api/preventable-event.js +0 -32
  75. package/dist/es/cards/hero-card.component.js +0 -54
  76. package/dist/es/chat/attachment-template.directive.js +0 -32
  77. package/dist/es/chat/attachment.component.js +0 -65
  78. package/dist/es/chat/builtin-actions.js +0 -28
  79. package/dist/es/chat/chat-item.js +0 -13
  80. package/dist/es/chat/chat-view.js +0 -92
  81. package/dist/es/chat/chat.component.js +0 -193
  82. package/dist/es/chat/chat.module.js +0 -76
  83. package/dist/es/chat/l10n/custom-messages.component.js +0 -45
  84. package/dist/es/chat/l10n/localized-messages.directive.js +0 -36
  85. package/dist/es/chat/l10n/messages.js +0 -26
  86. package/dist/es/chat/message-attachments.component.js +0 -148
  87. package/dist/es/chat/message-list.component.js +0 -165
  88. package/dist/es/chat/message-template.directive.js +0 -32
  89. package/dist/es/chat/message.component.js +0 -77
  90. package/dist/es/chat/suggested-actions.component.js +0 -91
  91. package/dist/es/common/focused-state.directive.js +0 -43
  92. package/dist/es/common/keys.enum.js +0 -4
  93. package/dist/es/common/scroll-anchor.directive.js +0 -87
  94. package/dist/es/common/utils.js +0 -13
  95. package/dist/es/index.js +0 -21
  96. package/dist/es/main.js +0 -8
  97. package/dist/es/package-metadata.js +0 -15
  98. package/dist/es2015/api/message.interface.js +0 -4
  99. package/dist/es2015/cards/hero-card.component.js +0 -78
  100. package/dist/es2015/chat/attachment.component.js +0 -66
  101. package/dist/es2015/chat/chat.component.js +0 -230
  102. package/dist/es2015/chat/chat.directives.js +0 -7
  103. package/dist/es2015/chat/chat.module.d.ts +0 -27
  104. package/dist/es2015/chat/l10n/custom-messages.component.js +0 -37
  105. package/dist/es2015/chat/l10n/localized-messages.directive.js +0 -32
  106. package/dist/es2015/chat/l10n/messages.js +0 -20
  107. package/dist/es2015/chat/message-list.component.js +0 -227
  108. package/dist/es2015/chat/message.component.js +0 -107
  109. package/dist/es2015/chat/suggested-actions.component.js +0 -104
  110. package/dist/es2015/common/focused-state.directive.js +0 -45
  111. package/dist/es2015/index.d.ts +0 -21
  112. package/dist/es2015/index.js +0 -21
  113. package/dist/es2015/index.metadata.json +0 -1
  114. package/dist/es2015/main.d.ts +0 -12
  115. package/dist/es2015/main.js +0 -8
  116. package/dist/fesm2015/index.js +0 -1403
  117. package/dist/fesm5/index.js +0 -1253
  118. package/dist/npm/api/action.interface.js +0 -7
  119. package/dist/npm/api/attachment.interface.js +0 -6
  120. package/dist/npm/api/execute-action-event.js +0 -26
  121. package/dist/npm/api/message.interface.js +0 -6
  122. package/dist/npm/api/post-message-event.js +0 -20
  123. package/dist/npm/api/preventable-event.js +0 -34
  124. package/dist/npm/api/user.interface.js +0 -6
  125. package/dist/npm/cards/hero-card.component.js +0 -56
  126. package/dist/npm/chat/attachment-template.directive.js +0 -34
  127. package/dist/npm/chat/attachment.component.js +0 -67
  128. package/dist/npm/chat/builtin-actions.js +0 -33
  129. package/dist/npm/chat/chat-view.js +0 -98
  130. package/dist/npm/chat/chat.component.js +0 -195
  131. package/dist/npm/chat/chat.directives.js +0 -12
  132. package/dist/npm/chat/chat.module.js +0 -78
  133. package/dist/npm/chat/l10n/custom-messages.component.js +0 -47
  134. package/dist/npm/chat/l10n/localized-messages.directive.js +0 -38
  135. package/dist/npm/chat/l10n/messages.js +0 -28
  136. package/dist/npm/chat/message-attachments.component.js +0 -150
  137. package/dist/npm/chat/message-list.component.js +0 -167
  138. package/dist/npm/chat/message-template.directive.js +0 -34
  139. package/dist/npm/chat/message.component.js +0 -79
  140. package/dist/npm/chat/suggested-actions.component.js +0 -93
  141. package/dist/npm/common/focused-state.directive.js +0 -45
  142. package/dist/npm/common/keys.enum.js +0 -6
  143. package/dist/npm/common/scroll-anchor.directive.js +0 -89
  144. package/dist/npm/common/utils.js +0 -15
  145. package/dist/npm/index.js +0 -37
  146. package/dist/npm/main.js +0 -11
  147. package/dist/npm/package-metadata.js +0 -17
  148. package/dist/systemjs/kendo-angular-conversational-ui.js +0 -5
@@ -1,13 +0,0 @@
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
- /**
6
- * @hidden
7
- */
8
- export var closest = function (node, predicate) {
9
- while (node && !predicate(node)) {
10
- node = node.parentNode;
11
- }
12
- return node;
13
- };
package/dist/es/index.js DELETED
@@ -1,21 +0,0 @@
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
- /**
6
- * Generated bundle index. Do not edit.
7
- */
8
- export * from './main';
9
- export { PreventableEvent } from './api/preventable-event';
10
- export { HeroCardComponent } from './cards/hero-card.component';
11
- export { AttachmentComponent } from './chat/attachment.component';
12
- export { ChatItem } from './chat/chat-item';
13
- export { CustomMessagesComponent } from './chat/l10n/custom-messages.component';
14
- export { LocalizedMessagesDirective } from './chat/l10n/localized-messages.directive';
15
- export { Messages } from './chat/l10n/messages';
16
- export { MessageAttachmentsComponent } from './chat/message-attachments.component';
17
- export { MessageListComponent } from './chat/message-list.component';
18
- export { MessageComponent } from './chat/message.component';
19
- export { SuggestedActionsComponent } from './chat/suggested-actions.component';
20
- export { FocusedStateDirective } from './common/focused-state.directive';
21
- export { ScrollAnchorDirective } from './common/scroll-anchor.directive';
package/dist/es/main.js DELETED
@@ -1,8 +0,0 @@
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
- export * from './chat/chat.directives';
6
- export * from './chat/chat.module';
7
- export * from './api/execute-action-event';
8
- export * from './api/post-message-event';
@@ -1,15 +0,0 @@
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
- /**
6
- * @hidden
7
- */
8
- export var packageMetadata = {
9
- name: '@progress/kendo-angular-conversational-ui',
10
- productName: 'Kendo UI for Angular',
11
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1646820248,
13
- version: '',
14
- licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
- };
@@ -1,4 +0,0 @@
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
- *-------------------------------------------------------------------------------------------*/
@@ -1,78 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
7
- /**
8
- * Represents a Hero Card component ([see example]({% slug dialogflow_chat %})).
9
- * Hero cards host a single large image and action buttons with text content.
10
- */
11
- let HeroCardComponent = class HeroCardComponent {
12
- /**
13
- * Represents a Hero Card component ([see example]({% slug dialogflow_chat %})).
14
- * Hero cards host a single large image and action buttons with text content.
15
- */
16
- constructor() {
17
- this.cssClass = true;
18
- /**
19
- * Fires when the user clicks a button.
20
- */
21
- this.executeAction = new EventEmitter();
22
- }
23
- onClick(action) {
24
- this.executeAction.next(action);
25
- }
26
- };
27
- tslib_1.__decorate([
28
- Input(),
29
- tslib_1.__metadata("design:type", String)
30
- ], HeroCardComponent.prototype, "imageUrl", void 0);
31
- tslib_1.__decorate([
32
- Input(),
33
- tslib_1.__metadata("design:type", String)
34
- ], HeroCardComponent.prototype, "title", void 0);
35
- tslib_1.__decorate([
36
- Input(),
37
- tslib_1.__metadata("design:type", String)
38
- ], HeroCardComponent.prototype, "subtitle", void 0);
39
- tslib_1.__decorate([
40
- Input(),
41
- tslib_1.__metadata("design:type", Array)
42
- ], HeroCardComponent.prototype, "actions", void 0);
43
- tslib_1.__decorate([
44
- HostBinding('class.k-card'),
45
- tslib_1.__metadata("design:type", Boolean)
46
- ], HeroCardComponent.prototype, "cssClass", void 0);
47
- tslib_1.__decorate([
48
- Output(),
49
- tslib_1.__metadata("design:type", EventEmitter)
50
- ], HeroCardComponent.prototype, "executeAction", void 0);
51
- HeroCardComponent = tslib_1.__decorate([
52
- Component({
53
- selector: 'kendo-chat-hero-card',
54
- template: `
55
- <img class="k-card-image" [src]="imageUrl" *ngIf="imageUrl" />
56
- <div class="k-card-body">
57
- <h5 class="k-card-title" *ngIf="title">
58
- {{ title }}
59
- </h5>
60
- <h6 class="k-card-subtitle" *ngIf="subtitle">
61
- {{ subtitle }}
62
- </h6>
63
- </div>
64
- <div class="k-card-actions k-card-actions-vertical">
65
- <span class="k-card-action"
66
- *ngFor="let act of actions"
67
- >
68
- <button
69
- kendoButton fillMode="flat"
70
- (click)="onClick(act)">
71
- {{ act.title }}
72
- </button>
73
- </span>
74
- </div>
75
- `
76
- })
77
- ], HeroCardComponent);
78
- export { HeroCardComponent };
@@ -1,66 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { Component, Input } from '@angular/core';
7
- import { AttachmentTemplateDirective } from './chat.directives';
8
- /**
9
- * @hidden
10
- */
11
- let AttachmentComponent = class AttachmentComponent {
12
- set attachment(value) {
13
- this._attachment = value;
14
- this.context = {
15
- $implicit: this.attachment
16
- };
17
- }
18
- get attachment() {
19
- return this._attachment;
20
- }
21
- get image() {
22
- return this.contentType.indexOf('image/') === 0;
23
- }
24
- get unknown() {
25
- return !this.image;
26
- }
27
- get contentType() {
28
- return this.attachment.contentType || '';
29
- }
30
- };
31
- tslib_1.__decorate([
32
- Input(),
33
- tslib_1.__metadata("design:type", Object),
34
- tslib_1.__metadata("design:paramtypes", [Object])
35
- ], AttachmentComponent.prototype, "attachment", null);
36
- tslib_1.__decorate([
37
- Input(),
38
- tslib_1.__metadata("design:type", AttachmentTemplateDirective)
39
- ], AttachmentComponent.prototype, "template", void 0);
40
- AttachmentComponent = tslib_1.__decorate([
41
- Component({
42
- selector: 'kendo-chat-attachment',
43
- template: `
44
- <ng-container *ngIf="template">
45
- <ng-container *ngTemplateOutlet="template.templateRef; context: context;">
46
- </ng-container>
47
- </ng-container>
48
-
49
- <div *ngIf="!template" class="k-card">
50
- <div class="k-card-body">
51
- <h5 class="k-card-title" *ngIf="attachment.title">
52
- {{ attachment.title }}
53
- </h5>
54
- <h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
55
- {{ attachment.subtitle }}
56
- </h6>
57
- <img *ngIf="image" [attr.src]="attachment.content" />
58
- <ng-container *ngIf="unknown">
59
- {{ attachment.content }}
60
- </ng-container>
61
- </div>
62
- </div>
63
- `
64
- })
65
- ], AttachmentComponent);
66
- export { AttachmentComponent };
@@ -1,230 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, isDevMode, Output, ViewChild, NgZone } from '@angular/core';
7
- import { AttachmentTemplateDirective } from './attachment-template.directive';
8
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
9
- import { makeHandler } from './builtin-actions';
10
- import { MessageTemplateDirective } from './message-template.directive';
11
- import { SendMessageEvent } from '../api/post-message-event';
12
- import { validatePackage } from '@progress/kendo-licensing';
13
- import { packageMetadata } from '../package-metadata';
14
- // tslint:disable-next-line:max-line-length
15
- 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>';
16
- /**
17
- * Represents the Kendo UI Chat component for Angular.
18
- *
19
- * {% meta height:700 %}
20
- * {% embed_file echo/app.component.ts preview %}
21
- * {% embed_file shared/app.module.ts %}
22
- * {% embed_file shared/main.ts hidden %}
23
- * {% endmeta %}
24
- *
25
- */
26
- let ChatComponent = class ChatComponent {
27
- constructor(localization, zone) {
28
- this.localization = localization;
29
- this.zone = zone;
30
- /**
31
- * Fires when the user types a message and clicks the **Send** button or presses **Enter**.
32
- * Emits the [`SendMessageEvent`]({% slug api_conversational-ui_sendmessageevent %}).
33
- *
34
- * > The message is not automatically appended to the `messages` array.
35
- */
36
- this.sendMessage = new EventEmitter();
37
- /**
38
- * Fires when the user clicks a quick action button.
39
- * The Chat internally handles the `reply`, `openUrl`, and `call` [known actions]({% slug api_conversational-ui_actiontype %}).
40
- *
41
- * Emits the [`ExecuteActionEvent`]({% slug api_conversational-ui_executeactionevent %}).
42
- * The event is preventable. If `preventDefault` is called, the built-in action will be suppressed.
43
- */
44
- this.executeAction = new EventEmitter();
45
- /**
46
- * @hidden
47
- */
48
- this.autoScroll = true;
49
- validatePackage(packageMetadata);
50
- this.direction = localization.rtl ? 'rtl' : 'ltr';
51
- this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
52
- this.direction = rtl ? 'rtl' : 'ltr';
53
- });
54
- }
55
- get className() {
56
- return 'k-widget k-chat';
57
- }
58
- get dirAttr() {
59
- return this.direction;
60
- }
61
- ngOnChanges() {
62
- this.zone.runOutsideAngular(() => setTimeout(() => {
63
- this.messageList.nativeElement.style.flex = '1 1 auto';
64
- }));
65
- }
66
- ngAfterViewInit() {
67
- if (!isDevMode()) {
68
- return;
69
- }
70
- if (!this.user) {
71
- throw new Error('User must be set and have a valid id.');
72
- }
73
- }
74
- ngOnDestroy() {
75
- if (this.localizationChangeSubscription) {
76
- this.localizationChangeSubscription.unsubscribe();
77
- }
78
- }
79
- /**
80
- * @hidden
81
- */
82
- sendClick() {
83
- const input = this.messageInput.nativeElement;
84
- const value = input.value;
85
- if (!value) {
86
- return;
87
- }
88
- const message = {
89
- author: this.user,
90
- text: value,
91
- timestamp: new Date()
92
- };
93
- this.sendMessage.emit(new SendMessageEvent(message));
94
- input.value = null;
95
- input.focus();
96
- this.autoScroll = true;
97
- }
98
- /**
99
- * @hidden
100
- */
101
- inputKeydown(e) {
102
- if (e.keyCode === 13 /* enter */) {
103
- this.sendClick();
104
- }
105
- }
106
- /**
107
- * @hidden
108
- */
109
- dispatchAction(e) {
110
- this.executeAction.emit(e);
111
- if (!e.isDefaultPrevented()) {
112
- const handler = makeHandler(e.action);
113
- handler(e.action, this);
114
- this.messageInput.nativeElement.focus();
115
- }
116
- }
117
- /**
118
- * @hidden
119
- */
120
- textFor(key) {
121
- return this.localization.get(key);
122
- }
123
- };
124
- tslib_1.__decorate([
125
- Input(),
126
- tslib_1.__metadata("design:type", Array)
127
- ], ChatComponent.prototype, "messages", void 0);
128
- tslib_1.__decorate([
129
- Input(),
130
- tslib_1.__metadata("design:type", Object)
131
- ], ChatComponent.prototype, "user", void 0);
132
- tslib_1.__decorate([
133
- Output(),
134
- tslib_1.__metadata("design:type", EventEmitter)
135
- ], ChatComponent.prototype, "sendMessage", void 0);
136
- tslib_1.__decorate([
137
- Output(),
138
- tslib_1.__metadata("design:type", EventEmitter)
139
- ], ChatComponent.prototype, "executeAction", void 0);
140
- tslib_1.__decorate([
141
- HostBinding('class'),
142
- tslib_1.__metadata("design:type", String),
143
- tslib_1.__metadata("design:paramtypes", [])
144
- ], ChatComponent.prototype, "className", null);
145
- tslib_1.__decorate([
146
- HostBinding('attr.dir'),
147
- tslib_1.__metadata("design:type", String),
148
- tslib_1.__metadata("design:paramtypes", [])
149
- ], ChatComponent.prototype, "dirAttr", null);
150
- tslib_1.__decorate([
151
- ContentChild(AttachmentTemplateDirective, { static: false }),
152
- tslib_1.__metadata("design:type", AttachmentTemplateDirective)
153
- ], ChatComponent.prototype, "attachmentTemplate", void 0);
154
- tslib_1.__decorate([
155
- ContentChild(MessageTemplateDirective, { static: false }),
156
- tslib_1.__metadata("design:type", MessageTemplateDirective)
157
- ], ChatComponent.prototype, "messageTemplate", void 0);
158
- tslib_1.__decorate([
159
- ViewChild('messageInput', { static: true }),
160
- tslib_1.__metadata("design:type", ElementRef)
161
- ], ChatComponent.prototype, "messageInput", void 0);
162
- tslib_1.__decorate([
163
- ViewChild('messageList', { static: true }),
164
- tslib_1.__metadata("design:type", ElementRef)
165
- ], ChatComponent.prototype, "messageList", void 0);
166
- ChatComponent = tslib_1.__decorate([
167
- Component({
168
- providers: [
169
- LocalizationService,
170
- {
171
- provide: L10N_PREFIX,
172
- useValue: 'kendo.chat'
173
- }
174
- ],
175
- selector: 'kendo-chat',
176
- template: `
177
- <ng-container
178
- kendoChatLocalizedMessages
179
- i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
180
- messagePlaceholder="Type a message..."
181
-
182
- i18n-send="kendo.chat.send|The text for the Send button"
183
- send="Send..."
184
- >
185
- </ng-container>
186
-
187
- <div
188
- #messageList
189
- class="k-message-list k-avatars"
190
- aria-live="polite" role="log"
191
- kendoChatScrollAnchor
192
- #anchor="scrollAnchor"
193
- [(autoScroll)]="autoScroll"
194
- >
195
- <kendo-chat-message-list
196
- [messages]="messages"
197
- [messageTemplate]="messageTemplate"
198
- [attachmentTemplate]="attachmentTemplate"
199
- [user]="user"
200
- (executeAction)="dispatchAction($event)"
201
- (resize)="anchor.scrollToBottom()"
202
- (navigate)="this.autoScroll = false"
203
- >
204
- </kendo-chat-message-list>
205
- </div>
206
-
207
- <div class="k-message-box">
208
- <input
209
- #messageInput
210
- kendoChatFocusedState
211
- type="text"
212
- class="k-input"
213
- [placeholder]="textFor('messagePlaceholder')"
214
- (keydown)="inputKeydown($event)"
215
- >
216
- <button
217
- kendoButton
218
- fillMode="flat"
219
- class="k-button-send"
220
- tabindex="-1"
221
- [attr.title]="textFor('send')"
222
- (click)="sendClick()"
223
- >${sendIcon}</button>
224
- </div>
225
- `
226
- }),
227
- tslib_1.__metadata("design:paramtypes", [LocalizationService,
228
- NgZone])
229
- ], ChatComponent);
230
- export { ChatComponent };
@@ -1,7 +0,0 @@
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
- export { ChatComponent } from './chat.component';
6
- export { AttachmentTemplateDirective } from './attachment-template.directive';
7
- export { MessageTemplateDirective } from './message-template.directive';
@@ -1,27 +0,0 @@
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
- /**
6
- * The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
7
- *
8
- * @example
9
- * ```ts-no-run
10
- * import { NgModule } from '@angular/core';
11
- * import { Component } from '@angular/core';
12
- * import { BrowserModule } from '@angular/platform-browser';
13
- *
14
- * import { ChatModule } from '@progress/kendo-angular-conversational-ui';
15
- * import { AppComponent } from './app.component';
16
- *
17
- * _@NgModule({
18
- * imports: [ BrowserModule, ChatModule ],
19
- * declarations: [ AppComponent ],
20
- * bootstrap: [ AppComponent ]
21
- * })
22
- *
23
- * export class AppModule { }
24
- * ```
25
- */
26
- export declare class ChatModule {
27
- }
@@ -1,37 +0,0 @@
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 * as tslib_1 from "tslib";
6
- var CustomMessagesComponent_1;
7
- import { Component, forwardRef } from '@angular/core';
8
- import { LocalizationService } from '@progress/kendo-angular-l10n';
9
- import { Messages } from './messages';
10
- // tslint:disable:no-forward-ref
11
- /**
12
- * Custom component messages override default component messages
13
- * ([see example]({% slug globalization_chat %}#toc-custom-messages)).
14
- */
15
- let CustomMessagesComponent = CustomMessagesComponent_1 = class CustomMessagesComponent extends Messages {
16
- constructor(service) {
17
- super();
18
- this.service = service;
19
- }
20
- get override() {
21
- return true;
22
- }
23
- };
24
- CustomMessagesComponent = CustomMessagesComponent_1 = tslib_1.__decorate([
25
- Component({
26
- providers: [
27
- {
28
- provide: Messages,
29
- useExisting: forwardRef(() => CustomMessagesComponent_1)
30
- }
31
- ],
32
- selector: 'kendo-chat-messages',
33
- template: ``
34
- }),
35
- tslib_1.__metadata("design:paramtypes", [LocalizationService])
36
- ], CustomMessagesComponent);
37
- export { CustomMessagesComponent };
@@ -1,32 +0,0 @@
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 * as tslib_1 from "tslib";
6
- var LocalizedMessagesDirective_1;
7
- import { Directive, forwardRef } from '@angular/core';
8
- import { LocalizationService } from '@progress/kendo-angular-l10n';
9
- import { Messages } from './messages';
10
- // tslint:disable:no-forward-ref
11
- /**
12
- * @hidden
13
- */
14
- let LocalizedMessagesDirective = LocalizedMessagesDirective_1 = class LocalizedMessagesDirective extends Messages {
15
- constructor(service) {
16
- super();
17
- this.service = service;
18
- }
19
- };
20
- LocalizedMessagesDirective = LocalizedMessagesDirective_1 = tslib_1.__decorate([
21
- Directive({
22
- providers: [
23
- {
24
- provide: Messages,
25
- useExisting: forwardRef(() => LocalizedMessagesDirective_1)
26
- }
27
- ],
28
- selector: '[kendoChatLocalizedMessages]'
29
- }),
30
- tslib_1.__metadata("design:paramtypes", [LocalizationService])
31
- ], LocalizedMessagesDirective);
32
- export { LocalizedMessagesDirective };
@@ -1,20 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { Input } from '@angular/core';
7
- import { ComponentMessages } from '@progress/kendo-angular-l10n';
8
- /**
9
- * @hidden
10
- */
11
- export class Messages extends ComponentMessages {
12
- }
13
- tslib_1.__decorate([
14
- Input(),
15
- tslib_1.__metadata("design:type", String)
16
- ], Messages.prototype, "messagePlaceholder", void 0);
17
- tslib_1.__decorate([
18
- Input(),
19
- tslib_1.__metadata("design:type", String)
20
- ], Messages.prototype, "send", void 0);