vue-intergrall-plugins 1.1.89 → 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.
Files changed (45) hide show
  1. package/README.md +220 -220
  2. package/dist/dist/vue-intergrall-plugins.css +1 -1
  3. package/dist/vue-intergrall-plugins.esm.js +193 -78
  4. package/dist/vue-intergrall-plugins.min.js +7 -7
  5. package/dist/vue-intergrall-plugins.ssr.js +245 -136
  6. package/package.json +61 -61
  7. package/src/lib-components/Buttons/IconButton.vue +27 -27
  8. package/src/lib-components/Buttons/SimpleButton.vue +140 -140
  9. package/src/lib-components/Cards/Card.vue +490 -490
  10. package/src/lib-components/Cards/CardCheck.vue +35 -35
  11. package/src/lib-components/Cards/CardFile.vue +163 -163
  12. package/src/lib-components/Chat/BtnDownloadAllFiles.vue +36 -36
  13. package/src/lib-components/Chat/BtnEmojis.vue +118 -118
  14. package/src/lib-components/Chat/BtnExpand.vue +17 -17
  15. package/src/lib-components/Chat/BtnFiles.vue +486 -486
  16. package/src/lib-components/Chat/BtnMic.vue +60 -60
  17. package/src/lib-components/Chat/BtnScreenShare.vue +31 -31
  18. package/src/lib-components/Chat/BtnStandardMessages.vue +17 -17
  19. package/src/lib-components/Chat/ExpandTextarea.vue +427 -427
  20. package/src/lib-components/Chat/MultipleFilePreview.vue +291 -291
  21. package/src/lib-components/Chat/Picker.vue +525 -525
  22. package/src/lib-components/Chat/RemainingCharacters.vue +28 -28
  23. package/src/lib-components/Chat/SingleFilePreview.vue +94 -94
  24. package/src/lib-components/Chat/SkeletonPicker.vue +110 -110
  25. package/src/lib-components/Chat/StandardMessages.vue +252 -252
  26. package/src/lib-components/Chat/TextFooter.vue +1007 -1007
  27. package/src/lib-components/Email/EmailExpanded.vue +270 -270
  28. package/src/lib-components/Email/EmailFile.vue +192 -192
  29. package/src/lib-components/Email/EmailFrom.vue +66 -66
  30. package/src/lib-components/Email/EmailItem.vue +867 -850
  31. package/src/lib-components/Email/EmailTo.vue +64 -64
  32. package/src/lib-components/Loader/Loader.vue +78 -78
  33. package/src/lib-components/Messages/AnexoMensagem.vue +534 -497
  34. package/src/lib-components/Messages/CardAttachment.vue +61 -61
  35. package/src/lib-components/Messages/CardMessages.vue +687 -687
  36. package/src/lib-components/Messages/InteratividadeBotoes.vue +197 -197
  37. package/src/lib-components/Messages/InteratividadeContato.vue +32 -32
  38. package/src/lib-components/Messages/InteratividadeContatoItem.vue +235 -235
  39. package/src/lib-components/Messages/InteratividadeFormulario.vue +334 -334
  40. package/src/lib-components/Messages/InteratividadePopup.vue +95 -95
  41. package/src/lib-components/Messages/LinkPreview.vue +176 -176
  42. package/src/lib-components/Scroll/ScrollContent.vue +166 -166
  43. package/src/lib-components/Templates/TemplateGenerator.vue +640 -640
  44. package/src/lib-components/Templates/TemplateMessage.vue +83 -83
  45. package/src/lib-components/Templates/TemplateSingle.vue +478 -478
