vue-wiguet-chatweb 0.1.23 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/App.vue.d.ts +2 -0
- package/dist/components/Chat.vue.d.ts +17 -6
- package/dist/components/ChatMessage.vue.d.ts +12 -0
- package/dist/components/DangerIcon.vue.d.ts +1 -1
- package/dist/components/IconAttach.vue.d.ts +2 -0
- package/dist/components/IconChat.vue.d.ts +1 -1
- package/dist/components/IconClose.vue.d.ts +1 -1
- package/dist/components/IconSend.vue.d.ts +1 -1
- package/dist/components/IconTelegram.vue.d.ts +1 -1
- package/dist/components/IconWhatsApp.vue.d.ts +1 -1
- package/dist/components/IconWidget.vue.d.ts +1 -1
- package/dist/components/Loader.vue.d.ts +1 -1
- package/dist/components/MessageList.vue.d.ts +14 -6
- package/dist/components/ODialog/IPropsDialog.d.ts +3 -0
- package/dist/components/ODialog/IPropsSidebar.d.ts +5 -0
- package/dist/components/ODialog/ODialog.vue.d.ts +22 -0
- package/dist/components/Widget.vue.d.ts +10 -6
- package/dist/dto/app.dto.d.ts +9 -1
- package/dist/hooks/useMobile.d.ts +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/store/config.d.ts +1 -1
- package/dist/store/index.d.ts +1 -4
- package/dist/style.css +1 -1
- package/dist/vue-wiguet-chatweb.js +3379 -2759
- package/dist/vue-wiguet-chatweb.umd.cjs +17 -7
- package/package.json +8 -6
- package/src/components/Chat.vue +157 -53
- package/src/components/IconAttach.vue +24 -0
- package/src/components/IconSend.vue +1 -1
- package/src/components/LoadingComponent.vue +111 -0
- package/src/components/MessageList.vue +14 -30
- package/src/components/ODialog/IPropsDialog.ts +4 -0
- package/src/components/ODialog/IPropsSidebar.ts +13 -0
- package/src/components/ODialog/ODialog.vue +85 -0
- package/src/components/Widget.vue +19 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vue-wiguet-chatweb",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.25",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -34,9 +34,11 @@
|
|
34
34
|
"prepack": "npm run build"
|
35
35
|
},
|
36
36
|
"peerDependencies": {
|
37
|
+
"@primevue/themes": "^4.2.5",
|
37
38
|
"@vueuse/core": "^10.0.0",
|
38
39
|
"axios": "^1.4.0",
|
39
40
|
"luxon": "^3.0.0",
|
41
|
+
"primevue": "^4.2.5",
|
40
42
|
"socket.io-client": "^4.7.2",
|
41
43
|
"uuid": "^9.0.1",
|
42
44
|
"vue": "^3.2.0"
|
@@ -46,12 +48,10 @@
|
|
46
48
|
"axios": "^1.4.0",
|
47
49
|
"luxon": "^3.0.0",
|
48
50
|
"socket.io-client": "^4.7.2",
|
49
|
-
"uuid": "^9.0.1"
|
50
|
-
"vite-plugin-dts": "^3.4.0",
|
51
|
-
"vue": "^3.2.0",
|
52
|
-
"vue-rabbit-frontend": "^0.0.15"
|
51
|
+
"uuid": "^9.0.1"
|
53
52
|
},
|
54
53
|
"devDependencies": {
|
54
|
+
"@primevue/auto-import-resolver": "^4.2.5",
|
55
55
|
"@types/luxon": "^3.4.2",
|
56
56
|
"@types/node": "^20.4.6",
|
57
57
|
"@types/uuid": "^10.0.0",
|
@@ -59,9 +59,11 @@
|
|
59
59
|
"@vitest/coverage-v8": "^2.1.8",
|
60
60
|
"@vue/test-utils": "^2.4.6",
|
61
61
|
"jsdom": "^25.0.1",
|
62
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
62
63
|
"typescript": "^5.0.2",
|
63
64
|
"vite": "^5.4.11",
|
65
|
+
"vite-plugin-dts": "^4.5.0",
|
64
66
|
"vitest": "^2.1.8",
|
65
|
-
"vue-tsc": "^
|
67
|
+
"vue-tsc": "^2.2.0"
|
66
68
|
}
|
67
69
|
}
|
package/src/components/Chat.vue
CHANGED
@@ -17,6 +17,12 @@
|
|
17
17
|
@loadMore="getMessages"
|
18
18
|
@retry="retryMessage"
|
19
19
|
@on-qualifying="(args) => onQualifying(args)"
|
20
|
+
@see="(message: Message) => {
|
21
|
+
currentDialogView = DIALOG_VIEWS.SEE
|
22
|
+
urlFileMessage = message.urlFile
|
23
|
+
dialog.title = 'Imagen'
|
24
|
+
dialog.modelValue = true
|
25
|
+
}"
|
20
26
|
/>
|
21
27
|
<div class="fit" v-else>
|
22
28
|
<span class="center">No tienes mensajes</span>
|
@@ -24,7 +30,7 @@
|
|
24
30
|
</div>
|
25
31
|
|
26
32
|
<div class="w-full">
|
27
|
-
<form v-if="!isDisabledBoxMessage" class="message-send" @submit.prevent="(event) => submitMessage(
|
33
|
+
<form v-if="!isDisabledBoxMessage" class="message-send" @submit.prevent="(event) => submitMessage()">
|
28
34
|
<div class="form-message">
|
29
35
|
<div class="jl-inputgroup-chat">
|
30
36
|
<textarea
|
@@ -36,12 +42,36 @@
|
|
36
42
|
@input="() => autoAdjustHeight()"
|
37
43
|
@keydown.enter="
|
38
44
|
(event) => {
|
39
|
-
!
|
45
|
+
!isMobile && event.preventDefault();
|
40
46
|
}
|
41
47
|
"
|
42
48
|
@keyup.enter="saltoDeLineaOEnviar"
|
43
49
|
/>
|
44
50
|
|
51
|
+
<input
|
52
|
+
type="file"
|
53
|
+
ref="fileInputRef"
|
54
|
+
@change="onFileSelect"
|
55
|
+
accept="image/*"
|
56
|
+
style="display: none;"
|
57
|
+
key="fileInputKey"
|
58
|
+
|
59
|
+
/>
|
60
|
+
<button
|
61
|
+
type="button"
|
62
|
+
class="pointer btn-primary"
|
63
|
+
title="Adjuntar archivo"
|
64
|
+
@click="
|
65
|
+
() => {
|
66
|
+
fileInputRef.value = '';
|
67
|
+
fileInputKey++;
|
68
|
+
fileInputRef?.click();
|
69
|
+
}
|
70
|
+
"
|
71
|
+
>
|
72
|
+
<IconAttach style="width: 20px; height: 20px" />
|
73
|
+
</button>
|
74
|
+
|
45
75
|
<button type="submit" class="pointer btn-primary">
|
46
76
|
<IconSend style="width: 20px; height: 20px" />
|
47
77
|
</button>
|
@@ -53,6 +83,51 @@
|
|
53
83
|
</span>
|
54
84
|
</div>
|
55
85
|
</div>
|
86
|
+
|
87
|
+
<ODialog v-bind="dialog">
|
88
|
+
<div v-if="currentDialogView === DIALOG_VIEWS.UPLOAD" class="flex flex-col gap-3 justify-center items-center">
|
89
|
+
<img v-for="(urlFile, i) in urlFiles" :key="i" :src="urlFile.toString()" alt="Image" width="400" />
|
90
|
+
|
91
|
+
<form
|
92
|
+
class="message-send"
|
93
|
+
@submit.prevent="
|
94
|
+
(event) => {
|
95
|
+
submitMessage();
|
96
|
+
dialog.modelValue = false;
|
97
|
+
}
|
98
|
+
"
|
99
|
+
>
|
100
|
+
<div class="form-message">
|
101
|
+
<div class="jl-inputgroup-chat">
|
102
|
+
<textarea
|
103
|
+
v-model="message"
|
104
|
+
autofocus
|
105
|
+
class="jl2-input-chat"
|
106
|
+
placeholder="Escribe tu mensaje"
|
107
|
+
ref="textAreaRef"
|
108
|
+
@input="() => autoAdjustHeight()"
|
109
|
+
@keydown.enter="
|
110
|
+
(event) => {
|
111
|
+
!isMobile && event.preventDefault();
|
112
|
+
}
|
113
|
+
"
|
114
|
+
@keyup.enter="(event)=>{
|
115
|
+
saltoDeLineaOEnviar(event, MESSAGE_TYPE_CODES.IMAGEN)
|
116
|
+
dialog.modelValue = false;
|
117
|
+
}"
|
118
|
+
/>
|
119
|
+
|
120
|
+
<button type="submit" class="pointer btn-primary">
|
121
|
+
<IconSend style="width: 20px; height: 20px" />
|
122
|
+
</button>
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
</form>
|
126
|
+
</div>
|
127
|
+
<div v-else>
|
128
|
+
<img v-if="urlFileMessage" :src="urlFileMessage" alt="Image" style="width: 55vw;" />
|
129
|
+
</div>
|
130
|
+
</ODialog>
|
56
131
|
</template>
|
57
132
|
|
58
133
|
<script setup lang="ts">
|
@@ -63,7 +138,7 @@ import {
|
|
63
138
|
PropType,
|
64
139
|
watch,
|
65
140
|
onUnmounted,
|
66
|
-
|
141
|
+
reactive,
|
67
142
|
} from "vue";
|
68
143
|
import { v4 as uuidv4 } from "uuid";
|
69
144
|
|
@@ -87,11 +162,24 @@ import Loader from "./Loader.vue";
|
|
87
162
|
import { searchFromLast } from "../resources/functions.helpers";
|
88
163
|
import { io, Socket } from "socket.io-client";
|
89
164
|
import { APP_TYPE } from "../dto/chat.dto";
|
90
|
-
import { MESSAGE_TYPE_CODES } from "../resources/constants/message-type.constant";
|
165
|
+
import { MESSAGE_TYPE_CODES, TypeMessageTypeCodes } from "../resources/constants/message-type.constant";
|
166
|
+
import { useMobile } from "../hooks/useMobile";
|
167
|
+
import IconAttach from "./IconAttach.vue";
|
168
|
+
import ODialog from "./ODialog/ODialog.vue";
|
169
|
+
import { IPropsDialog } from "./ODialog/IPropsDialog";
|
170
|
+
|
171
|
+
const enum DIALOG_VIEWS {
|
172
|
+
UPLOAD,
|
173
|
+
SEE
|
174
|
+
}
|
91
175
|
|
92
176
|
//DATA
|
93
177
|
const message = ref("");
|
94
178
|
const notViewed = ref(0);
|
179
|
+
const fileInputRef = ref();
|
180
|
+
const fileInputKey = ref(0);
|
181
|
+
const currentDialogView = ref(DIALOG_VIEWS.SEE)
|
182
|
+
const urlFileMessage = ref<string>()
|
95
183
|
|
96
184
|
const messagesData = ref<{ data: Message[]; canLoadMoreMessages: boolean }>({
|
97
185
|
data: [],
|
@@ -152,8 +240,8 @@ watch(
|
|
152
240
|
}
|
153
241
|
);
|
154
242
|
|
155
|
-
function saltoDeLineaOEnviar(event: KeyboardEvent) {
|
156
|
-
if(
|
243
|
+
function saltoDeLineaOEnviar(event: KeyboardEvent, messageTypeCode?: TypeMessageTypeCodes) {
|
244
|
+
if(isMobile.value) {
|
157
245
|
autoAdjustHeight();
|
158
246
|
return;
|
159
247
|
}
|
@@ -165,10 +253,10 @@ function saltoDeLineaOEnviar(event: KeyboardEvent) {
|
|
165
253
|
return;
|
166
254
|
}
|
167
255
|
|
168
|
-
submitMessage(
|
256
|
+
submitMessage({ codigoTipoMensaje: messageTypeCode });
|
169
257
|
}
|
170
258
|
|
171
|
-
function createMessage(message: string) {
|
259
|
+
function createMessage(message: string, codigoTipoMensaje?: TypeMessageTypeCodes) {
|
172
260
|
if (message?.length > 300) {
|
173
261
|
emit("show-toast", {
|
174
262
|
severity: "warn",
|
@@ -179,7 +267,7 @@ function createMessage(message: string) {
|
|
179
267
|
return;
|
180
268
|
}
|
181
269
|
|
182
|
-
if (!message.trim()) {
|
270
|
+
if (!message.trim() && codigoTipoMensaje !== MESSAGE_TYPE_CODES.IMAGEN) {
|
183
271
|
emit("show-toast", {
|
184
272
|
severity: "warn",
|
185
273
|
summary: "Error",
|
@@ -189,6 +277,12 @@ function createMessage(message: string) {
|
|
189
277
|
return;
|
190
278
|
}
|
191
279
|
|
280
|
+
const messageType = codigoTipoMensaje
|
281
|
+
? {
|
282
|
+
code: codigoTipoMensaje,
|
283
|
+
}
|
284
|
+
: undefined;
|
285
|
+
|
192
286
|
const newMessage: Message = {
|
193
287
|
id: uuidv4(),
|
194
288
|
chatId: information.value?.chat?.id,
|
@@ -199,6 +293,9 @@ function createMessage(message: string) {
|
|
199
293
|
appChatId: appChatId.value,
|
200
294
|
createdAt: new Date().toISOString(),
|
201
295
|
updatedAt: new Date().toISOString(),
|
296
|
+
file: inputFiles.value?.[0],
|
297
|
+
urlFile: urlFiles.value?.[0].toString(),
|
298
|
+
messageType,
|
202
299
|
sender: {
|
203
300
|
nombreCompleto: props.user.nombreCompleto,
|
204
301
|
ci: props.user.ci,
|
@@ -216,7 +313,7 @@ function updateMessageStatus(
|
|
216
313
|
messageSaved?: Message,
|
217
314
|
tipoCalificacionId?: number
|
218
315
|
) {
|
219
|
-
if (
|
316
|
+
if (idxMessageToCommunicate == null) throw new Error('idx is required')
|
220
317
|
|
221
318
|
if (!messageSaved) {
|
222
319
|
if (tipoCalificacionId) {
|
@@ -254,12 +351,11 @@ function updateMessageStatus(
|
|
254
351
|
}
|
255
352
|
|
256
353
|
const submitMessage = async (
|
257
|
-
|
258
|
-
messageExtraData?: { mensajeARespondeId?: string, tipoCalificacionId?: number, codigoTipoMensaje?: number}
|
354
|
+
messageExtraData?: { mensajeARespondeId?: string, tipoCalificacionId?: number, codigoTipoMensaje?: TypeMessageTypeCodes}
|
259
355
|
) => {
|
260
356
|
|
261
|
-
const newMessage = createMessage(message.value);
|
262
|
-
|
357
|
+
const newMessage = createMessage(message.value, messageExtraData?.codigoTipoMensaje);
|
358
|
+
message.value = '';
|
263
359
|
if (!newMessage) return;
|
264
360
|
|
265
361
|
let idxMessageToCommunicate = -1;
|
@@ -278,6 +374,8 @@ const submitMessage = async (
|
|
278
374
|
message: message.value,
|
279
375
|
appChatId: appChatId.value,
|
280
376
|
...messageExtraData,
|
377
|
+
codigoTipoMensaje: messageExtraData?.codigoTipoMensaje,
|
378
|
+
files: inputFiles.value,
|
281
379
|
}
|
282
380
|
sendApi(body).then((messageSaved) => {
|
283
381
|
let messageUpdated = updateMessageStatus(
|
@@ -463,44 +561,7 @@ function connectMsWebSocket(
|
|
463
561
|
});
|
464
562
|
}
|
465
563
|
|
466
|
-
const
|
467
|
-
return [OS.ANDROID, OS.IOS].includes(getOS() as OS);
|
468
|
-
});
|
469
|
-
|
470
|
-
const enum OS {
|
471
|
-
ANDROID = "Android",
|
472
|
-
IOS = "iPhone",
|
473
|
-
}
|
474
|
-
|
475
|
-
function getOS() {
|
476
|
-
const userAgent = window.navigator.userAgent;
|
477
|
-
const platform = (window.navigator as any)?.userAgentData?.platform || window.navigator.platform;
|
478
|
-
const macosPlatforms = [
|
479
|
-
"macOS",
|
480
|
-
"Macintosh",
|
481
|
-
"MacIntel",
|
482
|
-
"MacPPC",
|
483
|
-
"Mac68K",
|
484
|
-
];
|
485
|
-
const windowsPlatforms = ["Win32", "Win64", "Windows", "WinCE"];
|
486
|
-
const iosPlatforms = ["iPhone", "iPad", "iPod"];
|
487
|
-
|
488
|
-
let os = null;
|
489
|
-
|
490
|
-
if (macosPlatforms.indexOf(platform) !== -1) {
|
491
|
-
os = "Mac OS";
|
492
|
-
} else if (iosPlatforms.indexOf(platform) !== -1) {
|
493
|
-
os = OS.IOS;
|
494
|
-
} else if (windowsPlatforms.indexOf(platform) !== -1) {
|
495
|
-
os = "Windows";
|
496
|
-
} else if (/Android/.test(userAgent)) {
|
497
|
-
os = OS.ANDROID;
|
498
|
-
} else if (/Linux/.test(platform)) {
|
499
|
-
os = "Linux";
|
500
|
-
}
|
501
|
-
|
502
|
-
return os;
|
503
|
-
}
|
564
|
+
const { isMobile } = useMobile()
|
504
565
|
|
505
566
|
function onQualifying({ message: messageParam, emoji }: { message: Message, emoji: { iconUnicode: string, value: number } }) {
|
506
567
|
const callback = async () => {
|
@@ -508,7 +569,10 @@ function onQualifying({ message: messageParam, emoji }: { message: Message, emoj
|
|
508
569
|
|
509
570
|
message.value = emoji.iconUnicode
|
510
571
|
|
511
|
-
submitMessage(
|
572
|
+
submitMessage({
|
573
|
+
tipoCalificacionId: emoji.value,
|
574
|
+
mensajeARespondeId: messageParam.id
|
575
|
+
}).then();
|
512
576
|
}
|
513
577
|
|
514
578
|
emit('onQualifying', { message: emoji.iconUnicode , callback})
|
@@ -516,6 +580,46 @@ function onQualifying({ message: messageParam, emoji }: { message: Message, emoj
|
|
516
580
|
|
517
581
|
const isDisabledBoxMessage = ref(false);
|
518
582
|
|
583
|
+
// Adjuntar
|
584
|
+
function onFileSelect() {
|
585
|
+
inputFiles.value = [];
|
586
|
+
urlFiles.value = [];
|
587
|
+
|
588
|
+
const filesParam = fileInputRef.value?.files ?? []
|
589
|
+
|
590
|
+
const file = filesParam?.[0];
|
591
|
+
|
592
|
+
inputFiles.value = filesParam;
|
593
|
+
|
594
|
+
if (!file) return;
|
595
|
+
|
596
|
+
urlFiles.value.push(URL.createObjectURL(file))
|
597
|
+
|
598
|
+
currentDialogView.value = DIALOG_VIEWS.UPLOAD;
|
599
|
+
dialog.title = 'Preparar imagen';
|
600
|
+
dialog.modelValue = true;
|
601
|
+
}
|
602
|
+
|
603
|
+
// Dialog
|
604
|
+
|
605
|
+
const inputFiles = ref<(File & { objectURL: string })[]>([]);
|
606
|
+
const urlFiles = ref<Array<string>>([]);
|
607
|
+
|
608
|
+
const dialog = reactive<IPropsDialog>({
|
609
|
+
modelValue: false,
|
610
|
+
'onUpdate:modelValue': (args) => {
|
611
|
+
dialog.modelValue = args;
|
612
|
+
|
613
|
+
if (args) return;
|
614
|
+
|
615
|
+
urlFiles.value = [];
|
616
|
+
inputFiles.value = [];
|
617
|
+
},
|
618
|
+
title: 'Preparar imagen'
|
619
|
+
});
|
620
|
+
|
621
|
+
//
|
622
|
+
|
519
623
|
onMounted(async () => {
|
520
624
|
if (appChatId.value) return;
|
521
625
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<template>
|
2
|
+
<svg
|
3
|
+
version="1.1"
|
4
|
+
id="Layer_1"
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
6
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
7
|
+
viewBox="0 0 280.067 280.067"
|
8
|
+
xml:space="preserve"
|
9
|
+
>
|
10
|
+
<g>
|
11
|
+
<path
|
12
|
+
fill="currentColor"
|
13
|
+
d="M149.823,257.142c-31.398,30.698-81.882,30.576-113.105-0.429
|
14
|
+
c-31.214-30.987-31.337-81.129-0.42-112.308l-0.026-0.018L149.841,31.615l14.203-14.098c23.522-23.356,61.65-23.356,85.172,0
|
15
|
+
s23.522,61.221,0,84.586l-125.19,123.02l-0.044-0.035c-15.428,14.771-40.018,14.666-55.262-0.394
|
16
|
+
c-15.244-15.069-15.34-39.361-0.394-54.588l-0.044-0.053l13.94-13.756l69.701-68.843l13.931,13.774l-83.632,82.599
|
17
|
+
c-7.701,7.596-7.701,19.926,0,27.53s20.188,7.604,27.88,0L235.02,87.987l-0.035-0.026l0.473-0.403
|
18
|
+
c15.682-15.568,15.682-40.823,0-56.39s-41.094-15.568-56.776,0l-0.42,0.473l-0.026-0.018l-14.194,14.089L50.466,158.485
|
19
|
+
c-23.522,23.356-23.522,61.221,0,84.577s61.659,23.356,85.163,0l99.375-98.675l14.194-14.089l14.194,14.089l-14.194,14.098
|
20
|
+
l-99.357,98.675C149.841,257.159,149.823,257.142,149.823,257.142z"
|
21
|
+
/>
|
22
|
+
</g>
|
23
|
+
</svg>
|
24
|
+
</template>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
3
3
|
<path
|
4
|
-
fill="
|
4
|
+
fill="currentColor"
|
5
5
|
d="M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376V479.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"
|
6
6
|
/>
|
7
7
|
</svg>
|
@@ -0,0 +1,111 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="auth-loading">
|
3
|
+
<div class="relative">
|
4
|
+
<!-- SPINNER ICON -->
|
5
|
+
<svg
|
6
|
+
class="icon_1"
|
7
|
+
:class="{ 'sm-loader-size': props.size === 'small' }"
|
8
|
+
viewBox="0 0 275 276"
|
9
|
+
fill="none"
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
11
|
+
>
|
12
|
+
<path
|
13
|
+
d="M137.1 1C124.2 1 111.2 2.80001 98.3 6.60001C68.5 15.4 43.9 33.5 26.8 56.7C9.69999 79.9 0.0999756 108.3 0.0999756 137.9C0.0999756 150.8 1.90001 163.8 5.70001 176.7C7.60001 183 13.3 187 19.5 187C25.7 187 22.2 186.8 23.6 186.4C31.2 184.1 35.6 176.1 33.3 168.5C30.3 158.3 28.8 148 28.8 137.8C28.8 114.5 36.4 92 49.9 73.7C63.4 55.3 82.7 41.1 106.3 34.2C116.5 31.2 126.8 29.7 137 29.7C160.3 29.7 182.8 37.3 201.1 50.8C219.5 64.3 233.7 83.6 240.6 107.2C242.5 113.5 248.2 117.5 254.4 117.5C260.6 117.5 257.1 117.3 258.5 116.9C266.1 114.6 270.5 106.6 268.2 99C259.4 69.2 241.3 44.6 218.1 27.5C194.9 10.4 166.5 0.799988 136.9 0.799988"
|
14
|
+
fill="url(#paint0_linear_672_78)"
|
15
|
+
/>
|
16
|
+
<path
|
17
|
+
d="M254.5 88.9C253.1 88.9 251.8 89.1 250.4 89.5C242.8 91.8 238.4 99.8 240.7 107.4C243.7 117.6 245.2 127.9 245.2 138.1C245.2 161.4 237.6 183.9 224.1 202.2C210.6 220.6 191.3 234.8 167.7 241.7C157.5 244.7 147.2 246.2 137 246.2C113.7 246.2 91.2 238.6 72.9 225.1C54.5 211.6 40.3001 192.3 33.4001 168.7C31.5001 162.4 25.8 158.4 19.6 158.4C13.4 158.4 16.9 158.6 15.5 159C7.90003 161.3 3.50001 169.3 5.80001 176.9C14.6 206.7 32.7001 231.3 55.9001 248.4C79.1001 265.5 107.5 275.1 137.1 275.1C150 275.1 163 273.3 175.9 269.5C205.7 260.7 230.3 242.6 247.4 219.4C264.5 196.2 274.1 167.8 274.1 138.2C274.1 125.4 272.3 112.3 268.5 99.4C266.6 93.1 260.9 89.1 254.7 89.1"
|
18
|
+
fill="url(#paint1_linear_672_78)"
|
19
|
+
/>
|
20
|
+
<defs>
|
21
|
+
<linearGradient
|
22
|
+
id="paint0_linear_672_78"
|
23
|
+
x1="-2.44076e-05"
|
24
|
+
y1="94.1"
|
25
|
+
x2="269"
|
26
|
+
y2="94.1"
|
27
|
+
gradientUnits="userSpaceOnUse"
|
28
|
+
>
|
29
|
+
<stop stop-color="white" />
|
30
|
+
<stop offset="1" stop-color="white" stop-opacity="0" />
|
31
|
+
</linearGradient>
|
32
|
+
<linearGradient
|
33
|
+
id="paint1_linear_672_78"
|
34
|
+
x1="5.00002"
|
35
|
+
y1="181.9"
|
36
|
+
x2="274"
|
37
|
+
y2="181.9"
|
38
|
+
gradientUnits="userSpaceOnUse"
|
39
|
+
>
|
40
|
+
<stop stop-color="white" stop-opacity="0" />
|
41
|
+
<stop offset="1" stop-color="white" />
|
42
|
+
</linearGradient>
|
43
|
+
</defs>
|
44
|
+
</svg>
|
45
|
+
<!-- TEXTO SVG -->
|
46
|
+
<svg
|
47
|
+
class="icon_2"
|
48
|
+
:class="{ hidden: props.size === 'small' }"
|
49
|
+
xmlns="http://www.w3.org/2000/svg"
|
50
|
+
fill="none"
|
51
|
+
viewBox="0 0 176 74"
|
52
|
+
>
|
53
|
+
<path
|
54
|
+
fill="#fff"
|
55
|
+
d="M6.4 70v-3.5c-.3 1.3-1.5 4.5-2.2 6.6h-.8c-.6-1.7-1.7-5.2-2.1-6.6v6.6H.5v-7.3h1.4c.8 2.1 1.7 5.1 2 6.1.1-.7 1.3-3.9 2.1-6.1h1.3v7.3h-.9V70ZM10.8 65.8v7.3h-.9v-7.3h.9ZM13.5 73.1v-7.3h1.2c2.9 5.1 3.3 5.8 3.4 6.2v-6.1h.9v7.3h-1.1c-3.1-5.6-3.3-6-3.5-6.3v6.4h-.8l-.1-.2ZM22.5 65.8v7.3h-.9v-7.3h.9ZM25.5 71c.1.9.8 1.4 1.6 1.4s1.4-.4 1.4-1.3-.4-1.1-1.7-1.5c-1.5-.5-2.1-1-2.1-2s.9-1.9 2.2-1.9c1.3 0 2.2.9 2.3 1.9h-.9c-.1-.7-.5-1.2-1.4-1.2-.9 0-1.3.4-1.3 1.1 0 .7.4.9 1.5 1.3 1.8.5 2.2 1.2 2.2 2.2 0 1-.8 2.1-2.4 2.1-1.6 0-2.4-.8-2.5-2.1h1.1ZM32.9 66.6h-2.1v-.8H36v.8h-2.1v6.5H33v-6.5h-.1ZM41.9 69.6h-3.3v2.6h3.6v.8h-4.5v-7.3H42v.8h-3.4v2.3h3.3v.8ZM45.2 69.8v3.3h-.9v-7.3h2.6c1.3 0 2.2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-1.9 5.9-5.9 5.9s-5.7-2.8-5.9-5.9h2.4l-.1-.1ZM77.9 1.1v21.4h-2.3V1.1h2.3ZM87.9 16.9c.2 2.2 1.2 4 3.6 4 2.4 0 3.4-1.2 3.4-3.7s-.9-3.5-3.8-4.9c-3.4-1.6-4.8-3.1-4.8-6.2S88.2.8 91.7.8c3.5 0 5.3 3 5.3 5.5h-2.3c-.1-1-.4-3.5-3.1-3.5s-2.9 1.4-2.9 3.1c0 1.7.9 3 3.6 4.3 3.7 1.8 5.1 3.6 5.1 6.8 0 3.2-1.9 5.9-5.9 5.9s-5.7-2.8-5.9-5.9H88l-.1-.1ZM107.9 3.2h-4.8V1.1H115v2.1h-4.8v19.3h-2.4V3.2h.1ZM131.5 12.3h-7.1v8.2h7.9l-.3 2.1h-9.9V1.2h9.8v2.1h-7.5v7h7.1v2.1-.1ZM152.5 13.4c0-4 0-8 .1-10.3-.8 3.7-2.7 12.6-4.4 19.4h-2.3c-1.3-5.9-3.3-15.5-4.1-19.4.1 2.5.2 7.2.2 10.9v8.5h-2.2V1.1h3.5c1.7 6.7 3.4 14.9 3.9 17.7.4-2.3 2.5-11.2 4.2-17.7h3.5v21.4h-2.3v-9.1h-.1ZM165.9 15.8l-1.6 6.8h-2.4l5.2-21.4h3l5.3 21.4h-2.5l-1.6-6.8h-5.6.2Zm5.1-2.1c-1.2-5.3-2-8.6-2.3-10.3-.3 1.9-1.2 5.7-2.2 10.3h4.6-.1Z"
|
56
|
+
/>
|
57
|
+
</svg>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</template>
|
61
|
+
|
62
|
+
<script setup lang="ts">
|
63
|
+
import { PropType } from 'vue';
|
64
|
+
|
65
|
+
const props = defineProps({
|
66
|
+
size: {
|
67
|
+
type: String as PropType<'small' | 'normal'>,
|
68
|
+
default: 'normal',
|
69
|
+
},
|
70
|
+
footer_text: {
|
71
|
+
type: String,
|
72
|
+
},
|
73
|
+
});
|
74
|
+
</script>
|
75
|
+
|
76
|
+
<style scoped>
|
77
|
+
.auth-loading {
|
78
|
+
position: absolute;
|
79
|
+
width: 100%;
|
80
|
+
height: 100%;
|
81
|
+
background: rgba(85, 85, 85, 0.75);
|
82
|
+
left: 0;
|
83
|
+
top: 0;
|
84
|
+
z-index: 999999;
|
85
|
+
display: flex;
|
86
|
+
flex-direction: column;
|
87
|
+
align-items: center;
|
88
|
+
justify-content: center;
|
89
|
+
}
|
90
|
+
|
91
|
+
.icon_1 {
|
92
|
+
animation: rotate 2s linear infinite;
|
93
|
+
height: 200px;
|
94
|
+
}
|
95
|
+
.sm-loader-size {
|
96
|
+
height: 40px;
|
97
|
+
}
|
98
|
+
|
99
|
+
@keyframes rotate {
|
100
|
+
100% {
|
101
|
+
transform: rotate(-360deg);
|
102
|
+
}
|
103
|
+
}
|
104
|
+
.icon_2 {
|
105
|
+
width: 115px;
|
106
|
+
position: absolute;
|
107
|
+
top: 50%;
|
108
|
+
left: 50%;
|
109
|
+
transform: translate(-50%, -50%);
|
110
|
+
}
|
111
|
+
</style>
|
@@ -49,11 +49,19 @@
|
|
49
49
|
</div>
|
50
50
|
</div>
|
51
51
|
|
52
|
-
<div v-else
|
53
|
-
<
|
54
|
-
|
52
|
+
<div v-else>
|
53
|
+
<div v-if="message.messageType?.code === MESSAGE_TYPE_CODES.IMAGEN" style="text-align: center;">
|
54
|
+
<a href="javascript:" class="btn-icon" @click="emit('see', message)">
|
55
|
+
<img :src="message.thumbnailFile ?? message.urlFile" alt="image" width="150" />
|
56
|
+
</a>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div v-if="emoji[message.message ?? '']">
|
60
|
+
<img :src="emoji[message.message]" alt="icono" class="icon" />
|
61
|
+
</div>
|
55
62
|
|
56
|
-
|
63
|
+
<div v-else class="message-text" style="white-space: pre-line" v-html="textToRichFormat(message.message)"></div>
|
64
|
+
</div>
|
57
65
|
|
58
66
|
<div class="detail-message flex justify-between mt-2">
|
59
67
|
<span class="mr-5" v-if="message.sender?.nombreCompleto">
|
@@ -91,8 +99,9 @@ import AngryIcon from '../assets/emojis/AngryIcon.svg'
|
|
91
99
|
import HappiestIcon from '../assets/emojis/HappiestIcon.svg'
|
92
100
|
import NeutralIcon from '../assets/emojis/NeutralIcon.svg'
|
93
101
|
import HappyIcon from '../assets/emojis/HappyIcon.svg'
|
102
|
+
import { MESSAGE_TYPE_CODES } from '../resources/constants/message-type.constant';
|
94
103
|
|
95
|
-
const emit = defineEmits(["loadMore", "retry", "onQualifying"]);
|
104
|
+
const emit = defineEmits(["loadMore", "retry", "onQualifying", "see"]);
|
96
105
|
const props = defineProps({
|
97
106
|
messages: {
|
98
107
|
type: Array as PropType<Message[]>,
|
@@ -339,35 +348,10 @@ const emoji: { [key in string]: any } = {
|
|
339
348
|
font-size: 2rem;
|
340
349
|
}
|
341
350
|
|
342
|
-
.flex {
|
343
|
-
display: flex;
|
344
|
-
flex-wrap: wrap;
|
345
|
-
}
|
346
|
-
.flex-col {
|
347
|
-
flex-direction: column;
|
348
|
-
}
|
349
|
-
.items-center {
|
350
|
-
align-items: center;
|
351
|
-
}
|
352
|
-
.gap-2 {
|
353
|
-
gap: 0.5rem;
|
354
|
-
}
|
355
|
-
|
356
|
-
.mb-2 {
|
357
|
-
margin-bottom: 8px;
|
358
|
-
}
|
359
|
-
|
360
|
-
.mt-2 {
|
361
|
-
margin-top: 8px;
|
362
|
-
}
|
363
|
-
|
364
351
|
.content-disabled {
|
365
352
|
-webkit-filter: grayscale(1); /* Google Chrome, Safari 6+ & Opera 15+ */
|
366
353
|
filter: grayscale(1); /* Microsoft Edge and Firefox 35+ */
|
367
354
|
opacity: 0.5;
|
368
355
|
}
|
369
|
-
.justify-between {
|
370
|
-
justify-content: space-between;
|
371
|
-
}
|
372
356
|
|
373
357
|
</style>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export interface IPropsSidebar {
|
2
|
+
modelValue?: boolean;
|
3
|
+
title?: string;
|
4
|
+
// isLoading?: boolean;
|
5
|
+
// hideActions?: boolean;
|
6
|
+
// hideHeader?: boolean;
|
7
|
+
// acceptFn?: () => Promise<boolean>;
|
8
|
+
// beforeAcceptFn?: () => Promise<boolean>;
|
9
|
+
// disable?: boolean;
|
10
|
+
|
11
|
+
// solo para v-bind
|
12
|
+
'onUpdate:modelValue'?: (args: IPropsSidebar['modelValue'])=> void
|
13
|
+
}
|