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.
- package/README.md +220 -220
- package/dist/dist/vue-intergrall-plugins.css +1 -1
- package/dist/vue-intergrall-plugins.esm.js +193 -78
- package/dist/vue-intergrall-plugins.min.js +7 -7
- package/dist/vue-intergrall-plugins.ssr.js +245 -136
- package/package.json +61 -61
- package/src/lib-components/Buttons/IconButton.vue +27 -27
- package/src/lib-components/Buttons/SimpleButton.vue +140 -140
- package/src/lib-components/Cards/Card.vue +490 -490
- package/src/lib-components/Cards/CardCheck.vue +35 -35
- package/src/lib-components/Cards/CardFile.vue +163 -163
- package/src/lib-components/Chat/BtnDownloadAllFiles.vue +36 -36
- package/src/lib-components/Chat/BtnEmojis.vue +118 -118
- package/src/lib-components/Chat/BtnExpand.vue +17 -17
- package/src/lib-components/Chat/BtnFiles.vue +486 -486
- package/src/lib-components/Chat/BtnMic.vue +60 -60
- package/src/lib-components/Chat/BtnScreenShare.vue +31 -31
- package/src/lib-components/Chat/BtnStandardMessages.vue +17 -17
- package/src/lib-components/Chat/ExpandTextarea.vue +427 -427
- package/src/lib-components/Chat/MultipleFilePreview.vue +291 -291
- package/src/lib-components/Chat/Picker.vue +525 -525
- package/src/lib-components/Chat/RemainingCharacters.vue +28 -28
- package/src/lib-components/Chat/SingleFilePreview.vue +94 -94
- package/src/lib-components/Chat/SkeletonPicker.vue +110 -110
- package/src/lib-components/Chat/StandardMessages.vue +252 -252
- package/src/lib-components/Chat/TextFooter.vue +1007 -1007
- package/src/lib-components/Email/EmailExpanded.vue +270 -270
- package/src/lib-components/Email/EmailFile.vue +192 -192
- package/src/lib-components/Email/EmailFrom.vue +66 -66
- package/src/lib-components/Email/EmailItem.vue +867 -850
- package/src/lib-components/Email/EmailTo.vue +64 -64
- package/src/lib-components/Loader/Loader.vue +78 -78
- package/src/lib-components/Messages/AnexoMensagem.vue +534 -497
- package/src/lib-components/Messages/CardAttachment.vue +61 -61
- package/src/lib-components/Messages/CardMessages.vue +687 -687
- package/src/lib-components/Messages/InteratividadeBotoes.vue +197 -197
- package/src/lib-components/Messages/InteratividadeContato.vue +32 -32
- package/src/lib-components/Messages/InteratividadeContatoItem.vue +235 -235
- package/src/lib-components/Messages/InteratividadeFormulario.vue +334 -334
- package/src/lib-components/Messages/InteratividadePopup.vue +95 -95
- package/src/lib-components/Messages/LinkPreview.vue +176 -176
- package/src/lib-components/Scroll/ScrollContent.vue +166 -166
- package/src/lib-components/Templates/TemplateGenerator.vue +640 -640
- package/src/lib-components/Templates/TemplateMessage.vue +83 -83
- package/src/lib-components/Templates/TemplateSingle.vue +478 -478
|
@@ -1,490 +1,490 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="origin" :class="[currentClasses]" :id="`card-${messageIndex ? messageIndex : randomizeValue}`">
|
|
3
|
-
<transition name="fade">
|
|
4
|
-
<span v-if="newMessage" class="new-messages" v-text="`Nova mensagem`"></span>
|
|
5
|
-
</transition>
|
|
6
|
-
<div class="card box-shadow">
|
|
7
|
-
<div class="card-header" :style="resizeHeaderCard">
|
|
8
|
-
<div class="card-author">
|
|
9
|
-
<fa-icon :icon="currentIcon" />
|
|
10
|
-
<p v-if="author" class="text-bold" v-text="`${tratarTextoLongo(author)}`" :title="author"></p>
|
|
11
|
-
<p v-if="origin === 'principal' && login" v-text="`| ${login}`" :title="login"></p>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="card-right">
|
|
14
|
-
<div class="card-dates">
|
|
15
|
-
<div v-if="date" class="card-date" :title="`${dictionary.data_criacao}: ${origin === 'outros'
|
|
16
|
-
? formataTimezoneData(date)
|
|
17
|
-
: returnFormataDataHora(date)
|
|
18
|
-
}`">
|
|
19
|
-
<span v-text="origin === 'outros'
|
|
20
|
-
? formataTimezoneData(date)
|
|
21
|
-
: returnFormataDataHora(date)
|
|
22
|
-
"></span>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<div v-if="hasExpand" class="card-expand" @click="cardExpand()">
|
|
26
|
-
<fa-icon :icon="['fas', 'expand-alt']" />
|
|
27
|
-
</div>
|
|
28
|
-
<div class="card-actions" v-if="customButtons && customButtons.length">
|
|
29
|
-
<span v-for="(button, index) in customButtons" :key="button.id || index" v-show="button.use"
|
|
30
|
-
@click="button.callback(returnParams(button.params))" :class="`${button.customClass || 'menu-mensagem'}`"
|
|
31
|
-
v-tippy :content="button.tippyContent">
|
|
32
|
-
<fa-icon :icon="['fas', button.icon || 'question-circle']" />
|
|
33
|
-
</span>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
<p v-if="chipInfos.cod && chipInfos.desc" class="card-chip" :class="[chipInfosClasses]"
|
|
38
|
-
v-text="`${chipInfos.desc} (${chipInfos.cod})`" :title="`${chipInfos.desc} (${chipInfos.cod})`"></p>
|
|
39
|
-
<p class="card-message" v-html="formattedMessage"></p>
|
|
40
|
-
<div class="card-footer">
|
|
41
|
-
<template v-if="files && files.length">
|
|
42
|
-
<div class="card-file" v-for="(file, index) in files" :key="`${index}`">
|
|
43
|
-
<CardFile :file="file" :dictionary="dictionary" :domain="domain" />
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
46
|
-
<CardCheck v-if="messageStatus" :messageStatus="messageStatus" :hasReply="hasReply" :replyMessage="replyMessage"
|
|
47
|
-
:tooltipContent="tooltipContent" @reply-msg="$emit('reply-msg')" />
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</template>
|
|
52
|
-
|
|
53
|
-
<script>
|
|
54
|
-
import { textoLongo } from "@/mixins/formatarTexto";
|
|
55
|
-
import { formataTimezoneData, formataDataHora } from "../../services/textFormatting";
|
|
56
|
-
import CardFile from "./CardFile";
|
|
57
|
-
import CardCheck from "./CardCheck";
|
|
58
|
-
|
|
59
|
-
export default {
|
|
60
|
-
components: { CardFile, CardCheck },
|
|
61
|
-
props: {
|
|
62
|
-
customClass: {
|
|
63
|
-
type: String,
|
|
64
|
-
required: false,
|
|
65
|
-
},
|
|
66
|
-
dictionary: {
|
|
67
|
-
type: Object,
|
|
68
|
-
required: true,
|
|
69
|
-
},
|
|
70
|
-
messageIndex: {
|
|
71
|
-
type: [Number, String],
|
|
72
|
-
required: true,
|
|
73
|
-
},
|
|
74
|
-
domain: {
|
|
75
|
-
type: String,
|
|
76
|
-
required: true,
|
|
77
|
-
},
|
|
78
|
-
hasExpand: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
required: false,
|
|
81
|
-
default: true,
|
|
82
|
-
},
|
|
83
|
-
origin: {
|
|
84
|
-
type: String,
|
|
85
|
-
required: true,
|
|
86
|
-
},
|
|
87
|
-
author: {
|
|
88
|
-
type: String,
|
|
89
|
-
},
|
|
90
|
-
login: {
|
|
91
|
-
type: String,
|
|
92
|
-
},
|
|
93
|
-
message: {
|
|
94
|
-
type: String,
|
|
95
|
-
},
|
|
96
|
-
files: {
|
|
97
|
-
type: Array,
|
|
98
|
-
},
|
|
99
|
-
date: {
|
|
100
|
-
type: String,
|
|
101
|
-
},
|
|
102
|
-
chipInfos: {
|
|
103
|
-
type: Object,
|
|
104
|
-
},
|
|
105
|
-
newMessage: {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
},
|
|
108
|
-
hasReply: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
},
|
|
111
|
-
replyMessage: {
|
|
112
|
-
type: String,
|
|
113
|
-
},
|
|
114
|
-
messageStatus: {
|
|
115
|
-
type: String,
|
|
116
|
-
},
|
|
117
|
-
tooltipContent: {
|
|
118
|
-
type: String,
|
|
119
|
-
},
|
|
120
|
-
resizeCard: {
|
|
121
|
-
type: Boolean,
|
|
122
|
-
required: false,
|
|
123
|
-
default: false,
|
|
124
|
-
},
|
|
125
|
-
customButtons: {
|
|
126
|
-
type: Array
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
data() {
|
|
130
|
-
return {
|
|
131
|
-
styleCard: "",
|
|
132
|
-
};
|
|
133
|
-
},
|
|
134
|
-
mixins: [textoLongo],
|
|
135
|
-
computed: {
|
|
136
|
-
randomizeValue() {
|
|
137
|
-
return `${Math.floor(Math.random() * 7770)}${Date.now()}`;
|
|
138
|
-
},
|
|
139
|
-
formattedMessage() {
|
|
140
|
-
if (this.message) {
|
|
141
|
-
const regex = /(\n|\r| )/g;
|
|
142
|
-
if (regex.test(this.message)) return this.message.replace(regex, "<br>");
|
|
143
|
-
}
|
|
144
|
-
return this.message;
|
|
145
|
-
},
|
|
146
|
-
currentIcon() {
|
|
147
|
-
return this.origin === "outros" ? ["fas", "user"] : ["fas", "headset"];
|
|
148
|
-
},
|
|
149
|
-
currentClasses() {
|
|
150
|
-
return `${this.origin === "outros" ? "card-cli" : "card-ope"} ${this.newMessage ? "newMessage" : ""
|
|
151
|
-
} ${this.customClass || ''}`;
|
|
152
|
-
},
|
|
153
|
-
chipInfosClasses() {
|
|
154
|
-
if (!this.chipInfos || !this.chipInfos.cod) return "";
|
|
155
|
-
const { cod } = this.chipInfos;
|
|
156
|
-
switch (cod) {
|
|
157
|
-
case 9:
|
|
158
|
-
case "9":
|
|
159
|
-
case 8:
|
|
160
|
-
case "8":
|
|
161
|
-
case "CANCELADA":
|
|
162
|
-
return "red";
|
|
163
|
-
case 3:
|
|
164
|
-
case "3":
|
|
165
|
-
case 6:
|
|
166
|
-
case "6":
|
|
167
|
-
case "AGENDADA":
|
|
168
|
-
return "yellow";
|
|
169
|
-
default:
|
|
170
|
-
return "";
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
resizeHeaderCard() {
|
|
174
|
-
if (this.resizeCard) {
|
|
175
|
-
this.styleCard = "flex-direction: column;";
|
|
176
|
-
} else {
|
|
177
|
-
this.styleCard = "flex-direction: row;";
|
|
178
|
-
}
|
|
179
|
-
return this.styleCard;
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
methods: {
|
|
183
|
-
formataTimezoneData(timezoneData) {
|
|
184
|
-
return formataTimezoneData(timezoneData);
|
|
185
|
-
},
|
|
186
|
-
returnFormataDataHora(dataHora) {
|
|
187
|
-
return formataDataHora(dataHora, false, false, this.dictionary);
|
|
188
|
-
},
|
|
189
|
-
cardExpand() {
|
|
190
|
-
this.$emit("card-expand", this.$props);
|
|
191
|
-
},
|
|
192
|
-
returnParams(params) {
|
|
193
|
-
const defaultParams = {
|
|
194
|
-
message: this.message,
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
if (!params) return defaultParams;
|
|
198
|
-
|
|
199
|
-
const keys = params.instanceKeys.split("|");
|
|
200
|
-
if (!keys || !keys.length)
|
|
201
|
-
return {
|
|
202
|
-
defaultParams,
|
|
203
|
-
...params.values,
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
const customParams = { ...params.values };
|
|
207
|
-
keys.forEach((key) => {
|
|
208
|
-
if (this[key]) customParams[key] = this[key];
|
|
209
|
-
else console.warn(`Cant find ${key} on 'this' instance`);
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
return Object.keys(customParams).length ? customParams : defaultParams;
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
};
|
|
216
|
-
</script>
|
|
217
|
-
|
|
218
|
-
<style>
|
|
219
|
-
.fade-enter-active,
|
|
220
|
-
.fade-leave-active {
|
|
221
|
-
transition: opacity 200ms;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.fade-enter,
|
|
225
|
-
.fade-leave-to {
|
|
226
|
-
opacity: 0;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.card-cli,
|
|
230
|
-
.card-ope {
|
|
231
|
-
display: flex;
|
|
232
|
-
width: 95%;
|
|
233
|
-
margin: 5px 0;
|
|
234
|
-
position: relative;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.card-cli.newMessage,
|
|
238
|
-
.card-ope.newMessage {
|
|
239
|
-
margin-top: 30px;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.new-messages {
|
|
243
|
-
position: absolute;
|
|
244
|
-
top: -30px;
|
|
245
|
-
width: 100%;
|
|
246
|
-
display: flex;
|
|
247
|
-
justify-content: center;
|
|
248
|
-
align-items: center;
|
|
249
|
-
margin: 2.5px 0;
|
|
250
|
-
background-color: lighten(#fff249, 15);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.card-cli .card {
|
|
254
|
-
border-left: 3px solid #90b823;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.card-ope {
|
|
258
|
-
align-self: flex-end;
|
|
259
|
-
background-color: lighten(#007535, 72);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.card-ope .card {
|
|
263
|
-
border-right: 3px solid #007535;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.card {
|
|
267
|
-
background-color: rgba(255, 255, 255, 0.9);
|
|
268
|
-
overflow: hidden;
|
|
269
|
-
width: 100%;
|
|
270
|
-
padding: 2.5px 5px;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.card p {
|
|
274
|
-
word-break: break-all;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.card-header {
|
|
278
|
-
width: 100%;
|
|
279
|
-
border-bottom: 1px solid #ddd;
|
|
280
|
-
margin-bottom: 5px;
|
|
281
|
-
display: flex;
|
|
282
|
-
justify-content: space-between;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.card-header svg {
|
|
286
|
-
font-size: 16px;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.card-right {
|
|
290
|
-
margin-right: -20px;
|
|
291
|
-
display: flex;
|
|
292
|
-
flex-direction: row-reverse;
|
|
293
|
-
align-items: center;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.card-author {
|
|
297
|
-
display: flex;
|
|
298
|
-
align-items: center;
|
|
299
|
-
margin-right: 10px;
|
|
300
|
-
overflow: hidden;
|
|
301
|
-
min-width: 14px;
|
|
302
|
-
max-width: calc(100% - 215px);
|
|
303
|
-
gap: 5px;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.card-author svg {
|
|
307
|
-
margin-right: 5px;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.card-actions {
|
|
311
|
-
display: flex;
|
|
312
|
-
gap: 7px;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.menu-mensagem {
|
|
316
|
-
cursor: pointer;
|
|
317
|
-
padding: 1px;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.card-canal {
|
|
321
|
-
flex: 1;
|
|
322
|
-
margin-right: 10px;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.card-dates {
|
|
326
|
-
display: flex;
|
|
327
|
-
flex-direction: column;
|
|
328
|
-
margin-right: 10px;
|
|
329
|
-
padding: 5px 10px;
|
|
330
|
-
border-top-left-radius: 15px;
|
|
331
|
-
border-bottom-left-radius: 15px;
|
|
332
|
-
color: #fff;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
.card-cli .card-dates {
|
|
336
|
-
background-color: #90b823;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.card-ope .card-dates {
|
|
340
|
-
background-color: #007535;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.card-date {
|
|
344
|
-
overflow: hidden;
|
|
345
|
-
display: flex;
|
|
346
|
-
align-content: center;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.card-date span {
|
|
350
|
-
white-space: nowrap;
|
|
351
|
-
text-overflow: ellipsis;
|
|
352
|
-
overflow: hidden;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.card-date svg {
|
|
356
|
-
margin-right: 5px;
|
|
357
|
-
color: #232323;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.card-expand {
|
|
361
|
-
display: flex;
|
|
362
|
-
justify-content: center;
|
|
363
|
-
align-items: center;
|
|
364
|
-
margin: 2.5px;
|
|
365
|
-
cursor: pointer;
|
|
366
|
-
opacity: 0.8;
|
|
367
|
-
transition: opacity 150ms;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.card-expand:hover {
|
|
371
|
-
opacity: 1;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
.card-footer {
|
|
375
|
-
margin-top: 5px;
|
|
376
|
-
border-top: 1px solid #ddd;
|
|
377
|
-
display: flex;
|
|
378
|
-
flex-wrap: wrap;
|
|
379
|
-
min-height: 25px;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.card-chip {
|
|
383
|
-
font-size: 12.8px;
|
|
384
|
-
width: fit-content;
|
|
385
|
-
border-radius: 15px;
|
|
386
|
-
transition: all 150ms ease-in-out;
|
|
387
|
-
padding: 2.5px 7px;
|
|
388
|
-
color: rgb(31, 105, 193);
|
|
389
|
-
background-color: rgba(207, 216, 244, 0.6);
|
|
390
|
-
margin-bottom: 5px;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.card-chip:hover {
|
|
394
|
-
background-color: rgba(207, 216, 244, 1);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.card-chip.orange {
|
|
398
|
-
color: #e14924;
|
|
399
|
-
background-color: rgba(228, 92, 58, 0.15);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.card-chip.orange:hover {
|
|
403
|
-
background-color: rgba(228, 92, 58, 0.2);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.card-chip.yellow {
|
|
407
|
-
color: #f4a304;
|
|
408
|
-
background-color: rgba(252, 191, 73, 0.15);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.card-chip.yellow:hover {
|
|
412
|
-
background-color: rgba(252, 191, 73, 0.2);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
.card-chip.red {
|
|
416
|
-
color: rgb(231, 76, 60);
|
|
417
|
-
background-color: rgba(231, 76, 60, 0.2);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.card-chip.red:hover {
|
|
421
|
-
background-color: rgba(231, 76, 60, 0.25);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
.card-file {
|
|
425
|
-
width: 60px;
|
|
426
|
-
height: 50px;
|
|
427
|
-
margin-right: 5px;
|
|
428
|
-
display: flex;
|
|
429
|
-
justify-content: center;
|
|
430
|
-
align-items: center;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
.card-reply {
|
|
434
|
-
cursor: pointer;
|
|
435
|
-
position: absolute;
|
|
436
|
-
right: 30px;
|
|
437
|
-
bottom: 5px;
|
|
438
|
-
font-size: 9.6px;
|
|
439
|
-
color: #67a332;
|
|
440
|
-
width: 14.4px;
|
|
441
|
-
height: 14.4px;
|
|
442
|
-
display: flex;
|
|
443
|
-
justify-content: center;
|
|
444
|
-
align-items: center;
|
|
445
|
-
border-radius: 50%;
|
|
446
|
-
background-color: #fff;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
.card-reply svg {
|
|
450
|
-
margin-top: -1px;
|
|
451
|
-
margin-right: -1px;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.card-check {
|
|
455
|
-
position: absolute;
|
|
456
|
-
bottom: 5px;
|
|
457
|
-
right: 5px;
|
|
458
|
-
cursor: pointer;
|
|
459
|
-
font-size: 11.2px;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
.card-check svg {
|
|
463
|
-
font-size: 12.8px;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.card-check.seen,
|
|
467
|
-
.card-check.seen svg {
|
|
468
|
-
color: #006daa;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.card-check.green,
|
|
472
|
-
.card-check.green svg {
|
|
473
|
-
color: #4f772d;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.card-check.red,
|
|
477
|
-
.card-check.red svg {
|
|
478
|
-
color: #ba181b;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.card-check.gray,
|
|
482
|
-
.card-check.gray svg {
|
|
483
|
-
color: #999;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.card-check.black,
|
|
487
|
-
.card-check.black svg {
|
|
488
|
-
color: #666;
|
|
489
|
-
}
|
|
490
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="origin" :class="[currentClasses]" :id="`card-${messageIndex ? messageIndex : randomizeValue}`">
|
|
3
|
+
<transition name="fade">
|
|
4
|
+
<span v-if="newMessage" class="new-messages" v-text="`Nova mensagem`"></span>
|
|
5
|
+
</transition>
|
|
6
|
+
<div class="card box-shadow">
|
|
7
|
+
<div class="card-header" :style="resizeHeaderCard">
|
|
8
|
+
<div class="card-author">
|
|
9
|
+
<fa-icon :icon="currentIcon" />
|
|
10
|
+
<p v-if="author" class="text-bold" v-text="`${tratarTextoLongo(author)}`" :title="author"></p>
|
|
11
|
+
<p v-if="origin === 'principal' && login" v-text="`| ${login}`" :title="login"></p>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="card-right">
|
|
14
|
+
<div class="card-dates">
|
|
15
|
+
<div v-if="date" class="card-date" :title="`${dictionary.data_criacao}: ${origin === 'outros'
|
|
16
|
+
? formataTimezoneData(date)
|
|
17
|
+
: returnFormataDataHora(date)
|
|
18
|
+
}`">
|
|
19
|
+
<span v-text="origin === 'outros'
|
|
20
|
+
? formataTimezoneData(date)
|
|
21
|
+
: returnFormataDataHora(date)
|
|
22
|
+
"></span>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div v-if="hasExpand" class="card-expand" @click="cardExpand()">
|
|
26
|
+
<fa-icon :icon="['fas', 'expand-alt']" />
|
|
27
|
+
</div>
|
|
28
|
+
<div class="card-actions" v-if="customButtons && customButtons.length">
|
|
29
|
+
<span v-for="(button, index) in customButtons" :key="button.id || index" v-show="button.use"
|
|
30
|
+
@click="button.callback(returnParams(button.params))" :class="`${button.customClass || 'menu-mensagem'}`"
|
|
31
|
+
v-tippy :content="button.tippyContent">
|
|
32
|
+
<fa-icon :icon="['fas', button.icon || 'question-circle']" />
|
|
33
|
+
</span>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<p v-if="chipInfos.cod && chipInfos.desc" class="card-chip" :class="[chipInfosClasses]"
|
|
38
|
+
v-text="`${chipInfos.desc} (${chipInfos.cod})`" :title="`${chipInfos.desc} (${chipInfos.cod})`"></p>
|
|
39
|
+
<p class="card-message" v-html="formattedMessage"></p>
|
|
40
|
+
<div class="card-footer">
|
|
41
|
+
<template v-if="files && files.length">
|
|
42
|
+
<div class="card-file" v-for="(file, index) in files" :key="`${index}`">
|
|
43
|
+
<CardFile :file="file" :dictionary="dictionary" :domain="domain" />
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<CardCheck v-if="messageStatus" :messageStatus="messageStatus" :hasReply="hasReply" :replyMessage="replyMessage"
|
|
47
|
+
:tooltipContent="tooltipContent" @reply-msg="$emit('reply-msg')" />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
import { textoLongo } from "@/mixins/formatarTexto";
|
|
55
|
+
import { formataTimezoneData, formataDataHora } from "../../services/textFormatting";
|
|
56
|
+
import CardFile from "./CardFile";
|
|
57
|
+
import CardCheck from "./CardCheck";
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
components: { CardFile, CardCheck },
|
|
61
|
+
props: {
|
|
62
|
+
customClass: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false,
|
|
65
|
+
},
|
|
66
|
+
dictionary: {
|
|
67
|
+
type: Object,
|
|
68
|
+
required: true,
|
|
69
|
+
},
|
|
70
|
+
messageIndex: {
|
|
71
|
+
type: [Number, String],
|
|
72
|
+
required: true,
|
|
73
|
+
},
|
|
74
|
+
domain: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: true,
|
|
77
|
+
},
|
|
78
|
+
hasExpand: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
required: false,
|
|
81
|
+
default: true,
|
|
82
|
+
},
|
|
83
|
+
origin: {
|
|
84
|
+
type: String,
|
|
85
|
+
required: true,
|
|
86
|
+
},
|
|
87
|
+
author: {
|
|
88
|
+
type: String,
|
|
89
|
+
},
|
|
90
|
+
login: {
|
|
91
|
+
type: String,
|
|
92
|
+
},
|
|
93
|
+
message: {
|
|
94
|
+
type: String,
|
|
95
|
+
},
|
|
96
|
+
files: {
|
|
97
|
+
type: Array,
|
|
98
|
+
},
|
|
99
|
+
date: {
|
|
100
|
+
type: String,
|
|
101
|
+
},
|
|
102
|
+
chipInfos: {
|
|
103
|
+
type: Object,
|
|
104
|
+
},
|
|
105
|
+
newMessage: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
},
|
|
108
|
+
hasReply: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
},
|
|
111
|
+
replyMessage: {
|
|
112
|
+
type: String,
|
|
113
|
+
},
|
|
114
|
+
messageStatus: {
|
|
115
|
+
type: String,
|
|
116
|
+
},
|
|
117
|
+
tooltipContent: {
|
|
118
|
+
type: String,
|
|
119
|
+
},
|
|
120
|
+
resizeCard: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
required: false,
|
|
123
|
+
default: false,
|
|
124
|
+
},
|
|
125
|
+
customButtons: {
|
|
126
|
+
type: Array
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
data() {
|
|
130
|
+
return {
|
|
131
|
+
styleCard: "",
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
mixins: [textoLongo],
|
|
135
|
+
computed: {
|
|
136
|
+
randomizeValue() {
|
|
137
|
+
return `${Math.floor(Math.random() * 7770)}${Date.now()}`;
|
|
138
|
+
},
|
|
139
|
+
formattedMessage() {
|
|
140
|
+
if (this.message) {
|
|
141
|
+
const regex = /(\n|\r| )/g;
|
|
142
|
+
if (regex.test(this.message)) return this.message.replace(regex, "<br>");
|
|
143
|
+
}
|
|
144
|
+
return this.message;
|
|
145
|
+
},
|
|
146
|
+
currentIcon() {
|
|
147
|
+
return this.origin === "outros" ? ["fas", "user"] : ["fas", "headset"];
|
|
148
|
+
},
|
|
149
|
+
currentClasses() {
|
|
150
|
+
return `${this.origin === "outros" ? "card-cli" : "card-ope"} ${this.newMessage ? "newMessage" : ""
|
|
151
|
+
} ${this.customClass || ''}`;
|
|
152
|
+
},
|
|
153
|
+
chipInfosClasses() {
|
|
154
|
+
if (!this.chipInfos || !this.chipInfos.cod) return "";
|
|
155
|
+
const { cod } = this.chipInfos;
|
|
156
|
+
switch (cod) {
|
|
157
|
+
case 9:
|
|
158
|
+
case "9":
|
|
159
|
+
case 8:
|
|
160
|
+
case "8":
|
|
161
|
+
case "CANCELADA":
|
|
162
|
+
return "red";
|
|
163
|
+
case 3:
|
|
164
|
+
case "3":
|
|
165
|
+
case 6:
|
|
166
|
+
case "6":
|
|
167
|
+
case "AGENDADA":
|
|
168
|
+
return "yellow";
|
|
169
|
+
default:
|
|
170
|
+
return "";
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
resizeHeaderCard() {
|
|
174
|
+
if (this.resizeCard) {
|
|
175
|
+
this.styleCard = "flex-direction: column;";
|
|
176
|
+
} else {
|
|
177
|
+
this.styleCard = "flex-direction: row;";
|
|
178
|
+
}
|
|
179
|
+
return this.styleCard;
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
methods: {
|
|
183
|
+
formataTimezoneData(timezoneData) {
|
|
184
|
+
return formataTimezoneData(timezoneData);
|
|
185
|
+
},
|
|
186
|
+
returnFormataDataHora(dataHora) {
|
|
187
|
+
return formataDataHora(dataHora, false, false, this.dictionary);
|
|
188
|
+
},
|
|
189
|
+
cardExpand() {
|
|
190
|
+
this.$emit("card-expand", this.$props);
|
|
191
|
+
},
|
|
192
|
+
returnParams(params) {
|
|
193
|
+
const defaultParams = {
|
|
194
|
+
message: this.message,
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
if (!params) return defaultParams;
|
|
198
|
+
|
|
199
|
+
const keys = params.instanceKeys.split("|");
|
|
200
|
+
if (!keys || !keys.length)
|
|
201
|
+
return {
|
|
202
|
+
defaultParams,
|
|
203
|
+
...params.values,
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const customParams = { ...params.values };
|
|
207
|
+
keys.forEach((key) => {
|
|
208
|
+
if (this[key]) customParams[key] = this[key];
|
|
209
|
+
else console.warn(`Cant find ${key} on 'this' instance`);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
return Object.keys(customParams).length ? customParams : defaultParams;
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
</script>
|
|
217
|
+
|
|
218
|
+
<style>
|
|
219
|
+
.fade-enter-active,
|
|
220
|
+
.fade-leave-active {
|
|
221
|
+
transition: opacity 200ms;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.fade-enter,
|
|
225
|
+
.fade-leave-to {
|
|
226
|
+
opacity: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.card-cli,
|
|
230
|
+
.card-ope {
|
|
231
|
+
display: flex;
|
|
232
|
+
width: 95%;
|
|
233
|
+
margin: 5px 0;
|
|
234
|
+
position: relative;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.card-cli.newMessage,
|
|
238
|
+
.card-ope.newMessage {
|
|
239
|
+
margin-top: 30px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.new-messages {
|
|
243
|
+
position: absolute;
|
|
244
|
+
top: -30px;
|
|
245
|
+
width: 100%;
|
|
246
|
+
display: flex;
|
|
247
|
+
justify-content: center;
|
|
248
|
+
align-items: center;
|
|
249
|
+
margin: 2.5px 0;
|
|
250
|
+
background-color: lighten(#fff249, 15);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.card-cli .card {
|
|
254
|
+
border-left: 3px solid #90b823;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.card-ope {
|
|
258
|
+
align-self: flex-end;
|
|
259
|
+
background-color: lighten(#007535, 72);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.card-ope .card {
|
|
263
|
+
border-right: 3px solid #007535;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.card {
|
|
267
|
+
background-color: rgba(255, 255, 255, 0.9);
|
|
268
|
+
overflow: hidden;
|
|
269
|
+
width: 100%;
|
|
270
|
+
padding: 2.5px 5px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.card p {
|
|
274
|
+
word-break: break-all;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.card-header {
|
|
278
|
+
width: 100%;
|
|
279
|
+
border-bottom: 1px solid #ddd;
|
|
280
|
+
margin-bottom: 5px;
|
|
281
|
+
display: flex;
|
|
282
|
+
justify-content: space-between;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.card-header svg {
|
|
286
|
+
font-size: 16px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.card-right {
|
|
290
|
+
margin-right: -20px;
|
|
291
|
+
display: flex;
|
|
292
|
+
flex-direction: row-reverse;
|
|
293
|
+
align-items: center;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.card-author {
|
|
297
|
+
display: flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
margin-right: 10px;
|
|
300
|
+
overflow: hidden;
|
|
301
|
+
min-width: 14px;
|
|
302
|
+
max-width: calc(100% - 215px);
|
|
303
|
+
gap: 5px;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.card-author svg {
|
|
307
|
+
margin-right: 5px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.card-actions {
|
|
311
|
+
display: flex;
|
|
312
|
+
gap: 7px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.menu-mensagem {
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
padding: 1px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.card-canal {
|
|
321
|
+
flex: 1;
|
|
322
|
+
margin-right: 10px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.card-dates {
|
|
326
|
+
display: flex;
|
|
327
|
+
flex-direction: column;
|
|
328
|
+
margin-right: 10px;
|
|
329
|
+
padding: 5px 10px;
|
|
330
|
+
border-top-left-radius: 15px;
|
|
331
|
+
border-bottom-left-radius: 15px;
|
|
332
|
+
color: #fff;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.card-cli .card-dates {
|
|
336
|
+
background-color: #90b823;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.card-ope .card-dates {
|
|
340
|
+
background-color: #007535;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.card-date {
|
|
344
|
+
overflow: hidden;
|
|
345
|
+
display: flex;
|
|
346
|
+
align-content: center;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.card-date span {
|
|
350
|
+
white-space: nowrap;
|
|
351
|
+
text-overflow: ellipsis;
|
|
352
|
+
overflow: hidden;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.card-date svg {
|
|
356
|
+
margin-right: 5px;
|
|
357
|
+
color: #232323;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.card-expand {
|
|
361
|
+
display: flex;
|
|
362
|
+
justify-content: center;
|
|
363
|
+
align-items: center;
|
|
364
|
+
margin: 2.5px;
|
|
365
|
+
cursor: pointer;
|
|
366
|
+
opacity: 0.8;
|
|
367
|
+
transition: opacity 150ms;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.card-expand:hover {
|
|
371
|
+
opacity: 1;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.card-footer {
|
|
375
|
+
margin-top: 5px;
|
|
376
|
+
border-top: 1px solid #ddd;
|
|
377
|
+
display: flex;
|
|
378
|
+
flex-wrap: wrap;
|
|
379
|
+
min-height: 25px;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.card-chip {
|
|
383
|
+
font-size: 12.8px;
|
|
384
|
+
width: fit-content;
|
|
385
|
+
border-radius: 15px;
|
|
386
|
+
transition: all 150ms ease-in-out;
|
|
387
|
+
padding: 2.5px 7px;
|
|
388
|
+
color: rgb(31, 105, 193);
|
|
389
|
+
background-color: rgba(207, 216, 244, 0.6);
|
|
390
|
+
margin-bottom: 5px;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.card-chip:hover {
|
|
394
|
+
background-color: rgba(207, 216, 244, 1);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.card-chip.orange {
|
|
398
|
+
color: #e14924;
|
|
399
|
+
background-color: rgba(228, 92, 58, 0.15);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.card-chip.orange:hover {
|
|
403
|
+
background-color: rgba(228, 92, 58, 0.2);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.card-chip.yellow {
|
|
407
|
+
color: #f4a304;
|
|
408
|
+
background-color: rgba(252, 191, 73, 0.15);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.card-chip.yellow:hover {
|
|
412
|
+
background-color: rgba(252, 191, 73, 0.2);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.card-chip.red {
|
|
416
|
+
color: rgb(231, 76, 60);
|
|
417
|
+
background-color: rgba(231, 76, 60, 0.2);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.card-chip.red:hover {
|
|
421
|
+
background-color: rgba(231, 76, 60, 0.25);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.card-file {
|
|
425
|
+
width: 60px;
|
|
426
|
+
height: 50px;
|
|
427
|
+
margin-right: 5px;
|
|
428
|
+
display: flex;
|
|
429
|
+
justify-content: center;
|
|
430
|
+
align-items: center;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.card-reply {
|
|
434
|
+
cursor: pointer;
|
|
435
|
+
position: absolute;
|
|
436
|
+
right: 30px;
|
|
437
|
+
bottom: 5px;
|
|
438
|
+
font-size: 9.6px;
|
|
439
|
+
color: #67a332;
|
|
440
|
+
width: 14.4px;
|
|
441
|
+
height: 14.4px;
|
|
442
|
+
display: flex;
|
|
443
|
+
justify-content: center;
|
|
444
|
+
align-items: center;
|
|
445
|
+
border-radius: 50%;
|
|
446
|
+
background-color: #fff;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.card-reply svg {
|
|
450
|
+
margin-top: -1px;
|
|
451
|
+
margin-right: -1px;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.card-check {
|
|
455
|
+
position: absolute;
|
|
456
|
+
bottom: 5px;
|
|
457
|
+
right: 5px;
|
|
458
|
+
cursor: pointer;
|
|
459
|
+
font-size: 11.2px;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.card-check svg {
|
|
463
|
+
font-size: 12.8px;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.card-check.seen,
|
|
467
|
+
.card-check.seen svg {
|
|
468
|
+
color: #006daa;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.card-check.green,
|
|
472
|
+
.card-check.green svg {
|
|
473
|
+
color: #4f772d;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.card-check.red,
|
|
477
|
+
.card-check.red svg {
|
|
478
|
+
color: #ba181b;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.card-check.gray,
|
|
482
|
+
.card-check.gray svg {
|
|
483
|
+
color: #999;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.card-check.black,
|
|
487
|
+
.card-check.black svg {
|
|
488
|
+
color: #666;
|
|
489
|
+
}
|
|
490
|
+
</style>
|