vue-intergrall-plugins 0.0.242 → 0.0.245
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/dist/vue-intergrall-plugins.esm.js +365 -199
- package/dist/vue-intergrall-plugins.min.js +1 -1
- package/dist/vue-intergrall-plugins.ssr.js +368 -210
- package/package.json +1 -1
- package/src/lib-components/Chat/BtnDownloadAllFiles.vue +32 -0
- package/src/lib-components/Chat/TextFooter.vue +10 -3
- package/src/lib-components/Loader/Loader.vue +1 -0
- package/src/lib-components/Messages/ChatMessages.vue +28 -16
- package/src/lib-components/Templates/TemplateGenerator.vue +12 -5
- package/src/lib-components/Templates/TemplateMessage.vue +11 -0
- package/src/lib-components/Templates/TemplateSingle.vue +6 -1
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="text-footer-actions--btn" @click="$emit('click-trigger')" :title="dictionary.msg_baixar_todos_anexos">
|
|
3
|
+
<span class="multiplos">
|
|
4
|
+
<fa-icon :icon="['fas', 'download']" />
|
|
5
|
+
<fa-icon :icon="['fas', 'paperclip']" class="small" />
|
|
6
|
+
</span>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<style scoped>
|
|
11
|
+
.multiplos {
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
.multiplos svg {
|
|
15
|
+
font-size: .95rem
|
|
16
|
+
}
|
|
17
|
+
.multiplos svg.small {
|
|
18
|
+
font-size: .7rem!important;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
export default {
|
|
24
|
+
props: {
|
|
25
|
+
dictionary: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: {},
|
|
28
|
+
required: false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
@@ -38,7 +38,13 @@
|
|
|
38
38
|
:message="message"
|
|
39
39
|
:maxCharacters="textareaSettings.maxCharacters"
|
|
40
40
|
/>
|
|
41
|
-
<div v-if="buttons.hasFiles || buttons.hasAudio || buttons.hasExpand || formattedMessageSettings.hasStandardMessages || buttons.hasScreenShare" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
|
|
41
|
+
<div v-if="buttons.hasFiles || buttons.hasAudio || buttons.hasExpand || formattedMessageSettings.hasStandardMessages || buttons.hasScreenShare || buttons.hasDownloadAll" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
|
|
42
|
+
<BtnDownloadAllFiles
|
|
43
|
+
v-show="buttons.hasDownloadAll && !audioFile"
|
|
44
|
+
@click-trigger="$emit('handle-download-files')"
|
|
45
|
+
:dictionary="dictionary"
|
|
46
|
+
:ref="`${textId}-download-files`"
|
|
47
|
+
/>
|
|
42
48
|
<BtnScreenShare
|
|
43
49
|
v-show="buttons.hasScreenShare && !audioFile"
|
|
44
50
|
@handle-screen-share="handleScreenShare"
|
|
@@ -123,9 +129,10 @@ import BtnExpand from "./BtnExpand"
|
|
|
123
129
|
import BtnStandardMessages from "./BtnStandardMessages"
|
|
124
130
|
import StandardMessages from "./StandardMessages"
|
|
125
131
|
import BtnScreenShare from "./BtnScreenShare"
|
|
132
|
+
import BtnDownloadAllFiles from './BtnDownloadAllFiles'
|
|
126
133
|
|
|
127
134
|
export default {
|
|
128
|
-
components: { BtnEmojis, Loader, BtnMic, BtnFiles, BtnExpand, RemainingCharacters, BtnStandardMessages, StandardMessages, BtnScreenShare },
|
|
135
|
+
components: { BtnEmojis, Loader, BtnMic, BtnFiles, BtnExpand, RemainingCharacters, BtnStandardMessages, StandardMessages, BtnScreenShare, BtnDownloadAllFiles },
|
|
129
136
|
mixins: [ clickaway ],
|
|
130
137
|
props: {
|
|
131
138
|
buttons: {
|
|
@@ -606,7 +613,7 @@ ul {
|
|
|
606
613
|
align-items: center;
|
|
607
614
|
justify-content: flex-end;
|
|
608
615
|
position: absolute;
|
|
609
|
-
top: -
|
|
616
|
+
top: -30px;
|
|
610
617
|
right: 35px;
|
|
611
618
|
background-color: #FAFAFA;
|
|
612
619
|
}
|
|
@@ -230,27 +230,39 @@ export default {
|
|
|
230
230
|
},
|
|
231
231
|
adjustFontColor(cor) {
|
|
232
232
|
try {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
result = result ? {
|
|
236
|
-
r: parseInt(result[1], 16),
|
|
237
|
-
g: parseInt(result[2], 16),
|
|
238
|
-
b: parseInt(result[3], 16)
|
|
239
|
-
} : null
|
|
240
|
-
|
|
233
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(cor);
|
|
234
|
+
|
|
241
235
|
if(!result) return
|
|
242
|
-
|
|
243
|
-
const { r, g, b }= result
|
|
244
236
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
237
|
+
var r = parseInt(result[1], 16);
|
|
238
|
+
var g = parseInt(result[2], 16);
|
|
239
|
+
var b = parseInt(result[3], 16);
|
|
240
|
+
|
|
241
|
+
r /= 255, g /= 255, b /= 255;
|
|
242
|
+
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
243
|
+
var h, s, l = (max + min) / 2;
|
|
244
|
+
|
|
245
|
+
if(max == min){
|
|
246
|
+
h = s = 0; // achromatic
|
|
247
|
+
} else {
|
|
248
|
+
var d = max - min;
|
|
249
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
250
|
+
switch(max) {
|
|
251
|
+
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
|
252
|
+
case g: h = (b - r) / d + 2; break;
|
|
253
|
+
case b: h = (r - g) / d + 4; break;
|
|
254
|
+
}
|
|
255
|
+
h /= 6;
|
|
256
|
+
}
|
|
249
257
|
|
|
250
|
-
|
|
258
|
+
s = s*100;
|
|
259
|
+
s = Math.round(s);
|
|
260
|
+
l = l*100;
|
|
261
|
+
l = Math.round(l);
|
|
262
|
+
h = Math.round(360*h);
|
|
251
263
|
|
|
252
264
|
const root = document.documentElement
|
|
253
|
-
root.style.setProperty('--text-color',
|
|
265
|
+
root.style.setProperty('--text-color', l <= 50 ? "#FFF" : "#111B21")
|
|
254
266
|
}catch(e) {
|
|
255
267
|
console.error("Erro ao ajustar a cor da mensagem: ", e)
|
|
256
268
|
}
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
:reduce="template => template.cod"
|
|
12
12
|
:clearable="false"
|
|
13
13
|
@input="setTemplate"
|
|
14
|
-
:getOptionLabel="template => template.label"
|
|
14
|
+
:getOptionLabel="template => template.label"
|
|
15
|
+
ref="template-v-select"
|
|
16
|
+
>
|
|
15
17
|
<div slot="no-options" v-text="dictionary.msg_sem_resultados"></div>
|
|
16
18
|
</v-select>
|
|
17
19
|
</div>
|
|
@@ -131,6 +133,9 @@
|
|
|
131
133
|
this.selectedTemplate = this.templates[key]
|
|
132
134
|
this.codTemplate = key
|
|
133
135
|
this.$emit('selected-template', key)
|
|
136
|
+
this.$nextTick(() => {
|
|
137
|
+
if(this.$root.$refs[`template-single-${this.identifier}`]) this.$root.$refs[`template-single-${this.identifier}`].handleInitialFocus()
|
|
138
|
+
})
|
|
134
139
|
}else{
|
|
135
140
|
this.selectedTemplate = null
|
|
136
141
|
}
|
|
@@ -145,6 +150,9 @@
|
|
|
145
150
|
this.adjustOnSelect()
|
|
146
151
|
}
|
|
147
152
|
}
|
|
153
|
+
if(!this.codTemplate && this.$refs["template-v-select"] && this.$refs["template-v-select"].$el) {
|
|
154
|
+
this.$refs["template-v-select"].$el.querySelector("input").focus()
|
|
155
|
+
}
|
|
148
156
|
},
|
|
149
157
|
selectIfHasContact24h() {
|
|
150
158
|
if(this.templates['envio_msg']) {
|
|
@@ -383,7 +391,6 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
|
|
|
383
391
|
align-items: center;
|
|
384
392
|
}
|
|
385
393
|
.tg-btn button {
|
|
386
|
-
outline: unset;
|
|
387
394
|
border: unset;
|
|
388
395
|
display: block;
|
|
389
396
|
min-width: 180px;
|
|
@@ -392,7 +399,7 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
|
|
|
392
399
|
font-weight: 500;
|
|
393
400
|
background-color: #007bff;
|
|
394
401
|
color: #FFF;
|
|
395
|
-
transition
|
|
402
|
+
transition: transform 300ms ease-in-out;
|
|
396
403
|
user-select: none;
|
|
397
404
|
cursor: pointer;
|
|
398
405
|
box-shadow: inset 0 -2px rgba(0, 0, 0, 0.2);
|
|
@@ -425,11 +432,11 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
|
|
|
425
432
|
transform: translateY(1px);
|
|
426
433
|
}
|
|
427
434
|
.tg-btn button:focus, .tg-btn button:active {
|
|
428
|
-
outline:
|
|
435
|
+
outline: 2px solid black;
|
|
429
436
|
}
|
|
430
437
|
.tg-btn.small-btn {
|
|
431
438
|
width: auto;
|
|
432
|
-
margin
|
|
439
|
+
margin: 0 5px;
|
|
433
440
|
}
|
|
434
441
|
.tg-btn.small-btn svg {
|
|
435
442
|
margin-right: 0;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
:placeholderMessage="'Escreva sua mensagem'"
|
|
12
12
|
:ignoreHideTextarea="true"
|
|
13
13
|
:dictionary="dictionary"
|
|
14
|
+
ref="text-footer-template-message"
|
|
14
15
|
></TextFooter>
|
|
15
16
|
<div class="tg-btn" :class="{'small-btn' : iconButton}" v-if="hasButton">
|
|
16
17
|
<button @click="sendMessage">
|
|
@@ -47,7 +48,17 @@ export default {
|
|
|
47
48
|
required: true
|
|
48
49
|
}
|
|
49
50
|
},
|
|
51
|
+
mounted() {
|
|
52
|
+
this.initFocus()
|
|
53
|
+
},
|
|
50
54
|
methods: {
|
|
55
|
+
initFocus() {
|
|
56
|
+
this.$nextTick(() => {
|
|
57
|
+
if(this.$refs["text-footer-template-message"] && this.$refs["text-footer-template-message"].$el) {
|
|
58
|
+
this.$refs["text-footer-template-message"].$el.querySelector("textarea").focus()
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
},
|
|
51
62
|
sendMessage() {
|
|
52
63
|
this.$emit('click-trigger')
|
|
53
64
|
},
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
54
54
|
<div class="tg-btn" :class="{'small-btn' : iconButton}" v-if="hasButton">
|
|
55
|
-
<button @click="$emit('click-trigger')">
|
|
55
|
+
<button @click="$emit('click-trigger')" ref="template-single-button">
|
|
56
56
|
<template v-if="!iconButton">
|
|
57
57
|
<fa-icon :icon="['fas', 'paper-plane']" />
|
|
58
58
|
{{ dictionary.btn_contatar_clientes }}
|
|
@@ -121,6 +121,11 @@ export default {
|
|
|
121
121
|
})
|
|
122
122
|
},
|
|
123
123
|
methods: {
|
|
124
|
+
handleInitialFocus() {
|
|
125
|
+
const allInputs = document.querySelectorAll(`.input-var-${this.identifier}`);
|
|
126
|
+
if(allInputs.length) allInputs[0].focus()
|
|
127
|
+
else if(this.$refs["template-single-button"]) this.$refs["template-single-button"].focus()
|
|
128
|
+
},
|
|
124
129
|
limparInputVar() {
|
|
125
130
|
const allInputs = document.querySelectorAll(`.input-var-${this.identifier}`);
|
|
126
131
|
allInputs.forEach((input) => {
|