vue-intergrall-plugins 1.1.7 → 1.1.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -7,7 +7,10 @@
7
7
  {{ fileSize }}
8
8
  </span>
9
9
  </transition> -->
10
- <fa-icon :icon="['fas', 'paperclip']" :title="dictionary.title_selecionar_anexo" />
10
+ <span :title="dictionary.title_selecionar_anexo"
11
+ style="display: flex; align-items: center; justify-content-center; cursor: pointer;">
12
+ <fa-icon :icon="['fas', 'paperclip']" />
13
+ </span>
11
14
  <transition name="fade">
12
15
  <span v-if="fileSize > 0" @click.stop="toggleFilePreview" v-tippy :content="!fileSettings.handleFilePreview
13
16
  ? dictionary.msg_abrir_anexos
@@ -40,9 +40,13 @@
40
40
  <!-- Preview do link -->
41
41
  <LinkPreview v-if="link && !mapa && status != 'O'" :message="message" />
42
42
  <!-- Mensagem -->
43
- <p v-html="validateInterativity() ? '' : formatMsg(message)"></p>
43
+ <p v-html="validateInterativity() || isInteratividadeContato() ? '' : formatMsg(message)"></p>
44
44
  <!-- Botoes da interatividade -->
45
- <InteratividadeBotoes v-if="interatividade" :interatividade="interatividade" />
45
+ <template v-if="interatividade">
46
+ <InteratividadeContato v-if="isInteratividadeContato()" :interatividade="interatividade"
47
+ :dictionary="dictionary" :emitContactClick="emitContactClick" @contact-click="emitContactData" />
48
+ <InteratividadeBotoes v-else :interatividade="interatividade" :dictionary="dictionary" />
49
+ </template>
46
50
  <!-- Horario da mensagem -->
47
51
  <span class="horario-envio" v-text="horario"></span>
48
52
  <!-- Reenviar mensagem -->
@@ -153,6 +157,7 @@
153
157
  import AnexoMensagem from "./AnexoMensagem";
154
158
  import InteratividadeBotoes from "./InteratividadeBotoes";
155
159
  import InteratividadeFormulario from "./InteratividadeFormulario";
160
+ import InteratividadeContato from "./InteratividadeContato";
156
161
  import Picker from "../Chat/Picker";
157
162
  import { formataTimezoneData } from "../../services/textFormatting";
158
163
  import LinkPreview from "./LinkPreview";
@@ -163,10 +168,12 @@ export default {
163
168
  AnexoMensagem,
164
169
  InteratividadeBotoes,
165
170
  InteratividadeFormulario,
171
+ InteratividadeContato,
166
172
  LinkPreview,
167
173
  Picker,
168
174
  },
169
175
  props: [
176
+ "emitContactClick",
170
177
  "smartchannel",
171
178
  "messageIndex",
172
179
  "dictionary",
@@ -385,6 +392,18 @@ export default {
385
392
  return false;
386
393
  }
387
394
  },
