@progress/kendo-react-conversational-ui 6.1.1 → 7.0.0-develop.2

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 (109) hide show
  1. package/{dist/npm/ChatPropsAndState.d.ts → ChatPropsAndState.d.ts} +5 -2
  2. package/{dist/npm/Events.d.ts → Events.d.ts} +5 -1
  3. package/LICENSE.md +1 -1
  4. package/{dist/es/ViewItem.d.ts → ViewItem.d.ts} +6 -2
  5. package/{dist/npm/api → api}/action.interface.d.ts +5 -1
  6. package/{dist/es/api → api}/attachment.interface.d.ts +5 -1
  7. package/{dist/npm/api → api}/message.interface.d.ts +4 -0
  8. package/{dist/es/api → api}/user.interface.d.ts +4 -0
  9. package/{dist/npm/components → components}/Action.d.ts +6 -3
  10. package/{dist/npm/components → components}/ActionGroup.d.ts +5 -2
  11. package/{dist/npm/components → components}/Attachment.d.ts +6 -3
  12. package/{dist/npm/components → components}/AttachmentGroup.d.ts +5 -2
  13. package/{dist/es/components → components}/Chat.d.ts +6 -2
  14. package/{dist/npm/components → components}/ChatMessage.d.ts +5 -1
  15. package/components/DateMarker.d.ts +18 -0
  16. package/{dist/npm/components → components}/MessageGroup.d.ts +6 -2
  17. package/{dist/npm/components → components}/NewMessage.d.ts +6 -2
  18. package/components/Toolbar.d.ts +13 -0
  19. package/{dist/npm/components → components}/base/FocusableUponSelection.d.ts +4 -0
  20. package/{dist/es/components → components}/base/SelectableItemsContainer.d.ts +4 -0
  21. package/{dist/npm/components → components}/templates/HeroCard.d.ts +6 -2
  22. package/dist/cdn/js/kendo-react-conversational-ui.js +5 -1
  23. package/index.d.ts +15 -0
  24. package/index.js +5 -0
  25. package/index.mjs +671 -0
  26. package/{dist/npm/messages → messages}/index.d.ts +4 -0
  27. package/package-metadata.d.ts +9 -0
  28. package/package.json +29 -39
  29. package/utils.d.ts +9 -0
  30. package/about.md +0 -3
  31. package/dist/es/ChatPropsAndState.d.ts +0 -92
  32. package/dist/es/ChatPropsAndState.js +0 -1
  33. package/dist/es/Events.d.ts +0 -38
  34. package/dist/es/Events.js +0 -1
  35. package/dist/es/ViewItem.js +0 -90
  36. package/dist/es/api/action.interface.d.ts +0 -31
  37. package/dist/es/api/action.interface.js +0 -1
  38. package/dist/es/api/attachment.interface.js +0 -1
  39. package/dist/es/api/message.interface.d.ts +0 -56
  40. package/dist/es/api/message.interface.js +0 -1
  41. package/dist/es/api/user.interface.js +0 -1
  42. package/dist/es/components/Action.d.ts +0 -20
  43. package/dist/es/components/Action.js +0 -43
  44. package/dist/es/components/ActionGroup.d.ts +0 -24
  45. package/dist/es/components/ActionGroup.js +0 -40
  46. package/dist/es/components/Attachment.d.ts +0 -25
  47. package/dist/es/components/Attachment.js +0 -68
  48. package/dist/es/components/AttachmentGroup.d.ts +0 -24
  49. package/dist/es/components/AttachmentGroup.js +0 -92
  50. package/dist/es/components/Chat.js +0 -210
  51. package/dist/es/components/ChatMessage.d.ts +0 -68
  52. package/dist/es/components/ChatMessage.js +0 -83
  53. package/dist/es/components/DateMarker.d.ts +0 -14
  54. package/dist/es/components/DateMarker.js +0 -33
  55. package/dist/es/components/MessageGroup.d.ts +0 -25
  56. package/dist/es/components/MessageGroup.js +0 -61
  57. package/dist/es/components/NewMessage.d.ts +0 -34
  58. package/dist/es/components/NewMessage.js +0 -81
  59. package/dist/es/components/Toolbar.d.ts +0 -9
  60. package/dist/es/components/Toolbar.js +0 -31
  61. package/dist/es/components/base/FocusableUponSelection.d.ts +0 -20
  62. package/dist/es/components/base/FocusableUponSelection.js +0 -35
  63. package/dist/es/components/base/SelectableItemsContainer.js +0 -113
  64. package/dist/es/components/templates/HeroCard.d.ts +0 -41
  65. package/dist/es/components/templates/HeroCard.js +0 -64
  66. package/dist/es/main.d.ts +0 -11
  67. package/dist/es/main.js +0 -10
  68. package/dist/es/messages/index.d.ts +0 -30
  69. package/dist/es/messages/index.js +0 -31
  70. package/dist/es/package-metadata.d.ts +0 -5
  71. package/dist/es/package-metadata.js +0 -11
  72. package/dist/es/utils.d.ts +0 -5
  73. package/dist/es/utils.js +0 -6
  74. package/dist/npm/ChatPropsAndState.js +0 -2
  75. package/dist/npm/Events.js +0 -2
  76. package/dist/npm/ViewItem.d.ts +0 -57
  77. package/dist/npm/ViewItem.js +0 -94
  78. package/dist/npm/api/action.interface.js +0 -2
  79. package/dist/npm/api/attachment.interface.d.ts +0 -32
  80. package/dist/npm/api/attachment.interface.js +0 -2
  81. package/dist/npm/api/message.interface.js +0 -2
  82. package/dist/npm/api/user.interface.d.ts +0 -23
  83. package/dist/npm/api/user.interface.js +0 -2
  84. package/dist/npm/components/Action.js +0 -45
  85. package/dist/npm/components/ActionGroup.js +0 -42
  86. package/dist/npm/components/Attachment.js +0 -70
  87. package/dist/npm/components/AttachmentGroup.js +0 -94
  88. package/dist/npm/components/Chat.d.ts +0 -72
  89. package/dist/npm/components/Chat.js +0 -213
  90. package/dist/npm/components/ChatMessage.js +0 -86
  91. package/dist/npm/components/DateMarker.d.ts +0 -14
  92. package/dist/npm/components/DateMarker.js +0 -35
  93. package/dist/npm/components/MessageGroup.js +0 -63
  94. package/dist/npm/components/NewMessage.js +0 -83
  95. package/dist/npm/components/Toolbar.d.ts +0 -9
  96. package/dist/npm/components/Toolbar.js +0 -33
  97. package/dist/npm/components/base/FocusableUponSelection.js +0 -38
  98. package/dist/npm/components/base/SelectableItemsContainer.d.ts +0 -33
  99. package/dist/npm/components/base/SelectableItemsContainer.js +0 -116
  100. package/dist/npm/components/templates/HeroCard.js +0 -67
  101. package/dist/npm/main.d.ts +0 -11
  102. package/dist/npm/main.js +0 -27
  103. package/dist/npm/messages/index.js +0 -34
  104. package/dist/npm/package-metadata.d.ts +0 -5
  105. package/dist/npm/package-metadata.js +0 -14
  106. package/dist/npm/utils.d.ts +0 -5
  107. package/dist/npm/utils.js +0 -10
  108. package/dist/systemjs/kendo-react-conversational-ui.js +0 -1
  109. package/e2e-next/conversationalui.basic.tests.ts +0 -24
