vue-intergrall-plugins 0.0.5 → 0.0.9

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,78 +1,81 @@
1
1
  <template>
2
- <div class="text-footer-container" v-on-clickaway="away" v-if="textId">
2
+ <div class="text-footer-container" v-on-clickaway="away" v-if="textId" @drop.stop="dropFile" @dragenter.prevent @dragover.prevent>
3
3
  <div class="text-footer" :class="cssStyle.width ? cssStyle.width: ''" :style="`background-color: ${cssStyle.backgroundColor}`">
4
- <emojis-text-footer :ref="`${this.textId}`" :emojiId="`${this.textId}`" v-if="buttons.hasEmojis && !audioFile" :down="emojiSettings.openEmojisFrom == 'top' ? false : true" :small="emojiSettings.smallEmojis" @insert-emoji="insertEmoji"></emojis-text-footer>
4
+ <EmojisTextFooter
5
+ v-show="buttons.hasEmojis && !audioFile"
6
+ :ref="`${this.textId}`"
7
+ :emojiId="`${this.textId}`"
8
+ :down="emojiSettings.openEmojisFrom == 'top' ? false : true"
9
+ :small="emojiSettings.smallEmojis"
10
+ @insert-emoji="insertEmoji"
11
+ />
5
12
  <transition name="fade">
6
- <req-loader v-if="isSending" />
13
+ <Loader v-if="isSending" />
7
14
  </transition>
8
- <textarea v-if="!audioFile" :id="`text-footer-${this.textId}`" @input="sendFinalMessage" v-model="message" @keydown.up="toggleHSM" @keydown.down="toggleHSM" @keydown.esc="closeEmojis" @keydown.enter="sendMessageHandler" :disabled="textareaSettings.disabled" :placeholder="textareaSettings.placeholderMessage" @paste="pasteImage" class="js-autoresize"></textarea>
15
+ <textarea
16
+ class="js-autoresize"
17
+ v-if="!audioFile"
18
+ v-model="message"
19
+ :id="`text-footer-${this.textId}`"
20
+ :disabled="textareaSettings.disabled"
21
+ :placeholder="textareaSettings.placeholderMessage"
22
+ @input="sendFinalMessage"
23
+ @keydown.up="toggleHSM"
24
+ @keydown.down="toggleHSM"
25
+ @keydown.esc="closeEmojis"
26
+ @keydown.enter="sendMessageHandler"
27
+ @paste="pasteImage"
28
+ ></textarea>
9
29
  <div class="text-footer-audio" v-else>
10
30
  <audio :src="audioSource" controls="controls"></audio>
11
31
  <span class="delete-audio" title="Cancelar" @click="deleteAudio">
12
32
  <fa-icon :icon="['fas', 'times']" />
13
33
  </span>
14
34
  </div>
15
- <span class="max-characters no-width" :class="{'d-none' : audioFile}" v-if="textareaSettings.maxCharacters" v-text="`(${this.remainingCharacters})`"></span>
35
+ <RemainingCharacters
36
+ :class="{'d-none' : audioFile}"
37
+ :message="message"
38
+ :maxCharacters="textareaSettings.maxCharacters"
39
+ />
16
40
  <div class="text-footer-actions" v-if="buttons.hasSendButton">
17
41
  <span class="text-footer-actions--btn" :title="dictionary.title_enviar_msg" @click="sendMessageHandler">
18
42
  <fa-icon :icon="['fas', 'paper-plane']" />
19
43
  </span>
20
44
  </div>
21
45
  <div v-if="buttons.hasFiles || buttons.hasAudio" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
22
- <span v-if="buttons.hasAudio && !audioFile" class="text-footer-actions--btn" :class="{'audio-activated' : isRecording}" @click="toggleAudioRecorder">
23
- <fa-icon :icon="['fas', 'microphone']" />
24
- </span>
25
- <span v-if="buttons.hasFiles && !audioFile" class="text-footer-actions--btn" :class="{'files-activated' : openFiles}" :title="dictionary.title_selecionar_anexo" @click="toggleFiles">
26
- <fa-icon :icon="['fas', 'paperclip']" />
27
- </span>
46
+ <BtnMic
47
+ v-show="buttons.hasAudio && !audioFile"
48
+ :dictionary="dictionary"
49
+ @set-audio="setAudio"
50
+ :ref="`${textId}-mic`"
51
+ />
52
+ <BtnFiles
53
+ v-show="buttons.hasFiles && !audioFile"
54
+ :textId="textId"
55
+ :dictionary="dictionary"
56
+ :fileSettings="fileSettings"
57
+ :cssStyle="cssStyle"
58
+ :ref="`${textId}-file`"
59
+ @set-file-vars="setFileVars"
60
+ />
28
61
  </div>
