vue-intergrall-plugins 0.0.243 → 0.0.246
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 +344 -181
- package/dist/vue-intergrall-plugins.min.js +1 -1
- package/dist/vue-intergrall-plugins.ssr.js +363 -208
- 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/Templates/TemplateGenerator.vue +13 -5
- package/src/lib-components/Templates/TemplateMessage.vue +11 -0
- package/src/lib-components/Templates/TemplateSingle.vue +24 -3
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
|
}
|
|
@@ -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,11 +133,17 @@
|
|
|
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
|
}
|
|
137
142
|
this.adjustOnSelect()
|
|
138
143
|
},
|
|
144
|
+
focusSelect() {
|
|
145
|
+
if(this.$refs["template-v-select"] && this.$refs["template-v-select"].$el) this.$refs["template-v-select"].$el.querySelector("input").focus()
|
|
146
|
+
},
|
|
139
147
|
selectIfIsUnique() {
|
|
140
148
|
if(Object.keys(this.templates).length === 1) {
|
|
141
149
|
for(let key in this.templates) {
|
|
@@ -145,6 +153,7 @@
|
|
|
145
153
|
this.adjustOnSelect()
|
|
146
154
|
}
|
|
147
155
|
}
|
|
156
|
+
if(!this.codTemplate) this.focusSelect()
|
|
148
157
|
},
|
|
149
158
|
selectIfHasContact24h() {
|
|
150
159
|
if(this.templates['envio_msg']) {
|
|
@@ -383,7 +392,6 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
|
|
|
383
392
|
align-items: center;
|
|
384
393
|
}
|
|
385
394
|
.tg-btn button {
|
|
386
|
-
outline: unset;
|
|
387
395
|
border: unset;
|
|
388
396
|
display: block;
|
|
389
397
|
min-width: 180px;
|
|
@@ -392,7 +400,7 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
|
|
|
392
400
|
font-weight: 500;
|
|
393
401
|
background-color: #007bff;
|
|
394
402
|
color: #FFF;
|
|
395
|
-
transition
|
|
403
|
+
transition: transform 300ms ease-in-out;
|
|
396
404
|
user-select: none;
|
|
397
405
|
cursor: pointer;
|
|
398
406
|
box-shadow: inset 0 -2px rgba(0, 0, 0, 0.2);
|
|
@@ -425,11 +433,11 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
|
|
|
425
433
|
transform: translateY(1px);
|
|
426
434
|
}
|
|
427
435
|
.tg-btn button:focus, .tg-btn button:active {
|
|
428
|
-
outline:
|
|
436
|
+
outline: 2px solid black;
|
|
429
437
|
}
|
|
430
438
|
.tg-btn.small-btn {
|
|
431
439
|
width: auto;
|
|
432
|
-
margin
|
|
440
|
+
margin: 0 5px;
|
|
433
441
|
}
|
|
434
442
|
.tg-btn.small-btn svg {
|
|
435
443
|
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) => {
|
|
@@ -166,6 +171,8 @@ export default {
|
|
|
166
171
|
setEvent(input) {
|
|
167
172
|
const varList = input.nextSibling
|
|
168
173
|
|
|
174
|
+
const currentInstance = this
|
|
175
|
+
|
|
169
176
|
input.setAttribute("placeholder", `{{var_${this.lastVar}}}`);
|
|
170
177
|
input.setAttribute("id", `{{var_${this.lastVar}}}`);
|
|
171
178
|
input.addEventListener("input", (event) => {
|
|
@@ -176,11 +183,26 @@ export default {
|
|
|
176
183
|
input.classList.remove("invalid");
|
|
177
184
|
input.classList.add("active");
|
|
178
185
|
if(varList) {
|
|
186
|
+
const handleNextFocus = () => {
|
|
187
|
+
const allInputs = document.querySelectorAll(`.input-var-${currentInstance.identifier}`)
|
|
188
|
+
let stop = false
|
|
189
|
+
if(allInputs.length) {
|
|
190
|
+
allInputs.forEach(elem => {
|
|
191
|
+
if(!elem.value && !stop) {
|
|
192
|
+
stop = true
|
|
193
|
+
elem.focus()
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
if(!stop && this.$refs["template-single-button"]) this.$refs["template-single-button"].focus()
|
|
198
|
+
}
|
|
199
|
+
|
|
179
200
|
for(let i = 0; i < varList.children.length; i++) {
|
|
180
201
|
varList.children[i].addEventListener("click", function() {
|
|
181
202
|
input.value = `[${this.innerText}]`
|
|
182
203
|
input.classList.add("active")
|
|
183
204
|
input.dispatchEvent(new Event('input'))
|
|
205
|
+
handleNextFocus()
|
|
184
206
|
})
|
|
185
207
|
}
|
|
186
208
|
|
|
@@ -208,8 +230,7 @@ export default {
|
|
|
208
230
|
if(varList) varList.classList.remove("visible")
|
|
209
231
|
});
|
|
210
232
|
input.addEventListener("keydown", (event) => {
|
|
211
|
-
if (event.keyCode == 13 && this.hasButton)
|
|
212
|
-
this.$emit("click-trigger");
|
|
233
|
+
if (event.keyCode == 13 && this.hasButton) this.$emit("click-trigger");
|
|
213
234
|
});
|
|
214
235
|
this.lastVar += 1;
|
|
215
236
|
},
|