vue-intergrall-plugins 0.0.203 → 0.0.206

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.
@@ -1,7 +1,8 @@
1
1
  <template>
2
- <div class="single-file-preview">
2
+ <div v-if="textId" class="single-file-preview" :ref="`sfp-${textId}`">
3
+ <fa-icon :icon="['fas', 'times-circle']" class="close-icon" @click="$emit('close')" />
3
4
  <span @click="deleteFile" :title="dictionary.msg_cancelar_anexo" class="text-footer-exclude-file">
4
- <fa-icon :icon="['fas', 'times-circle']" />
5
+ <fa-icon :icon="['fas', 'trash-alt']" />
5
6
  </span>
6
7
  <div class="text-footer-invalid-format" v-if="fileFormatError">
7
8
  <h3 v-text="dictionary.titulo_msg_formato_invalido"></h3>
@@ -23,6 +24,7 @@
23
24
  <script>
24
25
  export default {
25
26
  props: {
27
+ textId: { type: String, required: true },
26
28
  dictionary: { type: Object, required: true },
27
29
  file: { type: File, required: false },
28
30
  isDoc: { type: Boolean, required: false },
@@ -30,18 +32,37 @@ export default {
30
32
  validFileFormats: { type: String, required: false, default: "" },
31
33
  imagePreview: { type: String, required: false }
32
34
  },
35
+ mounted() {
36
+ this.setPosition()
37
+ },
33
38
  methods: {
34
39
  deleteFile() {
35
40
  this.$emit("delete-file")
36
41
  },
37
42
  openImage() {
38
43
  this.$emit("open-image")
44
+ },
45
+ setPosition() {
46
+ try {
47
+ this.$refs[`sfp-${this.textId}`].parentElement.style.bottom = `${this.$root.$refs[`tf-${this.textId}`].$el.offsetHeight}px`
48
+ }catch(e) {
49
+ console.error("Erro ao setar a posicao do single file preview: ", e)
50
+ }
39
51
  }
40
52
  }
41
53
  }
42
54
  </script>
43
55
 
44
56
  <style>
57
+ .single-file-preview .close-icon {
58
+ color: #E74C3C;
59
+ cursor: pointer;
60
+ opacity: .9;
61
+ transition: opacity 300ms;
62
+ }
63
+ .single-file-preview .close-icon:hover {
64
+ opacity: 1;
65
+ }
45
66
  .text-footer-invalid-format {
46
67
  color: #222;
47
68
  padding: 10px;
@@ -1,18 +1,5 @@
1
1
  <template>
2
2
  <div class="text-footer-hsm-container">
3
- <v-select
4
- appendToBody
5
- :calculatePosition="calculateSelectPosition"
6
- :style="`background-color: ${backgroundColor}`"
7
- class="text-footer-v-select"
8
- :options="formatted_messages_1"
9
- label="value"
10
- v-model="key_1"
11
- :reduce="formatted_messages_1 => formatted_messages_1.cod"
12
- @input="inputSelectKey1"
13
- >
14
- <div slot="no-options"> {{ dictionary.msg_sem_resultados }} </div>
15
- </v-select>
16
3
  <div class="transition-selects">
17
4
  <transition name="fade" mode="out-in">
18
5
  <div v-if="formatted_messages_2.length && key_1">
@@ -114,7 +101,7 @@ export default {
114
101
  key_2: "",
115
102
  formatted_messages_3: [],
116
103
  key_3: "",
117
- loadingReq: false
104
+ loadingReq: true
118
105
  }
119
106
  },
120
107
  mounted() {
@@ -158,7 +145,8 @@ export default {
158
145
  }).catch(e => {
159
146
  this.loadingReq = false
160
147
  this.$toasted.global.defaultError()
161
- console.error("Error in getStandardMessages: ", e)
148
+ this.closeStandardMessages()
149
+ console.error("Error in getStandardMessages: ", e)
162
150
  })
163
151
  }catch(e) {
164
152
  this.loadingReq = false
@@ -43,7 +43,7 @@
43
43
  <fa-icon :icon="['fas', 'paper-plane']" />
44
44
  </span>
45
45
  </div>
46
- <div v-if="buttons.hasFiles || buttons.hasAudio || buttons.hasExpand" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
46
+ <div v-if="buttons.hasFiles || buttons.hasAudio || buttons.hasExpand || formattedMessageSettings.hasStandardMessages" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
47
47
  <BtnMic
48
48
  v-show="buttons.hasAudio && !audioFile"
49
49
  :dictionary="dictionary"
@@ -51,7 +51,7 @@
51
51
  :ref="`${textId}-mic`"
52
52
  />
53
53
  <BtnStandardMessages
54
- v-show="formattedMessageSettings.hasStandardMessages"
54
+ v-show="formattedMessageSettings.hasStandardMessages && !audioFile"
55
55
  :dictionary="dictionary"
56
56
  :ref="`${textId}-standard-messages`"
57
57
  @toggle-standard-messages="toggleStandardMessages"
@@ -143,7 +143,7 @@ export default {
143
143
  },
144
144
  fileSettings: {
145
145
  type: Object,
146
- default: () => { return { docsExtensions: "", imagesExtensions: "", multiple: false } },
146
+ default: () => { return { docsExtensions: "", imagesExtensions: "", multiple: false, systemButton: false } },
147
147
  required: false
148
148
  },
149
149
  textId: {
@@ -700,10 +700,22 @@ ul {
700
700
  margin-right: unset;
701
701
  margin-bottom: 5px; }
702
702
  .text-footer-container .text-footer-files-container .files-btn.docs {
703
- background-color: #7986cb;
704
- margin-right: 5px; }
703
+ background-color: #7986cb; }
705
704
  .text-footer-container .text-footer-files-container .files-btn.system {
706
- background-color: #49a349; }
705
+ background-color: #49a349;
706
+ margin-left: 5px }
707
+ .text-footer-container .text-footer-files-container .files-btn.both {
708
+ font-size: .95rem;
709
+ background-color: rgb(85, 85, 236);
710
+ flex-direction: column;
711
+ }
712
+ .text-footer-container .text-footer-files-container .files-btn.both svg:nth-child(1) {
713
+ transform: translateX(5px)
714
+ }
715
+ .text-footer-container .text-footer-files-container .files-btn.both svg:nth-child(2) {
716
+ transform: translateX(-5px)
717
+ }
718
+
707
719
  .text-footer-container .text-footer-preview-container {
708
720
  cursor: default;
709
721
  position: absolute;
@@ -163,33 +163,34 @@
163
163
  if(index === "components" && Array.isArray(this.selectedTemplate[index])) {
164
164
  const arrComponents = this.selectedTemplate[index]
165
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]
166
+ if(component && component.parameters && component.parameters.length) {
167
+ component.parameters.map(message => {
168
+ message.currentText = message.text
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 notificacao 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]
180
+ }
181
+ } else if(!this.selectedTemplate['parameters'][component.type]) {
182
+ this.selectedTemplate['parameters'][component.type] = new Array()
180
183
  }
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])
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])
187
+ }
188
+ message.currentText = message.currentText.replace(varName, values[keyIndex])
187
189
  }
188
- message.currentText = message.currentText.replace(varName, values[keyIndex])
190
+ keyIndex++
189
191
  }
190
- keyIndex++
191
- }
192
- })
192
+ })
193
+ }
193
194
  })
194
195
  }
195
196
  }