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
@@ -11,13 +11,28 @@
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>
18
20
  <template v-if="selectedTemplate">
19
21
  <div class="tg-component" v-if="selectedTemplate.components">
20
- <TemplateSingle :template="selectedTemplate" @set-vars="setFinalMessage" :hasButton="hasButton" :iconButton="iconButton" @click-trigger="$emit('click-trigger')" :identifier="identifier" :allVariables="allVariables" :dictionary="dictionary" />
22
+ <TemplateSingle
23
+ :key="codTemplate"
24
+ :template="selectedTemplate"
25
+ @set-vars="setFinalMessage"
26
+ @set-file-var="setFileVar"
27
+ :hasButton="hasButton"
28
+ :iconButton="iconButton"
29
+ @click-trigger="$emit('click-trigger')"
30
+ :identifier="identifier"
31
+ :allVariables="allVariables"
32
+ :dictionary="dictionary"
33
+ :hasSecondaryButton="hasSecondaryButton"
34
+ @dispatch-clients-with-bot="$emit('dispatch-clients-with-bot')"
35
+ />
21
36
  </div>
22
37
  <div class="tg-component" v-else>
23
38
  <TemplateMessage @final-message="setMessage" :hasButton="hasButton" :iconButton="iconButton" @click-trigger="$emit('click-trigger', true)" :dictionary="dictionary" />
@@ -38,6 +53,11 @@
38
53
  type: Object,
39
54
  required: true
40
55
  },
56
+ hasSecondaryButton: {
57
+ type: Boolean,
58
+ required: false,
59
+ default: false
60
+ },
41
61
  hasButton: {
42
62
  type: Boolean,
43
63
  required: false,
@@ -71,18 +91,24 @@
71
91
  dictionary: {
72
92
  type: Object,
73
93
  required: true
94
+ },
95
+ selectInitial: {
96
+ type: Boolean,
97
+ required: false,
98
+ default: true
74
99
  }
75
100
  },
76
101
  data() {
77
102
  return {
78
103
  templateOptions: [],
79
104
  codTemplate: {},
80
- selectedTemplate: null
105
+ selectedTemplate: null,
106
+ hasFile: false
81
107
  }
82
108
  },
83
109
  mounted() {
84
110
  this.setTemplateOptions()
85
- this.selectIfIsUnique()
111
+ if(this.selectInitial) this.selectIfIsUnique()
86
112
  this.selectIfHasContact24h()
87
113
  },
88
114
  methods: {
@@ -91,9 +117,11 @@
91
117
  for (let key in template) {
92
118
  if (key === "components" && Array.isArray(template[key])) {
93
119
  template[key].map((component) => {
94
- component.parameters.map((param) => {
95
- fullText += param.text;
96
- });
120
+ if(component && component.parameters && component.parameters.length) {
121
+ component.parameters.map((param) => {
122
+ fullText += param.text;
123
+ });
124
+ }
97
125
  });
98
126
  }
99
127
  }
@@ -129,11 +157,18 @@
129
157
  this.selectedTemplate = this.templates[key]
130
158
  this.codTemplate = key
131
159
  this.$emit('selected-template', key)
160
+ this.$nextTick(() => {
161
+ if(this.$root.$refs[`template-single-${this.identifier}`]) this.$root.$refs[`template-single-${this.identifier}`].handleInitialFocus()
162
+ })
132
163
  }else{
133
164
  this.selectedTemplate = null
134
165
  }
166
+ // if(this.hasFile) this.setFileVar(false)
135
167
  this.adjustOnSelect()
136
168
  },
169
+ focusSelect() {
170
+ if(this.$refs["template-v-select"] && this.$refs["template-v-select"].$el) this.$refs["template-v-select"].$el.querySelector("input").focus()
171
+ },
137
172
  selectIfIsUnique() {
138
173
  if(Object.keys(this.templates).length === 1) {
139
174
  for(let key in this.templates) {
@@ -143,6 +178,7 @@
143
178
  this.adjustOnSelect()
144
179
  }
145
180
  }
181
+ if(!this.codTemplate) this.focusSelect()
146
182
  },
