vue-intergrall-plugins 0.0.236 → 0.0.237

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.
@@ -3686,6 +3686,25 @@ var MultipleFilePreview = __vue_component__$w;var script$n = {
3686
3686
  var isStackable = this.fileSettings.stackFiles && this.fileSettings.multiple;
3687
3687
  this.file = filesAux.length ? isStackable ? (_this$file = this.file).concat.apply(_this$file, _toConsumableArray(filesAux)) : filesAux : this.file;
3688
3688
  if (!this.file.length) return;
3689
+ var sizeInBytes = 0;
3690
+ Array.from(this.file).forEach(function (file) {
3691
+ return sizeInBytes += file.size;
3692
+ });
3693
+ var sizeInMb = parseFloat((sizeInBytes / (1024 * 1024)).toFixed(2));
3694
+
3695
+ if (sizeInMb == 0) {
3696
+ this.file = [];
3697
+ return this.$toasted.global.defaultInfo({
3698
+ msg: this.dictionary.msg_arquivo_invalido
3699
+ });
3700
+ }
3701
+
3702
+ if (sizeInMb >= 9.5) {
3703
+ this.file = [];
3704
+ return this.$toasted.global.defaultInfo({
3705
+ msg: "Limite de 9.5 MB por arquivo"
3706
+ });
3707
+ }
3689
3708
 
3690
3709
  if (this.file.length > this.fileSettings.max) {
3691
3710
  this.file = [];
@@ -3894,7 +3913,7 @@ var __vue_render__$n = function __vue_render__() {
3894
3913
  }],
3895
3914
  class: "" + (_vm.fileSettings.filePreviewStyle == 2 ? 'files-counter-2' : 'files-counter'),
3896
3915
  attrs: {
3897
- "content": _vm.dictionary.msg_abrir_anexos
3916
+ "content": !_vm.fileSettings.handleFilePreview ? _vm.dictionary.msg_abrir_anexos : _vm.file.length + " anexo(s) selecionado(s)"
3898
3917
  },
3899
3918
  on: {
3900
3919
  "click": function click($event) {
@@ -4037,7 +4056,7 @@ var __vue_staticRenderFns__$n = [];
4037
4056
 
4038
4057
  var __vue_inject_styles__$n = function __vue_inject_styles__(inject) {
4039
4058
  if (!inject) return;
4040
- inject("data-v-38ede73a_0", {
4059
+ inject("data-v-6bf709f3_0", {
4041
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}",
4042
4061
  map: undefined,
4043
4062
  media: undefined
@@ -4049,7 +4068,7 @@ var __vue_inject_styles__$n = function __vue_inject_styles__(inject) {
4049
4068
  var __vue_scope_id__$n = undefined;
4050
4069
  /* module identifier */
4051
4070
 
4052
- var __vue_module_identifier__$n = "data-v-38ede73a";
4071
+ var __vue_module_identifier__$n = "data-v-6bf709f3";
4053
4072
  /* functional template */
4054
4073
 
4055
4074
  var __vue_is_functional_template__$n = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.236",
3
+ "version": "0.0.237",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -7,7 +7,7 @@
7
7
  </transition> -->
8
8
  <fa-icon :icon="['fas', 'paperclip']" :title="dictionary.title_selecionar_anexo" />
9
9
  <transition name="fade">
10
- <span v-if="fileSize > 0" @click.stop="toggleFilePreview" v-tippy :content="dictionary.msg_abrir_anexos" :class="`${fileSettings.filePreviewStyle == 2 ? 'files-counter-2' : 'files-counter'}`">
10
+ <span v-if="fileSize > 0" @click.stop="toggleFilePreview" v-tippy :content="!fileSettings.handleFilePreview ? dictionary.msg_abrir_anexos : `${file.length} anexo(s) selecionado(s)`" :class="`${fileSettings.filePreviewStyle == 2 ? 'files-counter-2' : 'files-counter'}`">
11
11
  <template v-if="fileSettings.filePreviewStyle == 1">
12
12
  {{ fileSize }}
13
13
  </template>
@@ -266,6 +266,19 @@ export default {
266
266
  const isStackable = this.fileSettings.stackFiles && this.fileSettings.multiple
267
267
  this.file = filesAux.length ? isStackable ? this.file.concat(...filesAux) : filesAux : this.file
268
268
  if(!this.file.length) return
269
+
270
+ let sizeInBytes = 0
271
+ Array.from(this.file).forEach(file => sizeInBytes += file.size)
272
+ const sizeInMb = parseFloat((sizeInBytes / (1024*1024)).toFixed(2))
273
+ if(sizeInMb == 0) {
274
+ this.file = []
275
+ return this.$toasted.global.defaultInfo({ msg: this.dictionary.msg_arquivo_invalido })
276
+ }
277
+ if(sizeInMb >= 9.5) {
278
+ this.file = []
279
+ return this.$toasted.global.defaultInfo({ msg: `Limite de 9.5 MB por arquivo` })
280
+ }
281
+
269
282
  if(this.file.length > this.fileSettings.max) {
270
283
  this.file = []
271
284
  return this.$toasted.global.defaultInfo({ msg: `Limite de ${this.fileSettings.max} arquivos` })