vue-intergrall-plugins 0.0.235 → 0.0.238

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.235",
3
+ "version": "0.0.238",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -7,7 +7,7 @@
7
7
  </transition> -->
8
8
  <fa-icon :icon="['fas', 'paperclip']" :title="dictionary.title_selecionar_anexo" />
9
9
  <transition name="fade">
10
- <span v-if="fileSize > 0" @click.stop="toggleFilePreview" v-tippy :content="dictionary.msg_abrir_anexos" :class="`${fileSettings.filePreviewStyle == 2 ? 'files-counter-2' : 'files-counter'}`">
10
+ <span v-if="fileSize > 0" @click.stop="toggleFilePreview" v-tippy :content="!fileSettings.handleFilePreview ? dictionary.msg_abrir_anexos : `${file.length} anexo(s) selecionado(s)`" :class="`${fileSettings.filePreviewStyle == 2 ? 'files-counter-2' : 'files-counter'}`">
11
11
  <template v-if="fileSettings.filePreviewStyle == 1">
12
12
  {{ fileSize }}
13
13
  </template>
@@ -266,6 +266,19 @@ export default {
266
266
  const isStackable = this.fileSettings.stackFiles && this.fileSettings.multiple
267
267
  this.file = filesAux.length ? isStackable ? this.file.concat(...filesAux) : filesAux : this.file
268
268
  if(!this.file.length) return
269
+
270
+ let sizeInBytes = 0
271
+ Array.from(this.file).forEach(file => sizeInBytes += file.size)
272
+ const sizeInMb = parseFloat((sizeInBytes / (1024*1024)).toFixed(2))
273
+ if(sizeInMb == 0) {
274
+ this.file = []
275
+ return this.$toasted.global.defaultInfo({ msg: this.dictionary.msg_arquivo_invalido })
276
+ }
277
+ if(sizeInMb >= 9.5) {
278
+ this.file = []
279
+ return this.$toasted.global.defaultInfo({ msg: `Limite de 9.5 MB por arquivo` })
280
+ }
281
+
269
282
  if(this.file.length > this.fileSettings.max) {
270
283
  this.file = []
271
284
  return this.$toasted.global.defaultInfo({ msg: `Limite de ${this.fileSettings.max} arquivos` })
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div class="text-footer-actions--btn" @click="$emit('toggle-standard-messages')" :title="dictionary.title_screen_share">
3
+ <fa-icon :icon="['fas', 'desktop']" />
4
+ <fa-icon :icon="['fas', 'share']" />
5
+ </div>
6
+ </template>
7
+
8
+ <style scoped>
9
+ .text-footer-actions--btn {
10
+ position: relative;
11
+ }
12
+ .text-footer-actions--btn > svg:nth-child(1) {
13
+ font-size: 1.2rem;
14
+ }
15
+ .text-footer-actions--btn > svg:nth-child(2) {
16
+ font-size: .6rem;
17
+ position: absolute;
18
+ transform: translateY(-2px)
19
+ }
20
+ </style>
21
+
22
+ <script>
23
+ export default {
24
+ props: {
25
+ dictionary: {
26
+ type: Object,
27
+ default: {},
28
+ required: false
29
+ }
30
+ }
31
+ }
32
+ </script>
@@ -38,12 +38,13 @@
38
38
  :message="message"
39
39
  :maxCharacters="textareaSettings.maxCharacters"
40
40
  />
41
- <div class="text-footer-actions" v-if="buttons.hasSendButton">
42
- <span class="text-footer-actions--btn" :title="dictionary.title_enviar_msg" @click="sendMessageHandler">
43
- <fa-icon :icon="['fas', 'paper-plane']" />
44
- </span>
45
- </div>
46
- <div v-if="buttons.hasFiles || buttons.hasAudio || buttons.hasExpand || formattedMessageSettings.hasStandardMessages" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
41
+ <div v-if="buttons.hasFiles || buttons.hasAudio || buttons.hasExpand || formattedMessageSettings.hasStandardMessages || buttons.hasScreenShare" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
42
+ <BtnScreenShare
43
+ v-show="buttons.hasScreenShare && !audioFile"
44
+ @handle-screen-share="handleScreenShare"
45
+ :dictionary="dictionary"
46
+ :ref="`${textId}-screen-share`"
47
+ />
47
48
  <BtnMic
48
49
  v-show="buttons.hasAudio && !audioFile"
49
50
  :dictionary="dictionary"
@@ -79,6 +80,11 @@
79
80
  :dictionary="dictionary"
80
81
  />
81
82
  </div>
83
+ <div class="text-footer-actions" v-if="buttons.hasSendButton">
84
+ <span class="text-footer-actions--btn" :title="dictionary.title_enviar_msg" @click="sendMessageHandler">
85
+ <fa-icon :icon="['fas', 'paper-plane']" />
86
+ </span>
87
+ </div>
82
88
  </div>
83
89
  <transition name="fade">
84
90
  <StandardMessages
@@ -116,14 +122,15 @@ import BtnFiles from "./BtnFiles"
116
122
  import BtnExpand from "./BtnExpand"
117
123
  import BtnStandardMessages from "./BtnStandardMessages"
118
124
  import StandardMessages from "./StandardMessages"
125
+ import BtnScreenShare from "./BtnScreenShare"
119
126
 
120
127
  export default {
121
- components: { BtnEmojis, Loader, BtnMic, BtnFiles, BtnExpand, RemainingCharacters, BtnStandardMessages, StandardMessages },
128
+ components: { BtnEmojis, Loader, BtnMic, BtnFiles, BtnExpand, RemainingCharacters, BtnStandardMessages, StandardMessages, BtnScreenShare },
122
129
  mixins: [ clickaway ],
123
130
  props: {
124
131
  buttons: {
125
132
  type: Object,
126
- default: () => { return { hasEmojis: false, hasSendButton: false, hasFiles: false, hasAudio: false, hasExpand: false } },
133
+ default: () => { return { hasEmojis: false, hasSendButton: false, hasFiles: false, hasAudio: false, hasExpand: false, hasScreenShare: false } },
127
134
  required: false
128
135
  },
129
136
  cssStyle: {
@@ -441,7 +448,7 @@ export default {
441
448
  try {
442
449
  e.stopPropagation()
443
450
  e.preventDefault()
444
- if(!this.buttons.hasFiles) return false
451
+ if(!this.buttons.hasFiles || this.fileSettings.handleFileClick) return false
445
452
  const files = e.dataTransfer.files.length ? e.dataTransfer.files : ""
446
453
  this.filesHandler(files)
447
454
  }catch(e) {
@@ -463,6 +470,9 @@ export default {
463
470
  console.error(e)
464
471
  }
465
472
  },
473
+ handleScreenShare() {
474
+ this.$emit("handle-screen-share")
475
+ },
466
476
  toggleStandardMessages() {
467
477
  this.showStandardMessages = !this.showStandardMessages
468
478
  },