vue-intergrall-plugins 0.0.159 → 0.0.160

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.159",
3
+ "version": "0.0.160",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <span class="text-footer-actions--btn" :class="{'files-activated' : openFiles || file.length}" @click="openFilesByClip()">
3
3
  <transition name="fade">
4
- <span v-if="file.length" class="files-counter" v-text="file.length" @click.stop="toggleFilePreview" :title="dictionary.msg_abrir_anexos"></span>
4
+ <span v-if="fileSize > 0" class="files-counter" v-text="fileSize" @click.stop="toggleFilePreview" :title="dictionary.msg_abrir_anexos"></span>
5
5
  </transition>
6
6
  <fa-icon :icon="['fas', 'paperclip']" :title="dictionary.title_selecionar_anexo" />
7
7
  <transition name="show">
@@ -117,6 +117,7 @@ export default {
117
117
  data() {
118
118
  return {
119
119
  file: [],
120
+ fileSize: 0,
120
121
  openFiles: false,
121
122
  showFilePreview: false,
122
123
  imagePreview: "",
@@ -149,6 +150,7 @@ export default {
149
150
  },
150
151
  openSelectFileHandler(type) {
151
152
  if(type == "system"){ this.$emit("open-file-system", true); return false }
153
+ if(this.fileSettings.multiple){ type = 'both' }
152
154
  const fileInput = document.querySelector(`#${type}-${this.textId}`)
153
155
  if(fileInput) fileInput.click()
154
156
  if(!fileInput) if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError()
@@ -172,6 +174,7 @@ export default {
172
174
  },
173
175
  fileUpload(event, type, externalCall) {
174
176
  try {
177
+ this.fileSize = 0
175
178
  if(this.fileFormatError) this.file = []
176
179
  this.openFiles = false
177
180
  let filesAux = !externalCall ? event.target.files ? event.target.files : event.dataTransfer.files : event
@@ -179,6 +182,7 @@ export default {
179
182
 
180
183
  if(!this.file.length) return
181
184
  this.hasAnyFile = true
185
+ this.fileSize = this.file.length
182
186
  if(!this.fileSettings.multiple) {
183
187
  this.file = this.file[0]
184
188
  this.singleFileUpload(type, this.file.name)
@@ -70,7 +70,7 @@ export default {
70
70
  },
71
71
  props: {
72
72
  dictionary: { type: Object, required: true },
73
- file: { type: File, required: true },
73
+ file: { type: Array, required: true },
74
74
  fileFormatError: { type: Boolean, required: false },
75
75
  validFileFormats: { type: String, required: false, default: "" }
76
76
  },