vue-intergrall-plugins 0.0.1085 → 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,666 @@
1
+ <template>
2
+ <div
3
+ :class="{
4
+ 'card-cli': origem === 'outros',
5
+ 'card-ope': origem === 'principal',
6
+ msgNova: msgNova,
7
+ }"
8
+ v-if="origem"
9
+ :id="`a${messageIndex ? messageIndex : randomizeValue}`"
10
+ >
11
+ <transition name="fade">
12
+ <span v-if="msgNova" class="novas-mensagens"> Nova mensagem </span>
13
+ </transition>
14
+ <div class="card box-shadow">
15
+ <div class="card-header">
16
+ <div class="card-autor">
17
+ <fa-icon :icon="iconAutor" />
18
+ <p
19
+ class="text-bold"
20
+ v-if="autor"
21
+ v-text="`${tratarTextoLongo(autor)}`"
22
+ :title="autor"
23
+ ></p>
24
+ <p
25
+ v-if="origem === 'principal' && autor && login"
26
+ v-text="returnLoginText"
27
+ :title="returnLoginText"
28
+ ></p>
29
+ </div>
30
+ <div class="card-right">
31
+ <div class="card-datas">
32
+ <div
33
+ v-if="data_cri"
34
+ class="card-data"
35
+ :title="`${dictionary.data_criacao}: ${
36
+ origem === 'outros'
37
+ ? formataTimezoneData(data_cri)
38
+ : returnFormataDataHora(data_cri)
39
+ }`"
40
+ >
41
+ <span
42
+ v-text="
43
+ origem === 'outros'
44
+ ? formataTimezoneData(data_cri)
45
+ : returnFormataDataHora(data_cri)
46
+ "
47
+ ></span>
48
+ </div>
49
+ <div
50
+ v-if="data_mod"
51
+ class="card-data"
52
+ :title="`${dictionary.data_mod}: ${
53
+ origem === 'outros'
54
+ ? formataTimezoneData(data_mod)
55
+ : returnFormataDataHora(data_mod)
56
+ }`"
57
+ >
58
+ <span
59
+ v-text="
60
+ origem === 'outros'
61
+ ? formataTimezoneData(data_mod)
62
+ : returnFormataDataHora(data_mod)
63
+ "
64
+ ></span>
65
+ </div>
66
+ </div>
67
+ <div class="card-expand" @click="expandirCard()" v-if="hasExpand">
68
+ <fa-icon :icon="['fas', 'expand-alt']" />
69
+ </div>
70
+ </div>
71
+ </div>
72
+ <div class="card-chip-container">
73
+ <p
74
+ class="card-chip"
75
+ :class="[ticketClassCod]"
76
+ v-if="ticket_id.cod && ticket_id.desc"
77
+ v-text="`${ticket_id.desc} (${ticket_id.cod})`"
78
+ :title="`${ticket_id.desc} (${ticket_id.cod})`"
79
+ ></p>
80
+ <p
81
+ v-if="ticket_id.hasOwnProperty('back_doing_business')"
82
+ :class="`${ticket_id.back_doing_business ? 'green' : 'red'} card-chip`"
83
+ :title="`${dictionary.title_voltaria_fazer_negocio} ${
84
+ ticket_id.back_doing_business
85
+ ? `${dictionary.title_sim}`
86
+ : `${dictionary.title_nao}`
87
+ }`"
88
+ v-text="
89
+ `${dictionary.title_voltaria_fazer_negocio} ${
90
+ ticket_id.back_doing_business
91
+ ? `${dictionary.title_sim}`
92
+ : `${dictionary.title_nao}`
93
+ }`
94
+ "
95
+ ></p>
96
+ <p
97
+ v-if="ticket_id.hasOwnProperty('rating')"
98
+ :class="`${isNumberBiggerThanSix ? 'green' : 'red'} card-chip`"
99
+ :title="`${dictionary.title_avaliacao} ${ticket_id.rating}`"
100
+ v-text="`${dictionary.title_avaliacao} ${ticket_id.rating}`"
101
+ ></p>
102
+ <p
103
+ v-if="ticket_id.hasOwnProperty('resolved_issue')"
104
+ :class="`${ticket_id.resolved_issue ? 'green' : 'red'} card-chip`"
105
+ :title="`${dictionary.title_problema_resolvido} ${
106
+ ticket_id.resolved_issue
107
+ ? `${dictionary.title_sim}`
108
+ : `${dictionary.title_nao}`
109
+ }`"
110
+ v-text="
111
+ `${dictionary.title_problema_resolvido} ${
112
+ ticket_id.resolved_issue
113
+ ? `${dictionary.title_sim}`
114
+ : `${dictionary.title_nao}`
115
+ }`
116
+ "
117
+ ></p>
118
+ </div>
119
+ <p class="card-message" v-html="mensagemFormatada"></p>
120
+ <div
121
+ class="card-interatividade"
122
+ v-if="filteredInteratividadeData && filteredInteratividadeData.length"
123
+ >
124
+ <p class="card-interatividade-title">{{ dictionary.ra_infos_interatividade }}:</p>
125
+ <ul class="card-interatividade-list">
126
+ <li v-for="(values, index) in filteredInteratividadeData" :key="index">
127
+ <p v-for="(value, key) in values" :key="key">
128
+ <span
129
+ v-if="key.indexOf(dictionary.ra_ask_avaliation_title) <= -1"
130
+ v-html="formatInteratividadeValue(key, value)"
131
+ ></span>
132
+ <span v-else>
133
+ <strong v-text="`${key}:`"></strong>
134
+ <button
135
+ @click="sendLink(filteredInteratividadeData[index])"
136
+ class="box-shadow"
137
+ v-text="value"
138
+ ></button>
139
+ </span>
140
+ </p>
141
+ <hr />
142
+ </li>
143
+ </ul>
144
+ </div>
145
+ <div class="card-footer" v-if="anexos && anexos.length">
146
+ <div class="card-anexo" v-for="(anexo, index) in anexos" :key="`${index}`">
147
+ <CardAttachment :anexo="anexo" :dictionary="dictionary" :dominio="dominio" />
148
+ </div>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ </template>
153
+
154
+ <script>
155
+ import { textoLongo } from "@/mixins/formatarTexto";
156
+ import { formataTimezoneData, formataDataHora } from "../../services/textFormatting";
157
+ import CardAttachment from "./CardAttachment";
158
+
159
+ export default {
160
+ components: { CardAttachment },
161
+ props: {
162
+ dictionary: {
163
+ type: Object,
164
+ required: true,
165
+ },
166
+ messageIndex: {
167
+ type: [Number, String],
168
+ required: true,
169
+ },
170
+ dominio: {
171
+ type: String,
172
+ required: true,
173
+ },
174
+ hasExpand: {
175
+ type: Boolean,
176
+ required: false,
177
+ default: true,
178
+ },
179
+ origem: {
180
+ type: String,
181
+ required: true,
182
+ },
183
+ autor: {
184
+ type: String,
185
+ },
186
+ login: {
187
+ type: String,
188
+ },
189
+ mensagem: {
190
+ type: String,
191
+ },
192
+ anexos: {
193
+ type: Array,
194
+ },
195
+ data_cri: {
196
+ type: String,
197
+ },
198
+ data_mod: {
199
+ type: String,
200
+ },
201
+ ticket_id: {
202
+ type: Object,
203
+ },
204
+ ticket_name: {
205
+ type: String,
206
+ },
207
+ msgNova: {
208
+ type: Boolean,
209
+ },
210
+ origemExterna: {
211
+ type: String,
212
+ },
213
+ interatividade: {
214
+ type: Array,
215
+ required: false,
216
+ default: () => [],
217
+ },
218
+ },
219
+ mixins: [textoLongo],
220
+ computed: {
221
+ randomizeValue() {
222
+ return `${Math.floor(Math.random() * 7770)}${Date.now()}`;
223
+ },
224
+ mensagemFormatada() {
225
+ if (this.mensagem) {
226
+ const regex = /(\n|&nbsp;)/g;
227
+ if (regex.test(this.mensagem)) return this.mensagem.replace(regex, "<br>");
228
+ }
229
+ return this.mensagem;
230
+ },
231
+ iconAutor() {
232
+ return this.origem === "outros" ? ["fas", "user"] : ["fas", "headset"];
233
+ },
234
+ returnLoginText() {
235
+ if (!this.login) return "";
236
+ if (this.autor) return ` (${this.login})`;
237
+ return `${this.login}`;
238
+ },
239
+ ticketClassCod() {
240
+ if (!this.ticket_id || !this.ticket_id.cod) return "";
241
+ const { cod } = this.ticket_id;
242
+ switch (cod) {
243
+ case 17:
244
+ case "17":
245
+ case 9:
246
+ case "9":
247
+ case 8:
248
+ case "8":
249
+ return "red";
250
+ case 3:
251
+ case "3":
252
+ case 6:
253
+ case "6":
254
+ return "yellow";
255
+ default:
256
+ return "";
257
+ }
258
+ },
259
+ isNumberBiggerThanSix() {
260
+ if (!this.ticket_id || !this.ticket_id.rating) return false;
261
+ try {
262
+ return parseInt(this.ticket_id.rating) > 6;
263
+ } catch (err) {
264
+ return false;
265
+ }
266
+ },
267
+ filteredInteratividadeData() {
268
+ if (!this.interatividade || !this.interatividade.length) return [];
269
+ const finalData = [];
270
+ const validKeys = [
271
+ "name",
272
+ "value",
273
+ // "ticket_detail_id",
274
+ // "ticket_detail_type_id",
275
+ // "creation_date",
276
+ // "modification_date",
277
+ ];
278
+ const validIds = [7];
279
+ this.interatividade.forEach((values) => {
280
+ if (validIds.includes(values.ticket_detail_type_id)) {
281
+ const currentKeys = Object.keys(values);
282
+ const formattedValues = {};
283
+ if (values.name && values.value) {
284
+ formattedValues[values.name] = values.value;
285
+ }
286
+ currentKeys.forEach((key) => {
287
+ if (validKeys.includes(key)) {
288
+ let formattedKey = "";
289
+ // if (key === "ticket_detail_id") {
290
+ // formattedKey = this.dictionary.ra_ticket_detail_id_title;
291
+ // } else if (key === "ticket_detail_type_id") {
292
+ // formattedKey = this.dictionary.ra_ticket_detail_type_id_title;
293
+ // } else if (key === "creation_date") {
294
+ // formattedKey = this.dictionary.ra_creation_date_title;
295
+ // } else if (key === "modification_date") {
296
+ // formattedKey = this.dictionary.ra_creation_modification_title;
297
+ // }
298
+ if (formattedKey) {
299
+ formattedValues[formattedKey] = values[key];
300
+ }
301
+ }
302
+ });
303
+ if (values.ticket_detail_type_id === 25) {
304
+ formattedValues[
305
+ this.dictionary.ra_ask_avaliation_title
306
+ ] = this.dictionary.ra_ask_avaliation_text;
307
+ }
308
+ finalData.push(formattedValues);
309
+ }
310
+ });
311
+
312
+ return finalData;
313
+ },
314
+ },
315
+ methods: {
316
+ formataTimezoneData(timezoneData) {
317
+ return formataTimezoneData(timezoneData);
318
+ },
319
+ returnFormataDataHora(dataHora) {
320
+ return formataDataHora(dataHora, false, false, this.dictionary);
321
+ },
322
+ expandirCard() {
323
+ this.$emit("expand-card", this.$props);
324
+ // this.$store.dispatch("informacoesCardExpandido", this.$props)
325
+ // this.$store.dispatch("toggleBlocker", { state: true, origin: "expandir-card-reclamacao"})
326
+ },
327
+ formatInteratividadeValue(key, value) {
328
+ const regexISO8601 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/;
329
+ if (regexISO8601.test(value)) {
330
+ const data = new Date(value);
331
+ const dia = String(data.getDate()).padStart(2, "0");
332
+ const mes = String(data.getMonth() + 1).padStart(2, "0");
333
+ const ano = data.getFullYear();
334
+ const horas = String(data.getHours()).padStart(2, "0");
335
+ const minutos = String(data.getMinutes()).padStart(2, "0");
336
+
337
+ value = `${dia}/${mes}/${ano} ${horas}:${minutos}`;
338
+ }
339
+ return `<strong>${key}:</strong> ${value || "---"}`;
340
+ },
341
+ sendLink(obj) {
342
+ this.$emit("send-avaliation-link", obj);
343
+ },
344
+ },
345
+ };
346
+ </script>
347
+
348
+ <style scoped>
349
+ .fade-enter-active,
350
+ .fade-leave-active {
351
+ transition: opacity 200ms;
352
+ }
353
+ .fade-enter,
354
+ .fade-leave-to {
355
+ opacity: 0;
356
+ }
357
+
358
+ .card-cli,
359
+ .card-ope {
360
+ display: flex;
361
+ width: 95%;
362
+ margin: 5px 0;
363
+ position: relative;
364
+ }
365
+ .card-cli.msgNova,
366
+ .card-ope.msgNova {
367
+ margin-top: 30px;
368
+ }
369
+
370
+ .novas-mensagens {
371
+ position: absolute;
372
+ top: -30px;
373
+ width: 100%;
374
+ display: flex;
375
+ justify-content: center;
376
+ align-items: center;
377
+ margin: 2.5px 0;
378
+ background-color: lighten(#fff249, 15);
379
+ }
380
+
381
+ .card-cli .card {
382
+ border-left: 3px solid #90b823;
383
+ }
384
+
385
+ .card-ope {
386
+ align-self: flex-end;
387
+ background-color: lighten(#007535, 72);
388
+ }
389
+ .card-ope .card {
390
+ border-right: 3px solid #007535;
391
+ }
392
+
393
+ .card {
394
+ background-color: rgba(255, 255, 255, 0.9);
395
+ overflow: hidden;
396
+ width: 100%;
397
+ padding: 2.5px 5px;
398
+ border-radius: 7px;
399
+ box-shadow: rgba(0, 0, 0, 0.15) 1px 2px 3px 0px;
400
+ }
401
+ .card p {
402
+ word-break: break-all;
403
+ }
404
+
405
+ .card-header {
406
+ width: 100%;
407
+ border-bottom: 1px solid #ddd;
408
+ margin-bottom: 5px;
409
+ display: flex;
410
+ justify-content: space-between;
411
+ padding: 10px 5px;
412
+ }
413
+ .card-header svg {
414
+ font-size: 16px;
415
+ }
416
+
417
+ .card-canal {
418
+ flex: 1;
419
+ margin-right: 10px;
420
+ }
421
+
422
+ .card-datas {
423
+ display: flex;
424
+ flex-direction: column;
425
+ margin-right: 10px;
426
+ background: rgb(0, 136, 69);
427
+ padding: 5px 10px;
428
+ border-top-left-radius: 15px;
429
+ border-bottom-left-radius: 15px;
430
+ color: #fff;
431
+ }
432
+
433
+ .card-right {
434
+ margin-right: -20px;
435
+ display: flex;
436
+ flex-direction: row-reverse;
437
+ align-items: center;
438
+ }
439
+ .card-data {
440
+ overflow: hidden;
441
+ display: flex;
442
+ align-content: center;
443
+ }
444
+ .card-data span {
445
+ white-space: nowrap;
446
+ text-overflow: ellipsis;
447
+ overflow: hidden;
448
+ }
449
+ .card-data svg {
450
+ margin-right: 5px;
451
+ color: #232323;
452
+ }
453
+
454
+ .card-expand {
455
+ display: flex;
456
+ justify-content: center;
457
+ align-items: center;
458
+ margin: 0 10px;
459
+ cursor: pointer;
460
+ opacity: 0.8;
461
+ transition: opacity 150ms;
462
+ }
463
+ .card-expand:hover {
464
+ opacity: 1;
465
+ }
466
+
467
+ .card-footer {
468
+ margin-top: 5px;
469
+ border-top: 1px solid #ddd;
470
+ display: flex;
471
+ flex-wrap: wrap;
472
+ }
473
+
474
+ .card-chip-container {
475
+ display: flex;
476
+ flex-wrap: wrap;
477
+ width: 100%;
478
+ gap: 5px;
479
+ }
480
+
481
+ .card-autor {
482
+ display: flex;
483
+ align-items: center;
484
+ margin-right: 10px;
485
+ overflow: hidden;
486
+ min-width: 14px;
487
+ max-width: calc(100% - 215px);
488
+ gap: 5px;
489
+ }
490
+
491
+ .card-chip {
492
+ font-size: 12.8px;
493
+ width: fit-content;
494
+ border-radius: 15px;
495
+ transition: all 150ms ease-in-out;
496
+ padding: 2.5px 7px;
497
+ color: rgb(31, 105, 193);
498
+ background-color: rgba(207, 216, 244, 0.6);
499
+ margin-bottom: 5px;
500
+ }
501
+ .card-chip:hover {
502
+ background-color: rgba(207, 216, 244, 1);
503
+ }
504
+ .card-chip.orange {
505
+ color: #e14924;
506
+ background-color: rgba(228, 92, 58, 0.15);
507
+ }
508
+ .card-chip.orange:hover {
509
+ background-color: rgba(228, 92, 58, 0.2);
510
+ }
511
+ .card-chip.yellow {
512
+ color: #f4a304;
513
+ background-color: rgba(252, 191, 73, 0.15);
514
+ }
515
+ .card-chip.yellow:hover {
516
+ background-color: rgba(252, 191, 73, 0.2);
517
+ }
518
+ .card-chip.red {
519
+ color: rgb(231, 76, 60);
520
+ background-color: rgba(231, 76, 60, 0.2);
521
+ }
522
+ .card-chip.red:hover {
523
+ background-color: rgba(231, 76, 60, 0.25);
524
+ }
525
+ .card-chip.green {
526
+ color: #0e3213;
527
+ background-color: rgba(15, 177, 39, 0.3);
528
+ }
529
+ .card-chip.green:hover {
530
+ background-color: rgba(15, 177, 39, 0.4);
531
+ }
532
+
533
+ .card-anexo {
534
+ width: 50px;
535
+ height: 50px;
536
+ margin-right: 5px;
537
+ display: flex;
538
+ justify-content: center;
539
+ align-items: center;
540
+ }
541
+ .anexo-item {
542
+ width: 100%;
543
+ height: 100%;
544
+ display: flex;
545
+ justify-content: center;
546
+ align-items: center;
547
+ position: relative;
548
+ }
549
+ .anexo-item .transition-anexo-item {
550
+ max-width: 100%;
551
+ max-height: 100%;
552
+ }
553
+ .anexo-item .req-loader {
554
+ position: absolute;
555
+ top: calc(50% - 12.5px);
556
+ right: calc(50% - 12.5px);
557
+ }
558
+ .anexo-item .transition-anexo-item img {
559
+ max-width: 45px;
560
+ max-height: 45px;
561
+ }
562
+
563
+ .anexo-icone {
564
+ opacity: 0.9;
565
+ transition: opacity 200ms;
566
+ color: #222;
567
+ cursor: pointer;
568
+ display: flex;
569
+ justify-content: center;
570
+ align-items: center;
571
+ }
572
+ .anexo-icone:hover {
573
+ opacity: 1;
574
+ }
575
+ .anexo-icone:visited {
576
+ color: inherit;
577
+ }
578
+ svg {
579
+ font-size: 30px;
580
+ z-index: 1;
581
+ }
582
+ .anexo-icone.pdf {
583
+ position: relative;
584
+ }
585
+ .anexo-icone.pdf svg {
586
+ color: rgb(231, 76, 60);
587
+ }
588
+ .anexo-icone.pdf::after {
589
+ content: "";
590
+ position: absolute;
591
+ bottom: 2px;
592
+ transform: translateY(2px);
593
+ width: 20px;
594
+ height: 20px;
595
+ background-color: #fff;
596
+ }
597
+ .anexo-icone.doc {
598
+ color: #15517f;
599
+ }
600
+ .anexo-icone.doc::after {
601
+ content: "";
602
+ position: absolute;
603
+ width: 20px;
604
+ height: 20px;
605
+ background-color: #fff;
606
+ }
607
+ .anexo-img {
608
+ display: flex;
609
+ justify-content: center;
610
+ align-items: center;
611
+ width: 100%;
612
+ height: 100%;
613
+ overflow: hidden;
614
+ background-color: rgba(0, 0, 0, 0.2);
615
+ border-radius: 2.5px;
616
+ cursor: pointer;
617
+ opacity: 0.9;
618
+ transition: opacity 150ms;
619
+ }
620
+
621
+ .anexo-img:hover {
622
+ opacity: 1;
623
+ }
624
+ .anexo-img img {
625
+ width: 95%;
626
+ }
627
+
628
+ .card-interatividade {
629
+ display: flex;
630
+ flex-direction: column;
631
+ margin-top: 10px;
632
+ margin-bottom: 5px;
633
+ font-size: 0.9em;
634
+ }
635
+
636
+ .card-interatividade-title {
637
+ font-weight: bold;
638
+ margin-bottom: 5px;
639
+ }
640
+
641
+ .card-interatividade-list {
642
+ margin: 0;
643
+ padding: 0;
644
+ font-size: 0.9em;
645
+ }
646
+
647
+ .card-interatividade-list hr {
648
+ height: 1px;
649
+ background-color: #ccc;
650
+ width: 100%;
651
+ border: 0;
652
+ }
653
+
654
+ .card-interatividade-list button {
655
+ margin-left: 5px;
656
+ border-radius: 5px;
657
+ border: unset;
658
+ cursor: pointer;
659
+ padding: 5px 10px;
660
+ background-color: #b5f778;
661
+ }
662
+
663
+ .card-interatividade-list button:hover {
664
+ text-decoration: underline;
665
+ }
666
+ </style>