vue-intergrall-plugins 0.0.225 → 0.0.228

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.
@@ -54,10 +54,22 @@ function _slicedToArray(arr, i) {
54
54
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
55
55
  }
56
56
 
57
+ function _toConsumableArray(arr) {
58
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
59
+ }
60
+
61
+ function _arrayWithoutHoles(arr) {
62
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
63
+ }
64
+
57
65
  function _arrayWithHoles(arr) {
58
66
  if (Array.isArray(arr)) return arr;
59
67
  }
60
68
 
69
+ function _iterableToArray(iter) {
70
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
71
+ }
72
+
61
73
  function _iterableToArrayLimit(arr, i) {
62
74
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
63
75
 
@@ -105,6 +117,10 @@ function _arrayLikeToArray(arr, len) {
105
117
  return arr2;
106
118
  }
107
119
 
120
+ function _nonIterableSpread() {
121
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
122
+ }
123
+
108
124
  function _nonIterableRest() {
109
125
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
110
126
  }var top = 'top';
@@ -3497,8 +3513,7 @@ var __vue_component__$w = /*#__PURE__*/normalizeComponent({
3497
3513
  staticRenderFns: __vue_staticRenderFns__$o
3498
3514
  }, __vue_inject_styles__$o, __vue_script__$o, __vue_scope_id__$o, __vue_is_functional_template__$o, __vue_module_identifier__$o, false, undefined, createInjectorSSR, undefined);
3499
3515
 
3500
- var MultipleFilePreview = __vue_component__$w;//
3501
- var script$n = {
3516
+ var MultipleFilePreview = __vue_component__$w;var script$n = {
3502
3517
  components: {
3503
3518
  SingleFilePreview: SingleFilePreview,
3504
3519
  MultipleFilePreview: MultipleFilePreview
@@ -3651,11 +3666,14 @@ var script$n = {
3651
3666
  },
3652
3667
  fileUpload: function fileUpload(event, type, externalCall) {
3653
3668
  try {
3669
+ var _this$file;
3670
+
3654
3671
  this.fileSize = 0;
3655
3672
  if (this.fileFormatError) this.file = [];
3656
3673
  this.openFiles = false;
3657
3674
  var filesAux = !externalCall ? event.target.files ? event.target.files : event.dataTransfer.files : event;
3658
- this.file = filesAux.length ? filesAux : this.file;
3675
+ var isStackable = this.fileSettings.stackFiles && this.fileSettings.multiple;
3676
+ this.file = filesAux.length ? isStackable ? (_this$file = this.file).concat.apply(_this$file, _toConsumableArray(filesAux)) : filesAux : this.file;
3659
3677
  if (!this.file.length) return;
3660
3678
 
3661
3679
  if (this.file.length > this.fileSettings.max) {
@@ -3778,6 +3796,11 @@ var script$n = {
3778
3796
  if (this.isDoc) this.emitFileVars();
3779
3797
  },
3780
3798
  toggleFilePreview: function toggleFilePreview() {
3799
+ if (this.fileSettings.handleFilePreview) {
3800
+ this.emitFileVars();
3801
+ return this.$emit("handle-file-preview");
3802
+ }
3803
+
3781
3804
  this.showFilePreview = !this.showFilePreview;
3782
3805
  if (this.showFilePreview && this.openFiles) this.toggleFiles();
3783
3806
  },
@@ -3835,24 +3858,30 @@ var __vue_render__$n = function __vue_render__() {
3835
3858
  return _c('span', {
3836
3859
  staticClass: "text-footer-actions--btn",
3837
3860
  class: {
3838
- 'files-activated': _vm.openFiles || _vm.file.length || _vm.file.name
3861
+ 'files-activated': _vm.openFiles || _vm.file.name
3839
3862
  },
3840
3863
  on: {
3841
3864
  "click": function click($event) {
3842
3865
  return _vm.openFilesByClip();
3843
3866
  }
3844
3867
  }
3845
- }, [_c('transition', {
3868
+ }, [_c('fa-icon', {
3869
+ attrs: {
3870
+ "icon": ['fas', 'paperclip'],
3871
+ "title": _vm.dictionary.title_selecionar_anexo
3872
+ }
3873
+ }), _vm._ssrNode(" "), _c('transition', {
3846
3874
  attrs: {
3847
3875
  "name": "fade"
3848
3876
  }
3849
3877
  }, [_vm.fileSize > 0 ? _c('span', {
3850
- staticClass: "files-counter",
3878
+ directives: [{
3879
+ name: "tippy",
3880
+ rawName: "v-tippy"
3881
+ }],
3882
+ class: "" + (_vm.fileSettings.filePreviewStyle == 2 ? 'files-counter-2' : 'files-counter'),
3851
3883
  attrs: {
3852
- "title": _vm.dictionary.msg_abrir_anexos
3853
- },
3854
- domProps: {
3855
- "textContent": _vm._s(_vm.fileSize)
3884
+ "content": _vm.dictionary.msg_abrir_anexos
3856
3885
  },
3857
3886
  on: {
3858
3887
  "click": function click($event) {
@@ -3860,12 +3889,11 @@ var __vue_render__$n = function __vue_render__() {
3860
3889
  return _vm.toggleFilePreview.apply(null, arguments);
3861
3890
  }
3862
3891
  }
3863
- }) : _vm._e()]), _vm._ssrNode(" "), _c('fa-icon', {
3892
+ }, [_vm.fileSettings.filePreviewStyle == 1 ? [_vm._v("\n " + _vm._s(_vm.fileSize) + "\n ")] : [_vm._v("\n Anexos "), _c('fa-icon', {
3864
3893
  attrs: {
3865
- "icon": ['fas', 'paperclip'],
3866
- "title": _vm.dictionary.title_selecionar_anexo
3894
+ "icon": ['fas', 'eye']
3867
3895
  }
3868
- }), _vm._ssrNode(" "), _c('transition', {
3896
+ })]], 2) : _vm._e()]), _vm._ssrNode(" "), _c('transition', {
3869
3897
  attrs: {
3870
3898
  "name": "show"
3871
3899
  }
@@ -3996,8 +4024,8 @@ var __vue_staticRenderFns__$n = [];
3996
4024
 
3997
4025
  var __vue_inject_styles__$n = function __vue_inject_styles__(inject) {
3998
4026
  if (!inject) return;
3999
- inject("data-v-0d26cc3c_0", {
4000
- 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}",
4027
+ inject("data-v-5a1fae02_0", {
4028
+ 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}",
4001
4029
  map: undefined,
4002
4030
  media: undefined
4003
4031
  });
@@ -4008,7 +4036,7 @@ var __vue_inject_styles__$n = function __vue_inject_styles__(inject) {
4008
4036
  var __vue_scope_id__$n = undefined;
4009
4037
  /* module identifier */
4010
4038
 
4011
- var __vue_module_identifier__$n = "data-v-0d26cc3c";
4039
+ var __vue_module_identifier__$n = "data-v-5a1fae02";
4012
4040
  /* functional template */
4013
4041
 
4014
4042
  var __vue_is_functional_template__$n = false;
@@ -8402,7 +8430,10 @@ var script$j = {
8402
8430
  imagesExtensions: "",
8403
8431
  multiple: false,
8404
8432
  systemButton: false,
8405
- max: 3
8433
+ max: 3,
8434
+ handleFilePreview: false,
8435
+ filePreviewStyle: 1,
8436
+ stackFiles: false
8406
8437
  };
8407
8438
  },
8408
8439
  required: false
@@ -8890,7 +8921,10 @@ var __vue_render__$j = function __vue_render__() {
8890
8921
  "set-file-vars": _vm.setFileVars,
8891
8922
  "open-image": _vm.openImage,
8892
8923
  "open-file-system": _vm.openFileSystem,
8893
- "reset-file-system": _vm.resetFileSystem
8924
+ "reset-file-system": _vm.resetFileSystem,
8925
+ "handle-file-preview": function handleFilePreview($event) {
8926
+ return _vm.$emit('handle-file-preview');
8927
+ }
8894
8928
  }
8895
8929
  }), _vm._ssrNode(" "), _c('BtnExpand', {
8896
8930
  directives: [{
@@ -8941,7 +8975,7 @@ var __vue_staticRenderFns__$j = [];
8941
8975
 
8942
8976
  var __vue_inject_styles__$j = function __vue_inject_styles__(inject) {
8943
8977
  if (!inject) return;
8944
- inject("data-v-7d5d938e_0", {
8978
+ inject("data-v-53fe87de_0", {
8945
8979
  source: ".toasted svg{margin-right:10px}.d-none{display:none}ul{list-style-type:none}.text-footer-container{display:flex;justify-content:center;align-items:center;flex-direction:column;width:100%;position:relative}.text-footer-container .text-footer{min-height:48px;box-shadow:0 3px 7px -2px rgba(0,0,0,.45);position:relative;display:flex;justify-content:center;align-items:center;border:1px solid #ccc;padding:5px 2px 5px 5px;border-radius:5px}.text-footer-container .text-footer.full{width:100%}.text-footer-container .text-footer.almostFull{width:95%}.text-footer-container .text-footer.medium{width:75%}.text-footer-container.bigger .text-footer{height:80px}.text-footer-container.bigger .text-footer>textarea{font-size:.875rem;height:75px;max-height:75px;min-height:75px}.text-footer-container textarea{margin:0 5px;border:unset;flex:1;resize:none;min-height:30px;max-height:60px;font-size:.875rem;font-family:inherit;background:inherit}.text-footer-container textarea:focus{outline:unset}.text-footer-container textarea::placeholder{font-size:.75rem}.text-footer-container .text-footer-audio{flex:1;display:flex;justify-content:center;align-items:center}.text-footer-container audio{flex:1;outline:unset;width:auto;height:38px}.text-footer-container .delete-audio{display:flex;justify-content:center;align-items:center;color:#e74c3c;transition:background .3s;border-radius:50%;font-size:1rem;padding:10px;cursor:pointer;margin:0 5px;width:31px;height:31px}.text-footer-container .delete-audio:hover{background-color:rgba(208,0,0,.2)}.text-footer-container .max-characters{font-size:.575rem;z-index:1;color:#444;position:relative;top:30px;left:-30px}.text-footer-container .max-characters.no-width{width:0}.text-footer-container .text-footer-actions{display:flex}.text-footer-container .text-footer-actions.outside-buttons{display:flex;align-items:center;justify-content:flex-end;position:absolute;top:-42px;right:2px;background-color:#ddd;box-shadow:inset 0 -10px 5px -11px rgba(0,0,0,.5)}.text-footer-container .text-footer-actions .text-footer-actions--btn{display:flex;justify-content:center;align-items:center;color:#777;border-radius:50%;transition:background .3s;padding:10px;font-size:1rem;width:36px;height:36px;cursor:pointer;margin-right:2.5px}.text-footer-container .text-footer-actions .text-footer-actions--btn:last-child{margin-right:unset}.text-footer-container .text-footer-actions .text-footer-actions--btn:hover{background-color:rgba(0,0,0,.1)}.text-footer-container .text-footer-actions .text-footer-actions--btn.files-activated{background-color:rgba(0,0,0,.1)}.text-footer-container .text-footer-actions .text-footer-actions--btn.audio-activated{background-color:rgba(208,0,0,.7);color:#fff}.text-footer-container .text-footer-actions .text-footer-actions--btn.left-button{position:absolute;left:0}.text-footer-container .text-footer-hsm-container{margin:12px 0 7px 0}.text-footer-container .text-footer-hsm-container.full{width:100%}.text-footer-container .text-footer-hsm-container.almostFull{width:95%}.text-footer-container .text-footer-hsm-container.medium{width:75%}.text-footer-container .text-footer-hsm-container .text-footer-v-select{border-radius:5px;margin-bottom:5px}.text-footer-container .text-footer-hsm-container .text-footer-select-03{display:flex;align-items:center;flex:1;width:100%}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer-v-select{flex:1}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03{transition-duration:.3s;user-select:none;cursor:pointer;box-shadow:inset 0 -3px rgba(0,0,0,.2);opacity:.9;border-radius:2.5px;display:flex;justify-content:center;align-items:center;margin-left:5px;margin-bottom:5px;background-color:#f7fe72;width:32px;height:32px}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:hover{opacity:1}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:active{opacity:1;box-shadow:inset 0 -1px rgba(0,0,0,.2);-webkit-transform:translateY(1px);-moz-transform:translateY(1px);-o-transform:translateY(1px);-ms-transform:translateY(1px);transform:translateY(1px)}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03 svg{font-size:1rem}.text-footer-container .text-footer-files-container{position:absolute;right:0;top:-55px;padding:5px;background-color:rgba(0,0,0,.4);border-radius:5px;display:flex;align-items:center;justify-content:space-between;z-index:1}.text-footer-container .text-footer-files-container.horizontal{right:-55px;flex-direction:column}.text-footer-container .text-footer-files-container .files-btn{transition-duration:.3s;transition-property:opacity;opacity:.8;cursor:pointer;display:flex;justify-content:center;align-items:center;border-radius:10px;padding:3px;width:40px;height:40px;font-size:1rem;color:#fff}.text-footer-container .text-footer-files-container .files-btn:hover{opacity:1}.text-footer-container .text-footer-files-container .files-btn svg{color:#fff}.text-footer-container .text-footer-files-container .files-btn.images{background-color:#9575cd;margin-right:5px}.text-footer-container .text-footer-files-container .files-btn.images.margin-bottom{margin-right:unset;margin-bottom:5px}.text-footer-container .text-footer-files-container .files-btn.docs{background-color:#7986cb}.text-footer-container .text-footer-files-container .files-btn.system{background-color:#49a349;margin-left:5px}.text-footer-container .text-footer-files-container .files-btn.both{font-size:.95rem;background-color:#5555ec;flex-direction:column}.text-footer-container .text-footer-files-container .files-btn.both svg:nth-child(1){transform:translateX(5px)}.text-footer-container .text-footer-files-container .files-btn.both svg:nth-child(2){transform:translateX(-5px)}.text-footer-container .text-footer-preview-container{width:100%;cursor:default;position:absolute;left:0;background-color:#f1f1f1;border:2px solid #ccc;border-bottom:unset;border-top-left-radius:2.5px;border-top-right-radius:2.5px}.text-footer-container .text-footer-preview-container.isDoc{top:-50px;width:100%;height:45px}.text-footer-container .text-footer-preview-container.isImg,.text-footer-container .text-footer-preview-container.isMultiple{top:-205px;width:100%;height:200px}.text-footer-container .text-footer-preview-container.isImg .text-footer-image-preview{height:170px}.text-footer-container .text-footer-preview-container.isError{top:-80px;width:100%;height:75px}.text-footer-container .text-footer-alt{margin-top:-12px;width:100%;padding:0 10px}.text-footer-container .text-footer-alt .text-footer-out-session{margin-top:12px}.text-footer-container .text-footer-alt .text-footer-sem-24h{font-size:.8rem;text-align:right;font-weight:600;letter-spacing:-.5px;color:#dd7f0c;margin-top:5px;position:absolute;right:0}.text-footer-container .text-footer-alt .sem-templates{margin-top:10px;font-size:.8rem;text-align:right;font-weight:600;letter-spacing:-.5px;color:#921e12}.text-footer-container .text-footer-alt .text-footer-templates{position:relative;width:100%}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection{width:100%;display:flex;align-items:center}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection h4{margin-right:5px}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection .sm__select{flex:1}.vs__dropdown-menu{font-size:.85rem!important}.emoji-mart-anchor,.emoji-mart-emoji span{cursor:pointer!important}.emoji-mart{z-index:2!important}.emoji-mart-scroll{overflow-x:hidden}",
8946
8980
  map: undefined,
8947
8981
  media: undefined
@@ -8953,7 +8987,7 @@ var __vue_inject_styles__$j = function __vue_inject_styles__(inject) {
8953
8987
  var __vue_scope_id__$j = undefined;
8954
8988
  /* module identifier */
8955
8989
 
8956
- var __vue_module_identifier__$j = "data-v-7d5d938e";
8990
+ var __vue_module_identifier__$j = "data-v-53fe87de";
8957
8991
  /* functional template */
8958
8992
 
8959
8993
  var __vue_is_functional_template__$j = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.225",
3
+ "version": "0.0.228",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -1,9 +1,21 @@
1
1
  <template>
2
- <span class="text-footer-actions--btn" :class="{'files-activated' : openFiles || file.length || file.name}" @click="openFilesByClip()">
2
+ <span class="text-footer-actions--btn" :class="{'files-activated' : openFiles || file.name}" @click="openFilesByClip()"> <!-- || file.length -->
3
+ <!-- <transition name="fade">
4
+ <span v-if="fileSize > 0" @click.stop="toggleFilePreview" v-tippy :content="`Visualizar ${fileSize} arquivo(s)`" class="files-counter">
5
+ {{ fileSize }}
6
+ </span>
7
+ </transition> -->
8
+ <fa-icon :icon="['fas', 'paperclip']" :title="dictionary.title_selecionar_anexo" />
3
9
  <transition name="fade">
4
- <span v-if="fileSize > 0" class="files-counter" v-text="fileSize" @click.stop="toggleFilePreview" :title="dictionary.msg_abrir_anexos"></span>
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'}`">
11
+ <template v-if="fileSettings.filePreviewStyle == 1">
12
+ {{ fileSize }}
13
+ </template>
14
+ <template v-else>
15
+ Anexos <fa-icon :icon="['fas', 'eye']" />
16
+ </template>
17
+ </span>
5
18
  </transition>
6
- <fa-icon :icon="['fas', 'paperclip']" :title="dictionary.title_selecionar_anexo" />
7
19
  <transition name="show">
8
20
  <div v-if="openFiles && hasButtonFiles" class="text-footer-files-container" :class="{'horizontal' : cssStyle.outsideButtons}">
9
21
  <template v-if="!fileSettings.multiple">
@@ -91,6 +103,23 @@
91
103
  .files-counter:hover {
92
104
  opacity: 1
93
105
  }
106
+ .files-counter-2 {
107
+ transform: translate(-15px, 28px);
108
+ opacity: .9;
109
+ position: absolute;
110
+ display: flex;
111
+ justify-content: center;
112
+ align-items: center;
113
+ color: #888;
114
+ font-size: .8rem
115
+ }
116
+ .files-counter-2 svg {
117
+ margin-left: 5px;
118
+ }
119
+ .files-counter-2:hover {
120
+ opacity: 1;
121
+ text-decoration: underline;
122
+ }
94
123
  </style>
95
124
 
96
125
  <script>
@@ -231,14 +260,13 @@ export default {
231
260
  if(this.fileFormatError) this.file = []
232
261
  this.openFiles = false
233
262
  const filesAux = !externalCall ? event.target.files ? event.target.files : event.dataTransfer.files : event
234
- this.file = filesAux.length ? filesAux : this.file
235
-
263
+ const isStackable = this.fileSettings.stackFiles && this.fileSettings.multiple
264
+ this.file = filesAux.length ? isStackable ? this.file.concat(...filesAux) : filesAux : this.file
236
265
  if(!this.file.length) return
237
266
  if(this.file.length > this.fileSettings.max) {
238
267
  this.file = []
239
268
  return this.$toasted.global.defaultInfo({ msg: `Limite de ${this.fileSettings.max} arquivos` })
240
269
  }
241
-
242
270
  this.hasAnyFile = true
243
271
  this.fileSize = this.file.length
244
272
  if(!this.fileSettings.multiple) {
@@ -329,6 +357,10 @@ export default {
329
357
  if(this.isDoc) this.emitFileVars()
330
358
  },
331
359
  toggleFilePreview() {
360
+ if(this.fileSettings.handleFilePreview) {
361
+ this.emitFileVars()
362
+ return this.$emit("handle-file-preview")
363
+ }
332
364
  this.showFilePreview = !this.showFilePreview
333
365
  if(this.showFilePreview && this.openFiles) this.toggleFiles()
334
366
  },
@@ -69,6 +69,7 @@
69
69
  @open-image="openImage"
70
70
  @open-file-system="openFileSystem"
71
71
  @reset-file-system="resetFileSystem"
72
+ @handle-file-preview="$emit('handle-file-preview')"
72
73
  />
73
74
  <BtnExpand
74
75
  v-show="buttons.hasExpand && !audioFile"
@@ -146,7 +147,7 @@ export default {
146
147
  },
147
148
  fileSettings: {
148
149
  type: Object,
149
- default: () => { return { docsExtensions: "", imagesExtensions: "", multiple: false, systemButton: false, max: 3 } },
150
+ default: () => { return { docsExtensions: "", imagesExtensions: "", multiple: false, systemButton: false, max: 3, handleFilePreview: false, filePreviewStyle: 1, stackFiles: false } },
150
151
  required: false
151
152
  },
152
153
  textId: {