package/package.json CHANGED
@@ -1,21 +1,31 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-conversational-ui",
3
+ "version": "7.0.0-develop.2",
3
4
  "description": "React Chat component allows the user to participate in chat sessions with users or chat bots. KendoReact Conversational UI components",
4
- "version": "6.1.1",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/telerik/kendo-react.git"
5
+ "author": "Progress",
6
+ "license": "SEE LICENSE IN LICENSE.md",
7
+ "homepage": "https://www.telerik.com/kendo-react-ui",
8
+ "main": "./index.js",
9
+ "types": "./index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./index.mjs",
13
+ "require": "./index.js"
14
+ }
8
15
  },
9
- "main": "dist/npm/main.js",
10
- "types": "dist/npm/main.d.ts",
11
- "module": "dist/es/main.js",
12
- "jsnext:main": "dist/es/main.js",
13
- "scripts": {
14
- "test": "cd ../../ && npm run test -- --testPathPattern=/packages/conversational-ui/.*",
15
- "build-package": "gulp build-package",
16
- "ssr": "gulp bundle-ssr-server bundle-ssr-client && node dist/ssr/server.js"
16
+ "sideEffects": false,
17
+ "peerDependencies": {
18
+ "@progress/kendo-licensing": "^1.3.0",
19
+ "@progress/kendo-react-buttons": "7.0.0-develop.2",
20
+ "@progress/kendo-react-common": "7.0.0-develop.2",
21
+ "@progress/kendo-react-intl": "7.0.0-develop.2",
22
+ "@progress/kendo-svg-icons": "^2.0.0",
23
+ "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
24
+ "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
25
+ },
26
+ "dependencies": {
27
+ "prop-types": "^15.6.0"
17
28
  },
18
- "homepage": "https://www.telerik.com/kendo-react-ui",
19
29
  "keywords": [
20
30
  "Kendo UI",
21
31
  "React",
@@ -30,35 +40,15 @@
30
40
  "React component",
31
41
  "Telerik"
32
42
  ],
33
- "peerDependencies": {
34
- "@progress/kendo-licensing": "^1.3.0",
35
- "@progress/kendo-react-buttons": "^6.0.0",
36
- "@progress/kendo-react-intl": "^6.0.0",
37
- "@progress/kendo-svg-icons": "^2.0.0",
38
- "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
39
- "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
40
- },
41
- "dependencies": {
42
- "@progress/kendo-react-common": "6.1.1"
43
- },
44
- "devDependencies": {
45
- "@progress/kendo-licensing": "^1.3.0",
46
- "@progress/kendo-react-buttons": "6.1.1",
47
- "@progress/kendo-react-dateinputs": "6.1.1",
48
- "@progress/kendo-react-intl": "6.1.1",
49
- "@progress/kendo-react-layout": "6.1.1",
50
- "@progress/kendo-svg-icons": "^2.0.0",
51
- "adaptivecards": "^1.0.0",
52
- "botframework-directlinejs": "^0.9.15"
53
- },
54
43
  "@progress": {
55
44
  "friendlyName": "Conversational UI",
56
45
  "framework": "KendoReact"
57
46
  },
58
- "author": "Progress",
59
- "license": "SEE LICENSE IN LICENSE.md",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/telerik/kendo-react.git"
50
+ },
60
51
  "publishConfig": {
61
52
  "access": "public"
62
- },
63
- "sideEffects": false
64
- }
53
+ }
54
+ }
package/utils.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Message, User } from '.';
6
+ /**
7
+ * @hidden
8
+ */
9
+ export declare const isAuthor: (user: User, msg: Message) => boolean;
package/about.md DELETED
@@ -1,3 +0,0 @@
1
- <a href="https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-conversational-ui&utm_content=banner" target="_blank">
2
- <img src="https://www.telerik.com/kendo-react-ui/components/npm-banner.svg" alt="KendoReact NPM Banner">
3
- </a>
@@ -1,92 +0,0 @@
1
- /// <reference types="react" />
2
- import { Message, User, ChatActionExecuteEvent, ChatMessageSendEvent, ChatToolbarActionExecuteEvent } from './main';
3
- import { ChatMessageProps, ChatMessageTemplateProps } from './components/ChatMessage';
4
- /**
5
- * Represents a Chat message box.
6
- */
7
- export interface ChatMessageBoxProps {
8
- /**
9
- * Sets the input message of the Chat component.
10
- */
11
- messageInput: JSX.Element;
12
- /**
13
- * Sets the toolbar button of the Chat component.
14
- */
15
- toolbarButton: JSX.Element;
16
- /**
17
- * Sets the send button of the Chat component.
18
- */
19
- sendButton: JSX.Element;
20
- }
21
- export interface ChatProps {
22
- /**
23
- * Sets a class of the Chat DOM element.
24
- */
25
- className?: string;
26
- /**
27
- * Sets the messages of the Chat.
28
- */
29
- messages: Message[];
30
- /**
31
- * Sets the [`User`]({% slug api_conversational-ui %}) instance for the local user. The User ID identifies messages that are authored by the local user.
32
- */
33
- user: User;
34
- /**
35
- * A React functional or class component which is used as a message template. The corresponding [`message`]({% slug api_conversational-ui_message %}) is passed to the component as a property by the name `item`.
36
- */
37
- messageTemplate?: React.ComponentType<ChatMessageTemplateProps>;
38
- /**
39
- * A React functional or class component which is used as an attachment template ([see example]({% slug attachments_chat %}#toc-attachment-templates)). The corresponding [`attachment`]({% slug api_conversational-ui_attachment %}) is passed to the component as a property by the name `item`.
40
- */
41
- attachmentTemplate?: any;
42
- /**
43
- * Sets the width of the Chat.
44
- */
45
- width?: string | number;
46
- /**
47
- * Determines if the toolbar will be rendered.
48
- */
49
- showToolbar?: any;
50
- /**
51
- * Renders a toolbar inside the Chat.
52
- */
53
- toolbar?: any;
54
- /**
55
- * Fires when the user types a message and clicks the **Send** button or presses **Enter**. Emits the [`MessageSendEvent`]({% slug api_conversational-ui_chatmessagesendevent %}).
56
- *
57
- * > The Chat is not automatically updated with the new message.
58
- */
59
- onMessageSend?: (event: ChatMessageSendEvent) => void;
60
- /**
61
- * Fires when the user clicks a quick action button. The Chat internally handles the `reply`, `openUrl`, and `call` [known actions]({% slug api_conversational-ui_actiontype %}). Emits the [`ExecuteActionEvent`]({% slug api_conversational-ui_chatactionexecuteevent %}). The event is preventable. If `preventDefault` is called, the built-in action will be suppressed.
62
- */
63
- onActionExecute?: (event: ChatActionExecuteEvent) => void;
64
- /**
65
- * Fires when the user clicks the button to show or hide the toolbar.
66
- */
67
- onToolbarActionExecute?: (event: ChatToolbarActionExecuteEvent) => void;
68
- /**
69
- * Sets the direction of the Chat component.
70
- */
71
- dir?: string;
72
- /**
73
- * The text which is visible inside the new message input when the message input is empty.
74
- */
75
- placeholder?: string;
76
- /**
77
- * Enables the customization or the override of the default message box item in the Conversational UI
78
- * ([see example]({% slug custom-rendering_chat %})).
79
- */
80
- messageBox?: React.ComponentType<ChatMessageBoxProps>;
81
- /**
82
- * Represents the ChatMessage component.
83
- */
84
- message?: React.ComponentType<ChatMessageProps>;
85
- }
86
- /**
87
- * @hidden
88
- */
89
- export interface ChatState {
90
- selectedItemIndex: number | null;
91
- isFirstRender: boolean;
92
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,38 +0,0 @@
1
- import { Chat, Action, Message, HeroCard } from './main';
2
- import { BaseEvent } from '@progress/kendo-react-common';
3
- /**
4
- * The arguments for the `actionexecute` event of the hero card.
5
- */
6
- export interface HeroCardActionExecuteEvent extends BaseEvent<HeroCard> {
7
- /**
8
- * The executed action.
9
- */
10
- action: Action;
11
- }
12
- /**
13
- * The arguments for the `actionexecute` event of the Chat.
14
- */
15
- export interface ChatActionExecuteEvent extends BaseEvent<Chat> {
16
- /**
17
- * The executed action.
18
- */
19
- action: Action;
20
- }
21
- /**
22
- * The arguments for the `messagesend` event of the Chat.
23
- */
24
- export interface ChatMessageSendEvent extends BaseEvent<Chat> {
25
- /**
26
- * The new message.
27
- */
28
- message: Message;
29
- }
30
- /**
31
- * The arguments for the `toolbaractionexecute` event of the Chat.
32
- */
33
- export interface ChatToolbarActionExecuteEvent extends BaseEvent<Chat> {
34
- /**
35
- * The new toolbarShow value.
36
- */
37
- show: boolean;
38
- }
package/dist/es/Events.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,90 +0,0 @@
1
- import { isAuthor } from './utils';
2
- var last = function (arr) { return arr[arr.length - 1]; };
3
- var dateChanged = function (curr, prev) {
4
- return (curr && prev) && (prev.getDate() !== curr.getDate() ||
5
- prev.getMonth() !== curr.getMonth() ||
6
- prev.getFullYear() !== curr.getFullYear());
7
- };
8
- var addDateMarker = function (acc, msg) {
9
- var timestamp = msg.timestamp;
10
- var lastItem = last(acc);
11
- if (!timestamp) {
12
- return;
13
- }
14
- if (!lastItem || dateChanged(timestamp, lastItem.timestamp)) {
15
- var dateMarker = {
16
- type: 'date-marker',
17
- timestamp: timestamp,
18
- trackBy: timestamp.getTime()
19
- };
20
- acc.push(dateMarker);
21
- }
22
- };
23
- var groupMessages = function (acc, msg, isLastMessage) {
24
- var lastItem = last(acc);
25
- var messages = undefined;
26
- if (msg.typing && !isLastMessage) {
27
- return;
28
- }
29
- if (lastItem && lastItem.type === 'message-group') {
30
- messages = lastItem.messages;
31
- }
32
- if (messages && isAuthor(msg.author, last(messages))) {
33
- messages.push(msg);
34
- }
35
- else {
36
- acc.push({
37
- type: 'message-group',
38
- messages: [msg],
39
- author: msg.author,
40
- timestamp: msg.timestamp,
41
- trackBy: msg
42
- });
43
- }
44
- };
45
- var groupItems = function (total) { return function (acc, msg, index) {
46
- var isLastMessage = index === total - 1;
47
- addDateMarker(acc, msg);
48
- groupMessages(acc, msg, isLastMessage);
49
- if (msg.attachments && msg.attachments.length > 1) {
50
- acc.push({
51
- type: 'attachment-group',
52
- attachments: msg.attachments,
53
- attachmentLayout: msg.attachmentLayout,
54
- timestamp: msg.timestamp,
55
- trackBy: msg
56
- });
57
- }
58
- if (msg.suggestedActions && isLastMessage) {
59
- acc.push({
60
- type: 'action-group',
61
- actions: msg.suggestedActions,
62
- timestamp: msg.timestamp,
63
- trackBy: msg
64
- });
65
- }
66
- return acc;
67
- }; };
68
- function assignSelectionIndices(viewItems) {
69
- var selectionCounter = 0;
70
- viewItems.forEach(function (viewItem) {
71
- if (viewItem.type === 'message-group') {
72
- viewItem.messages.forEach(function (msg) {
73
- msg.selectionIndex = selectionCounter++;
74
- });
75
- }
76
- else if (viewItem.type === 'attachment-group' || viewItem.type === 'action-group') {
77
- viewItem.selectionIndex = selectionCounter++;
78
- }
79
- });
80
- viewItems.lastSelectionIndex = selectionCounter - 1;
81
- }
82
- /**
83
- * @hidden
84
- */
85
- export var convertMsgsToViewItems = function (messages) {
86
- var items = messages.slice();
87
- var result = items.reduce(groupItems(messages.length), []);
88
- assignSelectionIndices(result);
89
- return result;
90
- };
@@ -1,31 +0,0 @@
1
- /**
2
- * The button type of the quick action
3
- * ([see examples]({% slug suggested_actions_chat %})).
4
- *
5
- * * `openUrl`&mdash;Opens a new browser window with the specified URL.
6
- * * `reply`&mdash;Sends the action value as a reply in the Chat.
7
- * * `call`&mdash;Treats a value as a phone number.
8
- * Similar to clicking a [telephone link](https://css-tricks.com/the-current-state-of-telephone-links/).
9
- * * other&mdash;
10
- * Handled by user code in the [`ExecuteActionEvent`]({% slug api_conversational-ui_chatactionexecuteevent %}).
11
- */
12
- export declare type ActionType = 'openUrl' | 'reply' | 'call' | any;
13
- /**
14
- * Defines a quick action for a message.
15
- * The value is interpreted according to the specified action type.
16
- */
17
- export interface Action {
18
- /**
19
- * A predefined or custom (string) type for the action.
20
- */
21
- type: ActionType;
22
- /**
23
- * The value which is associated with the action.
24
- */
25
- value: any;
26
- /**
27
- * An optional title for the quick action.
28
- * If omitted, the Chat displays the value instead.
29
- */
30
- title?: string;
31
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,56 +0,0 @@
1
- import { Action } from './action.interface';
2
- import { Attachment, AttachmentLayout } from './attachment.interface';
3
- import { User } from './user.interface';
4
- /**
5
- * Represents a Chat message.
6
- *
7
- * > * You are required to provide the `author` field.
8
- * > * [Local users]({% slug api_conversational-ui_chatprops %}#toc-user) are displayed to the
9
- * right in left-to-right languages and to the left in right-to-left languages.
10
- * > * If `typing` is set to `true`, the Chat displays a typing indicator instead of text.
11
- */
12
- export interface Message {
13
- /**
14
- * The author of the message.
15
- */
16
- author: User;
17
- /**
18
- * The layout that will be used for displaying message attachments, if any
19
- * ([see example]({% slug attachments_chat %}#toc-display-modes)).
20
- */
21
- attachmentLayout?: AttachmentLayout;
22
- /**
23
- * (Optional) The message attachments
24
- * ([see example]({% slug attachments_chat %})).
25
- */
26
- attachments?: Attachment[];
27
- /**
28
- * The suggested quick actions that will be displayed below this message
29
- * ([see example]({% slug suggested_actions_chat %}#toc-defining-quick-actions)).
30
- *
31
- * > Suggested actions are displayed only for the last message in the conversation.
32
- */
33
- suggestedActions?: Action[];
34
- /**
35
- * An optional status string for the message.
36
- * The status is displayed when the message is selected&mdash;either
37
- * by clicking on it or by using the keyboard navigation shortcuts.
38
- */
39
- status?: string;
40
- /**
41
- * (Optional) The text for the message.
42
- * For example, certain messages can contain
43
- * only attachments or quick actions.
44
- */
45
- text?: string;
46
- /**
47
- * The time at which the message was composed.
48
- *
49
- */
50
- timestamp?: Date;
51
- /**
52
- * A Boolean value which indicates if the message is still being typed by the user.
53
- * If set to `true`, the Chat displays a typing indicator instead of the actual message.
54
- */
55
- typing?: boolean;
56
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,20 +0,0 @@
1
- /// <reference types="react" />
2
- import { Action as ActionModel } from './../main';
3
- import { FocusableUponSelection, FocusableUponSelectionProps } from './base/FocusableUponSelection';
4
- /**
5
- * @hidden
6
- */
7
- export interface ActionProps extends FocusableUponSelectionProps {
8
- item: ActionModel;
9
- onActionExecute: any;
10
- isFirstItemInGroup?: boolean;
11
- isLastItemInGroup?: boolean;
12
- }
13
- /**
14
- * @hidden
15
- */
16
- export default class Action extends FocusableUponSelection<ActionProps, {}> {
17
- render(): JSX.Element;
18
- private onKeyDown;
19
- private getClassNames;
20
- }
@@ -1,43 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import * as React from 'react';
17
- import { Keys } from '@progress/kendo-react-common';
18
- import { classNames } from '@progress/kendo-react-common';
19
- import { FocusableUponSelection } from './base/FocusableUponSelection';
20
- /**
21
- * @hidden
22
- */
23
- var Action = /** @class */ (function (_super) {
24
- __extends(Action, _super);
25
- function Action() {
26
- var _this = _super !== null && _super.apply(this, arguments) || this;
27
- _this.onKeyDown = function (event) {
28
- if (event.keyCode === Keys.enter) {
29
- _this.props.onActionExecute(_this.props.item, event);
30
- }
31
- };
32
- return _this;
33
- }
34
- Action.prototype.render = function () {
35
- var _this = this;
36
- return (React.createElement("span", { role: 'button', className: this.getClassNames(), onClick: function (event) { return _this.props.onActionExecute(_this.props.item, event); }, ref: function (el) { return _this.elementToFocus = el; }, onKeyDown: this.onKeyDown, tabIndex: 0 }, this.props.item.title || this.props.item.value));
37
- };
38
- Action.prototype.getClassNames = function () {
39
- return classNames('k-quick-reply', { 'k-first': this.props.isFirstItemInGroup }, { 'k-last': this.props.isLastItemInGroup }, { 'k-selected': this.props.selected }, { 'k-focus': this.props.selected });
40
- };
41
- return Action;
42
- }(FocusableUponSelection));
43
- export default Action;
@@ -1,24 +0,0 @@
1
- /// <reference types="react" />
2
- import { ActionGroup as ActionGroupModel } from './../ViewItem';
3
- import { SelectableItemsContainer, SelectableItemsContainerProps, SelectableItemsContainerState } from './base/SelectableItemsContainer';
4
- /**
5
- * @hidden
6
- */
7
- export interface ActionGroupProps extends SelectableItemsContainerProps {
8
- group: ActionGroupModel;
9
- itemTemplate?: any;
10
- onActionExecute: any;
11
- }
12
- /**
13
- * @hidden
14
- */
15
- export interface ActionGroupState extends SelectableItemsContainerState {
16
- }
17
- /**
18
- * @hidden
19
- */
20
- export default class ActionGroup extends SelectableItemsContainer<ActionGroupProps, ActionGroupState> {
21
- constructor(props: any);
22
- render(): JSX.Element;
23
- private getClassNames;
24
- }
@@ -1,40 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import * as React from 'react';
17
- import { classNames } from '@progress/kendo-react-common';
18
- import Action from './Action';
19
- import { SelectableItemsContainer } from './base/SelectableItemsContainer';
20
- /**
21
- * @hidden
22
- */
23
- var ActionGroup = /** @class */ (function (_super) {
24
- __extends(ActionGroup, _super);
25
- function ActionGroup(props) {
26
- return _super.call(this, props) || this;
27
- }
28
- ActionGroup.prototype.render = function () {
29
- var _this = this;
30
- var lastItemIndex = this.props.group.actions ? this.props.group.actions.length - 1 : 0;
31
- return (React.createElement("div", { className: this.getClassNames(), onClick: this.onRequestContainerSelection, onKeyDown: this.onKeyDown }, this.props.group.actions && this.props.group.actions.map(function (item, index) {
32
- return (React.createElement(Action, { item: item, onActionExecute: _this.props.onActionExecute, selected: index === _this.state.selectedItemIndex, isFirstItemInGroup: index === 0, isLastItemInGroup: index === lastItemIndex, key: index }));
33
- })));
34
- };
35
- ActionGroup.prototype.getClassNames = function () {
36
- return classNames('k-quick-replies');
37
- };
38
- return ActionGroup;
39
- }(SelectableItemsContainer));
40
- export default ActionGroup;
@@ -1,25 +0,0 @@
1
- /// <reference types="react" />
2
- import { Attachment as AttachmentModel } from './../main';
3
- import { FocusableUponSelection, FocusableUponSelectionProps } from './base/FocusableUponSelection';
4
- /**
5
- * @hidden
6
- */
7
- export interface AttachmentProps extends FocusableUponSelectionProps {
8
- item: AttachmentModel;
9
- template?: any;
10
- tabbable?: boolean;
11
- isFirstItemInGroup?: boolean;
12
- isLastItemInGroup?: boolean;
13
- onClick?: any;
14
- }
15
- /**
16
- * @hidden
17
- */
18
- export default class Attachment extends FocusableUponSelection<AttachmentProps, {}> {
19
- render(): JSX.Element;
20
- private getTabIndexValue;
21
- private getClassNames;
22
- private getTitleView;
23
- private getSubtitleView;
24
- private getContentView;
25
- }
@@ -1,68 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import * as React from 'react';
17
- import { classNames } from '@progress/kendo-react-common';
18
- import { FocusableUponSelection } from './base/FocusableUponSelection';
19
- /**
20
- * @hidden
21
- */
22
- var Attachment = /** @class */ (function (_super) {
23
- __extends(Attachment, _super);
24
- function Attachment() {
25
- return _super !== null && _super.apply(this, arguments) || this;
26
- }
27
- Attachment.prototype.render = function () {
28
- var _this = this;
29
- return (React.createElement("div", { className: this.getClassNames(), tabIndex: this.getTabIndexValue(), onClick: this.props.onClick, ref: function (el) { return _this.elementToFocus = el; } }, this.props.template ?
30
- React.createElement(this.props.template, { item: this.props.item }) :
31
- (React.createElement("div", { className: "k-card" },
32
- React.createElement("div", { className: "k-card-body" },
33
- this.getTitleView(),
34
- this.getSubtitleView(),
35
- this.getContentView())))));
36
- };
37
- Attachment.prototype.getTabIndexValue = function () {
38
- if (this.props.tabbable === undefined) {
39
- return undefined;
40
- }
41
- else if (this.props.tabbable) {
42
- return 0;
43
- }
44
- else {
45
- return -1;
46
- }
47
- };
48
- Attachment.prototype.getClassNames = function () {
49
- return classNames({ 'k-selected': this.props.selected }, { 'k-focus': this.props.selected }, { 'k-first': this.props.isFirstItemInGroup }, { 'k-last': this.props.isLastItemInGroup });
50
- };
51
- Attachment.prototype.getTitleView = function () {
52
- return this.props.item.title ?
53
- React.createElement("h5", { className: "k-card-title" }, this.props.item.title) :
54
- null;
55
- };
56
- Attachment.prototype.getSubtitleView = function () {
57
- return this.props.item.subtitle ?
58
- React.createElement("h6", { className: "k-card-subtitle" }, this.props.item.subtitle) :
59
- null;
60
- };
61
- Attachment.prototype.getContentView = function () {
62
- return this.props.item.contentType.indexOf('image/') === 0 ?
63
- React.createElement("img", { src: this.props.item.content }) :
64
- this.props.item.content;
65
- };
66
- return Attachment;
67
- }(FocusableUponSelection));
68
- export default Attachment;