29
62
  </div>
30
- <transition name="show">
31
- <div v-if="buttons.hasFiles && openFiles" class="text-footer-files-container" :class="{'horizontal' : cssStyle.outsideButtons}">
32
- <div class="files-btn images" :class="{'margin-bottom' : cssStyle.outsideButtons}" :title="dictionary.title_anexo_img" @click="selectImage">
33
- <fa-icon :icon="['fas', 'image']" />
34
- </div>
35
- <div class="files-btn docs" :title="dictionary.title_anexo_doc" @click="selectDoc">
36
- <fa-icon :icon="['fas', 'file-alt']" />
37
- </div>
38
- <div class="files-pointers d-none">
39
- <input type="file" :id="`file-${textId}`" accept="image/*" @change="fileUpload($event, 'img')" />
40
- <input type="file" :id="`doc-${textId}`" accept="application/*" @change="fileUpload($event, 'doc')" />
41
- </div>
42
- </div>
43
- </transition>
44
- <transition name="fade">
45
- <div class="text-footer-preview-container" v-if="showFilePreview" :class="{'isDoc' : isDoc && !fileFormatError, 'isImg' : !isDoc && !fileFormatError, 'isError' : fileFormatError}">
46
- <span @click="deleteFile" :title="dictionary.msg_cancelar_anexo" class="text-footer-exclude-file">
47
- <fa-icon :icon="['fas', 'times-circle']" />
48
- </span>
49
- <h3 v-if="file.name" class="text-footer-preview-title">
50
- <fa-icon :icon="['fas', 'file-alt']" v-if="isDoc" />
51
- <fa-icon :icon="['fas', 'image']" v-else />
52
- {{ file.name }}
53
- </h3>
54
- <div class="text-footer-invalid-format" v-if="fileFormatError">
55
- <h3 v-text="dictionary.titulo_msg_formato_invalido"></h3>
56
- <h4 v-text="validFileFormats"></h4>
57
- </div>
58
- <div class="text-footer-image-preview" v-if="imagePreview">
59
- <img :src="imagePreview" :alt="dictionary.alt_previa_img" @click="openImage">
60
- </div>
61
- </div>
62
- </transition>
63
63
  </div>
64
64
  </template>
65
65
 
66
66
  <script>
67
67
  import { setResizeListeners, resetTargets } from "@/services/autoResize"
68
68
  import { mixin as clickaway } from "vue-clickaway"
69
- import { returnMessageWithHexa, formataHoraMensagem } from "@/services/textFormatting"
69
+ import { returnMessageWithHexa } from "@/services/textFormatting"
70
70
 
71
71
  import EmojisTextFooter from "./EmojisTextFooter"
72
- import ReqLoader from "../Loader/ReqLoader"
72
+ import Loader from "../Loader/Loader"
73
+ import RemainingCharacters from "./RemainingCharacters"
74
+ import BtnMic from "./BtnMic"
75
+ import BtnFiles from "./BtnFiles"
73
76
 
