@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.
Files changed (163) hide show
  1. package/{dist/es2015/api → api}/action.interface.d.ts +0 -0
  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 +7 -7
  17. package/{dist/es2015/chat → chat}/chat.directives.d.ts +0 -0
  18. package/chat/chat.module.d.ts +49 -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-box.component.d.ts +4 -1
  24. package/{dist/es2015/chat → chat}/message-box.directive.d.ts +3 -0
  25. package/{dist/es2015/chat → chat}/message-list.component.d.ts +9 -8
  26. package/{dist/es2015/chat → chat}/message-template.directive.d.ts +3 -0
  27. package/{dist/es2015/chat → chat}/message.component.d.ts +4 -1
  28. package/{dist/es2015/chat → chat}/suggested-actions.component.d.ts +4 -1
  29. package/common/focused-state.directive.d.ts +15 -0
  30. package/{dist/es2015/common → common}/keys.enum.d.ts +0 -0
  31. package/{dist/es2015/common → common}/models/message-box-options.d.ts +0 -0
  32. package/{dist/es2015/common → common}/scroll-anchor.directive.d.ts +3 -0
  33. package/{dist/es2015/common → common}/utils.d.ts +0 -0
  34. package/{dist/es2015 → esm2015}/api/action.interface.js +2 -1
  35. package/{dist/es2015 → esm2015}/api/attachment.interface.js +1 -0
  36. package/{dist/es2015 → esm2015}/api/execute-action-event.js +0 -0
  37. package/{dist/es/api/attachment.interface.js → esm2015/api/index.js} +6 -0
  38. package/{dist/es → esm2015}/api/message.interface.js +1 -0
  39. package/{dist/es2015 → esm2015}/api/post-message-event.js +0 -0
  40. package/{dist/es2015 → esm2015}/api/preventable-event.js +0 -0
  41. package/{dist/es2015 → esm2015}/api/user.interface.js +1 -0
  42. package/esm2015/cards/hero-card.component.js +90 -0
  43. package/{dist/es2015 → esm2015}/chat/attachment-template.directive.js +14 -12
  44. package/esm2015/chat/attachment.component.js +83 -0
  45. package/{dist/es2015 → esm2015}/chat/builtin-actions.js +13 -16
  46. package/{dist/es2015 → esm2015}/chat/chat-item.js +0 -0
  47. package/{dist/es2015 → esm2015}/chat/chat-view.js +0 -6
  48. package/esm2015/chat/chat.component.js +246 -0
  49. package/{dist/es → esm2015}/chat/chat.directives.js +0 -0
  50. package/{dist/es2015 → esm2015}/chat/chat.module.js +43 -15
  51. package/esm2015/chat/l10n/custom-messages.component.js +42 -0
  52. package/esm2015/chat/l10n/localized-messages.directive.js +37 -0
  53. package/esm2015/chat/l10n/messages.js +25 -0
  54. package/{dist/es2015 → esm2015}/chat/message-attachments.component.js +71 -48
  55. package/esm2015/chat/message-box.component.js +141 -0
  56. package/esm2015/chat/message-box.directive.js +24 -0
  57. package/esm2015/chat/message-list.component.js +279 -0
  58. package/{dist/es2015 → esm2015}/chat/message-template.directive.js +14 -12
  59. package/esm2015/chat/message.component.js +140 -0
  60. package/esm2015/chat/suggested-actions.component.js +113 -0
  61. package/esm2015/common/focused-state.directive.js +37 -0
  62. package/{dist/es2015 → esm2015}/common/keys.enum.js +1 -0
  63. package/{dist/es → esm2015}/common/models/message-box-options.js +1 -0
  64. package/{dist/es2015 → esm2015}/common/scroll-anchor.directive.js +20 -26
  65. package/{dist/es2015 → esm2015}/common/utils.js +0 -0
  66. package/{dist/es/api/action.interface.js → esm2015/kendo-angular-conversational-ui.js} +4 -1
  67. package/esm2015/main.js +10 -0
  68. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  69. package/fesm2015/kendo-angular-conversational-ui.js +1757 -0
  70. package/{dist/es2015/common/focused-state.directive.d.ts → kendo-angular-conversational-ui.d.ts} +3 -6
  71. package/main.d.ts +11 -0
  72. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  73. package/package.json +38 -107
  74. package/schematics/ngAdd/index.js +5 -2
  75. package/schematics/ngAdd/index.js.map +1 -1
  76. package/dist/cdn/js/kendo-angular-conversational-ui.js +0 -20
  77. package/dist/cdn/main.js +0 -5
  78. package/dist/es/api/execute-action-event.js +0 -24
  79. package/dist/es/api/post-message-event.js +0 -18
  80. package/dist/es/api/preventable-event.js +0 -32
  81. package/dist/es/cards/hero-card.component.js +0 -54
  82. package/dist/es/chat/attachment-template.directive.js +0 -32
  83. package/dist/es/chat/attachment.component.js +0 -65
  84. package/dist/es/chat/builtin-actions.js +0 -28
  85. package/dist/es/chat/chat-item.js +0 -13
  86. package/dist/es/chat/chat-view.js +0 -92
  87. package/dist/es/chat/chat.component.js +0 -190
  88. package/dist/es/chat/chat.module.js +0 -80
  89. package/dist/es/chat/l10n/custom-messages.component.js +0 -45
  90. package/dist/es/chat/l10n/localized-messages.directive.js +0 -36
  91. package/dist/es/chat/l10n/messages.js +0 -26
  92. package/dist/es/chat/message-attachments.component.js +0 -148
  93. package/dist/es/chat/message-box.component.js +0 -124
  94. package/dist/es/chat/message-box.directive.js +0 -24
  95. package/dist/es/chat/message-list.component.js +0 -165
  96. package/dist/es/chat/message-template.directive.js +0 -32
  97. package/dist/es/chat/message.component.js +0 -77
  98. package/dist/es/chat/suggested-actions.component.js +0 -91
  99. package/dist/es/common/focused-state.directive.js +0 -43
  100. package/dist/es/common/keys.enum.js +0 -4
  101. package/dist/es/common/scroll-anchor.directive.js +0 -87
  102. package/dist/es/common/utils.js +0 -13
  103. package/dist/es/index.js +0 -22
  104. package/dist/es/main.js +0 -8
  105. package/dist/es/package-metadata.js +0 -15
  106. package/dist/es2015/api/message.interface.js +0 -4
  107. package/dist/es2015/cards/hero-card.component.js +0 -79
  108. package/dist/es2015/chat/attachment.component.js +0 -66
  109. package/dist/es2015/chat/chat.component.js +0 -214
  110. package/dist/es2015/chat/chat.directives.js +0 -8
  111. package/dist/es2015/chat/chat.module.d.ts +0 -27
  112. package/dist/es2015/chat/l10n/custom-messages.component.js +0 -37
  113. package/dist/es2015/chat/l10n/localized-messages.directive.js +0 -32
  114. package/dist/es2015/chat/l10n/messages.js +0 -20
  115. package/dist/es2015/chat/message-box.component.js +0 -157
  116. package/dist/es2015/chat/message-box.directive.js +0 -23
  117. package/dist/es2015/chat/message-list.component.js +0 -227
  118. package/dist/es2015/chat/message.component.js +0 -107
  119. package/dist/es2015/chat/suggested-actions.component.js +0 -105
  120. package/dist/es2015/common/focused-state.directive.js +0 -45
  121. package/dist/es2015/common/models/message-box-options.js +0 -4
  122. package/dist/es2015/index.d.ts +0 -22
  123. package/dist/es2015/index.js +0 -22
  124. package/dist/es2015/index.metadata.json +0 -1
  125. package/dist/es2015/main.d.ts +0 -13
  126. package/dist/es2015/main.js +0 -8
  127. package/dist/fesm2015/index.js +0 -1554
  128. package/dist/fesm5/index.js +0 -1383
  129. package/dist/npm/api/action.interface.js +0 -7
  130. package/dist/npm/api/attachment.interface.js +0 -6
  131. package/dist/npm/api/execute-action-event.js +0 -26
  132. package/dist/npm/api/message.interface.js +0 -6
  133. package/dist/npm/api/post-message-event.js +0 -20
  134. package/dist/npm/api/preventable-event.js +0 -34
  135. package/dist/npm/api/user.interface.js +0 -6
  136. package/dist/npm/cards/hero-card.component.js +0 -56
  137. package/dist/npm/chat/attachment-template.directive.js +0 -34
  138. package/dist/npm/chat/attachment.component.js +0 -67
  139. package/dist/npm/chat/builtin-actions.js +0 -33
  140. package/dist/npm/chat/chat-item.js +0 -15
  141. package/dist/npm/chat/chat-view.js +0 -98
  142. package/dist/npm/chat/chat.component.js +0 -192
  143. package/dist/npm/chat/chat.directives.js +0 -14
  144. package/dist/npm/chat/chat.module.js +0 -82
  145. package/dist/npm/chat/l10n/custom-messages.component.js +0 -47
  146. package/dist/npm/chat/l10n/localized-messages.directive.js +0 -38
  147. package/dist/npm/chat/l10n/messages.js +0 -28
  148. package/dist/npm/chat/message-attachments.component.js +0 -150
  149. package/dist/npm/chat/message-box.component.js +0 -126
  150. package/dist/npm/chat/message-box.directive.js +0 -26
  151. package/dist/npm/chat/message-list.component.js +0 -167
  152. package/dist/npm/chat/message-template.directive.js +0 -34
  153. package/dist/npm/chat/message.component.js +0 -79
  154. package/dist/npm/chat/suggested-actions.component.js +0 -93
  155. package/dist/npm/common/focused-state.directive.js +0 -45
  156. package/dist/npm/common/keys.enum.js +0 -6
  157. package/dist/npm/common/models/message-box-options.js +0 -6
  158. package/dist/npm/common/scroll-anchor.directive.js +0 -89
  159. package/dist/npm/common/utils.js +0 -15
  160. package/dist/npm/index.js +0 -39
  161. package/dist/npm/main.js +0 -11
  162. package/dist/npm/package-metadata.js +0 -17
  163. package/dist/systemjs/kendo-angular-conversational-ui.js +0 -5
