vue-intergrall-plugins 0.0.4 → 0.0.8
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/README.md +177 -0
- package/dist/vue-intergrall-plugins.esm.js +1345 -600
- package/dist/vue-intergrall-plugins.min.js +1 -1
- package/dist/vue-intergrall-plugins.ssr.js +1274 -613
- package/package.json +2 -4
- package/src/lib-components/Chat/BtnFiles.vue +233 -0
- package/src/lib-components/Chat/BtnMic.vue +60 -0
- package/src/lib-components/Chat/MultipleFilePreview.vue +197 -0
- package/src/lib-components/Chat/RemainingCharacters.vue +28 -0
- package/src/lib-components/Chat/SingleFilePreview.vue +46 -0
- package/src/lib-components/Chat/TextFooter.vue +165 -212
- package/src/lib-components/Loader/Loader.vue +73 -0
- package/src/lib-components/Templates/TemplateGenerator.vue +225 -211
- package/src/lib-components/Templates/TemplateMessage.vue +6 -16
- package/src/lib-components/Templates/TemplateSingle.vue +35 -36
- package/src/lib-components/Loader/ReqLoader.vue +0 -25
|
@@ -1790,9 +1790,7 @@ var createPopper = /*#__PURE__*/popperGenerator({
|
|
|
1790
1790
|
//
|
|
1791
1791
|
//
|
|
1792
1792
|
//
|
|
1793
|
-
|
|
1794
|
-
//
|
|
1795
|
-
var script$5 = {
|
|
1793
|
+
var script$a = {
|
|
1796
1794
|
data() {
|
|
1797
1795
|
return {
|
|
1798
1796
|
varValues: {},
|
|
@@ -1813,10 +1811,6 @@ var script$5 = {
|
|
|
1813
1811
|
required: false,
|
|
1814
1812
|
default: true
|
|
1815
1813
|
},
|
|
1816
|
-
smartStyle: {
|
|
1817
|
-
type: Boolean,
|
|
1818
|
-
required: false
|
|
1819
|
-
},
|
|
1820
1814
|
allVariables: {
|
|
1821
1815
|
type: Boolean,
|
|
1822
1816
|
required: false,
|
|
@@ -1870,7 +1864,7 @@ var script$5 = {
|
|
|
1870
1864
|
},
|
|
1871
1865
|
|
|
1872
1866
|
getListOpts() {
|
|
1873
|
-
this.varListValues = `<ul class="
|
|
1867
|
+
this.varListValues = `<ul class="ts-dropdown">
|
|
1874
1868
|
<li> nome </li>
|
|
1875
1869
|
${this.allVariables ? '<li> telefone </li>' : ''}
|
|
1876
1870
|
</ul>`;
|
|
@@ -1889,9 +1883,7 @@ var script$5 = {
|
|
|
1889
1883
|
qtdInputs += header.querySelectorAll(`.input-var-${this.identifier}`).length;
|
|
1890
1884
|
}
|
|
1891
1885
|
|
|
1892
|
-
if (this.lastVar === 0)
|
|
1893
|
-
this.lastVar += 1;
|
|
1894
|
-
}
|
|
1886
|
+
if (this.lastVar === 0) this.lastVar += 1;
|
|
1895
1887
|
|
|
1896
1888
|
if (body !== null) {
|
|
1897
1889
|
body.querySelectorAll(`.input-var-${this.identifier}`).forEach(input => {
|
|
@@ -1908,12 +1900,9 @@ var script$5 = {
|
|
|
1908
1900
|
}
|
|
1909
1901
|
|
|
1910
1902
|
if (qtdInputs === 1) {
|
|
1911
|
-
document.querySelector(`.input-var-${this.identifier}`).parentElement.parentElement.parentElement.style.width = "100%";
|
|
1912
1903
|
document.querySelector(`.input-var-${this.identifier}`).parentElement.style.width = "100%";
|
|
1913
1904
|
document.querySelector(`.input-var-${this.identifier}`).style.width = "100%";
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
if (qtdInputs === 0) {
|
|
1905
|
+
} else if (qtdInputs === 0) {
|
|
1917
1906
|
this.$emit("set-vars", this.template);
|
|
1918
1907
|
}
|
|
1919
1908
|
},
|
|
@@ -1939,7 +1928,7 @@ var script$5 = {
|
|
|
1939
1928
|
});
|
|
1940
1929
|
}
|
|
1941
1930
|
|
|
1942
|
-
const containerGeral = document.querySelector(".
|
|
1931
|
+
const containerGeral = document.querySelector(".tg-container");
|
|
1943
1932
|
varList.classList.add("visible");
|
|
1944
1933
|
const maxBottom = containerGeral.getBoundingClientRect().bottom,
|
|
1945
1934
|
currentBottom = varList.getBoundingClientRect().bottom;
|
|
@@ -1983,9 +1972,21 @@ var script$5 = {
|
|
|
1983
1972
|
},
|
|
1984
1973
|
|
|
1985
1974
|
isValid(textValue) {
|
|
1986
|
-
const regex =
|
|
1975
|
+
const regex = {
|
|
1976
|
+
htmlTags: /<\/?[\d\w\s=\-:\.\/\'\";]+>/gi,
|
|
1977
|
+
enter: /\n/g,
|
|
1978
|
+
consecutiveSpaces: /\s{3,}/g
|
|
1979
|
+
};
|
|
1987
1980
|
const value = textValue ? textValue.trim("") : "";
|
|
1988
|
-
|
|
1981
|
+
if (!value.length) return false;
|
|
1982
|
+
let isValueValid = true;
|
|
1983
|
+
|
|
1984
|
+
for (let key in regex) {
|
|
1985
|
+
if (!isValueValid) return isValueValid;
|
|
1986
|
+
if (regex[key].test(value)) isValueValid = false;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
return isValueValid;
|
|
1989
1990
|
},
|
|
1990
1991
|
|
|
1991
1992
|
setVar(event, key, notificar) {
|
|
@@ -2085,10 +2086,10 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
|
|
|
2085
2086
|
}
|
|
2086
2087
|
|
|
2087
2088
|
/* script */
|
|
2088
|
-
const __vue_script__$
|
|
2089
|
+
const __vue_script__$a = script$a;
|
|
2089
2090
|
/* template */
|
|
2090
2091
|
|
|
2091
|
-
var __vue_render__$
|
|
2092
|
+
var __vue_render__$a = function () {
|
|
2092
2093
|
var _vm = this;
|
|
2093
2094
|
|
|
2094
2095
|
var _h = _vm.$createElement;
|
|
@@ -2096,25 +2097,22 @@ var __vue_render__$5 = function () {
|
|
|
2096
2097
|
var _c = _vm._self._c || _h;
|
|
2097
2098
|
|
|
2098
2099
|
return _c('div', {
|
|
2099
|
-
staticClass: "
|
|
2100
|
+
staticClass: "ts-container"
|
|
2100
2101
|
}, [_c('div', {
|
|
2101
|
-
staticClass: "
|
|
2102
|
+
staticClass: "ts-content"
|
|
2102
2103
|
}, _vm._l(_vm.template.components, function (component, cIndex) {
|
|
2103
2104
|
return _c('div', {
|
|
2104
2105
|
key: cIndex
|
|
2105
2106
|
}, [component.type === 'header' ? _c('header', {
|
|
2106
|
-
class: {
|
|
2107
|
-
sm__template: _vm.smartStyle
|
|
2108
|
-
},
|
|
2109
2107
|
attrs: {
|
|
2110
2108
|
"id": "template_header"
|
|
2111
2109
|
}
|
|
2112
2110
|
}, _vm._l(component.parameters, function (param, pIndex) {
|
|
2113
|
-
return _c('
|
|
2111
|
+
return _c('div', {
|
|
2114
2112
|
key: pIndex
|
|
2115
|
-
}, [param.type === 'text' ? [_vm.regexVars.test(param.text) ? _c('
|
|
2113
|
+
}, [param.type === 'text' ? [_vm.regexVars.test(param.text) ? _c('div', {
|
|
2116
2114
|
domProps: {
|
|
2117
|
-
"innerHTML": _vm._s(param.text.replace(_vm.regexVars, "<div class='
|
|
2115
|
+
"innerHTML": _vm._s(param.text.replace(_vm.regexVars, "<div class='ts-content__var'>" + _vm.htmlInputString + _vm.varListValues + "</div>"))
|
|
2118
2116
|
}
|
|
2119
2117
|
}) : _c('p', {
|
|
2120
2118
|
domProps: {
|
|
@@ -2123,18 +2121,17 @@ var __vue_render__$5 = function () {
|
|
|
2123
2121
|
})] : _vm._e()], 2);
|
|
2124
2122
|
}), 0) : _vm._e(), _vm._v(" "), component.type === 'body' ? _c('section', {
|
|
2125
2123
|
class: {
|
|
2126
|
-
sm__template: _vm.smartStyle,
|
|
2127
2124
|
'margin-bottom': _vm.template.components.length === 2
|
|
2128
2125
|
},
|
|
2129
2126
|
attrs: {
|
|
2130
2127
|
"id": "template_body"
|
|
2131
2128
|
}
|
|
2132
2129
|
}, _vm._l(component.parameters, function (param, pIndex) {
|
|
2133
|
-
return _c('
|
|
2130
|
+
return _c('div', {
|
|
2134
2131
|
key: pIndex
|
|
2135
|
-
}, [param.type === 'text' ? [_vm.regexVars.test(param.text) ? _c('
|
|
2132
|
+
}, [param.type === 'text' ? [_vm.regexVars.test(param.text) ? _c('div', {
|
|
2136
2133
|
domProps: {
|
|
2137
|
-
"innerHTML": _vm._s(param.text.replace(_vm.regexVars, "<div class='
|
|
2134
|
+
"innerHTML": _vm._s(param.text.replace(_vm.regexVars, "<div class='ts-content__var'>" + _vm.htmlInputString + _vm.varListValues + "</div>"))
|
|
2138
2135
|
}
|
|
2139
2136
|
}) : _c('p', {
|
|
2140
2137
|
domProps: {
|
|
@@ -2142,14 +2139,11 @@ var __vue_render__$5 = function () {
|
|
|
2142
2139
|
}
|
|
2143
2140
|
})] : _vm._e()], 2);
|
|
2144
2141
|
}), 0) : _vm._e(), _vm._v(" "), component.type == 'footer' ? _c('footer', {
|
|
2145
|
-
class: {
|
|
2146
|
-
sm__template: _vm.smartStyle
|
|
2147
|
-
},
|
|
2148
2142
|
attrs: {
|
|
2149
2143
|
"id": "template_footer"
|
|
2150
2144
|
}
|
|
2151
2145
|
}, _vm._l(component.parameters, function (param, pIndex) {
|
|
2152
|
-
return _c('
|
|
2146
|
+
return _c('div', {
|
|
2153
2147
|
key: pIndex
|
|
2154
2148
|
}, [param.type == 'text' ? _c('small', {
|
|
2155
2149
|
domProps: {
|
|
@@ -2158,7 +2152,7 @@ var __vue_render__$5 = function () {
|
|
|
2158
2152
|
}) : _vm._e()]);
|
|
2159
2153
|
}), 0) : _vm._e()]);
|
|
2160
2154
|
}), 0), _vm._v(" "), _vm.hasButton ? _c('div', {
|
|
2161
|
-
staticClass: "
|
|
2155
|
+
staticClass: "tg-btn",
|
|
2162
2156
|
class: {
|
|
2163
2157
|
'small-btn': _vm.iconButton
|
|
2164
2158
|
}
|
|
@@ -2175,31 +2169,31 @@ var __vue_render__$5 = function () {
|
|
|
2175
2169
|
})], 2)]) : _vm._e()]);
|
|
2176
2170
|
};
|
|
2177
2171
|
|
|
2178
|
-
var __vue_staticRenderFns__$
|
|
2172
|
+
var __vue_staticRenderFns__$a = [];
|
|
2179
2173
|
/* style */
|
|
2180
2174
|
|
|
2181
|
-
const __vue_inject_styles__$
|
|
2175
|
+
const __vue_inject_styles__$a = undefined;
|
|
2182
2176
|
/* scoped */
|
|
2183
2177
|
|
|
2184
|
-
const __vue_scope_id__$
|
|
2178
|
+
const __vue_scope_id__$a = undefined;
|
|
2185
2179
|
/* module identifier */
|
|
2186
2180
|
|
|
2187
|
-
const __vue_module_identifier__$
|
|
2181
|
+
const __vue_module_identifier__$a = undefined;
|
|
2188
2182
|
/* functional template */
|
|
2189
2183
|
|
|
2190
|
-
const __vue_is_functional_template__$
|
|
2184
|
+
const __vue_is_functional_template__$a = false;
|
|
2191
2185
|
/* style inject */
|
|
2192
2186
|
|
|
2193
2187
|
/* style inject SSR */
|
|
2194
2188
|
|
|
2195
2189
|
/* style inject shadow dom */
|
|
2196
2190
|
|
|
2197
|
-
const __vue_component__$
|
|
2198
|
-
render: __vue_render__$
|
|
2199
|
-
staticRenderFns: __vue_staticRenderFns__$
|
|
2200
|
-
}, __vue_inject_styles__$
|
|
2191
|
+
const __vue_component__$b = /*#__PURE__*/normalizeComponent({
|
|
2192
|
+
render: __vue_render__$a,
|
|
2193
|
+
staticRenderFns: __vue_staticRenderFns__$a
|
|
2194
|
+
}, __vue_inject_styles__$a, __vue_script__$a, __vue_scope_id__$a, __vue_is_functional_template__$a, __vue_module_identifier__$a, false, undefined, undefined, undefined);
|
|
2201
2195
|
|
|
2202
|
-
var TemplateSingle = __vue_component__$
|
|
2196
|
+
var TemplateSingle = __vue_component__$b;
|
|
2203
2197
|
|
|
2204
2198
|
const setResizeListeners = ($el, inputClass, parentClass) => {
|
|
2205
2199
|
const inputTargets = $el.querySelectorAll(inputClass);
|
|
@@ -2314,17 +2308,6 @@ function returnMessageWithHexa(originalMessage) {
|
|
|
2314
2308
|
|
|
2315
2309
|
return output;
|
|
2316
2310
|
}
|
|
2317
|
-
function formataHoraMensagem(mostrarSegundos = true) {
|
|
2318
|
-
let data = new Date();
|
|
2319
|
-
let hora = data.getHours();
|
|
2320
|
-
hora = hora < 10 ? "0" + hora : hora;
|
|
2321
|
-
let minutos = data.getMinutes();
|
|
2322
|
-
minutos = minutos < 10 ? "0" + minutos : minutos;
|
|
2323
|
-
let segundos = data.getSeconds();
|
|
2324
|
-
segundos = segundos < 10 ? "0" + segundos : segundos;
|
|
2325
|
-
const horaFormatada = mostrarSegundos ? `${hora}:${minutos}:${segundos}` : `${hora}:${minutos}`;
|
|
2326
|
-
return horaFormatada;
|
|
2327
|
-
}
|
|
2328
2311
|
|
|
2329
2312
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2330
2313
|
|
|
@@ -7964,7 +7947,7 @@ exports.default = { search: search, emojis: emojis, emoticons: emoticons };
|
|
|
7964
7947
|
});
|
|
7965
7948
|
|
|
7966
7949
|
//
|
|
7967
|
-
var script$
|
|
7950
|
+
var script$9 = {
|
|
7968
7951
|
components: {
|
|
7969
7952
|
"picker": emojiMart.Picker
|
|
7970
7953
|
},
|
|
@@ -8057,10 +8040,10 @@ var script$4 = {
|
|
|
8057
8040
|
};
|
|
8058
8041
|
|
|
8059
8042
|
/* script */
|
|
8060
|
-
const __vue_script__$
|
|
8043
|
+
const __vue_script__$9 = script$9;
|
|
8061
8044
|
/* template */
|
|
8062
8045
|
|
|
8063
|
-
var __vue_render__$
|
|
8046
|
+
var __vue_render__$9 = function () {
|
|
8064
8047
|
var _vm = this;
|
|
8065
8048
|
|
|
8066
8049
|
var _h = _vm.$createElement;
|
|
@@ -8110,31 +8093,31 @@ var __vue_render__$4 = function () {
|
|
|
8110
8093
|
})], 1);
|
|
8111
8094
|
};
|
|
8112
8095
|
|
|
8113
|
-
var __vue_staticRenderFns__$
|
|
8096
|
+
var __vue_staticRenderFns__$9 = [];
|
|
8114
8097
|
/* style */
|
|
8115
8098
|
|
|
8116
|
-
const __vue_inject_styles__$
|
|
8099
|
+
const __vue_inject_styles__$9 = undefined;
|
|
8117
8100
|
/* scoped */
|
|
8118
8101
|
|
|
8119
|
-
const __vue_scope_id__$
|
|
8102
|
+
const __vue_scope_id__$9 = undefined;
|
|
8120
8103
|
/* module identifier */
|
|
8121
8104
|
|
|
8122
|
-
const __vue_module_identifier__$
|
|
8105
|
+
const __vue_module_identifier__$9 = undefined;
|
|
8123
8106
|
/* functional template */
|
|
8124
8107
|
|
|
8125
|
-
const __vue_is_functional_template__$
|
|
8108
|
+
const __vue_is_functional_template__$9 = false;
|
|
8126
8109
|
/* style inject */
|
|
8127
8110
|
|
|
8128
8111
|
/* style inject SSR */
|
|
8129
8112
|
|
|
8130
8113
|
/* style inject shadow dom */
|
|
8131
8114
|
|
|
8132
|
-
const __vue_component__$
|
|
8133
|
-
render: __vue_render__$
|
|
8134
|
-
staticRenderFns: __vue_staticRenderFns__$
|
|
8135
|
-
}, __vue_inject_styles__$
|
|
8115
|
+
const __vue_component__$a = /*#__PURE__*/normalizeComponent({
|
|
8116
|
+
render: __vue_render__$9,
|
|
8117
|
+
staticRenderFns: __vue_staticRenderFns__$9
|
|
8118
|
+
}, __vue_inject_styles__$9, __vue_script__$9, __vue_scope_id__$9, __vue_is_functional_template__$9, __vue_module_identifier__$9, false, undefined, undefined, undefined);
|
|
8136
8119
|
|
|
8137
|
-
var EmojisTextFooter = __vue_component__$
|
|
8120
|
+
var EmojisTextFooter = __vue_component__$a;
|
|
8138
8121
|
|
|
8139
8122
|
//
|
|
8140
8123
|
//
|
|
@@ -8142,7 +8125,7 @@ var EmojisTextFooter = __vue_component__$5;
|
|
|
8142
8125
|
//
|
|
8143
8126
|
//
|
|
8144
8127
|
//
|
|
8145
|
-
var script$
|
|
8128
|
+
var script$8 = {
|
|
8146
8129
|
props: {
|
|
8147
8130
|
hasBg: {
|
|
8148
8131
|
type: Boolean,
|
|
@@ -8160,11 +8143,64 @@ var script$3 = {
|
|
|
8160
8143
|
}
|
|
8161
8144
|
};
|
|
8162
8145
|
|
|
8146
|
+
const isOldIE = typeof navigator !== 'undefined' &&
|
|
8147
|
+
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
|
|
8148
|
+
function createInjector(context) {
|
|
8149
|
+
return (id, style) => addStyle(id, style);
|
|
8150
|
+
}
|
|
8151
|
+
let HEAD;
|
|
8152
|
+
const styles = {};
|
|
8153
|
+
function addStyle(id, css) {
|
|
8154
|
+
const group = isOldIE ? css.media || 'default' : id;
|
|
8155
|
+
const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
|
|
8156
|
+
if (!style.ids.has(id)) {
|
|
8157
|
+
style.ids.add(id);
|
|
8158
|
+
let code = css.source;
|
|
8159
|
+
if (css.map) {
|
|
8160
|
+
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
8161
|
+
// this makes source maps inside style tags work properly in Chrome
|
|
8162
|
+
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
8163
|
+
// http://stackoverflow.com/a/26603875
|
|
8164
|
+
code +=
|
|
8165
|
+
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
8166
|
+
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
|
|
8167
|
+
' */';
|
|
8168
|
+
}
|
|
8169
|
+
if (!style.element) {
|
|
8170
|
+
style.element = document.createElement('style');
|
|
8171
|
+
style.element.type = 'text/css';
|
|
8172
|
+
if (css.media)
|
|
8173
|
+
style.element.setAttribute('media', css.media);
|
|
8174
|
+
if (HEAD === undefined) {
|
|
8175
|
+
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
8176
|
+
}
|
|
8177
|
+
HEAD.appendChild(style.element);
|
|
8178
|
+
}
|
|
8179
|
+
if ('styleSheet' in style.element) {
|
|
8180
|
+
style.styles.push(code);
|
|
8181
|
+
style.element.styleSheet.cssText = style.styles
|
|
8182
|
+
.filter(Boolean)
|
|
8183
|
+
.join('\n');
|
|
8184
|
+
}
|
|
8185
|
+
else {
|
|
8186
|
+
const index = style.ids.size - 1;
|
|
8187
|
+
const textNode = document.createTextNode(code);
|
|
8188
|
+
const nodes = style.element.childNodes;
|
|
8189
|
+
if (nodes[index])
|
|
8190
|
+
style.element.removeChild(nodes[index]);
|
|
8191
|
+
if (nodes.length)
|
|
8192
|
+
style.element.insertBefore(textNode, nodes[index]);
|
|
8193
|
+
else
|
|
8194
|
+
style.element.appendChild(textNode);
|
|
8195
|
+
}
|
|
8196
|
+
}
|
|
8197
|
+
}
|
|
8198
|
+
|
|
8163
8199
|
/* script */
|
|
8164
|
-
const __vue_script__$
|
|
8200
|
+
const __vue_script__$8 = script$8;
|
|
8165
8201
|
/* template */
|
|
8166
8202
|
|
|
8167
|
-
var __vue_render__$
|
|
8203
|
+
var __vue_render__$8 = function () {
|
|
8168
8204
|
var _vm = this;
|
|
8169
8205
|
|
|
8170
8206
|
var _h = _vm.$createElement;
|
|
@@ -8185,174 +8221,1095 @@ var __vue_render__$3 = function () {
|
|
|
8185
8221
|
})]);
|
|
8186
8222
|
};
|
|
8187
8223
|
|
|
8188
|
-
var __vue_staticRenderFns__$
|
|
8224
|
+
var __vue_staticRenderFns__$8 = [];
|
|
8189
8225
|
/* style */
|
|
8190
8226
|
|
|
8191
|
-
const __vue_inject_styles__$
|
|
8227
|
+
const __vue_inject_styles__$8 = function (inject) {
|
|
8228
|
+
if (!inject) return;
|
|
8229
|
+
inject("data-v-8ff43434_0", {
|
|
8230
|
+
source: ".req-loader-container{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.req-loader-container.light-bg{background-color:rgba(0,0,0,.3);border-radius:inherit}.req-loader-container.align-right{justify-content:flex-end}.req-loader-container.align-right .req-loader{margin-right:15px}.req-loader{border:2px solid #ccc;border-top:2px solid #333;border-radius:50%;width:20px;height:20px;min-width:20px;min-height:20px;animation:spin 2s linear infinite}.req-loader.big{width:40px;height:40px;animation:spin 3s linear infinite}.req-loader.slow{animation:spin 4s linear infinite}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}",
|
|
8231
|
+
map: undefined,
|
|
8232
|
+
media: undefined
|
|
8233
|
+
});
|
|
8234
|
+
};
|
|
8192
8235
|
/* scoped */
|
|
8193
8236
|
|
|
8194
|
-
|
|
8237
|
+
|
|
8238
|
+
const __vue_scope_id__$8 = undefined;
|
|
8195
8239
|
/* module identifier */
|
|
8196
8240
|
|
|
8197
|
-
const __vue_module_identifier__$
|
|
8241
|
+
const __vue_module_identifier__$8 = undefined;
|
|
8198
8242
|
/* functional template */
|
|
8199
8243
|
|
|
8200
|
-
const __vue_is_functional_template__$
|
|
8201
|
-
/* style inject */
|
|
8202
|
-
|
|
8244
|
+
const __vue_is_functional_template__$8 = false;
|
|
8203
8245
|
/* style inject SSR */
|
|
8204
8246
|
|
|
8205
8247
|
/* style inject shadow dom */
|
|
8206
8248
|
|
|
8207
|
-
const __vue_component__$
|
|
8208
|
-
render: __vue_render__$
|
|
8209
|
-
staticRenderFns: __vue_staticRenderFns__$
|
|
8210
|
-
}, __vue_inject_styles__$
|
|
8249
|
+
const __vue_component__$9 = /*#__PURE__*/normalizeComponent({
|
|
8250
|
+
render: __vue_render__$8,
|
|
8251
|
+
staticRenderFns: __vue_staticRenderFns__$8
|
|
8252
|
+
}, __vue_inject_styles__$8, __vue_script__$8, __vue_scope_id__$8, __vue_is_functional_template__$8, __vue_module_identifier__$8, false, createInjector, undefined, undefined);
|
|
8211
8253
|
|
|
8212
|
-
var
|
|
8254
|
+
var Loader = __vue_component__$9;
|
|
8213
8255
|
|
|
8214
8256
|
//
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8257
|
+
//
|
|
8258
|
+
//
|
|
8259
|
+
//
|
|
8260
|
+
//
|
|
8261
|
+
//
|
|
8262
|
+
//
|
|
8263
|
+
//
|
|
8264
|
+
var script$7 = {
|
|
8221
8265
|
props: {
|
|
8222
|
-
|
|
8223
|
-
type: Object,
|
|
8224
|
-
default: () => {
|
|
8225
|
-
return {
|
|
8226
|
-
hasEmojis: false,
|
|
8227
|
-
hasSendButton: false,
|
|
8228
|
-
hasFiles: false,
|
|
8229
|
-
hasAudio: false
|
|
8230
|
-
};
|
|
8231
|
-
},
|
|
8232
|
-
required: false
|
|
8233
|
-
},
|
|
8234
|
-
cssStyle: {
|
|
8235
|
-
type: Object,
|
|
8236
|
-
default: () => {
|
|
8237
|
-
return {
|
|
8238
|
-
width: "full",
|
|
8239
|
-
backgroundColor: "#FFF",
|
|
8240
|
-
outsideButtons: false
|
|
8241
|
-
};
|
|
8242
|
-
},
|
|
8243
|
-
required: false
|
|
8244
|
-
},
|
|
8245
|
-
textareaSettings: {
|
|
8246
|
-
type: Object,
|
|
8247
|
-
default: () => {
|
|
8248
|
-
return {
|
|
8249
|
-
placeholderMessage: "",
|
|
8250
|
-
maxCharacters: 0,
|
|
8251
|
-
sendOnEnter: false,
|
|
8252
|
-
disabled: false
|
|
8253
|
-
};
|
|
8254
|
-
},
|
|
8255
|
-
required: false
|
|
8256
|
-
},
|
|
8257
|
-
emojiSettings: {
|
|
8258
|
-
type: Object,
|
|
8259
|
-
default: () => {
|
|
8260
|
-
return {
|
|
8261
|
-
openEmojisFrom: "top",
|
|
8262
|
-
smallEmojis: false
|
|
8263
|
-
};
|
|
8264
|
-
},
|
|
8265
|
-
required: false
|
|
8266
|
-
},
|
|
8267
|
-
formattedMessageSettings: {
|
|
8268
|
-
type: Object,
|
|
8269
|
-
default: () => {
|
|
8270
|
-
return {
|
|
8271
|
-
hasHsm: false,
|
|
8272
|
-
msgType: 0
|
|
8273
|
-
};
|
|
8274
|
-
},
|
|
8275
|
-
required: false
|
|
8276
|
-
},
|
|
8277
|
-
fileSettings: {
|
|
8278
|
-
type: Object,
|
|
8279
|
-
default: () => {
|
|
8280
|
-
return {
|
|
8281
|
-
docsExtensions: "",
|
|
8282
|
-
imagesExtensions: ""
|
|
8283
|
-
};
|
|
8284
|
-
},
|
|
8285
|
-
required: false
|
|
8286
|
-
},
|
|
8287
|
-
textId: {
|
|
8266
|
+
message: {
|
|
8288
8267
|
type: String,
|
|
8289
8268
|
required: true
|
|
8290
8269
|
},
|
|
8291
|
-
|
|
8292
|
-
type:
|
|
8293
|
-
default: false,
|
|
8294
|
-
required: false
|
|
8295
|
-
},
|
|
8296
|
-
isSending: {
|
|
8297
|
-
type: Boolean,
|
|
8298
|
-
default: false,
|
|
8270
|
+
maxCharacters: {
|
|
8271
|
+
type: Number,
|
|
8299
8272
|
required: false
|
|
8300
|
-
},
|
|
8301
|
-
dictionary: {
|
|
8302
|
-
type: Object,
|
|
8303
|
-
required: true
|
|
8304
8273
|
}
|
|
8305
8274
|
},
|
|
8306
8275
|
computed: {
|
|
8307
8276
|
remainingCharacters() {
|
|
8308
|
-
if (this.message
|
|
8309
|
-
|
|
8310
|
-
|
|
8277
|
+
if (this.message.length) return this.maxCharacters - this.message.length;
|
|
8278
|
+
return this.maxCharacters;
|
|
8279
|
+
}
|
|
8280
|
+
|
|
8281
|
+
}
|
|
8282
|
+
};
|
|
8283
|
+
|
|
8284
|
+
/* script */
|
|
8285
|
+
const __vue_script__$7 = script$7;
|
|
8286
|
+
/* template */
|
|
8311
8287
|
|
|
8312
|
-
|
|
8288
|
+
var __vue_render__$7 = function () {
|
|
8289
|
+
var _vm = this;
|
|
8290
|
+
|
|
8291
|
+
var _h = _vm.$createElement;
|
|
8292
|
+
|
|
8293
|
+
var _c = _vm._self._c || _h;
|
|
8294
|
+
|
|
8295
|
+
return _vm.maxCharacters ? _c('span', {
|
|
8296
|
+
staticClass: "max-characters no-width",
|
|
8297
|
+
domProps: {
|
|
8298
|
+
"textContent": _vm._s("(" + this.remainingCharacters + ")")
|
|
8313
8299
|
}
|
|
8300
|
+
}) : _vm._e();
|
|
8301
|
+
};
|
|
8302
|
+
|
|
8303
|
+
var __vue_staticRenderFns__$7 = [];
|
|
8304
|
+
/* style */
|
|
8305
|
+
|
|
8306
|
+
const __vue_inject_styles__$7 = undefined;
|
|
8307
|
+
/* scoped */
|
|
8308
|
+
|
|
8309
|
+
const __vue_scope_id__$7 = undefined;
|
|
8310
|
+
/* module identifier */
|
|
8314
8311
|
|
|
8312
|
+
const __vue_module_identifier__$7 = undefined;
|
|
8313
|
+
/* functional template */
|
|
8314
|
+
|
|
8315
|
+
const __vue_is_functional_template__$7 = false;
|
|
8316
|
+
/* style inject */
|
|
8317
|
+
|
|
8318
|
+
/* style inject SSR */
|
|
8319
|
+
|
|
8320
|
+
/* style inject shadow dom */
|
|
8321
|
+
|
|
8322
|
+
const __vue_component__$8 = /*#__PURE__*/normalizeComponent({
|
|
8323
|
+
render: __vue_render__$7,
|
|
8324
|
+
staticRenderFns: __vue_staticRenderFns__$7
|
|
8325
|
+
}, __vue_inject_styles__$7, __vue_script__$7, __vue_scope_id__$7, __vue_is_functional_template__$7, __vue_module_identifier__$7, false, undefined, undefined, undefined);
|
|
8326
|
+
|
|
8327
|
+
var RemainingCharacters = __vue_component__$8;
|
|
8328
|
+
|
|
8329
|
+
//
|
|
8330
|
+
//
|
|
8331
|
+
//
|
|
8332
|
+
//
|
|
8333
|
+
//
|
|
8334
|
+
//
|
|
8335
|
+
var script$6 = {
|
|
8336
|
+
props: {
|
|
8337
|
+
dictionary: {
|
|
8338
|
+
type: Object,
|
|
8339
|
+
required: true
|
|
8340
|
+
}
|
|
8315
8341
|
},
|
|
8316
8342
|
|
|
8317
8343
|
data() {
|
|
8318
8344
|
return {
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
file: [],
|
|
8322
|
-
showFilePreview: false,
|
|
8323
|
-
imagePreview: "",
|
|
8324
|
-
isDoc: false,
|
|
8325
|
-
fileFormatError: false,
|
|
8326
|
-
validFileFormats: "",
|
|
8327
|
-
audioFile: "",
|
|
8328
|
-
audioSource: "",
|
|
8329
|
-
mediaRecorder: {},
|
|
8330
|
-
isRecording: false
|
|
8345
|
+
isRecording: false,
|
|
8346
|
+
mediaRecorder: {}
|
|
8331
8347
|
};
|
|
8332
8348
|
},
|
|
8333
8349
|
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8350
|
+
methods: {
|
|
8351
|
+
toggleAudioRecorder() {
|
|
8352
|
+
if (!this.mediaRecorder.state) return this.initAudioRecorder();
|
|
8353
|
+
this.isRecording = !this.isRecording;
|
|
8354
|
+
if (this.isRecording) return this.mediaRecorder.start();
|
|
8355
|
+
return this.mediaRecorder.stop();
|
|
8356
|
+
},
|
|
8357
|
+
|
|
8358
|
+
initAudioRecorder() {
|
|
8359
|
+
navigator.mediaDevices.getUserMedia({
|
|
8360
|
+
audio: true
|
|
8361
|
+
}).then(stream => {
|
|
8362
|
+
this.mediaRecorder = new MediaRecorder(stream);
|
|
8363
|
+
const audioChunks = [];
|
|
8364
|
+
|
|
8365
|
+
this.mediaRecorder.ondataavailable = eventData => {
|
|
8366
|
+
audioChunks.push(eventData.data);
|
|
8367
|
+
};
|
|
8368
|
+
|
|
8369
|
+
this.mediaRecorder.onstop = () => {
|
|
8370
|
+
const blob = new Blob(audioChunks, {
|
|
8371
|
+
type: "audio/mpeg"
|
|
8372
|
+
});
|
|
8373
|
+
blob.lastModifiedDate = new Date();
|
|
8374
|
+
blob.name = `im-audio-file-${parseInt(Math.random() * 50000)}`;
|
|
8375
|
+
const reader = new FileReader();
|
|
8376
|
+
reader.readAsDataURL(blob);
|
|
8377
|
+
|
|
8378
|
+
reader.onloadend = () => {
|
|
8379
|
+
this.$emit("set-audio", {
|
|
8380
|
+
audioFile: new File([blob], `${blob.name}.mpeg`, {
|
|
8381
|
+
type: blob.type
|
|
8382
|
+
}),
|
|
8383
|
+
audioSource: reader.result
|
|
8384
|
+
});
|
|
8385
|
+
};
|
|
8386
|
+
|
|
8387
|
+
stream.getTracks().forEach(track => track.stop());
|
|
8388
|
+
};
|
|
8389
|
+
|
|
8390
|
+
this.toggleAudioRecorder();
|
|
8391
|
+
}, error => {
|
|
8392
|
+
this.$toasted.global.defaultError({
|
|
8393
|
+
msg: this.dictionary.msg_permitir_audio
|
|
8394
|
+
});
|
|
8395
|
+
console.error("error audio recorder: ", error);
|
|
8396
|
+
});
|
|
8397
|
+
},
|
|
8398
|
+
|
|
8399
|
+
deleteMediaRecorder() {
|
|
8400
|
+
this.mediaRecorder = {};
|
|
8401
|
+
}
|
|
8402
|
+
|
|
8403
|
+
}
|
|
8404
|
+
};
|
|
8405
|
+
|
|
8406
|
+
/* script */
|
|
8407
|
+
const __vue_script__$6 = script$6;
|
|
8408
|
+
/* template */
|
|
8409
|
+
|
|
8410
|
+
var __vue_render__$6 = function () {
|
|
8411
|
+
var _vm = this;
|
|
8412
|
+
|
|
8413
|
+
var _h = _vm.$createElement;
|
|
8414
|
+
|
|
8415
|
+
var _c = _vm._self._c || _h;
|
|
8416
|
+
|
|
8417
|
+
return _c('span', {
|
|
8418
|
+
staticClass: "text-footer-actions--btn",
|
|
8419
|
+
class: {
|
|
8420
|
+
'audio-activated': _vm.isRecording
|
|
8421
|
+
},
|
|
8422
|
+
on: {
|
|
8423
|
+
"click": _vm.toggleAudioRecorder
|
|
8424
|
+
}
|
|
8425
|
+
}, [_c('fa-icon', {
|
|
8426
|
+
attrs: {
|
|
8427
|
+
"icon": ['fas', 'microphone']
|
|
8428
|
+
}
|
|
8429
|
+
})], 1);
|
|
8430
|
+
};
|
|
8431
|
+
|
|
8432
|
+
var __vue_staticRenderFns__$6 = [];
|
|
8433
|
+
/* style */
|
|
8434
|
+
|
|
8435
|
+
const __vue_inject_styles__$6 = undefined;
|
|
8436
|
+
/* scoped */
|
|
8437
|
+
|
|
8438
|
+
const __vue_scope_id__$6 = undefined;
|
|
8439
|
+
/* module identifier */
|
|
8440
|
+
|
|
8441
|
+
const __vue_module_identifier__$6 = undefined;
|
|
8442
|
+
/* functional template */
|
|
8443
|
+
|
|
8444
|
+
const __vue_is_functional_template__$6 = false;
|
|
8445
|
+
/* style inject */
|
|
8446
|
+
|
|
8447
|
+
/* style inject SSR */
|
|
8448
|
+
|
|
8449
|
+
/* style inject shadow dom */
|
|
8450
|
+
|
|
8451
|
+
const __vue_component__$7 = /*#__PURE__*/normalizeComponent({
|
|
8452
|
+
render: __vue_render__$6,
|
|
8453
|
+
staticRenderFns: __vue_staticRenderFns__$6
|
|
8454
|
+
}, __vue_inject_styles__$6, __vue_script__$6, __vue_scope_id__$6, __vue_is_functional_template__$6, __vue_module_identifier__$6, false, undefined, undefined, undefined);
|
|
8455
|
+
|
|
8456
|
+
var BtnMic = __vue_component__$7;
|
|
8457
|
+
|
|
8458
|
+
//
|
|
8459
|
+
//
|
|
8460
|
+
//
|
|
8461
|
+
//
|
|
8462
|
+
//
|
|
8463
|
+
//
|
|
8464
|
+
//
|
|
8465
|
+
//
|
|
8466
|
+
//
|
|
8467
|
+
//
|
|
8468
|
+
//
|
|
8469
|
+
//
|
|
8470
|
+
//
|
|
8471
|
+
//
|
|
8472
|
+
//
|
|
8473
|
+
//
|
|
8474
|
+
//
|
|
8475
|
+
//
|
|
8476
|
+
//
|
|
8477
|
+
//
|
|
8478
|
+
//
|
|
8479
|
+
//
|
|
8480
|
+
var script$5 = {
|
|
8481
|
+
props: {
|
|
8482
|
+
dictionary: {
|
|
8483
|
+
type: Object,
|
|
8484
|
+
required: true
|
|
8485
|
+
},
|
|
8486
|
+
file: {
|
|
8487
|
+
type: File,
|
|
8488
|
+
required: true
|
|
8489
|
+
},
|
|
8490
|
+
isDoc: {
|
|
8491
|
+
type: Boolean,
|
|
8492
|
+
required: false
|
|
8493
|
+
},
|
|
8494
|
+
fileFormatError: {
|
|
8495
|
+
type: Boolean,
|
|
8496
|
+
required: false
|
|
8497
|
+
},
|
|
8498
|
+
validFileFormats: {
|
|
8499
|
+
type: String,
|
|
8500
|
+
required: false,
|
|
8501
|
+
default: ""
|
|
8502
|
+
},
|
|
8503
|
+
imagePreview: {
|
|
8504
|
+
type: String,
|
|
8505
|
+
required: false
|
|
8506
|
+
}
|
|
8507
|
+
},
|
|
8508
|
+
methods: {
|
|
8509
|
+
deleteFile() {
|
|
8510
|
+
this.$emit("delete-file");
|
|
8511
|
+
},
|
|
8512
|
+
|
|
8513
|
+
openImage() {
|
|
8514
|
+
this.$emit("open-image");
|
|
8515
|
+
}
|
|
8516
|
+
|
|
8517
|
+
}
|
|
8518
|
+
};
|
|
8519
|
+
|
|
8520
|
+
/* script */
|
|
8521
|
+
const __vue_script__$5 = script$5;
|
|
8522
|
+
/* template */
|
|
8523
|
+
|
|
8524
|
+
var __vue_render__$5 = function () {
|
|
8525
|
+
var _vm = this;
|
|
8526
|
+
|
|
8527
|
+
var _h = _vm.$createElement;
|
|
8528
|
+
|
|
8529
|
+
var _c = _vm._self._c || _h;
|
|
8530
|
+
|
|
8531
|
+
return _c('div', {
|
|
8532
|
+
staticClass: "single-file-preview"
|
|
8533
|
+
}, [_c('span', {
|
|
8534
|
+
staticClass: "text-footer-exclude-file",
|
|
8535
|
+
attrs: {
|
|
8536
|
+
"title": _vm.dictionary.msg_cancelar_anexo
|
|
8537
|
+
},
|
|
8538
|
+
on: {
|
|
8539
|
+
"click": _vm.deleteFile
|
|
8540
|
+
}
|
|
8541
|
+
}, [_c('fa-icon', {
|
|
8542
|
+
attrs: {
|
|
8543
|
+
"icon": ['fas', 'times-circle']
|
|
8544
|
+
}
|
|
8545
|
+
})], 1), _vm._v(" "), _vm.fileFormatError ? _c('div', {
|
|
8546
|
+
staticClass: "text-footer-invalid-format"
|
|
8547
|
+
}, [_c('h3', {
|
|
8548
|
+
domProps: {
|
|
8549
|
+
"textContent": _vm._s(_vm.dictionary.titulo_msg_formato_invalido)
|
|
8550
|
+
}
|
|
8551
|
+
}), _vm._v(" "), _c('h4', {
|
|
8552
|
+
domProps: {
|
|
8553
|
+
"textContent": _vm._s(_vm.validFileFormats)
|
|
8554
|
+
}
|
|
8555
|
+
})]) : [_vm.file.name ? _c('h3', {
|
|
8556
|
+
staticClass: "text-footer-preview-title"
|
|
8557
|
+
}, [_vm.isDoc ? _c('fa-icon', {
|
|
8558
|
+
attrs: {
|
|
8559
|
+
"icon": ['fas', 'file-alt']
|
|
8560
|
+
}
|
|
8561
|
+
}) : _c('fa-icon', {
|
|
8562
|
+
attrs: {
|
|
8563
|
+
"icon": ['fas', 'image']
|
|
8564
|
+
}
|
|
8565
|
+
}), _vm._v("\n " + _vm._s(_vm.file.name) + "\n ")], 1) : _vm._e(), _vm._v(" "), _vm.imagePreview ? _c('div', {
|
|
8566
|
+
staticClass: "text-footer-image-preview"
|
|
8567
|
+
}, [_c('img', {
|
|
8568
|
+
attrs: {
|
|
8569
|
+
"src": _vm.imagePreview,
|
|
8570
|
+
"alt": _vm.dictionary.alt_previa_img
|
|
8571
|
+
},
|
|
8572
|
+
on: {
|
|
8573
|
+
"click": _vm.openImage
|
|
8574
|
+
}
|
|
8575
|
+
})]) : _vm._e()]], 2);
|
|
8576
|
+
};
|
|
8577
|
+
|
|
8578
|
+
var __vue_staticRenderFns__$5 = [];
|
|
8579
|
+
/* style */
|
|
8580
|
+
|
|
8581
|
+
const __vue_inject_styles__$5 = undefined;
|
|
8582
|
+
/* scoped */
|
|
8583
|
+
|
|
8584
|
+
const __vue_scope_id__$5 = undefined;
|
|
8585
|
+
/* module identifier */
|
|
8586
|
+
|
|
8587
|
+
const __vue_module_identifier__$5 = undefined;
|
|
8588
|
+
/* functional template */
|
|
8589
|
+
|
|
8590
|
+
const __vue_is_functional_template__$5 = false;
|
|
8591
|
+
/* style inject */
|
|
8592
|
+
|
|
8593
|
+
/* style inject SSR */
|
|
8594
|
+
|
|
8595
|
+
/* style inject shadow dom */
|
|
8596
|
+
|
|
8597
|
+
const __vue_component__$6 = /*#__PURE__*/normalizeComponent({
|
|
8598
|
+
render: __vue_render__$5,
|
|
8599
|
+
staticRenderFns: __vue_staticRenderFns__$5
|
|
8600
|
+
}, __vue_inject_styles__$5, __vue_script__$5, __vue_scope_id__$5, __vue_is_functional_template__$5, __vue_module_identifier__$5, false, undefined, undefined, undefined);
|
|
8601
|
+
|
|
8602
|
+
var SingleFilePreview = __vue_component__$6;
|
|
8603
|
+
|
|
8604
|
+
//
|
|
8605
|
+
var script$4 = {
|
|
8606
|
+
components: {
|
|
8607
|
+
Loader
|
|
8608
|
+
},
|
|
8609
|
+
|
|
8610
|
+
data() {
|
|
8611
|
+
return {
|
|
8612
|
+
loading: true,
|
|
8613
|
+
loadingTimeout: 0,
|
|
8614
|
+
ignoreNextUpdate: false
|
|
8615
|
+
};
|
|
8616
|
+
},
|
|
8617
|
+
|
|
8618
|
+
mounted() {
|
|
8619
|
+
setTimeout(() => {
|
|
8620
|
+
this.loading = false;
|
|
8621
|
+
}, 500);
|
|
8622
|
+
},
|
|
8623
|
+
|
|
8624
|
+
watch: {
|
|
8625
|
+
file() {
|
|
8626
|
+
if (!this.ignoreNextUpdate) {
|
|
8627
|
+
if (this.loadingTimeout) clearTimeout(this.loadingTimeout);
|
|
8628
|
+
this.loading = true;
|
|
8629
|
+
this.loadingTimeout = setTimeout(() => {
|
|
8630
|
+
this.loading = false;
|
|
8631
|
+
}, 500);
|
|
8632
|
+
this.ignoreNextUpdate = true;
|
|
8633
|
+
}
|
|
8634
|
+
|
|
8635
|
+
this.ignoreNextUpdate = false;
|
|
8636
|
+
}
|
|
8637
|
+
|
|
8638
|
+
},
|
|
8639
|
+
props: {
|
|
8640
|
+
dictionary: {
|
|
8641
|
+
type: Object,
|
|
8642
|
+
required: true
|
|
8643
|
+
},
|
|
8644
|
+
file: {
|
|
8645
|
+
type: Array,
|
|
8646
|
+
required: true
|
|
8647
|
+
},
|
|
8648
|
+
fileFormatError: {
|
|
8649
|
+
type: Boolean,
|
|
8650
|
+
required: false
|
|
8651
|
+
},
|
|
8652
|
+
validFileFormats: {
|
|
8653
|
+
type: String,
|
|
8654
|
+
required: false,
|
|
8655
|
+
default: ""
|
|
8656
|
+
}
|
|
8657
|
+
},
|
|
8658
|
+
methods: {
|
|
8659
|
+
deleteFile() {
|
|
8660
|
+
this.$emit("delete-file");
|
|
8661
|
+
},
|
|
8662
|
+
|
|
8663
|
+
deleteSpecificFile(fileName, index) {
|
|
8664
|
+
this.ignoreNextUpdate = true;
|
|
8665
|
+
this.$emit("delete-specific-file", {
|
|
8666
|
+
fileName,
|
|
8667
|
+
index
|
|
8668
|
+
});
|
|
8669
|
+
},
|
|
8670
|
+
|
|
8671
|
+
openImage(image) {
|
|
8672
|
+
this.$emit("open-image", image);
|
|
8673
|
+
},
|
|
8674
|
+
|
|
8675
|
+
icon(imgOrDoc) {
|
|
8676
|
+
if (!imgOrDoc) return ['fas', 'times-circle'];
|
|
8677
|
+
return imgOrDoc == 'doc' ? ['fas', 'file-alt'] : ['fas', 'image'];
|
|
8678
|
+
},
|
|
8679
|
+
|
|
8680
|
+
isPdf(type) {
|
|
8681
|
+
return type === "application/pdf" ? true : false;
|
|
8682
|
+
}
|
|
8683
|
+
|
|
8684
|
+
}
|
|
8685
|
+
};
|
|
8686
|
+
|
|
8687
|
+
/* script */
|
|
8688
|
+
const __vue_script__$4 = script$4;
|
|
8689
|
+
/* template */
|
|
8690
|
+
|
|
8691
|
+
var __vue_render__$4 = function () {
|
|
8692
|
+
var _vm = this;
|
|
8693
|
+
|
|
8694
|
+
var _h = _vm.$createElement;
|
|
8695
|
+
|
|
8696
|
+
var _c = _vm._self._c || _h;
|
|
8697
|
+
|
|
8698
|
+
return _c('div', {
|
|
8699
|
+
staticClass: "multiple-file-preview"
|
|
8700
|
+
}, [_c('transition-group', {
|
|
8701
|
+
attrs: {
|
|
8702
|
+
"name": "fade"
|
|
8703
|
+
}
|
|
8704
|
+
}, [_vm.loading ? _c('Loader', {
|
|
8705
|
+
key: "mfp-loader"
|
|
8706
|
+
}) : _vm.fileFormatError ? [_c('span', {
|
|
8707
|
+
key: "mfp-exlude-file",
|
|
8708
|
+
staticClass: "text-footer-exclude-file",
|
|
8709
|
+
attrs: {
|
|
8710
|
+
"title": _vm.dictionary.msg_cancelar_anexo
|
|
8711
|
+
},
|
|
8712
|
+
on: {
|
|
8713
|
+
"click": _vm.deleteFile
|
|
8714
|
+
}
|
|
8715
|
+
}, [_c('fa-icon', {
|
|
8716
|
+
attrs: {
|
|
8717
|
+
"icon": ['fas', 'times-circle']
|
|
8718
|
+
}
|
|
8719
|
+
})], 1), _vm._v(" "), _vm.fileFormatError ? _c('div', {
|
|
8720
|
+
key: "mfp-invalid-format",
|
|
8721
|
+
staticClass: "text-footer-invalid-format"
|
|
8722
|
+
}, [_c('h3', {
|
|
8723
|
+
domProps: {
|
|
8724
|
+
"textContent": _vm._s(_vm.dictionary.titulo_msg_formato_invalido)
|
|
8725
|
+
}
|
|
8726
|
+
}), _vm._v(" "), _c('h4', {
|
|
8727
|
+
domProps: {
|
|
8728
|
+
"textContent": _vm._s(_vm.validFileFormats)
|
|
8729
|
+
}
|
|
8730
|
+
})]) : _vm._e()] : _vm._l(_vm.file, function (singleFile, index) {
|
|
8731
|
+
return _c('div', {
|
|
8732
|
+
key: index,
|
|
8733
|
+
staticClass: "file-preview"
|
|
8734
|
+
}, [_c('p', {
|
|
8735
|
+
staticClass: "file-title"
|
|
8736
|
+
}, [_c('fa-icon', {
|
|
8737
|
+
attrs: {
|
|
8738
|
+
"icon": _vm.icon(singleFile.imgOrDoc)
|
|
8739
|
+
}
|
|
8740
|
+
}), _vm._v("\n " + _vm._s(singleFile.name) + "\n ")], 1), _vm._v(" "), singleFile.invalid ? _c('p', {
|
|
8741
|
+
staticClass: "file-title red"
|
|
8742
|
+
}, [_vm._v("\n " + _vm._s(_vm.dictionary.titulo_msg_formato_invalido ? _vm.dictionary.titulo_msg_formato_invalido : "Arquivo invalido") + "\n ")]) : _vm._e(), _vm._v(" "), _c('div', {
|
|
8743
|
+
staticClass: "small-img"
|
|
8744
|
+
}, [singleFile.imgOrDoc === 'img' ? _c('span', {
|
|
8745
|
+
staticClass: "img-container"
|
|
8746
|
+
}, [_c('img', {
|
|
8747
|
+
attrs: {
|
|
8748
|
+
"src": singleFile.src,
|
|
8749
|
+
"alt": _vm.dictionary.alt_previa_img
|
|
8750
|
+
},
|
|
8751
|
+
on: {
|
|
8752
|
+
"click": function ($event) {
|
|
8753
|
+
return _vm.openImage(singleFile.src);
|
|
8754
|
+
}
|
|
8755
|
+
}
|
|
8756
|
+
})]) : _vm.isPdf(singleFile.type) ? _c('span', {
|
|
8757
|
+
staticClass: "pdf"
|
|
8758
|
+
}, [_c('fa-icon', {
|
|
8759
|
+
attrs: {
|
|
8760
|
+
"icon": ['fas', 'file-pdf']
|
|
8761
|
+
}
|
|
8762
|
+
})], 1) : _vm._e()]), _vm._v(" "), _c('span', {
|
|
8763
|
+
staticClass: "delete-file",
|
|
8764
|
+
on: {
|
|
8765
|
+
"click": function ($event) {
|
|
8766
|
+
return _vm.deleteSpecificFile(singleFile.name, index);
|
|
8767
|
+
}
|
|
8768
|
+
}
|
|
8769
|
+
}, [_c('fa-icon', {
|
|
8770
|
+
attrs: {
|
|
8771
|
+
"icon": ['fas', 'times-circle']
|
|
8772
|
+
}
|
|
8773
|
+
})], 1)]);
|
|
8774
|
+
})], 2)], 1);
|
|
8775
|
+
};
|
|
8776
|
+
|
|
8777
|
+
var __vue_staticRenderFns__$4 = [];
|
|
8778
|
+
/* style */
|
|
8779
|
+
|
|
8780
|
+
const __vue_inject_styles__$4 = function (inject) {
|
|
8781
|
+
if (!inject) return;
|
|
8782
|
+
inject("data-v-53d19bab_0", {
|
|
8783
|
+
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}",
|
|
8784
|
+
map: undefined,
|
|
8785
|
+
media: undefined
|
|
8786
|
+
});
|
|
8787
|
+
};
|
|
8788
|
+
/* scoped */
|
|
8789
|
+
|
|
8790
|
+
|
|
8791
|
+
const __vue_scope_id__$4 = undefined;
|
|
8792
|
+
/* module identifier */
|
|
8793
|
+
|
|
8794
|
+
const __vue_module_identifier__$4 = undefined;
|
|
8795
|
+
/* functional template */
|
|
8796
|
+
|
|
8797
|
+
const __vue_is_functional_template__$4 = false;
|
|
8798
|
+
/* style inject SSR */
|
|
8799
|
+
|
|
8800
|
+
/* style inject shadow dom */
|
|
8801
|
+
|
|
8802
|
+
const __vue_component__$5 = /*#__PURE__*/normalizeComponent({
|
|
8803
|
+
render: __vue_render__$4,
|
|
8804
|
+
staticRenderFns: __vue_staticRenderFns__$4
|
|
8805
|
+
}, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, false, createInjector, undefined, undefined);
|
|
8806
|
+
|
|
8807
|
+
var MultipleFilePreview = __vue_component__$5;
|
|
8808
|
+
|
|
8809
|
+
//
|
|
8810
|
+
var script$3 = {
|
|
8811
|
+
components: {
|
|
8812
|
+
SingleFilePreview,
|
|
8813
|
+
MultipleFilePreview
|
|
8814
|
+
},
|
|
8815
|
+
props: {
|
|
8816
|
+
textId: {
|
|
8817
|
+
type: String,
|
|
8818
|
+
required: true
|
|
8819
|
+
},
|
|
8820
|
+
dictionary: {
|
|
8821
|
+
type: Object,
|
|
8822
|
+
required: true
|
|
8823
|
+
},
|
|
8824
|
+
fileSettings: {
|
|
8825
|
+
type: Object,
|
|
8826
|
+
required: false
|
|
8827
|
+
},
|
|
8828
|
+
cssStyle: {
|
|
8829
|
+
type: Object,
|
|
8830
|
+
required: false
|
|
8831
|
+
}
|
|
8832
|
+
},
|
|
8833
|
+
|
|
8834
|
+
data() {
|
|
8835
|
+
return {
|
|
8836
|
+
file: [],
|
|
8837
|
+
openFiles: false,
|
|
8838
|
+
showFilePreview: false,
|
|
8839
|
+
imagePreview: "",
|
|
8840
|
+
isDoc: false,
|
|
8841
|
+
fileFormatError: false,
|
|
8842
|
+
validFileFormats: ""
|
|
8843
|
+
};
|
|
8844
|
+
},
|
|
8845
|
+
|
|
8846
|
+
computed: {
|
|
8847
|
+
previewContainerClass() {
|
|
8848
|
+
if (this.fileFormatError) return "isError";
|
|
8849
|
+
if (this.fileSettings.multiple) return "isMultiple";
|
|
8850
|
+
if (this.isDoc) return "isDoc";
|
|
8851
|
+
return "isMsg";
|
|
8852
|
+
}
|
|
8853
|
+
|
|
8854
|
+
},
|
|
8855
|
+
methods: {
|
|
8856
|
+
toggleFiles() {
|
|
8857
|
+
this.openFiles = !this.openFiles;
|
|
8858
|
+
},
|
|
8859
|
+
|
|
8860
|
+
openSelectFileHandler(type) {
|
|
8861
|
+
const fileInput = document.querySelector(`#${type}-${this.textId}`);
|
|
8862
|
+
if (fileInput) fileInput.click();
|
|
8863
|
+
if (!fileInput) if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError();
|
|
8864
|
+
},
|
|
8865
|
+
|
|
8866
|
+
isFileValid(type, fileName) {
|
|
8867
|
+
const extensions = type === "img" ? this.fileSettings.imagesExtensions : this.fileSettings.docsExtensions;
|
|
8868
|
+
const regex = new RegExp("(" + extensions + ")", "i");
|
|
8869
|
+
if (regex.test(fileName)) return true;
|
|
8870
|
+
this.showToastedValidFormats();
|
|
8871
|
+
return false;
|
|
8872
|
+
},
|
|
8873
|
+
|
|
8874
|
+
showToastedValidFormats() {
|
|
8875
|
+
if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError({
|
|
8876
|
+
msg: this.dictionary.msg_formato_invalido
|
|
8877
|
+
});
|
|
8878
|
+
const str = {
|
|
8879
|
+
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
8880
|
+
doc: this.fileSettings.docsExtensions.split("|").join(", ")
|
|
8881
|
+
};
|
|
8882
|
+
if (!document.querySelector(".toasted.toasted-primary.info")) this.$toasted.global.showValidFormats({
|
|
8883
|
+
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`
|
|
8884
|
+
});
|
|
8885
|
+
},
|
|
8886
|
+
|
|
8887
|
+
fileUpload(event, type, externalCall) {
|
|
8888
|
+
try {
|
|
8889
|
+
this.openFiles = false;
|
|
8890
|
+
if (this.showFilePreview) this.deleteFile();
|
|
8891
|
+
this.file = !externalCall ? event.target.files ? event.target.files : event.dataTransfer.files : event;
|
|
8892
|
+
|
|
8893
|
+
if (!this.file.length) {
|
|
8894
|
+
this.file = [];
|
|
8895
|
+
return;
|
|
8896
|
+
}
|
|
8897
|
+
|
|
8898
|
+
this.showFilePreview = true;
|
|
8899
|
+
|
|
8900
|
+
if (!this.fileSettings.multiple) {
|
|
8901
|
+
this.file = this.file[0];
|
|
8902
|
+
this.singleFileUpload(type, this.file.name);
|
|
8903
|
+
} else {
|
|
8904
|
+
this.multipleFileUpload();
|
|
8905
|
+
}
|
|
8906
|
+
} catch (e) {
|
|
8907
|
+
console.error("Error file upload");
|
|
8908
|
+
console.error(e);
|
|
8909
|
+
}
|
|
8910
|
+
},
|
|
8911
|
+
|
|
8912
|
+
returnFileType(file) {
|
|
8913
|
+
const imgRegex = new RegExp("\.(" + this.fileSettings.imagesExtensions + ")", "i");
|
|
8914
|
+
if (imgRegex.test(file.name)) return "img";
|
|
8915
|
+
const docRegex = new RegExp("\.(" + this.fileSettings.docsExtensions + ")", "i");
|
|
8916
|
+
if (docRegex.test(file.name)) return "doc";
|
|
8917
|
+
return "";
|
|
8918
|
+
},
|
|
8919
|
+
|
|
8920
|
+
multipleFileUpload() {
|
|
8921
|
+
let waitForImageLoad = false;
|
|
8922
|
+
this.file = Array.from(this.file);
|
|
8923
|
+
this.file.forEach(file => {
|
|
8924
|
+
const fileReader = new FileReader();
|
|
8925
|
+
const singleFileType = this.returnFileType(file);
|
|
8926
|
+
if (!singleFileType) file.invalid = true;
|
|
8927
|
+
file.imgOrDoc = singleFileType ? singleFileType : "";
|
|
8928
|
+
if (file.imgOrDoc === "doc") this.isDoc = true;
|
|
8929
|
+
|
|
8930
|
+
if (file.imgOrDoc === "img") {
|
|
8931
|
+
waitForImageLoad = true;
|
|
8932
|
+
|
|
8933
|
+
fileReader.onload = () => file.src = fileReader.result;
|
|
8934
|
+
|
|
8935
|
+
fileReader.onloadend = () => this.emitFileVars(true);
|
|
8936
|
+
}
|
|
8937
|
+
|
|
8938
|
+
if (this.isFileValid(file.imgOrDoc, file.name)) {
|
|
8939
|
+
if (file.imgOrDoc === "img") fileReader.readAsDataURL(file);
|
|
8940
|
+
} else {
|
|
8941
|
+
file.invalid = true;
|
|
8942
|
+
this.fileFormatError = true;
|
|
8943
|
+
this.validFileFormats = `${file.imgOrDoc === "img" ? this.fileSettings.imagesExtensions.split("|").join(", ") : this.fileSettings.docsExtensions.split("|").join(", ")} ${this.dictionary.msg_extensoes_aceitas}`;
|
|
8944
|
+
}
|
|
8945
|
+
});
|
|
8946
|
+
if (this.isDoc && !waitForImageLoad) this.emitFileVars();
|
|
8947
|
+
},
|
|
8948
|
+
|
|
8949
|
+
singleFileUpload(type, fileName) {
|
|
8950
|
+
const fileReader = new FileReader();
|
|
8951
|
+
|
|
8952
|
+
if (type === "img") {
|
|
8953
|
+
fileReader.onload = () => this.imagePreview = fileReader.result;
|
|
8954
|
+
|
|
8955
|
+
fileReader.onloadend = () => this.emitFileVars();
|
|
8956
|
+
}
|
|
8957
|
+
|
|
8958
|
+
if (this.isFileValid(type, fileName)) {
|
|
8959
|
+
if (type === "img") fileReader.readAsDataURL(this.file);
|
|
8960
|
+
if (type === "doc") this.isDoc = true;
|
|
8961
|
+
this.fileFormatError = false;
|
|
8962
|
+
} else {
|
|
8963
|
+
this.fileFormatError = true;
|
|
8964
|
+
this.validFileFormats = `${type === "img" ? this.fileSettings.imagesExtensions.split("|").join(", ") : this.fileSettings.docsExtensions.split("|").join(", ")} ${this.dictionary.msg_extensoes_aceitas}`;
|
|
8965
|
+
}
|
|
8966
|
+
|
|
8967
|
+
if (this.isDoc) this.emitFileVars();
|
|
8968
|
+
},
|
|
8969
|
+
|
|
8970
|
+
emitFileVars() {
|
|
8971
|
+
const vars = {
|
|
8972
|
+
file: this.file,
|
|
8973
|
+
isDoc: this.isDoc,
|
|
8974
|
+
showFilePreview: this.showFilePreview,
|
|
8975
|
+
imagePreview: this.imagePreview,
|
|
8976
|
+
fileFormatError: this.fileFormatError
|
|
8977
|
+
};
|
|
8978
|
+
this.$emit("set-file-vars", vars);
|
|
8979
|
+
this.$parent.focusTextarea();
|
|
8980
|
+
},
|
|
8981
|
+
|
|
8982
|
+
deleteSpecificFile(obj) {
|
|
8983
|
+
const {
|
|
8984
|
+
fileName
|
|
8985
|
+
} = obj;
|
|
8986
|
+
this.file = this.file.filter(file => {
|
|
8987
|
+
return file.name != fileName;
|
|
8988
|
+
});
|
|
8989
|
+
this.file.length ? this.emitFileVars(true) : this.deleteFile();
|
|
8990
|
+
},
|
|
8991
|
+
|
|
8992
|
+
deleteFile() {
|
|
8993
|
+
this.$emit("set-file-vars", {
|
|
8994
|
+
file: [],
|
|
8995
|
+
isDoc: false,
|
|
8996
|
+
showFilePreview: false,
|
|
8997
|
+
imagePreview: "",
|
|
8998
|
+
fileFormatError: false
|
|
8999
|
+
});
|
|
9000
|
+
this.file = [];
|
|
9001
|
+
this.isDoc = false;
|
|
9002
|
+
this.showFilePreview = false;
|
|
9003
|
+
this.imagePreview = "";
|
|
9004
|
+
this.fileFormatError = false;
|
|
9005
|
+
this.validFileFormats = "";
|
|
9006
|
+
},
|
|
9007
|
+
|
|
9008
|
+
openImage(imagePreview) {
|
|
9009
|
+
this.$emit("open-image", !imagePreview ? this.imagePreview : imagePreview);
|
|
9010
|
+
}
|
|
9011
|
+
|
|
9012
|
+
}
|
|
9013
|
+
};
|
|
9014
|
+
|
|
9015
|
+
/* script */
|
|
9016
|
+
const __vue_script__$3 = script$3;
|
|
9017
|
+
/* template */
|
|
9018
|
+
|
|
9019
|
+
var __vue_render__$3 = function () {
|
|
9020
|
+
var _vm = this;
|
|
9021
|
+
|
|
9022
|
+
var _h = _vm.$createElement;
|
|
9023
|
+
|
|
9024
|
+
var _c = _vm._self._c || _h;
|
|
9025
|
+
|
|
9026
|
+
return _c('span', {
|
|
9027
|
+
staticClass: "text-footer-actions--btn",
|
|
9028
|
+
class: {
|
|
9029
|
+
'files-activated': _vm.openFiles
|
|
9030
|
+
},
|
|
9031
|
+
attrs: {
|
|
9032
|
+
"title": _vm.dictionary.title_selecionar_anexo
|
|
9033
|
+
},
|
|
9034
|
+
on: {
|
|
9035
|
+
"click": function ($event) {
|
|
9036
|
+
_vm.fileSettings.multiple ? _vm.openSelectFileHandler('both') : _vm.toggleFiles;
|
|
9037
|
+
}
|
|
9038
|
+
}
|
|
9039
|
+
}, [_c('fa-icon', {
|
|
9040
|
+
attrs: {
|
|
9041
|
+
"icon": ['fas', 'paperclip']
|
|
9042
|
+
}
|
|
9043
|
+
}), _vm._v(" "), _c('transition', {
|
|
9044
|
+
attrs: {
|
|
9045
|
+
"name": "show"
|
|
9046
|
+
}
|
|
9047
|
+
}, [_vm.openFiles ? _c('div', {
|
|
9048
|
+
staticClass: "text-footer-files-container",
|
|
9049
|
+
class: {
|
|
9050
|
+
'horizontal': _vm.cssStyle.outsideButtons
|
|
9051
|
+
}
|
|
9052
|
+
}, [_c('div', {
|
|
9053
|
+
staticClass: "files-btn images",
|
|
9054
|
+
class: {
|
|
9055
|
+
'margin-bottom': _vm.cssStyle.outsideButtons
|
|
9056
|
+
},
|
|
9057
|
+
attrs: {
|
|
9058
|
+
"title": _vm.dictionary.title_anexo_img
|
|
9059
|
+
},
|
|
9060
|
+
on: {
|
|
9061
|
+
"click": function ($event) {
|
|
9062
|
+
return _vm.openSelectFileHandler('img');
|
|
9063
|
+
}
|
|
9064
|
+
}
|
|
9065
|
+
}, [_c('fa-icon', {
|
|
9066
|
+
attrs: {
|
|
9067
|
+
"icon": ['fas', 'image']
|
|
9068
|
+
}
|
|
9069
|
+
})], 1), _vm._v(" "), _c('div', {
|
|
9070
|
+
staticClass: "files-btn docs",
|
|
9071
|
+
attrs: {
|
|
9072
|
+
"title": _vm.dictionary.title_anexo_doc
|
|
9073
|
+
},
|
|
9074
|
+
on: {
|
|
9075
|
+
"click": function ($event) {
|
|
9076
|
+
return _vm.openSelectFileHandler('doc');
|
|
9077
|
+
}
|
|
9078
|
+
}
|
|
9079
|
+
}, [_c('fa-icon', {
|
|
9080
|
+
attrs: {
|
|
9081
|
+
"icon": ['fas', 'file-alt']
|
|
9082
|
+
}
|
|
9083
|
+
})], 1)]) : _vm._e()]), _vm._v(" "), _c('div', {
|
|
9084
|
+
staticClass: "files-pointers d-none"
|
|
9085
|
+
}, [_vm.fileSettings.multiple ? _c('input', {
|
|
9086
|
+
attrs: {
|
|
9087
|
+
"type": "file",
|
|
9088
|
+
"id": "both-" + _vm.textId,
|
|
9089
|
+
"accept": "image/*,application/*",
|
|
9090
|
+
"multiple": ""
|
|
9091
|
+
},
|
|
9092
|
+
on: {
|
|
9093
|
+
"change": function ($event) {
|
|
9094
|
+
return _vm.fileUpload($event, 'both');
|
|
9095
|
+
}
|
|
9096
|
+
}
|
|
9097
|
+
}) : _vm._e(), _vm._v(" "), !_vm.fileSettings.multiple ? _c('input', {
|
|
9098
|
+
attrs: {
|
|
9099
|
+
"type": "file",
|
|
9100
|
+
"id": "img-" + _vm.textId,
|
|
9101
|
+
"accept": "image/*"
|
|
9102
|
+
},
|
|
9103
|
+
on: {
|
|
9104
|
+
"change": function ($event) {
|
|
9105
|
+
return _vm.fileUpload($event, 'img');
|
|
9106
|
+
}
|
|
9107
|
+
}
|
|
9108
|
+
}) : _vm._e(), _vm._v(" "), !_vm.fileSettings.multiple ? _c('input', {
|
|
9109
|
+
attrs: {
|
|
9110
|
+
"type": "file",
|
|
9111
|
+
"id": "doc-" + _vm.textId,
|
|
9112
|
+
"accept": "application/*"
|
|
9113
|
+
},
|
|
9114
|
+
on: {
|
|
9115
|
+
"change": function ($event) {
|
|
9116
|
+
return _vm.fileUpload($event, 'doc');
|
|
9117
|
+
}
|
|
9118
|
+
}
|
|
9119
|
+
}) : _vm._e()]), _vm._v(" "), _c('transition', {
|
|
9120
|
+
attrs: {
|
|
9121
|
+
"name": "fade"
|
|
9122
|
+
}
|
|
9123
|
+
}, [_vm.showFilePreview ? _c('div', {
|
|
9124
|
+
staticClass: "text-footer-preview-container",
|
|
9125
|
+
class: [_vm.previewContainerClass],
|
|
9126
|
+
on: {
|
|
9127
|
+
"click": function ($event) {
|
|
9128
|
+
$event.stopPropagation();
|
|
9129
|
+
}
|
|
9130
|
+
}
|
|
9131
|
+
}, [!_vm.fileSettings.multiple ? _c('SingleFilePreview', {
|
|
9132
|
+
attrs: {
|
|
9133
|
+
"dictionary": _vm.dictionary,
|
|
9134
|
+
"file": _vm.file,
|
|
9135
|
+
"isDoc": _vm.isDoc,
|
|
9136
|
+
"fileFormatError": _vm.fileFormatError,
|
|
9137
|
+
"validFileFormats": _vm.validFileFormats,
|
|
9138
|
+
"imagePreview": _vm.imagePreview
|
|
9139
|
+
},
|
|
9140
|
+
on: {
|
|
9141
|
+
"delete-file": _vm.deleteFile,
|
|
9142
|
+
"open-image": _vm.openImage
|
|
9143
|
+
}
|
|
9144
|
+
}) : _c('MultipleFilePreview', {
|
|
9145
|
+
attrs: {
|
|
9146
|
+
"dictionary": _vm.dictionary,
|
|
9147
|
+
"file": _vm.file,
|
|
9148
|
+
"fileFormatError": _vm.fileFormatError,
|
|
9149
|
+
"validFileFormats": _vm.validFileFormats
|
|
9150
|
+
},
|
|
9151
|
+
on: {
|
|
9152
|
+
"delete-file": _vm.deleteFile,
|
|
9153
|
+
"delete-specific-file": _vm.deleteSpecificFile,
|
|
9154
|
+
"open-image": _vm.openImage
|
|
9155
|
+
}
|
|
9156
|
+
})], 1) : _vm._e()])], 1);
|
|
9157
|
+
};
|
|
9158
|
+
|
|
9159
|
+
var __vue_staticRenderFns__$3 = [];
|
|
9160
|
+
/* style */
|
|
9161
|
+
|
|
9162
|
+
const __vue_inject_styles__$3 = function (inject) {
|
|
9163
|
+
if (!inject) return;
|
|
9164
|
+
inject("data-v-3d12f7cc_0", {
|
|
9165
|
+
source: ".fade-enter-active,.fade-leave-active{transition:opacity .3s}.fade-enter,.fade-leave-to{opacity:0}",
|
|
9166
|
+
map: undefined,
|
|
9167
|
+
media: undefined
|
|
9168
|
+
});
|
|
9169
|
+
};
|
|
9170
|
+
/* scoped */
|
|
9171
|
+
|
|
9172
|
+
|
|
9173
|
+
const __vue_scope_id__$3 = undefined;
|
|
9174
|
+
/* module identifier */
|
|
9175
|
+
|
|
9176
|
+
const __vue_module_identifier__$3 = undefined;
|
|
9177
|
+
/* functional template */
|
|
9178
|
+
|
|
9179
|
+
const __vue_is_functional_template__$3 = false;
|
|
9180
|
+
/* style inject SSR */
|
|
9181
|
+
|
|
9182
|
+
/* style inject shadow dom */
|
|
9183
|
+
|
|
9184
|
+
const __vue_component__$4 = /*#__PURE__*/normalizeComponent({
|
|
9185
|
+
render: __vue_render__$3,
|
|
9186
|
+
staticRenderFns: __vue_staticRenderFns__$3
|
|
9187
|
+
}, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, false, createInjector, undefined, undefined);
|
|
9188
|
+
|
|
9189
|
+
var BtnFiles = __vue_component__$4;
|
|
9190
|
+
|
|
9191
|
+
//
|
|
9192
|
+
var script$2 = {
|
|
9193
|
+
components: {
|
|
9194
|
+
EmojisTextFooter,
|
|
9195
|
+
Loader,
|
|
9196
|
+
BtnMic,
|
|
9197
|
+
BtnFiles,
|
|
9198
|
+
RemainingCharacters
|
|
9199
|
+
},
|
|
9200
|
+
mixins: [mixin_1],
|
|
9201
|
+
props: {
|
|
9202
|
+
buttons: {
|
|
9203
|
+
type: Object,
|
|
9204
|
+
default: () => {
|
|
9205
|
+
return {
|
|
9206
|
+
hasEmojis: false,
|
|
9207
|
+
hasSendButton: false,
|
|
9208
|
+
hasFiles: false,
|
|
9209
|
+
hasAudio: false
|
|
9210
|
+
};
|
|
9211
|
+
},
|
|
9212
|
+
required: false
|
|
9213
|
+
},
|
|
9214
|
+
cssStyle: {
|
|
9215
|
+
type: Object,
|
|
9216
|
+
default: () => {
|
|
9217
|
+
return {
|
|
9218
|
+
width: "full",
|
|
9219
|
+
backgroundColor: "#FFF",
|
|
9220
|
+
outsideButtons: false
|
|
9221
|
+
};
|
|
9222
|
+
},
|
|
9223
|
+
required: false
|
|
9224
|
+
},
|
|
9225
|
+
textareaSettings: {
|
|
9226
|
+
type: Object,
|
|
9227
|
+
default: () => {
|
|
9228
|
+
return {
|
|
9229
|
+
placeholderMessage: "",
|
|
9230
|
+
maxCharacters: 0,
|
|
9231
|
+
sendOnEnter: false,
|
|
9232
|
+
disabled: false
|
|
9233
|
+
};
|
|
9234
|
+
},
|
|
9235
|
+
required: false
|
|
9236
|
+
},
|
|
9237
|
+
emojiSettings: {
|
|
9238
|
+
type: Object,
|
|
9239
|
+
default: () => {
|
|
9240
|
+
return {
|
|
9241
|
+
openEmojisFrom: "top",
|
|
9242
|
+
smallEmojis: false
|
|
9243
|
+
};
|
|
9244
|
+
},
|
|
9245
|
+
required: false
|
|
9246
|
+
},
|
|
9247
|
+
formattedMessageSettings: {
|
|
9248
|
+
type: Object,
|
|
9249
|
+
default: () => {
|
|
9250
|
+
return {
|
|
9251
|
+
hasHsm: false,
|
|
9252
|
+
msgType: 0
|
|
9253
|
+
};
|
|
9254
|
+
},
|
|
9255
|
+
required: false
|
|
9256
|
+
},
|
|
9257
|
+
fileSettings: {
|
|
9258
|
+
type: Object,
|
|
9259
|
+
default: () => {
|
|
9260
|
+
return {
|
|
9261
|
+
docsExtensions: "",
|
|
9262
|
+
imagesExtensions: "",
|
|
9263
|
+
multiple: false
|
|
9264
|
+
};
|
|
9265
|
+
},
|
|
9266
|
+
required: false
|
|
9267
|
+
},
|
|
9268
|
+
textId: {
|
|
9269
|
+
type: String,
|
|
9270
|
+
required: true
|
|
9271
|
+
},
|
|
9272
|
+
isMainChat: {
|
|
9273
|
+
type: Boolean,
|
|
9274
|
+
default: false,
|
|
9275
|
+
required: false
|
|
9276
|
+
},
|
|
9277
|
+
isSending: {
|
|
9278
|
+
type: Boolean,
|
|
9279
|
+
default: false,
|
|
9280
|
+
required: false
|
|
9281
|
+
},
|
|
9282
|
+
dictionary: {
|
|
9283
|
+
type: Object,
|
|
9284
|
+
required: true
|
|
9285
|
+
}
|
|
9286
|
+
},
|
|
9287
|
+
|
|
9288
|
+
data() {
|
|
9289
|
+
return {
|
|
9290
|
+
message: "",
|
|
9291
|
+
openFiles: false,
|
|
9292
|
+
file: [],
|
|
9293
|
+
showFilePreview: false,
|
|
9294
|
+
imagePreview: "",
|
|
9295
|
+
isDoc: false,
|
|
9296
|
+
fileFormatError: false,
|
|
9297
|
+
audioFile: "",
|
|
9298
|
+
audioSource: ""
|
|
9299
|
+
};
|
|
9300
|
+
},
|
|
9301
|
+
|
|
9302
|
+
created() {
|
|
9303
|
+
this.$root.$refs[`tf-${this.textId}`] = this;
|
|
9304
|
+
},
|
|
8337
9305
|
|
|
8338
9306
|
mounted() {
|
|
8339
|
-
setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize");
|
|
8340
|
-
this.$root.$on("
|
|
8341
|
-
|
|
8342
|
-
})
|
|
8343
|
-
this.$root.$on("
|
|
8344
|
-
|
|
8345
|
-
});
|
|
8346
|
-
this.$root.$on("textarea-focus", () => {
|
|
8347
|
-
this.focusTextarea();
|
|
8348
|
-
});
|
|
8349
|
-
this.$root.$on("resize-footer-template", () => {
|
|
8350
|
-
this.adjustChatHeight();
|
|
8351
|
-
});
|
|
8352
|
-
this.$root.$on("clear-footer-message", () => {
|
|
8353
|
-
this.message = "";
|
|
8354
|
-
});
|
|
8355
|
-
if (this.cssStyle.outsideButtons) if (this.$root.$refs.chatCorpo) this.$root.$refs.chatCorpo.setOutsideButtons(this.cssStyle.outsideButtons);
|
|
9307
|
+
setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize"); // this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
|
|
9308
|
+
// this.$root.$on("toggle-msg-formatada", () => { this.toggleHSM() })
|
|
9309
|
+
// this.$root.$on("textarea-focus", () => { this.focusTextarea() })
|
|
9310
|
+
// this.$root.$on("resize-footer-template", () => { this.adjustChatHeight() })
|
|
9311
|
+
// this.$root.$on("clear-footer-message", () => { this.message = "" })
|
|
9312
|
+
// if(this.cssStyle.outsideButtons) if(this.$root.$refs.chatCorpo) this.$root.$refs.chatCorpo.setOutsideButtons(this.cssStyle.outsideButtons)
|
|
8356
9313
|
},
|
|
8357
9314
|
|
|
8358
9315
|
methods: {
|
|
@@ -8366,7 +9323,7 @@ var script$2 = {
|
|
|
8366
9323
|
},
|
|
8367
9324
|
|
|
8368
9325
|
away() {
|
|
8369
|
-
this.openFiles = false;
|
|
9326
|
+
if (this.$refs[`${this.textId}-file`]) this.$refs[`${this.textId}-file`].openFiles = false;
|
|
8370
9327
|
},
|
|
8371
9328
|
|
|
8372
9329
|
setDefaultMessage(msg) {
|
|
@@ -8398,7 +9355,16 @@ var script$2 = {
|
|
|
8398
9355
|
if (this.textareaSettings.disabled) return false;
|
|
8399
9356
|
|
|
8400
9357
|
if (this.fileFormatError) {
|
|
8401
|
-
this.$toasted.global.
|
|
9358
|
+
this.$toasted.global.defaultError({
|
|
9359
|
+
msg: this.dictionary.msg_formato_invalido
|
|
9360
|
+
});
|
|
9361
|
+
const str = {
|
|
9362
|
+
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
9363
|
+
doc: this.fileSettings.docsExtensions.split("|").join(", ")
|
|
9364
|
+
};
|
|
9365
|
+
this.$toasted.global.showValidFormats({
|
|
9366
|
+
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`
|
|
9367
|
+
});
|
|
8402
9368
|
return false;
|
|
8403
9369
|
}
|
|
8404
9370
|
|
|
@@ -8447,7 +9413,7 @@ var script$2 = {
|
|
|
8447
9413
|
const messageAux = this.formatMessage(this.message);
|
|
8448
9414
|
|
|
8449
9415
|
if (this.verifyMessage()) {
|
|
8450
|
-
if (messageAux
|
|
9416
|
+
if (messageAux || this.showFilePreview || this.audioFile) {
|
|
8451
9417
|
this.$emit("send-message", messageAux);
|
|
8452
9418
|
const objMessage = this.returnObjectMessage(messageAux);
|
|
8453
9419
|
this.$emit("obj-message", objMessage);
|
|
@@ -8464,248 +9430,145 @@ var script$2 = {
|
|
|
8464
9430
|
|
|
8465
9431
|
resetFooterData() {
|
|
8466
9432
|
if (this.audioFile) this.deleteAudio();
|
|
8467
|
-
if (this.showFilePreview) this.deleteFile();
|
|
9433
|
+
if (this.showFilePreview) this.$refs[`${this.textId}-file`].deleteFile();
|
|
8468
9434
|
this.message = "";
|
|
8469
9435
|
this.sendFinalMessage();
|
|
8470
9436
|
resetTargets(this.$el, ".js-autoresize", ".js-parentresize", "38px");
|
|
8471
9437
|
this.focusTextarea();
|
|
8472
9438
|
},
|
|
8473
9439
|
|
|
8474
|
-
activeFormatHourMessage() {
|
|
8475
|
-
return formataHoraMensagem(false);
|
|
8476
|
-
},
|
|
8477
|
-
|
|
8478
9440
|
returnObjectMessage(message) {
|
|
8479
9441
|
return {
|
|
8480
9442
|
message,
|
|
8481
|
-
|
|
8482
|
-
hora: this.activeFormatHourMessage(),
|
|
8483
|
-
anexo: this.showFilePreview ? this.file : false,
|
|
8484
|
-
imgAnexo: this.imagePreview,
|
|
9443
|
+
attachment: this.showFilePreview ? this.file : false,
|
|
8485
9444
|
isDoc: this.isDoc,
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
9445
|
+
imagePreview: this.imagePreview,
|
|
9446
|
+
isAudio: this.audioFile ? true : false,
|
|
9447
|
+
audioAttachment: this.audioSource
|
|
8489
9448
|
};
|
|
8490
9449
|
},
|
|
8491
9450
|
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
const fileInput = document.querySelector(`#doc-${this.textId}`);
|
|
8506
|
-
if (fileInput) fileInput.click();
|
|
8507
|
-
if (!fileInput) if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError();
|
|
9451
|
+
setFileVars(fileObj) {
|
|
9452
|
+
const {
|
|
9453
|
+
file,
|
|
9454
|
+
showFilePreview,
|
|
9455
|
+
imagePreview,
|
|
9456
|
+
isDoc,
|
|
9457
|
+
fileFormatError
|
|
9458
|
+
} = fileObj;
|
|
9459
|
+
this.file = file;
|
|
9460
|
+
this.showFilePreview = showFilePreview;
|
|
9461
|
+
this.imagePreview = imagePreview ? imagePreview : "";
|
|
9462
|
+
this.isDoc = isDoc;
|
|
9463
|
+
this.fileFormatError = fileFormatError;
|
|
8508
9464
|
},
|
|
8509
9465
|
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
const regex = new RegExp("(" + extensions + ")", "i");
|
|
8513
|
-
if (regex.test(this.file.name)) return true;
|
|
8514
|
-
this.$toasted.global.formatoInvalido();
|
|
8515
|
-
return false;
|
|
9466
|
+
openImage(imagePreview) {
|
|
9467
|
+
this.$emit("open-image", imagePreview);
|
|
8516
9468
|
},
|
|
8517
9469
|
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
this.file = [];
|
|
8526
|
-
return;
|
|
8527
|
-
}
|
|
8528
|
-
|
|
8529
|
-
this.file = this.file[0];
|
|
8530
|
-
|
|
8531
|
-
if (!externalCall) {
|
|
8532
|
-
const selector = type === "img" ? `#file-${this.textId}` : `#doc-${this.textId}`;
|
|
8533
|
-
document.querySelector(selector).value = "";
|
|
8534
|
-
}
|
|
8535
|
-
|
|
8536
|
-
this.showFilePreview = true;
|
|
8537
|
-
|
|
8538
|
-
if (type === "img") {
|
|
8539
|
-
fileReader.onload = () => {
|
|
8540
|
-
this.imagePreview = fileReader.result;
|
|
8541
|
-
};
|
|
8542
|
-
}
|
|
8543
|
-
|
|
8544
|
-
if (this.isFileValid(type)) {
|
|
8545
|
-
if (type === "img") fileReader.readAsDataURL(this.file);
|
|
8546
|
-
if (type === "doc") this.isDoc = true;
|
|
8547
|
-
this.focusTextarea();
|
|
8548
|
-
this.fileFormatError = false;
|
|
8549
|
-
} else {
|
|
8550
|
-
this.fileFormatError = true;
|
|
8551
|
-
this.validFileFormats = `${type === "img" ? this.fileSettings.imagesExtensions : this.fileSettings.docsExtensions} ${this.dictionary.msg_extensoes_aceitas}`;
|
|
8552
|
-
}
|
|
9470
|
+
setAudio(audioObj) {
|
|
9471
|
+
const {
|
|
9472
|
+
audioFile,
|
|
9473
|
+
audioSource
|
|
9474
|
+
} = audioObj;
|
|
9475
|
+
this.audioFile = audioFile;
|
|
9476
|
+
this.audioSource = audioSource;
|
|
8553
9477
|
},
|
|
8554
9478
|
|
|
8555
|
-
|
|
8556
|
-
this.
|
|
8557
|
-
this.
|
|
8558
|
-
this.
|
|
8559
|
-
this.imagePreview = "";
|
|
8560
|
-
this.fileFormatError = false;
|
|
8561
|
-
this.validFileFormats = "";
|
|
9479
|
+
deleteAudio() {
|
|
9480
|
+
this.$refs[`${this.textId}-mic`].deleteMediaRecorder();
|
|
9481
|
+
this.audioFile = "";
|
|
9482
|
+
this.audioSource = "";
|
|
8562
9483
|
},
|
|
8563
9484
|
|
|
8564
|
-
|
|
8565
|
-
this
|
|
8566
|
-
|
|
8567
|
-
|
|
9485
|
+
returnFileType(file, stopAlert) {
|
|
9486
|
+
const imgRegex = new RegExp("\.(" + this.fileSettings.imagesExtensions + ")", "i");
|
|
9487
|
+
if (imgRegex.test(file.name)) return "img";
|
|
9488
|
+
const docRegex = new RegExp("\.(" + this.fileSettings.docsExtensions + ")", "i");
|
|
9489
|
+
if (docRegex.test(file.name)) return "doc";
|
|
9490
|
+
if (!stopAlert) return;
|
|
9491
|
+
if (!document.querySelector(".toasted.toasted-primary.error")) this.$toasted.global.defaultError({
|
|
9492
|
+
msg: this.dictionary.msg_formato_invalido
|
|
8568
9493
|
});
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
})
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
this.mediaRecorder.ondataavailable = eventData => {
|
|
8580
|
-
audioChunks.push(eventData.data);
|
|
8581
|
-
};
|
|
9494
|
+
const str = {
|
|
9495
|
+
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
9496
|
+
doc: this.fileSettings.docsExtensions.split("|").join(", ")
|
|
9497
|
+
};
|
|
9498
|
+
this.$toasted.global.showValidFormats({
|
|
9499
|
+
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`
|
|
9500
|
+
});
|
|
9501
|
+
return false;
|
|
9502
|
+
},
|
|
8582
9503
|
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
blob.name = `im-audio-file-${this.$store.getters.getNomeOpe}-${parseInt(Math.random() * 5000)}`;
|
|
8589
|
-
const reader = new FileReader();
|
|
8590
|
-
reader.readAsDataURL(blob);
|
|
9504
|
+
filesHandler(files) {
|
|
9505
|
+
const fileType = this.returnFileType(files[0], true);
|
|
9506
|
+
let invalidFile = false;
|
|
9507
|
+
files.forEach(file => {
|
|
9508
|
+
const singleFileType = this.returnFileType(file, true);
|
|
8591
9509
|
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
this.audioSource = reader.result;
|
|
8597
|
-
};
|
|
9510
|
+
if (!singleFileType) {
|
|
9511
|
+
invalidFile = true;
|
|
9512
|
+
file.invalid = true;
|
|
9513
|
+
}
|
|
8598
9514
|
|
|
8599
|
-
|
|
8600
|
-
|
|
9515
|
+
file.imgOrDoc = singleFileType ? singleFileType : "";
|
|
9516
|
+
});
|
|
8601
9517
|
|
|
8602
|
-
|
|
8603
|
-
|
|
9518
|
+
if (!invalidFile) {
|
|
9519
|
+
this.$refs[`${this.textId}-file`].fileUpload(files, fileType, true);
|
|
9520
|
+
} else {
|
|
8604
9521
|
this.$toasted.global.defaultError({
|
|
8605
|
-
msg: this.dictionary.
|
|
9522
|
+
msg: this.dictionary.msg_formato_invalido
|
|
8606
9523
|
});
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8615
|
-
return this.mediaRecorder.stop();
|
|
9524
|
+
const str = {
|
|
9525
|
+
img: this.fileSettings.imagesExtensions.split("|").join(", "),
|
|
9526
|
+
doc: this.fileSettings.docsExtensions.split("|").join(", ")
|
|
9527
|
+
};
|
|
9528
|
+
this.$toasted.global.showValidFormats({
|
|
9529
|
+
msg: `Imagens: ${str.img} - Documentos: ${str.doc} ${this.dictionary.msg_extensoes_aceitas}`
|
|
9530
|
+
});
|
|
9531
|
+
}
|
|
8616
9532
|
},
|
|
8617
9533
|
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
9534
|
+
dropFile(e) {
|
|
9535
|
+
try {
|
|
9536
|
+
e.stopPropagation();
|
|
9537
|
+
e.preventDefault();
|
|
9538
|
+
const files = e.dataTransfer.files.length ? e.dataTransfer.files : "";
|
|
9539
|
+
this.filesHandler(files);
|
|
9540
|
+
} catch (e) {
|
|
9541
|
+
console.error("Erro drop file");
|
|
9542
|
+
console.error(e);
|
|
9543
|
+
}
|
|
8621
9544
|
},
|
|
8622
9545
|
|
|
8623
9546
|
pasteImage(e) {
|
|
8624
|
-
|
|
8625
|
-
e.
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
if (imgRegex.test(file[0].name)) fileType = "img";
|
|
8632
|
-
const docRegex = new RegExp("(" + this.fileSettings.docsExtensions + ")", "i");
|
|
8633
|
-
if (docRegex.test(file[0].name)) fileType = "doc";
|
|
8634
|
-
|
|
8635
|
-
if (fileType) {
|
|
8636
|
-
this.fileUpload(file, fileType, true);
|
|
8637
|
-
} else {
|
|
8638
|
-
this.$toasted.global.formatoInvalido();
|
|
8639
|
-
this.$toasted.global.formatosValidos();
|
|
9547
|
+
try {
|
|
9548
|
+
if (e.clipboardData.files.length && !this.buttons.hasFiles) {
|
|
9549
|
+
e.preventDefault();
|
|
9550
|
+
return;
|
|
9551
|
+
} else if (e.clipboardData.files.length && this.buttons.hasFiles) {
|
|
9552
|
+
const files = e.clipboardData.files;
|
|
9553
|
+
this.filesHandler(files);
|
|
8640
9554
|
}
|
|
9555
|
+
} catch (e) {
|
|
9556
|
+
console.error("Nao foi possivel colar a/o imagem/documento");
|
|
9557
|
+
console.error(e);
|
|
8641
9558
|
}
|
|
8642
9559
|
}
|
|
8643
9560
|
|
|
8644
9561
|
},
|
|
8645
9562
|
|
|
8646
|
-
destroyed() {
|
|
8647
|
-
this.$root.$off("
|
|
8648
|
-
this.$root.$off("
|
|
8649
|
-
this.$root.$off("
|
|
8650
|
-
this.$root.$off("
|
|
8651
|
-
this.$root.$off("resize-footer-template");
|
|
9563
|
+
destroyed() {// this.$root.$off("drop-file")
|
|
9564
|
+
// this.$root.$off("toggle-msg-formatada")
|
|
9565
|
+
// this.$root.$off("textarea-focus")
|
|
9566
|
+
// this.$root.$off("clear-footer-message")
|
|
9567
|
+
// this.$root.$off("resize-footer-template")
|
|
8652
9568
|
}
|
|
8653
9569
|
|
|
8654
9570
|
};
|
|
8655
9571
|
|
|
8656
|
-
const isOldIE = typeof navigator !== 'undefined' &&
|
|
8657
|
-
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
|
|
8658
|
-
function createInjector(context) {
|
|
8659
|
-
return (id, style) => addStyle(id, style);
|
|
8660
|
-
}
|
|
8661
|
-
let HEAD;
|
|
8662
|
-
const styles = {};
|
|
8663
|
-
function addStyle(id, css) {
|
|
8664
|
-
const group = isOldIE ? css.media || 'default' : id;
|
|
8665
|
-
const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
|
|
8666
|
-
if (!style.ids.has(id)) {
|
|
8667
|
-
style.ids.add(id);
|
|
8668
|
-
let code = css.source;
|
|
8669
|
-
if (css.map) {
|
|
8670
|
-
// https://developer.chrome.com/devtools/docs/javascript-debugging
|
|
8671
|
-
// this makes source maps inside style tags work properly in Chrome
|
|
8672
|
-
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
|
|
8673
|
-
// http://stackoverflow.com/a/26603875
|
|
8674
|
-
code +=
|
|
8675
|
-
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
8676
|
-
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
|
|
8677
|
-
' */';
|
|
8678
|
-
}
|
|
8679
|
-
if (!style.element) {
|
|
8680
|
-
style.element = document.createElement('style');
|
|
8681
|
-
style.element.type = 'text/css';
|
|
8682
|
-
if (css.media)
|
|
8683
|
-
style.element.setAttribute('media', css.media);
|
|
8684
|
-
if (HEAD === undefined) {
|
|
8685
|
-
HEAD = document.head || document.getElementsByTagName('head')[0];
|
|
8686
|
-
}
|
|
8687
|
-
HEAD.appendChild(style.element);
|
|
8688
|
-
}
|
|
8689
|
-
if ('styleSheet' in style.element) {
|
|
8690
|
-
style.styles.push(code);
|
|
8691
|
-
style.element.styleSheet.cssText = style.styles
|
|
8692
|
-
.filter(Boolean)
|
|
8693
|
-
.join('\n');
|
|
8694
|
-
}
|
|
8695
|
-
else {
|
|
8696
|
-
const index = style.ids.size - 1;
|
|
8697
|
-
const textNode = document.createTextNode(code);
|
|
8698
|
-
const nodes = style.element.childNodes;
|
|
8699
|
-
if (nodes[index])
|
|
8700
|
-
style.element.removeChild(nodes[index]);
|
|
8701
|
-
if (nodes.length)
|
|
8702
|
-
style.element.insertBefore(textNode, nodes[index]);
|
|
8703
|
-
else
|
|
8704
|
-
style.element.appendChild(textNode);
|
|
8705
|
-
}
|
|
8706
|
-
}
|
|
8707
|
-
}
|
|
8708
|
-
|
|
8709
9572
|
/* script */
|
|
8710
9573
|
const __vue_script__$2 = script$2;
|
|
8711
9574
|
/* template */
|
|
@@ -8724,12 +9587,30 @@ var __vue_render__$2 = function () {
|
|
|
8724
9587
|
value: _vm.away,
|
|
8725
9588
|
expression: "away"
|
|
8726
9589
|
}],
|
|
8727
|
-
staticClass: "text-footer-container"
|
|
9590
|
+
staticClass: "text-footer-container",
|
|
9591
|
+
on: {
|
|
9592
|
+
"drop": function ($event) {
|
|
9593
|
+
$event.stopPropagation();
|
|
9594
|
+
return _vm.dropFile.apply(null, arguments);
|
|
9595
|
+
},
|
|
9596
|
+
"dragenter": function ($event) {
|
|
9597
|
+
$event.preventDefault();
|
|
9598
|
+
},
|
|
9599
|
+
"dragover": function ($event) {
|
|
9600
|
+
$event.preventDefault();
|
|
9601
|
+
}
|
|
9602
|
+
}
|
|
8728
9603
|
}, [_c('div', {
|
|
8729
9604
|
staticClass: "text-footer",
|
|
8730
9605
|
class: _vm.cssStyle.width ? _vm.cssStyle.width : '',
|
|
8731
9606
|
style: "background-color: " + _vm.cssStyle.backgroundColor
|
|
8732
|
-
}, [
|
|
9607
|
+
}, [_c('EmojisTextFooter', {
|
|
9608
|
+
directives: [{
|
|
9609
|
+
name: "show",
|
|
9610
|
+
rawName: "v-show",
|
|
9611
|
+
value: _vm.buttons.hasEmojis && !_vm.audioFile,
|
|
9612
|
+
expression: "buttons.hasEmojis && !audioFile"
|
|
9613
|
+
}],
|
|
8733
9614
|
ref: "" + this.textId,
|
|
8734
9615
|
attrs: {
|
|
8735
9616
|
"emojiId": "" + this.textId,
|
|
@@ -8739,11 +9620,11 @@ var __vue_render__$2 = function () {
|
|
|
8739
9620
|
on: {
|
|
8740
9621
|
"insert-emoji": _vm.insertEmoji
|
|
8741
9622
|
}
|
|
8742
|
-
})
|
|
9623
|
+
}), _vm._v(" "), _c('transition', {
|
|
8743
9624
|
attrs: {
|
|
8744
9625
|
"name": "fade"
|
|
8745
9626
|
}
|
|
8746
|
-
}, [_vm.isSending ? _c('
|
|
9627
|
+
}, [_vm.isSending ? _c('Loader') : _vm._e()], 1), _vm._v(" "), !_vm.audioFile ? _c('textarea', {
|
|
8747
9628
|
directives: [{
|
|
8748
9629
|
name: "model",
|
|
8749
9630
|
rawName: "v-model",
|
|
@@ -8813,15 +9694,15 @@ var __vue_render__$2 = function () {
|
|
|
8813
9694
|
attrs: {
|
|
8814
9695
|
"icon": ['fas', 'times']
|
|
8815
9696
|
}
|
|
8816
|
-
})], 1)]), _vm._v(" "),
|
|
8817
|
-
staticClass: "max-characters no-width",
|
|
9697
|
+
})], 1)]), _vm._v(" "), _c('RemainingCharacters', {
|
|
8818
9698
|
class: {
|
|
8819
9699
|
'd-none': _vm.audioFile
|
|
8820
9700
|
},
|
|
8821
|
-
|
|
8822
|
-
"
|
|
9701
|
+
attrs: {
|
|
9702
|
+
"message": _vm.message,
|
|
9703
|
+
"maxCharacters": _vm.textareaSettings.maxCharacters
|
|
8823
9704
|
}
|
|
8824
|
-
})
|
|
9705
|
+
}), _vm._v(" "), _vm.buttons.hasSendButton ? _c('div', {
|
|
8825
9706
|
staticClass: "text-footer-actions"
|
|
8826
9707
|
}, [_c('span', {
|
|
8827
9708
|
staticClass: "text-footer-actions--btn",
|
|
@@ -8840,147 +9721,38 @@ var __vue_render__$2 = function () {
|
|
|
8840
9721
|
class: {
|
|
8841
9722
|
'outside-buttons': _vm.cssStyle.outsideButtons && !_vm.audioFile
|
|
8842
9723
|
}
|
|
8843
|
-
}, [
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
}, [_c('fa-icon', {
|
|
8852
|
-
attrs: {
|
|
8853
|
-
"icon": ['fas', 'microphone']
|
|
8854
|
-
}
|
|
8855
|
-
})], 1) : _vm._e(), _vm._v(" "), _vm.buttons.hasFiles && !_vm.audioFile ? _c('span', {
|
|
8856
|
-
staticClass: "text-footer-actions--btn",
|
|
8857
|
-
class: {
|
|
8858
|
-
'files-activated': _vm.openFiles
|
|
8859
|
-
},
|
|
8860
|
-
attrs: {
|
|
8861
|
-
"title": _vm.dictionary.title_selecionar_anexo
|
|
8862
|
-
},
|
|
8863
|
-
on: {
|
|
8864
|
-
"click": _vm.toggleFiles
|
|
8865
|
-
}
|
|
8866
|
-
}, [_c('fa-icon', {
|
|
8867
|
-
attrs: {
|
|
8868
|
-
"icon": ['fas', 'paperclip']
|
|
8869
|
-
}
|
|
8870
|
-
})], 1) : _vm._e()]) : _vm._e()], 1), _vm._v(" "), _c('transition', {
|
|
8871
|
-
attrs: {
|
|
8872
|
-
"name": "show"
|
|
8873
|
-
}
|
|
8874
|
-
}, [_vm.buttons.hasFiles && _vm.openFiles ? _c('div', {
|
|
8875
|
-
staticClass: "text-footer-files-container",
|
|
8876
|
-
class: {
|
|
8877
|
-
'horizontal': _vm.cssStyle.outsideButtons
|
|
8878
|
-
}
|
|
8879
|
-
}, [_c('div', {
|
|
8880
|
-
staticClass: "files-btn images",
|
|
8881
|
-
class: {
|
|
8882
|
-
'margin-bottom': _vm.cssStyle.outsideButtons
|
|
8883
|
-
},
|
|
8884
|
-
attrs: {
|
|
8885
|
-
"title": _vm.dictionary.title_anexo_img
|
|
8886
|
-
},
|
|
8887
|
-
on: {
|
|
8888
|
-
"click": _vm.selectImage
|
|
8889
|
-
}
|
|
8890
|
-
}, [_c('fa-icon', {
|
|
8891
|
-
attrs: {
|
|
8892
|
-
"icon": ['fas', 'image']
|
|
8893
|
-
}
|
|
8894
|
-
})], 1), _vm._v(" "), _c('div', {
|
|
8895
|
-
staticClass: "files-btn docs",
|
|
8896
|
-
attrs: {
|
|
8897
|
-
"title": _vm.dictionary.title_anexo_doc
|
|
8898
|
-
},
|
|
8899
|
-
on: {
|
|
8900
|
-
"click": _vm.selectDoc
|
|
8901
|
-
}
|
|
8902
|
-
}, [_c('fa-icon', {
|
|
8903
|
-
attrs: {
|
|
8904
|
-
"icon": ['fas', 'file-alt']
|
|
8905
|
-
}
|
|
8906
|
-
})], 1), _vm._v(" "), _c('div', {
|
|
8907
|
-
staticClass: "files-pointers d-none"
|
|
8908
|
-
}, [_c('input', {
|
|
8909
|
-
attrs: {
|
|
8910
|
-
"type": "file",
|
|
8911
|
-
"id": "file-" + _vm.textId,
|
|
8912
|
-
"accept": "image/*"
|
|
8913
|
-
},
|
|
8914
|
-
on: {
|
|
8915
|
-
"change": function ($event) {
|
|
8916
|
-
return _vm.fileUpload($event, 'img');
|
|
8917
|
-
}
|
|
8918
|
-
}
|
|
8919
|
-
}), _vm._v(" "), _c('input', {
|
|
8920
|
-
attrs: {
|
|
8921
|
-
"type": "file",
|
|
8922
|
-
"id": "doc-" + _vm.textId,
|
|
8923
|
-
"accept": "application/*"
|
|
8924
|
-
},
|
|
8925
|
-
on: {
|
|
8926
|
-
"change": function ($event) {
|
|
8927
|
-
return _vm.fileUpload($event, 'doc');
|
|
8928
|
-
}
|
|
8929
|
-
}
|
|
8930
|
-
})])]) : _vm._e()]), _vm._v(" "), _c('transition', {
|
|
8931
|
-
attrs: {
|
|
8932
|
-
"name": "fade"
|
|
8933
|
-
}
|
|
8934
|
-
}, [_vm.showFilePreview ? _c('div', {
|
|
8935
|
-
staticClass: "text-footer-preview-container",
|
|
8936
|
-
class: {
|
|
8937
|
-
'isDoc': _vm.isDoc && !_vm.fileFormatError,
|
|
8938
|
-
'isImg': !_vm.isDoc && !_vm.fileFormatError,
|
|
8939
|
-
'isError': _vm.fileFormatError
|
|
8940
|
-
}
|
|
8941
|
-
}, [_c('span', {
|
|
8942
|
-
staticClass: "text-footer-exclude-file",
|
|
9724
|
+
}, [_c('BtnMic', {
|
|
9725
|
+
directives: [{
|
|
9726
|
+
name: "show",
|
|
9727
|
+
rawName: "v-show",
|
|
9728
|
+
value: _vm.buttons.hasAudio && !_vm.audioFile,
|
|
9729
|
+
expression: "buttons.hasAudio && !audioFile"
|
|
9730
|
+
}],
|
|
9731
|
+
ref: _vm.textId + "-mic",
|
|
8943
9732
|
attrs: {
|
|
8944
|
-
"
|
|
9733
|
+
"dictionary": _vm.dictionary
|
|
8945
9734
|
},
|
|
8946
9735
|
on: {
|
|
8947
|
-
"
|
|
8948
|
-
}
|
|
8949
|
-
}, [_c('fa-icon', {
|
|
8950
|
-
attrs: {
|
|
8951
|
-
"icon": ['fas', 'times-circle']
|
|
8952
|
-
}
|
|
8953
|
-
})], 1), _vm._v(" "), _vm.file.name ? _c('h3', {
|
|
8954
|
-
staticClass: "text-footer-preview-title"
|
|
8955
|
-
}, [_vm.isDoc ? _c('fa-icon', {
|
|
8956
|
-
attrs: {
|
|
8957
|
-
"icon": ['fas', 'file-alt']
|
|
8958
|
-
}
|
|
8959
|
-
}) : _c('fa-icon', {
|
|
8960
|
-
attrs: {
|
|
8961
|
-
"icon": ['fas', 'image']
|
|
8962
|
-
}
|
|
8963
|
-
}), _vm._v("\n " + _vm._s(_vm.file.name) + "\n ")], 1) : _vm._e(), _vm._v(" "), _vm.fileFormatError ? _c('div', {
|
|
8964
|
-
staticClass: "text-footer-invalid-format"
|
|
8965
|
-
}, [_c('h3', {
|
|
8966
|
-
domProps: {
|
|
8967
|
-
"textContent": _vm._s(_vm.dictionary.titulo_msg_formato_invalido)
|
|
8968
|
-
}
|
|
8969
|
-
}), _vm._v(" "), _c('h4', {
|
|
8970
|
-
domProps: {
|
|
8971
|
-
"textContent": _vm._s(_vm.validFileFormats)
|
|
9736
|
+
"set-audio": _vm.setAudio
|
|
8972
9737
|
}
|
|
8973
|
-
})
|
|
8974
|
-
|
|
8975
|
-
|
|
9738
|
+
}), _vm._v(" "), _c('BtnFiles', {
|
|
9739
|
+
directives: [{
|
|
9740
|
+
name: "show",
|
|
9741
|
+
rawName: "v-show",
|
|
9742
|
+
value: _vm.buttons.hasFiles && !_vm.audioFile,
|
|
9743
|
+
expression: "buttons.hasFiles && !audioFile"
|
|
9744
|
+
}],
|
|
9745
|
+
ref: _vm.textId + "-file",
|
|
8976
9746
|
attrs: {
|
|
8977
|
-
"
|
|
8978
|
-
"
|
|
9747
|
+
"textId": _vm.textId,
|
|
9748
|
+
"dictionary": _vm.dictionary,
|
|
9749
|
+
"fileSettings": _vm.fileSettings,
|
|
9750
|
+
"cssStyle": _vm.cssStyle
|
|
8979
9751
|
},
|
|
8980
9752
|
on: {
|
|
8981
|
-
"
|
|
9753
|
+
"set-file-vars": _vm.setFileVars
|
|
8982
9754
|
}
|
|
8983
|
-
})]
|
|
9755
|
+
})], 1) : _vm._e()], 1)]) : _vm._e();
|
|
8984
9756
|
};
|
|
8985
9757
|
|
|
8986
9758
|
var __vue_staticRenderFns__$2 = [];
|
|
@@ -8988,8 +9760,8 @@ var __vue_staticRenderFns__$2 = [];
|
|
|
8988
9760
|
|
|
8989
9761
|
const __vue_inject_styles__$2 = function (inject) {
|
|
8990
9762
|
if (!inject) return;
|
|
8991
|
-
inject("data-v-
|
|
8992
|
-
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:54px;position:relative;display:flex;justify-content:center;align-items:center;border:1px solid #ccc;padding:5px 2px 5px 5px;border-radius:15px}.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:
|
|
9763
|
+
inject("data-v-4d58300c_0", {
|
|
9764
|
+
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:54px;position:relative;display:flex;justify-content:center;align-items:center;border:1px solid #ccc;padding:5px 2px 5px 5px;border-radius:15px}.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:5px;border-top-right-radius: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}",
|
|
8993
9765
|
map: undefined,
|
|
8994
9766
|
media: undefined
|
|
8995
9767
|
});
|
|
@@ -9028,10 +9800,6 @@ var script$1 = {
|
|
|
9028
9800
|
},
|
|
9029
9801
|
|
|
9030
9802
|
props: {
|
|
9031
|
-
smartStyle: {
|
|
9032
|
-
type: Boolean,
|
|
9033
|
-
required: false
|
|
9034
|
-
},
|
|
9035
9803
|
hasButton: {
|
|
9036
9804
|
type: Boolean,
|
|
9037
9805
|
required: false
|
|
@@ -9065,12 +9833,6 @@ var script$1 = {
|
|
|
9065
9833
|
elem.classList.toggle("active");
|
|
9066
9834
|
}
|
|
9067
9835
|
}
|
|
9068
|
-
},
|
|
9069
|
-
|
|
9070
|
-
isValid(textValue) {
|
|
9071
|
-
const regex = /^[ ?????�����??��?���?��??????�������?���?��???��??\w?-�\r\n()[\]{}.,:;@??�????!&?�`�=%^*+\-$|/]+$/;
|
|
9072
|
-
const value = textValue ? textValue.trim("") : "";
|
|
9073
|
-
return regex.test(value);
|
|
9074
9836
|
}
|
|
9075
9837
|
|
|
9076
9838
|
}
|
|
@@ -9088,12 +9850,12 @@ var __vue_render__$1 = function () {
|
|
|
9088
9850
|
var _c = _vm._self._c || _h;
|
|
9089
9851
|
|
|
9090
9852
|
return _c('div', {
|
|
9091
|
-
staticClass: "
|
|
9853
|
+
staticClass: "ts-container"
|
|
9092
9854
|
}, [_c('div', {
|
|
9093
|
-
staticClass: "
|
|
9855
|
+
staticClass: "ts-content"
|
|
9094
9856
|
}, [_c('section', {
|
|
9095
9857
|
class: {
|
|
9096
|
-
'
|
|
9858
|
+
'tm-container': _vm.hasButton
|
|
9097
9859
|
}
|
|
9098
9860
|
}, [_c('TextFooter', {
|
|
9099
9861
|
attrs: {
|
|
@@ -9102,13 +9864,14 @@ var __vue_render__$1 = function () {
|
|
|
9102
9864
|
"openEmojisFrom": 'top',
|
|
9103
9865
|
"smallEmojis": true,
|
|
9104
9866
|
"placeholderMessage": 'Escreva sua mensagem',
|
|
9105
|
-
"ignoreHideTextarea": true
|
|
9867
|
+
"ignoreHideTextarea": true,
|
|
9868
|
+
"dictionary": _vm.dictionary
|
|
9106
9869
|
},
|
|
9107
9870
|
on: {
|
|
9108
9871
|
"final-message": _vm.preencherMensagem
|
|
9109
9872
|
}
|
|
9110
9873
|
}), _vm._v(" "), _vm.hasButton ? _c('div', {
|
|
9111
|
-
staticClass: "
|
|
9874
|
+
staticClass: "tg-btn",
|
|
9112
9875
|
class: {
|
|
9113
9876
|
'small-btn': _vm.iconButton
|
|
9114
9877
|
}
|
|
@@ -9116,7 +9879,7 @@ var __vue_render__$1 = function () {
|
|
|
9116
9879
|
on: {
|
|
9117
9880
|
"click": _vm.sendMessage
|
|
9118
9881
|
}
|
|
9119
|
-
}, [!_vm.iconButton ? [_vm._v(" " + _vm._s(_vm.dictionary.btn_contatar_clientes) + " ")] : _c('
|
|
9882
|
+
}, [!_vm.iconButton ? [_vm._v(" " + _vm._s(_vm.dictionary.btn_contatar_clientes) + " ")] : _c('fa-icon', {
|
|
9120
9883
|
attrs: {
|
|
9121
9884
|
"icon": ['fas', 'paper-plane']
|
|
9122
9885
|
}
|
|
@@ -9165,19 +9928,11 @@ var script = {
|
|
|
9165
9928
|
required: false,
|
|
9166
9929
|
default: true
|
|
9167
9930
|
},
|
|
9168
|
-
|
|
9169
|
-
type: Boolean,
|
|
9170
|
-
required: false
|
|
9171
|
-
},
|
|
9172
|
-
adjustBoxOnSelect: {
|
|
9931
|
+
columnSelect: {
|
|
9173
9932
|
type: Boolean,
|
|
9174
9933
|
required: false
|
|
9175
9934
|
},
|
|
9176
|
-
|
|
9177
|
-
type: Boolean,
|
|
9178
|
-
required: false
|
|
9179
|
-
},
|
|
9180
|
-
footerStyle: {
|
|
9935
|
+
resizeParentOnSelect: {
|
|
9181
9936
|
type: Boolean,
|
|
9182
9937
|
required: false
|
|
9183
9938
|
},
|
|
@@ -9300,8 +10055,7 @@ var script = {
|
|
|
9300
10055
|
},
|
|
9301
10056
|
|
|
9302
10057
|
adjustOnSelect() {
|
|
9303
|
-
if (this.
|
|
9304
|
-
if (this.adjustChatOnSelect) this.$emit("adjust-chat");
|
|
10058
|
+
if (this.resizeParentOnSelect) this.$emit("resize-parent");
|
|
9305
10059
|
},
|
|
9306
10060
|
|
|
9307
10061
|
setFinalMessage(vars) {
|
|
@@ -9370,19 +10124,14 @@ var __vue_render__ = function () {
|
|
|
9370
10124
|
var _c = _vm._self._c || _h;
|
|
9371
10125
|
|
|
9372
10126
|
return _vm.templates && _vm.identifier ? _c('div', {
|
|
9373
|
-
staticClass: "
|
|
9374
|
-
class: {
|
|
9375
|
-
'text-footer-template': _vm.footerStyle
|
|
9376
|
-
}
|
|
10127
|
+
staticClass: "tg-container"
|
|
9377
10128
|
}, [_c('div', {
|
|
9378
|
-
staticClass: "options
|
|
9379
|
-
}, [_c('h4', [_vm._v(" Template: ")]), _vm._v(" "), _c('div', {
|
|
9380
|
-
staticClass: "select-container"
|
|
9381
|
-
}, [_c('v-select', {
|
|
10129
|
+
staticClass: "tg-options",
|
|
9382
10130
|
class: {
|
|
9383
|
-
'
|
|
9384
|
-
|
|
9385
|
-
|
|
10131
|
+
'column': _vm.columnSelect
|
|
10132
|
+
}
|
|
10133
|
+
}, [_c('h4', [_vm._v(" Template: ")]), _vm._v(" "), _c('v-select', {
|
|
10134
|
+
staticClass: "tg-select",
|
|
9386
10135
|
attrs: {
|
|
9387
10136
|
"appendToBody": "",
|
|
9388
10137
|
"calculatePosition": _vm.calculateSelectPosition,
|
|
@@ -9407,14 +10156,13 @@ var __vue_render__ = function () {
|
|
|
9407
10156
|
"textContent": _vm._s(_vm.dictionary.msg_sem_resultados)
|
|
9408
10157
|
},
|
|
9409
10158
|
slot: "no-options"
|
|
9410
|
-
})])], 1)
|
|
9411
|
-
staticClass: "
|
|
10159
|
+
})])], 1), _vm._v(" "), _vm.selectedTemplate ? [_vm.selectedTemplate.components ? _c('div', {
|
|
10160
|
+
staticClass: "tg-component"
|
|
9412
10161
|
}, [_c('TemplateSingle', {
|
|
9413
10162
|
attrs: {
|
|
9414
10163
|
"template": _vm.selectedTemplate,
|
|
9415
10164
|
"hasButton": _vm.hasButton,
|
|
9416
10165
|
"iconButton": _vm.iconButton,
|
|
9417
|
-
"smartStyle": _vm.smartStyle,
|
|
9418
10166
|
"identifier": _vm.identifier,
|
|
9419
10167
|
"allVariables": _vm.allVariables,
|
|
9420
10168
|
"dictionary": _vm.dictionary
|
|
@@ -9426,10 +10174,9 @@ var __vue_render__ = function () {
|
|
|
9426
10174
|
}
|
|
9427
10175
|
}
|
|
9428
10176
|
})], 1) : _c('div', {
|
|
9429
|
-
staticClass: "
|
|
10177
|
+
staticClass: "tg-component"
|
|
9430
10178
|
}, [_c('TemplateMessage', {
|
|
9431
10179
|
attrs: {
|
|
9432
|
-
"smartStyle": _vm.smartStyle,
|
|
9433
10180
|
"hasButton": _vm.hasButton,
|
|
9434
10181
|
"iconButton": _vm.iconButton,
|
|
9435
10182
|
"dictionary": _vm.dictionary
|
|
@@ -9448,8 +10195,8 @@ var __vue_staticRenderFns__ = [];
|
|
|
9448
10195
|
|
|
9449
10196
|
const __vue_inject_styles__ = function (inject) {
|
|
9450
10197
|
if (!inject) return;
|
|
9451
|
-
inject("data-v-
|
|
9452
|
-
source: ".toasted svg{margin-right:10px}.d-none{display:none}ul{list-style-type:none}.
|
|
10198
|
+
inject("data-v-35a85f88_0", {
|
|
10199
|
+
source: "*{box-sizing:border-box}.toasted svg{margin-right:10px}.d-none{display:none}ul{list-style-type:none}h1,h2,h3,h4,p{margin:0;padding:0}.tg-container{width:100%;display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto}.tg-options{width:100%;display:flex}.tg-options.column{flex-direction:column}.tg-options h4{margin-right:5px}.tg-select{flex:1;height:34px;overflow:hidden}.tg-select .vs__dropdown-toggle{background-color:#fff;height:34px;overflow:hidden;display:flex;align-items:center}.tg-select .vs__selected-options{height:34px;overflow:hidden}.tg-select .vs__selected-options>span{white-space:nowrap;text-overflow:ellipsis;flex:1}.vs__dropdown-option{transition:background-color 150ms;white-space:normal}.vs__dropdown-option:nth-child(odd){background-color:#f1f1f1}.vs__dropdown-option--highlight,.vs__dropdown-option--selected,.vs__dropdown-option:active,.vs__dropdown-option:focus,.vs__dropdown-option:hover{background-color:#5897fb!important;color:#fff}.tg-component{width:100%}.ts-container{width:100%;display:flex;justify-content:space-between}.ts-content{--border-color:#CCC;--background-color:#DFF0D8;--input-background-color:#FFF;--input-border-default:#007BFF;--input-border-error:#E74C3C;--placeholder-color:#BBB;flex:2;font-size:.7rem;padding:10px 0}.ts-content footer,.ts-content header,.ts-content section{padding:3px 5px;background-color:var(--background-color)}.ts-content header,.ts-content section{border-right:1px solid var(--border-color);border-left:1px solid var(--border-color)}.ts-content header{border-top-left-radius:5px;border-top-right-radius:5px;border-top:1px solid var(--border-color)}.ts-content header{font-weight:550}.ts-content section{line-height:25px}.ts-content section.margin-bottom{border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-bottom:1px solid var(--border-color)}.ts-content footer{border:1px solid var(--border-color);border-top:unset;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.ts-content input{border:1px solid transparent;outline:0;font-size:.8rem;padding:2.5px 5px;background-color:var(--input-background-color)}.ts-content input::placeholder{color:var(--placeholder-color)}.ts-content input.active,.ts-content input:focus{border:1px solid var(--input-border-default)}.ts-content input.invalid{border:1px solid var(--input-border-error)!important}.ts-content__var{display:inline-block;position:relative}.ts-dropdown{margin:0;padding:0;position:absolute;top:19px;left:0;background:#eee;width:100%;z-index:1;transition:all 150ms;visibility:hidden;opacity:0;list-style-type:none;border:1px solid #444;border-top:unset}.ts-dropdown li{width:100%;opacity:.9;cursor:pointer;font-weight:550;padding:2px 5px;transition:background-color 150ms}.ts-dropdown li:focus,.ts-dropdown li:focus-within,.ts-dropdown li:hover{opacity:1;background-color:#555;color:#fff}.ts-dropdown.visible{visibility:visible;opacity:1}.tg-btn{width:40%;display:flex;justify-content:center;align-items:center}.tg-btn button{outline:unset;border:unset;display:block;min-width:180px;height:35px;padding:0 10px;font-weight:500;background-color:#007bff;color:#fff;transition-duration:.3s;user-select:none;cursor:pointer;box-shadow:inset 0 -2px rgba(0,0,0,.2);opacity:.9;border-radius:25px}.tg-btn button:hover{opacity:1}.tg-btn button: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)}.tg-btn button: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)}.tg-btn button:active,.tg-btn button:focus{outline:unset}.tg-btn.small-btn{width:auto;margin-left:5px}.tg-btn.small-btn button{min-width:35px;width:35px;padding:0;display:flex;justify-content:center;align-items:center}.tm-container{border:1px solid var(--border-color);border-radius:5px;display:flex}",
|
|
9453
10200
|
map: undefined,
|
|
9454
10201
|
media: undefined
|
|
9455
10202
|
});
|
|
@@ -9475,8 +10222,6 @@ const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
|
9475
10222
|
|
|
9476
10223
|
var __vue_component__$1 = __vue_component__;
|
|
9477
10224
|
|
|
9478
|
-
// import "/css/style.css";
|
|
9479
|
-
|
|
9480
10225
|
var components = /*#__PURE__*/Object.freeze({
|
|
9481
10226
|
__proto__: null,
|
|
9482
10227
|
TemplateGenerator: __vue_component__$1,
|