vue-intergrall-plugins 0.0.238 → 0.0.239

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.
@@ -3647,7 +3647,7 @@ var MultipleFilePreview = __vue_component__$x;var script$o = {
3647
3647
  if (fileInput) fileInput.click();
3648
3648
  if (!fileInput) if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError();
3649
3649
  },
3650
- isFileValid: function isFileValid(type, fileName) {
3650
+ isFileValid: function isFileValid(type, fileName, fileType) {
3651
3651
  if (type == "img" && !this.fileSettings.imagesExtensions || type == "doc" && !this.fileSettings.docsExtensions) {
3652
3652
  this.$toasted.global.defaultInfo({
3653
3653
  msg: this.dictionary.sem_extensoes_parametrizadas
@@ -3658,7 +3658,7 @@ var MultipleFilePreview = __vue_component__$x;var script$o = {
3658
3658
 
3659
3659
  var extensions = type === "img" ? this.fileSettings.imagesExtensions : this.fileSettings.docsExtensions;
3660
3660
  var regex = new RegExp("(" + extensions + ")", "i");
3661
- if (regex.test(fileName)) return true;
3661
+ if (regex.test(fileName) || regex.test(fileType)) return true;
3662
3662
  this.hasAnyFile = false;
3663
3663
  this.showToastedValidFormats();
3664
3664
  return false;
@@ -3718,7 +3718,7 @@ var MultipleFilePreview = __vue_component__$x;var script$o = {
3718
3718
 
3719
3719
  if (!this.fileSettings.multiple) {
3720
3720
  this.file = this.file[0];
3721
- this.singleFileUpload(type, this.file.name);
3721
+ this.singleFileUpload(type, this.file.name, this.file.type);
3722
3722
  } else {
3723
3723
  this.multipleFileUpload();
3724
3724
  }
@@ -3758,7 +3758,7 @@ var MultipleFilePreview = __vue_component__$x;var script$o = {
3758
3758
  if (!singleFileType) file.invalid = true;
3759
3759
  file.imgOrDoc = singleFileType ? singleFileType : "";
3760
3760
 
3761
- if (_this2.isFileValid(file.imgOrDoc, file.name)) {
3761
+ if (_this2.isFileValid(file.imgOrDoc, file.name, file.type)) {
3762
3762
  if (file.imgOrDoc == "img") {
3763
3763
  var fileReader = new FileReader();
3764
3764
  waitForImageLoad = true;
@@ -3794,10 +3794,10 @@ var MultipleFilePreview = __vue_component__$x;var script$o = {
3794
3794
 
3795
3795
  if (this.isDoc && !waitForImageLoad) this.emitFileVars();
3796
3796
  },
3797
- singleFileUpload: function singleFileUpload(type, fileName) {
3797
+ singleFileUpload: function singleFileUpload(type, fileName, fileType) {
3798
3798
  var _this3 = this;
3799
3799
 
3800
- if (this.isFileValid(type, fileName)) {
3800
+ if (this.isFileValid(type, fileName, fileType)) {
3801
3801
  var fileReader = new FileReader();
3802
3802
 
3803
3803
  if (type === "img") {
@@ -4056,7 +4056,7 @@ var __vue_staticRenderFns__$o = [];
4056
4056
 
4057
4057
  var __vue_inject_styles__$o = function __vue_inject_styles__(inject) {
4058
4058
  if (!inject) return;
4059
- inject("data-v-6bf709f3_0", {
4059
+ inject("data-v-0a31a0c7_0", {
4060
4060
  source: ".fade-enter-active,.fade-leave-active{transition:opacity .3s}.fade-enter,.fade-leave-to{opacity:0}.files-counter{position:absolute;top:unset;transform:translate(17.5px,-15px);background-color:#888;z-index:1;font-size:.5rem;width:15px;height:15px;border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer;opacity:.9;transition:all .3s;color:#fff;font-weight:900}.files-counter:hover{opacity:1}.files-counter-2{transform:translate(-15px,28px);opacity:.9;position:absolute;display:flex;justify-content:center;align-items:center;color:#888;font-size:.8rem}.files-counter-2 svg{margin-left:5px}.files-counter-2:hover{opacity:1;text-decoration:underline}",
4061
4061
  map: undefined,
4062
4062
  media: undefined
@@ -4068,7 +4068,7 @@ var __vue_inject_styles__$o = function __vue_inject_styles__(inject) {
4068
4068
  var __vue_scope_id__$o = undefined;
4069
4069
  /* module identifier */
4070
4070
 
4071
- var __vue_module_identifier__$o = "data-v-6bf709f3";
4071
+ var __vue_module_identifier__$o = "data-v-0a31a0c7";
4072
4072
  /* functional template */
4073
4073
 
4074
4074
  var __vue_is_functional_template__$o = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.238",
3
+ "version": "0.0.239",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -236,7 +236,7 @@ export default {
236
236
  if(fileInput) fileInput.click()
237
237
  if(!fileInput) if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError()
238
238
  },
239
- isFileValid(type, fileName) {
239
+ isFileValid(type, fileName, fileType) {
240
240
  if((type == "img" && !this.fileSettings.imagesExtensions) || (type == "doc" && !this.fileSettings.docsExtensions)) {
241
241
  this.$toasted.global.defaultInfo({ msg: this.dictionary.sem_extensoes_parametrizadas })
242
242
  this.hasAnyFile = false
@@ -244,7 +244,7 @@ export default {
244
244
  }
245
245
  const extensions = type === "img" ? this.fileSettings.imagesExtensions : this.fileSettings.docsExtensions
246
246
  const regex = new RegExp("("+extensions+")", "i")
247
- if(regex.test(fileName)) return true
247
+ if(regex.test(fileName) || regex.test(fileType)) return true
248
248
  this.hasAnyFile = false
249
249
  this.showToastedValidFormats()
250
250
  return false
@@ -287,7 +287,7 @@ export default {
287
287
  this.fileSize = this.file.length
288
288
  if(!this.fileSettings.multiple) {
289
289
  this.file = this.file[0]
290
- this.singleFileUpload(type, this.file.name)
290
+ this.singleFileUpload(type, this.file.name, this.file.type)
291
291
  }else {
292
292
  this.multipleFileUpload()
293
293
  }
@@ -322,7 +322,7 @@ export default {
322
322
  const singleFileType = this.returnFileType(file)
323
323
  if(!singleFileType) file.invalid = true
324
324
  file.imgOrDoc = singleFileType ? singleFileType : ""
325
- if(this.isFileValid(file.imgOrDoc, file.name)) {
325
+ if(this.isFileValid(file.imgOrDoc, file.name, file.type)) {
326
326
  if(file.imgOrDoc == "img") {
327
327
  const fileReader = new FileReader();
328
328
  waitForImageLoad = true
@@ -350,8 +350,8 @@ export default {
350
350
 
351
351
  if(this.isDoc && !waitForImageLoad) this.emitFileVars()
352
352
  },
353
- singleFileUpload(type, fileName) {
354
- if(this.isFileValid(type, fileName)) {
353
+ singleFileUpload(type, fileName, fileType) {
354
+ if(this.isFileValid(type, fileName, fileType)) {
355
355
  const fileReader = new FileReader()
356
356
  if(type === "img") {
357
357
  fileReader.onload = () => this.imagePreview = fileReader.result