vue-intergrall-plugins 0.0.288 → 0.0.289

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +185 -185
  2. package/dist/vue-intergrall-plugins.esm.js +59 -58
  3. package/dist/vue-intergrall-plugins.min.js +1 -1
  4. package/dist/vue-intergrall-plugins.ssr.js +128 -127
  5. package/package.json +65 -65
  6. package/src/lib-components/Buttons/IconButton.vue +27 -27
  7. package/src/lib-components/Buttons/SimpleButton.vue +140 -140
  8. package/src/lib-components/Cards/Card.vue +412 -412
  9. package/src/lib-components/Cards/CardCheck.vue +35 -35
  10. package/src/lib-components/Cards/CardFile.vue +157 -157
  11. package/src/lib-components/Chat/BtnDownloadAllFiles.vue +32 -32
  12. package/src/lib-components/Chat/BtnEmojis.vue +124 -124
  13. package/src/lib-components/Chat/BtnExpand.vue +17 -17
  14. package/src/lib-components/Chat/BtnFiles.vue +415 -415
  15. package/src/lib-components/Chat/BtnMic.vue +60 -60
  16. package/src/lib-components/Chat/BtnScreenShare.vue +32 -32
  17. package/src/lib-components/Chat/BtnStandardMessages.vue +17 -17
  18. package/src/lib-components/Chat/ExpandTextarea.vue +410 -410
  19. package/src/lib-components/Chat/MultipleFilePreview.vue +266 -266
  20. package/src/lib-components/Chat/Picker.vue +368 -368
  21. package/src/lib-components/Chat/RemainingCharacters.vue +28 -28
  22. package/src/lib-components/Chat/SingleFilePreview.vue +94 -94
  23. package/src/lib-components/Chat/SkeletonPicker.vue +110 -110
  24. package/src/lib-components/Chat/StandardMessages.vue +245 -245
  25. package/src/lib-components/Chat/TextFooter.vue +1075 -1075
  26. package/src/lib-components/Email/EmailFile.vue +125 -125
  27. package/src/lib-components/Email/EmailItem.vue +185 -185
  28. package/src/lib-components/Loader/Loader.vue +78 -78
  29. package/src/lib-components/Messages/AnexoMensagem.vue +458 -458
  30. package/src/lib-components/Messages/CardAttachment.vue +61 -61
  31. package/src/lib-components/Messages/CardMessages.vue +460 -460
  32. package/src/lib-components/Messages/ChatMessages.vue +716 -715
  33. package/src/lib-components/Messages/InteratividadeBotoes.vue +165 -165
  34. package/src/lib-components/Messages/InteratividadeFormulario.vue +392 -392
  35. package/src/lib-components/Messages/InteratividadePopup.vue +88 -88
  36. package/src/lib-components/Messages/LinkPreview.vue +163 -163
  37. package/src/lib-components/Scroll/ScrollContent.vue +150 -150
  38. package/src/lib-components/Templates/TemplateGenerator.vue +576 -576
  39. package/src/lib-components/Templates/TemplateMessage.vue +83 -83
  40. package/src/lib-components/Templates/TemplateSingle.vue +481 -481
