vue-intergrall-plugins 0.0.138 → 0.0.142

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.
@@ -0,0 +1,213 @@
1
+ <template>
2
+ <span class="file-item">
3
+ <transition-group name="fade" mode="out-in" class="file-item-transition">
4
+ <div v-if="loading" :small="true" key="card-file-loader" class="req-loader slow"></div>
5
+ <template v-else>
6
+ <span v-if="imageUrl" class="file-img box-shadow" @click="openFile(imageUrl, true)" key="card-file-img" :title="fileName">
7
+ <img :src="`${imageUrl}`" :alt="fileName" />
8
+ </span>
9
+ <span
10
+ v-else
11
+ class="file-icon"
12
+ key="card-file-doc"
13
+ :class="[currentClass]"
14
+ @click="openFile(docUrl, false)"
15
+ :title="fileName"
16
+ target="_blank"
17
+ rel="noreferrer noopener"
18
+ >
19
+ <fa-icon :icon="icon" />
20
+ </span>
21
+ <a :href="imageUrl ? imageUrl : docUrl" :download="`${fileName}`" target="_blank" rel="noreferrer noopener" key="card-file-download-icon" :title="`Download ${fileName}`">
22
+ <fa-icon :icon="['fas', 'download']" />
23
+ </a>
24
+ </template>
25
+ </transition-group>
26
+ </span>
27
+ </template>
28
+
29
+ <style scoped>
30
+ .fade-enter-active, .fade-leave-active {
31
+ transition: opacity .5s;
32
+ }
33
+ .fade-enter, .fade-leave-to {
34
+ opacity: 0;
35
+ }
36
+ </style>
37
+
38
+ <script>
39
+ import { gerarVariaveisAnexo } from "../../services/formatMessage"
40
+
41
+ export default {
42
+ props: {
43
+ file: {
44
+ type: Object,
45
+ required: true
46
+ },
47
+ dictionary: {
48
+ type: Object,
49
+ required: true
50
+ },
51
+ domain: {
52
+ type: String,
53
+ required: true
54
+ }
55
+ },
56
+ computed: {
57
+ currentClass() {
58
+ return this.fileExt === "pdf" ? "pdf" : "doc"
59
+ }
60
+ },
61
+ data() {
62
+ return {
63
+ loading: true,
64
+ isAnexo: false,
65
+ imageUrl: "",
66
+ fileExt: "",
67
+ docUrl: "",
68
+ fileName: "",
69
+ audio: false,
70
+ video: false,
71
+ icon: []
72
+ }
73
+ },
74
+ mounted() {
75
+ this.setFileVars()
76
+ },
77
+ methods: {
78
+ setFileVars() {
79
+ try {
80
+ const {
81
+ anexo,
82
+ imgAnexo,
83
+ tipoDoc,
84
+ docAnexo,
85
+ nomeArquivo,
86
+ audio,
87
+ video
88
+ } = gerarVariaveisAnexo(this.file, { dominio: this.domain });
89
+
90
+ this.isAnexo = anexo;
91
+ this.imageUrl = imgAnexo;
92
+ this.fileExt = tipoDoc;
93
+ this.docUrl = docAnexo;
94
+ this.fileName = nomeArquivo;
95
+ this.audio = audio;
96
+ this.video = video;
97
+
98
+ this.generateIcon();
99
+
100
+ this.loading = false;
101
+ }catch(e) {
102
+ console.error("Erro ao gerar as variaveis dos anexos")
103
+ console.error(e)
104
+ }
105
+ },
106
+ generateIcon() {
107
+ this.icon = this.fileExt === "pdf" ? ['fas', 'file-pdf'] : ['fas', 'file-alt']
108
+ },
109
+ openFile(link, isImg) {
110
+ const width = window.innerWidth
111
+ const height = window.innerHeight
112
+ const options = !isImg ? `width=${width},height=${height}` : "width=auto,height=auto"
113
+ window.open(link, "card-file", options)
114
+ }
115
+ }
116
+ }
117
+ </script>
118
+
119
+ <style>
120
+ .file-item {
121
+ width: 100%;
122
+ height: 100%;
123
+ display: flex;
124
+ justify-content: center;
125
+ align-items: center;
126
+ position: relative;
127
+ }
128
+ .file-item-transition {
129
+ max-width: 100%;
130
+ max-height: 100%;
131
+ display: flex;
132
+ justify-content: center;
133
+ align-items: center;
134
+ position: relative;
135
+ }
136
+ .file-item .req-loader {
137
+ position: absolute;
138
+ top: calc(50% - 12.5px);
139
+ right: calc(50% - 12.5px);
140
+ }
141
+ .file-item-transition img {
142
+ max-width: 45px;
143
+ max-height: 45px;
144
+ }
145
+ .file-item a {
146
+ margin-left: 5px;
147
+ text-decoration: none;
148
+ color: #333;
149
+ }
150
+
151
+ .file-icon {
152
+ display: flex;
153
+ justify-content: center;
154
+ align-items: center;
155
+ font-size: 30px;
156
+ cursor: pointer;
157
+ }
158
+ .file-icon:hover {
159
+ opacity: 1
160
+ }
161
+ .file-icon:visited {
162
+ color: inherit;
163
+ }
164
+ svg {
165
+ font-size: 30px;
166
+ z-index: 1;
167
+ }
168
+ .file-icon.pdf {
169
+ position: relative;
170
+ }
171
+ .file-icon.pdf svg {
172
+ color: rgb(231, 76, 60);
173
+ }
174
+ .file-icon.pdf::after {
175
+ content: "";
176
+ position: absolute;
177
+ bottom: 2px;
178
+ transform: translateY(2px);
179
+ width: 20px;
180
+ height: 20px;
181
+ background-color: #FFF;
182
+ }
183
+ .file-icon.doc {
184
+ color: #15517F;
185
+ }
186
+ .file-icon.doc::after {
187
+ content: "";
188
+ position: absolute;
189
+ width: 20px;
190
+ height: 20px;
191
+ background-color: #FFF;
192
+ }
193
+ .file-img {
194
+ display: flex;
195
+ justify-content: center;
196
+ align-items: center;
197
+ width: 100%;
198
+ height: 100%;
199
+ overflow: hidden;
200
+ background-color: rgba(0, 0, 0, .2);
201
+ border-radius: 2.5px;
202
+ cursor: pointer;
203
+ opacity: .9;
204
+ transition: opacity 150ms;
205
+ }
206
+
207
+ .file-img:hover {
208
+ opacity: 1;
209
+ }
210
+ .file-img img {
211
+ width: 95%;
212
+ }
213
+ </style>
@@ -30,7 +30,10 @@
30
30
  />
