vue-intergrall-plugins 0.0.102 → 0.0.108

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,111 @@
1
+ <template>
2
+ <div class="skeleton-picker">
3
+ <div class="skeleton-options">
4
+ <div class="opt box-shadow ov__skeleton--animation"></div>
5
+ <div class="opt box-shadow ov__skeleton--animation"></div>
6
+ <div class="opt box-shadow ov__skeleton--animation"></div>
7
+ <div class="opt box-shadow ov__skeleton--animation"></div>
8
+ <div class="opt box-shadow ov__skeleton--animation"></div>
9
+ <div class="opt box-shadow ov__skeleton--animation"></div>
10
+ <div class="opt box-shadow ov__skeleton--animation"></div>
11
+ <div class="opt box-shadow ov__skeleton--animation"></div>
12
+ <div class="opt box-shadow ov__skeleton--animation"></div>
13
+ </div>
14
+ <div class="skeleton-input box-shadow ov__skeleton--animation"></div>
15
+ <div class="skeleton-label box-shadow ov__skeleton--animation"></div>
16
+ <div class="skeleton-list">
17
+ <div class="opt box-shadow ov__skeleton--animation"></div>
18
+ <div class="opt box-shadow ov__skeleton--animation"></div>
19
+ <div class="opt box-shadow ov__skeleton--animation"></div>
20
+ <div class="opt box-shadow ov__skeleton--animation"></div>
21
+ <div class="opt box-shadow ov__skeleton--animation"></div>
22
+ <div class="opt box-shadow ov__skeleton--animation"></div>
23
+ <div class="opt box-shadow ov__skeleton--animation"></div>
24
+ <div class="opt box-shadow ov__skeleton--animation"></div>
25
+ <div class="opt box-shadow ov__skeleton--animation"></div>
26
+ <div class="opt box-shadow ov__skeleton--animation"></div>
27
+ <div class="opt box-shadow ov__skeleton--animation"></div>
28
+ <div class="opt box-shadow ov__skeleton--animation"></div>
29
+ </div>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ export default {
35
+
36
+ }
37
+ </script>
38
+
39
+ <style>
40
+ .box-shadow {
41
+ -webkit-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
42
+ -moz-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
43
+ box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
44
+ }
45
+
46
+ .ov__skeleton--animation {
47
+ animation: skeleton-loading 1s linear infinite alternate;
48
+ }
49
+ @keyframes skeleton-loading {
50
+ 0% {
51
+ background-color: #F7F7F7;
52
+ }
53
+ 70% {
54
+ background-color: #EDEDED;
55
+ }
56
+ 100% {
57
+ background-color: #EDEDED;
58
+ }
59
+ }
60
+
61
+ .skeleton-picker {
62
+ position: absolute;
63
+ width: 100%;
64
+ height: 100%;
65
+ z-index: 91;
66
+ border-radius: 5px;
67
+ background-color: #FFF;
68
+ border: 1px solid #CCC;
69
+ }
70
+
71
+ .skeleton-options {
72
+ width: 100%;
73
+ height: 48px;
74
+ display: flex;
75
+ justify-content: space-between;
76
+ align-items: center;
77
+ padding: 0 15px;
78
+ border-bottom: 1px solid #CCC;
79
+ }
80
+ .skeleton-options .opt {
81
+ width: 25px;
82
+ height: 50%;
83
+ }
84
+
85
+ .skeleton-input {
86
+ width: calc(100% - 30px);
87
+ height: 25px;
88
+ margin: 7px 15px;
89
+ border-radius: 2.5px;
90
+ }
91
+
92
+ .skeleton-label {
93
+ margin: 15px 0;
94
+ width: 100%;
95
+ height: 30px;
96
+ }
97
+
98
+ .skeleton-list {
99
+ width: 100%;
100
+ padding-left: 7.5px;
101
+ display: flex;
102
+ align-items: center;
103
+ flex-wrap: wrap;
104
+ }
105
+
106
+ .skeleton-list .opt {
107
+ margin: 0 5px 15px 6px;
108
+ width: 25px;
109
+ height: 25px;
110
+ }
111
+ </style>
@@ -1,12 +1,13 @@
1
1
  <template>
2
2
  <div class="text-footer-container" :class="{'bigger' : cssStyle.height}" v-on-clickaway="away" v-if="textId" @drop.stop="dropFile" @dragenter.prevent @dragover.prevent>
3
3
  <div class="text-footer" :class="cssStyle.width ? cssStyle.width: ''" :style="`background-color: ${cssStyle.backgroundColor}`">
