@phonghq/go-chat 1.0.76 → 1.0.78

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.
@@ -10,6 +10,7 @@ declare const _default: import("vue").DefineComponent<GoChatProps, GoChatInstanc
10
10
  "app:close": () => any;
11
11
  "app:zoomChange": () => any;
12
12
  "app:openPhoneNumpad": () => any;
13
+ "update:hasTenantPhone": (id: boolean) => any;
13
14
  }, string, import("vue").PublicProps, Readonly<GoChatProps> & Readonly<{
14
15
  onCall?: ((data: IResUser) => any) | undefined;
15
16
  "onBooking-admin:viewAppointment"?: ((id: any) => any) | undefined;
@@ -19,6 +20,7 @@ declare const _default: import("vue").DefineComponent<GoChatProps, GoChatInstanc
19
20
  "onApp:close"?: (() => any) | undefined;
20
21
  "onApp:zoomChange"?: (() => any) | undefined;
21
22
  "onApp:openPhoneNumpad"?: (() => any) | undefined;
23
+ "onUpdate:hasTenantPhone"?: ((id: boolean) => any) | undefined;
22
24
  }>, {
23
25
  isZoomIn: boolean;
24
26
  response: PAGE_RESPONSIVE;
@@ -186,6 +186,9 @@ const handleInitPage = async () => {
186
186
  emit('error:noPhoneTenant');
187
187
  routerPush(PAGE.NOT_TENANT_PHONE);
188
188
  }
189
+ else if (dataProfile.value?.phone && dataProfile.value?.user_type == 'tenant') {
190
+ emit('update:hasTenantPhone', true);
191
+ }
189
192
  handleExposeInit(init_data);
190
193
  };
