vue-intergrall-plugins 1.1.90 → 1.2.18

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