@factoringplus/pl-components-pack-v3 0.5.2-pre-12 → 0.5.2-pre-14
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.
|
@@ -47578,10 +47578,12 @@ const useSelectedChannelStore = defineStore("selectedChannel", {
|
|
|
47578
47578
|
async sendMessage(params, callback) {
|
|
47579
47579
|
try {
|
|
47580
47580
|
this.isManagerSendMsg = true;
|
|
47581
|
+
const { message: message2 } = params;
|
|
47581
47582
|
await Promise.all([
|
|
47582
47583
|
await this.loadMessages(),
|
|
47583
47584
|
await apiChat.postChatMessagesByChannelId(this.api, this.baseUrl, this.channelId, params)
|
|
47584
47585
|
]);
|
|
47586
|
+
this.messages.push(message2);
|
|
47585
47587
|
} catch {
|
|
47586
47588
|
this.messages.push({
|
|
47587
47589
|
...params.message,
|
|
@@ -47682,15 +47684,19 @@ const _sfc_main$e = {
|
|
|
47682
47684
|
width: {
|
|
47683
47685
|
type: String,
|
|
47684
47686
|
default: "100"
|
|
47687
|
+
},
|
|
47688
|
+
unreadMessagesCount: {
|
|
47689
|
+
type: Number,
|
|
47690
|
+
default: 0
|
|
47685
47691
|
}
|
|
47686
47692
|
},
|
|
47687
47693
|
setup(__props) {
|
|
47688
47694
|
const props = __props;
|
|
47689
47695
|
const plChatBtnClass = `pl-chat-btn ${props.type}`;
|
|
47690
|
-
|
|
47696
|
+
useChannelsStore();
|
|
47691
47697
|
return (_ctx, _cache) => {
|
|
47692
47698
|
return openBlock(), createElementBlock("button", {
|
|
47693
|
-
class: normalizeClass([{ "unreaded-message":
|
|
47699
|
+
class: normalizeClass([{ "unreaded-message": __props.unreadMessagesCount }, plChatBtnClass]),
|
|
47694
47700
|
style: normalizeStyle(`width: ${__props.width}px`)
|
|
47695
47701
|
}, [
|
|
47696
47702
|
renderSlot(_ctx.$slots, "default")
|
|
@@ -47745,6 +47751,7 @@ const _sfc_main$d = {
|
|
|
47745
47751
|
const _directive_loading = vLoading;
|
|
47746
47752
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
47747
47753
|
withDirectives((openBlock(), createBlock(_sfc_main$e, {
|
|
47754
|
+
"unread-messages-count": unref(channelsStore).unreadChannelsCount,
|
|
47748
47755
|
type: "info",
|
|
47749
47756
|
width: "171",
|
|
47750
47757
|
onClick: togglePopup
|
|
@@ -47753,7 +47760,7 @@ const _sfc_main$d = {
|
|
|
47753
47760
|
createTextVNode(toDisplayString(__props.btnText), 1)
|
|
47754
47761
|
]),
|
|
47755
47762
|
_: 1
|
|
47756
|
-
})), [
|
|
47763
|
+
}, 8, ["unread-messages-count"])), [
|
|
47757
47764
|
[_directive_loading, unref(channelsStore).isHubsConnected]
|
|
47758
47765
|
]),
|
|
47759
47766
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
@@ -50721,24 +50728,6 @@ const _sfc_main$1 = {
|
|
|
50721
50728
|
files.value = files.value.filter((file) => file.internalGuid !== internalGuid);
|
|
50722
50729
|
};
|
|
50723
50730
|
const footerVisibility = computed$1(() => !props.manager && !channelsStore.isFilesList || props.manager && !channelsStore.isFilesList && channelsStore.isOpenChannel && !channelsStore.isClientInfo);
|
|
50724
|
-
const sendMessage2 = () => {
|
|
50725
|
-
if (enableSendMessage.value) {
|
|
50726
|
-
message2.value.attachments = files.value;
|
|
50727
|
-
const newMessage = JSON.parse(JSON.stringify(message2.value));
|
|
50728
|
-
selectedChannelStore.sendMessage({ message: newMessage }, () => {
|
|
50729
|
-
});
|
|
50730
|
-
textArea.value.innerText = "";
|
|
50731
|
-
files.value = [];
|
|
50732
|
-
message2.value.attachments = [];
|
|
50733
|
-
message2.value.text = "";
|
|
50734
|
-
}
|
|
50735
|
-
};
|
|
50736
|
-
const handleEnter = (evt) => {
|
|
50737
|
-
if (evt.keyCode === 13 && !evt.shiftKey) {
|
|
50738
|
-
evt.preventDefault();
|
|
50739
|
-
sendMessage2();
|
|
50740
|
-
}
|
|
50741
|
-
};
|
|
50742
50731
|
const uploadingFiles = computed$1(() => {
|
|
50743
50732
|
let countLoaded = 0;
|
|
50744
50733
|
files.value.reduce((acc, file) => {
|
|
@@ -50760,6 +50749,24 @@ const _sfc_main$1 = {
|
|
|
50760
50749
|
return !!countErrorFiles;
|
|
50761
50750
|
});
|
|
50762
50751
|
const enableSendMessage = computed$1(() => !errorFiles.value && !uploadingFiles.value && (!!message2.value.text || !!files.value.length));
|
|
50752
|
+
const sendMessage2 = () => {
|
|
50753
|
+
if (enableSendMessage.value) {
|
|
50754
|
+
message2.value.attachments = files.value;
|
|
50755
|
+
const newMessage = JSON.parse(JSON.stringify(message2.value));
|
|
50756
|
+
selectedChannelStore.sendMessage({ message: newMessage }, () => {
|
|
50757
|
+
});
|
|
50758
|
+
textArea.value.innerText = "";
|
|
50759
|
+
files.value = [];
|
|
50760
|
+
message2.value.attachments = [];
|
|
50761
|
+
message2.value.text = "";
|
|
50762
|
+
}
|
|
50763
|
+
};
|
|
50764
|
+
const handleEnter = (evt) => {
|
|
50765
|
+
if (evt.keyCode === 13 && !evt.shiftKey) {
|
|
50766
|
+
evt.preventDefault();
|
|
50767
|
+
sendMessage2();
|
|
50768
|
+
}
|
|
50769
|
+
};
|
|
50763
50770
|
return (_ctx, _cache) => {
|
|
50764
50771
|
const _component_el_scrollbar = ElScrollbar;
|
|
50765
50772
|
return unref(footerVisibility) ? (openBlock(), createElementBlock("div", {
|
|
@@ -50807,10 +50814,7 @@ const _sfc_main$1 = {
|
|
|
50807
50814
|
}, null, 32)
|
|
50808
50815
|
])
|
|
50809
50816
|
]),
|
|
50810
|
-
createVNode(_component_el_scrollbar, {
|
|
50811
|
-
height: "196",
|
|
50812
|
-
"wrap-class": "pl-chat-footer__input"
|
|
50813
|
-
}, {
|
|
50817
|
+
createVNode(_component_el_scrollbar, { "wrap-class": "pl-chat-footer__input" }, {
|
|
50814
50818
|
default: withCtx(() => [
|
|
50815
50819
|
createElementVNode("div", {
|
|
50816
50820
|
ref_key: "textArea",
|