191
194
  const openSettings = () => {
@@ -9,6 +9,7 @@ import { getTimeLocal } from '../../../utils/dayjs-helper';
9
9
  const props = withDefaults(defineProps(), {});
10
10
  const emit = defineEmits();
11
11
  const scrollEventRef = ref(null);
12
+ const selectedMessageId = ref(null);
12
13
  const scrollBottom = () => {
13
14
  nextTick(() => {
14
15
  const eleIdContentChat = document.getElementById('content-chat');
@@ -57,6 +58,9 @@ const hideScrollEvent = () => {
57
58
  const fixedScroll = () => {
58
59
  scrollEventRef.value?.fixedScroll();
59
60
  };
61
+ const handleMessageClick = (data) => {
62
+ selectedMessageId.value = data?.id;
63
+ };
60
64
  const __VLS_exposed = { scrollBottom, hideScrollEvent, fixedScroll };
61
65
  defineExpose(__VLS_exposed);
62
66
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
@@ -149,6 +153,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
149
153
  const __VLS_18 = __VLS_asFunctionalComponent(ChatMessageItem, new ChatMessageItem({
150
154
  ...{ 'onCallAgain': {} },
151
155
  ...{ 'onResend': {} },
156
+ ...{ 'onMessageClick': {} },
152
157
  message: (item),
153
158
  responsive: (__VLS_ctx.responsive),
154
159
  isMyMessage: (item.sender_id == __VLS_ctx.dataProfile?.id),
@@ -159,10 +164,12 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
159
164
  isChatFinished: (__VLS_ctx.isChatFinished(index)),
160
165
  isChatStart: (__VLS_ctx.isChatStart(index)),
161
166
  isStartNewDate: (__VLS_ctx.isStartNewDate(index)),
167
+ selectedMessageId: (__VLS_ctx.selectedMessageId),
162
168
  }));
163
169
  const __VLS_19 = __VLS_18({
164
170
  ...{ 'onCallAgain': {} },
165
171
  ...{ 'onResend': {} },
172
+ ...{ 'onMessageClick': {} },
166
173
  message: (item),
167
174
  responsive: (__VLS_ctx.responsive),
168
175
  isMyMessage: (item.sender_id == __VLS_ctx.dataProfile?.id),
@@ -173,6 +180,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
173
180
  isChatFinished: (__VLS_ctx.isChatFinished(index)),
174
181
  isChatStart: (__VLS_ctx.isChatStart(index)),
175
182
  isStartNewDate: (__VLS_ctx.isStartNewDate(index)),
183
+ selectedMessageId: (__VLS_ctx.selectedMessageId),
176
184
  }, ...__VLS_functionalComponentArgsRest(__VLS_18));
177
185
  let __VLS_21;
178
186
  let __VLS_22;
@@ -180,7 +188,7 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
180
188
  { onCallAgain: (...[$event]) => {
181
189
  __VLS_ctx.emit('callBack');
182
190
  // @ts-ignore
183
- [data, message, responsive, dataProfile, shouldShowAvatar, isEndMessage, isChatFinished, isChatStart, isStartNewDate, emit,];
191
+ [data, message, responsive, dataProfile, shouldShowAvatar, isEndMessage, isChatFinished, isChatStart, isStartNewDate, selectedMessageId, emit,];
184
192
  } });
185
193
  const __VLS_24 = ({ resend: {} },
186
194
  { onResend: (...[$event]) => {
@@ -188,6 +196,12 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
188
196
  // @ts-ignore
189
197
  [emit,];
190
198
  } });
199
+ const __VLS_25 = ({ messageClick: {} },
200
+ { onMessageClick: (...[$event]) => {
201
+ __VLS_ctx.handleMessageClick(item);
202
+ // @ts-ignore
203
+ [handleMessageClick,];
204
+ } });
191
205
  var __VLS_20;
192
206
  }
193
207
  var __VLS_16;
@@ -11,12 +11,15 @@ type Props = {
11
11
  isChatStart: boolean;
12
12
  isStartNewDate: boolean;
13
13
  data: IResUser | null;
14
+ selectedMessageId: any;
14
15
  };
15
16
  declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
16
17
  callAgain: () => any;
17
18
  resend: () => any;
19
+ messageClick: () => any;
18
20
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
19
21
  onCallAgain?: (() => any) | undefined;
20
22
  onResend?: (() => any) | undefined;
23
+ onMessageClick?: (() => any) | undefined;
21
24
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
25
  export default _default;
@@ -14,7 +14,6 @@ import IconMenuDot from '../../../assets/icons/chat/IconMenuDot.vue';
14
14
  import IconResend from '../../../assets/icons/chat/IconResend.vue';
15
15
  import IconCopy from '../../../assets/icons/chat/IconCopy.vue';
16
16
  import PopoverBase from '../../../components/chat/common/popover/PopoverBase.vue';
17
- import { userHistory } from '../../../utils/chat/store/user';
18
17
  dayjs.extend(utc);
19
18
  dayjs.extend(timezone);
20
19
  const props = withDefaults(defineProps(), {});
@@ -49,28 +48,46 @@ const callTitle = computed(() => {
49
48
  });
50
49
  const popoverContent = computed(() => {
51
50
  let result = [];
52
- if (props.message?.is_call != 1) {
53
- result.unshift({
54
- icon: IconCopy,
55
- title: 'Copy',
56
- disabled: !userHistory.value?.appointment?.length,
57
- click: () => {
58
- copyToClipboard(props.message.message ?? '');
59
- popoverOpen.value = false;
60
- }
61
- });
62
- if (props.isMyMessage) {
63
- result.unshift({
64
- icon: IconResend,
65
- title: 'Resend',
66
- disabled: false,
67
- click: () => {
68
- emit('resend');
69
- popoverOpen.value = false;
70
- }
71
- });
51
+ result.unshift({
52
+ icon: IconCopy,
53
+ title: 'Copy',
54
+ disabled: props.message?.is_call == 1,
55
+ click: () => {
56
+ copyToClipboard(props.message.message ?? '');
57
+ popoverOpen.value = false;
72
58
  }
73
- }
59
+ });
60
+ result.unshift({
61
+ icon: IconResend,
62
+ title: 'Resend',
63
+ disabled: !props.isMyMessage || props.message?.is_call == 1,
64
+ click: () => {
65
+ emit('resend');
66
+ popoverOpen.value = false;
67
+ }
68
+ });
69
+ // if (props.message?.is_call != 1) {
70
+ // result.unshift({
71
+ // icon: IconCopy,
72
+ // title: 'Copy',
73
+ // disabled: props.message?.is_call == 1,
74
+ // click: () => {
75
+ // copyToClipboard(props.message.message ?? '')
76
+ // popoverOpen.value = false
77
+ // }
78
+ // })
79
+ // if (props.isMyMessage) {
80
+ // result.unshift({
81
+ // icon: IconResend,
82
+ // title: 'Resend',
83
+ // disabled: false,
84
+ // click: () => {
85
+ // emit('resend')
86
+ // popoverOpen.value = false
87
+ // }
88
+ // })
89
+ // }
90
+ // }
74
91
  return result;
75
92
  });
76
93
  const popoverOpen = ref(false);
@@ -124,6 +141,11 @@ const copyToClipboard = async (text) => {
124
141
  return false;
125
142
  }
126
143
  };
144
+ const handleMessageClick = () => {
145
+ if (props.responsive == 'mobile') {
146
+ emit('messageClick');
147
+ }
148
+ };
127
149
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
128
150
  const __VLS_defaults = {};
129
151
  const __VLS_ctx = {
@@ -213,6 +235,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
213
235
  }
214
236
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
215
237
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
238
+ ...{ onClick: (__VLS_ctx.handleMessageClick) },
216
239
  ...{ class: "px-3 py-2 rounded-2xl text-left w-max relative" },
217
240
  ...{ class: ({
218
241
  'rounded-tl-[6px]': !__VLS_ctx.isChatStart && !__VLS_ctx.isMyMessage,
@@ -229,7 +252,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
229
252
  }) },
230
253
  });
231
254
  // @ts-ignore
232
- [message, message, message, message, message, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, responsive, responsive, isChatStart, isChatStart, isChatFinished, isChatFinished,];
255
+ [message, message, message, message, message, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, isMyMessage, responsive, responsive, handleMessageClick, isChatStart, isChatStart, isChatFinished, isChatFinished,];
233
256
  if (__VLS_ctx.popoverContent.length) {
234
257
  // @ts-ignore
235
258
  [popoverContent,];
@@ -238,26 +261,26 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
238
261
  const __VLS_4 = __VLS_asFunctionalComponent(PopoverBase, new PopoverBase({
239
262
  open: (__VLS_ctx.popoverOpen),
240
263
  trigger: "click",
241
- side: "top",
264
+ side: "bottom",
242
265
  align: (__VLS_ctx.isMyMessage ? 'end' : 'start'),
243
266
  ...{ class: "" },
244
- triggerClass: (`absolute w-6 opacity-0 group-hover:opacity-[1] ${__VLS_ctx.isMyMessage ? '-left-6 ' : '-right-6'}`),
245
- contentClass: "min-w-0 -translate-y-4 shadow-none",
267
+ triggerClass: (`absolute w-6 opacity-0 group-hover:opacity-[1] bottom-1/2 translate-y-1/2 ${__VLS_ctx.isMyMessage ? '-left-10 ' : '-right-10'} ${__VLS_ctx.selectedMessageId == __VLS_ctx.message.id ? 'opacity-[1]' : ''}`),
268
+ contentClass: "min-w-0",
246
269
  }));
247
270
  const __VLS_5 = __VLS_4({
248
271
  open: (__VLS_ctx.popoverOpen),
249
272
  trigger: "click",
250
- side: "top",
273
+ side: "bottom",
251
274
  align: (__VLS_ctx.isMyMessage ? 'end' : 'start'),
252
275
  ...{ class: "" },
253
- triggerClass: (`absolute w-6 opacity-0 group-hover:opacity-[1] ${__VLS_ctx.isMyMessage ? '-left-6 ' : '-right-6'}`),
254
- contentClass: "min-w-0 -translate-y-4 shadow-none",
276
+ triggerClass: (`absolute w-6 opacity-0 group-hover:opacity-[1] bottom-1/2 translate-y-1/2 ${__VLS_ctx.isMyMessage ? '-left-10 ' : '-right-10'} ${__VLS_ctx.selectedMessageId == __VLS_ctx.message.id ? 'opacity-[1]' : ''}`),
277
+ contentClass: "min-w-0",
255
278
  }, ...__VLS_functionalComponentArgsRest(__VLS_4));
256
279
  const { default: __VLS_7 } = __VLS_6.slots;
257
280
  // @ts-ignore
258
- [isMyMessage, isMyMessage, popoverOpen,];
281
+ [message, isMyMessage, isMyMessage, popoverOpen, selectedMessageId,];
259
282
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
260
- ...{ class: "" },
283
+ ...{ class: "w-8 h-8 rotate-90 rounded-full bg-[#f1f5f9] flex-center shadow-3xl" },
261
284
  });