@@ -1,497 +1,534 @@
1
- <template>
2
- <div class="mensagem-div-anexo">
3
- <div class="anexo-mensagem">
4
- <img v-if="imageURL" @click="showImage(imageURL)" :src="imageURL" :alt="dictionary.alt_msg_img" />
5
- <div class="divAudioPai" v-else-if="audio">
6
- <audio ref="audioPlayer" class="audioStyle" controls="controls">
7
- <source :src="docURL" :type="fileType" />
8
- Sem suporte para o elemento audio
9
- </audio>
10
- <audio-speed-control @change-speed="changeAudioSpeed"></audio-speed-control>
11
- </div>
12
-
13
- <video v-else-if="video" controls="controls">
14
- <source :src="docURL" :type="fileType" />
15
- Sem suporte para o elemento video
16
- </video>
17
- <span v-else-if="docURL" @click="openWindowFromURL(docURL)" class="default-doc">
18
- <fa-icon :class="[iconClass]" :icon="icon" />
19
- <p v-text="filename" :title="filename"></p>
20
- </span>
21
- <span v-else class="default-doc">
22
- <fa-icon :class="[iconClass ? iconClass : '']" :icon="['fas', 'file-alt']" />
23
- <p v-text="filename" :title="filename"></p>
24
- </span>
25
-
26
- <!-- Transcricao -->
27
- <div v-if="audio && hasTranscription" class="transcription-controls" @click="emitTranscription">
28
- {{ dictionary.transcricaoControl || 'Transcrever' }}
29
- </div>
30
- <div v-if="audio && transcriptionText" class="transcription-container">
31
- <div class="transcription-header">
32
- <p v-if="!hideTranscription" v-text="`${dictionary.transcricaoLabel ? `${dictionary.transcricaoLabel}:` : ''}`"></p>
33
- <button @click="toggleHideTranscription" class="transcription-button">
34
- <fa-icon :icon="['fas', `caret-${hideTranscription ? 'down' : 'up'}`]" />
35
- </button>
36
- </div>
37
- <div v-if="transcriptionLoading" class="transcription-loader">
38
- <VueLoader />
39
- </div>
40
- <p v-else-if="!hideTranscription" class="transcription-text">{{ transcriptionText }}</p>
41
- </div>
42
-
43
- <!-- Acoes -->
44
- <div v-if="showControlFiles" class="file-actions">
45
- <span v-if="imageURL" class="file-action-button" @click="showImage(imageURL)">
46
- <fa-icon :icon="['fas', 'search-plus']" v-tippy :content="`${dictionary.titulo_visualizar_img}`" />
47
- </span>
48
- <span v-if="docURL" @click="openWindowFromURL(docURL)" v-tippy :content="`Visualizar anexo`"
49
- class="file-action-button">
50
- <fa-icon :icon="['fas', 'search-plus']" />
51
- </span>
52
- <a v-if="imageURL || docURL" :href="imageURL ? imageURL : docURL" :download="`${filename}`" target="_blank"
53
- rel="noreferrer noopener" v-tippy :content="`Fazer o download do anexo`" class="file-action-button">
54
- <fa-icon :icon="['fas', 'download']" />
55
- </a>
56
- <template v-if="imageURL || docURL">
57
- <tippy interactive theme="light" trigger="click">
58
- <template v-slot:trigger>
59
- <span class="file-action-button" ref="download-multiple-trigger" v-tippy
60
- :content="`Fazer o download de todos anexos da conversa`">
61
- <fa-icon :icon="['fas', 'download']" />
62
- <fa-icon :icon="['fas', 'download']" />
63
- <fa-icon :icon="['fas', 'download']" />
64
- </span>
65
- </template>
66
-
67
- <div class="tippy-confirmation">
68
- <p>Deseja fazer download de todos anexos da tela?</p>
69
- <button class="cancel box-shadow" @click="closeTippy">Cancelar</button>
70
- <button class="confirm box-shadow" @click="downloadAllFilesHandler(referenceSelector)">
71
- Confirmar
72
- </button>
73
- </div>
74
- </tippy>
75
- </template>
76
- </div>
77
- </div>
78
- </div>
79
- </template>
80
-
81
- <style>
82
- .transcription-container {
83
- display: flex;
84
- flex-wrap: wrap;
85
- width: 100%;
86
- }
87
-
88
- .transcription-header {
89
- display: flex;
90
- justify-content: flex-end;
91
- align-items: center;
92
- gap: 10px;
93
- width: 100%;
94
- }
95
-
96
- .transcription-header > p {
97
- flex: 1;
98
- }
99
-
100
- .transcription-button {
101
- background-color: transparent;
102
- border: none;
103
- cursor: pointer;
104
- transition: background 150ms ease-in-out;
105
- border-radius: 5px;
106
- display: flex;
107
- justify-content: center;
108
- align-items: center;
109
- }
110
-
111
- .transcription-button:hover {
112
- background: rgba(0, 0, 0, 0.1);
113
- }
114
-
115
- .transcription-controls {
116
- margin-top: 10px;
117
- color: blue;
118
- cursor: pointer;
119
- }
120
-
121
- .transcription-controls:hover {
122
- text-decoration: underline;
123
- }
124
-
125
- .transcription-loader {
126
- position: relative;
127
- height: 30px;
128
- width: 100%;
129
- }
130
-
131
- .transcription-text {
132
- white-space: break-spaces;
133
- color: rgba(0, 0, 0, 0.6);
134
- }
135
-
136
- .tippy-tooltip.light-theme .tippy-backdrop {
137
- background-color: #fff;
138
- }
139
-
140
- .tippy-tooltip.light-theme {
141
- /* .tippy-box[data-theme~='light'] { */
142
- background-color: #fff;
143
- border: 1px solid #ccc;
144
- color: #333;
145
- -webkit-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
146
- 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
147
- -moz-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
148
- 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
149
- box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14),
150
- 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
151
- }
152
-
153
- .tippy-confirmation p {
154
- margin-bottom: 3px;
155
- }
156
-
157
- .tippy-confirmation button {
158
- border: unset;
159
- background-color: #f1f1f1;
160
- border-radius: 3px;
161
- padding: 5px 8px;
162
- cursor: pointer;
163
- font-size: 12px;
164
- }
165
-
166
- .tippy-confirmation button.cancel {
167
- border-bottom: 2px solid red;
168
- margin-right: 15px;
169
- }
170
-
171
- .tippy-confirmation button.confirm {
172
- border-bottom: 2px solid green;
173
- }
174
- </style>
175
-
176
- <script>
177
- import { fileHandler } from "../../mixins/fileHandler";
178
- import AudioSpeedControl from "../Chat/AudioSpeedControl.vue";
179
- import Loader from "../Loader/Loader";
180
-
181
- export default {
182
- mixins: [fileHandler],
183
- components: { Loader, AudioSpeedControl },
184
- props: {
185
- anexo: {
186
- type: Object,
187
- required: true,
188
- },
189
- dominio: {
190
- type: String,
191
- required: true,
192
- },
193
- dictionary: {
194
- type: Object,
195
- required: true,
196
- },
197
- origemExterna: {
198
- type: Boolean,
199
- required: false,
200
- },
201
- referenceSelector: {
202
- type: String,
203
- required: true,
204
- },
205
- showControlFiles: { type: Boolean },
206
- hasTranscription: { type: Boolean, default: false },
207
- transcriptionText: { type: String, default: "" },
208
- transcriptionLoading: { type: Boolean, default: false }
209
- },
210
- data() {
211
- return {
212
- imgErro: false,
213
- imgMsgErro: "",
214
- hideTranscription: false
215
- };
216
- },
217
- mounted() {
218
- if (this.validarAnexo()) {
219
- this.setFileVars(this.anexo, { dominio: this.dominio });
220
- }
221
- },
222
- methods: {
223
- toggleHideTranscription() {
224
- this.hideTranscription = !this.hideTranscription;
225
- },
226
- emitTranscription() {
227
- this.$emit("transcribe-audio", this.anexo);
228
- },
229
- changeAudioSpeed(newSpeed) {
230
- // Aplique a velocidade ao elemento de áudio
231
- this.$refs.audioPlayer.playbackRate = newSpeed;
232
- },
233
- validarAnexo() {
234
- let status = true;
235
- //caso for audio ou documento ignorar
236
- if (this.anexo.docURL || this.anexo.audio) return true;
237
- if (!this.anexo.name) {
238
- this.imgMsgErro = this.dictionary.img_com_erro_nome;
239
- status = false;
240
- }
241
- if (!this.anexo.nomeGravacao) {
242
- this.imgMsgErro = this.dictionary.img_com_erro_nome_gravacao;
243
- status = false;
244
- }
245
- if (!this.anexo.type) {
246
- this.imgMsgErro = this.dictionary.img_com_erro_tipo;
247
- status = false;
248
- }
249
- if (status == false) {
250
- this.imgErro = true;
251
- this.isLoading = false;
252
- }
253
- return status;
254
- },
255
- closeTippy() {
256
- this.$refs["download-multiple-trigger"] &&
257
- this.$refs["download-multiple-trigger"].click();
258
- },
259
- },
260
- };
261
- </script>
262
-
263
- <style>
264
- .mensagem__principal .default-doc {
265
- background-color: var(--files-bg);
266
- }
267
-
268
- .mensagem__principal .default-doc:hover {
269
- background-color: var(--files-bg-hover);
270
- }
271
-
272
- .mensagem__outros .default-doc {
273
- background-color: rgba(100, 100, 100, 0.1);
274
- }
275
-
276
- .mensagem__outros .default-doc:hover {
277
- background-color: rgba(100, 100, 100, 0.3);
278
- }
279
-
280
- .default-doc:hover p {
281
- text-decoration: underline;
282
- }
283
-
284
- .default-doc {
285
- display: flex;
286
- align-items: center;
287
- padding: 10px;
288
- border-radius: 5px;
289
- width: 100%;
290
- max-width: 100%;
291
- cursor: pointer;
292
- transition: background-color 150ms ease-in-out;
293
- }
294
-
295
- .default-doc svg {
296
- font-size: 19.2px;
297
- margin: 0 5px;
298
- }
299
-
300
- .default-doc p {
301
- overflow: hidden;
302
- text-overflow: ellipsis;
303
- white-space: nowrap;
304
- }
305
-
306
- .file-actions {
307
- display: flex;
308
- justify-content: flex-end;
309
- width: 100%;
310
- padding: 5px;
311
- }
312
-
313
- .file-actions a {
314
- margin-right: 0;
315
- }
316
-
317
- .mensagem__principal .file-action-button {
318
- background-color: var(--files-bg);
319
- }
320
-
321
- .mensagem__outros .file-action-button {
322
- background-color: rgba(100, 100, 100, 0.1);
323
- }
324
-
325
- .mensagem__principal .file-action-button:hover {
326
- background-color: var(--files-bg-hover);
327
- }
328
-
329
- .mensagem__outros .file-action-button:hover {
330
- background-color: rgba(100, 100, 100, 0.3);
331
- }
332
-
333
- .file-action-button {
334
- display: flex;
335
- justify-content: center;
336
- align-items: center;
337
- margin-left: 12px;
338
- cursor: pointer;
339
- padding: 5px;
340
- border-radius: 5px;
341
- transition: background-color 150ms ease-in-out;
342
- }
343
-
344
- .file-action-button a {
345
- margin: 0;
346
- }
347
-
348
- .fade-enter-active,
349
- .fade-leave-active {
350
- transition: opacity 0.5s;
351
- }
352
-
353
- .fade-enter,
354
- .fade-leave-to {
355
- opacity: 0;
356
- }
357
-
358
- .mensagem-div-anexo {
359
- width: 100%;
360
- display: flex;
361
- justify-content: center;
362
- align-items: center;
363
- flex-direction: column;
364
- overflow: hidden;
365
- }
366
-
367
- .anexo-container {
368
- width: 100%;
369
- margin-top: 5px;
370
- overflow: hidden;
371
- display: flex;
372
- max-height: 300px;
373
- }
374
-
375
- .anexo-container a,
376
- .anexo-container .arquivo-erro {
377
- padding: 10px 15px 15px 15px;
378
- display: flex;
379
- justify-content: center;
380
- align-items: center;
381
- }
382
-
383
- .anexo-container p {
384
- text-overflow: ellipsis;
385
- overflow: hidden;
386
- }
387
-
388
- .anexo-container p,
389
- .anexo-container .arquivo-erro {
390
- margin: 0;
391
- margin-left: 15px;
392
- font-size: 14.4px;
393
- }
394
-
395
- .anexo-container svg {
396
- font-size: 32px;
397
- }
398
-
399
- .anexo-mensagem audio .divAudioPai {
400
- outline: none;
401
- width: 100%;
402
- margin-bottom: 5px;
403
- }
404
-
405
- .audioStyle {
406
- width: 370px;
407
- min-width: calc(100% - 45px);
408
- }
409
-
410
- .divAudioPai {
411
- display: flex;
412
- /* justify-content: space-between; */
413
- background-color: #f1f3f4;
414
- border-radius: 50%;
415
- width: 100%;
416
- border-bottom-right-radius: 26px;
417
- border-top-right-radius: 26px;
418
- }
419
-
420
- .anexo-mensagem video {
421
- flex: 1;
422
- width: 100%;
423
- max-width: 350px;
424
- cursor: pointer;
425
- margin-bottom: 5px;
426
- }
427
-
428
- .anexos-links-container {
429
- width: 100%;
430
- display: flex;
431
- justify-content: center;
432
- align-items: center;
433
- }
434
-
435
- .anexos-links-container a {
436
- white-space: nowrap;
437
- text-overflow: ellipsis;
438
- overflow: hidden;
439
- margin-right: 5px;
440
- font-weight: 550;
441
- color: inherit;
442
- text-decoration: none;
443
- }
444
-
445
- .anexos-links-container svg {
446
- cursor: pointer;
447
- }
448
-
449
- .mensagem-div-anexo img {
450
- cursor: pointer;
451
- margin: 10px 0;
452
- min-width: 35px;
453
- width: 100%;
454
- max-width: 250px;
455
- }
456
-
457
- .anexo-transition {
458
- width: 100%;
459
- height: 100%;
460
- }
461
-
462
- .anexo-mensagem {
463
- display: flex;
464
- justify-content: center;
465
- align-items: center;
466
- flex-direction: column;
467
- width: 100%;
468
- }
469
-
470
- .alert-danger {
471
- color: #721c24;
472
- background-color: #f8d7da;
473
- border-color: #f5c6cb;
474
- }
475
-
476
- .alert {
477
- position: relative;
478
- padding: 10.4px 19.2px;
479
- margin: 5px 0;
480
- border: 1px solid transparent;
481
- border-radius: 4px;
482
- text-align: center;
483
- }
484
-
485
- .alert svg {
486
- font-size: 16.4px;
487
- margin-right: 2px;
488
- }
489
-
490
- .pdf {
491
- color: #e74c3c;
492
- }
493
-
494
- .doc {
495
- color: #006bc9;
496
- }
497
- </style>
1
+ <template>
2
+ <div class="mensagem-div-anexo">
3
+ <div class="anexo-mensagem">
4
+ <span v-if="fileAccessError" class="default-doc file-unavailable"
5
+ :title="dictionary.arquivo_indisponivel || 'Arquivo indisponível ou foi removido'">
6
+ <fa-icon :icon="['fas', 'exclamation-triangle']" />
7
+ <p>{{ filename || dictionary.arquivo_sem_nome || 'Arquivo sem nome' }}</p>
8
+ </span>
9
+
10
+ <template v-else>
11
+ <img v-if="imageURL" @click="showImage(imageURL)" :src="imageURL" :alt="dictionary.alt_msg_img" />
12
+ <div class="divAudioPai" v-else-if="audio">
13
+ <audio ref="audioPlayer" class="audioStyle" controls="controls">
14
+ <source :src="docURL" :type="fileType" />
15
+ Sem suporte para o elemento audio
16
+ </audio>
17
+ <audio-speed-control @change-speed="changeAudioSpeed"></audio-speed-control>
18
+ </div>
19
+
20
+ <video v-else-if="video" controls="controls">
21
+ <source :src="docURL" :type="fileType" />
22
+ Sem suporte para o elemento video
23
+ </video>
24
+ <span v-else-if="docURL" @click="openWindowFromURL(docURL)" class="default-doc">
25
+ <fa-icon :class="[iconClass]" :icon="icon" />
26
+ <p v-text="filename" :title="filename"></p>
27
+ </span>
28
+ <span v-else class="default-doc">
29
+ <fa-icon :class="[iconClass ? iconClass : '']" :icon="['fas', 'file-alt']" />
30
+ <p v-text="filename" :title="filename"></p>
31
+ </span>
32
+
33
+ <!-- Transcricao -->
34
+ <div v-if="audio && hasTranscription" class="transcription-controls" @click="emitTranscription">
35
+ {{ dictionary.transcricaoControl || 'Transcrever' }}
36
+ </div>
37
+ <div v-if="audio && transcriptionText" class="transcription-container">
38
+ <div class="transcription-header">
39
+ <p v-if="!hideTranscription" v-text="`${dictionary.transcricaoLabel ? `${dictionary.transcricaoLabel}:` : ''}`"></p>
40
+ <button @click="toggleHideTranscription" class="transcription-button">
41
+ <fa-icon :icon="['fas', `caret-${hideTranscription ? 'down' : 'up'}`]" />
42
+ </button>
43
+ </div>
44
+ <div v-if="transcriptionLoading" class="transcription-loader">
45
+ <VueLoader />
46
+ </div>
47
+ <p v-else-if="!hideTranscription" class="transcription-text">{{ transcriptionText }}</p>
48
+ </div>
49
+
50
+ <!-- Acoes -->
51
+ <div v-if="showControlFiles" class="file-actions">
52
+ <span v-if="imageURL" lass="file-action-button" @click="showImage(imageURL)">
53
+ <fa-icon :icon="['fas', 'search-plus']" v-tippy :content="`${dictionary.titulo_visualizar_img}`" />
54
+ </span>
55
+ <span v-if="docURL" @click="openWindowFromURL(docURL)" v-tippy :content="`Visualizar anexo`"
56
+ class="file-action-button">
57
+ <fa-icon :icon="['fas', 'search-plus']" />
58
+ </span>
59
+ <a v-if="imageURL || docURL" :href="imageURL ? imageURL : docURL" :download="`${filename}`" target="_blank"
60
+ rel="noreferrer noopener" v-tippy :content="`Fazer o download do anexo`" class="file-action-button">
61
+ <fa-icon :icon="['fas', 'download']" />
62
+ </a>
63
+ <template v-if="imageURL || docURL">
64
+ <tippy interactive theme="light" trigger="click">
65
+ <template v-slot:trigger>
66
+ <span class="file-action-button" ref="download-multiple-trigger" v-tippy
67
+ :content="`Fazer o download de todos anexos da conversa`">
68
+ <fa-icon :icon="['fas', 'download']" />
69
+ <fa-icon :icon="['fas', 'download']" />
70
+ <fa-icon :icon="['fas', 'download']" />
71
+ </span>
72
+ </template>
73
+
74
+ <div class="tippy-confirmation">
75
+ <p>Deseja fazer download de todos anexos da tela?</p>
76
+ <button class="cancel box-shadow" @click="closeTippy">Cancelar</button>
77
+ <button class="confirm box-shadow" @click="downloadAllFilesHandler(referenceSelector)">
78
+ Confirmar
79
+ </button>
80
+ </div>
81
+ </tippy>
82
+ </template>
83
+ </div>
84
+ </template>
85
+ </div>
86
+ </div>
87
+ </template>
88
+
89
+ <style>
90
+ .transcription-container {
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ width: 100%;
94
+ }
95
+
96
+ .transcription-header {
97
+ display: flex;
98
+ justify-content: flex-end;
99
+ align-items: center;
100
+ gap: 10px;
101
+ width: 100%;
102
+ }
103
+
104
+ .transcription-header > p {
105
+ flex: 1;
106
+ }
107
+
108
+ .transcription-button {
109
+ background-color: transparent;
110
+ border: none;
111
+ cursor: pointer;
112
+ transition: background 150ms ease-in-out;
113
+ border-radius: 5px;
114
+ display: flex;
115
+ justify-content: center;
116
+ align-items: center;
117
+ }
118
+
119
+ .transcription-button:hover {
120
+ background: rgba(0, 0, 0, 0.1);
121
+ }
122
+
123
+ .transcription-controls {
124
+ margin-top: 10px;
125
+ color: blue;
126
+ cursor: pointer;
127
+ }
128
+
129
+ .transcription-controls:hover {
130
+ text-decoration: underline;
131
+ }
132
+
133
+ .transcription-loader {
134
+ position: relative;
135
+ height: 30px;
136
+ width: 100%;
137
+ }
138
+
139
+ .transcription-text {
140
+ white-space: break-spaces;
141
+ color: rgba(0, 0, 0, 0.6);
142
+ }
143
+
144
+ .tippy-tooltip.light-theme .tippy-backdrop {
145
+ background-color: #fff;
146
+ }
147
+
148
+ .tippy-tooltip.light-theme {
149
+ /* .tippy-box[data-theme~='light'] { */
150
+ background-color: #fff;
151
+ border: 1px solid #ccc;
152
+ color: #333;
153
+ -webkit-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
154
+ 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
155
+ -moz-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
156
+ 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
157
+ box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14),
158
+ 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
159
+ }
160
+
161
+ .tippy-confirmation p {
162
+ margin-bottom: 3px;
163
+ }
164
+
165
+ .tippy-confirmation button {
166
+ border: unset;
167
+ background-color: #f1f1f1;
168
+ border-radius: 3px;
169
+ padding: 5px 8px;
170
+ cursor: pointer;
171
+ font-size: 12px;
172
+ }
173
+
174
+ .tippy-confirmation button.cancel {
175
+ border-bottom: 2px solid red;
176
+ margin-right: 15px;
177
+ }
178
+
179
+ .tippy-confirmation button.confirm {
180
+ border-bottom: 2px solid green;
181
+ }
182
+ </style>
183
+
184
+ <script>
185
+ import { fileHandler } from "../../mixins/fileHandler";
186
+ import AudioSpeedControl from "../Chat/AudioSpeedControl.vue";
187
+ import Loader from "../Loader/Loader";
188
+
189
+ export default {
190
+ mixins: [fileHandler],
191
+ components: { Loader, AudioSpeedControl },
192
+ props: {
193
+ anexo: {
194
+ type: Object,
195
+ required: true,
196
+ },
197
+ dominio: {
198
+ type: String,
199
+ required: true,
200
+ },
201
+ dictionary: {
202
+ type: Object,
203
+ required: true,
204
+ },
205
+ origemExterna: {
206
+ type: Boolean,
207
+ required: false,
208
+ },
209
+ referenceSelector: {
210
+ type: String,
211
+ required: true,
212
+ },
213
+ showControlFiles: { type: Boolean },
214
+ hasTranscription: { type: Boolean, default: false },
215
+ transcriptionText: { type: String, default: "" },
216
+ transcriptionLoading: { type: Boolean, default: false }
217
+ },
218
+ data() {
219
+ return {
220
+ imgErro: false,
221
+ imgMsgErro: "",
222
+ fileAccessError: false,
223
+ };
224
+ },
225
+ mounted() {
226
+ if (this.validarAnexo()) {
227
+ this.setFileVars(this.anexo, { dominio: this.dominio });
228
+
229
+ this.$nextTick(() => {
230
+ const hasValidFile = this.imageURL || this.docURL || this.audio || this.video;
231
+ if (!hasValidFile) {
232
+ this.fileAccessError = true;
233
+ }
234
+ });
235
+ }
236
+ },
237
+ methods: {
238
+ toggleHideTranscription() {
239
+ this.hideTranscription = !this.hideTranscription;
240
+ },
241
+ emitTranscription() {
242
+ this.$emit("transcribe-audio", this.anexo);
243
+ },
244
+ changeAudioSpeed(newSpeed) {
245
+ // Aplique a velocidade ao elemento de áudio
246
+ this.$refs.audioPlayer.playbackRate = newSpeed;
247
+ },
248
+ validarAnexo() {
249
+ let status = true;
250
+ //caso for audio ou documento ignorar
251
+ if (this.anexo.docURL || this.anexo.audio) return true;
252
+ if (!this.anexo.name) {
253
+ this.imgMsgErro = this.dictionary.img_com_erro_nome;
254
+ status = false;
255
+ }
256
+ if (!this.anexo.nomeGravacao) {
257
+ this.imgMsgErro = this.dictionary.img_com_erro_nome_gravacao;
258
+ status = false;
259
+ }
260
+ if (!this.anexo.type) {
261
+ this.imgMsgErro = this.dictionary.img_com_erro_tipo;
262
+ status = false;
263
+ }
264
+ if (status == false) {
265
+ this.imgErro = true;
266
+ this.isLoading = false;
267
+ }
268
+ return status;
269
+ },
270
+ closeTippy() {
271
+ this.$refs["download-multiple-trigger"] &&
272
+ this.$refs["download-multiple-trigger"].click();
273
+ },
274
+ },
275
+ };
276
+ </script>
277
+
278
+ <style>
279
+ .mensagem__principal .default-doc {
280
+ background-color: var(--files-bg);
281
+ }
282
+
283
+ .mensagem__principal .default-doc:hover {
284
+ background-color: var(--files-bg-hover);
285
+ }
286
+
287
+ .mensagem__outros .default-doc {
288
+ background-color: rgba(100, 100, 100, 0.1);
289
+ }
290
+
291
+ .mensagem__outros .default-doc:hover {
292
+ background-color: rgba(100, 100, 100, 0.3);
293
+ }
294
+
295
+ .default-doc:hover p {
296
+ text-decoration: underline;
297
+ }
298
+
299
+ .default-doc {
300
+ display: flex;
301
+ align-items: center;
302
+ padding: 10px;
303
+ border-radius: 5px;
304
+ width: 100%;
305
+ max-width: 100%;
306
+ cursor: pointer;
307
+ transition: background-color 150ms ease-in-out;
308
+ }
309
+
310
+ .default-doc svg {
311
+ font-size: 19.2px;
312
+ margin: 0 5px;
313
+ }
314
+
315
+ .default-doc p {
316
+ overflow: hidden;
317
+ text-overflow: ellipsis;
318
+ white-space: nowrap;
319
+ }
320
+
321
+ .file-actions {
322
+ display: flex;
323
+ justify-content: flex-end;
324
+ width: 100%;
325
+ padding: 5px;
326
+ }
327
+
328
+ .file-actions a {
329
+ margin-right: 0;
330
+ }
331
+
332
+ .mensagem__principal .file-action-button {
333
+ background-color: var(--files-bg);
334
+ }
335
+
336
+ .mensagem__outros .file-action-button {
337
+ background-color: rgba(100, 100, 100, 0.1);
338
+ }
339
+
340
+ .mensagem__principal .file-action-button:hover {
341
+ background-color: var(--files-bg-hover);
342
+ }
343
+
344
+ .mensagem__outros .file-action-button:hover {
345
+ background-color: rgba(100, 100, 100, 0.3);
346
+ }
347
+
348
+ .file-action-button {
349
+ display: flex;
350
+ justify-content: center;
351
+ align-items: center;
352
+ margin-left: 12px;
353
+ cursor: pointer;
354
+ padding: 5px;
355
+ border-radius: 5px;
356
+ transition: background-color 150ms ease-in-out;
357
+ }
358
+
359
+ .file-action-button a {
360
+ margin: 0;
361
+ }
362
+
363
+ .fade-enter-active,
364
+ .fade-leave-active {
365
+ transition: opacity 0.5s;
366
+ }
367
+
368
+ .fade-enter,
369
+ .fade-leave-to {
370
+ opacity: 0;
371
+ }
372
+
373
+ .mensagem-div-anexo {
374
+ width: 100%;
375
+ display: flex;
376
+ justify-content: center;
377
+ align-items: center;
378
+ flex-direction: column;
379
+ overflow: hidden;
380
+ }
381
+
382
+ .anexo-container {
383
+ width: 100%;
384
+ margin-top: 5px;
385
+ overflow: hidden;
386
+ display: flex;
387
+ max-height: 300px;
388
+ }
389
+
390
+ .anexo-container a,
391
+ .anexo-container .arquivo-erro {
392
+ padding: 10px 15px 15px 15px;
393
+ display: flex;
394
+ justify-content: center;
395
+ align-items: center;
396
+ }
397
+
398
+ .anexo-container p {
399
+ text-overflow: ellipsis;
400
+ overflow: hidden;
401
+ }
402
+
403
+ .anexo-container p,
404
+ .anexo-container .arquivo-erro {
405
+ margin: 0;
406
+ margin-left: 15px;
407
+ font-size: 14.4px;
408
+ }
409
+
410
+ .anexo-container svg {
411
+ font-size: 32px;
412
+ }
413
+
414
+ .anexo-mensagem audio .divAudioPai {
415
+ outline: none;
416
+ width: 100%;
417
+ margin-bottom: 5px;
418
+ }
419
+
420
+ .audioStyle {
421
+ width: 370px;
422
+ min-width: calc(100% - 45px);
423
+ }
424
+
425
+ .divAudioPai {
426
+ display: flex;
427
+ /* justify-content: space-between; */
428
+ background-color: #f1f3f4;
429
+ border-radius: 50%;
430
+ width: 100%;
431
+ border-bottom-right-radius: 26px;
432
+ border-top-right-radius: 26px;
433
+ }
434
+
435
+ .anexo-mensagem video {
436
+ flex: 1;
437
+ width: 100%;
438
+ max-width: 350px;
439
+ cursor: pointer;
440
+ margin-bottom: 5px;
441
+ }
442
+
443
+ .anexos-links-container {
444
+ width: 100%;
445
+ display: flex;
446
+ justify-content: center;
447
+ align-items: center;
448
+ }
449
+
450
+ .anexos-links-container a {
451
+ white-space: nowrap;
452
+ text-overflow: ellipsis;
453
+ overflow: hidden;
454
+ margin-right: 5px;
455
+ font-weight: 550;
456
+ color: inherit;
457
+ text-decoration: none;
458
+ }
459
+
460
+ .anexos-links-container svg {
461
+ cursor: pointer;
462
+ }
463
+
464
+ .mensagem-div-anexo img {
465
+ cursor: pointer;
466
+ margin: 10px 0;
467
+ min-width: 35px;
468
+ width: 100%;
469
+ max-width: 250px;
470
+ }
471
+
472
+ .anexo-transition {
473
+ width: 100%;
474
+ height: 100%;
475
+ }
476
+
477
+ .anexo-mensagem {
478
+ display: flex;
479
+ justify-content: center;
480
+ align-items: center;
481
+ flex-direction: column;
482
+ width: 100%;
483
+ }
484
+
485
+ .alert-danger {
486
+ color: #721c24;
487
+ background-color: #f8d7da;
488
+ border-color: #f5c6cb;
489
+ }
490
+
491
+ .alert {
492
+ position: relative;
493
+ padding: 10.4px 19.2px;
494
+ margin: 5px 0;
495
+ border: 1px solid transparent;
496
+ border-radius: 4px;
497
+ text-align: center;
498
+ }
499
+
500
+ .alert svg {
501
+ font-size: 16.4px;
502
+ margin-right: 2px;
503
+ }
504
+
505
+ .pdf {
506
+ color: #e74c3c;
507
+ }
508
+
509
+ .doc {
510
+ color: #006bc9;
511
+ }
512
+
513
+ .file-unavailable {
514
+ opacity: 0.6;
515
+ cursor: not-allowed;
516
+ border: 1px dashed rgba(255, 0, 0, 0.3);
517
+ pointer-events: none;
518
+ background-color: rgba(255, 0, 0, 0.05);
519
+ }
520
+
521
+ .file-unavailable:hover {
522
+ background-color: rgba(255, 0, 0, 0.05);
523
+ }
524
+
525
+ .file-unavailable svg {
526
+ color: #e74c3c;
527
+ font-size: 24px;
528
+ }
529
+
530
+ .file-unavailable p {
531
+ color: rgba(0, 0, 0, 0.5);
532
+ text-decoration: line-through;
533
+ }
534
+ </style>