147
183
  selectIfHasContact24h() {
148
184
  if(this.templates['envio_msg']) {
@@ -162,40 +198,54 @@
162
198
  for(let index in this.selectedTemplate) {
163
199
  if(index === "components" && Array.isArray(this.selectedTemplate[index])) {
164
200
  const arrComponents = this.selectedTemplate[index]
165
- arrComponents.map(component => {
166
- component.parameters.map(message => {
167
- message.currentText = message.text
168
-
169
- let keyIndex = 0
170
- while(keyIndex < keys.length) {
171
- const varName = `{{${keys[keyIndex]}}}`
172
- if(message.text.indexOf(varName) != -1) {
173
- /**Gerando os obejetos de parametros da notifica??o para o component */
174
- if(component.type === "header") {
175
- this.selectedTemplate['parameters'][component.type] = {}
176
- //Header s? pode ter uma vari?vel
177
- this.selectedTemplate['parameters'][component.type] = {
178
- tipo: "text",
179
- text: values[keyIndex]
201
+ if(arrComponents && arrComponents.length) {
202
+ arrComponents.map(component => {
203
+ if(component && component.parameters && component.parameters.length) {
204
+ component.parameters.map(message => {
205
+ message.currentText = message.text
206
+ let keyIndex = 0
207
+ while(keyIndex < keys.length) {
208
+ const varName = `{{${keys[keyIndex]}}}`
209
+ if(message.text.indexOf(varName) != -1) {
210
+ /**Gerando os obejetos de parametros da notificacao para o component */
211
+ if(component.type === "header" && !this.selectedTemplate['parameters'][component.type]) {
212
+ this.selectedTemplate['parameters'][component.type] = {}
213
+ //Header so pode ter uma vari?vel
214
+ this.selectedTemplate['parameters'][component.type] = {
215
+ tipo: "text",
216
+ text: values[keyIndex]
217
+ }
218
+ } else if(!this.selectedTemplate['parameters'][component.type]) {
219
+ this.selectedTemplate['parameters'][component.type] = new Array()
220
+ }
221
+ //Aplicando valores das v?riaveis dentro dos outros componentes com execess?o do header
222
+ if(this.selectedTemplate['parameters'][component.type] && component.type !== 'header') {
223
+ this.selectedTemplate['parameters'][component.type].push(values[keyIndex])
224
+ }
225
+ message.currentText = message.currentText.replace(varName, values[keyIndex])
180
226
  }
181
- } else if(!this.selectedTemplate['parameters'][component.type]) {
182
- this.selectedTemplate['parameters'][component.type] = new Array()
183
- }
184
- //Aplicando valores das v?riaveis dentro dos outros componentes com execess?o do header
185
- if(this.selectedTemplate['parameters'][component.type] && component.type !== 'header') {
186
- this.selectedTemplate['parameters'][component.type].push(values[keyIndex])
227
+ keyIndex++
187
228
  }
188
- message.currentText = message.currentText.replace(varName, values[keyIndex])
229
+ })
230
+ }else if(component.type == 'header' && component.parameters.seq) {
231
+ if(this.hasFile) {
232
+ if(!this.selectedTemplate['parameters'][component.type]) this.selectedTemplate['parameters'][component.type] = new Array()
233
+ this.selectedTemplate['parameters'][component.type].push({ tipo: 'image', template: component.parameters.seq, link: '' })
234
+ }else {
235
+ delete this.selectedTemplate['parameters'][component.type]
189
236
  }
190
- keyIndex++
191
237
  }
192
238
  })
193
- })
239
+ }
194
240
  }
195
241
  }
196
-
197
242
  this.$emit("template-data", this.selectedTemplate)
198
243
  },
244
+ setFileVar(file) {
245
+ this.hasFile = file ? true : false
246
+ this.$emit("set-file-var", file)
247
+ if(file) this.$emit("template-data", this.selectedTemplate)
248
+ },
199
249
  setMessage(message) {
200
250
  this.$emit("static-message", message)
201
251
  }
@@ -230,6 +280,67 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
230
280
  margin-right: 5px;
231
281
  }
232
282
 
283
+ .ts-image-type {
284
+ display: flex;
285
+ align-items: center;
286
+ }
287
+
288
+ .ts-image-type img {
289
+ cursor: pointer;
290
+ }
291
+
292
+ .ts-image-type svg {
293
+ font-size: 25px;
294
+ cursor: pointer;
295
+ }
296
+
297
+ .ts-image-type .select-image {
298
+ color: #838383;
299
+ }
300
+
301
+ .color-red {
302
+ color: #E74C3C;
303
+ }
304
+
305
+ .color-blue {
306
+ color: #007BFF;
307
+ }
308
+
309
+ .color-black {
310
+ color: #333
311
+ }
312
+
313
+ .color-purple {
314
+ color: #a312a3
315
+ }
316
+
317
+ .custom-tooltip-image {
318
+ display: flex;
319
+ justify-content: center;
320
+ align-items: center;
321
+ overflow: visible;
322
+ padding: 5px;
323
+ }
324
+
325
+ .custom-tooltip-image img {
326
+ max-width: 75px;
327
+ max-height: 75px;
328
+ }
329
+
330
+ .ts-button {
331
+ background-color: #FFF;
332
+ border-radius: 10px;
333
+ display: flex;
334
+ justify-content: center;
335
+ align-items: center;
336
+ padding: 3px 15px;
337
+ transition: background-color 150ms ease-in-out;
338
+ }
339
+
340
+ .ts-button:hover {
341
+ background-color: rgb(253, 253, 253);
342
+ }
343
+
233
344
  .tg-select {
234
345
  flex: 1;
235
346
  height: 34px;
@@ -251,8 +362,14 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
251
362
  text-overflow: ellipsis;
252
363
  flex: 1;
253
364
  }
254
- .tg-select .vs__selected-options > input {
255
- flex-grow: 0;
365
+
366
+ .vs__dropdown-option.vs__dropdown-option--selected {
367
+ background-color: rgb(26, 95, 173)!important;
368
+ color: white;
369
+ }
370
+
371
+ .vs__dropdown-menu li {
372
+ padding: 10px 15px;
256
373
  }
257
374
 
258
375
  .vs__dropdown-option {
@@ -275,6 +392,7 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
275
392
  width: 100%;
276
393
  display: flex;
277
394
  justify-content: space-between;
395
+ gap: 10px;
278
396
  }
279
397
 
280
398
  .ts-content {
@@ -284,10 +402,22 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
284
402
  --input-border-default: #007BFF;
285
403
  --input-border-error: #E74C3C;
286
404
  --placeholder-color: #BBB;
405
+ --border-radius: 5px;
287
406
 
288
407
  flex: 2;
289
- font-size: .7rem;
408
+ font-size: 11.2px;
290
409
  padding: 10px 0;
410
+ display: flex;
411
+ flex-direction: column;
412
+ }
413
+ .order-1 {
414
+ order: 1
415
+ }
416
+ .custom-box-shadow-bottom {
417
+ box-shadow: 0px 3px 4px -3px rgba(0, 0, 0, .3);
418
+ }
419
+ .custom-border-gray {
420
+ border: 1px solid var(--border-color)!important;
291
421
  }
292
422
  .ts-content header, .ts-content section, .ts-content footer {
293
423
  padding: 3px 5px;
@@ -298,8 +428,8 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
298
428
  border-left: 1px solid var(--border-color);
299
429
  }
300
430
  .ts-content header {
301
- border-top-left-radius: 5px;
302
- border-top-right-radius: 5px;
431
+ border-top-left-radius: var(--border-radius);
432
+ border-top-right-radius: var(--border-radius);
303
433
  border-top: 1px solid var(--border-color);
304
434
  }
305
435
  .ts-content header { font-weight: 550 }
@@ -307,20 +437,20 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
307
437
  line-height: 25px;
308
438
  }
309
439
  .ts-content section.margin-bottom {
310
- border-bottom-left-radius: 5px;
311
- border-bottom-right-radius: 5px;
440
+ border-bottom-left-radius: var(--border-radius);
441
+ border-bottom-right-radius: var(--border-radius);
312
442
  border-bottom: 1px solid var(--border-color);
313
443
  }
314
- .ts-content footer {
444
+ .ts-content footer, .custom-footer-style {
315
445
  border: 1px solid var(--border-color);
316
446
  border-top: unset;
317
- border-bottom-left-radius: 5px;
318
- border-bottom-right-radius: 5px;
447
+ border-bottom-left-radius: var(--border-radius);
448
+ border-bottom-right-radius: var(--border-radius);
319
449
  }
320
450
  .ts-content input {
321
451
  border: 1px solid transparent;
322
452
  outline: 0;
323
- font-size: .8rem;
453
+ font-size: 12.8px;
324
454
  padding: 2.5px 5px;
325
455
  background-color: var(--input-background-color);
326
456
  }
@@ -359,7 +489,8 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
359
489
  opacity: .9;
360
490
  cursor: pointer;
361
491
  font-weight: 550;
362
- padding: 2px 5px;
492
+ padding: 2px 3px;
493
+ font-size: 12.8px;
363
494
  transition: background-color 150ms;
364
495
  }
365
496
  .ts-dropdown li:hover, .ts-dropdown li:focus-within, .ts-dropdown li:focus {
@@ -372,13 +503,12 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
372
503
  opacity: 1;
373
504
  }
374
505
  .tg-btn {
375
- width: 40%;
506
+ width: auto;
376
507
  display: flex;
377
508
  justify-content: center;
378
509
  align-items: center;
379
510
  }
380
511
  .tg-btn button {
381
- outline: unset;
382
512
  border: unset;
383
513
  display: block;
384
514
  min-width: 180px;
@@ -387,12 +517,16 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
387
517
  font-weight: 500;
388
518
  background-color: #007bff;
389
519
  color: #FFF;
390
- transition-duration: 300ms;
520
+ transition: transform 300ms ease-in-out;
391
521
  user-select: none;
392
522
  cursor: pointer;
393
523
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.2);
394
524
  opacity: 0.9;
395
- border-radius: 25px;
525
+ border-radius: 2.5px;
526
+ }
527
+ .tg-btn button > svg{
528
+ margin-right: 5px;
529
+ color: #003166
396
530
  }
397
531
  .tg-btn button:hover {
398
532
  opacity: 1;
@@ -416,11 +550,14 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
416
550
  transform: translateY(1px);
417
551
  }
418
552
  .tg-btn button:focus, .tg-btn button:active {
419
- outline: unset;
553
+ outline: 2px solid black;
420
554
  }
421
555
  .tg-btn.small-btn {
422
556
  width: auto;
423
- margin-left: 5px;
557
+ margin: 0 5px;
558
+ }
559
+ .tg-btn.small-btn svg {
560
+ margin-right: 0;
424
561
  }
425
562
  .tg-btn.small-btn button {
426
563
  min-width: 35px;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="ts-container">
3
3
  <div class="ts-content">
4
- <section :class="{'tm-container' : hasButton}">
4
+ <section :class="{'tm-container custom-box-shadow-bottom' : hasButton}">
5
5
  <TextFooter
6
6
  :textId="'var_1'"
7
7
  width="full"
@@ -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
  },