262
285
  /** @type {[typeof IconMenuDot, ]} */ ;
263
286
  // @ts-ignore
@@ -266,7 +289,10 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
266
289
  {
267
290
  const { content: __VLS_12 } = __VLS_6.slots;
268
291
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
269
- ...{ class: "flex bg-chat-primary-dark text-chat-text rounded-xl py-2" },
292
+ ...{ class: "rounded-xl p-2 min-w-[200px]" },
293
+ });
294
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
295
+ ...{ class: "text-chat-text" },
270
296
  });
271
297
  for (const [item, i] of __VLS_getVForSourceType((__VLS_ctx.popoverContent))) {
272
298
  // @ts-ignore
@@ -279,7 +305,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
279
305
  return;
280
306
  item.click?.();
281
307
  } },
282
- ...{ class: "flex items-center flex-col w-[70px] text-white text-base duration-200 cursor-pointer border-r last:border-none" },
308
+ ...{ class: "flex items-center gap-2 p-2 hover:bg-chat-primary hover:text-white duration-200 cursor-pointer rounded-lg" },
283
309
  key: (i),
284
310
  ...{ class: ({ 'opacity-[0.3] pointer-events-none': item.disabled }) },
285
311
  });
@@ -418,7 +444,6 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
418
444
  }
419
445
  /** @type {__VLS_StyleScopedClasses['']} */ ;