@@ -1,715 +1,716 @@
1
- <template>
2
- <div
3
- :class="'mensagem__'+origem" v-if="origem && !erro" :id="`a${messageIndex ? messageIndex : randomizeValue}`"
4
- >
5
- <InteratividadeFormulario
6
- v-if="interatividade && validateInterativity()"
7
- :interatividade="interatividade"
8
- :dominio="dominio"
9
- :infoCanal="infoCanalTeste"
10
- :anexos="anexos"
11
- :dictionary="dictionary"
12
- />
13
- <div
14
- v-else
15
- class="mensagem"
16
- :class="{mapa, 'hist-msg' : histMsg, 'max-w-60' : link && !mapa}"
17
- >
18
- <!-- Estilo da mensagem do tipo reply (que foi respondida) -->
19
- <div v-if="isReply && replyMessage" class="mensagem-reply" :class="`message-reply-${origem}`">
20
- <p v-if="replyMessage" v-html="replyMessage"></p>
21
- <span v-else class="mensagem-reply-vazia">
22
- <fa-icon :icon="['fas', 'times']" v-if="showReplyIcon" />
23
- {{ defaultReplyMessage ? defaultReplyMessage : dictionary.mensagem_reply_padrao }}
24
- </span>
25
- </div>
26
- <!-- Anexos -->
27
- <template v-if="anexos && anexos.length">
28
- <div class="mensagem-anexo" v-for="(anexo, index) in anexos" :key="index">
29
- <AnexoMensagem :showControlFiles="showControlFiles" :referenceSelector="referenceSelector" :dictionary="dictionary" :anexo="anexo" :origemExterna="origemExterna" :dominio="dominio" @abrir-imagem="abrirImagem" @download-all="$emit('download-all')"/>
30
- </div>
31
- </template>
32
- <!-- sticker -->
33
- <img class="default-stick-size" v-if="urlSticker" :src="urlSticker" :title="urlFileName">
34
- <!-- Mapa -->
35
- <div v-if="mapa" class="mensagem-div-mapa">
36
- <GmapMap
37
- :id="`mapa_${seq}`"
38
- class="msg-mapa"
39
- :center="center"
40
- :zoom="17"
41
- :options="mapOptions"
42
- >
43
- <GmapMarker :position="marker" />
44
- </GmapMap>
45
- <ul class="info-mapa" v-if="infos.length">
46
- <li v-for="(info, index) in infos" :key="index" :class="info.classe">
47
- <template v-if="!info.link"> {{ info.value }} </template>
48
- <a v-else :href="info.value" @click.prevent="abrirPopup(info.value)"> {{ info.textLink }} <fa-icon :icon="['fas', 'map-marker-alt']" /> </a>
49
- </li>
50
- </ul>
51
- </div>
52
- <!-- Preview do link -->
53
- <LinkPreview v-if="link && !mapa && status != 'O'" :message="message" />
54
- <!-- Mensagem -->
55
- <p v-html="validateInterativity() ? '' : formatMsg(message)"></p>
56
- <!-- Botoes da interatividade -->
57
- <InteratividadeBotoes
58
- v-if="interatividade"
59
- :interatividade="interatividade"
60
- />
61
- <!-- Horario da mensagem -->
62
- <span class="horario-envio" v-text="horario"></span>
63
- <!-- Reenviar mensagem -->
64
- <transition name="fade" mode="out-in">
65
- <span :class="reply" v-if="hasReply && (status == 'C' || status == 'T' || status == 'ERRO')" v-tippy :content="msgReply ? msgReply : 'Fazer reenvio da mensagem'" @click="$emit('replyMsg')"> <fa-icon :icon="['fas', 'reply']" /> </span>
66
- </transition>
67
- <!-- ?? -->
68
- <transition name="fade" mode="out-in" v-if="validadeSeq">
69
- <span class="star dourado" v-if="iniDialogo > 0" :content="contentTooltipStar" v-tippy key="star-padrao-dourado">
70
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
71
- <path fill="#FFD700" d="M224 122.8c-72.7 0-131.8 59.1-131.9 131.8 0 24.9 7 49.2 20.2 70.1l3.1 5-13.3 48.6 49.9-13.1 4.8 2.9c20.2 12 43.4 18.4 67.1 18.4h.1c72.6 0 133.3-59.1 133.3-131.8 0-35.2-15.2-68.3-40.1-93.2-25-25-58-38.7-93.2-38.7zm77.5 188.4c-3.3 9.3-19.1 17.7-26.7 18.8-12.6 1.9-22.4.9-47.5-9.9-39.7-17.2-65.7-57.2-67.7-59.8-2-2.6-16.2-21.5-16.2-41s10.2-29.1 13.9-33.1c3.6-4 7.9-5 10.6-5 2.6 0 5.3 0 7.6.1 2.4.1 5.7-.9 8.9 6.8 3.3 7.9 11.2 27.4 12.2 29.4s1.7 4.3.3 6.9c-7.6 15.2-15.7 14.6-11.6 21.6 15.3 26.3 30.6 35.4 53.9 47.1 4 2 6.3 1.7 8.6-1 2.3-2.6 9.9-11.6 12.5-15.5 2.6-4 5.3-3.3 8.9-2 3.6 1.3 23.1 10.9 27.1 12.9s6.6 3 7.6 4.6c.9 1.9.9 9.9-2.4 19.1zM400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM223.9 413.2c-26.6 0-52.7-6.7-75.8-19.3L64 416l22.5-82.2c-13.9-24-21.2-51.3-21.2-79.3C65.4 167.1 136.5 96 223.9 96c42.4 0 82.2 16.5 112.2 46.5 29.9 30 47.9 69.8 47.9 112.2 0 87.4-72.7 158.5-160.1 158.5z"/>
72
- </svg>
73
- </span>
74
- <span class="star cinza" v-if="iniDialogo == 0" :content="contentTooltipStar" v-tippy key="star-padrao-cinza">
75
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
76
- <path fill="#808080" d="M224 122.8c-72.7 0-131.8 59.1-131.9 131.8 0 24.9 7 49.2 20.2 70.1l3.1 5-13.3 48.6 49.9-13.1 4.8 2.9c20.2 12 43.4 18.4 67.1 18.4h.1c72.6 0 133.3-59.1 133.3-131.8 0-35.2-15.2-68.3-40.1-93.2-25-25-58-38.7-93.2-38.7zm77.5 188.4c-3.3 9.3-19.1 17.7-26.7 18.8-12.6 1.9-22.4.9-47.5-9.9-39.7-17.2-65.7-57.2-67.7-59.8-2-2.6-16.2-21.5-16.2-41s10.2-29.1 13.9-33.1c3.6-4 7.9-5 10.6-5 2.6 0 5.3 0 7.6.1 2.4.1 5.7-.9 8.9 6.8 3.3 7.9 11.2 27.4 12.2 29.4s1.7 4.3.3 6.9c-7.6 15.2-15.7 14.6-11.6 21.6 15.3 26.3 30.6 35.4 53.9 47.1 4 2 6.3 1.7 8.6-1 2.3-2.6 9.9-11.6 12.5-15.5 2.6-4 5.3-3.3 8.9-2 3.6 1.3 23.1 10.9 27.1 12.9s6.6 3 7.6 4.6c.9 1.9.9 9.9-2.4 19.1zM400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM223.9 413.2c-26.6 0-52.7-6.7-75.8-19.3L64 416l22.5-82.2c-13.9-24-21.2-51.3-21.2-79.3C65.4 167.1 136.5 96 223.9 96c42.4 0 82.2 16.5 112.2 46.5 29.9 30 47.9 69.8 47.9 112.2 0 87.4-72.7 158.5-160.1 158.5z"/>
77
- </svg>
78
- </span>
79
- </transition>
80
- <!-- Status da mensagem -->
81
- <transition name="fade" mode="out-in">
82
- <span class="check" v-if="status == 'D'" :content="contentTooltip" v-tippy key="check-padrao"> <fa-icon :icon="['fas', 'check']" /> </span>
83
- <span class="check cinza" v-else-if="status == 'Q'" :content="contentTooltip" v-tippy key="check-cinza"> <fa-icon :icon="['fas', 'check']" /> </span>
84
- <span class="check preto" v-else-if="status == 'G'" :content="contentTooltip" v-tippy key="check-preto"> <fa-icon :icon="['fas', 'check']" /> </span>
85
- <span class="check preto" v-else-if="status == 'E'" :content="contentTooltip" v-tippy key="double-check-preto"> <fa-icon :icon="['fas', 'check-double']" /> </span>
86
- <span class="check visualizado" v-else-if="status == 'L'" :content="contentTooltip" v-tippy key="double-check-visualizado"> <fa-icon :icon="['fas', 'check-double']" /> </span> <!-- Status finalizador -->
87
- <span class="check vermelho" v-else-if="status == 'C' || status == 'ERRO'" :content="contentTooltip" v-tippy key="times-circle"> <fa-icon :icon="['fas', 'times-circle']" /> </span> <!-- Status finalizador -->
88
- <span class="check vermelho" v-else-if="status == 'T'" :content="contentTooltip" v-tippy key="hourglass"> <fa-icon :icon="['fas', 'hourglass']" /> </span> <!-- Status finalizador -->
89
- <span class="check vermelho" v-else-if="status == 'O'" :content="contentTooltip" v-tippy key="deleted"> <fa-icon :icon="['fas', 'times']" /> </span> <!-- Status de mensagem deletada -->
90
- </transition>
91
- <!-- Autor da mensagem -->
92
- <span class="autor-mensagem" v-html="autor"></span>
93
- <!-- Menu de opcoes da mensagem -->
94
- <div class="menu-primario" :class="origem" v-if="showMenu">
95
- <!-- <span class="menu-mensagem" @click="toggleIsMenuOpen" v-tippy :content="dictionary.tit_mais_msg">
96
- <fa-icon :icon="['fas', 'chevron-down']" />
97
- </span> -->
98
- <span class="menu-mensagem" @click="responderMensagemHandler" v-tippy :content="dictionary.tit_responder_msg">
99
- <fa-icon :icon="['fas', 'reply']" />
100
- </span>
101
- </div>
102
- <transition name="fade" mode="out-in" v-if="isMenuOpen">
103
- <ul class="menu-flutuante" :class="origem" v-on-clickaway="closeMenu">
104
- <li @click="responderMensagemHandler">
105
- <span> {{ dictionary.tit_responder_msg }} </span>
106
- </li>
107
- </ul>
108
- </transition>
109
- </div>
110
- </div>
111
- </template>
112
-
113
- <script>
114
- import AnexoMensagem from "./AnexoMensagem"
115
- import InteratividadeBotoes from "./InteratividadeBotoes"
116
- import InteratividadeFormulario from "./InteratividadeFormulario"
117
- import { formataTimezoneData } from "../../services/textFormatting"
118
- import LinkPreview from './LinkPreview'
119
- import { mixin as clickaway } from 'vue-clickaway'
120
-
121
- export default {
122
- components: { AnexoMensagem, InteratividadeBotoes, InteratividadeFormulario, LinkPreview },
123
- props: ["smartchannel", "messageIndex", "dictionary", "autor", "origem", "msg", "link", "anexo", "imgAnexo", "tipoDoc", "docAnexo", "nomeArquivo", "audio", "video", "horario", "status", "logo", "msgTooltip", "seq", "mapa", "histMsg", "erro", "msgErro", "origemExterna", "anexos", "dominio", "corMsg", "interatividade", "msgReply", "hasReply", "iniDialogo", "dialogoId", "dialogoOrigem", "expSessao", "referenceSelector", "replyMessage", "isReply", "defaultReplyMessage", "showReplyIcon", "showControlFiles", "showMenu"],
124
- created() {
125
- if(!this.$root.$refs.chatMessages) this.$root.$refs.chatMessages = this
126
- },
127
- mixins: [clickaway],
128
- data(){
129
- return{
130
- strTooltipAux: "",
131
- linkAux: "",
132
- urlSticker: "",
133
- urlFileName: "",
134
- message: "",
135
- reply: "reply",
136
- center: {},
137
- marker: {},
138
- infos: [],
139
- infoCanalTeste: {PRAZO: "2022-05-05", SITUACAO: {cod: "3", desc: "Em analise pelo fornecedor", cor: "#03A64A"}, DATA_ABERTURA: "2022-05-03 09:43:43"},
140
- mapOptions: {
141
- zoomControl: true,
142
- mapTypeControl: false,
143
- scaleControl: false,
144
- streetViewControl: false,
145
- rotateControl: false,
146
- fullscreenControl: false,
147
- disableDefaultUI: false
148
- },
149
- isMenuOpen: false,
150
- showMenuOptions: false
151
- }
152
- },
153
- computed: {
154
- hrefAnexo(){
155
- if(this.docAnexo){
156
- if(this.tipoDoc == "erro"){
157
- return this.hrefAnexo = "#"
158
- }else{
159
- return this.docAnexo
160
- }
161
- }
162
- },
163
- randomizeValue() {
164
- return `${(Math.floor(Math.random() * 7770))}${Date.now()}`
165
- },
166
- contentTooltip: {
167
- get(){
168
- if(this.status && !this.msgTooltip){
169
- const msgStatus = "msg_status_"+this.status
170
- return this.strTooltipAux = this.dictionary[msgStatus]
171
- }else if(this.status && this.msgTooltip){
172
- return this.strTooltipAux = this.msgTooltip
173
- }
174
- },
175
- set(msg){
176
- return this.contentTooltip = msg
177
- }
178
- },
179
- contentTooltipStar() {
180
- let tooltipStar = "";
181
- if(this.iniDialogo == 1){
182
- tooltipStar += this.dictionary['ini_sessao']+"<br/>"
183
- }
184
- else {
185
- tooltipStar += this.dictionary['ini_sessao_padrao']+"<br/>"
186
- }
187
- tooltipStar += this.dialogoId ? this.dictionary['id_conversa']+" - "+ this.dialogoId +"<br/>" : ""
188
- tooltipStar += this.dialogoOrigem ? this.dictionary['origem_conversa']+" - "+ this.dialogoOrigem +"<br/>" : ""
189
- tooltipStar += this.expSessao ? this.dictionary['expiracao_sessao']+" - "+ formataTimezoneData(this.expSessao) +"<br/>" : ""
190
- return tooltipStar
191
- },
192
- validadeSeq(){
193
- if(this.seq && this.seq.substring(0, 2) == "HW") return true
194
- this.reply = "reply reply-with-2-icons"
195
- return false;
196
- }
197
- },
198
- mounted() {
199
- if(this.mapa) this.setMap()
200
- if(this.corMsg) this.setCorMsg()
201
- this.validadeUrlToMsg()
202
- },
203
- methods: {
204
- closeMenu() {
205
- this.isMenuOpen = false
206
- },
207
- toggleIsMenuOpen() {
208
- this.isMenuOpen = !this.isMenuOpen
209
- },
210
- responderMensagemHandler() {
211
- if(this.isMenuOpen) this.closeMenu()
212
- this.$emit('responder-mensagem', {
213
- messageIndex: this.messageIndex,
214
- autor: this.autor,
215
- origem: this.origem,
216
- msg: this.msg,
217
- anexo: this.anexo,
218
- imgAnexo: this.imgAnexo,
219
- tipoDoc: this.tipoDoc,
220
- docAnexo: this.docAnexo,
221
- nomeArquivo: this.nomeArquivo,
222
- audio: this.audio,
223
- video: this.video,
224
- seq: this.seq,
225
- mapa: this.mapa,
226
- anexos: this.anexos,
227
- interatividade: this.interatividade,
228
- referenceSelector: this.referenceSelector,
229
- })
230
- },
231
- validateInterativity(){
232
- try {
233
- if(this.interatividade && (this.interatividade.formulario && this.interatividade.formulario.length) || (this.interatividade.list && this.interatividade.tipo == 'listItem')){
234
- return true;
235
- }
236
- return false;
237
- } catch (error) {
238
- return false;
239
- }
240
- },
241
- validadeUrlToMsg(){
242
- try {
243
- this.message = this.msg
244
- if(this.validadeIfExistsSticker()){
245
- this.urlSticker = this.getUrlSticker()
246
- this.urlFileName = this.getUrlFileName()
247
- this.message = this.removeUrlStickerByString(this.urlSticker)
248
- }
249
- } catch (error) {
250
- console.error("Error validating url to msg: ", error)
251
- }
252
- },
253
- getUrlFileName(){
254
- let urlRegex = /(?<=\/)[^\/\?#]+(?=[^\/]*$)/;
255
- let urlName = this.urlSticker.match(urlRegex)[0];
256
- return urlName;
257
- },
258
- removeUrlStickerByString(url){
259
- let msg = this.message.replace(`KSTICKERK ${url}`, '')
260
- return msg;
261
- },
262
- getUrlSticker(){
263
- let urlRegex = /(https?:\/\/[^ ]*)/;
264
- let url = this.message.match(urlRegex)[1];
265
- return url;
266
- },
267
- validadeIfExistsSticker(){
268
- if(this.message && this.message.indexOf("KSTICKERK https://") === 0) return true
269
- return false
270
- },
271
- setCorMsg() {
272
- try {
273
- const root = document.documentElement
274
- root.style.setProperty('--message-color', this.corMsg)
275
- this.adjustFontColor(this.corMsg)
276
- }catch(e) {
277
- console.error("Erro ao atribuir a cor as mensagens")
278
- console.error(e)
279
- }
280
- },
281
- setMap() {
282
- let objMapa = typeof this.mapa === "string" ? JSON.parse(`${this.mapa}`) : this.mapa
283
- if(objMapa.latitude && objMapa.longitude) {
284
- objMapa.latitude = parseFloat(objMapa.latitude)
285
- objMapa.longitude = parseFloat(objMapa.longitude)
286
-
287
- this.center.lat = objMapa.latitude
288
- this.center.lng = objMapa.longitude
289
-
290
- this.marker.lat = objMapa.latitude
291
- this.marker.lng = objMapa.longitude
292
-
293
- this.infos.push(
294
- { classe: "title", value: objMapa.name },
295
- { classe: "address", value: objMapa.address },
296
- { classe: "url", value: `https://www.google.com/maps/search/?api=1&query=${this.marker.lat},${this.marker.lng}`, link: true, textLink: this.dictionary.abrir_mapa }
297
- )
298
- }
299
- },
300
- abrirPopup(url) {
301
- window.open(url, "map-popup", "width=auto,height=auto")
302
- },
303
- abrirImagem(imagem) {
304
- this.$emit("abrir-imagem", imagem)
305
- },
306
- adjustFontColor(cor) {
307
- try {
308
- var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(cor);
309
-
310
- if(!result) return
311
-
312
- var r = parseInt(result[1], 16);
313
- var g = parseInt(result[2], 16);
314
- var b = parseInt(result[3], 16);
315
-
316
- r /= 255, g /= 255, b /= 255;
317
- var max = Math.max(r, g, b), min = Math.min(r, g, b);
318
- var h, s, l = (max + min) / 2;
319
-
320
- if(max == min){
321
- h = s = 0; // achromatic
322
- } else {
323
- var d = max - min;
324
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
325
- switch(max) {
326
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
327
- case g: h = (b - r) / d + 2; break;
328
- case b: h = (r - g) / d + 4; break;
329
- }
330
- h /= 6;
331
- }
332
-
333
- s = s*100;
334
- s = Math.round(s);
335
- l = l*100;
336
- l = Math.round(l);
337
- h = Math.round(360*h);
338
-
339
- const root = document.documentElement
340
- root.style.setProperty('--text-color', l <= 50 ? "#FFF" : "#111B21")
341
- root.style.setProperty('--files-bg', l <= 50 ? "rgba(255, 255, 255, 0.1)" : "rgba(100, 100, 100, 0.1)")
342
- root.style.setProperty('--files-bg-hover', l <= 50 ? "rgba(255, 255, 255, 0.3)" : "rgba(100, 100, 100, 0.3)")
343
- }catch(e) {
344
- console.error("Erro ao ajustar a cor da mensagem: ", e)
345
- }
346
- },
347
- formatMsg(msg) {
348
- if(this.status == 'O') return this.dictionary.msg_excluida ? this.dictionary.msg_excluida : 'MENSAGEM DELETADA'
349
- const regex = /(\n|&nbsp;)/g
350
- if(regex.test(msg)) msg = msg.replace(regex, "<br>")
351
- return msg
352
- },
353
- }
354
- }
355
- </script>
356
-
357
- <style>
358
- :root {
359
- --message-color: #373737;
360
- --text-color: #FFF;
361
- --files-bg: rgba(255, 255, 255, 0.1);
362
- --files-bg-hover: rgba(255, 255, 255, 0.1);
363
-
364
- --light: 80;
365
- --threshold: 60;
366
- }
367
-
368
- .fade-enter-active, .fade-leave-active {
369
- transition: opacity .5s;
370
- }
371
- .fade-enter, .fade-leave-to {
372
- opacity: 0;
373
- }
374
-
375
- .mensagem-reply {
376
- padding: 5px 10px;
377
- font-size: .75rem;
378
- color: #666;
379
- transition: background-color 150ms ease-in-out;
380
- border-radius: 5px;
381
- margin: 5px 0;
382
- overflow: hidden;
383
- max-width: 100%;
384
- }
385
- .mensagem-reply p {
386
- overflow: hidden;
387
- text-overflow: ellipsis;
388
- white-space: nowrap;
389
- }
390
-
391
- .message-reply-principal {
392
- border-left: 3px solid transparent;
393
- background-color: rgba(100, 100, 100, 0.1)
394
- }
395
- .message-reply-principal:hover {
396
- background-color: rgba(100, 100, 100, 0.2);
397
- }
398
-
399
- .message-reply-outros {
400
- background-color: rgb(245, 245, 245);
401
- border-left: 3px solid var(--message-color);
402
- }
403
- .message-reply-outros:hover {
404
- background-color: rgb(235, 235, 235)
405
- }
406
-
407
- .mensagem-reply-vazia {
408
- display: flex;
409
- align-items: center;
410
- }
411
- .mensagem-reply-vazia svg {
412
- margin-right: 5px;
413
- color: #ba181b;
414
- }
415
-
416
- .mensagem {
417
- padding: 20px 7px 14px 7px;
418
- border-radius: 5px;
419
- min-width: 150px;
420
- min-height: 60px;
421
- width: -webkit-fit-content;
422
- width: -moz-fit-content;
423
- width: fit-content;
424
- position: relative;
425
- max-width: 80%;
426
- margin-bottom: 10px;
427
- font-size: .75rem;
428
- word-break: break-word;
429
-
430
- -webkit-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
431
- -moz-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
432
- box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
433
- }
434
- .mensagem.max-w-60 {
435
- max-width: 60%;
436
- }
437
- .mensagem.mapa {
438
- width: 100%
439
- }
440
- .mensagem.hist-msg {
441
- animation: show 1s;
442
- }
443
- .mensagem a {
444
- margin-right: 5px;
445
- font-weight: 550;
446
- color: inherit;
447
- text-decoration: none;
448
- }
449
- .mensagem a:hover {
450
- text-decoration: underline;
451
- }
452
- .message p {
453
- white-space: pre-wrap;
454
- }
455
- .mensagem:hover .menu-primario {
456
- visibility: visible;
457
- opacity: 1;
458
- }
459
-
460
- .mensagem-anexo a, .mensagem-div-mapa a {
461
- white-space: nowrap;
462
- text-overflow: ellipsis;
463
- overflow: hidden;
464
- }
465
-
466
- .reply {
467
- cursor: pointer;
468
- position: absolute;
469
- right: 53px;
470
- bottom: 5px;
471
- font-size: .6rem;
472
- color: #67a332;
473
- width: .9rem;
474
- height: .9rem;
475
- display: flex;
476
- justify-content: center;
477
- align-items: center;
478
- border-radius: 50%;
479
- background-color: #FFF;
480
- }
481
- .reply svg {
482
- margin-top: -1px;
483
- margin-right: -1px;
484
- }
485
- .reply-with-2-icons{
486
- right: 30px;
487
- }
488
-
489
- .check{
490
- cursor: pointer;
491
- position: absolute;
492
- right: 10px;
493
- bottom: 2px;
494
- font-size: 0.7rem;
495
- }
496
- .check.visualizado, .check.visualizado svg{
497
- color: #006DAA
498
- }
499
- .check.verde, .check.verde svg{
500
- color: #4f772d
501
- }
502
- .check.vermelho, .check.vermelho svg{
503
- color: #ba181b
504
- }
505
- .check.cinza, .check.cinza svg{
506
- color: #999
507
- }
508
- .check.preto, .check.preto svg{
509
- color: #666
510
- }
511
- .star{
512
- cursor: pointer;
513
- position: absolute;
514
- right: 30px;
515
- bottom: 2px;
516
- font-size: 0.4rem;
517
- width: 11.2px;
518
- }
519
- .default-stick-size{
520
- width: 180px;
521
- height: auto;
522
- }
523
- .horario-envio {
524
- margin-right: 15px;
525
- font-size: 0.7rem;
526
- position: absolute;
527
- left: 10px;
528
- bottom: 2px;
529
- }
530
-
531
- .autor-mensagem {
532
- position: absolute;
533
- font-size: 0.6rem;
534
- white-space: nowrap;
535
- text-overflow: ellipsis;
536
- overflow: hidden;
537
- max-width: 90%;
538
- font-weight: bold;
539
- top: 2px;
540
- }
541
-
542
- .menu-primario {
543
- visibility: hidden;
544
- opacity: 0;
545
- transition: opacity 150ms ease-in-out;
546
- position: absolute;
547
- font-size: 0.7rem;
548
- top: 3px;
549
- display: flex;
550
- gap: 5px;
551
- padding: 2px 4px;
552
- }
553
- .menu-primario.principal {
554
- left: 4px;
555
- color: var(--text-color);
556
- background-color: var(--message-color);
557
- }
558
- .menu-primario.outros {
559
- right: 4px;
560
- color: var(--text-color);
561
- background-color: #FFF;
562
- }
563
-
564
- .menu-primario.outros > span:nth-child(1) {
565
- order: 10;
566
- }
567
-
568
- .menu-mensagem {
569
- cursor: pointer;
570
- padding: 1px;
571
- }
572
-
573
- .menu-flutuante {
574
- background-color: #FFF;
575
- -webkit-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
576
- -moz-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
577
- box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
578
- border-radius: 10px;
579
- position: absolute;
580
- top: 20px;
581
- width: 120px;
582
- min-height: 50px;
583
- height: 50px;
584
- max-height: 50px;
585
- overflow-x: hidden;
586
- overflow-y: auto;
587
- margin: 0;
588
- padding: 0;
589
- display: flex;
590
- flex-direction: column;
591
- z-index: 1;
592
- }
593
-
594
- .menu-flutuante.principal {
595
- left: 3px
596
- }
597
-
598
- .menu-flutuante.outros {
599
- right: 3px
600
- }
601
-
602
- .menu-flutuante li {
603
- transition: background-color 300ms ease-in-out;
604
- width: 100%;
605
- cursor: pointer;
606
- padding: 5px 10px;
607
- display: flex;
608
- align-items: center;
609
- }
610
-
611
- .menu-flutuante li:hover {
612
- background-color: #e9e9e9;
613
- }
614
-
615
- /* Principal */
616
- .mensagem__principal {
617
- width: 100%;
618
- display: flex;
619
- justify-content: flex-end;
620
- }
621
- .mensagem__principal > .mensagem::after {
622
- content: "";
623
- width: 0;
624
- height: 0;
625
- position: absolute;
626
- border-left: 10px solid transparent;
627
- border-right: 10px solid transparent;
628
- border-top: 10px solid var(--message-color);
629
- bottom: 5px;
630
- right: -10px;
631
- transform: rotate(-90deg);
632
- }
633
- .mensagem__principal > .mensagem {
634
- background-color: var(--message-color);
635
- color: var(--text-color);
636
- }
637
-
638
- .mensagem__principal > .mensagem .horario-envio {
639
- color: var(--text-color);
640
- }
641
- .mensagem__principal > .mensagem .autor-mensagem {
642
- right: 5px;
643
- color: var(--text-color);
644
- }
645
- /* Outros */
646
- .mensagem__outros {
647
- width: 100%;
648
- display: flex;
649
- }
650
- .mensagem__outros > .mensagem{
651
- background-color: #FFF;
652
- color: #333;
653
- }
654
- .mensagem__outros > .mensagem::after{
655
- content: "";
656
- width: 0;
657
- height: 0;
658
- position: absolute;
659
- border-left: 10px solid transparent;
660
- border-right: 10px solid transparent;
661
- border-top: 10px solid #FFF;
662
- bottom: 5px;
663
- left: -10px;
664
- transform: rotate(90deg);
665
- }
666
- /* .mensagem__outros .check{
667
- display: none
668
- } */
669
- .mensagem__outros > .autor-mensagem{
670
- left: 5px;
671
- color: #333;
672
- }
673
- /* Mapa */
674
- .mensagem-div-mapa {
675
- width: 100%;
676
- display: flex;
677
- justify-content: center;
678
- align-items: center;
679
- flex-direction: column;
680
- margin-bottom: 5px;
681
- }
682
-
683
- .msg-mapa {
684
- width: 100%;
685
- min-height: 225px;
686
- height: 100%;
687
- box-sizing: initial;
688
- }
689
- .msg-mapa img {
690
- max-width: none!important;
691
- }
692
-
693
- .info-mapa {
694
- list-style-type: none;
695
- }
696
- .info-mapa li.title {
697
- font-size: .85em
698
- }
699
- .info-mapa li.address, .info-mapa li.url {
700
- font-size: .85em
701
- }
702
- .info-mapa li.url {
703
- font-size: .85em
704
- }
705
-
706
- .tooltip-list {
707
- margin: 0;
708
- padding: 0;
709
- display: flex;
710
- flex-direction: column;
711
- justify-content: center;
712
- align-items: flex-start;
713
- }
714
-
715
- </style>
1
+ <template>
2
+ <div
3
+ :class="'mensagem__'+origem" v-if="origem && !erro" :id="`a${messageIndex ? messageIndex : randomizeValue}`"
4
+ >
5
+ <InteratividadeFormulario
6
+ v-if="interatividade && validateInterativity()"
7
+ :interatividade="interatividade"
8
+ :dominio="dominio"
9
+ :infoCanal="infoCanalTeste"
10
+ :anexos="anexos"
11
+ :dictionary="dictionary"
12
+ />
13
+ <div
14
+ v-else
15
+ class="mensagem"
16
+ :class="{mapa, 'hist-msg' : histMsg, 'max-w-60' : link && !mapa}"
17
+ >
18
+ <!-- Estilo da mensagem do tipo reply (que foi respondida) -->
19
+ <div v-if="isReply && replyMessage" class="mensagem-reply" :class="`message-reply-${origem}`">
20
+ <p v-if="replyMessage" v-html="replyMessage"></p>
21
+ <span v-else class="mensagem-reply-vazia">
22
+ <fa-icon :icon="['fas', 'times']" v-if="showReplyIcon" />
23
+ {{ defaultReplyMessage ? defaultReplyMessage : dictionary.mensagem_reply_padrao }}
24
+ </span>
25
+ </div>
26
+ <!-- Anexos -->
27
+ <template v-if="anexos && anexos.length">
28
+ <div class="mensagem-anexo" v-for="(anexo, index) in anexos" :key="index">
29
+ <AnexoMensagem :showControlFiles="showControlFiles" :referenceSelector="referenceSelector" :dictionary="dictionary" :anexo="anexo" :origemExterna="origemExterna" :dominio="dominio" @abrir-imagem="abrirImagem" @download-all="$emit('download-all')"/>
30
+ </div>
31
+ </template>
32
+ <!-- sticker -->
33
+ <img class="default-stick-size" v-if="urlSticker" :src="urlSticker" :title="urlFileName">
34
+ <!-- Mapa -->
35
+ <div v-if="mapa" class="mensagem-div-mapa">
36
+ <GmapMap
37
+ :id="`mapa_${seq}`"
38
+ class="msg-mapa"
39
+ :center="center"
40
+ :zoom="17"
41
+ :options="mapOptions"
42
+ >
43
+ <GmapMarker :position="marker" />
44
+ </GmapMap>
45
+ <ul class="info-mapa" v-if="infos.length">
46
+ <li v-for="(info, index) in infos" :key="index" :class="info.classe">
47
+ <template v-if="!info.link"> {{ info.value }} </template>
48
+ <a v-else :href="info.value" @click.prevent="abrirPopup(info.value)"> {{ info.textLink }} <fa-icon :icon="['fas', 'map-marker-alt']" /> </a>
49
+ </li>
50
+ </ul>
51
+ </div>
52
+ <!-- Preview do link -->
53
+ <LinkPreview v-if="link && !mapa && status != 'O'" :message="message" />
54
+ <!-- Mensagem -->
55
+ <p v-html="validateInterativity() ? '' : formatMsg(message)"></p>
56
+ <!-- Botoes da interatividade -->
57
+ <InteratividadeBotoes
58
+ v-if="interatividade"
59
+ :interatividade="interatividade"
60
+ />
61
+ <!-- Horario da mensagem -->
62
+ <span class="horario-envio" v-text="horario"></span>
63
+ <!-- Reenviar mensagem -->
64
+ <transition name="fade" mode="out-in">
65
+ <span :class="reply" v-if="hasReply && (status == 'C' || status == 'T' || status == 'ERRO')" v-tippy :content="msgReply ? msgReply : 'Fazer reenvio da mensagem'" @click="$emit('replyMsg')"> <fa-icon :icon="['fas', 'reply']" /> </span>
66
+ </transition>
67
+ <!-- ?? -->
68
+ <transition name="fade" mode="out-in" v-if="validadeSeq">
69
+ <span class="star dourado" v-if="iniDialogo > 0" :content="contentTooltipStar" v-tippy key="star-padrao-dourado">
70
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
71
+ <path fill="#FFD700" d="M224 122.8c-72.7 0-131.8 59.1-131.9 131.8 0 24.9 7 49.2 20.2 70.1l3.1 5-13.3 48.6 49.9-13.1 4.8 2.9c20.2 12 43.4 18.4 67.1 18.4h.1c72.6 0 133.3-59.1 133.3-131.8 0-35.2-15.2-68.3-40.1-93.2-25-25-58-38.7-93.2-38.7zm77.5 188.4c-3.3 9.3-19.1 17.7-26.7 18.8-12.6 1.9-22.4.9-47.5-9.9-39.7-17.2-65.7-57.2-67.7-59.8-2-2.6-16.2-21.5-16.2-41s10.2-29.1 13.9-33.1c3.6-4 7.9-5 10.6-5 2.6 0 5.3 0 7.6.1 2.4.1 5.7-.9 8.9 6.8 3.3 7.9 11.2 27.4 12.2 29.4s1.7 4.3.3 6.9c-7.6 15.2-15.7 14.6-11.6 21.6 15.3 26.3 30.6 35.4 53.9 47.1 4 2 6.3 1.7 8.6-1 2.3-2.6 9.9-11.6 12.5-15.5 2.6-4 5.3-3.3 8.9-2 3.6 1.3 23.1 10.9 27.1 12.9s6.6 3 7.6 4.6c.9 1.9.9 9.9-2.4 19.1zM400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM223.9 413.2c-26.6 0-52.7-6.7-75.8-19.3L64 416l22.5-82.2c-13.9-24-21.2-51.3-21.2-79.3C65.4 167.1 136.5 96 223.9 96c42.4 0 82.2 16.5 112.2 46.5 29.9 30 47.9 69.8 47.9 112.2 0 87.4-72.7 158.5-160.1 158.5z"/>
72
+ </svg>
73
+ </span>
74
+ <span class="star cinza" v-if="iniDialogo == 0" :content="contentTooltipStar" v-tippy key="star-padrao-cinza">
75
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
76
+ <path fill="#808080" d="M224 122.8c-72.7 0-131.8 59.1-131.9 131.8 0 24.9 7 49.2 20.2 70.1l3.1 5-13.3 48.6 49.9-13.1 4.8 2.9c20.2 12 43.4 18.4 67.1 18.4h.1c72.6 0 133.3-59.1 133.3-131.8 0-35.2-15.2-68.3-40.1-93.2-25-25-58-38.7-93.2-38.7zm77.5 188.4c-3.3 9.3-19.1 17.7-26.7 18.8-12.6 1.9-22.4.9-47.5-9.9-39.7-17.2-65.7-57.2-67.7-59.8-2-2.6-16.2-21.5-16.2-41s10.2-29.1 13.9-33.1c3.6-4 7.9-5 10.6-5 2.6 0 5.3 0 7.6.1 2.4.1 5.7-.9 8.9 6.8 3.3 7.9 11.2 27.4 12.2 29.4s1.7 4.3.3 6.9c-7.6 15.2-15.7 14.6-11.6 21.6 15.3 26.3 30.6 35.4 53.9 47.1 4 2 6.3 1.7 8.6-1 2.3-2.6 9.9-11.6 12.5-15.5 2.6-4 5.3-3.3 8.9-2 3.6 1.3 23.1 10.9 27.1 12.9s6.6 3 7.6 4.6c.9 1.9.9 9.9-2.4 19.1zM400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM223.9 413.2c-26.6 0-52.7-6.7-75.8-19.3L64 416l22.5-82.2c-13.9-24-21.2-51.3-21.2-79.3C65.4 167.1 136.5 96 223.9 96c42.4 0 82.2 16.5 112.2 46.5 29.9 30 47.9 69.8 47.9 112.2 0 87.4-72.7 158.5-160.1 158.5z"/>
77
+ </svg>
78
+ </span>
79
+ </transition>
80
+ <!-- Status da mensagem -->
81
+ <transition name="fade" mode="out-in">
82
+ <span class="check" v-if="status == 'D'" :content="contentTooltip" v-tippy key="check-padrao"> <fa-icon :icon="['fas', 'check']" /> </span>
83
+ <span class="check cinza" v-else-if="status == 'Q'" :content="contentTooltip" v-tippy key="check-cinza"> <fa-icon :icon="['fas', 'check']" /> </span>
84
+ <span class="check preto" v-else-if="status == 'G'" :content="contentTooltip" v-tippy key="check-preto"> <fa-icon :icon="['fas', 'check']" /> </span>
85
+ <span class="check preto" v-else-if="status == 'E'" :content="contentTooltip" v-tippy key="double-check-preto"> <fa-icon :icon="['fas', 'check-double']" /> </span>
86
+ <span class="check visualizado" v-else-if="status == 'L'" :content="contentTooltip" v-tippy key="double-check-visualizado"> <fa-icon :icon="['fas', 'check-double']" /> </span> <!-- Status finalizador -->
87
+ <span class="check vermelho" v-else-if="status == 'C' || status == 'ERRO'" :content="contentTooltip" v-tippy key="times-circle"> <fa-icon :icon="['fas', 'times-circle']" /> </span> <!-- Status finalizador -->
88
+ <span class="check vermelho" v-else-if="status == 'T'" :content="contentTooltip" v-tippy key="hourglass"> <fa-icon :icon="['fas', 'hourglass']" /> </span> <!-- Status finalizador -->
89
+ <span class="check vermelho" v-else-if="status == 'O'" :content="contentTooltip" v-tippy key="deleted"> <fa-icon :icon="['fas', 'times']" /> </span> <!-- Status de mensagem deletada -->
90
+ </transition>
91
+ <!-- Autor da mensagem -->
92
+ <span class="autor-mensagem" v-html="autor"></span>
93
+ <!-- Menu de opcoes da mensagem -->
94
+ <div class="menu-primario" :class="origem" v-if="showMenu">
95
+ <!-- <span class="menu-mensagem" @click="toggleIsMenuOpen" v-tippy :content="dictionary.tit_mais_msg">
96
+ <fa-icon :icon="['fas', 'chevron-down']" />
97
+ </span> -->
98
+ <span class="menu-mensagem" @click="responderMensagemHandler" v-tippy :content="dictionary.tit_responder_msg">
99
+ <fa-icon :icon="['fas', 'reply']" />
100
+ </span>
101
+ </div>
102
+ <transition name="fade" mode="out-in" v-if="isMenuOpen">
103
+ <ul class="menu-flutuante" :class="origem" v-on-clickaway="closeMenu">
104
+ <li @click="responderMensagemHandler">
105
+ <span> {{ dictionary.tit_responder_msg }} </span>
106
+ </li>
107
+ </ul>
108
+ </transition>
109
+ </div>
110
+ </div>
111
+ </template>
112
+
113
+ <script>
114
+ import AnexoMensagem from "./AnexoMensagem"
115
+ import InteratividadeBotoes from "./InteratividadeBotoes"
116
+ import InteratividadeFormulario from "./InteratividadeFormulario"
117
+ import { formataTimezoneData } from "../../services/textFormatting"
118
+ import LinkPreview from './LinkPreview'
119
+ import { mixin as clickaway } from 'vue-clickaway'
120
+
121
+ export default {
122
+ components: { AnexoMensagem, InteratividadeBotoes, InteratividadeFormulario, LinkPreview },
123
+ props: ["smartchannel", "messageIndex", "dictionary", "autor", "origem", "msg", "link", "anexo", "imgAnexo", "tipoDoc", "docAnexo", "nomeArquivo", "audio", "video", "horario", "status", "logo", "msgTooltip", "seq", "mapa", "histMsg", "erro", "msgErro", "origemExterna", "anexos", "dominio", "corMsg", "interatividade", "msgReply", "hasReply", "iniDialogo", "dialogoId", "dialogoOrigem", "expSessao", "referenceSelector", "replyMessage", "isReply", "defaultReplyMessage", "showReplyIcon", "showControlFiles", "showMenu", "id_ext_msg"],
124
+ created() {
125
+ if(!this.$root.$refs.chatMessages) this.$root.$refs.chatMessages = this
126
+ },
127
+ mixins: [clickaway],
128
+ data(){
129
+ return{
130
+ strTooltipAux: "",
131
+ linkAux: "",
132
+ urlSticker: "",
133
+ urlFileName: "",
134
+ message: "",
135
+ reply: "reply",
136
+ center: {},
137
+ marker: {},
138
+ infos: [],
139
+ infoCanalTeste: {PRAZO: "2022-05-05", SITUACAO: {cod: "3", desc: "Em analise pelo fornecedor", cor: "#03A64A"}, DATA_ABERTURA: "2022-05-03 09:43:43"},
140
+ mapOptions: {
141
+ zoomControl: true,
142
+ mapTypeControl: false,
143
+ scaleControl: false,
144
+ streetViewControl: false,
145
+ rotateControl: false,
146
+ fullscreenControl: false,
147
+ disableDefaultUI: false
148
+ },
149
+ isMenuOpen: false,
150
+ showMenuOptions: false
151
+ }
152
+ },
153
+ computed: {
154
+ hrefAnexo(){
155
+ if(this.docAnexo){
156
+ if(this.tipoDoc == "erro"){
157
+ return this.hrefAnexo = "#"
158
+ }else{
159
+ return this.docAnexo
160
+ }
161
+ }
162
+ },
163
+ randomizeValue() {
164
+ return `${(Math.floor(Math.random() * 7770))}${Date.now()}`
165
+ },
166
+ contentTooltip: {
167
+ get(){
168
+ if(this.status && !this.msgTooltip){
169
+ const msgStatus = "msg_status_"+this.status
170
+ return this.strTooltipAux = this.dictionary[msgStatus]
171
+ }else if(this.status && this.msgTooltip){
172
+ return this.strTooltipAux = this.msgTooltip
173
+ }
174
+ },
175
+ set(msg){
176
+ return this.contentTooltip = msg
177
+ }
178
+ },
179
+ contentTooltipStar() {
180
+ let tooltipStar = "";
181
+ if(this.iniDialogo == 1){
182
+ tooltipStar += this.dictionary['ini_sessao']+"<br/>"
183
+ }
184
+ else {
185
+ tooltipStar += this.dictionary['ini_sessao_padrao']+"<br/>"
186
+ }
187
+ tooltipStar += this.dialogoId ? this.dictionary['id_conversa']+" - "+ this.dialogoId +"<br/>" : ""
188
+ tooltipStar += this.dialogoOrigem ? this.dictionary['origem_conversa']+" - "+ this.dialogoOrigem +"<br/>" : ""
189
+ tooltipStar += this.expSessao ? this.dictionary['expiracao_sessao']+" - "+ formataTimezoneData(this.expSessao) +"<br/>" : ""
190
+ return tooltipStar
191
+ },
192
+ validadeSeq(){
193
+ if(this.seq && this.seq.substring(0, 2) == "HW") return true
194
+ this.reply = "reply reply-with-2-icons"
195
+ return false;
196
+ }
197
+ },
198
+ mounted() {
199
+ if(this.mapa) this.setMap()
200
+ if(this.corMsg) this.setCorMsg()
201
+ this.validadeUrlToMsg()
202
+ },
203
+ methods: {
204
+ closeMenu() {
205
+ this.isMenuOpen = false
206
+ },
207
+ toggleIsMenuOpen() {
208
+ this.isMenuOpen = !this.isMenuOpen
209
+ },
210
+ responderMensagemHandler() {
211
+ if(this.isMenuOpen) this.closeMenu()
212
+ this.$emit('responder-mensagem', {
213
+ messageIndex: this.messageIndex,
214
+ autor: this.autor,
215
+ origem: this.origem,
216
+ msg: this.msg,
217
+ anexo: this.anexo,
218
+ imgAnexo: this.imgAnexo,
219
+ tipoDoc: this.tipoDoc,
220
+ docAnexo: this.docAnexo,
221
+ nomeArquivo: this.nomeArquivo,
222
+ audio: this.audio,
223
+ video: this.video,
224
+ seq: this.seq,
225
+ mapa: this.mapa,
226
+ anexos: this.anexos,
227
+ interatividade: this.interatividade,
228
+ referenceSelector: this.referenceSelector,
229
+ id_ext_msg: this.id_ext_msg
230
+ })
231
+ },
232
+ validateInterativity(){
233
+ try {
234
+ if(this.interatividade && (this.interatividade.formulario && this.interatividade.formulario.length) || (this.interatividade.list && this.interatividade.tipo == 'listItem')){
235
+ return true;
236
+ }
237
+ return false;
238
+ } catch (error) {
239
+ return false;
240
+ }
241
+ },
242
+ validadeUrlToMsg(){
243
+ try {
244
+ this.message = this.msg
245
+ if(this.validadeIfExistsSticker()){
246
+ this.urlSticker = this.getUrlSticker()
247
+ this.urlFileName = this.getUrlFileName()
248
+ this.message = this.removeUrlStickerByString(this.urlSticker)
249
+ }
250
+ } catch (error) {
251
+ console.error("Error validating url to msg: ", error)
252
+ }
253
+ },
254
+ getUrlFileName(){
255
+ let urlRegex = /(?<=\/)[^\/\?#]+(?=[^\/]*$)/;
256
+ let urlName = this.urlSticker.match(urlRegex)[0];
257
+ return urlName;
258
+ },
259
+ removeUrlStickerByString(url){
260
+ let msg = this.message.replace(`KSTICKERK ${url}`, '')
261
+ return msg;
262
+ },
263
+ getUrlSticker(){
264
+ let urlRegex = /(https?:\/\/[^ ]*)/;
265
+ let url = this.message.match(urlRegex)[1];
266
+ return url;
267
+ },
268
+ validadeIfExistsSticker(){
269
+ if(this.message && this.message.indexOf("KSTICKERK https://") === 0) return true
270
+ return false
271
+ },
272
+ setCorMsg() {
273
+ try {
274
+ const root = document.documentElement
275
+ root.style.setProperty('--message-color', this.corMsg)
276
+ this.adjustFontColor(this.corMsg)
277
+ }catch(e) {
278
+ console.error("Erro ao atribuir a cor as mensagens")
279
+ console.error(e)
280
+ }
281
+ },
282
+ setMap() {
283
+ let objMapa = typeof this.mapa === "string" ? JSON.parse(`${this.mapa}`) : this.mapa
284
+ if(objMapa.latitude && objMapa.longitude) {
285
+ objMapa.latitude = parseFloat(objMapa.latitude)
286
+ objMapa.longitude = parseFloat(objMapa.longitude)
287
+
288
+ this.center.lat = objMapa.latitude
289
+ this.center.lng = objMapa.longitude
290
+
291
+ this.marker.lat = objMapa.latitude
292
+ this.marker.lng = objMapa.longitude
293
+
294
+ this.infos.push(
295
+ { classe: "title", value: objMapa.name },
296
+ { classe: "address", value: objMapa.address },
297
+ { classe: "url", value: `https://www.google.com/maps/search/?api=1&query=${this.marker.lat},${this.marker.lng}`, link: true, textLink: this.dictionary.abrir_mapa }
298
+ )
299
+ }
300
+ },
301
+ abrirPopup(url) {
302
+ window.open(url, "map-popup", "width=auto,height=auto")
303
+ },
304
+ abrirImagem(imagem) {
305
+ this.$emit("abrir-imagem", imagem)
306
+ },
307
+ adjustFontColor(cor) {
308
+ try {
309
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(cor);
310
+
311
+ if(!result) return
312
+
313
+ var r = parseInt(result[1], 16);
314
+ var g = parseInt(result[2], 16);
315
+ var b = parseInt(result[3], 16);
316
+
317
+ r /= 255, g /= 255, b /= 255;
318
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
319
+ var h, s, l = (max + min) / 2;
320
+
321
+ if(max == min){
322
+ h = s = 0; // achromatic
323
+ } else {
324
+ var d = max - min;
325
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
326
+ switch(max) {
327
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
328
+ case g: h = (b - r) / d + 2; break;
329
+ case b: h = (r - g) / d + 4; break;
330
+ }
331
+ h /= 6;
332
+ }
333
+
334
+ s = s*100;
335
+ s = Math.round(s);
336
+ l = l*100;
337
+ l = Math.round(l);
338
+ h = Math.round(360*h);
339
+
340
+ const root = document.documentElement
341
+ root.style.setProperty('--text-color', l <= 50 ? "#FFF" : "#111B21")
342
+ root.style.setProperty('--files-bg', l <= 50 ? "rgba(255, 255, 255, 0.1)" : "rgba(100, 100, 100, 0.1)")
343
+ root.style.setProperty('--files-bg-hover', l <= 50 ? "rgba(255, 255, 255, 0.3)" : "rgba(100, 100, 100, 0.3)")
344
+ }catch(e) {
345
+ console.error("Erro ao ajustar a cor da mensagem: ", e)
346
+ }
347
+ },
348
+ formatMsg(msg) {
349
+ if(this.status == 'O') return this.dictionary.msg_excluida ? this.dictionary.msg_excluida : 'MENSAGEM DELETADA'
350
+ const regex = /(\n|&nbsp;)/g
351
+ if(regex.test(msg)) msg = msg.replace(regex, "<br>")
352
+ return msg
353
+ },
354
+ }
355
+ }
356
+ </script>
357
+
358
+ <style>
359
+ :root {
360
+ --message-color: #373737;
361
+ --text-color: #FFF;
362
+ --files-bg: rgba(255, 255, 255, 0.1);
363
+ --files-bg-hover: rgba(255, 255, 255, 0.1);
364
+
365
+ --light: 80;
366
+ --threshold: 60;
367
+ }
368
+
369
+ .fade-enter-active, .fade-leave-active {
370
+ transition: opacity .5s;
371
+ }
372
+ .fade-enter, .fade-leave-to {
373
+ opacity: 0;
374
+ }
375
+
376
+ .mensagem-reply {
377
+ padding: 5px 10px;
378
+ font-size: .75rem;
379
+ color: #666;
380
+ transition: background-color 150ms ease-in-out;
381
+ border-radius: 5px;
382
+ margin: 5px 0;
383
+ overflow: hidden;
384
+ max-width: 100%;
385
+ }
386
+ .mensagem-reply p {
387
+ overflow: hidden;
388
+ text-overflow: ellipsis;
389
+ white-space: nowrap;
390
+ }
391
+
392
+ .message-reply-principal {
393
+ border-left: 3px solid transparent;
394
+ background-color: rgba(100, 100, 100, 0.1)
395
+ }
396
+ .message-reply-principal:hover {
397
+ background-color: rgba(100, 100, 100, 0.2);
398
+ }
399
+
400
+ .message-reply-outros {
401
+ background-color: rgb(245, 245, 245);
402
+ border-left: 3px solid var(--message-color);
403
+ }
404
+ .message-reply-outros:hover {
405
+ background-color: rgb(235, 235, 235)
406
+ }
407
+
408
+ .mensagem-reply-vazia {
409
+ display: flex;
410
+ align-items: center;
411
+ }
412
+ .mensagem-reply-vazia svg {
413
+ margin-right: 5px;
414
+ color: #ba181b;
415
+ }
416
+
417
+ .mensagem {
418
+ padding: 20px 7px 14px 7px;
419
+ border-radius: 5px;
420
+ min-width: 150px;
421
+ min-height: 60px;
422
+ width: -webkit-fit-content;
423
+ width: -moz-fit-content;
424
+ width: fit-content;
425
+ position: relative;
426
+ max-width: 80%;
427
+ margin-bottom: 10px;
428
+ font-size: .75rem;
429
+ word-break: break-word;
430
+
431
+ -webkit-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
432
+ -moz-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
433
+ box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
434
+ }
435
+ .mensagem.max-w-60 {
436
+ max-width: 60%;
437
+ }
438
+ .mensagem.mapa {
439
+ width: 100%
440
+ }
441
+ .mensagem.hist-msg {
442
+ animation: show 1s;
443
+ }
444
+ .mensagem a {
445
+ margin-right: 5px;
446
+ font-weight: 550;
447
+ color: inherit;
448
+ text-decoration: none;
449
+ }
450
+ .mensagem a:hover {
451
+ text-decoration: underline;
452
+ }
453
+ .message p {
454
+ white-space: pre-wrap;
455
+ }
456
+ .mensagem:hover .menu-primario {
457
+ visibility: visible;
458
+ opacity: 1;
459
+ }
460
+
461
+ .mensagem-anexo a, .mensagem-div-mapa a {
462
+ white-space: nowrap;
463
+ text-overflow: ellipsis;
464
+ overflow: hidden;
465
+ }
466
+
467
+ .reply {
468
+ cursor: pointer;
469
+ position: absolute;
470
+ right: 53px;
471
+ bottom: 5px;
472
+ font-size: .6rem;
473
+ color: #67a332;
474
+ width: .9rem;
475
+ height: .9rem;
476
+ display: flex;
477
+ justify-content: center;
478
+ align-items: center;
479
+ border-radius: 50%;
480
+ background-color: #FFF;
481
+ }
482
+ .reply svg {
483
+ margin-top: -1px;
484
+ margin-right: -1px;
485
+ }
486
+ .reply-with-2-icons{
487
+ right: 30px;
488
+ }
489
+
490
+ .check{
491
+ cursor: pointer;
492
+ position: absolute;
493
+ right: 10px;
494
+ bottom: 2px;
495
+ font-size: 0.7rem;
496
+ }
497
+ .check.visualizado, .check.visualizado svg{
498
+ color: #006DAA
499
+ }
500
+ .check.verde, .check.verde svg{
501
+ color: #4f772d
502
+ }
503
+ .check.vermelho, .check.vermelho svg{
504
+ color: #ba181b
505
+ }
506
+ .check.cinza, .check.cinza svg{
507
+ color: #999
508
+ }
509
+ .check.preto, .check.preto svg{
510
+ color: #666
511
+ }
512
+ .star{
513
+ cursor: pointer;
514
+ position: absolute;
515
+ right: 30px;
516
+ bottom: 2px;
517
+ font-size: 0.4rem;
518
+ width: 11.2px;
519
+ }
520
+ .default-stick-size{
521
+ width: 180px;
522
+ height: auto;
523
+ }
524
+ .horario-envio {
525
+ margin-right: 15px;
526
+ font-size: 0.7rem;
527
+ position: absolute;
528
+ left: 10px;
529
+ bottom: 2px;
530
+ }
531
+
532
+ .autor-mensagem {
533
+ position: absolute;
534
+ font-size: 0.6rem;
535
+ white-space: nowrap;
536
+ text-overflow: ellipsis;
537
+ overflow: hidden;
538
+ max-width: 90%;
539
+ font-weight: bold;
540
+ top: 2px;
541
+ }
542
+
543
+ .menu-primario {
544
+ visibility: hidden;
545
+ opacity: 0;
546
+ transition: opacity 150ms ease-in-out;
547
+ position: absolute;
548
+ font-size: 0.7rem;
549
+ top: 3px;
550
+ display: flex;
551
+ gap: 5px;
552
+ padding: 2px 4px;
553
+ }
554
+ .menu-primario.principal {
555
+ left: 4px;
556
+ color: var(--text-color);
557
+ background-color: var(--message-color);
558
+ }
559
+ .menu-primario.outros {
560
+ right: 4px;
561
+ color: var(--text-color);
562
+ background-color: #FFF;
563
+ }
564
+
565
+ .menu-primario.outros > span:nth-child(1) {
566
+ order: 10;
567
+ }
568
+
569
+ .menu-mensagem {
570
+ cursor: pointer;
571
+ padding: 1px;
572
+ }
573
+
574
+ .menu-flutuante {
575
+ background-color: #FFF;
576
+ -webkit-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
577
+ -moz-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
578
+ box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
579
+ border-radius: 10px;
580
+ position: absolute;
581
+ top: 20px;
582
+ width: 120px;
583
+ min-height: 50px;
584
+ height: 50px;
585
+ max-height: 50px;
586
+ overflow-x: hidden;
587
+ overflow-y: auto;
588
+ margin: 0;
589
+ padding: 0;
590
+ display: flex;
591
+ flex-direction: column;
592
+ z-index: 1;
593
+ }
594
+
595
+ .menu-flutuante.principal {
596
+ left: 3px
597
+ }
598
+
599
+ .menu-flutuante.outros {
600
+ right: 3px
601
+ }
602
+
603
+ .menu-flutuante li {
604
+ transition: background-color 300ms ease-in-out;
605
+ width: 100%;
606
+ cursor: pointer;
607
+ padding: 5px 10px;
608
+ display: flex;
609
+ align-items: center;
610
+ }
611
+
612
+ .menu-flutuante li:hover {
613
+ background-color: #e9e9e9;
614
+ }
615
+
616
+ /* Principal */
617
+ .mensagem__principal {
618
+ width: 100%;
619
+ display: flex;
620
+ justify-content: flex-end;
621
+ }
622
+ .mensagem__principal > .mensagem::after {
623
+ content: "";
624
+ width: 0;
625
+ height: 0;
626
+ position: absolute;
627
+ border-left: 10px solid transparent;
628
+ border-right: 10px solid transparent;
629
+ border-top: 10px solid var(--message-color);
630
+ bottom: 5px;
631
+ right: -10px;
632
+ transform: rotate(-90deg);
633
+ }
634
+ .mensagem__principal > .mensagem {
635
+ background-color: var(--message-color);
636
+ color: var(--text-color);
637
+ }
638
+
639
+ .mensagem__principal > .mensagem .horario-envio {
640
+ color: var(--text-color);
641
+ }
642
+ .mensagem__principal > .mensagem .autor-mensagem {
643
+ right: 5px;
644
+ color: var(--text-color);
645
+ }
646
+ /* Outros */
647
+ .mensagem__outros {
648
+ width: 100%;
649
+ display: flex;
650
+ }
651
+ .mensagem__outros > .mensagem{
652
+ background-color: #FFF;
653
+ color: #333;
654
+ }
655
+ .mensagem__outros > .mensagem::after{
656
+ content: "";
657
+ width: 0;
658
+ height: 0;
659
+ position: absolute;
660
+ border-left: 10px solid transparent;
661
+ border-right: 10px solid transparent;
662
+ border-top: 10px solid #FFF;
663
+ bottom: 5px;
664
+ left: -10px;
665
+ transform: rotate(90deg);
666
+ }
667
+ /* .mensagem__outros .check{
668
+ display: none
669
+ } */
670
+ .mensagem__outros > .autor-mensagem{
671
+ left: 5px;
672
+ color: #333;
673
+ }
674
+ /* Mapa */
675
+ .mensagem-div-mapa {
676
+ width: 100%;
677
+ display: flex;
678
+ justify-content: center;
679
+ align-items: center;
680
+ flex-direction: column;
681
+ margin-bottom: 5px;
682
+ }
683
+
684
+ .msg-mapa {
685
+ width: 100%;
686
+ min-height: 225px;
687
+ height: 100%;
688
+ box-sizing: initial;
689
+ }
690
+ .msg-mapa img {
691
+ max-width: none!important;
692
+ }
693
+
694
+ .info-mapa {
695
+ list-style-type: none;
696
+ }
697
+ .info-mapa li.title {
698
+ font-size: .85em
699
+ }
700
+ .info-mapa li.address, .info-mapa li.url {
701
+ font-size: .85em
702
+ }
703
+ .info-mapa li.url {
704
+ font-size: .85em
705
+ }
706
+
707
+ .tooltip-list {
708
+ margin: 0;
709
+ padding: 0;
710
+ display: flex;
711
+ flex-direction: column;
712
+ justify-content: center;
713
+ align-items: flex-start;
714
+ }
715
+
716
+ </style>