4
- <EmojisTextFooter
4
+ <BtnEmojis
5
5
  v-show="buttons.hasEmojis && !audioFile"
6
6
  :ref="`${this.textId}`"
7
7
  :emojiId="`${this.textId}`"
8
8
  :down="emojiSettings.openEmojisFrom == 'top' ? false : true"
9
9
  :small="emojiSettings.smallEmojis"
10
+ :biggerTextarea="cssStyle.height ? true : false"
10
11
  @insert-emoji="insertEmoji"
11
12
  />
12
13
  <transition name="fade">
@@ -42,7 +43,7 @@
42
43
  <fa-icon :icon="['fas', 'paper-plane']" />
43
44
  </span>
44
45
  </div>
45
- <div v-if="buttons.hasFiles || buttons.hasAudio" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
46
+ <div v-if="buttons.hasFiles || buttons.hasAudio || buttons.hasExpand" class="text-footer-actions" :class="{'outside-buttons' : cssStyle.outsideButtons && !audioFile}">
46
47
  <BtnMic
47
48
  v-show="buttons.hasAudio && !audioFile"
48
49
  :dictionary="dictionary"
@@ -62,6 +63,7 @@
62
63
  <BtnExpand
63
64
  v-show="buttons.hasExpand && !audioFile"
64
65
  @expand-textarea="$emit('expand-textarea')"
66
+ :dictionary="dictionary"
65
67
  />
66
68
  </div>
67
69
  </div>
@@ -73,7 +75,7 @@ import { setResizeListeners, resetTargets } from "@/services/autoResize"
73
75
  import { mixin as clickaway } from "vue-clickaway"
74
76
  import { returnMessageWithHexa } from "@/services/textFormatting"
75
77
 
76
- import EmojisTextFooter from "./EmojisTextFooter"
78
+ import BtnEmojis from "./BtnEmojis"
77
79
  import Loader from "../Loader/Loader"
78
80
  import RemainingCharacters from "./RemainingCharacters"
79
81
  import BtnMic from "./BtnMic"
@@ -81,7 +83,7 @@ import BtnFiles from "./BtnFiles"
81
83
  import BtnExpand from "./BtnExpand"
82
84
 