31
31
  <span class="horario-envio" v-text="horario"></span>
32
32
  <transition name="fade" mode="out-in">
33
- <span class="reply" v-if="hasReply && (status == 'C' || status == 'T')" v-tippy :content="msgReply ? msgReply : 'Fazer reenvio da mensagem'" @click="$emit('replyMsg')"> <fa-icon :icon="['fas', 'reply']" /> </span>
33
+ <span :class="reply" v-if="hasReply && (status == 'C' || status == 'T')" v-tippy :content="msgReply ? msgReply : 'Fazer reenvio da mensagem'" @click="$emit('replyMsg')"> <fa-icon :icon="['fas', 'reply']" /> </span>
34
+ </transition>
35
+ <transition name="fade" mode="out-in">
36
+ <span class="star dourado" v-if="iniDialogo == 1" :content="contentTooltipStar" v-tippy key="star-padrao"> <fa-icon :icon="['fas', 'star']" /> </span>
34
37
  </transition>
35
38
  <transition name="fade" mode="out-in">
36
39
  <span class="check" v-if="status == 'D'" :content="contentTooltip" v-tippy key="check-padrao"> <fa-icon :icon="['fas', 'check']" /> </span>
@@ -50,14 +53,16 @@
50
53
  <script>
51
54
  import AnexoMensagem from "./AnexoMensagem"