@@ -1,82 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var attachment_component_1 = require("./attachment.component");
9
- var chat_directives_1 = require("./chat.directives");
10
- var kendo_angular_buttons_1 = require("@progress/kendo-angular-buttons");
11
- var common_1 = require("@angular/common");
12
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
13
- var custom_messages_component_1 = require("./l10n/custom-messages.component");
14
- var focused_state_directive_1 = require("../common/focused-state.directive");
15
- var hero_card_component_1 = require("../cards/hero-card.component");
16
- var localized_messages_directive_1 = require("./l10n/localized-messages.directive");
17
- var message_attachments_component_1 = require("./message-attachments.component");
18
- var message_component_1 = require("./message.component");
19
- var message_list_component_1 = require("./message-list.component");
20
- var core_1 = require("@angular/core");
21
- var scroll_anchor_directive_1 = require("../common/scroll-anchor.directive");
22
- var suggested_actions_component_1 = require("./suggested-actions.component");
23
- var message_box_component_1 = require("./message-box.component");
24
- var message_box_directive_1 = require("./message-box.directive");
25
- var PUBLIC_DIRECTIVES = [
26
- chat_directives_1.ChatComponent,
27
- custom_messages_component_1.CustomMessagesComponent,
28
- chat_directives_1.AttachmentTemplateDirective,
29
- chat_directives_1.MessageTemplateDirective,
30
- hero_card_component_1.HeroCardComponent,
31
- message_box_directive_1.ChatMessageBoxTemplateDirective
32
- ];
33
- var PRIVATE_DIRECTIVES = [
34
- attachment_component_1.AttachmentComponent,
35
- focused_state_directive_1.FocusedStateDirective,
36
- localized_messages_directive_1.LocalizedMessagesDirective,
37
- message_attachments_component_1.MessageAttachmentsComponent,
38
- message_component_1.MessageComponent,
39
- message_list_component_1.MessageListComponent,
40
- chat_directives_1.MessageTemplateDirective,
41
- scroll_anchor_directive_1.ScrollAnchorDirective,
42
- suggested_actions_component_1.SuggestedActionsComponent,
43
- message_box_component_1.MessageBoxComponent
44
- ];
45
- /**
46
- * The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
47
- *
48
- * @example
49
- * ```ts-no-run
50
- * import { NgModule } from '@angular/core';
51
- * import { Component } from '@angular/core';
52
- * import { BrowserModule } from '@angular/platform-browser';
53
- *
54
- * import { ChatModule } from '@progress/kendo-angular-conversational-ui';
55
- * import { AppComponent } from './app.component';
56
- *
57
- * _@NgModule({
58
- * imports: [ BrowserModule, ChatModule ],
59
- * declarations: [ AppComponent ],
60
- * bootstrap: [ AppComponent ]
61
- * })
62
- *
63
- * export class AppModule { }
64
- * ```
65
- */
66
- var ChatModule = /** @class */ (function () {
67
- function ChatModule() {
68
- }
69
- ChatModule = tslib_1.__decorate([
70
- core_1.NgModule({
71
- declarations: PUBLIC_DIRECTIVES.concat(PRIVATE_DIRECTIVES),
72
- exports: [PUBLIC_DIRECTIVES],
73
- imports: [
74
- kendo_angular_buttons_1.ButtonModule,
75
- common_1.CommonModule,
76
- kendo_angular_common_1.ResizeSensorModule
77
- ]
78
- })
79
- ], ChatModule);
80
- return ChatModule;
81
- }());
82
- exports.ChatModule = ChatModule;
@@ -1,47 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
10
- var messages_1 = require("./messages");
11
- // tslint:disable:no-forward-ref
12
- /**
13
- * Custom component messages override default component messages
14
- * ([see example]({% slug globalization_chat %}#toc-custom-messages)).
15
- */
16
- var CustomMessagesComponent = /** @class */ (function (_super) {
17
- tslib_1.__extends(CustomMessagesComponent, _super);
18
- function CustomMessagesComponent(service) {
19
- var _this = _super.call(this) || this;
20
- _this.service = service;
21
- return _this;
22
- }
23
- CustomMessagesComponent_1 = CustomMessagesComponent;
24
- Object.defineProperty(CustomMessagesComponent.prototype, "override", {
25
- get: function () {
26
- return true;
27
- },
28
- enumerable: true,
29
- configurable: true
30
- });
31
- var CustomMessagesComponent_1;
32
- CustomMessagesComponent = CustomMessagesComponent_1 = tslib_1.__decorate([
33
- core_1.Component({
34
- providers: [
35
- {
36
- provide: messages_1.Messages,
37
- useExisting: core_1.forwardRef(function () { return CustomMessagesComponent_1; })
38
- }
39
- ],
40
- selector: 'kendo-chat-messages',
41
- template: ""
42
- }),
43
- tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
44
- ], CustomMessagesComponent);
45
- return CustomMessagesComponent;
46
- }(messages_1.Messages));
47
- exports.CustomMessagesComponent = CustomMessagesComponent;
@@ -1,38 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
10
- var messages_1 = require("./messages");
11
- // tslint:disable:no-forward-ref
12
- /**
13
- * @hidden
14
- */
15
- var LocalizedMessagesDirective = /** @class */ (function (_super) {
16
- tslib_1.__extends(LocalizedMessagesDirective, _super);
17
- function LocalizedMessagesDirective(service) {
18
- var _this = _super.call(this) || this;
19
- _this.service = service;
20
- return _this;
21
- }
22
- LocalizedMessagesDirective_1 = LocalizedMessagesDirective;
23
- var LocalizedMessagesDirective_1;
24
- LocalizedMessagesDirective = LocalizedMessagesDirective_1 = tslib_1.__decorate([
25
- core_1.Directive({
26
- providers: [
27
- {
28
- provide: messages_1.Messages,
29
- useExisting: core_1.forwardRef(function () { return LocalizedMessagesDirective_1; })
30
- }
31
- ],
32
- selector: '[kendoChatLocalizedMessages]'
33
- }),
34
- tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
35
- ], LocalizedMessagesDirective);
36
- return LocalizedMessagesDirective;
37
- }(messages_1.Messages));
38
- exports.LocalizedMessagesDirective = LocalizedMessagesDirective;
@@ -1,28 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
10
- /**
11
- * @hidden
12
- */
13
- var Messages = /** @class */ (function (_super) {
14
- tslib_1.__extends(Messages, _super);
15
- function Messages() {
16
- return _super !== null && _super.apply(this, arguments) || this;
17
- }
18
- tslib_1.__decorate([
19
- core_1.Input(),
20
- tslib_1.__metadata("design:type", String)
21
- ], Messages.prototype, "messagePlaceholder", void 0);
22
- tslib_1.__decorate([
23
- core_1.Input(),
24
- tslib_1.__metadata("design:type", String)
25
- ], Messages.prototype, "send", void 0);
26
- return Messages;
27
- }(kendo_angular_l10n_1.ComponentMessages));
28
- exports.Messages = Messages;
@@ -1,150 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var rxjs_1 = require("rxjs");
10
- var operators_1 = require("rxjs/operators");
11
- var chat_item_1 = require("./chat-item");
12
- var chat_directives_1 = require("./chat.directives");
13
- // tslint:disable:no-forward-ref
14
- /**
15
- * @hidden
16
- */
17
- var MessageAttachmentsComponent = /** @class */ (function (_super) {
18
- tslib_1.__extends(MessageAttachmentsComponent, _super);
19
- function MessageAttachmentsComponent(zone) {
20
- var _a, _b;
21
- var _this = _super.call(this) || this;
22
- _this.zone = zone;
23
- _this.scrollPosition = 0;
24
- _this.selectedIndex = 0;
25
- _this.carouselKeyHandlers = (_a = {},
26
- _a[37 /* left */] = function (e) { return _this.navigateTo(e, -1); },
27
- _a[39 /* right */] = function (e) { return _this.navigateTo(e, 1); },
28
- _a);
29
- _this.listKeyHandlers = (_b = {},
30
- _b[38 /* up */] = function (e) { return _this.navigateTo(e, -1); },
31
- _b[40 /* down */] = function (e) { return _this.navigateTo(e, 1); },
32
- _b);
33
- return _this;
34
- }
35
- MessageAttachmentsComponent_1 = MessageAttachmentsComponent;
36
- Object.defineProperty(MessageAttachmentsComponent.prototype, "carousel", {
37
- get: function () {
38
- return this.layout !== 'list';
39
- },
40
- enumerable: true,
41
- configurable: true
42
- });
43
- MessageAttachmentsComponent.prototype.ngAfterViewInit = function () {
44
- var _this = this;
45
- this.zone.runOutsideAngular(function () {
46
- var scrollDebounceTime = 100;
47
- _this.scrollSubscription = rxjs_1.fromEvent(_this.deck.nativeElement, 'scroll')
48
- .pipe(operators_1.debounceTime(scrollDebounceTime))
49
- .subscribe(function () { return _this.onScroll(); });
50
- });
51
- };
52
- MessageAttachmentsComponent.prototype.ngOnDestroy = function () {
53
- this.scrollSubscription.unsubscribe();
54
- };
55
- MessageAttachmentsComponent.prototype.isSelected = function (index) {
56
- return this.selectedIndex === index;
57
- };
58
- MessageAttachmentsComponent.prototype.itemKeydown = function (e, attachment) {
59
- var keyHandlers = this.layout === 'list' ?
60
- this.listKeyHandlers : this.carouselKeyHandlers;
61
- var handler = keyHandlers[e.keyCode];
62
- if (handler) {
63
- handler(e, attachment);
64
- }
65
- };
66
- MessageAttachmentsComponent.prototype.itemClick = function (index) {
67
- this.select(index);
68
- };
69
- MessageAttachmentsComponent.prototype.focus = function () {
70
- this.select(this.selectedIndex);
71
- };
72
- MessageAttachmentsComponent.prototype.scrollTo = function (dir) {
73
- var el = this.deck.nativeElement;
74
- var scrollStep = el.scrollWidth / this.items.length;
75
- var max = el.scrollWidth - el.offsetWidth;
76
- var pos = el.scrollLeft + scrollStep * dir;
77
- el.scrollLeft = Math.max(0, Math.min(max, pos));
78
- };
79
- MessageAttachmentsComponent.prototype.select = function (index) {
80
- this.selectedIndex = index;
81
- var item = this.items.toArray()[index];
82
- if (item) {
83
- item.nativeElement.focus();
84
- }
85
- };
86
- MessageAttachmentsComponent.prototype.navigateTo = function (e, offset) {
87
- var prevIndex = this.selectedIndex;
88
- var nextIndex = Math.max(0, Math.min(prevIndex + offset, this.items.length - 1));
89
- if (nextIndex !== prevIndex) {
90
- this.select(nextIndex);
91
- e.preventDefault();
92
- }
93
- };
94
- MessageAttachmentsComponent.prototype.onScroll = function () {
95
- var _this = this;
96
- var el = this.deck.nativeElement;
97
- if (el.scrollWidth === 0) {
98
- return;
99
- }
100
- var pos = el.scrollLeft / (el.scrollWidth - el.offsetWidth);
101
- if (pos !== this.scrollPosition) {
102
- this.zone.run(function () {
103
- _this.scrollPosition = pos;
104
- });
105
- }
106
- };
107
- var MessageAttachmentsComponent_1;
108
- tslib_1.__decorate([
109
- core_1.Input(),
110
- tslib_1.__metadata("design:type", Array)
111
- ], MessageAttachmentsComponent.prototype, "attachments", void 0);
112
- tslib_1.__decorate([
113
- core_1.Input(),
114
- tslib_1.__metadata("design:type", String)
115
- ], MessageAttachmentsComponent.prototype, "layout", void 0);
116
- tslib_1.__decorate([
117
- core_1.Input(),
118
- tslib_1.__metadata("design:type", Boolean)
119
- ], MessageAttachmentsComponent.prototype, "tabbable", void 0);
120
- tslib_1.__decorate([
121
- core_1.Input(),
122
- tslib_1.__metadata("design:type", chat_directives_1.AttachmentTemplateDirective)
123
- ], MessageAttachmentsComponent.prototype, "template", void 0);
124
- tslib_1.__decorate([
125
- core_1.HostBinding('class.k-card-deck-scrollwrap'),
126
- tslib_1.__metadata("design:type", Boolean),
127
- tslib_1.__metadata("design:paramtypes", [])
128
- ], MessageAttachmentsComponent.prototype, "carousel", null);
129
- tslib_1.__decorate([
130
- core_1.ViewChild('deck', { read: core_1.ElementRef, static: true }),
131
- tslib_1.__metadata("design:type", core_1.ElementRef)
132
- ], MessageAttachmentsComponent.prototype, "deck", void 0);
133
- tslib_1.__decorate([
134
- core_1.ViewChildren('item', { read: core_1.ElementRef }),
135
- tslib_1.__metadata("design:type", core_1.QueryList)
136
- ], MessageAttachmentsComponent.prototype, "items", void 0);
137
- MessageAttachmentsComponent = MessageAttachmentsComponent_1 = tslib_1.__decorate([
138
- core_1.Component({
139
- providers: [{
140
- provide: chat_item_1.ChatItem,
141
- useExisting: core_1.forwardRef(function () { return MessageAttachmentsComponent_1; })
142
- }],
143
- selector: 'kendo-chat-message-attachments',
144
- template: "\n <button\n *ngIf=\"carousel && scrollPosition > 0\"\n (click)=\"scrollTo(-1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-left\"></span>\n </button>\n <div #deck [class.k-card-deck]=\"carousel\">\n <kendo-chat-attachment #item\n *ngFor=\"let att of attachments; index as index; first as first; last as last\"\n [attachment]=\"att\"\n [template]=\"template\"\n [class.k-state-selected]=\"isSelected(index)\"\n [class.k-state-focused]=\"isSelected(index)\"\n [class.k-card-wrap]=\"true\"\n [class.k-first]=\"first\"\n [class.k-last]=\"last\"\n [attr.tabindex]=\"tabbable && isSelected(index) ? '0' : '-1'\"\n (click)=\"itemClick(index)\"\n (keydown)=\"itemKeydown($event, att)\"\n >\n </kendo-chat-attachment>\n </div>\n <button\n *ngIf=\"carousel && scrollPosition < 1\"\n (click)=\"scrollTo(1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-right\"></span>\n </button>\n "
145
- }),
146
- tslib_1.__metadata("design:paramtypes", [core_1.NgZone])
147
- ], MessageAttachmentsComponent);
148
- return MessageAttachmentsComponent;
149
- }(chat_item_1.ChatItem));
150
- exports.MessageAttachmentsComponent = MessageAttachmentsComponent;
@@ -1,126 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var post_message_event_1 = require("../api/post-message-event");
10
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
11
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
12
- var message_box_directive_1 = require("./message-box.directive");
13
- // tslint:disable-next-line:max-line-length
14
- var 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>';
15
- /**
16
- * @hidden
17
- */
18
- var MessageBoxComponent = /** @class */ (function () {
19
- function MessageBoxComponent() {
20
- this.hostClasses = 'k-message-box k-input k-input-md k-rounded-md k-input-solid';
21
- this.sendMessage = new core_1.EventEmitter();
22
- }
23
- Object.defineProperty(MessageBoxComponent.prototype, "messageBoxValue", {
24
- get: function () {
25
- return this.type === 'textarea';
26
- },
27
- enumerable: true,
28
- configurable: true
29
- });
30
- /**
31
- * @hidden
32
- */
33
- MessageBoxComponent.prototype.sendClick = function () {
34
- var input = this.messageBoxInput.nativeElement;
35
- var value = input.value;
36
- if (!value) {
37
- return;
38
- }
39
- var message = {
40
- author: this.user,
41
- text: value,
42
- timestamp: new Date()
43
- };
44
- this.sendMessage.emit(new post_message_event_1.SendMessageEvent(message));
45
- input.value = null;
46
- input.focus();
47
- this.autoScroll = true;
48
- };
49
- /**
50
- * @hidden
51
- */
52
- MessageBoxComponent.prototype.inputKeydown = function (e) {
53
- if (e.keyCode === kendo_angular_common_1.Keys.Enter) {
54
- this.sendClick();
55
- }
56
- };
57
- /**
58
- * @hidden
59
- */
60
- MessageBoxComponent.prototype.textAreaKeydown = function (e) {
61
- var isEnter = e.keyCode === kendo_angular_common_1.Keys.Enter;
62
- if (!isEnter) {
63
- return;
64
- }
65
- var newLine = (e.metaKey || e.ctrlKey);
66
- var enterOnly = !(e.shiftKey || e.metaKey || e.ctrlKey);
67
- if (enterOnly) {
68
- e.preventDefault();
69
- this.sendClick();
70
- }
71
- if (newLine) {
72
- this.messageBoxInput.nativeElement.value += "\r\n";
73
- }
74
- };
75
- /**
76
- * @hidden
77
- */
78
- MessageBoxComponent.prototype.textFor = function (key) {
79
- return this.localization.get(key);
80
- };
81
- tslib_1.__decorate([
82
- core_1.HostBinding('class'),
83
- tslib_1.__metadata("design:type", String)
84
- ], MessageBoxComponent.prototype, "hostClasses", void 0);
85
- tslib_1.__decorate([
86
- core_1.HostBinding('class.\!k-align-items-end'),
87
- tslib_1.__metadata("design:type", Boolean),
88
- tslib_1.__metadata("design:paramtypes", [])
89
- ], MessageBoxComponent.prototype, "messageBoxValue", null);
90
- tslib_1.__decorate([
91
- core_1.ViewChild('messageBoxInput', { static: false }),
92
- tslib_1.__metadata("design:type", core_1.ElementRef)
93
- ], MessageBoxComponent.prototype, "messageBoxInput", void 0);
94
- tslib_1.__decorate([
95
- core_1.Input(),
96
- tslib_1.__metadata("design:type", Object)
97
- ], MessageBoxComponent.prototype, "user", void 0);
98
- tslib_1.__decorate([
99
- core_1.Input(),
100
- tslib_1.__metadata("design:type", Boolean)
101
- ], MessageBoxComponent.prototype, "autoScroll", void 0);
102
- tslib_1.__decorate([
103
- core_1.Input(),
104
- tslib_1.__metadata("design:type", String)
105
- ], MessageBoxComponent.prototype, "type", void 0);
106
- tslib_1.__decorate([
107
- core_1.Input(),
108
- tslib_1.__metadata("design:type", kendo_angular_l10n_1.LocalizationService)
109
- ], MessageBoxComponent.prototype, "localization", void 0);
110
- tslib_1.__decorate([
111
- core_1.Input(),
112
- tslib_1.__metadata("design:type", message_box_directive_1.ChatMessageBoxTemplateDirective)
113
- ], MessageBoxComponent.prototype, "messageBoxTemplate", void 0);
114
- tslib_1.__decorate([
115
- core_1.Output(),
116
- tslib_1.__metadata("design:type", core_1.EventEmitter)
117
- ], MessageBoxComponent.prototype, "sendMessage", void 0);
118
- MessageBoxComponent = tslib_1.__decorate([
119
- core_1.Component({
120
- selector: 'kendo-message-box',
121
- 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 " + sendIcon + "\n </button>\n </ng-container>\n\n <ng-template *ngIf=\"messageBoxTemplate\" [ngTemplateOutlet]=\"messageBoxTemplate?.templateRef\"></ng-template>\n"
122
- })
123
- ], MessageBoxComponent);
124
- return MessageBoxComponent;
125
- }());
126
- exports.MessageBoxComponent = MessageBoxComponent;
@@ -1,26 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- /**
10
- * Creates a message box area that overrides the default message box of the Conversational UI Component.
11
- * To define a message-box template, nest an `<ng-template>` tag with the `kendoChatMessageBoxTemplate` directive inside the `<kendo-chat>` tag
12
- * [see example]({% slug message_box %}#toc-message-box-template).
13
- */
14
- var ChatMessageBoxTemplateDirective = /** @class */ (function () {
15
- function ChatMessageBoxTemplateDirective(templateRef) {
16
- this.templateRef = templateRef;
17
- }
18
- ChatMessageBoxTemplateDirective = tslib_1.__decorate([
19
- core_1.Directive({
20
- selector: '[kendoChatMessageBoxTemplate]'
21
- }),
22
- tslib_1.__metadata("design:paramtypes", [core_1.TemplateRef])
23
- ], ChatMessageBoxTemplateDirective);
24
- return ChatMessageBoxTemplateDirective;
25
- }());
26
- exports.ChatMessageBoxTemplateDirective = ChatMessageBoxTemplateDirective;