420
446
  /** @type {__VLS_StyleScopedClasses['']} */ ;
421
- /** @type {__VLS_StyleScopedClasses['']} */ ;
422
447
  /** @type {__VLS_StyleScopedClasses['relative']} */ ;
423
448
  /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
424
449
  /** @type {__VLS_StyleScopedClasses['text-chat-haze-200']} */ ;
@@ -469,21 +494,26 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
469
494
  /** @type {__VLS_StyleScopedClasses['mr-auto']} */ ;
470
495
  /** @type {__VLS_StyleScopedClasses['max-w-[280px]']} */ ;
471
496
  /** @type {__VLS_StyleScopedClasses['max-w-[480px]']} */ ;
472
- /** @type {__VLS_StyleScopedClasses['flex']} */ ;
473
- /** @type {__VLS_StyleScopedClasses['bg-chat-primary-dark']} */ ;
474
- /** @type {__VLS_StyleScopedClasses['text-chat-text']} */ ;
497
+ /** @type {__VLS_StyleScopedClasses['w-8']} */ ;
498
+ /** @type {__VLS_StyleScopedClasses['h-8']} */ ;
499
+ /** @type {__VLS_StyleScopedClasses['rotate-90']} */ ;
500
+ /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
501
+ /** @type {__VLS_StyleScopedClasses['bg-[#f1f5f9]']} */ ;
502
+ /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
503
+ /** @type {__VLS_StyleScopedClasses['shadow-3xl']} */ ;
475
504
  /** @type {__VLS_StyleScopedClasses['rounded-xl']} */ ;
476
- /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
505
+ /** @type {__VLS_StyleScopedClasses['p-2']} */ ;
506
+ /** @type {__VLS_StyleScopedClasses['min-w-[200px]']} */ ;
507
+ /** @type {__VLS_StyleScopedClasses['text-chat-text']} */ ;
477
508
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
478
509
  /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
479
- /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
480
- /** @type {__VLS_StyleScopedClasses['w-[70px]']} */ ;
481
- /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
482
- /** @type {__VLS_StyleScopedClasses['text-base']} */ ;
510
+ /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
511
+ /** @type {__VLS_StyleScopedClasses['p-2']} */ ;
512
+ /** @type {__VLS_StyleScopedClasses['hover:bg-chat-primary']} */ ;
513
+ /** @type {__VLS_StyleScopedClasses['hover:text-white']} */ ;
483
514
  /** @type {__VLS_StyleScopedClasses['duration-200']} */ ;
484
515
  /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
485
- /** @type {__VLS_StyleScopedClasses['border-r']} */ ;
486
- /** @type {__VLS_StyleScopedClasses['last:border-none']} */ ;
516
+ /** @type {__VLS_StyleScopedClasses['rounded-lg']} */ ;
487
517
  /** @type {__VLS_StyleScopedClasses['opacity-[0.3]']} */ ;
488
518
  /** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
489
519
  /** @type {__VLS_StyleScopedClasses['w-5']} */ ;