vue-intergrall-plugins 1.1.90 → 1.2.0
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/README.md +220 -220
- package/dist/dist/vue-intergrall-plugins.css +1 -1
- package/dist/vue-intergrall-plugins.esm.js +193 -78
- package/dist/vue-intergrall-plugins.min.js +7 -7
- package/dist/vue-intergrall-plugins.ssr.js +245 -136
- package/package.json +61 -61
- package/src/lib-components/Buttons/IconButton.vue +27 -27
- package/src/lib-components/Buttons/SimpleButton.vue +140 -140
- package/src/lib-components/Cards/Card.vue +490 -490
- package/src/lib-components/Cards/CardCheck.vue +35 -35
- package/src/lib-components/Cards/CardFile.vue +163 -163
- package/src/lib-components/Chat/BtnDownloadAllFiles.vue +36 -36
- package/src/lib-components/Chat/BtnEmojis.vue +118 -118
- package/src/lib-components/Chat/BtnExpand.vue +17 -17
- package/src/lib-components/Chat/BtnFiles.vue +486 -486
- package/src/lib-components/Chat/BtnMic.vue +60 -60
- package/src/lib-components/Chat/BtnScreenShare.vue +31 -31
- package/src/lib-components/Chat/BtnStandardMessages.vue +17 -17
- package/src/lib-components/Chat/ExpandTextarea.vue +427 -427
- package/src/lib-components/Chat/MultipleFilePreview.vue +291 -291
- package/src/lib-components/Chat/Picker.vue +525 -525
- package/src/lib-components/Chat/RemainingCharacters.vue +28 -28
- package/src/lib-components/Chat/SingleFilePreview.vue +94 -94
- package/src/lib-components/Chat/SkeletonPicker.vue +110 -110
- package/src/lib-components/Chat/StandardMessages.vue +252 -252
- package/src/lib-components/Chat/TextFooter.vue +1007 -1007
- package/src/lib-components/Email/EmailExpanded.vue +270 -270
- package/src/lib-components/Email/EmailFile.vue +192 -192
- package/src/lib-components/Email/EmailFrom.vue +66 -66
- package/src/lib-components/Email/EmailItem.vue +867 -850
- package/src/lib-components/Email/EmailTo.vue +64 -64
- package/src/lib-components/Loader/Loader.vue +78 -78
- package/src/lib-components/Messages/AnexoMensagem.vue +534 -497
- package/src/lib-components/Messages/CardAttachment.vue +61 -61
- package/src/lib-components/Messages/CardMessages.vue +687 -687
- package/src/lib-components/Messages/InteratividadeBotoes.vue +197 -197
- package/src/lib-components/Messages/InteratividadeContato.vue +32 -32
- package/src/lib-components/Messages/InteratividadeContatoItem.vue +235 -235
- package/src/lib-components/Messages/InteratividadeFormulario.vue +334 -334
- package/src/lib-components/Messages/InteratividadePopup.vue +95 -95
- package/src/lib-components/Messages/LinkPreview.vue +176 -176
- package/src/lib-components/Scroll/ScrollContent.vue +166 -166
- package/src/lib-components/Templates/TemplateGenerator.vue +640 -640
- package/src/lib-components/Templates/TemplateMessage.vue +83 -83
- package/src/lib-components/Templates/TemplateSingle.vue +478 -478
|
@@ -1,1007 +1,1007 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="text-footer-container" :class="{ bigger: cssStyle.height }" v-clickaway="away" v-if="textId"
|
|
3
|
-
@drop.stop="dropFile" @dragenter.prevent @dragover.prevent>
|
|
4
|
-
<div class="text-footer" :class="cssStyle.width ? cssStyle.width : ''"
|
|
5
|
-
:style="`background-color: ${cssStyle.backgroundColor}`">
|
|
6
|
-
<BtnEmojis v-show="buttons.hasEmojis && !audioFile" :ref="`${this.textId}`" :emojiId="`${this.textId}`"
|
|
7
|
-
:down="emojiSettings.openEmojisFrom == 'top' ? false : true" :small="emojiSettings.smallEmojis"
|
|
8
|
-
:biggerTextarea="cssStyle.height ? true : false" @insert-emoji="insertEmoji" />
|
|
9
|
-
<transition name="fade">
|
|
10
|
-
<Loader v-if="isSending" />
|
|
11
|
-
</transition>
|
|
12
|
-
<textarea class="js-autoresize" v-if="!audioFile" v-model="message" :id="`text-footer-${this.textId}`"
|
|
13
|
-
:disabled="textareaSettings.disabled" :placeholder="textareaSettings.placeholderMessage"
|
|
14
|
-
@input="sendFinalMessage" @keydown.up="toggleStandardMessages" @keydown.down="toggleStandardMessages"
|
|
15
|
-
@keydown.esc="closeEmojis" @keydown.enter="sendMessageHandler" @paste="pasteImage"></textarea>
|
|
16
|
-
<div class="text-footer-audio" v-else>
|
|
17
|
-
<div>
|
|
18
|
-
<audio :src="audioSource" controls="controls"></audio>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<span class="delete-audio" title="Cancelar" @click="deleteAudio">
|
|
22
|
-
<fa-icon :icon="['fas', 'times']" />
|
|
23
|
-
</span>
|
|
24
|
-
</div>
|
|
25
|
-
<RemainingCharacters :class="{ 'd-none': audioFile }" :message="message"
|
|
26
|
-
:maxCharacters="textareaSettings.maxCharacters" />
|
|
27
|
-
<div v-if="
|
|
28
|
-
buttons.hasFiles ||
|
|
29
|
-
buttons.hasAudio ||
|
|
30
|
-
buttons.hasExpand ||
|
|
31
|
-
formattedMessageSettings.hasStandardMessages ||
|
|
32
|
-
buttons.hasScreenShare ||
|
|
33
|
-
buttons.hasDownloadAll ||
|
|
34
|
-
(customButtons && customButtons.length)
|
|
35
|
-
" class="text-footer-actions" :class="{ 'outside-buttons': cssStyle.outsideButtons && !audioFile }">
|
|
36
|
-
<BtnDownloadAllFiles v-show="buttons.hasDownloadAll && !audioFile"
|
|
37
|
-
@click-trigger="$emit('handle-download-files')" :dictionary="dictionary" :ref="`${textId}-download-files`" />
|
|
38
|
-
<BtnScreenShare v-show="buttons.hasScreenShare && !audioFile" @handle-screen-share="handleScreenShare"
|
|
39
|
-
:dictionary="dictionary" :ref="`${textId}-screen-share`" />
|
|
40
|
-
<BtnMic v-show="buttons.hasAudio && !audioFile" :dictionary="dictionary" @set-audio="setAudio"
|
|
41
|
-
:ref="`${textId}-mic`" />
|
|
42
|
-
<BtnStandardMessages v-show="formattedMessageSettings.hasStandardMessages && !audioFile"
|
|
43
|
-
:dictionary="dictionary" :ref="`${textId}-standard-messages`"
|
|
44
|
-
@toggle-standard-messages="toggleStandardMessages" />
|
|
45
|
-
<BtnFiles v-show="buttons.hasFiles && !audioFile" :textId="textId" :dictionary="dictionary"
|
|
46
|
-
:fileSettings="fileSettings" :cssStyle="cssStyle" :ref="`${textId}-file`" :hasButtonFiles="hasButtonFiles"
|
|
47
|
-
:externalFiles="externalFiles" @set-file-vars="setFileVars" @open-image="openImage"
|
|
48
|
-
@open-file-system="openFileSystem" @reset-file-system="resetFileSystem"
|
|
49
|
-
@handle-file-preview="$emit('handle-file-preview')" @handle-file-click="$emit('handle-file-click')" />
|
|
50
|
-
<BtnExpand v-show="buttons.hasExpand && !audioFile" :ref="`${textId}-expand`"
|
|
51
|
-
@expand-textarea="$emit('expand-textarea')" :dictionary="dictionary" />
|
|
52
|
-
<template v-if="customButtons && customButtons.length">
|
|
53
|
-
<div v-for="(button, index) in customButtons" :key="button.id || index" class="text-footer-actions--btn"
|
|
54
|
-
@click="button.callback(returnParams(button.params))" :title="button.title">
|
|
55
|
-
<fa-icon :icon="['fas', button.icon || 'question-circle']" v-if="!button.svgIcon" />
|
|
56
|
-
<span v-else v-html="button.svgIcon" :class="button.svgClass ? button.svgClass : ''"></span>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="text-footer-actions" v-if="buttons.hasSendButton">
|
|
61
|
-
<span class="text-footer-actions--btn" :title="dictionary.title_enviar_msg" @click="sendMessageHandler">
|
|
62
|
-
<fa-icon :icon="['fas', 'paper-plane']" />
|
|
63
|
-
</span>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
<transition name="fade">
|
|
67
|
-
<StandardMessages v-if="showStandardMessages" :class="cssStyle.width ? cssStyle.width : ''"
|
|
68
|
-
:dictionary="dictionary" :backgroundColor="cssStyle.backgroundColor" :token_cliente="formattedMessageSettings.token_cliente
|
|
69
|
-
? formattedMessageSettings.token_cliente
|
|
70
|
-
: ''
|
|
71
|
-
" :message="message" :messageType="messageType" :hasStandardMessages="formattedMessageSettings.hasStandardMessages && showStandardMessages
|
|
72
|
-
" @close-standard-messages="closeStandardMessages"
|
|
73
|
-
@open-blocker-standard-message="openBlockerStandardMessage"
|
|
74
|
-
@close-blocker-standard-message="closeBlockerStandardMessage" @set-message-type="setMessageType"
|
|
75
|
-
@set-standard-infos="setStandardInfos" @add-standard-message="addStandardMessage"
|
|
76
|
-
@error-standard-message="$emit('error-standard-message')" />
|
|
77
|
-
</transition>
|
|
78
|
-
</div>
|
|
79
|
-
</template>
|
|
80
|
-
|
|
81
|
-
<script>
|
|
82
|
-
import Clickaway from '@/directives/clickaway';
|
|
83
|
-
import { resetTargets, setResizeListeners } from "../../services/autoResize";
|
|
84
|
-
import { returnMessageWithHexa } from "../../services/textFormatting";
|
|
85
|
-
|
|
86
|
-
import Loader from "../Loader/Loader";
|
|
87
|
-
import BtnDownloadAllFiles from "./BtnDownloadAllFiles";
|
|
88
|
-
import BtnEmojis from "./BtnEmojis";
|
|
89
|
-
import BtnExpand from "./BtnExpand";
|
|
90
|
-
import BtnFiles from "./BtnFiles";
|
|
91
|
-
import BtnMic from "./BtnMic";
|
|
92
|
-
import BtnScreenShare from "./BtnScreenShare";
|
|
93
|
-
import BtnStandardMessages from "./BtnStandardMessages";
|
|
94
|
-
import RemainingCharacters from "./RemainingCharacters";
|
|
95
|
-
import StandardMessages from "./StandardMessages";
|
|
96
|
-
|
|
97
|
-
export default {
|
|
98
|
-
components: {
|
|
99
|
-
BtnEmojis,
|
|
100
|
-
Loader,
|
|
101
|
-
BtnMic,
|
|
102
|
-
BtnFiles,
|
|
103
|
-
BtnExpand,
|
|
104
|
-
RemainingCharacters,
|
|
105
|
-
BtnStandardMessages,
|
|
106
|
-
StandardMessages,
|
|
107
|
-
BtnScreenShare,
|
|
108
|
-
BtnDownloadAllFiles,
|
|
109
|
-
},
|
|
110
|
-
directives: {
|
|
111
|
-
clickaway: Clickaway
|
|
112
|
-
},
|
|
113
|
-
props: {
|
|
114
|
-
buttons: {
|
|
115
|
-
type: Object,
|
|
116
|
-
default: () => {
|
|
117
|
-
return {
|
|
118
|
-
hasEmojis: false,
|
|
119
|
-
hasSendButton: false,
|
|
120
|
-
hasFiles: false,
|
|
121
|
-
hasAudio: false,
|
|
122
|
-
hasExpand: false,
|
|
123
|
-
hasScreenShare: false,
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
required: false,
|
|
127
|
-
},
|
|
128
|
-
cssStyle: {
|
|
129
|
-
type: Object,
|
|
130
|
-
default: () => {
|
|
131
|
-
return {
|
|
132
|
-
height: false,
|
|
133
|
-
width: "full",
|
|
134
|
-
backgroundColor: "#FFF",
|
|
135
|
-
outsideButtons: false,
|
|
136
|
-
};
|
|
137
|
-
},
|
|
138
|
-
required: false,
|
|
139
|
-
},
|
|
140
|
-
textareaSettings: {
|
|
141
|
-
type: Object,
|
|
142
|
-
default: () => {
|
|
143
|
-
return {
|
|
144
|
-
placeholderMessage: "",
|
|
145
|
-
maxCharacters: 0,
|
|
146
|
-
sendOnEnter: false,
|
|
147
|
-
disabled: false,
|
|
148
|
-
};
|
|
149
|
-
},
|
|
150
|
-
required: false,
|
|
151
|
-
},
|
|
152
|
-
emojiSettings: {
|
|
153
|
-
type: Object,
|
|
154
|
-
default: () => {
|
|
155
|
-
return { openEmojisFrom: "top", smallEmojis: false };
|
|
156
|
-
},
|
|
157
|
-
required: false,
|
|
158
|
-
},
|
|
159
|
-
formattedMessageSettings: {
|
|
160
|
-
type: Object,
|
|
161
|
-
default: () => {
|
|
162
|
-
return { hasStandardMessages: false, msgType: 0, token_cliente: "" };
|
|
163
|
-
},
|
|
164
|
-
required: false,
|
|
165
|
-
},
|
|
166
|
-
fileSettings: {
|
|
167
|
-
type: Object,
|
|
168
|
-
default: () => {
|
|
169
|
-
return {
|
|
170
|
-
docsExtensions: "",
|
|
171
|
-
imagesExtensions: "",
|
|
172
|
-
multiple: false,
|
|
173
|
-
systemButton: false,
|
|
174
|
-
max: 3,
|
|
175
|
-
handleFilePreview: false,
|
|
176
|
-
filePreviewStyle: 1,
|
|
177
|
-
stackFiles: false,
|
|
178
|
-
handleFileClick: false,
|
|
179
|
-
};
|
|
180
|
-
},
|
|
181
|
-
required: false,
|
|
182
|
-
},
|
|
183
|
-
textId: {
|
|
184
|
-
type: String,
|
|
185
|
-
required: true,
|
|
186
|
-
},
|
|
187
|
-
isMainChat: {
|
|
188
|
-
type: Boolean,
|
|
189
|
-
default: false,
|
|
190
|
-
required: false,
|
|
191
|
-
},
|
|
192
|
-
isSending: {
|
|
193
|
-
type: Boolean,
|
|
194
|
-
default: false,
|
|
195
|
-
required: false,
|
|
196
|
-
},
|
|
197
|
-
dictionary: {
|
|
198
|
-
type: Object,
|
|
199
|
-
required: true,
|
|
200
|
-
},
|
|
201
|
-
hasButtonFiles: {
|
|
202
|
-
type: Boolean,
|
|
203
|
-
required: false,
|
|
204
|
-
},
|
|
205
|
-
externalFiles: {
|
|
206
|
-
type: Array,
|
|
207
|
-
required: false,
|
|
208
|
-
},
|
|
209
|
-
customButtons: {
|
|
210
|
-
type: Array,
|
|
211
|
-
required: false
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
data() {
|
|
215
|
-
return {
|
|
216
|
-
message: "",
|
|
217
|
-
openFiles: false,
|
|
218
|
-
file: [],
|
|
219
|
-
hasAnyFile: false,
|
|
220
|
-
imagePreview: "",
|
|
221
|
-
isDoc: false,
|
|
222
|
-
fileFormatError: false,
|
|
223
|
-
audioFile: "",
|
|
224
|
-
audioSource: "",
|
|
225
|
-
showStandardMessages: false,
|
|
226
|
-
messageType: 1,
|
|
227
|
-
};
|
|
228
|
-
},
|
|
229
|
-
created() {
|
|
230
|
-
this.$root.$refs[`tf-${this.textId}`] = this;
|
|
231
|
-
},
|
|
232
|
-
mounted() {
|
|
233
|
-
setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize");
|
|
234
|
-
window.addEventListener("message", this.listenerPostMessage, false);
|
|
235
|
-
|
|
236
|
-
// this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
|
|
237
|
-
// this.$root.$on("toggle-msg-formatada", () => { this.toggleStandardMessages() })
|
|
238
|
-
// this.$root.$on("textarea-focus", () => { this.focusTextarea() })
|
|
239
|
-
// this.$root.$on("resize-footer-template", () => { this.adjustChatHeight() })
|
|
240
|
-
// this.$root.$on("clear-footer-message", () => { this.message = "" })
|
|
241
|
-
// if(this.cssStyle.outsideButtons) if(this.$root.$refs.chatCorpo) this.$root.$refs.chatCorpo.setOutsideButtons(this.cssStyle.outsideButtons)
|
|
242
|
-
},
|
|
243
|
-
methods: {
|
|
244
|
-
listenerPostMessage(event) {
|
|
245
|
-
const baseURL =
|
|
246
|
-
window.location.hostname == "localhost"
|
|
247
|
-
? `https://linux07`
|
|
248
|
-
: `https://${window.location.hostname}`;
|
|
249
|
-
if (!this.formattedMessageSettings.hasStandardMessages) return;
|
|
250
|
-
if (
|
|
251
|
-
event.data.gerenciador ||
|
|
252
|
-
event.data.abrirFishing ||
|
|
253
|
-
event.data.multiplos_contatos ||
|
|
254
|
-
event.data.inserir_cliente_omni ||
|
|
255
|
-
event.data.multiple_contatos
|
|
256
|
-
)
|
|
257
|
-
return;
|
|
258
|
-
if (event.origin == baseURL) {
|
|
259
|
-
if (event.data == "" && this.showStandardMessages) {
|
|
260
|
-
this.closeBlockerStandardMessage();
|
|
261
|
-
this.toggleStandardMessages();
|
|
262
|
-
this.$toasted.global.defaultInfo({
|
|
263
|
-
msg: this.dictionary.msg_erro_sem_msg_formatada,
|
|
264
|
-
});
|
|
265
|
-
} else if (typeof event.data === "string" && this.showStandardMessages) {
|
|
266
|
-
this.message = event.data;
|
|
267
|
-
this.focusTextarea();
|
|
268
|
-
this.closeBlockerStandardMessage();
|
|
269
|
-
this.toggleStandardMessages();
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
closeEmojis() {
|
|
274
|
-
try {
|
|
275
|
-
this.$root.$refs[`etf-${this.textId}`].showEmojis
|
|
276
|
-
? this.$root.$refs[`etf-${this.textId}`].away()
|
|
277
|
-
: "";
|
|
278
|
-
} catch (e) {
|
|
279
|
-
console.error("Nao foi possivel fechar os emojis");
|
|
280
|
-
console.error(e);
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
away() {
|
|
284
|
-
if (this.$refs[`${this.textId}-file`])
|
|
285
|
-
this.$refs[`${this.textId}-file`].openFiles = false;
|
|
286
|
-
},
|
|
287
|
-
setDefaultMessage(msg) {
|
|
288
|
-
this.message = msg;
|
|
289
|
-
this.sendFinalMessage();
|
|
290
|
-
},
|
|
291
|
-
insertEmoji(emoji) {
|
|
292
|
-
try {
|
|
293
|
-
if (!emoji) return;
|
|
294
|
-
const textarea = document.querySelector(`#text-footer-${this.textId}`);
|
|
295
|
-
if (document.activeElement === textarea) {
|
|
296
|
-
const cursorStart = textarea.selectionStart;
|
|
297
|
-
const cursorEnd = textarea.selectionEnd;
|
|
298
|
-
if (cursorEnd == textarea.value.length) {
|
|
299
|
-
this.message += emoji.finalEmoji;
|
|
300
|
-
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
|
|
301
|
-
} else {
|
|
302
|
-
const initValue = textarea.value.slice(0, cursorStart) + emoji.finalEmoji;
|
|
303
|
-
const endValue = textarea.value.slice(cursorEnd);
|
|
304
|
-
this.message = initValue + endValue;
|
|
305
|
-
textarea.setSelectionRange(initValue.length, initValue.length);
|
|
306
|
-
}
|
|
307
|
-
} else {
|
|
308
|
-
this.message += emoji.finalEmoji;
|
|
309
|
-
}
|
|
310
|
-
this.sendFinalMessage();
|
|
311
|
-
} catch (e) {
|
|
312
|
-
console.error("Erro ao inserir emoji");
|
|
313
|
-
console.error(e);
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
verifyMessage() {
|
|
317
|
-
if (this.textareaSettings.maxCharacters && this.message) {
|
|
318
|
-
if (this.message.length > this.textareaSettings.maxCharacters) {
|
|
319
|
-
if (!document.querySelector(".toasted.toasted-primary.error"))
|
|
320
|
-
this.$toasted.global.limiteCaracter();
|
|
321
|
-
return false;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
if ((!this.message || !this.message.trim()) && !this.hasAnyFile && !this.audioFile)
|
|
326
|
-
return false;
|
|
327
|
-
|
|
328
|
-
if (this.textareaSettings.disabled) return false;
|
|
329
|
-
|
|
330
|
-
if (this.fileFormatError && this.hasAnyFile) {
|
|
331
|
-
if (!document.querySelector(".toasted.toasted-primary.error"))
|
|
332
|
-
this.$toasted.global.defaultError({
|
|
333
|
-
msg: this.dictionary.msg_formato_invalido,
|
|
334
|
-
});
|
|
335
|
-
const str = {
|
|
336
|
-
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
337
|
-
doc: this.fileSettings.docsExtensions.split("|").join(", "),
|
|
338
|
-
};
|
|
339
|
-
if (!document.querySelector(".toasted.toasted-primary.info"))
|
|
340
|
-
this.$toasted.global.showValidFormats({
|
|
341
|
-
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`,
|
|
342
|
-
});
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
return true;
|
|
347
|
-
},
|
|
348
|
-
removeHTMLElementsFromMessage(message) {
|
|
349
|
-
const regexTags = /<\/?[\d\w\s=\-:./'";]+>/gi;
|
|
350
|
-
if (message.match(regexTags)) message = message.replace(regexTags, " ");
|
|
351
|
-
return message;
|
|
352
|
-
},
|
|
353
|
-
formatMessage(message) {
|
|
354
|
-
if (!message) return "";
|
|
355
|
-
message = message.trim();
|
|
356
|
-
message = message.replace(/\n$/, "", message);
|
|
357
|
-
// message = returnMessageWithHexa(message);
|
|
358
|
-
message = this.removeHTMLElementsFromMessage(message);
|
|
359
|
-
return message;
|
|
360
|
-
},
|
|
361
|
-
sendFinalMessage() {
|
|
362
|
-
const messageAux = this.formatMessage(this.message);
|
|
363
|
-
this.$emit("final-message", messageAux);
|
|
364
|
-
},
|
|
365
|
-
sendMessageHandler(event) {
|
|
366
|
-
this.sendMessage(event);
|
|
367
|
-
},
|
|
368
|
-
sendMessage(event) {
|
|
369
|
-
if (this.isSending) return;
|
|
370
|
-
|
|
371
|
-
if (this.isMainChat && event) {
|
|
372
|
-
if (this.textareaSettings.sendOnEnter) {
|
|
373
|
-
if (event.keyCode == 13 && !event.shiftKey) event.preventDefault();
|
|
374
|
-
if (event.shiftKey) return;
|
|
375
|
-
} else {
|
|
376
|
-
if (event.keyCode == 13) {
|
|
377
|
-
if (!event.shiftKey) return;
|
|
378
|
-
event.preventDefault();
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
if (!this.buttons.hasSendButton) return;
|
|
384
|
-
|
|
385
|
-
const messageAux = this.formatMessage(this.message);
|
|
386
|
-
if (this.verifyMessage()) {
|
|
387
|
-
if (messageAux || this.hasAnyFile || this.audioFile) {
|
|
388
|
-
this.$emit("send-message", messageAux);
|
|
389
|
-
const objMessage = this.returnObjectMessage(messageAux);
|
|
390
|
-
this.$emit("obj-message", objMessage);
|
|
391
|
-
|
|
392
|
-
if (
|
|
393
|
-
this.$refs[`emoji-text-${this.textId}`] &&
|
|
394
|
-
this.$refs[`emoji-text-${this.textId}`].showEmojis
|
|
395
|
-
)
|
|
396
|
-
this.$refs[`emoji-text-${this.textId}`].toggleEmojiSelection();
|
|
397
|
-
|
|
398
|
-
this.resetFooterData();
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
focusTextarea() {
|
|
403
|
-
const textarea = document.querySelector(`#text-footer-${this.textId}`);
|
|
404
|
-
if (textarea) textarea.focus();
|
|
405
|
-
},
|
|
406
|
-
resetFooterData() {
|
|
407
|
-
if (this.audioFile) this.deleteAudio();
|
|
408
|
-
if (this.hasAnyFile) this.$refs[`${this.textId}-file`].deleteFile();
|
|
409
|
-
this.message = "";
|
|
410
|
-
this.sendFinalMessage();
|
|
411
|
-
resetTargets(this.$el, ".js-autoresize", ".js-parentresize", "38px");
|
|
412
|
-
this.focusTextarea();
|
|
413
|
-
},
|
|
414
|
-
returnObjectMessage(message) {
|
|
415
|
-
return {
|
|
416
|
-
message,
|
|
417
|
-
attachment: this.hasAnyFile ? this.file : false,
|
|
418
|
-
isDoc: this.isDoc,
|
|
419
|
-
imagePreview: this.imagePreview,
|
|
420
|
-
isAudio: this.audioFile ? true : false,
|
|
421
|
-
audioAttachment: this.audioSource,
|
|
422
|
-
};
|
|
423
|
-
},
|
|
424
|
-
setFileVars(fileObj) {
|
|
425
|
-
const { file, imagePreview, isDoc, fileFormatError, hasAnyFile } = fileObj;
|
|
426
|
-
|
|
427
|
-
this.file = file;
|
|
428
|
-
this.imagePreview = imagePreview ? imagePreview : "";
|
|
429
|
-
this.isDoc = isDoc;
|
|
430
|
-
this.fileFormatError = fileFormatError;
|
|
431
|
-
this.hasAnyFile = hasAnyFile;
|
|
432
|
-
|
|
433
|
-
this.$emit("set-file-vars", fileObj);
|
|
434
|
-
},
|
|
435
|
-
openImage(imagePreview) {
|
|
436
|
-
this.$emit("open-image", imagePreview);
|
|
437
|
-
},
|
|
438
|
-
openFileSystem() {
|
|
439
|
-
this.$emit("open-file-system");
|
|
440
|
-
},
|
|
441
|
-
resetFileSystem() {
|
|
442
|
-
this.$emit("reset-file-system");
|
|
443
|
-
},
|
|
444
|
-
setAudio(audioObj) {
|
|
445
|
-
const { audioFile, audioSource } = audioObj;
|
|
446
|
-
this.audioFile = audioFile;
|
|
447
|
-
this.audioSource = audioSource;
|
|
448
|
-
},
|
|
449
|
-
deleteAudio() {
|
|
450
|
-
this.$refs[`${this.textId}-mic`].deleteMediaRecorder();
|
|
451
|
-
this.audioFile = "";
|
|
452
|
-
this.audioSource = "";
|
|
453
|
-
},
|
|
454
|
-
returnFileType(file, stopAlert) {
|
|
455
|
-
if (!this.fileSettings.imagesExtensions && !this.fileSettings.docsExtensions)
|
|
456
|
-
return false;
|
|
457
|
-
const imgRegex = new RegExp("\.(" + this.fileSettings.imagesExtensions + ")", "i");
|
|
458
|
-
if (imgRegex.test(file.name)) return "img";
|
|
459
|
-
|
|
460
|
-
const docRegex = new RegExp("\.(" + this.fileSettings.docsExtensions + ")", "i");
|
|
461
|
-
if (docRegex.test(file.name)) return "doc";
|
|
462
|
-
|
|
463
|
-
if (!stopAlert) return false;
|
|
464
|
-
if (!document.querySelector(".toasted.toasted-primary.error"))
|
|
465
|
-
this.$toasted.global.defaultError({
|
|
466
|
-
msg: this.dictionary.msg_formato_invalido,
|
|
467
|
-
});
|
|
468
|
-
const str = {
|
|
469
|
-
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
470
|
-
doc: this.fileSettings.docsExtensions.split("|").join(", "),
|
|
471
|
-
};
|
|
472
|
-
if (!document.querySelector(".toasted.toasted-primary.info"))
|
|
473
|
-
this.$toasted.global.showValidFormats({
|
|
474
|
-
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`,
|
|
475
|
-
});
|
|
476
|
-
return false;
|
|
477
|
-
},
|
|
478
|
-
filesHandler(files) {
|
|
479
|
-
if (!Array.isArray(files)) files = Array.from(files);
|
|
480
|
-
const fileType = this.returnFileType(files[0], true);
|
|
481
|
-
let invalidFile = false;
|
|
482
|
-
try {
|
|
483
|
-
files.forEach((file) => {
|
|
484
|
-
const singleFileType = this.returnFileType(file, true);
|
|
485
|
-
if (!singleFileType) {
|
|
486
|
-
invalidFile = true;
|
|
487
|
-
file.invalid = true;
|
|
488
|
-
}
|
|
489
|
-
file.imgOrDoc = singleFileType ? singleFileType : "";
|
|
490
|
-
});
|
|
491
|
-
} catch (e) {
|
|
492
|
-
console.error("Erro ao tentar percorrer os arquivos");
|
|
493
|
-
console.error(e);
|
|
494
|
-
invalidFile = true;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
if (!invalidFile) {
|
|
498
|
-
this.$refs[`${this.textId}-file`].fileUpload(files, fileType, true);
|
|
499
|
-
} else {
|
|
500
|
-
if (!document.querySelector(".toasted.toasted-primary.error"))
|
|
501
|
-
this.$toasted.global.defaultError({
|
|
502
|
-
msg: this.dictionary.msg_formato_invalido,
|
|
503
|
-
});
|
|
504
|
-
const str = {
|
|
505
|
-
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
506
|
-
doc: this.fileSettings.docsExtensions.split("|").join(", "),
|
|
507
|
-
};
|
|
508
|
-
if (!document.querySelector(".toasted.toasted-primary.info"))
|
|
509
|
-
this.$toasted.global.showValidFormats({
|
|
510
|
-
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`,
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
dropFile(e) {
|
|
515
|
-
try {
|
|
516
|
-
e.stopPropagation();
|
|
517
|
-
e.preventDefault();
|
|
518
|
-
if (!this.buttons.hasFiles || this.fileSettings.handleFileClick) return false;
|
|
519
|
-
const files = e.dataTransfer.files.length ? e.dataTransfer.files : "";
|
|
520
|
-
this.filesHandler(files);
|
|
521
|
-
} catch (e) {
|
|
522
|
-
console.error("Erro drop file");
|
|
523
|
-
console.error(e);
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
|
-
pasteImage(e) {
|
|
527
|
-
try {
|
|
528
|
-
if (e.clipboardData.files.length && !this.buttons.hasFiles) {
|
|
529
|
-
e.preventDefault();
|
|
530
|
-
return;
|
|
531
|
-
} else if (e.clipboardData.files.length && this.buttons.hasFiles) {
|
|
532
|
-
const files = e.clipboardData.files;
|
|
533
|
-
this.filesHandler(files);
|
|
534
|
-
}
|
|
535
|
-
} catch (e) {
|
|
536
|
-
console.error("Nao foi possivel colar a/o imagem/documento");
|
|
537
|
-
console.error(e);
|
|
538
|
-
}
|
|
539
|
-
},
|
|
540
|
-
handleScreenShare() {
|
|
541
|
-
this.$emit("handle-screen-share");
|
|
542
|
-
},
|
|
543
|
-
toggleStandardMessages() {
|
|
544
|
-
if (this.formattedMessageSettings.hasStandardMessages) {
|
|
545
|
-
this.showStandardMessages = !this.showStandardMessages;
|
|
546
|
-
}
|
|
547
|
-
},
|
|
548
|
-
openBlockerStandardMessage() {
|
|
549
|
-
this.$emit("open-blocker-standard-message");
|
|
550
|
-
},
|
|
551
|
-
closeBlockerStandardMessage() {
|
|
552
|
-
this.$emit("close-blocker-standard-message");
|
|
553
|
-
},
|
|
554
|
-
setMessageType(type) {
|
|
555
|
-
this.messageType = type;
|
|
556
|
-
},
|
|
557
|
-
setStandardInfos(infos) {
|
|
558
|
-
this.$emit("set-standard-infos", infos);
|
|
559
|
-
},
|
|
560
|
-
addStandardMessage(message) {
|
|
561
|
-
this.message = message;
|
|
562
|
-
this.sendFinalMessage();
|
|
563
|
-
},
|
|
564
|
-
closeStandardMessages() {
|
|
565
|
-
this.showStandardMessages = false;
|
|
566
|
-
},
|
|
567
|
-
returnParams(params) {
|
|
568
|
-
const defaultParams = {
|
|
569
|
-
message: this.message,
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
if (!params) return defaultParams;
|
|
573
|
-
|
|
574
|
-
const keys = params.instanceKeys.split("|");
|
|
575
|
-
if (!keys || !keys.length)
|
|
576
|
-
return {
|
|
577
|
-
defaultParams,
|
|
578
|
-
...params.values,
|
|
579
|
-
};
|
|
580
|
-
|
|
581
|
-
const customParams = { ...params.values };
|
|
582
|
-
keys.forEach((key) => {
|
|
583
|
-
if (this[key]) customParams[key] = this[key];
|
|
584
|
-
else console.warn(`Cant find ${key} on 'this' instance`);
|
|
585
|
-
});
|
|
586
|
-
|
|
587
|
-
return Object.keys(customParams).length ? customParams : defaultParams;
|
|
588
|
-
}
|
|
589
|
-
},
|
|
590
|
-
destroyed() {
|
|
591
|
-
// this.$root.$off("drop-file")
|
|
592
|
-
// this.$root.$off("toggle-msg-formatada")
|
|
593
|
-
// this.$root.$off("textarea-focus")
|
|
594
|
-
// this.$root.$off("clear-footer-message")
|
|
595
|
-
// this.$root.$off("resize-footer-template")
|
|
596
|
-
|
|
597
|
-
window.removeEventListener("message", this.listenerPostMessage);
|
|
598
|
-
},
|
|
599
|
-
};
|
|
600
|
-
</script>
|
|
601
|
-
|
|
602
|
-
<style>
|
|
603
|
-
.text-footer-container {
|
|
604
|
-
display: flex;
|
|
605
|
-
justify-content: center;
|
|
606
|
-
align-items: center;
|
|
607
|
-
flex-direction: column;
|
|
608
|
-
width: 100%;
|
|
609
|
-
position: relative;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
.text-footer-container .text-footer {
|
|
613
|
-
min-height: 48px;
|
|
614
|
-
box-shadow: 0px 3px 7px -2px rgba(0, 0, 0, 0.45);
|
|
615
|
-
position: relative;
|
|
616
|
-
display: flex;
|
|
617
|
-
justify-content: center;
|
|
618
|
-
align-items: center;
|
|
619
|
-
border: 1px solid #ccc;
|
|
620
|
-
padding: 5px 2px 5px 5px;
|
|
621
|
-
border-radius: 5px;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
.text-footer-container .text-footer.full {
|
|
625
|
-
width: 100%;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
.text-footer-container .text-footer.almostFull {
|
|
629
|
-
width: 95%;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
.text-footer-container .text-footer.medium {
|
|
633
|
-
width: 75%;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
.text-footer-container.bigger .text-footer {
|
|
637
|
-
height: 80px;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
.text-footer-container.bigger .text-footer>textarea {
|
|
641
|
-
font-size: 14px;
|
|
642
|
-
height: 75px;
|
|
643
|
-
max-height: 75px;
|
|
644
|
-
min-height: 75px;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
.text-footer-container textarea {
|
|
648
|
-
margin: 0 5px;
|
|
649
|
-
border: unset;
|
|
650
|
-
flex: 1;
|
|
651
|
-
resize: none;
|
|
652
|
-
min-height: 30px;
|
|
653
|
-
max-height: 60px;
|
|
654
|
-
font-size: 14px;
|
|
655
|
-
font-family: inherit;
|
|
656
|
-
background: inherit;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
.text-footer-container textarea:focus {
|
|
660
|
-
outline: unset;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
.text-footer-container textarea::placeholder {
|
|
664
|
-
font-size: 12px;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
.text-footer-container .text-footer-audio {
|
|
668
|
-
flex: 1;
|
|
669
|
-
display: flex;
|
|
670
|
-
justify-content: center;
|
|
671
|
-
align-items: center;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
.text-footer-container audio {
|
|
675
|
-
flex: 1;
|
|
676
|
-
outline: unset;
|
|
677
|
-
width: auto;
|
|
678
|
-
height: 38px;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
.text-footer-container .delete-audio {
|
|
682
|
-
display: flex;
|
|
683
|
-
justify-content: center;
|
|
684
|
-
align-items: center;
|
|
685
|
-
color: #e74c3c;
|
|
686
|
-
transition: background 300ms;
|
|
687
|
-
border-radius: 50%;
|
|
688
|
-
font-size: 16px;
|
|
689
|
-
padding: 10px;
|
|
690
|
-
cursor: pointer;
|
|
691
|
-
margin: 0 5px;
|
|
692
|
-
width: 31px;
|
|
693
|
-
height: 31px;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
.text-footer-container .delete-audio:hover {
|
|
697
|
-
background-color: rgba(208, 0, 0, 0.2);
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
.text-footer-container .max-characters {
|
|
701
|
-
font-size: 9.2px;
|
|
702
|
-
z-index: 1;
|
|
703
|
-
color: #444;
|
|
704
|
-
position: relative;
|
|
705
|
-
top: 30px;
|
|
706
|
-
left: -30px;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
.text-footer-container .max-characters.no-width {
|
|
710
|
-
width: 0;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
.text-footer-container .text-footer-actions {
|
|
714
|
-
display: flex;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
.text-footer-container .text-footer-actions.outside-buttons {
|
|
718
|
-
display: flex;
|
|
719
|
-
align-items: center;
|
|
720
|
-
justify-content: flex-end;
|
|
721
|
-
position: absolute;
|
|
722
|
-
top: -30px;
|
|
723
|
-
right: 35px;
|
|
724
|
-
background-color: #fafafa;
|
|
725
|
-
height: 38px;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
.text-footer-container .text-footer-actions .text-footer-actions--btn {
|
|
729
|
-
display: flex;
|
|
730
|
-
justify-content: center;
|
|
731
|
-
align-items: center;
|
|
732
|
-
color: #777;
|
|
733
|
-
border-radius: 50%;
|
|
734
|
-
transition: background 300ms;
|
|
735
|
-
font-size: 16px;
|
|
736
|
-
width: 36px;
|
|
737
|
-
height: 36px;
|
|
738
|
-
cursor: pointer;
|
|
739
|
-
margin-right: 2.5px;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
.text-footer-container .text-footer-actions .text-footer-actions--btn:last-child {
|
|
743
|
-
margin-right: unset;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
.text-footer-container .text-footer-actions .text-footer-actions--btn:hover {
|
|
747
|
-
background-color: rgba(0, 0, 0, 0.1);
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
.text-footer-container .text-footer-actions .text-footer-actions--btn.files-activated {
|
|
751
|
-
background-color: rgba(0, 0, 0, 0.1);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
.text-footer-container .text-footer-actions .text-footer-actions--btn.audio-activated {
|
|
755
|
-
background-color: rgba(208, 0, 0, 0.7);
|
|
756
|
-
color: #fff;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
.text-footer-container .text-footer-actions .text-footer-actions--btn.left-button {
|
|
760
|
-
position: absolute;
|
|
761
|
-
left: 0;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
.text-footer-container .text-footer-hsm-container {
|
|
765
|
-
margin: 12px 0 7px 0;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
.text-footer-container .text-footer-hsm-container.full {
|
|
769
|
-
width: 100%;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
.text-footer-container .text-footer-hsm-container.almostFull {
|
|
773
|
-
width: 95%;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
.text-footer-container .text-footer-hsm-container.medium {
|
|
777
|
-
width: 75%;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
.text-footer-container .text-footer-hsm-container .text-footer-v-select {
|
|
781
|
-
border-radius: 5px;
|
|
782
|
-
margin-bottom: 5px;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
.text-footer-container .text-footer-hsm-container .text-footer-select-03 {
|
|
786
|
-
display: flex;
|
|
787
|
-
align-items: center;
|
|
788
|
-
flex: 1;
|
|
789
|
-
width: 100%;
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer-v-select {
|
|
793
|
-
flex: 1;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03 {
|
|
797
|
-
transition-duration: 300ms;
|
|
798
|
-
user-select: none;
|
|
799
|
-
cursor: pointer;
|
|
800
|
-
box-shadow: inset 0 -3px rgba(0, 0, 0, 0.2);
|
|
801
|
-
opacity: 0.9;
|
|
802
|
-
border-radius: 2.5px;
|
|
803
|
-
display: flex;
|
|
804
|
-
justify-content: center;
|
|
805
|
-
align-items: center;
|
|
806
|
-
margin-left: 5px;
|
|
807
|
-
margin-bottom: 5px;
|
|
808
|
-
background-color: #f7fe72;
|
|
809
|
-
width: 32px;
|
|
810
|
-
height: 32px;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:hover {
|
|
814
|
-
opacity: 1;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:active {
|
|
818
|
-
opacity: 1;
|
|
819
|
-
box-shadow: inset 0 -1px rgba(0, 0, 0, 0.2);
|
|
820
|
-
-webkit-transform: translateY(1px);
|
|
821
|
-
-moz-transform: translateY(1px);
|
|
822
|
-
-o-transform: translateY(1px);
|
|
823
|
-
-ms-transform: translateY(1px);
|
|
824
|
-
transform: translateY(1px);
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03 svg {
|
|
828
|
-
font-size: 16px;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
.text-footer-container .text-footer-files-container {
|
|
832
|
-
position: absolute;
|
|
833
|
-
right: 0;
|
|
834
|
-
top: -55px;
|
|
835
|
-
padding: 5px;
|
|
836
|
-
background-color: rgba(0, 0, 0, 0.4);
|
|
837
|
-
border-radius: 5px;
|
|
838
|
-
display: flex;
|
|
839
|
-
align-items: center;
|
|
840
|
-
justify-content: space-between;
|
|
841
|
-
z-index: 1;
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
.text-footer-container .text-footer-files-container.horizontal {
|
|
845
|
-
right: -55px;
|
|
846
|
-
flex-direction: column;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
.text-footer-container .text-footer-files-container .files-btn {
|
|
850
|
-
transition-duration: 300ms;
|
|
851
|
-
transition-property: opacity;
|
|
852
|
-
opacity: 0.8;
|
|
853
|
-
cursor: pointer;
|
|
854
|
-
display: flex;
|
|
855
|
-
justify-content: center;
|
|
856
|
-
align-items: center;
|
|
857
|
-
border-radius: 10px;
|
|
858
|
-
padding: 3px;
|
|
859
|
-
width: 40px;
|
|
860
|
-
height: 40px;
|
|
861
|
-
font-size: 16px;
|
|
862
|
-
color: #fff;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
.text-footer-container .text-footer-files-container .files-btn:hover {
|
|
866
|
-
opacity: 1;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
.text-footer-container .text-footer-files-container .files-btn svg {
|
|
870
|
-
color: #fff;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
.text-footer-container .text-footer-files-container .files-btn.images {
|
|
874
|
-
background-color: #9575cd;
|
|
875
|
-
margin-right: 5px;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
.text-footer-container .text-footer-files-container .files-btn.images.margin-bottom {
|
|
879
|
-
margin-right: unset;
|
|
880
|
-
margin-bottom: 5px;
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
.text-footer-container .text-footer-files-container .files-btn.docs {
|
|
884
|
-
background-color: #7986cb;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
.text-footer-container .text-footer-files-container .files-btn.system {
|
|
888
|
-
background-color: #49a349;
|
|
889
|
-
margin-left: 5px;
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
.text-footer-container .text-footer-files-container .files-btn.both {
|
|
893
|
-
font-size: 15.2px;
|
|
894
|
-
background-color: rgb(85, 85, 236);
|
|
895
|
-
flex-direction: column;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
.text-footer-container .text-footer-files-container .files-btn.both svg:nth-child(1) {
|
|
899
|
-
transform: translateX(5px);
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
.text-footer-container .text-footer-files-container .files-btn.both svg:nth-child(2) {
|
|
903
|
-
transform: translateX(-5px);
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
.text-footer-container .old-footer-preview-container {
|
|
907
|
-
width: 100%;
|
|
908
|
-
cursor: default;
|
|
909
|
-
position: absolute;
|
|
910
|
-
right: 0;
|
|
911
|
-
background-color: #f1f1f1;
|
|
912
|
-
border: 2px solid #ccc;
|
|
913
|
-
border-bottom: unset;
|
|
914
|
-
border-top-left-radius: 2.5px;
|
|
915
|
-
border-top-right-radius: 2.5px;
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
.text-footer-container .old-footer-preview-container.isDoc {
|
|
919
|
-
top: -50px;
|
|
920
|
-
width: 100%;
|
|
921
|
-
height: 45px;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
.text-footer-container .old-footer-preview-container.isImg,
|
|
925
|
-
.text-footer-container .old-footer-preview-container.isMultiple {
|
|
926
|
-
top: -205px;
|
|
927
|
-
width: 100%;
|
|
928
|
-
height: 200px;
|
|
929
|
-
min-width: 300px;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
.text-footer-container .old-footer-preview-container.isImg .text-footer-image-preview {
|
|
933
|
-
height: 170px;
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
.text-footer-container .old-footer-preview-container.isError {
|
|
937
|
-
top: -80px;
|
|
938
|
-
width: 100%;
|
|
939
|
-
height: 75px;
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
.text-footer-container .text-footer-alt {
|
|
943
|
-
margin-top: -12px;
|
|
944
|
-
width: 100%;
|
|
945
|
-
padding: 0 10px;
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
.text-footer-container .text-footer-alt .text-footer-out-session {
|
|
949
|
-
margin-top: 12px;
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
.text-footer-container .text-footer-alt .text-footer-sem-24h {
|
|
953
|
-
font-size: 12.8px;
|
|
954
|
-
text-align: right;
|
|
955
|
-
font-weight: 600;
|
|
956
|
-
letter-spacing: -0.5px;
|
|
957
|
-
color: #dd7f0c;
|
|
958
|
-
margin-top: 5px;
|
|
959
|
-
position: absolute;
|
|
960
|
-
right: 0;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
.text-footer-container .text-footer-alt .sem-templates {
|
|
964
|
-
margin-top: 10px;
|
|
965
|
-
font-size: 12.8px;
|
|
966
|
-
text-align: right;
|
|
967
|
-
font-weight: 600;
|
|
968
|
-
letter-spacing: -0.5px;
|
|
969
|
-
color: #921e12;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
.text-footer-container .text-footer-alt .text-footer-templates {
|
|
973
|
-
position: relative;
|
|
974
|
-
width: 100%;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection {
|
|
978
|
-
width: 100%;
|
|
979
|
-
display: flex;
|
|
980
|
-
align-items: center;
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection h4 {
|
|
984
|
-
margin-right: 5px;
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection .sm__select {
|
|
988
|
-
flex: 1;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
.vs__dropdown-menu {
|
|
992
|
-
font-size: 13.6px !important;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
.emoji-mart-anchor,
|
|
996
|
-
.emoji-mart-emoji span {
|
|
997
|
-
cursor: pointer !important;
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
.emoji-mart {
|
|
1001
|
-
z-index: 2 !important;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
.emoji-mart-scroll {
|
|
1005
|
-
overflow-x: hidden;
|
|
1006
|
-
}
|
|
1007
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="text-footer-container" :class="{ bigger: cssStyle.height }" v-clickaway="away" v-if="textId"
|
|
3
|
+
@drop.stop="dropFile" @dragenter.prevent @dragover.prevent>
|
|
4
|
+
<div class="text-footer" :class="cssStyle.width ? cssStyle.width : ''"
|
|
5
|
+
:style="`background-color: ${cssStyle.backgroundColor}`">
|
|
6
|
+
<BtnEmojis v-show="buttons.hasEmojis && !audioFile" :ref="`${this.textId}`" :emojiId="`${this.textId}`"
|
|
7
|
+
:down="emojiSettings.openEmojisFrom == 'top' ? false : true" :small="emojiSettings.smallEmojis"
|
|
8
|
+
:biggerTextarea="cssStyle.height ? true : false" @insert-emoji="insertEmoji" />
|
|
9
|
+
<transition name="fade">
|
|
10
|
+
<Loader v-if="isSending" />
|
|
11
|
+
</transition>
|
|
12
|
+
<textarea class="js-autoresize" v-if="!audioFile" v-model="message" :id="`text-footer-${this.textId}`"
|
|
13
|
+
:disabled="textareaSettings.disabled" :placeholder="textareaSettings.placeholderMessage"
|
|
14
|
+
@input="sendFinalMessage" @keydown.up="toggleStandardMessages" @keydown.down="toggleStandardMessages"
|
|
15
|
+
@keydown.esc="closeEmojis" @keydown.enter="sendMessageHandler" @paste="pasteImage"></textarea>
|
|
16
|
+
<div class="text-footer-audio" v-else>
|
|
17
|
+
<div>
|
|
18
|
+
<audio :src="audioSource" controls="controls"></audio>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<span class="delete-audio" title="Cancelar" @click="deleteAudio">
|
|
22
|
+
<fa-icon :icon="['fas', 'times']" />
|
|
23
|
+
</span>
|
|
24
|
+
</div>
|
|
25
|
+
<RemainingCharacters :class="{ 'd-none': audioFile }" :message="message"
|
|
26
|
+
:maxCharacters="textareaSettings.maxCharacters" />
|
|
27
|
+
<div v-if="
|
|
28
|
+
buttons.hasFiles ||
|
|
29
|
+
buttons.hasAudio ||
|
|
30
|
+
buttons.hasExpand ||
|
|
31
|
+
formattedMessageSettings.hasStandardMessages ||
|
|
32
|
+
buttons.hasScreenShare ||
|
|
33
|
+
buttons.hasDownloadAll ||
|
|
34
|
+
(customButtons && customButtons.length)
|
|
35
|
+
" class="text-footer-actions" :class="{ 'outside-buttons': cssStyle.outsideButtons && !audioFile }">
|
|
36
|
+
<BtnDownloadAllFiles v-show="buttons.hasDownloadAll && !audioFile"
|
|
37
|
+
@click-trigger="$emit('handle-download-files')" :dictionary="dictionary" :ref="`${textId}-download-files`" />
|
|
38
|
+
<BtnScreenShare v-show="buttons.hasScreenShare && !audioFile" @handle-screen-share="handleScreenShare"
|
|
39
|
+
:dictionary="dictionary" :ref="`${textId}-screen-share`" />
|
|
40
|
+
<BtnMic v-show="buttons.hasAudio && !audioFile" :dictionary="dictionary" @set-audio="setAudio"
|
|
41
|
+
:ref="`${textId}-mic`" />
|
|
42
|
+
<BtnStandardMessages v-show="formattedMessageSettings.hasStandardMessages && !audioFile"
|
|
43
|
+
:dictionary="dictionary" :ref="`${textId}-standard-messages`"
|
|
44
|
+
@toggle-standard-messages="toggleStandardMessages" />
|
|
45
|
+
<BtnFiles v-show="buttons.hasFiles && !audioFile" :textId="textId" :dictionary="dictionary"
|
|
46
|
+
:fileSettings="fileSettings" :cssStyle="cssStyle" :ref="`${textId}-file`" :hasButtonFiles="hasButtonFiles"
|
|
47
|
+
:externalFiles="externalFiles" @set-file-vars="setFileVars" @open-image="openImage"
|
|
48
|
+
@open-file-system="openFileSystem" @reset-file-system="resetFileSystem"
|
|
49
|
+
@handle-file-preview="$emit('handle-file-preview')" @handle-file-click="$emit('handle-file-click')" />
|
|
50
|
+
<BtnExpand v-show="buttons.hasExpand && !audioFile" :ref="`${textId}-expand`"
|
|
51
|
+
@expand-textarea="$emit('expand-textarea')" :dictionary="dictionary" />
|
|
52
|
+
<template v-if="customButtons && customButtons.length">
|
|
53
|
+
<div v-for="(button, index) in customButtons" :key="button.id || index" class="text-footer-actions--btn"
|
|
54
|
+
@click="button.callback(returnParams(button.params))" :title="button.title">
|
|
55
|
+
<fa-icon :icon="['fas', button.icon || 'question-circle']" v-if="!button.svgIcon" />
|
|
56
|
+
<span v-else v-html="button.svgIcon" :class="button.svgClass ? button.svgClass : ''"></span>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="text-footer-actions" v-if="buttons.hasSendButton">
|
|
61
|
+
<span class="text-footer-actions--btn" :title="dictionary.title_enviar_msg" @click="sendMessageHandler">
|
|
62
|
+
<fa-icon :icon="['fas', 'paper-plane']" />
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<transition name="fade">
|
|
67
|
+
<StandardMessages v-if="showStandardMessages" :class="cssStyle.width ? cssStyle.width : ''"
|
|
68
|
+
:dictionary="dictionary" :backgroundColor="cssStyle.backgroundColor" :token_cliente="formattedMessageSettings.token_cliente
|
|
69
|
+
? formattedMessageSettings.token_cliente
|
|
70
|
+
: ''
|
|
71
|
+
" :message="message" :messageType="messageType" :hasStandardMessages="formattedMessageSettings.hasStandardMessages && showStandardMessages
|
|
72
|
+
" @close-standard-messages="closeStandardMessages"
|
|
73
|
+
@open-blocker-standard-message="openBlockerStandardMessage"
|
|
74
|
+
@close-blocker-standard-message="closeBlockerStandardMessage" @set-message-type="setMessageType"
|
|
75
|
+
@set-standard-infos="setStandardInfos" @add-standard-message="addStandardMessage"
|
|
76
|
+
@error-standard-message="$emit('error-standard-message')" />
|
|
77
|
+
</transition>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script>
|
|
82
|
+
import Clickaway from '@/directives/clickaway';
|
|
83
|
+
import { resetTargets, setResizeListeners } from "../../services/autoResize";
|
|
84
|
+
import { returnMessageWithHexa } from "../../services/textFormatting";
|
|
85
|
+
|
|
86
|
+
import Loader from "../Loader/Loader";
|
|
87
|
+
import BtnDownloadAllFiles from "./BtnDownloadAllFiles";
|
|
88
|
+
import BtnEmojis from "./BtnEmojis";
|
|
89
|
+
import BtnExpand from "./BtnExpand";
|
|
90
|
+
import BtnFiles from "./BtnFiles";
|
|
91
|
+
import BtnMic from "./BtnMic";
|
|
92
|
+
import BtnScreenShare from "./BtnScreenShare";
|
|
93
|
+
import BtnStandardMessages from "./BtnStandardMessages";
|
|
94
|
+
import RemainingCharacters from "./RemainingCharacters";
|
|
95
|
+
import StandardMessages from "./StandardMessages";
|
|
96
|
+
|
|
97
|
+
export default {
|
|
98
|
+
components: {
|
|
99
|
+
BtnEmojis,
|
|
100
|
+
Loader,
|
|
101
|
+
BtnMic,
|
|
102
|
+
BtnFiles,
|
|
103
|
+
BtnExpand,
|
|
104
|
+
RemainingCharacters,
|
|
105
|
+
BtnStandardMessages,
|
|
106
|
+
StandardMessages,
|
|
107
|
+
BtnScreenShare,
|
|
108
|
+
BtnDownloadAllFiles,
|
|
109
|
+
},
|
|
110
|
+
directives: {
|
|
111
|
+
clickaway: Clickaway
|
|
112
|
+
},
|
|
113
|
+
props: {
|
|
114
|
+
buttons: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default: () => {
|
|
117
|
+
return {
|
|
118
|
+
hasEmojis: false,
|
|
119
|
+
hasSendButton: false,
|
|
120
|
+
hasFiles: false,
|
|
121
|
+
hasAudio: false,
|
|
122
|
+
hasExpand: false,
|
|
123
|
+
hasScreenShare: false,
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
required: false,
|
|
127
|
+
},
|
|
128
|
+
cssStyle: {
|
|
129
|
+
type: Object,
|
|
130
|
+
default: () => {
|
|
131
|
+
return {
|
|
132
|
+
height: false,
|
|
133
|
+
width: "full",
|
|
134
|
+
backgroundColor: "#FFF",
|
|
135
|
+
outsideButtons: false,
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
required: false,
|
|
139
|
+
},
|
|
140
|
+
textareaSettings: {
|
|
141
|
+
type: Object,
|
|
142
|
+
default: () => {
|
|
143
|
+
return {
|
|
144
|
+
placeholderMessage: "",
|
|
145
|
+
maxCharacters: 0,
|
|
146
|
+
sendOnEnter: false,
|
|
147
|
+
disabled: false,
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
required: false,
|
|
151
|
+
},
|
|
152
|
+
emojiSettings: {
|
|
153
|
+
type: Object,
|
|
154
|
+
default: () => {
|
|
155
|
+
return { openEmojisFrom: "top", smallEmojis: false };
|
|
156
|
+
},
|
|
157
|
+
required: false,
|
|
158
|
+
},
|
|
159
|
+
formattedMessageSettings: {
|
|
160
|
+
type: Object,
|
|
161
|
+
default: () => {
|
|
162
|
+
return { hasStandardMessages: false, msgType: 0, token_cliente: "" };
|
|
163
|
+
},
|
|
164
|
+
required: false,
|
|
165
|
+
},
|
|
166
|
+
fileSettings: {
|
|
167
|
+
type: Object,
|
|
168
|
+
default: () => {
|
|
169
|
+
return {
|
|
170
|
+
docsExtensions: "",
|
|
171
|
+
imagesExtensions: "",
|
|
172
|
+
multiple: false,
|
|
173
|
+
systemButton: false,
|
|
174
|
+
max: 3,
|
|
175
|
+
handleFilePreview: false,
|
|
176
|
+
filePreviewStyle: 1,
|
|
177
|
+
stackFiles: false,
|
|
178
|
+
handleFileClick: false,
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
required: false,
|
|
182
|
+
},
|
|
183
|
+
textId: {
|
|
184
|
+
type: String,
|
|
185
|
+
required: true,
|
|
186
|
+
},
|
|
187
|
+
isMainChat: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
default: false,
|
|
190
|
+
required: false,
|
|
191
|
+
},
|
|
192
|
+
isSending: {
|
|
193
|
+
type: Boolean,
|
|
194
|
+
default: false,
|
|
195
|
+
required: false,
|
|
196
|
+
},
|
|
197
|
+
dictionary: {
|
|
198
|
+
type: Object,
|
|
199
|
+
required: true,
|
|
200
|
+
},
|
|
201
|
+
hasButtonFiles: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
required: false,
|
|
204
|
+
},
|
|
205
|
+
externalFiles: {
|
|
206
|
+
type: Array,
|
|
207
|
+
required: false,
|
|
208
|
+
},
|
|
209
|
+
customButtons: {
|
|
210
|
+
type: Array,
|
|
211
|
+
required: false
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
data() {
|
|
215
|
+
return {
|
|
216
|
+
message: "",
|
|
217
|
+
openFiles: false,
|
|
218
|
+
file: [],
|
|
219
|
+
hasAnyFile: false,
|
|
220
|
+
imagePreview: "",
|
|
221
|
+
isDoc: false,
|
|
222
|
+
fileFormatError: false,
|
|
223
|
+
audioFile: "",
|
|
224
|
+
audioSource: "",
|
|
225
|
+
showStandardMessages: false,
|
|
226
|
+
messageType: 1,
|
|
227
|
+
};
|
|
228
|
+
},
|
|
229
|
+
created() {
|
|
230
|
+
this.$root.$refs[`tf-${this.textId}`] = this;
|
|
231
|
+
},
|
|
232
|
+
mounted() {
|
|
233
|
+
setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize");
|
|
234
|
+
window.addEventListener("message", this.listenerPostMessage, false);
|
|
235
|
+
|
|
236
|
+
// this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
|
|
237
|
+
// this.$root.$on("toggle-msg-formatada", () => { this.toggleStandardMessages() })
|
|
238
|
+
// this.$root.$on("textarea-focus", () => { this.focusTextarea() })
|
|
239
|
+
// this.$root.$on("resize-footer-template", () => { this.adjustChatHeight() })
|
|
240
|
+
// this.$root.$on("clear-footer-message", () => { this.message = "" })
|
|
241
|
+
// if(this.cssStyle.outsideButtons) if(this.$root.$refs.chatCorpo) this.$root.$refs.chatCorpo.setOutsideButtons(this.cssStyle.outsideButtons)
|
|
242
|
+
},
|
|
243
|
+
methods: {
|
|
244
|
+
listenerPostMessage(event) {
|
|
245
|
+
const baseURL =
|
|
246
|
+
window.location.hostname == "localhost"
|
|
247
|
+
? `https://linux07`
|
|
248
|
+
: `https://${window.location.hostname}`;
|
|
249
|
+
if (!this.formattedMessageSettings.hasStandardMessages) return;
|
|
250
|
+
if (
|
|
251
|
+
event.data.gerenciador ||
|
|
252
|
+
event.data.abrirFishing ||
|
|
253
|
+
event.data.multiplos_contatos ||
|
|
254
|
+
event.data.inserir_cliente_omni ||
|
|
255
|
+
event.data.multiple_contatos
|
|
256
|
+
)
|
|
257
|
+
return;
|
|
258
|
+
if (event.origin == baseURL) {
|
|
259
|
+
if (event.data == "" && this.showStandardMessages) {
|
|
260
|
+
this.closeBlockerStandardMessage();
|
|
261
|
+
this.toggleStandardMessages();
|
|
262
|
+
this.$toasted.global.defaultInfo({
|
|
263
|
+
msg: this.dictionary.msg_erro_sem_msg_formatada,
|
|
264
|
+
});
|
|
265
|
+
} else if (typeof event.data === "string" && this.showStandardMessages) {
|
|
266
|
+
this.message = event.data;
|
|
267
|
+
this.focusTextarea();
|
|
268
|
+
this.closeBlockerStandardMessage();
|
|
269
|
+
this.toggleStandardMessages();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
closeEmojis() {
|
|
274
|
+
try {
|
|
275
|
+
this.$root.$refs[`etf-${this.textId}`].showEmojis
|
|
276
|
+
? this.$root.$refs[`etf-${this.textId}`].away()
|
|
277
|
+
: "";
|
|
278
|
+
} catch (e) {
|
|
279
|
+
console.error("Nao foi possivel fechar os emojis");
|
|
280
|
+
console.error(e);
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
away() {
|
|
284
|
+
if (this.$refs[`${this.textId}-file`])
|
|
285
|
+
this.$refs[`${this.textId}-file`].openFiles = false;
|
|
286
|
+
},
|
|
287
|
+
setDefaultMessage(msg) {
|
|
288
|
+
this.message = msg;
|
|
289
|
+
this.sendFinalMessage();
|
|
290
|
+
},
|
|
291
|
+
insertEmoji(emoji) {
|
|
292
|
+
try {
|
|
293
|
+
if (!emoji) return;
|
|
294
|
+
const textarea = document.querySelector(`#text-footer-${this.textId}`);
|
|
295
|
+
if (document.activeElement === textarea) {
|
|
296
|
+
const cursorStart = textarea.selectionStart;
|
|
297
|
+
const cursorEnd = textarea.selectionEnd;
|
|
298
|
+
if (cursorEnd == textarea.value.length) {
|
|
299
|
+
this.message += emoji.finalEmoji;
|
|
300
|
+
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
|
|
301
|
+
} else {
|
|
302
|
+
const initValue = textarea.value.slice(0, cursorStart) + emoji.finalEmoji;
|
|
303
|
+
const endValue = textarea.value.slice(cursorEnd);
|
|
304
|
+
this.message = initValue + endValue;
|
|
305
|
+
textarea.setSelectionRange(initValue.length, initValue.length);
|
|
306
|
+
}
|
|
307
|
+
} else {
|
|
308
|
+
this.message += emoji.finalEmoji;
|
|
309
|
+
}
|
|
310
|
+
this.sendFinalMessage();
|
|
311
|
+
} catch (e) {
|
|
312
|
+
console.error("Erro ao inserir emoji");
|
|
313
|
+
console.error(e);
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
verifyMessage() {
|
|
317
|
+
if (this.textareaSettings.maxCharacters && this.message) {
|
|
318
|
+
if (this.message.length > this.textareaSettings.maxCharacters) {
|
|
319
|
+
if (!document.querySelector(".toasted.toasted-primary.error"))
|
|
320
|
+
this.$toasted.global.limiteCaracter();
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if ((!this.message || !this.message.trim()) && !this.hasAnyFile && !this.audioFile)
|
|
326
|
+
return false;
|
|
327
|
+
|
|
328
|
+
if (this.textareaSettings.disabled) return false;
|
|
329
|
+
|
|
330
|
+
if (this.fileFormatError && this.hasAnyFile) {
|
|
331
|
+
if (!document.querySelector(".toasted.toasted-primary.error"))
|
|
332
|
+
this.$toasted.global.defaultError({
|
|
333
|
+
msg: this.dictionary.msg_formato_invalido,
|
|
334
|
+
});
|
|
335
|
+
const str = {
|
|
336
|
+
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
337
|
+
doc: this.fileSettings.docsExtensions.split("|").join(", "),
|
|
338
|
+
};
|
|
339
|
+
if (!document.querySelector(".toasted.toasted-primary.info"))
|
|
340
|
+
this.$toasted.global.showValidFormats({
|
|
341
|
+
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`,
|
|
342
|
+
});
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return true;
|
|
347
|
+
},
|
|
348
|
+
removeHTMLElementsFromMessage(message) {
|
|
349
|
+
const regexTags = /<\/?[\d\w\s=\-:./'";]+>/gi;
|
|
350
|
+
if (message.match(regexTags)) message = message.replace(regexTags, " ");
|
|
351
|
+
return message;
|
|
352
|
+
},
|
|
353
|
+
formatMessage(message) {
|
|
354
|
+
if (!message) return "";
|
|
355
|
+
message = message.trim();
|
|
356
|
+
message = message.replace(/\n$/, "", message);
|
|
357
|
+
// message = returnMessageWithHexa(message);
|
|
358
|
+
message = this.removeHTMLElementsFromMessage(message);
|
|
359
|
+
return message;
|
|
360
|
+
},
|
|
361
|
+
sendFinalMessage() {
|
|
362
|
+
const messageAux = this.formatMessage(this.message);
|
|
363
|
+
this.$emit("final-message", messageAux);
|
|
364
|
+
},
|
|
365
|
+
sendMessageHandler(event) {
|
|
366
|
+
this.sendMessage(event);
|
|
367
|
+
},
|
|
368
|
+
sendMessage(event) {
|
|
369
|
+
if (this.isSending) return;
|
|
370
|
+
|
|
371
|
+
if (this.isMainChat && event) {
|
|
372
|
+
if (this.textareaSettings.sendOnEnter) {
|
|
373
|
+
if (event.keyCode == 13 && !event.shiftKey) event.preventDefault();
|
|
374
|
+
if (event.shiftKey) return;
|
|
375
|
+
} else {
|
|
376
|
+
if (event.keyCode == 13) {
|
|
377
|
+
if (!event.shiftKey) return;
|
|
378
|
+
event.preventDefault();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (!this.buttons.hasSendButton) return;
|
|
384
|
+
|
|
385
|
+
const messageAux = this.formatMessage(this.message);
|
|
386
|
+
if (this.verifyMessage()) {
|
|
387
|
+
if (messageAux || this.hasAnyFile || this.audioFile) {
|
|
388
|
+
this.$emit("send-message", messageAux);
|
|
389
|
+
const objMessage = this.returnObjectMessage(messageAux);
|
|
390
|
+
this.$emit("obj-message", objMessage);
|
|
391
|
+
|
|
392
|
+
if (
|
|
393
|
+
this.$refs[`emoji-text-${this.textId}`] &&
|
|
394
|
+
this.$refs[`emoji-text-${this.textId}`].showEmojis
|
|
395
|
+
)
|
|
396
|
+
this.$refs[`emoji-text-${this.textId}`].toggleEmojiSelection();
|
|
397
|
+
|
|
398
|
+
this.resetFooterData();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
focusTextarea() {
|
|
403
|
+
const textarea = document.querySelector(`#text-footer-${this.textId}`);
|
|
404
|
+
if (textarea) textarea.focus();
|
|
405
|
+
},
|
|
406
|
+
resetFooterData() {
|
|
407
|
+
if (this.audioFile) this.deleteAudio();
|
|
408
|
+
if (this.hasAnyFile) this.$refs[`${this.textId}-file`].deleteFile();
|
|
409
|
+
this.message = "";
|
|
410
|
+
this.sendFinalMessage();
|
|
411
|
+
resetTargets(this.$el, ".js-autoresize", ".js-parentresize", "38px");
|
|
412
|
+
this.focusTextarea();
|
|
413
|
+
},
|
|
414
|
+
returnObjectMessage(message) {
|
|
415
|
+
return {
|
|
416
|
+
message,
|
|
417
|
+
attachment: this.hasAnyFile ? this.file : false,
|
|
418
|
+
isDoc: this.isDoc,
|
|
419
|
+
imagePreview: this.imagePreview,
|
|
420
|
+
isAudio: this.audioFile ? true : false,
|
|
421
|
+
audioAttachment: this.audioSource,
|
|
422
|
+
};
|
|
423
|
+
},
|
|
424
|
+
setFileVars(fileObj) {
|
|
425
|
+
const { file, imagePreview, isDoc, fileFormatError, hasAnyFile } = fileObj;
|
|
426
|
+
|
|
427
|
+
this.file = file;
|
|
428
|
+
this.imagePreview = imagePreview ? imagePreview : "";
|
|
429
|
+
this.isDoc = isDoc;
|
|
430
|
+
this.fileFormatError = fileFormatError;
|
|
431
|
+
this.hasAnyFile = hasAnyFile;
|
|
432
|
+
|
|
433
|
+
this.$emit("set-file-vars", fileObj);
|
|
434
|
+
},
|
|
435
|
+
openImage(imagePreview) {
|
|
436
|
+
this.$emit("open-image", imagePreview);
|
|
437
|
+
},
|
|
438
|
+
openFileSystem() {
|
|
439
|
+
this.$emit("open-file-system");
|
|
440
|
+
},
|
|
441
|
+
resetFileSystem() {
|
|
442
|
+
this.$emit("reset-file-system");
|
|
443
|
+
},
|
|
444
|
+
setAudio(audioObj) {
|
|
445
|
+
const { audioFile, audioSource } = audioObj;
|
|
446
|
+
this.audioFile = audioFile;
|
|
447
|
+
this.audioSource = audioSource;
|
|
448
|
+
},
|
|
449
|
+
deleteAudio() {
|
|
450
|
+
this.$refs[`${this.textId}-mic`].deleteMediaRecorder();
|
|
451
|
+
this.audioFile = "";
|
|
452
|
+
this.audioSource = "";
|
|
453
|
+
},
|
|
454
|
+
returnFileType(file, stopAlert) {
|
|
455
|
+
if (!this.fileSettings.imagesExtensions && !this.fileSettings.docsExtensions)
|
|
456
|
+
return false;
|
|
457
|
+
const imgRegex = new RegExp("\.(" + this.fileSettings.imagesExtensions + ")", "i");
|
|
458
|
+
if (imgRegex.test(file.name)) return "img";
|
|
459
|
+
|
|
460
|
+
const docRegex = new RegExp("\.(" + this.fileSettings.docsExtensions + ")", "i");
|
|
461
|
+
if (docRegex.test(file.name)) return "doc";
|
|
462
|
+
|
|
463
|
+
if (!stopAlert) return false;
|
|
464
|
+
if (!document.querySelector(".toasted.toasted-primary.error"))
|
|
465
|
+
this.$toasted.global.defaultError({
|
|
466
|
+
msg: this.dictionary.msg_formato_invalido,
|
|
467
|
+
});
|
|
468
|
+
const str = {
|
|
469
|
+
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
470
|
+
doc: this.fileSettings.docsExtensions.split("|").join(", "),
|
|
471
|
+
};
|
|
472
|
+
if (!document.querySelector(".toasted.toasted-primary.info"))
|
|
473
|
+
this.$toasted.global.showValidFormats({
|
|
474
|
+
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`,
|
|
475
|
+
});
|
|
476
|
+
return false;
|
|
477
|
+
},
|
|
478
|
+
filesHandler(files) {
|
|
479
|
+
if (!Array.isArray(files)) files = Array.from(files);
|
|
480
|
+
const fileType = this.returnFileType(files[0], true);
|
|
481
|
+
let invalidFile = false;
|
|
482
|
+
try {
|
|
483
|
+
files.forEach((file) => {
|
|
484
|
+
const singleFileType = this.returnFileType(file, true);
|
|
485
|
+
if (!singleFileType) {
|
|
486
|
+
invalidFile = true;
|
|
487
|
+
file.invalid = true;
|
|
488
|
+
}
|
|
489
|
+
file.imgOrDoc = singleFileType ? singleFileType : "";
|
|
490
|
+
});
|
|
491
|
+
} catch (e) {
|
|
492
|
+
console.error("Erro ao tentar percorrer os arquivos");
|
|
493
|
+
console.error(e);
|
|
494
|
+
invalidFile = true;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (!invalidFile) {
|
|
498
|
+
this.$refs[`${this.textId}-file`].fileUpload(files, fileType, true);
|
|
499
|
+
} else {
|
|
500
|
+
if (!document.querySelector(".toasted.toasted-primary.error"))
|
|
501
|
+
this.$toasted.global.defaultError({
|
|
502
|
+
msg: this.dictionary.msg_formato_invalido,
|
|
503
|
+
});
|
|
504
|
+
const str = {
|
|
505
|
+
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
506
|
+
doc: this.fileSettings.docsExtensions.split("|").join(", "),
|
|
507
|
+
};
|
|
508
|
+
if (!document.querySelector(".toasted.toasted-primary.info"))
|
|
509
|
+
this.$toasted.global.showValidFormats({
|
|
510
|
+
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`,
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
dropFile(e) {
|
|
515
|
+
try {
|
|
516
|
+
e.stopPropagation();
|
|
517
|
+
e.preventDefault();
|
|
518
|
+
if (!this.buttons.hasFiles || this.fileSettings.handleFileClick) return false;
|
|
519
|
+
const files = e.dataTransfer.files.length ? e.dataTransfer.files : "";
|
|
520
|
+
this.filesHandler(files);
|
|
521
|
+
} catch (e) {
|
|
522
|
+
console.error("Erro drop file");
|
|
523
|
+
console.error(e);
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
pasteImage(e) {
|
|
527
|
+
try {
|
|
528
|
+
if (e.clipboardData.files.length && !this.buttons.hasFiles) {
|
|
529
|
+
e.preventDefault();
|
|
530
|
+
return;
|
|
531
|
+
} else if (e.clipboardData.files.length && this.buttons.hasFiles) {
|
|
532
|
+
const files = e.clipboardData.files;
|
|
533
|
+
this.filesHandler(files);
|
|
534
|
+
}
|
|
535
|
+
} catch (e) {
|
|
536
|
+
console.error("Nao foi possivel colar a/o imagem/documento");
|
|
537
|
+
console.error(e);
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
handleScreenShare() {
|
|
541
|
+
this.$emit("handle-screen-share");
|
|
542
|
+
},
|
|
543
|
+
toggleStandardMessages() {
|
|
544
|
+
if (this.formattedMessageSettings.hasStandardMessages) {
|
|
545
|
+
this.showStandardMessages = !this.showStandardMessages;
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
openBlockerStandardMessage() {
|
|
549
|
+
this.$emit("open-blocker-standard-message");
|
|
550
|
+
},
|
|
551
|
+
closeBlockerStandardMessage() {
|
|
552
|
+
this.$emit("close-blocker-standard-message");
|
|
553
|
+
},
|
|
554
|
+
setMessageType(type) {
|
|
555
|
+
this.messageType = type;
|
|
556
|
+
},
|
|
557
|
+
setStandardInfos(infos) {
|
|
558
|
+
this.$emit("set-standard-infos", infos);
|
|
559
|
+
},
|
|
560
|
+
addStandardMessage(message) {
|
|
561
|
+
this.message = message;
|
|
562
|
+
this.sendFinalMessage();
|
|
563
|
+
},
|
|
564
|
+
closeStandardMessages() {
|
|
565
|
+
this.showStandardMessages = false;
|
|
566
|
+
},
|
|
567
|
+
returnParams(params) {
|
|
568
|
+
const defaultParams = {
|
|
569
|
+
message: this.message,
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
if (!params) return defaultParams;
|
|
573
|
+
|
|
574
|
+
const keys = params.instanceKeys.split("|");
|
|
575
|
+
if (!keys || !keys.length)
|
|
576
|
+
return {
|
|
577
|
+
defaultParams,
|
|
578
|
+
...params.values,
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
const customParams = { ...params.values };
|
|
582
|
+
keys.forEach((key) => {
|
|
583
|
+
if (this[key]) customParams[key] = this[key];
|
|
584
|
+
else console.warn(`Cant find ${key} on 'this' instance`);
|
|
585
|
+
});
|
|
586
|
+
|
|
587
|
+
return Object.keys(customParams).length ? customParams : defaultParams;
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
destroyed() {
|
|
591
|
+
// this.$root.$off("drop-file")
|
|
592
|
+
// this.$root.$off("toggle-msg-formatada")
|
|
593
|
+
// this.$root.$off("textarea-focus")
|
|
594
|
+
// this.$root.$off("clear-footer-message")
|
|
595
|
+
// this.$root.$off("resize-footer-template")
|
|
596
|
+
|
|
597
|
+
window.removeEventListener("message", this.listenerPostMessage);
|
|
598
|
+
},
|
|
599
|
+
};
|
|
600
|
+
</script>
|
|
601
|
+
|
|
602
|
+
<style>
|
|
603
|
+
.text-footer-container {
|
|
604
|
+
display: flex;
|
|
605
|
+
justify-content: center;
|
|
606
|
+
align-items: center;
|
|
607
|
+
flex-direction: column;
|
|
608
|
+
width: 100%;
|
|
609
|
+
position: relative;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.text-footer-container .text-footer {
|
|
613
|
+
min-height: 48px;
|
|
614
|
+
box-shadow: 0px 3px 7px -2px rgba(0, 0, 0, 0.45);
|
|
615
|
+
position: relative;
|
|
616
|
+
display: flex;
|
|
617
|
+
justify-content: center;
|
|
618
|
+
align-items: center;
|
|
619
|
+
border: 1px solid #ccc;
|
|
620
|
+
padding: 5px 2px 5px 5px;
|
|
621
|
+
border-radius: 5px;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.text-footer-container .text-footer.full {
|
|
625
|
+
width: 100%;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.text-footer-container .text-footer.almostFull {
|
|
629
|
+
width: 95%;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.text-footer-container .text-footer.medium {
|
|
633
|
+
width: 75%;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.text-footer-container.bigger .text-footer {
|
|
637
|
+
height: 80px;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.text-footer-container.bigger .text-footer>textarea {
|
|
641
|
+
font-size: 14px;
|
|
642
|
+
height: 75px;
|
|
643
|
+
max-height: 75px;
|
|
644
|
+
min-height: 75px;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.text-footer-container textarea {
|
|
648
|
+
margin: 0 5px;
|
|
649
|
+
border: unset;
|
|
650
|
+
flex: 1;
|
|
651
|
+
resize: none;
|
|
652
|
+
min-height: 30px;
|
|
653
|
+
max-height: 60px;
|
|
654
|
+
font-size: 14px;
|
|
655
|
+
font-family: inherit;
|
|
656
|
+
background: inherit;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.text-footer-container textarea:focus {
|
|
660
|
+
outline: unset;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.text-footer-container textarea::placeholder {
|
|
664
|
+
font-size: 12px;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.text-footer-container .text-footer-audio {
|
|
668
|
+
flex: 1;
|
|
669
|
+
display: flex;
|
|
670
|
+
justify-content: center;
|
|
671
|
+
align-items: center;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.text-footer-container audio {
|
|
675
|
+
flex: 1;
|
|
676
|
+
outline: unset;
|
|
677
|
+
width: auto;
|
|
678
|
+
height: 38px;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.text-footer-container .delete-audio {
|
|
682
|
+
display: flex;
|
|
683
|
+
justify-content: center;
|
|
684
|
+
align-items: center;
|
|
685
|
+
color: #e74c3c;
|
|
686
|
+
transition: background 300ms;
|
|
687
|
+
border-radius: 50%;
|
|
688
|
+
font-size: 16px;
|
|
689
|
+
padding: 10px;
|
|
690
|
+
cursor: pointer;
|
|
691
|
+
margin: 0 5px;
|
|
692
|
+
width: 31px;
|
|
693
|
+
height: 31px;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.text-footer-container .delete-audio:hover {
|
|
697
|
+
background-color: rgba(208, 0, 0, 0.2);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.text-footer-container .max-characters {
|
|
701
|
+
font-size: 9.2px;
|
|
702
|
+
z-index: 1;
|
|
703
|
+
color: #444;
|
|
704
|
+
position: relative;
|
|
705
|
+
top: 30px;
|
|
706
|
+
left: -30px;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.text-footer-container .max-characters.no-width {
|
|
710
|
+
width: 0;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.text-footer-container .text-footer-actions {
|
|
714
|
+
display: flex;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.text-footer-container .text-footer-actions.outside-buttons {
|
|
718
|
+
display: flex;
|
|
719
|
+
align-items: center;
|
|
720
|
+
justify-content: flex-end;
|
|
721
|
+
position: absolute;
|
|
722
|
+
top: -30px;
|
|
723
|
+
right: 35px;
|
|
724
|
+
background-color: #fafafa;
|
|
725
|
+
height: 38px;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.text-footer-container .text-footer-actions .text-footer-actions--btn {
|
|
729
|
+
display: flex;
|
|
730
|
+
justify-content: center;
|
|
731
|
+
align-items: center;
|
|
732
|
+
color: #777;
|
|
733
|
+
border-radius: 50%;
|
|
734
|
+
transition: background 300ms;
|
|
735
|
+
font-size: 16px;
|
|
736
|
+
width: 36px;
|
|
737
|
+
height: 36px;
|
|
738
|
+
cursor: pointer;
|
|
739
|
+
margin-right: 2.5px;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.text-footer-container .text-footer-actions .text-footer-actions--btn:last-child {
|
|
743
|
+
margin-right: unset;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.text-footer-container .text-footer-actions .text-footer-actions--btn:hover {
|
|
747
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.text-footer-container .text-footer-actions .text-footer-actions--btn.files-activated {
|
|
751
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.text-footer-container .text-footer-actions .text-footer-actions--btn.audio-activated {
|
|
755
|
+
background-color: rgba(208, 0, 0, 0.7);
|
|
756
|
+
color: #fff;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.text-footer-container .text-footer-actions .text-footer-actions--btn.left-button {
|
|
760
|
+
position: absolute;
|
|
761
|
+
left: 0;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.text-footer-container .text-footer-hsm-container {
|
|
765
|
+
margin: 12px 0 7px 0;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.text-footer-container .text-footer-hsm-container.full {
|
|
769
|
+
width: 100%;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
.text-footer-container .text-footer-hsm-container.almostFull {
|
|
773
|
+
width: 95%;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.text-footer-container .text-footer-hsm-container.medium {
|
|
777
|
+
width: 75%;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.text-footer-container .text-footer-hsm-container .text-footer-v-select {
|
|
781
|
+
border-radius: 5px;
|
|
782
|
+
margin-bottom: 5px;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.text-footer-container .text-footer-hsm-container .text-footer-select-03 {
|
|
786
|
+
display: flex;
|
|
787
|
+
align-items: center;
|
|
788
|
+
flex: 1;
|
|
789
|
+
width: 100%;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer-v-select {
|
|
793
|
+
flex: 1;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03 {
|
|
797
|
+
transition-duration: 300ms;
|
|
798
|
+
user-select: none;
|
|
799
|
+
cursor: pointer;
|
|
800
|
+
box-shadow: inset 0 -3px rgba(0, 0, 0, 0.2);
|
|
801
|
+
opacity: 0.9;
|
|
802
|
+
border-radius: 2.5px;
|
|
803
|
+
display: flex;
|
|
804
|
+
justify-content: center;
|
|
805
|
+
align-items: center;
|
|
806
|
+
margin-left: 5px;
|
|
807
|
+
margin-bottom: 5px;
|
|
808
|
+
background-color: #f7fe72;
|
|
809
|
+
width: 32px;
|
|
810
|
+
height: 32px;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:hover {
|
|
814
|
+
opacity: 1;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:active {
|
|
818
|
+
opacity: 1;
|
|
819
|
+
box-shadow: inset 0 -1px rgba(0, 0, 0, 0.2);
|
|
820
|
+
-webkit-transform: translateY(1px);
|
|
821
|
+
-moz-transform: translateY(1px);
|
|
822
|
+
-o-transform: translateY(1px);
|
|
823
|
+
-ms-transform: translateY(1px);
|
|
824
|
+
transform: translateY(1px);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03 svg {
|
|
828
|
+
font-size: 16px;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.text-footer-container .text-footer-files-container {
|
|
832
|
+
position: absolute;
|
|
833
|
+
right: 0;
|
|
834
|
+
top: -55px;
|
|
835
|
+
padding: 5px;
|
|
836
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
837
|
+
border-radius: 5px;
|
|
838
|
+
display: flex;
|
|
839
|
+
align-items: center;
|
|
840
|
+
justify-content: space-between;
|
|
841
|
+
z-index: 1;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.text-footer-container .text-footer-files-container.horizontal {
|
|
845
|
+
right: -55px;
|
|
846
|
+
flex-direction: column;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.text-footer-container .text-footer-files-container .files-btn {
|
|
850
|
+
transition-duration: 300ms;
|
|
851
|
+
transition-property: opacity;
|
|
852
|
+
opacity: 0.8;
|
|
853
|
+
cursor: pointer;
|
|
854
|
+
display: flex;
|
|
855
|
+
justify-content: center;
|
|
856
|
+
align-items: center;
|
|
857
|
+
border-radius: 10px;
|
|
858
|
+
padding: 3px;
|
|
859
|
+
width: 40px;
|
|
860
|
+
height: 40px;
|
|
861
|
+
font-size: 16px;
|
|
862
|
+
color: #fff;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.text-footer-container .text-footer-files-container .files-btn:hover {
|
|
866
|
+
opacity: 1;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
.text-footer-container .text-footer-files-container .files-btn svg {
|
|
870
|
+
color: #fff;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.text-footer-container .text-footer-files-container .files-btn.images {
|
|
874
|
+
background-color: #9575cd;
|
|
875
|
+
margin-right: 5px;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.text-footer-container .text-footer-files-container .files-btn.images.margin-bottom {
|
|
879
|
+
margin-right: unset;
|
|
880
|
+
margin-bottom: 5px;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.text-footer-container .text-footer-files-container .files-btn.docs {
|
|
884
|
+
background-color: #7986cb;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.text-footer-container .text-footer-files-container .files-btn.system {
|
|
888
|
+
background-color: #49a349;
|
|
889
|
+
margin-left: 5px;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.text-footer-container .text-footer-files-container .files-btn.both {
|
|
893
|
+
font-size: 15.2px;
|
|
894
|
+
background-color: rgb(85, 85, 236);
|
|
895
|
+
flex-direction: column;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
.text-footer-container .text-footer-files-container .files-btn.both svg:nth-child(1) {
|
|
899
|
+
transform: translateX(5px);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.text-footer-container .text-footer-files-container .files-btn.both svg:nth-child(2) {
|
|
903
|
+
transform: translateX(-5px);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
.text-footer-container .old-footer-preview-container {
|
|
907
|
+
width: 100%;
|
|
908
|
+
cursor: default;
|
|
909
|
+
position: absolute;
|
|
910
|
+
right: 0;
|
|
911
|
+
background-color: #f1f1f1;
|
|
912
|
+
border: 2px solid #ccc;
|
|
913
|
+
border-bottom: unset;
|
|
914
|
+
border-top-left-radius: 2.5px;
|
|
915
|
+
border-top-right-radius: 2.5px;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
.text-footer-container .old-footer-preview-container.isDoc {
|
|
919
|
+
top: -50px;
|
|
920
|
+
width: 100%;
|
|
921
|
+
height: 45px;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.text-footer-container .old-footer-preview-container.isImg,
|
|
925
|
+
.text-footer-container .old-footer-preview-container.isMultiple {
|
|
926
|
+
top: -205px;
|
|
927
|
+
width: 100%;
|
|
928
|
+
height: 200px;
|
|
929
|
+
min-width: 300px;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
.text-footer-container .old-footer-preview-container.isImg .text-footer-image-preview {
|
|
933
|
+
height: 170px;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.text-footer-container .old-footer-preview-container.isError {
|
|
937
|
+
top: -80px;
|
|
938
|
+
width: 100%;
|
|
939
|
+
height: 75px;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
.text-footer-container .text-footer-alt {
|
|
943
|
+
margin-top: -12px;
|
|
944
|
+
width: 100%;
|
|
945
|
+
padding: 0 10px;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
.text-footer-container .text-footer-alt .text-footer-out-session {
|
|
949
|
+
margin-top: 12px;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
.text-footer-container .text-footer-alt .text-footer-sem-24h {
|
|
953
|
+
font-size: 12.8px;
|
|
954
|
+
text-align: right;
|
|
955
|
+
font-weight: 600;
|
|
956
|
+
letter-spacing: -0.5px;
|
|
957
|
+
color: #dd7f0c;
|
|
958
|
+
margin-top: 5px;
|
|
959
|
+
position: absolute;
|
|
960
|
+
right: 0;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
.text-footer-container .text-footer-alt .sem-templates {
|
|
964
|
+
margin-top: 10px;
|
|
965
|
+
font-size: 12.8px;
|
|
966
|
+
text-align: right;
|
|
967
|
+
font-weight: 600;
|
|
968
|
+
letter-spacing: -0.5px;
|
|
969
|
+
color: #921e12;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.text-footer-container .text-footer-alt .text-footer-templates {
|
|
973
|
+
position: relative;
|
|
974
|
+
width: 100%;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection {
|
|
978
|
+
width: 100%;
|
|
979
|
+
display: flex;
|
|
980
|
+
align-items: center;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection h4 {
|
|
984
|
+
margin-right: 5px;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection .sm__select {
|
|
988
|
+
flex: 1;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.vs__dropdown-menu {
|
|
992
|
+
font-size: 13.6px !important;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.emoji-mart-anchor,
|
|
996
|
+
.emoji-mart-emoji span {
|
|
997
|
+
cursor: pointer !important;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.emoji-mart {
|
|
1001
|
+
z-index: 2 !important;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.emoji-mart-scroll {
|
|
1005
|
+
overflow-x: hidden;
|
|
1006
|
+
}
|
|
1007
|
+
</style>
|