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