83
85
  export default {
84
- components: { EmojisTextFooter, Loader, BtnMic, BtnFiles, BtnExpand, RemainingCharacters },
86
+ components: { BtnEmojis, Loader, BtnMic, BtnFiles, BtnExpand, RemainingCharacters },
85
87
  mixins: [ clickaway ],
86
88
  props: {
87
89
  buttons: {
@@ -152,6 +154,8 @@ export default {
152
154
  mounted() {
153
155
  setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize")
154
156
 
157
+ console.log(this.buttons)
158
+
155
159
  // this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
156
160
  // this.$root.$on("toggle-msg-formatada", () => { this.toggleHSM() })
157
161
  // this.$root.$on("textarea-focus", () => { this.focusTextarea() })
@@ -176,13 +180,29 @@ export default {
176
180
  this.sendFinalMessage()
177
181
  },
178
182
  insertEmoji(emoji) {
179
- const textarea = document.querySelector(`#text-footer-${this.textId}`)
180
- if(textarea) {
181
- this.focusTextarea()
182
- const cursorStart = textarea.selectionStart
183
- const cursorEnd = textarea.selectionEnd
184
- this.message = this.message.slice(0, cursorStart) + emoji.native + this.message.slice(cursorEnd)
183
+ try {
184
+ const textarea = document.querySelector(`#text-footer-${this.textId}`)
185
+ console.log("emoji: ", emoji)
186
+ console.log(textarea)
187
+ if (document.activeElement === textarea) {
188
+ const cursorStart = textarea.selectionStart
189
+ const cursorEnd = textarea.selectionEnd
190
+ if (cursorEnd == textarea.value.length) {
191
+ this.message += emoji.finalEmoji
192
+ textarea.setSelectionRange(textarea.value.length, textarea.value.length);
193
+ } else {
194
+ const initValue = textarea.value.slice(0, cursorStart) + emoji.finalEmoji;
195
+ const endValue = textarea.value.slice(cursorEnd)
196
+ this.message = initValue + endValue
197
+ textarea.setSelectionRange(initValue.length, initValue.length);
198
+ }
199
+ } else {
200
+ this.message += emoji.finalEmoji
201
+ }
185
202
  this.sendFinalMessage()
203
+ }catch(e) {
204
+ console.error("Erro ao inserir emoji")
205
+ console.error(e)
186
206
  }
187
207
  },
188
208
  verifyMessage() {
@@ -660,12 +680,6 @@ ul {
660
680
  .vs__dropdown-menu {
661
681
  font-size: 0.85rem !important; }
662
682
 
663
- .emoji-text-container {
664
- position: relative; }
665
- .emoji-text-container .emoji-text-btn {
666
- font-size: 1.2rem;
667
- cursor: pointer; }
668
-
669
683
  .emoji-mart-anchor, .emoji-mart-emoji span {
670
684
  cursor: pointer !important; }
671
685
 
@@ -212,6 +212,7 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
212
212
 
213
213
  .tg-container {
214
214
  width: 100%;
215
+ max-width: 800px;
215
216
  display: flex;
216
217
  flex-direction: column;
217
218
  overflow-x: hidden;
@@ -250,6 +251,9 @@ h1, h2, h3, h4, p { margin: 0; padding: 0 }
250
251
  text-overflow: ellipsis;
251
252
  flex: 1;
252
253
  }
254
+ .tg-select .vs__selected-options > input {
255
+ flex-grow: 0;
256
+ }
253
257
 
254
258
  .vs__dropdown-option {
255
259
  transition: background-color 150ms;
@@ -1,116 +0,0 @@
1
- <template>
2
- <div class="emoji-text-container" v-on-clickaway="away">
3
- <div
4
- class="emoji-text-btn"
5
- @click="toggleEmojiSelection()"
6
- v-text="String.fromCodePoint(0x1f61c)"
7
- >
8
- </div>
9
- <picker
10
- v-show="showEmojis"
11
- :showPreview="false"
12
- :skin="1"
13
- :native="true"
14
- :enableFrequentEmojiSort="true"
15
- :i18n="emojiTexts"
16
- :include="['recent', 'people', 'nature', 'foods', 'activity', 'places', 'objects']"
17
- :perLine="7"
18
- :title="'Smart Channel Emojis'"
19
- :ref="emojiId"
20
- :emojiTooltip="true"
21
- @select="addEmoji" />
22
- </div>
23
- </template>
24
-
25
- <script>
26
-
27
- import { Picker } from 'emoji-mart-vue'
28
- import { mixin as clickaway } from 'vue-clickaway'
29
-
30
- export default {
31
- components: {
32
- "picker" : Picker
33
- },
34
- mixins: [ clickaway ],
35
- props: {
36
- emojiId: {
37
- type: String,
38
- required: true
39
- },
40
- small: {
41
- type: Boolean,
42
- default: false,
43
- required: false
44
- },
45
- up: {
46
- type: Boolean,
47
- default: true,
48
- required: false
49
- },
50
- down: {
51
- type: Boolean,
52
- default: false,
53
- required: false
54
- },
55
- left: {
56
- type: Boolean,
57
- default: true,
58
- required: false
59
- }
60
- },
61
- computed: {
62
- height() {
63
- if(this.small) return 225
64
- return 325
65
- },
66
- top() {
67
- if(!this.down) return -(this.height + 5)
68
- return 40
69
- }
70
- },
71
- data(){
72
- return{
73
- showEmojis: false,
74
- emojiTexts: {
75
- search: "Pesquisar",
76
- notfound: "Nenhum emoji encontrado",
77
- categories: {
78
- search: "Resultados da pesquisa",
79
- recent: "Recentes",
80
- people: "Pessoas & Expressoes",
81
- nature: "Animais & Natureza",
82
- foods: "Comidas & Bebibas",
83
- activity: "Atividades",
84
- places: "Viagens & Lugares",
85
- objects: "Objetos"
86
- }
87
- }
88
- }
89
- },
90
- created() {
91
- this.$root.$refs[`etf-${this.emojiId}`] = this
92
- },
93
- mounted() {
94
- this.setPosition()
95
- },
96
- methods: {
97
- setPosition() {
98
- if(this.$refs[this.emojiId] && this.$refs[this.emojiId].$el){
99
- this.$refs[this.emojiId].$el.style.position = "absolute"
100
- this.$refs[this.emojiId].$el.style.top = `${this.top}px`
101
- this.left ? this.$refs[this.emojiId].$el.style.left = "0" : this.$refs[this.emojiId].$el.style.right = "0"
102
- this.$refs[this.emojiId].$el.style.height = `${this.height}px`
103
- }
104
- },
105
- addEmoji(emoji){
106
- this.$emit("insert-emoji", emoji)
107
- },
108
- toggleEmojiSelection() {
109
- this.showEmojis = !this.showEmojis
110
- },
111
- away() {
112
- this.showEmojis = false
113
- }
114
- }
115
- }
116
- </script>