@progress/kendo-react-conversational-ui 11.4.0 → 12.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-prompt/views/AIPromptView.js +2 -2
- package/ai-prompt/views/AIPromptView.mjs +26 -26
- package/chat/components/Action.js +8 -0
- package/chat/components/Action.mjs +37 -0
- package/chat/components/ActionGroup.js +8 -0
- package/chat/components/ActionGroup.mjs +56 -0
- package/chat/components/Attachment.js +8 -0
- package/chat/components/Attachment.mjs +23 -0
- package/chat/components/AttachmentGroup.js +8 -0
- package/chat/components/AttachmentGroup.mjs +66 -0
- package/chat/components/Chat.js +8 -0
- package/chat/components/Chat.mjs +388 -0
- package/chat/components/ChatContext.js +8 -0
- package/{components/base/FocusableUponSelection.mjs → chat/components/ChatContext.mjs} +10 -10
- package/chat/components/ChatMessage.js +8 -0
- package/chat/components/ChatMessage.mjs +284 -0
- package/chat/components/DateMarker.js +8 -0
- package/chat/components/DateMarker.mjs +22 -0
- package/chat/components/Header.js +8 -0
- package/{utils.mjs → chat/components/Header.mjs} +4 -2
- package/chat/components/MessageGroup.js +8 -0
- package/chat/components/MessageGroup.mjs +88 -0
- package/chat/components/NewMessage.js +8 -0
- package/chat/components/NewMessage.mjs +264 -0
- package/chat/components/Notification.js +8 -0
- package/chat/components/Notification.mjs +24 -0
- package/chat/components/SuggestionsGroup.js +1 -1
- package/chat/components/SuggestionsGroup.mjs +40 -23
- package/chat/components/elements/FileBox.js +8 -0
- package/chat/components/elements/FileBox.mjs +69 -0
- package/chat/components/elements/PinnedMessage.js +8 -0
- package/chat/components/elements/PinnedMessage.mjs +46 -0
- package/chat/components/templates/HeroCard.js +8 -0
- package/chat/components/templates/HeroCard.mjs +26 -0
- package/chat/utils/fieldMapping.js +8 -0
- package/chat/utils/fieldMapping.mjs +79 -0
- package/chat/utils.js +8 -0
- package/chat/utils.mjs +65 -0
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/index.d.mts +423 -165
- package/index.d.ts +423 -165
- package/index.js +1 -1
- package/index.mjs +34 -27
- package/messages/index.js +1 -1
- package/messages/index.mjs +38 -16
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +7 -7
- package/components/Action.js +0 -8
- package/components/Action.mjs +0 -45
- package/components/ActionGroup.js +0 -8
- package/components/ActionGroup.mjs +0 -36
- package/components/Attachment.js +0 -8
- package/components/Attachment.mjs +0 -50
- package/components/AttachmentGroup.js +0 -8
- package/components/AttachmentGroup.mjs +0 -64
- package/components/Chat.js +0 -8
- package/components/Chat.mjs +0 -214
- package/components/ChatMessage.js +0 -8
- package/components/ChatMessage.mjs +0 -63
- package/components/ChatToolbar.js +0 -8
- package/components/ChatToolbar.mjs +0 -33
- package/components/DateMarker.js +0 -8
- package/components/DateMarker.mjs +0 -19
- package/components/MessageGroup.js +0 -8
- package/components/MessageGroup.mjs +0 -67
- package/components/NewMessage.js +0 -8
- package/components/NewMessage.mjs +0 -106
- package/components/base/FocusableUponSelection.js +0 -8
- package/components/base/SelectableItemsContainer.js +0 -8
- package/components/base/SelectableItemsContainer.mjs +0 -42
- package/components/templates/HeroCard.js +0 -8
- package/components/templates/HeroCard.mjs +0 -44
- package/utils.js +0 -8
- /package/{ViewItem.js → chat/ViewItem.js} +0 -0
- /package/{ViewItem.mjs → chat/ViewItem.mjs} +0 -0
package/components/Chat.mjs
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
import { Keys as n, dispatchEvent as l, validatePackage as p, getLicenseMessage as u, WatermarkOverlay as d, classNames as g } from "@progress/kendo-react-common";
|
|
9
|
-
import o from "prop-types";
|
|
10
|
-
import * as i from "react";
|
|
11
|
-
import { convertMsgsToViewItems as f } from "../ViewItem.mjs";
|
|
12
|
-
import I from "./ActionGroup.mjs";
|
|
13
|
-
import T from "./AttachmentGroup.mjs";
|
|
14
|
-
import w from "./DateMarker.mjs";
|
|
15
|
-
import k from "./MessageGroup.mjs";
|
|
16
|
-
import y from "./NewMessage.mjs";
|
|
17
|
-
import { ChatMessage as S } from "./ChatMessage.mjs";
|
|
18
|
-
import { packageMetadata as c } from "../package-metadata.mjs";
|
|
19
|
-
import { ariaLabelMessageList as m, messages as x } from "../messages/index.mjs";
|
|
20
|
-
import { provideLocalizationService as E } from "@progress/kendo-react-intl";
|
|
21
|
-
const a = class a extends i.Component {
|
|
22
|
-
constructor(s) {
|
|
23
|
-
super(s), this.viewItems = [], this.isDirectionRightToLeft = !1, this.scrollToBottomOnLoadingData = !0, this.showLicenseWatermark = !1, this.onFocus = () => {
|
|
24
|
-
clearTimeout(this.timeoutIdForChatLosingFocus);
|
|
25
|
-
}, this.onBlur = () => {
|
|
26
|
-
this.timeoutIdForChatLosingFocus = window.setTimeout(() => {
|
|
27
|
-
this.setState({ selectedItemIndex: null });
|
|
28
|
-
}, 0);
|
|
29
|
-
}, this.onSelectionRequested = (e) => {
|
|
30
|
-
this.setState({ selectedItemIndex: e });
|
|
31
|
-
}, this.onKeyDown = (e) => {
|
|
32
|
-
let t = null;
|
|
33
|
-
const r = this.state.selectedItemIndex !== null ? this.state.selectedItemIndex : this.viewItems.lastSelectionIndex;
|
|
34
|
-
e.keyCode === n.up ? r === null ? t = 0 : r > 0 && (t = r - 1) : e.keyCode === n.down && (r === null ? t = 0 : r < this.viewItems.lastSelectionIndex && (t = r + 1)), t !== null && (this.setState({ selectedItemIndex: t }), e.preventDefault());
|
|
35
|
-
}, this.onMessageSend = (e, t) => {
|
|
36
|
-
l(this.props.onMessageSend, t, this, { message: e });
|
|
37
|
-
}, this.onActionExecute = (e, t) => {
|
|
38
|
-
if (l(this.props.onActionExecute, t, this, { action: e }), !t.isDefaultPrevented()) {
|
|
39
|
-
switch (e.type) {
|
|
40
|
-
case "reply":
|
|
41
|
-
this.onMessageSend(
|
|
42
|
-
{
|
|
43
|
-
author: this.props.user,
|
|
44
|
-
text: e.value,
|
|
45
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
46
|
-
},
|
|
47
|
-
t
|
|
48
|
-
);
|
|
49
|
-
break;
|
|
50
|
-
case "call":
|
|
51
|
-
window.open("tel:" + e.value);
|
|
52
|
-
break;
|
|
53
|
-
case "openUrl":
|
|
54
|
-
window.open(e.value);
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
this.newMsgComp.focusInput();
|
|
58
|
-
}
|
|
59
|
-
}, this.showLicenseWatermark = !p(c, { component: "Chat" }), this.licenseMessage = u(c), this.state = { selectedItemIndex: null, isFirstRender: !0 };
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @hidden
|
|
63
|
-
*/
|
|
64
|
-
render() {
|
|
65
|
-
this.viewItems = this.getViewItemsFromMsgs(this.props.messages), this.isDirectionRightToLeft = this.checkIsDirectionRightToLeft(this.props);
|
|
66
|
-
const s = E(this);
|
|
67
|
-
return /* @__PURE__ */ i.createElement(
|
|
68
|
-
"div",
|
|
69
|
-
{
|
|
70
|
-
style: { width: this.props.width, position: "relative" },
|
|
71
|
-
onKeyDown: this.onKeyDown,
|
|
72
|
-
className: this.getClassNames(),
|
|
73
|
-
ref: (e) => {
|
|
74
|
-
this.chatWrapperEl = e;
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
/* @__PURE__ */ i.createElement(
|
|
78
|
-
"div",
|
|
79
|
-
{
|
|
80
|
-
className: "k-message-list k-avatars",
|
|
81
|
-
onBlur: this.onBlur,
|
|
82
|
-
onFocus: this.onFocus,
|
|
83
|
-
role: "log",
|
|
84
|
-
"aria-label": s.toLanguageString(
|
|
85
|
-
m,
|
|
86
|
-
x[m]
|
|
87
|
-
),
|
|
88
|
-
"aria-live": "polite",
|
|
89
|
-
onScroll: (e) => {
|
|
90
|
-
this.scrollToBottomOnLoadingData = e.currentTarget.scrollTop === e.currentTarget.scrollHeight - e.currentTarget.clientHeight;
|
|
91
|
-
},
|
|
92
|
-
ref: (e) => {
|
|
93
|
-
this.viewItemsWrapperEl = e;
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
/* @__PURE__ */ i.createElement("div", { className: "k-message-list-content" }, this.renderViewItems())
|
|
97
|
-
),
|
|
98
|
-
/* @__PURE__ */ i.createElement(
|
|
99
|
-
y,
|
|
100
|
-
{
|
|
101
|
-
user: this.props.user,
|
|
102
|
-
onMessageSend: this.onMessageSend,
|
|
103
|
-
isDirectionRightToLeft: this.isDirectionRightToLeft,
|
|
104
|
-
ref: (e) => {
|
|
105
|
-
this.newMsgComp = e;
|
|
106
|
-
},
|
|
107
|
-
placeholder: this.props.placeholder,
|
|
108
|
-
MessageBox: this.props.messageBox,
|
|
109
|
-
toolbar: this.props.toolbar,
|
|
110
|
-
onToolbarActionButtonClick: this.props.onToolbarActionExecute,
|
|
111
|
-
showToolbar: this.props.showToolbar
|
|
112
|
-
}
|
|
113
|
-
),
|
|
114
|
-
this.showLicenseWatermark && /* @__PURE__ */ i.createElement(d, { message: this.licenseMessage })
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* @hidden
|
|
119
|
-
*/
|
|
120
|
-
componentDidMount() {
|
|
121
|
-
this.setState({ isFirstRender: !1 }, () => {
|
|
122
|
-
this.nextTickId = window.setTimeout(() => this.scrollViewItemsToBottom(), 250);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* @hidden
|
|
127
|
-
*/
|
|
128
|
-
componentWillUnmount() {
|
|
129
|
-
clearTimeout(this.nextTickId);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* @hidden
|
|
133
|
-
*/
|
|
134
|
-
componentDidUpdate(s) {
|
|
135
|
-
s.messages.length !== this.props.messages.length && this.scrollToBottomOnLoadingData && this.scrollViewItemsToBottom();
|
|
136
|
-
}
|
|
137
|
-
getClassNames() {
|
|
138
|
-
return g("k-chat", this.props.className, { "k-rtl": this.isDirectionRightToLeft });
|
|
139
|
-
}
|
|
140
|
-
checkIsDirectionRightToLeft(s) {
|
|
141
|
-
return !!(s.dir !== void 0 ? s.dir === "rtl" : this.chatWrapperEl && getComputedStyle(this.chatWrapperEl).direction === "rtl");
|
|
142
|
-
}
|
|
143
|
-
renderViewItems() {
|
|
144
|
-
const s = this.viewItems.length - 1;
|
|
145
|
-
return this.viewItems.map((e, t) => {
|
|
146
|
-
if (e.type === "date-marker")
|
|
147
|
-
return /* @__PURE__ */ i.createElement(w, { item: e, key: t });
|
|
148
|
-
if (e.type === "message-group")
|
|
149
|
-
return /* @__PURE__ */ i.createElement(
|
|
150
|
-
k,
|
|
151
|
-
{
|
|
152
|
-
group: e,
|
|
153
|
-
itemTemplate: this.props.messageTemplate,
|
|
154
|
-
attachmentTemplate: this.props.attachmentTemplate,
|
|
155
|
-
user: this.props.user,
|
|
156
|
-
selectedItemIndex: this.state.selectedItemIndex,
|
|
157
|
-
onRequestSelection: this.onSelectionRequested,
|
|
158
|
-
isLastGroup: t === s,
|
|
159
|
-
key: t,
|
|
160
|
-
message: this.props.message || a.defaultProps.message
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
if (e.type === "attachment-group")
|
|
164
|
-
return /* @__PURE__ */ i.createElement(
|
|
165
|
-
T,
|
|
166
|
-
{
|
|
167
|
-
group: e,
|
|
168
|
-
itemTemplate: this.props.attachmentTemplate,
|
|
169
|
-
onRequestSelection: this.onSelectionRequested,
|
|
170
|
-
selected: e.selectionIndex === this.state.selectedItemIndex,
|
|
171
|
-
isLastGroup: t === s,
|
|
172
|
-
key: t
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
if (e.type === "action-group")
|
|
176
|
-
return /* @__PURE__ */ i.createElement(
|
|
177
|
-
I,
|
|
178
|
-
{
|
|
179
|
-
group: e,
|
|
180
|
-
onActionExecute: this.onActionExecute,
|
|
181
|
-
onRequestSelection: this.onSelectionRequested,
|
|
182
|
-
selected: e.selectionIndex === this.state.selectedItemIndex,
|
|
183
|
-
isLastGroup: t === s,
|
|
184
|
-
key: t
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
scrollViewItemsToBottom() {
|
|
190
|
-
this.viewItemsWrapperEl && (this.viewItemsWrapperEl.scrollTop = this.viewItemsWrapperEl.scrollHeight - this.viewItemsWrapperEl.clientHeight);
|
|
191
|
-
}
|
|
192
|
-
getViewItemsFromMsgs(s) {
|
|
193
|
-
return s.length > 0 ? f(s) : [];
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
a.propTypes = {
|
|
197
|
-
messages: o.arrayOf(o.object),
|
|
198
|
-
user: o.object,
|
|
199
|
-
messageTemplate: o.any,
|
|
200
|
-
attachmentTemplate: o.any,
|
|
201
|
-
width: o.oneOfType([o.string, o.number]),
|
|
202
|
-
onMessageSend: o.func,
|
|
203
|
-
onActionExecute: o.func,
|
|
204
|
-
dir: o.string,
|
|
205
|
-
messageBox: o.any
|
|
206
|
-
}, a.defaultProps = {
|
|
207
|
-
messages: [],
|
|
208
|
-
dateFormat: "g",
|
|
209
|
-
message: S
|
|
210
|
-
};
|
|
211
|
-
let h = a;
|
|
212
|
-
export {
|
|
213
|
-
h as Chat
|
|
214
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),p=require("@progress/kendo-react-common"),o=require("@progress/kendo-react-intl"),c=require("./base/FocusableUponSelection.js");function m(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}return e.default=s,Object.freeze(e)}const t=m(l),n=class n extends c.FocusableUponSelection{render(){return t.createElement("div",{className:this.getClassNames(),tabIndex:this.props.tabIndex,onClick:()=>this.props.onRequestSelection(this.props.item.selectionIndex),onFocus:()=>this.props.onRequestSelection(this.props.item.selectionIndex),ref:e=>{this.elementToFocus=e}},this.getTimestampView(),this.getMainView(),this.getStatusView())}getMainView(){return this.props.item.typing?t.createElement("div",{className:"k-chat-bubble"},t.createElement("div",{className:"k-typing-indicator"},t.createElement("span",null),t.createElement("span",null),t.createElement("span",null))):this.props.template?t.createElement(this.props.template,{item:this.props.item}):this.props.item.text?t.createElement("div",{className:"k-chat-bubble"},this.props.item.text):null}getTimestampView(){let e=null;return this.props.item.timestamp&&(e=t.createElement("time",{className:"k-message-time","aria-hidden":!this.props.selected},o.provideIntlService(this).formatDate(this.props.item.timestamp,this.props.dateFormat))),e}getStatusView(){let e=null;return this.props.item.status&&(e=t.createElement("span",{className:"k-message-status"},this.props.item.status)),e}getClassNames(){return p.classNames({"k-only":this.props.isOnlyItemInGroup},{"k-first":this.props.isFirstItemInGroup&&!this.props.isOnlyItemInGroup},{"k-last":this.props.isLastItemInGroup&&!this.props.isOnlyItemInGroup},{"k-selected":this.props.selected},{"k-focus":this.props.selected},"k-message")}};n.defaultProps={dateFormat:"g",tabIndex:-1};let r=n;o.registerForIntl(r);exports.ChatMessage=r;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
import * as e from "react";
|
|
9
|
-
import { classNames as r } from "@progress/kendo-react-common";
|
|
10
|
-
import { provideIntlService as p, registerForIntl as a } from "@progress/kendo-react-intl";
|
|
11
|
-
import { FocusableUponSelection as n } from "./base/FocusableUponSelection.mjs";
|
|
12
|
-
const i = class i extends n {
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
render() {
|
|
17
|
-
return /* @__PURE__ */ e.createElement(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
className: this.getClassNames(),
|
|
21
|
-
tabIndex: this.props.tabIndex,
|
|
22
|
-
onClick: () => this.props.onRequestSelection(this.props.item.selectionIndex),
|
|
23
|
-
onFocus: () => this.props.onRequestSelection(this.props.item.selectionIndex),
|
|
24
|
-
ref: (t) => {
|
|
25
|
-
this.elementToFocus = t;
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
this.getTimestampView(),
|
|
29
|
-
this.getMainView(),
|
|
30
|
-
this.getStatusView()
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
getMainView() {
|
|
34
|
-
return this.props.item.typing ? /* @__PURE__ */ e.createElement("div", { className: "k-chat-bubble" }, /* @__PURE__ */ e.createElement("div", { className: "k-typing-indicator" }, /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("span", null))) : this.props.template ? /* @__PURE__ */ e.createElement(this.props.template, { item: this.props.item }) : this.props.item.text ? /* @__PURE__ */ e.createElement("div", { className: "k-chat-bubble" }, this.props.item.text) : null;
|
|
35
|
-
}
|
|
36
|
-
getTimestampView() {
|
|
37
|
-
let t = null;
|
|
38
|
-
return this.props.item.timestamp && (t = /* @__PURE__ */ e.createElement("time", { className: "k-message-time", "aria-hidden": !this.props.selected }, p(this).formatDate(this.props.item.timestamp, this.props.dateFormat))), t;
|
|
39
|
-
}
|
|
40
|
-
getStatusView() {
|
|
41
|
-
let t = null;
|
|
42
|
-
return this.props.item.status && (t = /* @__PURE__ */ e.createElement("span", { className: "k-message-status" }, this.props.item.status)), t;
|
|
43
|
-
}
|
|
44
|
-
getClassNames() {
|
|
45
|
-
return r(
|
|
46
|
-
{ "k-only": this.props.isOnlyItemInGroup },
|
|
47
|
-
{ "k-first": this.props.isFirstItemInGroup && !this.props.isOnlyItemInGroup },
|
|
48
|
-
{ "k-last": this.props.isLastItemInGroup && !this.props.isOnlyItemInGroup },
|
|
49
|
-
{ "k-selected": this.props.selected },
|
|
50
|
-
{ "k-focus": this.props.selected },
|
|
51
|
-
"k-message"
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
i.defaultProps = {
|
|
56
|
-
dateFormat: "g",
|
|
57
|
-
tabIndex: -1
|
|
58
|
-
};
|
|
59
|
-
let s = i;
|
|
60
|
-
a(s);
|
|
61
|
-
export {
|
|
62
|
-
s as ChatMessage
|
|
63
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),c=require("@progress/kendo-react-common"),m=require("@progress/kendo-react-buttons");function d(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const t=d(f),u=t.forwardRef((e,o)=>{const{className:r,...a}=e,n=t.useRef(null),l=t.useRef(null);t.useImperativeHandle(l,()=>({element:n.current,props:e})),t.useImperativeHandle(o,()=>l.current);const i=t.useMemo(()=>c.classNames("k-chat-toolbar k-toolbar",r),[r]);return t.useEffect(()=>{n.current!==null&&c.focusFirstFocusableChild(n.current,[...c.TABBABLE_ELEMENTS])},[]),t.createElement(m.Toolbar,{id:e.id,ref:s=>{s&&(n.current=s.element)},className:i,...a},t.createElement("div",{className:"k-button-list k-toolbar-group"},e.children))});u.displayName="KendoReactChatToolbar";exports.ChatToolbar=u;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
import * as e from "react";
|
|
9
|
-
import { classNames as m, focusFirstFocusableChild as u, TABBABLE_ELEMENTS as i } from "@progress/kendo-react-common";
|
|
10
|
-
import { Toolbar as f } from "@progress/kendo-react-buttons";
|
|
11
|
-
const d = e.forwardRef((t, s) => {
|
|
12
|
-
const { className: a, ...n } = t, r = e.useRef(null), o = e.useRef(null);
|
|
13
|
-
e.useImperativeHandle(o, () => ({ element: r.current, props: t })), e.useImperativeHandle(s, () => o.current);
|
|
14
|
-
const c = e.useMemo(() => m("k-chat-toolbar k-toolbar", a), [a]);
|
|
15
|
-
return e.useEffect(() => {
|
|
16
|
-
r.current !== null && u(r.current, [...i]);
|
|
17
|
-
}, []), /* @__PURE__ */ e.createElement(
|
|
18
|
-
f,
|
|
19
|
-
{
|
|
20
|
-
id: t.id,
|
|
21
|
-
ref: (l) => {
|
|
22
|
-
l && (r.current = l.element);
|
|
23
|
-
},
|
|
24
|
-
className: c,
|
|
25
|
-
...n
|
|
26
|
-
},
|
|
27
|
-
/* @__PURE__ */ e.createElement("div", { className: "k-button-list k-toolbar-group" }, t.children)
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
d.displayName = "KendoReactChatToolbar";
|
|
31
|
-
export {
|
|
32
|
-
d as ChatToolbar
|
|
33
|
-
};
|
package/components/DateMarker.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";const s=require("react"),c=require("@progress/kendo-react-intl");function i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const a=i(s);class o extends a.Component{render(){const t=this.props.item;return a.createElement("div",{className:"k-timestamp"},c.provideIntlService(this).formatDate(t.timestamp,"D"))}}c.registerForIntl(o);module.exports=o;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
import * as e from "react";
|
|
9
|
-
import { provideIntlService as r, registerForIntl as a } from "@progress/kendo-react-intl";
|
|
10
|
-
class m extends e.Component {
|
|
11
|
-
render() {
|
|
12
|
-
const t = this.props.item;
|
|
13
|
-
return /* @__PURE__ */ e.createElement("div", { className: "k-timestamp" }, r(this).formatDate(t.timestamp, "D"));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
a(m);
|
|
17
|
-
export {
|
|
18
|
-
m as default
|
|
19
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";const c=require("react"),i=require("@progress/kendo-react-common"),p=require("@progress/kendo-react-layout"),l=require("./Attachment.js"),u=require("../utils.js"),m=require("@progress/kendo-react-intl"),n=require("../messages/index.js");function g(r){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return s.default=r,Object.freeze(s)}const a=g(c);class h extends a.Component{render(){const{avatarUrl:s,avatarAltText:e,name:t}=this.props.group.author,o=m.provideLocalizationService(this);return a.createElement("div",{className:this.getMsgGroupClassNames()},t&&a.createElement("p",{className:"k-author"},t),s&&a.createElement(p.Avatar,{type:"image"},a.createElement("img",{src:s,alt:e!==void 0?e:o.toLanguageString(n.avatarAlt,n.messages[n.avatarAlt])})),this.getGroupMessagesView())}getMsgGroupClassNames(){return i.classNames("k-message-group",{"k-no-avatar":!this.props.group.author.avatarUrl,"k-alt":u.isAuthor(this.props.user,this.props.group.messages[0])})}getGroupMessagesView(){const s=this.props.group.messages.length-1;return this.props.group.messages.map((e,t)=>{const o=[a.createElement(this.props.message,{item:e,template:this.props.itemTemplate,selected:e.selectionIndex===this.props.selectedItemIndex,onRequestSelection:this.props.onRequestSelection,tabIndex:t===s&&this.props.isLastGroup?0:-1,isFirstItemInGroup:t===0,isLastItemInGroup:t===s,isOnlyItemInGroup:s===0,key:t})];return e.attachments&&e.attachments.length===1&&o.push(a.createElement(l,{item:e.attachments[0],template:this.props.attachmentTemplate,selected:!1,key:`att-${t}`})),o})}}module.exports=h;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
import * as s from "react";
|
|
9
|
-
import { classNames as p } from "@progress/kendo-react-common";
|
|
10
|
-
import { Avatar as m } from "@progress/kendo-react-layout";
|
|
11
|
-
import i from "./Attachment.mjs";
|
|
12
|
-
import { isAuthor as n } from "../utils.mjs";
|
|
13
|
-
import { provideLocalizationService as l } from "@progress/kendo-react-intl";
|
|
14
|
-
import { avatarAlt as o, messages as c } from "../messages/index.mjs";
|
|
15
|
-
class G extends s.Component {
|
|
16
|
-
render() {
|
|
17
|
-
const { avatarUrl: a, avatarAltText: e, name: t } = this.props.group.author, r = l(this);
|
|
18
|
-
return /* @__PURE__ */ s.createElement("div", { className: this.getMsgGroupClassNames() }, t && /* @__PURE__ */ s.createElement("p", { className: "k-author" }, t), a && /* @__PURE__ */ s.createElement(m, { type: "image" }, /* @__PURE__ */ s.createElement(
|
|
19
|
-
"img",
|
|
20
|
-
{
|
|
21
|
-
src: a,
|
|
22
|
-
alt: e !== void 0 ? e : r.toLanguageString(o, c[o])
|
|
23
|
-
}
|
|
24
|
-
)), this.getGroupMessagesView());
|
|
25
|
-
}
|
|
26
|
-
getMsgGroupClassNames() {
|
|
27
|
-
return p("k-message-group", {
|
|
28
|
-
"k-no-avatar": !this.props.group.author.avatarUrl,
|
|
29
|
-
"k-alt": n(this.props.user, this.props.group.messages[0])
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
getGroupMessagesView() {
|
|
33
|
-
const a = this.props.group.messages.length - 1;
|
|
34
|
-
return this.props.group.messages.map((e, t) => {
|
|
35
|
-
const r = [
|
|
36
|
-
/* @__PURE__ */ s.createElement(
|
|
37
|
-
this.props.message,
|
|
38
|
-
{
|
|
39
|
-
item: e,
|
|
40
|
-
template: this.props.itemTemplate,
|
|
41
|
-
selected: e.selectionIndex === this.props.selectedItemIndex,
|
|
42
|
-
onRequestSelection: this.props.onRequestSelection,
|
|
43
|
-
tabIndex: t === a && this.props.isLastGroup ? 0 : -1,
|
|
44
|
-
isFirstItemInGroup: t === 0,
|
|
45
|
-
isLastItemInGroup: t === a,
|
|
46
|
-
isOnlyItemInGroup: a === 0,
|
|
47
|
-
key: t
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
];
|
|
51
|
-
return e.attachments && e.attachments.length === 1 && r.push(
|
|
52
|
-
/* @__PURE__ */ s.createElement(
|
|
53
|
-
i,
|
|
54
|
-
{
|
|
55
|
-
item: e.attachments[0],
|
|
56
|
-
template: this.props.attachmentTemplate,
|
|
57
|
-
selected: !1,
|
|
58
|
-
key: `att-${t}`
|
|
59
|
-
}
|
|
60
|
-
)
|
|
61
|
-
), r;
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
G as default
|
|
67
|
-
};
|
package/components/NewMessage.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";const c=require("@progress/kendo-react-common"),p=require("react"),h=require("./ChatToolbar.js"),l=require("@progress/kendo-react-buttons"),u=require("@progress/kendo-svg-icons"),g=require("@progress/kendo-react-intl"),n=require("../messages/index.js");function m(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>a[s]})}}return e.default=a,Object.freeze(e)}const t=m(p);class f extends t.Component{constructor(){super(...arguments),this.state={focused:!1},this.inputEl=null,this.toolbarBtnRef=t.createRef(),this.onInputKeyDown=e=>{switch(e.key){case"Enter":return this.sendMessage(e);case"F10":return this.openToolbar(e);default:return}},this.sendMessage=e=>{if(this.props.onMessageSend&&this.inputEl!==null){const s=this.inputEl.value;if(s){const o={author:this.props.user,text:s,timestamp:new Date};this.props.onMessageSend(o,e)}}this.inputEl!==null&&(this.inputEl.value=null)},this.openToolbar=e=>{this.toolbarBtnRef.current!==null&&(e.preventDefault(),this.props.onToolbarActionButtonClick(!this.props.showToolbar,e))}}render(){const e=g.provideLocalizationService(this),s=t.createElement("input",{type:"text",className:this.getClassNames(),placeholder:this.props.placeholder,onKeyDown:this.onInputKeyDown,onFocus:()=>this.setState({focused:!0}),onBlur:()=>this.setState({focused:!1}),ref:r=>{this.inputEl=r},"aria-label":e.toLanguageString(n.newMessageMessageInput,n.messages[n.newMessageMessageInput])}),o=t.createElement(l.Button,{fillMode:"flat",themeColor:"base",className:"k-chat-send",icon:"paper-plane",svgIcon:u.paperPlaneIcon,onClick:this.sendMessage,"aria-label":e.toLanguageString(n.newMessageSendButton,n.messages[n.newMessageSendButton]),dir:this.props.isDirectionRightToLeft?"rtl":void 0}),i=t.createElement(l.Button,{ref:this.toolbarBtnRef,fillMode:"flat",themeColor:"base",icon:"more-horizontal",svgIcon:u.moreHorizontalIcon,onClick:r=>this.props.onToolbarActionButtonClick(!this.props.showToolbar,r),"aria-label":e.toLanguageString(n.newMessageOptionsButton,n.messages[n.newMessageOptionsButton])});return t.createElement(t.Fragment,null,t.createElement("span",{className:"k-message-box k-textbox k-input k-input-md k-rounded-md k-input-solid"},this.props.MessageBox?t.createElement(this.props.MessageBox,{messageInput:s,sendButton:o,toolbarButton:i}):t.createElement(t.Fragment,null,s,t.createElement("span",{className:"k-input-separator k-input-separator-vertical"}),t.createElement("span",{className:"k-input-suffix k-input-suffix-horizontal"},this.props.toolbar&&i,o))),this.props.showToolbar&&t.createElement(h.ChatToolbar,null,this.props.toolbar))}focusInput(){this.inputEl!==null&&this.inputEl.focus()}getClassNames(){return c.classNames("k-input-inner",{"k-focus":this.state.focused})}}module.exports=f;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
import { classNames as c } from "@progress/kendo-react-common";
|
|
9
|
-
import * as e from "react";
|
|
10
|
-
import { ChatToolbar as h } from "./ChatToolbar.mjs";
|
|
11
|
-
import { Button as i } from "@progress/kendo-react-buttons";
|
|
12
|
-
import { paperPlaneIcon as m, moreHorizontalIcon as f } from "@progress/kendo-svg-icons";
|
|
13
|
-
import { provideLocalizationService as g } from "@progress/kendo-react-intl";
|
|
14
|
-
import { newMessageMessageInput as l, messages as a, newMessageSendButton as p, newMessageOptionsButton as u } from "../messages/index.mjs";
|
|
15
|
-
class x extends e.Component {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments), this.state = { focused: !1 }, this.inputEl = null, this.toolbarBtnRef = e.createRef(), this.onInputKeyDown = (t) => {
|
|
18
|
-
switch (t.key) {
|
|
19
|
-
case "Enter":
|
|
20
|
-
return this.sendMessage(t);
|
|
21
|
-
case "F10":
|
|
22
|
-
return this.openToolbar(t);
|
|
23
|
-
default:
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
}, this.sendMessage = (t) => {
|
|
27
|
-
if (this.props.onMessageSend && this.inputEl !== null) {
|
|
28
|
-
const s = this.inputEl.value;
|
|
29
|
-
if (s) {
|
|
30
|
-
const o = {
|
|
31
|
-
author: this.props.user,
|
|
32
|
-
text: s,
|
|
33
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
34
|
-
};
|
|
35
|
-
this.props.onMessageSend(o, t);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
this.inputEl !== null && (this.inputEl.value = null);
|
|
39
|
-
}, this.openToolbar = (t) => {
|
|
40
|
-
this.toolbarBtnRef.current !== null && (t.preventDefault(), this.props.onToolbarActionButtonClick(!this.props.showToolbar, t));
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
render() {
|
|
44
|
-
const t = g(this), s = /* @__PURE__ */ e.createElement(
|
|
45
|
-
"input",
|
|
46
|
-
{
|
|
47
|
-
type: "text",
|
|
48
|
-
className: this.getClassNames(),
|
|
49
|
-
placeholder: this.props.placeholder,
|
|
50
|
-
onKeyDown: this.onInputKeyDown,
|
|
51
|
-
onFocus: () => this.setState({ focused: !0 }),
|
|
52
|
-
onBlur: () => this.setState({ focused: !1 }),
|
|
53
|
-
ref: (n) => {
|
|
54
|
-
this.inputEl = n;
|
|
55
|
-
},
|
|
56
|
-
"aria-label": t.toLanguageString(
|
|
57
|
-
l,
|
|
58
|
-
a[l]
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
), o = /* @__PURE__ */ e.createElement(
|
|
62
|
-
i,
|
|
63
|
-
{
|
|
64
|
-
fillMode: "flat",
|
|
65
|
-
themeColor: "base",
|
|
66
|
-
className: "k-chat-send",
|
|
67
|
-
icon: "paper-plane",
|
|
68
|
-
svgIcon: m,
|
|
69
|
-
onClick: this.sendMessage,
|
|
70
|
-
"aria-label": t.toLanguageString(p, a[p]),
|
|
71
|
-
dir: this.props.isDirectionRightToLeft ? "rtl" : void 0
|
|
72
|
-
}
|
|
73
|
-
), r = /* @__PURE__ */ e.createElement(
|
|
74
|
-
i,
|
|
75
|
-
{
|
|
76
|
-
ref: this.toolbarBtnRef,
|
|
77
|
-
fillMode: "flat",
|
|
78
|
-
themeColor: "base",
|
|
79
|
-
icon: "more-horizontal",
|
|
80
|
-
svgIcon: f,
|
|
81
|
-
onClick: (n) => this.props.onToolbarActionButtonClick(!this.props.showToolbar, n),
|
|
82
|
-
"aria-label": t.toLanguageString(
|
|
83
|
-
u,
|
|
84
|
-
a[u]
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("span", { className: "k-message-box k-textbox k-input k-input-md k-rounded-md k-input-solid" }, this.props.MessageBox ? /* @__PURE__ */ e.createElement(
|
|
89
|
-
this.props.MessageBox,
|
|
90
|
-
{
|
|
91
|
-
messageInput: s,
|
|
92
|
-
sendButton: o,
|
|
93
|
-
toolbarButton: r
|
|
94
|
-
}
|
|
95
|
-
) : /* @__PURE__ */ e.createElement(e.Fragment, null, s, /* @__PURE__ */ e.createElement("span", { className: "k-input-separator k-input-separator-vertical" }), /* @__PURE__ */ e.createElement("span", { className: "k-input-suffix k-input-suffix-horizontal" }, this.props.toolbar && r, o))), this.props.showToolbar && /* @__PURE__ */ e.createElement(h, null, this.props.toolbar));
|
|
96
|
-
}
|
|
97
|
-
focusInput() {
|
|
98
|
-
this.inputEl !== null && this.inputEl.focus();
|
|
99
|
-
}
|
|
100
|
-
getClassNames() {
|
|
101
|
-
return c("k-input-inner", { "k-focus": this.state.focused });
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
export {
|
|
105
|
-
x as default
|
|
106
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=r(c);class l extends s.Component{componentDidUpdate(t){!t.selected&&this.props.selected&&this.elementToFocus.focus()}}exports.FocusableUponSelection=l;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),o=require("@progress/kendo-react-common");function i(l){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const e in l)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(l,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>l[e]})}}return t.default=l,Object.freeze(t)}const a=i(r);class c extends a.Component{constructor(){super(...arguments),this.state={selectedItemIndex:null},this.onRequestContainerSelection=()=>this.props.onRequestSelection(this.props.group.selectionIndex),this.onKeyDown=t=>{let e=null,n,s;this.isKeyboardNavigationLeftRight?(n=o.Keys.left,s=o.Keys.right):(n=o.Keys.up,s=o.Keys.down),t.keyCode===n?e=this.navigate(!1):t.keyCode===s&&(e=this.navigate(!0)),e!==null&&(t.preventDefault(),t.stopPropagation())}}static getDerivedStateFromProps(t,e){return!t.selected&&e.selectedItemIndex!==null?{selectedItemIndex:null}:t.selected&&e.selectedItemIndex===null?{selectedItemIndex:0}:null}navigate(t,e=0){let n=null;const s=this.state.selectedItemIndex;return t?s===null?n=e:s<this.getLastSelectionIndex()&&(n=s+1):s===null?n=0:s>0&&(n=s-1),n!==null&&this.setState({selectedItemIndex:n}),n}get isKeyboardNavigationLeftRight(){return!0}getLastSelectionIndex(){let t=-1;if(this.props.group.type==="action-group"){const e=this.props.group;t=e.actions?e.actions.length-1:-1}else if(this.props.group.type==="attachment-group"){const e=this.props.group;t=e.attachments?e.attachments.length-1:-1}return t}}exports.SelectableItemsContainer=c;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
import * as i from "react";
|
|
9
|
-
import { Keys as l } from "@progress/kendo-react-common";
|
|
10
|
-
class a extends i.Component {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments), this.state = { selectedItemIndex: null }, this.onRequestContainerSelection = () => this.props.onRequestSelection(this.props.group.selectionIndex), this.onKeyDown = (t) => {
|
|
13
|
-
let e = null, n, s;
|
|
14
|
-
this.isKeyboardNavigationLeftRight ? (n = l.left, s = l.right) : (n = l.up, s = l.down), t.keyCode === n ? e = this.navigate(!1) : t.keyCode === s && (e = this.navigate(!0)), e !== null && (t.preventDefault(), t.stopPropagation());
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
static getDerivedStateFromProps(t, e) {
|
|
18
|
-
return !t.selected && e.selectedItemIndex !== null ? { selectedItemIndex: null } : t.selected && e.selectedItemIndex === null ? { selectedItemIndex: 0 } : null;
|
|
19
|
-
}
|
|
20
|
-
navigate(t, e = 0) {
|
|
21
|
-
let n = null;
|
|
22
|
-
const s = this.state.selectedItemIndex;
|
|
23
|
-
return t ? s === null ? n = e : s < this.getLastSelectionIndex() && (n = s + 1) : s === null ? n = 0 : s > 0 && (n = s - 1), n !== null && this.setState({ selectedItemIndex: n }), n;
|
|
24
|
-
}
|
|
25
|
-
get isKeyboardNavigationLeftRight() {
|
|
26
|
-
return !0;
|
|
27
|
-
}
|
|
28
|
-
getLastSelectionIndex() {
|
|
29
|
-
let t = -1;
|
|
30
|
-
if (this.props.group.type === "action-group") {
|
|
31
|
-
const e = this.props.group;
|
|
32
|
-
t = e.actions ? e.actions.length - 1 : -1;
|
|
33
|
-
} else if (this.props.group.type === "attachment-group") {
|
|
34
|
-
const e = this.props.group;
|
|
35
|
-
t = e.attachments ? e.attachments.length - 1 : -1;
|
|
36
|
-
}
|
|
37
|
-
return t;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
a as SelectableItemsContainer
|
|
42
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),c=require("@progress/kendo-react-buttons"),n=require("@progress/kendo-react-common");function l(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>s[r]})}}return e.default=s,Object.freeze(e)}const t=l(a);class o extends t.Component{constructor(){super(...arguments),this.onBtnClick=(e,r)=>{n.dispatchEvent(this.props.onActionExecute,r,this,{action:e})}}render(){return t.createElement("div",{className:"k-card"},t.createElement("img",{className:"k-card-image",src:this.props.imageUrl,style:{maxWidth:this.props.imageMaxWidth}}),t.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView()),t.createElement("div",{className:"k-card-actions k-card-actions-vertical"},this.getActionsView()))}getActionsView(){return this.props.actions.map((e,r)=>t.createElement("span",{className:"k-card-action",key:r},t.createElement(c.Button,{fillMode:"flat",onClick:i=>this.onBtnClick(e,i)},e.title)))}getTitleView(){let e=null;return this.props.title&&(e=t.createElement("h5",{className:"k-card-title"},this.props.title)),e}getSubtitleView(){let e=null;return this.props.subtitle&&(e=t.createElement("h6",{className:"k-card-subtitle"},this.props.subtitle)),e}}exports.HeroCard=o;
|