vue-intergrall-plugins 0.0.8 → 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.
- package/dist/vue-intergrall-plugins.esm.js +61 -31
- package/dist/vue-intergrall-plugins.min.js +1 -1
- package/dist/vue-intergrall-plugins.ssr.js +63 -34
- package/package.json +1 -1
- package/src/lib-components/Chat/BtnFiles.vue +35 -11
- package/src/lib-components/Chat/MultipleFilePreview.vue +3 -3
- package/src/lib-components/Chat/TextFooter.vue +19 -12
|
@@ -2087,7 +2087,7 @@ var TemplateSingle = __vue_component__$b;var setResizeListeners = function setRe
|
|
|
2087
2087
|
inputTargets.forEach(function (target) {
|
|
2088
2088
|
target.addEventListener("input", function () {
|
|
2089
2089
|
var currentHeight = target.scrollHeight;
|
|
2090
|
-
if (target.textLength == 0) currentHeight =
|
|
2090
|
+
if (target.textLength == 0) currentHeight = 30;
|
|
2091
2091
|
target.style.height = "auto";
|
|
2092
2092
|
target.style.height = "".concat(currentHeight, "px");
|
|
2093
2093
|
var parentTargets = $el.querySelectorAll(parentClass);
|
|
@@ -8540,6 +8540,9 @@ var __vue_render__$4 = function __vue_render__() {
|
|
|
8540
8540
|
}
|
|
8541
8541
|
})], 1) : _vm._e()]), _vm._v(" "), _c('span', {
|
|
8542
8542
|
staticClass: "delete-file",
|
|
8543
|
+
attrs: {
|
|
8544
|
+
"title": _vm.dictionary.msg_excluir_anexo
|
|
8545
|
+
},
|
|
8543
8546
|
on: {
|
|
8544
8547
|
"click": function click($event) {
|
|
8545
8548
|
return _vm.deleteSpecificFile(singleFile.name, index);
|
|
@@ -8558,8 +8561,8 @@ var __vue_staticRenderFns__$4 = [];
|
|
|
8558
8561
|
|
|
8559
8562
|
var __vue_inject_styles__$4 = function __vue_inject_styles__(inject) {
|
|
8560
8563
|
if (!inject) return;
|
|
8561
|
-
inject("data-v-
|
|
8562
|
-
source: ".multiple-file-preview{position:relative;display:flex;flex-direction:column;width:100%;height:100%;max-height:100%;overflow-y:auto;overflow-x:hidden;border-top-left-radius:5px;border-top-right-radius:5px;transition:background-color 150ms}.file-preview{display:flex;width:100%;align-items:center;padding:5px 10px;transition:background-color 150ms}.file-preview:hover{background-color:rgba(0,0,0,.1)}.file-title{color:#222;display:flex;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding:4px 10px;background-color:rgba(255,255,255,.8);border-radius:30px}.file-title.red{color:#e74c3c;margin-left:5px}.file-title>svg{margin-right:5px}.small-img{flex:1;margin:0 15px;display:flex;justify-content:center;align-items:center;position:relative}.small-img img{height:40px;cursor:pointer}.small-img .pdf{display:flex;justify-content:center;align-items:center;font-size:30px;color:#e74c3c}.small-img .pdf svg{z-index:1}.small-img .pdf::after{content:\"\";position:absolute;bottom:2px;transform:translateY(2px);width:20px;height:20px;background-color:#fff}.img-container{padding:5px;border-radius:2.5px;background-color:rgba(0,0,0,.15);display:flex;justify-content:center;align-items:center}.delete-file{display:flex;justify-content:center;align-items:center;border-radius:50%;background-color:#fff;min-width:1rem;min-height:1rem;cursor:pointer}.delete-file>svg{font-size:1rem;color:#e74c3c}",
|
|
8564
|
+
inject("data-v-1ab24e70_0", {
|
|
8565
|
+
source: ".multiple-file-preview{position:relative;display:flex;flex-direction:column;width:100%;height:100%;max-height:100%;overflow-y:auto;overflow-x:hidden;border-top-left-radius:2.5px;border-top-right-radius:2.5px;transition:background-color 150ms}.file-preview{display:flex;width:100%;align-items:center;padding:5px 10px;transition:background-color 150ms}.file-preview:hover{background-color:rgba(0,0,0,.1)}.file-title{color:#222;display:flex;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding:4px 10px;background-color:rgba(255,255,255,.8);border-radius:30px}.file-title.red{color:#e74c3c;margin-left:5px}.file-title>svg{margin-right:5px}.small-img{flex:1;margin:0 15px;display:flex;justify-content:center;align-items:center;position:relative}.small-img img{height:40px;cursor:pointer}.small-img .pdf{display:flex;justify-content:center;align-items:center;font-size:30px;color:#e74c3c}.small-img .pdf svg{z-index:1}.small-img .pdf::after{content:\"\";position:absolute;bottom:2px;transform:translateY(2px);width:20px;height:20px;background-color:#fff}.img-container{padding:5px;border-radius:2.5px;background-color:rgba(0,0,0,.15);display:flex;justify-content:center;align-items:center}.delete-file{display:flex;justify-content:center;align-items:center;border-radius:50%;background-color:#fff;min-width:1rem;min-height:1rem;cursor:pointer}.delete-file>svg{font-size:1rem;color:#e74c3c}",
|
|
8563
8566
|
map: undefined,
|
|
8564
8567
|
media: undefined
|
|
8565
8568
|
});
|
|
@@ -8570,7 +8573,7 @@ var __vue_inject_styles__$4 = function __vue_inject_styles__(inject) {
|
|
|
8570
8573
|
var __vue_scope_id__$4 = undefined;
|
|
8571
8574
|
/* module identifier */
|
|
8572
8575
|
|
|
8573
|
-
var __vue_module_identifier__$4 = "data-v-
|
|
8576
|
+
var __vue_module_identifier__$4 = "data-v-1ab24e70";
|
|
8574
8577
|
/* functional template */
|
|
8575
8578
|
|
|
8576
8579
|
var __vue_is_functional_template__$4 = false;
|
|
@@ -8655,15 +8658,9 @@ var script$3 = {
|
|
|
8655
8658
|
fileUpload: function fileUpload(event, type, externalCall) {
|
|
8656
8659
|
try {
|
|
8657
8660
|
this.openFiles = false;
|
|
8658
|
-
|
|
8659
|
-
this.file =
|
|
8660
|
-
|
|
8661
|
-
if (!this.file.length) {
|
|
8662
|
-
this.file = [];
|
|
8663
|
-
return;
|
|
8664
|
-
}
|
|
8665
|
-
|
|
8666
|
-
this.showFilePreview = true;
|
|
8661
|
+
var filesAux = !externalCall ? event.target.files ? event.target.files : event.dataTransfer.files : event;
|
|
8662
|
+
this.file = filesAux.length ? filesAux : this.file;
|
|
8663
|
+
if (!this.file.length) return;
|
|
8667
8664
|
|
|
8668
8665
|
if (!this.fileSettings.multiple) {
|
|
8669
8666
|
this.file = this.file[0];
|
|
@@ -8745,6 +8742,9 @@ var script$3 = {
|
|
|
8745
8742
|
|
|
8746
8743
|
if (this.isDoc) this.emitFileVars();
|
|
8747
8744
|
},
|
|
8745
|
+
toggleFilePreview: function toggleFilePreview() {
|
|
8746
|
+
this.showFilePreview = !this.showFilePreview;
|
|
8747
|
+
},
|
|
8748
8748
|
emitFileVars: function emitFileVars() {
|
|
8749
8749
|
var vars = {
|
|
8750
8750
|
file: this.file,
|
|
@@ -8796,19 +8796,35 @@ var __vue_render__$3 = function __vue_render__() {
|
|
|
8796
8796
|
return _c('span', {
|
|
8797
8797
|
staticClass: "text-footer-actions--btn",
|
|
8798
8798
|
class: {
|
|
8799
|
-
'files-activated': _vm.openFiles
|
|
8799
|
+
'files-activated': _vm.openFiles || _vm.file.length
|
|
8800
8800
|
},
|
|
8801
|
+
on: {
|
|
8802
|
+
"click": function click($event) {
|
|
8803
|
+
_vm.fileSettings.multiple ? _vm.openSelectFileHandler('both') : _vm.toggleFiles;
|
|
8804
|
+
}
|
|
8805
|
+
}
|
|
8806
|
+
}, [_c('transition', {
|
|
8801
8807
|
attrs: {
|
|
8802
|
-
"
|
|
8808
|
+
"name": "fade"
|
|
8809
|
+
}
|
|
8810
|
+
}, [_vm.file.length ? _c('span', {
|
|
8811
|
+
staticClass: "files-counter",
|
|
8812
|
+
attrs: {
|
|
8813
|
+
"title": _vm.dictionary.msg_abrir_anexos
|
|
8814
|
+
},
|
|
8815
|
+
domProps: {
|
|
8816
|
+
"textContent": _vm._s(_vm.file.length)
|
|
8803
8817
|
},
|
|
8804
8818
|
on: {
|
|
8805
8819
|
"click": function click($event) {
|
|
8806
|
-
|
|
8820
|
+
$event.stopPropagation();
|
|
8821
|
+
return _vm.toggleFilePreview.apply(null, arguments);
|
|
8807
8822
|
}
|
|
8808
8823
|
}
|
|
8809
|
-
},
|
|
8824
|
+
}) : _vm._e()]), _vm._ssrNode(" "), _c('fa-icon', {
|
|
8810
8825
|
attrs: {
|
|
8811
|
-
"icon": ['fas', 'paperclip']
|
|
8826
|
+
"icon": ['fas', 'paperclip'],
|
|
8827
|
+
"title": _vm.dictionary.title_selecionar_anexo
|
|
8812
8828
|
}
|
|
8813
8829
|
}), _vm._ssrNode(" "), _c('transition', {
|
|
8814
8830
|
attrs: {
|
|
@@ -8854,7 +8870,13 @@ var __vue_render__$3 = function __vue_render__() {
|
|
|
8854
8870
|
attrs: {
|
|
8855
8871
|
"name": "fade"
|
|
8856
8872
|
}
|
|
8857
|
-
}, [
|
|
8873
|
+
}, [_c('div', {
|
|
8874
|
+
directives: [{
|
|
8875
|
+
name: "show",
|
|
8876
|
+
rawName: "v-show",
|
|
8877
|
+
value: _vm.showFilePreview,
|
|
8878
|
+
expression: "showFilePreview"
|
|
8879
|
+
}],
|
|
8858
8880
|
staticClass: "text-footer-preview-container",
|
|
8859
8881
|
class: [_vm.previewContainerClass],
|
|
8860
8882
|
on: {
|
|
@@ -8887,7 +8909,7 @@ var __vue_render__$3 = function __vue_render__() {
|
|
|
8887
8909
|
"delete-specific-file": _vm.deleteSpecificFile,
|
|
8888
8910
|
"open-image": _vm.openImage
|
|
8889
8911
|
}
|
|
8890
|
-
})], 1)
|
|
8912
|
+
})], 1)])], 2);
|
|
8891
8913
|
};
|
|
8892
8914
|
|
|
8893
8915
|
var __vue_staticRenderFns__$3 = [];
|
|
@@ -8895,8 +8917,8 @@ var __vue_staticRenderFns__$3 = [];
|
|
|
8895
8917
|
|
|
8896
8918
|
var __vue_inject_styles__$3 = function __vue_inject_styles__(inject) {
|
|
8897
8919
|
if (!inject) return;
|
|
8898
|
-
inject("data-v-
|
|
8899
|
-
source: ".fade-enter-active,.fade-leave-active{transition:opacity .3s}.fade-enter,.fade-leave-to{opacity:0}",
|
|
8920
|
+
inject("data-v-ba3fe4c6_0", {
|
|
8921
|
+
source: ".fade-enter-active,.fade-leave-active{transition:opacity .3s}.fade-enter,.fade-leave-to{opacity:0}.files-counter{position:absolute;top:0;z-index:1;right:0;font-size:.5rem;width:15px;height:15px;border-radius:50%;background:#a4ac86;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}",
|
|
8900
8922
|
map: undefined,
|
|
8901
8923
|
media: undefined
|
|
8902
8924
|
});
|
|
@@ -8907,7 +8929,7 @@ var __vue_inject_styles__$3 = function __vue_inject_styles__(inject) {
|
|
|
8907
8929
|
var __vue_scope_id__$3 = undefined;
|
|
8908
8930
|
/* module identifier */
|
|
8909
8931
|
|
|
8910
|
-
var __vue_module_identifier__$3 = "data-v-
|
|
8932
|
+
var __vue_module_identifier__$3 = "data-v-ba3fe4c6";
|
|
8911
8933
|
/* functional template */
|
|
8912
8934
|
|
|
8913
8935
|
var __vue_is_functional_template__$3 = false;
|
|
@@ -9210,16 +9232,23 @@ var script$2 = {
|
|
|
9210
9232
|
|
|
9211
9233
|
var fileType = this.returnFileType(files[0], true);
|
|
9212
9234
|
var invalidFile = false;
|
|
9213
|
-
files.forEach(function (file) {
|
|
9214
|
-
var singleFileType = _this.returnFileType(file, true);
|
|
9215
9235
|
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
}
|
|
9236
|
+
try {
|
|
9237
|
+
files.forEach(function (file) {
|
|
9238
|
+
var singleFileType = _this.returnFileType(file, true);
|
|
9220
9239
|
|
|
9221
|
-
|
|
9222
|
-
|
|
9240
|
+
if (!singleFileType) {
|
|
9241
|
+
invalidFile = true;
|
|
9242
|
+
file.invalid = true;
|
|
9243
|
+
}
|
|
9244
|
+
|
|
9245
|
+
file.imgOrDoc = singleFileType ? singleFileType : "";
|
|
9246
|
+
});
|
|
9247
|
+
} catch (e) {
|
|
9248
|
+
console.error("Erro ao tentar percorrer os arquivos");
|
|
9249
|
+
console.error(e);
|
|
9250
|
+
invalidFile = true;
|
|
9251
|
+
}
|
|
9223
9252
|
|
|
9224
9253
|
if (!invalidFile) {
|
|
9225
9254
|
this.$refs["".concat(this.textId, "-file")].fileUpload(files, fileType, true);
|
|
@@ -9376,8 +9405,8 @@ var __vue_staticRenderFns__$2 = [];
|
|
|
9376
9405
|
|
|
9377
9406
|
var __vue_inject_styles__$2 = function __vue_inject_styles__(inject) {
|
|
9378
9407
|
if (!inject) return;
|
|
9379
|
-
inject("data-v-
|
|
9380
|
-
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:
|
|
9408
|
+
inject("data-v-e42cf7de_0", {
|
|
9409
|
+
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 4px 5px -2px rgba(0,0,0,.25);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 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 .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:5px}.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-preview-container{cursor:default;position:absolute;left:0;background-color:#e1e1e1;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-preview-container .text-footer-exclude-file{position:absolute;top:5px;right:5px;cursor:pointer;display:flex;justify-content:center;align-items:center;min-width:1rem;min-height:1rem;background-color:#fff;border-radius:50%}.text-footer-container .text-footer-preview-container .text-footer-exclude-file svg{transition:color .2s;color:#e9594a}.text-footer-container .text-footer-preview-container .text-footer-exclude-file svg:hover{color:#e74c3c}.text-footer-container .text-footer-preview-container .text-footer-preview-title{font-size:1rem;padding:10px 0 0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-footer-container .text-footer-preview-container .text-footer-image-preview{display:flex;justify-content:center;align-items:center;width:100%}.text-footer-container .text-footer-preview-container .text-footer-image-preview img{cursor:pointer;max-width:98%;max-height:98%;padding:2%}.text-footer-container .text-footer-preview-container .text-footer-invalid-format{color:#222;padding:10px}.text-footer-container .text-footer-preview-container .text-footer-invalid-format h3{font-weight:500}.text-footer-container .text-footer-preview-container .text-footer-invalid-format h4{font-size:.9rem}.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-text-container{position:relative}.emoji-text-container .emoji-text-btn{font-size:1.2rem;cursor:pointer}.emoji-mart-anchor,.emoji-mart-emoji span{cursor:pointer!important}.emoji-mart{z-index:2!important}.emoji-mart-scroll{overflow-x:hidden}",
|
|
9381
9410
|
map: undefined,
|
|
9382
9411
|
media: undefined
|
|
9383
9412
|
});
|
|
@@ -9388,7 +9417,7 @@ var __vue_inject_styles__$2 = function __vue_inject_styles__(inject) {
|
|
|
9388
9417
|
var __vue_scope_id__$2 = undefined;
|
|
9389
9418
|
/* module identifier */
|
|
9390
9419
|
|
|
9391
|
-
var __vue_module_identifier__$2 = "data-v-
|
|
9420
|
+
var __vue_module_identifier__$2 = "data-v-e42cf7de";
|
|
9392
9421
|
/* functional template */
|
|
9393
9422
|
|
|
9394
9423
|
var __vue_is_functional_template__$2 = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span class="text-footer-actions--btn" :class="{'files-activated' : openFiles
|
|
3
|
-
<
|
|
2
|
+
<span class="text-footer-actions--btn" :class="{'files-activated' : openFiles || file.length}" @click="fileSettings.multiple ? openSelectFileHandler('both') : toggleFiles">
|
|
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>
|
|
5
|
+
</transition>
|
|
6
|
+
<fa-icon :icon="['fas', 'paperclip']" :title="dictionary.title_selecionar_anexo" />
|
|
4
7
|
<transition name="show">
|
|
5
8
|
<div v-if="openFiles" class="text-footer-files-container" :class="{'horizontal' : cssStyle.outsideButtons}">
|
|
6
9
|
<div class="files-btn images" :class="{'margin-bottom' : cssStyle.outsideButtons}" :title="dictionary.title_anexo_img" @click="openSelectFileHandler('img')">
|
|
@@ -17,7 +20,7 @@
|
|
|
17
20
|
<input v-if="!fileSettings.multiple" type="file" :id="`doc-${textId}`" accept="application/*" @change="fileUpload($event, 'doc')" />
|
|
18
21
|
</div>
|
|
19
22
|
<transition name="fade">
|
|
20
|
-
<div class="text-footer-preview-container" @click.stop v-
|
|
23
|
+
<div class="text-footer-preview-container" @click.stop v-show="showFilePreview" :class="[previewContainerClass]">
|
|
21
24
|
<SingleFilePreview
|
|
22
25
|
v-if="!fileSettings.multiple"
|
|
23
26
|
:dictionary="dictionary"
|
|
@@ -53,6 +56,29 @@
|
|
|
53
56
|
.fade-leave-to {
|
|
54
57
|
opacity: 0;
|
|
55
58
|
}
|
|
59
|
+
|
|
60
|
+
.files-counter {
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 0px;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
right: 0px;
|
|
65
|
+
font-size: .5rem;
|
|
66
|
+
width: 15px;
|
|
67
|
+
height: 15px;
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
background: #a4ac86;
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
opacity: .9;
|
|
75
|
+
transition: all 300ms;
|
|
76
|
+
color: #FFF;
|
|
77
|
+
font-weight: 900;
|
|
78
|
+
}
|
|
79
|
+
.files-counter:hover {
|
|
80
|
+
opacity: 1
|
|
81
|
+
}
|
|
56
82
|
</style>
|
|
57
83
|
|
|
58
84
|
<script>
|
|
@@ -126,15 +152,10 @@ export default {
|
|
|
126
152
|
fileUpload(event, type, externalCall) {
|
|
127
153
|
try {
|
|
128
154
|
this.openFiles = false
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.file = !externalCall ? event.target.files ? event.target.files : event.dataTransfer.files : event
|
|
132
|
-
if(!this.file.length) {
|
|
133
|
-
this.file = []
|
|
134
|
-
return
|
|
135
|
-
}
|
|
155
|
+
let filesAux = !externalCall ? event.target.files ? event.target.files : event.dataTransfer.files : event
|
|
156
|
+
this.file = filesAux.length ? filesAux : this.file
|
|
136
157
|
|
|
137
|
-
this.
|
|
158
|
+
if(!this.file.length) return
|
|
138
159
|
if(!this.fileSettings.multiple) {
|
|
139
160
|
this.file = this.file[0]
|
|
140
161
|
this.singleFileUpload(type, this.file.name)
|
|
@@ -202,6 +223,9 @@ export default {
|
|
|
202
223
|
|
|
203
224
|
if(this.isDoc) this.emitFileVars()
|
|
204
225
|
},
|
|
226
|
+
toggleFilePreview() {
|
|
227
|
+
this.showFilePreview = !this.showFilePreview
|
|
228
|
+
},
|
|
205
229
|
emitFileVars() {
|
|
206
230
|
const vars = { file: this.file, isDoc: this.isDoc, showFilePreview: this.showFilePreview, imagePreview: this.imagePreview, fileFormatError: this.fileFormatError }
|
|
207
231
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<fa-icon :icon="['fas', 'file-pdf']" />
|
|
33
33
|
</span>
|
|
34
34
|
</div>
|
|
35
|
-
<span @click="deleteSpecificFile(singleFile.name, index)" class="delete-file">
|
|
35
|
+
<span @click="deleteSpecificFile(singleFile.name, index)" :title="dictionary.msg_excluir_anexo" class="delete-file">
|
|
36
36
|
<fa-icon :icon="['fas', 'times-circle']" />
|
|
37
37
|
</span>
|
|
38
38
|
</div>
|
|
@@ -105,8 +105,8 @@ export default {
|
|
|
105
105
|
max-height: 100%;
|
|
106
106
|
overflow-y: auto;
|
|
107
107
|
overflow-x: hidden;
|
|
108
|
-
border-top-left-radius: 5px;
|
|
109
|
-
border-top-right-radius: 5px;
|
|
108
|
+
border-top-left-radius: 2.5px;
|
|
109
|
+
border-top-right-radius: 2.5px;
|
|
110
110
|
transition: background-color 150ms;
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -315,14 +315,20 @@ export default {
|
|
|
315
315
|
filesHandler(files) {
|
|
316
316
|
const fileType = this.returnFileType(files[0], true)
|
|
317
317
|
let invalidFile = false
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
318
|
+
try {
|
|
319
|
+
files.forEach(file => {
|
|
320
|
+
const singleFileType = this.returnFileType(file, true)
|
|
321
|
+
if(!singleFileType) {
|
|
322
|
+
invalidFile = true
|
|
323
|
+
file.invalid = true
|
|
324
|
+
}
|
|
325
|
+
file.imgOrDoc = singleFileType ? singleFileType : ""
|
|
326
|
+
})
|
|
327
|
+
}catch(e) {
|
|
328
|
+
console.error("Erro ao tentar percorrer os arquivos")
|
|
329
|
+
console.error(e)
|
|
330
|
+
invalidFile = true
|
|
331
|
+
}
|
|
326
332
|
|
|
327
333
|
if(!invalidFile) {
|
|
328
334
|
this.$refs[`${this.textId}-file`].fileUpload(files, fileType, true)
|
|
@@ -389,14 +395,15 @@ ul {
|
|
|
389
395
|
width: 100%;
|
|
390
396
|
position: relative; }
|
|
391
397
|
.text-footer-container .text-footer {
|
|
392
|
-
min-height:
|
|
398
|
+
min-height: 48px;
|
|
399
|
+
box-shadow: 0px 4px 5px -2px rgba(0, 0, 0, 0.25);
|
|
393
400
|
position: relative;
|
|
394
401
|
display: flex;
|
|
395
402
|
justify-content: center;
|
|
396
403
|
align-items: center;
|
|
397
404
|
border: 1px solid #ccc;
|
|
398
405
|
padding: 5px 2px 5px 5px;
|
|
399
|
-
border-radius:
|
|
406
|
+
border-radius: 5px; }
|
|
400
407
|
.text-footer-container .text-footer.full {
|
|
401
408
|
width: 100%; }
|
|
402
409
|
.text-footer-container .text-footer.almostFull {
|
|
@@ -575,8 +582,8 @@ ul {
|
|
|
575
582
|
position: absolute;
|
|
576
583
|
left: 0;
|
|
577
584
|
background-color: rgb(225, 225, 225);
|
|
578
|
-
border-top-left-radius: 5px;
|
|
579
|
-
border-top-right-radius: 5px; }
|
|
585
|
+
border-top-left-radius: 2.5px;
|
|
586
|
+
border-top-right-radius: 2.5px; }
|
|
580
587
|
.text-footer-container .text-footer-preview-container.isDoc {
|
|
581
588
|
top: -50px;
|
|
582
589
|
width: 100%;
|