74
77
  export default {
75
- components: { EmojisTextFooter, ReqLoader },
78
+ components: { EmojisTextFooter, Loader, BtnMic, BtnFiles, RemainingCharacters },
76
79
  mixins: [ clickaway ],
77
80
  props: {
78
81
  buttons: {
@@ -102,7 +105,7 @@ export default {
102
105
  },
103
106
  fileSettings: {
104
107
  type: Object,
105
- default: () => { return { docsExtensions: "", imagesExtensions: "" } },
108
+ default: () => { return { docsExtensions: "", imagesExtensions: "", multiple: false } },
106
109
  required: false
107
110
  },
108
111
  textId: {
@@ -124,14 +127,6 @@ export default {
124
127
  required: true
125
128
  }
126
129
  },
127
- computed: {
128
- remainingCharacters() {
129
- if(this.message && this.message.length) {
130
- return this.textareaSettings.maxCharacters - this.message.length
131
- }
132
- return this.textareaSettings.maxCharacters
133
- }
134
- },
135
130
  data() {
136
131
  return {
137
132
  message: "",
@@ -141,11 +136,8 @@ export default {
141
136
  imagePreview: "",
142
137
  isDoc: false,
143
138
  fileFormatError: false,
144
- validFileFormats: "",
145
139
  audioFile: "",
146
- audioSource: "",
147
- mediaRecorder: {},
148
- isRecording: false
140
+ audioSource: ""
149
141
  }
150
142
  },
151
143
  created() {
@@ -154,17 +146,12 @@ export default {
154
146
  mounted() {
155
147
  setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize")
156
148
 
157
- this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
158
-
159
- this.$root.$on("toggle-msg-formatada", () => { this.toggleHSM() })
160
-
161
- this.$root.$on("textarea-focus", () => { this.focusTextarea() })
162
-
163
- this.$root.$on("resize-footer-template", () => { this.adjustChatHeight() })
164
-
165
- this.$root.$on("clear-footer-message", () => { this.message = "" })
166
-
167
- if(this.cssStyle.outsideButtons) if(this.$root.$refs.chatCorpo) this.$root.$refs.chatCorpo.setOutsideButtons(this.cssStyle.outsideButtons)
149
+ // this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
150
+ // this.$root.$on("toggle-msg-formatada", () => { this.toggleHSM() })
151
+ // this.$root.$on("textarea-focus", () => { this.focusTextarea() })
152
+ // this.$root.$on("resize-footer-template", () => { this.adjustChatHeight() })
153
+ // this.$root.$on("clear-footer-message", () => { this.message = "" })
154
+ // if(this.cssStyle.outsideButtons) if(this.$root.$refs.chatCorpo) this.$root.$refs.chatCorpo.setOutsideButtons(this.cssStyle.outsideButtons)
168
155
  },
169
156
  methods: {
170
157
  closeEmojis() {
@@ -176,7 +163,7 @@ export default {
176
163
  }
177
164
  },
178
165
  away() {
179
- this.openFiles = false
166
+ if(this.$refs[`${this.textId}-file`]) this.$refs[`${this.textId}-file`].openFiles = false
180
167
  },
181
168
  setDefaultMessage(msg) {
182
169
  this.message = msg
@@ -205,7 +192,12 @@ export default {
205
192
  if(this.textareaSettings.disabled) return false
206
193
 
207
194
  if(this.fileFormatError) {
208
- this.$toasted.global.formatoInvalido()
195
+ this.$toasted.global.defaultError({ msg: this.dictionary.msg_formato_invalido })
196
+ const str = {
197
+ img: this.fileSettings.imagesExtensions.split("|").join(", "),
198
+ doc: this.fileSettings.docsExtensions.split("|").join(", ")
199
+ }
200
+ this.$toasted.global.showValidFormats({ msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}` })
209
201
  return false
210
202
  }
211
203
 
@@ -266,7 +258,7 @@ export default {
266
258
  },
267
259
  resetFooterData() {
268
260
  if(this.audioFile) this.deleteAudio()
269
- if(this.showFilePreview) this.deleteFile()
261
+ if(this.showFilePreview) this.$refs[`${this.textId}-file`].deleteFile()
270
262
  this.message = ""
271
263
  this.sendFinalMessage()
272
264
  resetTargets(this.$el, ".js-autoresize", ".js-parentresize", "38px")
@@ -277,147 +269,110 @@ export default {
277
269
  message,
278
270
  attachment: this.showFilePreview ? this.file : false,
279
271
  isDoc: this.isDoc,
280
- image: this.imagePreview,
272
+ imagePreview: this.imagePreview,
281
273
  isAudio: this.audioFile ? true : false,
282
274
  audioAttachment: this.audioSource
283
275
  }
284
276
  },
285
- toggleFiles() {
286
- this.openFiles = !this.openFiles
277
+ setFileVars(fileObj) {
278
+ const { file, showFilePreview, imagePreview, isDoc, fileFormatError } = fileObj;
279
+
280
+ this.file = file
281
+ this.showFilePreview = showFilePreview
282
+ this.imagePreview = imagePreview ? imagePreview : ""
283
+ this.isDoc = isDoc
284
+ this.fileFormatError = fileFormatError
287
285
  },
288
- selectImage() {
289
- const fileInput = document.querySelector(`#file-${this.textId}`)
290
- if(fileInput) fileInput.click()
291
- if(!fileInput) if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError()
286
+ openImage(imagePreview) {
287
+ this.$emit("open-image", imagePreview)
292
288
  },
293
- selectDoc() {
294
- const fileInput = document.querySelector(`#doc-${this.textId}`)
295
- if(fileInput) fileInput.click()
296
- if(!fileInput) if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError()
289
+ setAudio(audioObj) {
290
+ const { audioFile, audioSource } = audioObj
291
+ this.audioFile = audioFile
292
+ this.audioSource = audioSource
297
293
  },
298
- isFileValid(type) {
299
- const extensions = type === "img" ? this.fileSettings.imagesExtensions : this.fileSettings.docsExtensions
300
- const regex = new RegExp("("+extensions+")", "i")
301
-
302
- if(regex.test(this.file.name)) return true
303
-
304
- this.$toasted.global.formatoInvalido()
305
- return false
294
+ deleteAudio() {
295
+ this.$refs[`${this.textId}-mic`].deleteMediaRecorder()
296
+ this.audioFile = ""
297
+ this.audioSource = ""
306
298
  },
307
- fileUpload(event, type, externalCall) {
308
- this.openFiles = false
309
- if(this.showFilePreview) this.deleteFile()
299
+ returnFileType(file, stopAlert) {
300
+ const imgRegex = new RegExp("\.("+this.fileSettings.imagesExtensions+")", "i")
301
+ if(imgRegex.test(file.name)) return "img"
310
302
 
311
- const fileReader = new FileReader()
303
+ const docRegex = new RegExp("\.("+this.fileSettings.docsExtensions+")", "i")
304
+ if(docRegex.test(file.name)) return "doc"
312
305
 
313
- this.file = !externalCall ? event.target.files || event.dataTransfer.files : event
314
-
315
- if(!this.file.length) {
316
- this.file = []
317
- return
318
- }
319
-
320
- this.file = this.file[0]
321
- if(!externalCall) {
322
- const selector = type === "img" ? `#file-${this.textId}` : `#doc-${this.textId}`
323
- document.querySelector(selector).value = ""
306
+ if(!stopAlert) return
307
+ if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError({ msg: this.dictionary.msg_formato_invalido })
308
+ const str = {
309
+ img: this.fileSettings.imagesExtensions.split("|").join(", "),
310
+ doc: this.fileSettings.docsExtensions.split("|").join(", ")
324
311
  }
325
-
326
- this.showFilePreview = true
327
- if(type === "img") {
328
- fileReader.onload = () => { this.imagePreview = fileReader.result }
329
- }
330
-
331
- if(this.isFileValid(type)) {
332
- if(type === "img") fileReader.readAsDataURL(this.file)
333
- if(type === "doc") this.isDoc = true
334
-
335
- this.focusTextarea()
336
- this.fileFormatError = false
337
- }else {
338
- this.fileFormatError = true
339
- this.validFileFormats = `${type === "img" ? this.fileSettings.imagesExtensions : this.fileSettings.docsExtensions} ${this.dictionary.msg_extensoes_aceitas}`
340
- }
341
- },
342
- deleteFile() {
343
- this.file = []
344
- this.isDoc = false
345
- this.showFilePreview = false
346
- this.imagePreview = ""
347
- this.fileFormatError = false
348
- this.validFileFormats = ""
349
- },
350
- openImage() {
351
- this.$store.dispatch("toggleBlocker", { state: true, origin: "visualizar-imagem" })
352
- this.$store.dispatch("setLinkImagem", this.imagePreview)
312
+ this.$toasted.global.showValidFormats({ msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}` })
313
+ return false
353
314
  },
354
- initAudioRecorder() {
355
- navigator.mediaDevices.getUserMedia({ audio: true })
356
- .then(stream => {
357
- this.mediaRecorder = new MediaRecorder(stream)
358
- const audioChunks = []
359
- this.mediaRecorder.ondataavailable = eventData => { audioChunks.push(eventData.data) }
360
- this.mediaRecorder.onstop = () => {
361
- const blob = new Blob(audioChunks, { type: "audio/mpeg" })
362
- blob.lastModifiedDate = new Date()
363
- blob.name = `im-audio-file-${parseInt(Math.random() * 5000)}`
364
- const reader = new FileReader()
365
- reader.readAsDataURL(blob)
366
- reader.onloadend = () => {
367
- this.audioFile = new File([blob], `${blob.name}.mpeg`, { type: blob.type })
368
- this.audioSource = reader.result
369
- }
370
- stream.getTracks().forEach(track => track.stop())
315
+ filesHandler(files) {
316
+ const fileType = this.returnFileType(files[0], true)
317
+ let invalidFile = false
318
+ try {
319
+ files.forEach(file => {
320
+ const singleFileType = this.returnFileType(file, true)
321
+ if(!singleFileType) {
322
+ invalidFile = true
323
+ file.invalid = true
371
324
  }
372
-
373
- this.toggleAudioRecorder()
374
- },
375
- error => {
376
- this.$toasted.global.defaultError({ msg: this.dictionary.msg_permitir_audio })
377
- console.error("error audio recorder: ", error)
325
+ file.imgOrDoc = singleFileType ? singleFileType : ""
378
326
  })
379
- },
380
- toggleAudioRecorder() {
381
- if(!this.mediaRecorder.state) return this.initAudioRecorder()
382
-
383
- this.isRecording = !this.isRecording
327
+ }catch(e) {
328
+ console.error("Erro ao tentar percorrer os arquivos")
329
+ console.error(e)
330
+ invalidFile = true
331
+ }
384
332
 
385
- if(this.isRecording) return this.mediaRecorder.start()
386
- return this.mediaRecorder.stop()
333
+ if(!invalidFile) {
334
+ this.$refs[`${this.textId}-file`].fileUpload(files, fileType, true)
335
+ }else {
336
+ this.$toasted.global.defaultError({ msg: this.dictionary.msg_formato_invalido })
337
+ const str = {
338
+ img: this.fileSettings.imagesExtensions.split("|").join(", "),
339
+ doc: this.fileSettings.docsExtensions.split("|").join(", ")
340
+ }
341
+ this.$toasted.global.showValidFormats({ msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}` })
342
+ }
387
343
  },
388
- deleteAudio() {
389
- this.mediaRecorder = {}
390
- this.audioFile = ""
344
+ dropFile(e) {
345
+ try {
346
+ e.stopPropagation()
347
+ e.preventDefault()
348
+ const files = e.dataTransfer.files.length ? e.dataTransfer.files : ""
349
+ this.filesHandler(files)
350
+ }catch(e) {
351
+ console.error("Erro drop file")
352
+ console.error(e)
353
+ }
391
354
  },
392
355
  pasteImage(e) {
393
- if(e.clipboardData.files.length && !this.buttons.hasFiles) {
394
- e.preventDefault()
395
- return
396
- }else if(e.clipboardData.files.length && this.buttons.hasFiles) {
397
- const file = e.clipboardData.files
398
-
399
- let fileType = ""
400
- const imgRegex = new RegExp("("+this.fileSettings.imagesExtensions+")", "i")
401
- if(imgRegex.test(file[0].name)) fileType = "img"
402
-
403
- const docRegex = new RegExp("("+this.fileSettings.docsExtensions+")", "i")
404
- if(docRegex.test(file[0].name)) fileType = "doc"
405
-
406
- if(fileType) {
407
- this.fileUpload(file, fileType, true)
408
- }else {
409
- this.$toasted.global.formatoInvalido()
410
- this.$toasted.global.formatosValidos()
356
+ try {
357
+ if(e.clipboardData.files.length && !this.buttons.hasFiles) {
358
+ e.preventDefault()
359
+ return
360
+ }else if(e.clipboardData.files.length && this.buttons.hasFiles) {
361
+ const files = e.clipboardData.files
362
+ this.filesHandler(files)
411
363
  }
364
+ }catch(e) {
365
+ console.error("Nao foi possivel colar a/o imagem/documento")
366
+ console.error(e)
412
367
  }
413
368
  },
414
369
  },
415
370
  destroyed() {
416
- this.$root.$off("drop-file")
417
- this.$root.$off("toggle-msg-formatada")
418
- this.$root.$off("textarea-focus")
419
- this.$root.$off("clear-footer-message")
420
- this.$root.$off("resize-footer-template")
371
+ // this.$root.$off("drop-file")
372
+ // this.$root.$off("toggle-msg-formatada")
373
+ // this.$root.$off("textarea-focus")
374
+ // this.$root.$off("clear-footer-message")
375
+ // this.$root.$off("resize-footer-template")
421
376
  }
422
377
  }
423
378
  </script>
@@ -440,14 +395,15 @@ ul {
440
395
  width: 100%;
441
396
  position: relative; }
442
397
  .text-footer-container .text-footer {
443
- min-height: 54px;
398
+ min-height: 48px;
399
+ box-shadow: 0px 4px 5px -2px rgba(0, 0, 0, 0.25);
444
400
  position: relative;
445
401
  display: flex;
446
402
  justify-content: center;
447
403
  align-items: center;
448
404
  border: 1px solid #ccc;
449
405
  padding: 5px 2px 5px 5px;
450
- border-radius: 15px; }
406
+ border-radius: 5px; }
451
407
  .text-footer-container .text-footer.full {
452
408
  width: 100%; }
453
409
  .text-footer-container .text-footer.almostFull {
@@ -496,7 +452,7 @@ ul {
496
452
  z-index: 1;
497
453
  color: #444;
498
454
  position: relative;
499
- top: 28px;
455
+ top: 30px;
500
456
  left: 5px; }
501
457
  .text-footer-container .max-characters.no-width {
502
458
  width: 0; }
@@ -622,29 +578,39 @@ ul {
622
578
  .text-footer-container .text-footer-files-container .files-btn.docs {
623
579
  background-color: #7986cb; }
624
580
  .text-footer-container .text-footer-preview-container {
581
+ cursor: default;
625
582
  position: absolute;
626
- background-color: #AAA;
627
- border-top-left-radius: 5px;
628
- border-top-right-radius: 5px; }
583
+ left: 0;
584
+ background-color: rgb(225, 225, 225);
585
+ border-top-left-radius: 2.5px;
586
+ border-top-right-radius: 2.5px; }
629
587
  .text-footer-container .text-footer-preview-container.isDoc {
630
588
  top: -50px;
631
589
  width: 100%;
632
590
  height: 45px; }
633
- .text-footer-container .text-footer-preview-container.isImg {
591
+ .text-footer-container .text-footer-preview-container.isImg, .text-footer-container .text-footer-preview-container.isMultiple {
634
592
  top: -205px;
635
593
  width: 100%;
636
594
  height: 200px; }
637
595
  .text-footer-container .text-footer-preview-container.isImg .text-footer-image-preview {
638
596
  height: 170px; }
639
597
  .text-footer-container .text-footer-preview-container.isError {
640
- top: -155px;
598
+ top: -80px;
641
599
  width: 100%;
642
- height: 150px; }
600
+ height: 75px; }
643
601
  .text-footer-container .text-footer-preview-container .text-footer-exclude-file {
644
602
  position: absolute;
645
603
  top: 5px;
646
604
  right: 5px;
647
- cursor: pointer; }
605
+ cursor: pointer;
606
+ display: flex;
607
+ justify-content: center;
608
+ align-items: center;
609
+ min-width: 1rem;
610
+ min-height: 1rem;
611
+ background-color: #FFF;
612
+ border-radius: 50%;
613
+ }
648
614
  .text-footer-container .text-footer-preview-container .text-footer-exclude-file svg {
649
615
  transition: color 200ms;
650
616
  color: #e9594a; }
@@ -667,6 +633,7 @@ ul {
667
633
  max-height: 98%;
668
634
  padding: 2%; }
669
635
  .text-footer-container .text-footer-preview-container .text-footer-invalid-format {
636
+ color: #222;
670
637
  padding: 10px; }
671
638
  .text-footer-container .text-footer-preview-container .text-footer-invalid-format h3 {
672
639
  font-weight: 500; }
@@ -66,13 +66,6 @@ export default {
66
66
  elem.classList.toggle("active");
67
67
  }
68
68
  }
69
- },
70
- isValid(textValue) {
71
- const regex =
72
- /^[ ?????�����??��?���?��??????�������?���?��???��??\w?-�\r\n()[\]{}.,:;@??�????!&?�`�=%^*+\-$|/]+$/;
73
- const value = textValue ? textValue.trim("") : "";
74
-
75
- return regex.test(value);
76
69
  }
77
70
  }
78
71
  };
@@ -223,10 +223,21 @@ export default {
223
223
  }
224
224
  },
225
225
  isValid(textValue) {
226
- const regex =
227
- /^[ ?????�����??��?���?��??????�������?���?��???��??\w?-�\r\n()[\]{}.,:;@??�????!&?�`�=%^*+\-$|/]+$/;
228
- const value = textValue ? textValue.trim("") : ""
229
- return regex.test(value);
226
+ const regex = {
227
+ htmlTags: /<\/?[\d\w\s=\-:\.\/\'\";]+>/gi,
228
+ enter: /\n/g,
229
+ consecutiveSpaces: /\s{3,}/g
230
+ }
231
+ const value = textValue ? textValue.trim("") : "";
232
+ if(!value.length) return false
233
+
234
+ let isValueValid = true
235
+ for(let key in regex) {
236
+ if(!isValueValid) return isValueValid
237
+ if(regex[key].test(value)) isValueValid = false
238
+ }
239
+
240
+ return isValueValid
230
241
  },
231
242
  setVar(event, key, notificar) {
232
243
  if (event && event.target) {