395
+ isInteratividadeContato() {
396
+ try {
397
+ if (
398
+ this.interatividade && this.interatividade.length && this.interatividade[0].phones
399
+ ) {
400
+ return true;
401
+ }
402
+ return false;
403
+ } catch (error) {
404
+ return false;
405
+ }
406
+ },
388
407
  validadeUrlToMsg() {
389
408
  try {
390
409
  this.message = this.msg;
@@ -458,6 +477,9 @@ export default {
458
477
  abrirImagem(imagem) {
459
478
  this.$emit("abrir-imagem", imagem);
460
479
  },
480
+ emitContactData(props) {
481
+ this.$emit("contact-click", props);
482
+ },
461
483
  adjustFontColor(cor) {
462
484
  try {
463
485
  var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(cor);
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div>
3
+ <InteratividadeContatoItem v-for="(item, index) in interatividade" :key="index" :item="item"
4
+ :dictionary="dictionary" :emitContactClick="emitContactClick" @contact-click="emitData" />
5
+ </div>
6
+ </template>
7
+ <script>
8
+ import InteratividadeContatoItem from "./InteratividadeContatoItem";
9
+
10
+ export default {
11
+ components: { InteratividadeContatoItem },
12
+ props: {
13
+ interatividade: {
14
+ type: Array,
15
+ required: true,
16
+ },
17
+ dictionary: {
18
+ type: Object,
19
+ required: true,
20
+ },
21
+ emitContactClick: {
22
+ type: Boolean,
23
+ default: false,
24
+ }
25
+ },
26
+ methods: {
27
+ emitData(props) {
28
+ this.$emit("contact-click", props);
29
+ }
30
+ }
31
+ };
32
+ </script>
@@ -0,0 +1,208 @@
1
+ <template>
2
+ <div class="contact-card" ref="contactCard">
3
+ <div class="contact-header">
4
+ <div class="header-content">
5
+ <span class="badge">{{ getInitials(item.name) }}</span>
6
+ <h3>{{ item.name.formatted_name }}</h3>
7
+ </div>
8
+ <ul v-if="item.org" class="contact-list">
9
+ <li v-if="item.org.company">{{ item.org.company }}</li>
10
+ <li v-if="item.org.title">{{ item.org.title }}</li>
11
+ </ul>
12
+ </div>
13
+ <div class="contact-content">
14
+ <div class="contact-section">
15
+ <h4>
16
+ <fa-icon :icon="['fas', 'phone-alt']" />
17
+ Telefones
18
+ </h4>
19
+ <ul class="contact-list">
20
+ <li v-for="phone in item.phones" :key="phone.phone">
21
+ {{ dictionary[`${phone.type}_phone`] || phone.type }}: {{ phone.phone }}
22
+ <button v-if="emitContactClick" @click="emitData(phone.phone, 'phone')" title="Adicionar contato">
23
+ <fa-icon :icon="['fas', 'user-plus']" />
24
+ </button>
25
+ </li>
26
+ </ul>
27
+ </div>
28
+ <div class="contact-section">
29
+ <h4><fa-icon :icon="['fas', 'envelope']" />Emails</h4>
30
+ <ul class="contact-list">
31
+ <li v-for="email in item.emails" :key="email.email">
32
+ {{ dictionary[`${email.type}_email`] || email.type }}: {{ email.email }}
33
+ <button v-if="emitContactClick" @click="emitData(email.email, 'email')" title="Adicionar contato">
34
+ <fa-icon :icon="['fas', 'user-plus']" />
35
+ </button>
36
+ </li>
37
+ </ul>
38
+ </div>
39
+ <div class="contact-section">
40
+ <h4>
41
+ <fa-icon :icon="['fas', 'info']" /> {{ dictionary.titulo_informacoes }} adicionais
42
+ </h4>
43
+ <ul class="contact-list">
44
+ <template v-if="item.addresses && item.addresses.length">
45
+ <li v-for="address in item.addresses" :key="address.street">
46
+ {{ dictionary[`${address.type}_address`] || address.type }}: {{ address.street }}, {{ address.city }} - {{
47
+ address.state ? address.state.toUpperCase() : '(vazio)' }} - {{
48
+ address.country }}, {{
49
+ address.zip }}
50
+ </li>
51
+ </template>
52
+ <template v-if="item.urls && item.urls.length">
53
+ <li v-for="url in item.urls" :key="url.url">
54
+ {{ dictionary[url.type] || url.type }}: <a
55
+ :href="`${url.url.startsWith('https://') ? url.url : `https://${url.url}`}`" target="_blank">{{ url.url
56
+ }}</a>
57
+ </li>
58
+ </template>
59
+ <li v-if="item.birthday">{{ dictionary.birthday }}: {{ formatBirthday(item.birthday) }}</li>
60
+ <template v-if="additionals && additionals.length">
61
+ <li v-for="(value, key) in additionals" :key="key">
62
+ {{ key }}: {{ value }}
63
+ </li>
64
+ </template>
65
+ </ul>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </template>
70
+
71
+ <script>
72
+
73
+ export default {
74
+ props: {
75
+ item: {
76
+ type: Object,
77
+ required: true,
78
+ },
79
+ dictionary: {
80
+ type: Object,
81
+ required: true,
82
+ },
83
+ emitContactClick: {
84
+ type: Boolean,
85
+ default: false,
86
+ }
87
+ },
88
+ data() {
89
+ return {
90
+ additionals: []
91
+ }
92
+ },
93
+ mounted() {
94
+ this.additionals = this.getAdditionalInfo(JSON.parse(JSON.stringify(this.item)));
95
+ },
96
+ methods: {
97
+ getInitials(name) {
98
+ if (!name) return '';
99
+ const initials = name.first_name.charAt(0);
100
+ if (name.last_name) {
101
+ return initials + name.last_name.charAt(0);
102
+ }
103
+ return initials;
104
+ },
105
+ formatBirthday(birthday) {
106
+ if (!birthday) return '';
107
+ const values = birthday.split('-');
108
+ const month = values[values.length - 2]
109
+ const day = values[values.length - 1]
110
+ const months = [
111
+ 'janeiro', 'fevereiro', `mar${this.dictionary.c_dil}o`, 'abril', 'maio', 'junho',
112
+ 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'
113
+ ];
114
+ return `${parseInt(day)} de ${months[parseInt(month) - 1]}`;
115
+ },
116
+ emitData(contact, type) {
117
+ this.$emit('contact-click', {
118
+ contact,
119
+ type,
120
+ data: JSON.parse(JSON.stringify(this.item))
121
+ });
122
+ },
123
+ getAdditionalInfo(item) {
124
+ const keysToExclude = ['name', 'org', 'phones', 'emails', 'addresses', 'urls', 'birthday'];
125
+ return Object.keys(item)
126
+ .filter(key => !keysToExclude.includes(key))
127
+ .reduce((obj, key) => {
128
+ obj[key] = item[key];
129
+ return obj;
130
+ }, {});
131
+ }
132
+ },
133
+ };
134
+ </script>
135
+
136
+ <style scoped>
137
+ .contact-card {
138
+ border: 1px solid rgba(0, 0, 0, 0.1);
139
+ background-color: rgba(255, 255, 255, 0.9);
140
+ border-radius: 5px;
141
+ padding: 5px;
142
+ margin-bottom: 10px;
143
+ }
144
+
145
+ .contact-header {
146
+ margin-bottom: 16px;
147
+ }
148
+
149
+ .header-content {
150
+ display: flex;
151
+ align-items: center;
152
+ gap: 5px;
153
+ }
154
+
155
+ .header-content h3 {
156
+ margin: 0;
157
+ }
158
+
159
+ .contact-list {
160
+ list-style: none;
161
+ padding: 0;
162
+ margin: 0;
163
+ display: flex;
164
+ flex-direction: column;
165
+ gap: 5px;
166
+ margin: 10px 0;
167
+ }
168
+
169
+ .contact-list li>button {
170
+ background-color: transparent;
171
+ border: none;
172
+ cursor: pointer;
173
+ font-size: 14px;
174
+ color: var(--konecta-success);
175
+ }
176
+
177
+ .contact-list li>button:hover {
178
+ color: var(--konecta-success-hover);
179
+ }
180
+
181
+ .badge {
182
+ display: flex;
183
+ justify-content: center;
184
+ align-items: center;
185
+ width: 30px;
186
+ height: 30px;
187
+ border-radius: 50%;
188
+ background-color: var(--message-color);
189
+ color: var(--text-color);
190
+ text-align: center;
191
+ line-height: 24px;
192
+ font-size: 14px;
193
+ font-weight: bold;
194
+ }
195
+
196
+ .contact-section {
197
+ margin-bottom: 16px;
198
+ }
199
+
200
+ .contact-section h4 {
201
+ margin: 0;
202
+ font-size: 14px;
203
+ font-weight: bold;
204
+ display: flex;
205
+ align-items: center;
206
+ gap: 5px;
207
+ }
208
+ </style>
@@ -29,8 +29,11 @@
29
29
  class="mb-5 mx-5 d-flex">
30
30
  <img class="box-shadow max-w-75px max-h-75px cursor-pointer" @click="openFile(mku, type)" v-if="!type"
31
31
  :src="`${dominio}/callcenter/docs.php?mku=${mku}`" :alt="name" :title="name" />
32
- <fa-icon v-else :icon="returnCurrentIcon(type)" @click="openFile(mku, type)"
33
- :class="returnCurrentClass(type)" :title="name" />
32
+ <span v-else style="display: flex; align-items: center; justify-content-center; cursor: pointer;"
33
+ @click="openFile(mku, type)" :title="name">
34
+
35
+ <fa-icon :icon="returnCurrentIcon(type)" :class="returnCurrentClass(type)" />
36
+ </span>
34
37
  <a class="d-flex align-items-end ml-3 text-dark" :href="`${dominio}/callcenter/docs.php?mku=${mkuDownload}`"
35
38
  :download="`${name}`" target="_blank" rel="noreferrer noopener" :title="`Download ${name}`">
36
39
  <fa-icon :icon="['fas', 'download']" />