52
55
  import InteratividadeBotoes from "./InteratividadeBotoes"
56
+ import { formataTimezoneData } from "../../services/textFormatting"
53
57
 
54
58
  export default {
55
59
  components: { AnexoMensagem, InteratividadeBotoes },
56
- props: ["smartchannel", "messageIndex", "dictionary", "autor", "origem", "msg", "link", "anexo", "imgAnexo", "tipoDoc", "docAnexo", "nomeArquivo", "audio", "video", "horario", "status", "logo", "msgTooltip", "seq", "mapa", "histMsg", "erro", "msgErro", "origemExterna", "anexos", "dominio", "corMsg", "interatividade", "msgReply", "hasReply"],
60
+ props: ["smartchannel", "messageIndex", "dictionary", "autor", "origem", "msg", "link", "anexo", "imgAnexo", "tipoDoc", "docAnexo", "nomeArquivo", "audio", "video", "horario", "status", "logo", "msgTooltip", "seq", "mapa", "histMsg", "erro", "msgErro", "origemExterna", "anexos", "dominio", "corMsg", "interatividade", "msgReply", "hasReply", "iniDialogo", "dialogoId", "dialogoOrigem", "expSessao"],
57
61
  data(){
58
62
  return{
59
63
  strTooltipAux: "",
60
64
  linkAux: "",
65
+ reply: "reply",
61
66
  center: {},
62
67
  marker: {},
63
68
  infos: [],
@@ -97,13 +102,30 @@ export default {
97
102
  set(msg){
98
103
  return this.contentTooltip = msg
99
104
  }
105
+ },
106
+ contentTooltipStar() {
107
+ let tooltipStar = "";
108
+ if(this.iniDialogo == 1){
109
+ tooltipStar += this.dictionary['ini_sessao']+"<br/>"
110
+ tooltipStar += this.dictionary['id_conversa']+" - "+this.dialogoId+"<br/>"
111
+ tooltipStar += this.dictionary['origem_conversa']+" - "+this.dialogoOrigem+"<br/>"
112
+ tooltipStar += this.dictionary['expiracao_sessao']+" - "+formataTimezoneData(this.expSessao)+"<br/>"
113
+ return tooltipStar
114
+ }
115
+ return tooltipStar
100
116
  }
101
117
  },
102
118
  mounted() {
103
119
  if(this.mapa) this.setMap()
104
120
  if(this.corMsg) this.setCorMsg()
121
+ this.setClasses()
105
122
  },
106
123
  methods: {
124
+ setClasses(){
125
+ if(this.hasReply && (this.status == "C" || this.status == "T") && this.iniDialogo == 0){
126
+ this.reply = "reply reply-with-2-icons"
127
+ }
128
+ },
107
129
  setCorMsg() {
108
130
  try {
109
131
  const root = document.documentElement
@@ -201,7 +223,7 @@ export default {
201
223
  .reply {
202
224
  cursor: pointer;
203
225
  position: absolute;
204
- right: 30px;
226
+ right: 53px;
205
227
  bottom: 5px;
206
228
  font-size: .6rem;
207
229
  color: #67a332;
@@ -217,6 +239,9 @@ export default {
217
239
  margin-top: -1px;
218
240
  margin-right: -1px;
219
241
  }
242
+ .reply-with-2-icons{
243
+ right: 30px;
244
+ }
220
245
 
221
246
  .check{
222
247
  cursor: pointer;
@@ -240,7 +265,16 @@ export default {
240
265
  .check.preto, .check.preto svg{
241
266
  color: #666
242
267
  }
243
-
268
+ .star{
269
+ cursor: pointer;
270
+ position: absolute;
271
+ right: 30px;
272
+ bottom: 3px;
273
+ font-size: 0.7rem;
274
+ }
275
+ .star.dourado svg{
276
+ color: gold
277
+ }
244
278
  .horario-envio {
245
279
  margin-right: 15px;
246
280
  font-size: 0.7rem;