@icvdeveloper/common-module 1.4.14 → 2.1.0
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/CHANGELOG.md +4 -0
- package/dist/module.d.mts +1051 -2
- package/dist/module.d.ts +1051 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +29 -15
- package/dist/runtime/@types/components.d.ts +22 -0
- package/dist/runtime/@types/configVariables.d.ts +6 -0
- package/dist/runtime/analytics.d.ts +1 -6
- package/dist/runtime/assets/scss/_agenda.css +1 -0
- package/dist/runtime/assets/scss/_animations.css +1 -0
- package/dist/runtime/assets/scss/_container_variants.css +1 -0
- package/dist/runtime/assets/scss/_custom.css +3 -0
- package/dist/runtime/assets/scss/_forms.css +1 -0
- package/dist/runtime/assets/scss/_header.css +0 -0
- package/dist/runtime/assets/scss/_index_production.css +1 -0
- package/dist/runtime/assets/scss/_transitions.css +1 -0
- package/dist/runtime/assets/scss/_variables.css +1 -0
- package/dist/runtime/assets/scss/_variables2.css +0 -0
- package/dist/runtime/assets/scss/_webcast.css +1 -0
- package/dist/runtime/assets/scss/index.css +1 -705
- package/dist/runtime/assets/svg/icon-minus.svg +6 -0
- package/dist/runtime/assets/svg/icon-video.svg +6 -0
- package/dist/runtime/components/affiliates/AffiliateModal.vue +66 -0
- package/dist/runtime/components/affiliates/AffiliatePage.vue +329 -159
- package/dist/runtime/components/agenda/AgendaList.vue +18 -14
- package/dist/runtime/components/agenda/AgendaTabbed.vue +60 -54
- package/dist/runtime/components/agenda/components/AgendaListAccordion.vue +8 -3
- package/dist/runtime/components/agenda/components/Calendar.vue +23 -18
- package/dist/runtime/components/agenda/components/Favorite.vue +46 -0
- package/dist/runtime/components/agenda/components/InfoLink.vue +15 -5
- package/dist/runtime/components/agenda/components/PlayIcon.vue +3 -5
- package/dist/runtime/components/agenda/components/PresentationLink.vue +37 -19
- package/dist/runtime/components/agenda/components/Sponsor.vue +31 -24
- package/dist/runtime/components/auth/PasswordReset.vue +20 -5
- package/dist/runtime/components/auth/Registration.vue +14 -4
- package/dist/runtime/components/auth/Ucc.vue +44 -27
- package/dist/runtime/components/chat/ChatConversationList.vue +108 -0
- package/dist/runtime/components/chat/ChatCreateConversation.vue +199 -0
- package/dist/runtime/components/chat/ChatCreateGroupConversation.vue +154 -0
- package/dist/runtime/components/chat/ChatHeader.vue +97 -0
- package/dist/runtime/components/chat/ChatMessage.vue +40 -0
- package/dist/runtime/components/chat/ChatShowConversation.vue +76 -0
- package/dist/runtime/components/chat/ChatWidget.vue +40 -0
- package/dist/runtime/components/chat/ChatWindow.vue +154 -0
- package/dist/runtime/components/chat/ChatWindow.vue.d.ts +6 -0
- package/dist/runtime/components/chat/MessageInput.vue +27 -0
- package/dist/runtime/components/chat/SearchInput.vue +32 -0
- package/dist/runtime/components/core/Accordion.vue +12 -12
- package/dist/runtime/components/core/AttendeeList.vue +31 -36
- package/dist/runtime/components/core/CountdownTimer.vue +68 -52
- package/dist/runtime/components/core/DynamicHtml.vue.d.ts +6 -9
- package/dist/runtime/components/core/Modal.vue +24 -22
- package/dist/runtime/components/core/ModalButton.vue +43 -0
- package/dist/runtime/components/core/Navbar.vue +33 -21
- package/dist/runtime/components/core/Navigation.vue +286 -0
- package/dist/runtime/components/core/SvgIcon.vue +34 -1
- package/dist/runtime/components/core/VButton.vue +35 -0
- package/dist/runtime/components/core/ZoomModal.vue +9 -3
- package/dist/runtime/components/events/EventHeader.vue +14 -4
- package/dist/runtime/components/events/ListEvents.vue +21 -22
- package/dist/runtime/components/forms/CheckboxGroup.vue +46 -0
- package/dist/runtime/components/forms/ErrorField.vue +11 -2
- package/dist/runtime/components/forms/Message.vue +1 -1
- package/dist/runtime/components/forms/RadioGroup.vue +50 -0
- package/dist/runtime/components/forms/SearchInput.vue +8 -2
- package/dist/runtime/components/forms/SelectDropDown.vue +47 -0
- package/dist/runtime/components/forms/SupportForm.vue +22 -11
- package/dist/runtime/components/forms/SwitchInput.vue +50 -30
- package/dist/runtime/components/forms/TextArea.vue +1 -1
- package/dist/runtime/components/forms/TextInput.vue +1 -1
- package/dist/runtime/components/layouts/Accordion.vue +11 -6
- package/dist/runtime/components/media/ArchivePlayerAndContentContainer.vue +24 -5
- package/dist/runtime/components/media/ArchiveVideoPlayer.vue +19 -23
- package/dist/runtime/components/media/PlayerAndContentContainer.vue +4 -1
- package/dist/runtime/components/media/WebcastVideoPlayer.vue +6 -18
- package/dist/runtime/components/media/components/AgendaPanel.vue +7 -6
- package/dist/runtime/components/media/components/ArchiveMediaContainer.vue +17 -15
- package/dist/runtime/components/media/components/CeCreditNotification.vue +8 -8
- package/dist/runtime/components/media/components/ContentArea.vue +59 -18
- package/dist/runtime/components/media/components/ContentTabs.vue +40 -28
- package/dist/runtime/components/media/components/DocumentsPanel.vue +19 -17
- package/dist/runtime/components/media/components/MediaContainer.vue +11 -13
- package/dist/runtime/components/media/components/OverviewPanel.vue +5 -2
- package/dist/runtime/components/media/components/PresentersPanel.vue +74 -55
- package/dist/runtime/components/media/components/SessionReporting.vue +5 -4
- package/dist/runtime/components/media/components/SponsorsPanel.vue +13 -12
- package/dist/runtime/components/presenters/PresenterListing.vue +33 -25
- package/dist/runtime/components/presenters/PresenterModal.vue +26 -21
- package/dist/runtime/components/presenters/Presenters.vue +139 -0
- package/dist/runtime/components/profile/Profile.vue +10 -6
- package/dist/runtime/components/profile/components/Sidebar.vue +1 -1
- package/dist/runtime/components/profile/components/SidebarNavItem.vue +2 -4
- package/dist/runtime/components/profile/tabs/Favorites.vue +5 -4
- package/dist/runtime/components/profile/tabs/GeneralInformation.vue +26 -16
- package/dist/runtime/components/profile/tabs/ProfileImage.vue +7 -6
- package/dist/runtime/components/registration/AlreadyRegisteredModal.vue +102 -0
- package/dist/runtime/components/registration/PaymentForm.vue +136 -0
- package/dist/runtime/components/registration/RegistrationForm.vue +417 -0
- package/dist/runtime/components/registration/RegistrationGroupSelect.vue +146 -0
- package/dist/runtime/components/registration/StripePaymentForm.vue +121 -0
- package/dist/runtime/components/support/FAQAccordion.vue +8 -7
- package/dist/runtime/composables/useAdobeLaunch.d.ts +2 -7
- package/dist/runtime/composables/useAdobeLaunch.mjs +2 -2
- package/dist/runtime/composables/useAgenda.d.ts +13 -1
- package/dist/runtime/composables/useAgenda.mjs +125 -25
- package/dist/runtime/composables/useApi.d.ts +1 -1
- package/dist/runtime/composables/useAuth.d.ts +1 -1
- package/dist/runtime/composables/useAuth.mjs +1 -1
- package/dist/runtime/composables/useClassBinding.d.ts +3 -1
- package/dist/runtime/composables/useConferenceHelpers.d.ts +7 -3
- package/dist/runtime/composables/useConferenceHelpers.mjs +26 -15
- package/dist/runtime/composables/useEventHooks.d.ts +29 -0
- package/dist/runtime/composables/useEventHooks.mjs +21 -0
- package/dist/runtime/composables/useEvents.d.ts +17 -1
- package/dist/runtime/composables/useEvents.mjs +35 -9
- package/dist/runtime/composables/useLogin.mjs +9 -5
- package/dist/runtime/composables/useNavigation.d.ts +1 -1
- package/dist/runtime/composables/useNavigation.mjs +4 -2
- package/dist/runtime/composables/usePresentation.d.ts +2 -2
- package/dist/runtime/composables/usePresentation.mjs +8 -7
- package/dist/runtime/composables/usePresenter.d.ts +2 -2
- package/dist/runtime/composables/usePresenters.d.ts +2 -2
- package/dist/runtime/composables/usePusher.d.ts +4 -0
- package/dist/runtime/composables/usePusher.mjs +38 -26
- package/dist/runtime/composables/useScripts.mjs +1 -1
- package/dist/runtime/composables/useStream.d.ts +2 -3
- package/dist/runtime/composables/useStream.mjs +8 -2
- package/dist/runtime/composables/useUcc.d.ts +1 -1
- package/dist/runtime/composables/useUcc.mjs +29 -23
- package/dist/runtime/enums/general.d.ts +4 -1
- package/dist/runtime/enums/general.mjs +4 -1
- package/dist/runtime/models/adobeLaunch.d.ts +6 -0
- package/dist/runtime/models/adobeLaunch.mjs +0 -0
- package/dist/runtime/models/analytics.d.ts +6 -0
- package/dist/runtime/models/analytics.mjs +0 -0
- package/dist/runtime/models/attendeeList.d.ts +1 -1
- package/dist/runtime/models/conference.d.ts +122 -91
- package/dist/runtime/models/conversation.d.ts +11 -13
- package/dist/runtime/models/document.d.ts +5 -5
- package/dist/runtime/models/globalConfig.d.ts +9 -3
- package/dist/runtime/models/group.d.ts +38 -8
- package/dist/runtime/models/icons.d.ts +8 -1
- package/dist/runtime/models/index.d.ts +20 -0
- package/dist/runtime/models/index.mjs +20 -0
- package/dist/runtime/models/link.d.ts +4 -4
- package/dist/runtime/models/loginParams.d.ts +5 -0
- package/dist/runtime/models/loginParams.mjs +0 -0
- package/dist/runtime/models/navigationConfig.d.ts +7 -7
- package/dist/runtime/models/pagination.d.ts +11 -11
- package/dist/runtime/models/portal.d.ts +15 -10
- package/dist/runtime/models/templateConfig.d.ts +13 -7
- package/dist/runtime/models/ucc.d.ts +22 -0
- package/dist/runtime/models/ucc.mjs +0 -0
- package/dist/runtime/models/user.d.ts +25 -12
- package/dist/runtime/models/vButton.d.ts +7 -0
- package/dist/runtime/models/vButton.mjs +0 -0
- package/dist/runtime/models/video.d.ts +5 -4
- package/dist/runtime/models/virtualPagesConfig.d.ts +223 -0
- package/dist/runtime/models/virtualPagesConfig.mjs +0 -0
- package/dist/runtime/plugin.mjs +18 -9
- package/dist/runtime/store/affiliates.d.ts +4 -1
- package/dist/runtime/store/affiliates.mjs +38 -0
- package/dist/runtime/store/attendeeList.d.ts +1 -1
- package/dist/runtime/store/auth.d.ts +3 -7
- package/dist/runtime/store/auth.mjs +6 -0
- package/dist/runtime/store/conferences.d.ts +3 -1
- package/dist/runtime/store/conferences.mjs +14 -9
- package/dist/runtime/store/conversations.d.ts +78 -10
- package/dist/runtime/store/conversations.mjs +255 -22
- package/dist/runtime/store/modalPlayerConfig.d.ts +27 -0
- package/dist/runtime/store/modalPlayerConfig.mjs +58 -0
- package/dist/runtime/store/navigationConfig.d.ts +1 -1
- package/dist/runtime/store/presentations.d.ts +2 -2
- package/dist/runtime/store/templateConfigs.d.ts +7 -6
- package/dist/runtime/store/templateConfigs.mjs +7 -6
- package/dist/runtime/store/user.mjs +0 -1
- package/dist/runtime/v3plusCommonPlugin.d.ts +1 -1
- package/dist/types.d.mts +3 -2
- package/dist/types.d.ts +3 -2
- package/package.json +12 -9
- package/dist/runtime/components/media/components/JsonApi.vue +0 -33
- package/dist/runtime/components/media/components/JsonApi.vue.d.ts +0 -16
- package/dist/runtime/components/media/components/PresentersPanel.vue.d.ts +0 -32
- package/dist/runtime/components/media/components/WindowContent.vue +0 -118
- package/dist/runtime/components/media/components/WindowContent.vue.d.ts +0 -50
- package/dist/runtime/components/media/components/WindowSlide.vue +0 -92
- package/dist/runtime/components/media/components/WindowSlide.vue.d.ts +0 -36
- package/dist/runtime/models/authUser.d.ts +0 -16
- /package/dist/runtime/{models/authUser.mjs → assets/scss/_footer.css} +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { inject, onMounted, onBeforeUnmount, ref, watch } from 'vue';
|
|
3
|
+
import { storeToRefs } from 'pinia';
|
|
4
|
+
import { debounce, find, remove } from 'lodash-es';
|
|
5
|
+
import { VueEternalLoading } from '@ts-pro/vue-eternal-loading';
|
|
6
|
+
import { useConversationStore } from '#imports';
|
|
7
|
+
import { chatSearchEventHook } from '../../composables/useEventHooks';
|
|
8
|
+
import type { LoadAction } from '@ts-pro/vue-eternal-loading';
|
|
9
|
+
import type { User, UsersResult } from '../../models/user';
|
|
10
|
+
|
|
11
|
+
const conversationStore = useConversationStore();
|
|
12
|
+
const { user, users, isInitial } = storeToRefs(conversationStore);
|
|
13
|
+
|
|
14
|
+
const { getName, createConversation } = conversationStore;
|
|
15
|
+
|
|
16
|
+
// data
|
|
17
|
+
const selectedUsers = ref<User[]>([] as User[]);
|
|
18
|
+
const filteredUsers = ref<UsersResult>({} as UsersResult);
|
|
19
|
+
|
|
20
|
+
// injected load function
|
|
21
|
+
// (see Vue Eternal Loading docs for reference: https://ts-pro.github.io/vue-eternal-loading/guide/simple-usage.html)
|
|
22
|
+
const load = inject('attendeeListLoad', (loaded: LoadAction) => { console.log('no scroll'); loaded(0); })
|
|
23
|
+
|
|
24
|
+
// methods
|
|
25
|
+
const toggle = (user: User) => {
|
|
26
|
+
console.log('selected: ', user.name);
|
|
27
|
+
if (exists(user) == undefined) {
|
|
28
|
+
console.log('user not already selected');
|
|
29
|
+
selectedUsers.value?.push(user);
|
|
30
|
+
} else {
|
|
31
|
+
console.log('user already selected, removing');
|
|
32
|
+
const array = selectedUsers.value as User[];
|
|
33
|
+
|
|
34
|
+
remove(array, (element) => {
|
|
35
|
+
return element.id === user.id;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
selectedUsers.value = [...array];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const exists = (user: User): User | undefined => {
|
|
43
|
+
return find(selectedUsers.value, {'id': user.id});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const onSearchChange = debounce((value: string) => {
|
|
47
|
+
console.log('debounced');
|
|
48
|
+
chatSearchEventHook.trigger({value: value, iterate: true});
|
|
49
|
+
}, 500);
|
|
50
|
+
|
|
51
|
+
const clear = (): void => {
|
|
52
|
+
console.log('clear');
|
|
53
|
+
chatSearchEventHook.trigger({value: undefined, iterate: true});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
watch(users.value, (_users, _newUsers) => {
|
|
57
|
+
filteredUsers.value = _newUsers;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// lifecycle hooks
|
|
61
|
+
onMounted(() => {
|
|
62
|
+
filteredUsers.value = users.value;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
onBeforeUnmount(() => {
|
|
66
|
+
clear();
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<div class="flex h-full justify-between flex-col overflow-y-hidden">
|
|
72
|
+
<CommonSearchInput
|
|
73
|
+
@on-change="onSearchChange"
|
|
74
|
+
@clear="clear"
|
|
75
|
+
/>
|
|
76
|
+
<div class="overflow-y-auto h-full bg-gray-300">
|
|
77
|
+
<!-- Selected Users -->
|
|
78
|
+
<div class="z-50 sticky flex pin-t border-b-4 border-blue bg-gray-300 overflow-x-auto">
|
|
79
|
+
<div
|
|
80
|
+
v-if="selectedUsers?.length"
|
|
81
|
+
class="flex flex-row"
|
|
82
|
+
>
|
|
83
|
+
<div
|
|
84
|
+
v-for="currentUser in selectedUsers"
|
|
85
|
+
:key="currentUser.id"
|
|
86
|
+
class="py-1"
|
|
87
|
+
>
|
|
88
|
+
<div
|
|
89
|
+
v-if="currentUser.id !== user.data.id"
|
|
90
|
+
class="selected-user-item"
|
|
91
|
+
@click="toggle(currentUser)"
|
|
92
|
+
>
|
|
93
|
+
<CommonSvgIcon icon="person" />
|
|
94
|
+
<div class="text-sm py-2">
|
|
95
|
+
<p class="pt-2 text-black leading-none">
|
|
96
|
+
{{ getName(currentUser) }}
|
|
97
|
+
</p>
|
|
98
|
+
</div>
|
|
99
|
+
<CommonSvgIcon icon="close" />
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div
|
|
105
|
+
v-else
|
|
106
|
+
class="flex py-4 w-full"
|
|
107
|
+
>
|
|
108
|
+
<p class="text-center mb-0 text-green-500 w-full">
|
|
109
|
+
Select one or more users to chat with,
|
|
110
|
+
<br>
|
|
111
|
+
then click Start Chat
|
|
112
|
+
</p>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<!-- All Users -->
|
|
117
|
+
<div
|
|
118
|
+
v-for="currentUser in filteredUsers?.data"
|
|
119
|
+
:key="currentUser.id"
|
|
120
|
+
>
|
|
121
|
+
<div
|
|
122
|
+
v-if="currentUser.id !== user.data.id && !exists(currentUser)"
|
|
123
|
+
class="user-item"
|
|
124
|
+
@click="toggle(currentUser)"
|
|
125
|
+
>
|
|
126
|
+
<CommonSvgIcon
|
|
127
|
+
v-if="currentUser.online"
|
|
128
|
+
icon="online"
|
|
129
|
+
/>
|
|
130
|
+
<CommonSvgIcon
|
|
131
|
+
v-if="!currentUser.online"
|
|
132
|
+
icon="offline"
|
|
133
|
+
/>
|
|
134
|
+
<CommonSvgIcon
|
|
135
|
+
icon="person"
|
|
136
|
+
/>
|
|
137
|
+
<div class="text-sm py-4">
|
|
138
|
+
<p class="pt-2 text-black leading-none">
|
|
139
|
+
{{ getName(currentUser) }}
|
|
140
|
+
</p>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
<VueEternalLoading
|
|
145
|
+
v-model:is-initial="isInitial"
|
|
146
|
+
:load="load"
|
|
147
|
+
>
|
|
148
|
+
<template #no-more>
|
|
149
|
+
|
|
150
|
+
</template>
|
|
151
|
+
</VueEternalLoading>
|
|
152
|
+
</div>
|
|
153
|
+
<button
|
|
154
|
+
v-if="selectedUsers?.length !== 0"
|
|
155
|
+
class="create-conversation-button bg-blue-500 border-0 hover:bg-blue-700 text-white font-bold py-3 px-4 focus:outline-none cursor-pointer"
|
|
156
|
+
type="button"
|
|
157
|
+
@click="createConversation(selectedUsers as User[])"
|
|
158
|
+
>
|
|
159
|
+
Start Chat
|
|
160
|
+
</button>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
163
|
+
|
|
164
|
+
<style scoped lang="postcss">
|
|
165
|
+
.disabled {
|
|
166
|
+
opacity: 50%;
|
|
167
|
+
cursor: not-allowed;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.disabled:hover {
|
|
171
|
+
background-color: #3490dc !important;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.create-conversation-button {
|
|
175
|
+
border-bottom-left-radius: 9px;
|
|
176
|
+
border-bottom-right-radius: 9px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.user-item {
|
|
180
|
+
@apply cursor-pointer flex items-center px-4 bg-gray-300;
|
|
181
|
+
border-bottom: 1px solid #dae1e7;
|
|
182
|
+
&:hover {
|
|
183
|
+
background-color: lighten(#dae1e7, 10%);
|
|
184
|
+
}
|
|
185
|
+
&:active {
|
|
186
|
+
background-color: darken(#dae1e7, 10%);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.selected-user-item {
|
|
191
|
+
@apply cursor-pointer flex items-center px-4 border-r-2 border-gray-400;
|
|
192
|
+
&:hover {
|
|
193
|
+
background-color: lighten(#dae1e7, 10%);
|
|
194
|
+
}
|
|
195
|
+
&:active {
|
|
196
|
+
background-color: darken(#dae1e7, 10%);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
</style>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { inject, onMounted, onBeforeUnmount, ref, watch } from 'vue';
|
|
3
|
+
import { storeToRefs } from 'pinia';
|
|
4
|
+
import { debounce, find, remove } from 'lodash-es';
|
|
5
|
+
import { VueEternalLoading } from "@ts-pro/vue-eternal-loading";
|
|
6
|
+
import { useConversationStore } from '../../store/conversations';
|
|
7
|
+
import { chatSearchEventHook } from '../../composables/useEventHooks';
|
|
8
|
+
import type { LoadAction } from "@ts-pro/vue-eternal-loading";
|
|
9
|
+
import type { User } from '../../models/user';
|
|
10
|
+
|
|
11
|
+
// data
|
|
12
|
+
const selectedUsers = ref<User[]>();
|
|
13
|
+
const filteredUsers = ref<User[]>();
|
|
14
|
+
|
|
15
|
+
const conversationStore = useConversationStore();
|
|
16
|
+
|
|
17
|
+
const { user, users, isInitial } = storeToRefs(conversationStore);
|
|
18
|
+
|
|
19
|
+
// emits
|
|
20
|
+
const emit = defineEmits<{
|
|
21
|
+
(event: 'onCreate', value: User[]): void;
|
|
22
|
+
}>();
|
|
23
|
+
|
|
24
|
+
// injected load function
|
|
25
|
+
// (see Vue Eternal Loading docs for reference: https://ts-pro.github.io/vue-eternal-loading/guide/simple-usage.html)
|
|
26
|
+
const load = inject('attendeeListLoad', (loaded: LoadAction) => { console.log('no scroll'); loaded(0); })
|
|
27
|
+
|
|
28
|
+
const { getName } = conversationStore;
|
|
29
|
+
|
|
30
|
+
// methods
|
|
31
|
+
const toggle = (user: User) => {
|
|
32
|
+
if (exists(user) == undefined) {
|
|
33
|
+
selectedUsers.value?.push(user);
|
|
34
|
+
} else {
|
|
35
|
+
const array = selectedUsers.value as User[];
|
|
36
|
+
|
|
37
|
+
remove(array, (element) => {
|
|
38
|
+
return element.id === user.id;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
selectedUsers.value = [...array];
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const exists = (user: User): User | undefined => {
|
|
46
|
+
return find(selectedUsers.value, {'id': user.id});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const onSearchChange = debounce((value: string) => {
|
|
50
|
+
chatSearchEventHook.trigger({value: value, iterate: true});
|
|
51
|
+
}, 500);
|
|
52
|
+
|
|
53
|
+
const clear = (): void => {
|
|
54
|
+
chatSearchEventHook.trigger({value: undefined, iterate: true});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
watch(users.value, (_users, _newUsers) => {
|
|
58
|
+
filteredUsers.value = _newUsers.data;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// lifecycle hooks
|
|
62
|
+
onMounted(() => {
|
|
63
|
+
filteredUsers.value = users.value.data;
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
onBeforeUnmount(() => {
|
|
67
|
+
clear();
|
|
68
|
+
});
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<template>
|
|
72
|
+
<div class="flex h-full justify-between flex-col overflow-y-hidden">
|
|
73
|
+
<CommonSearchInput
|
|
74
|
+
@on-change="onSearchChange"
|
|
75
|
+
/>
|
|
76
|
+
<div class="overflow-y-auto h-full bg-grey-lighter">
|
|
77
|
+
<!-- Selected Users -->
|
|
78
|
+
<div
|
|
79
|
+
v-if="selectedUsers?.length"
|
|
80
|
+
class="z-50 sticky pin-t border-b-4 border-blue bg-grey-lighter"
|
|
81
|
+
>
|
|
82
|
+
<div
|
|
83
|
+
v-for="currentUser in selectedUsers"
|
|
84
|
+
:key="currentUser.id"
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
v-if="currentUser.id !== user.id"
|
|
88
|
+
class="cursor-pointer flex items-center px-4"
|
|
89
|
+
style="border-bottom: 1px solid #dae1e7"
|
|
90
|
+
@click="toggle(currentUser)"
|
|
91
|
+
>
|
|
92
|
+
<CommonSvgIcon icon="check" />
|
|
93
|
+
<CommonSvgIcon icon="person" />
|
|
94
|
+
<div class="text-sm py-2">
|
|
95
|
+
<p class="pt-2 text-black leading-none">
|
|
96
|
+
{{ getName(currentUser) }}
|
|
97
|
+
</p>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<!-- All Users -->
|
|
104
|
+
<div
|
|
105
|
+
v-for="currentUser in filteredUsers"
|
|
106
|
+
:key="currentUser.id"
|
|
107
|
+
>
|
|
108
|
+
<div
|
|
109
|
+
v-if="currentUser.id !== user.id"
|
|
110
|
+
:class="{selected: exists(currentUser), 'bg-grey-lighter': !exists(currentUser) }"
|
|
111
|
+
class="cursor-pointer flex items-center px-4"
|
|
112
|
+
style="border-bottom: 1px solid #dae1e7"
|
|
113
|
+
@click="toggle(currentUser)"
|
|
114
|
+
>
|
|
115
|
+
<CommonSvgIcon
|
|
116
|
+
v-if="currentUser.online"
|
|
117
|
+
icon="online"
|
|
118
|
+
/>
|
|
119
|
+
<CommonSvgIcon
|
|
120
|
+
v-else
|
|
121
|
+
icon="online"
|
|
122
|
+
/>
|
|
123
|
+
<CommonSvgIcon
|
|
124
|
+
icon="person"
|
|
125
|
+
/>
|
|
126
|
+
<div class="text-sm py-4">
|
|
127
|
+
<p class="pt-2 text-black leading-none">
|
|
128
|
+
{{ getName(currentUser) }}
|
|
129
|
+
</p>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
<VueEternalLoading
|
|
134
|
+
v-model:is-initial="isInitial"
|
|
135
|
+
:load="load"
|
|
136
|
+
>
|
|
137
|
+
<template #no-more>
|
|
138
|
+
|
|
139
|
+
</template>
|
|
140
|
+
</VueEternalLoading>
|
|
141
|
+
</div>
|
|
142
|
+
<button
|
|
143
|
+
class="create-conversation-button bg-blue border-0 hover:bg-blue-dark text-white font-bold py-3 px-4 focus:outline-none cursor-pointer"
|
|
144
|
+
type="button"
|
|
145
|
+
@click="emit('onCreate', selectedUsers as User[])"
|
|
146
|
+
>
|
|
147
|
+
Create Conversation
|
|
148
|
+
</button>
|
|
149
|
+
</div>
|
|
150
|
+
</template>
|
|
151
|
+
|
|
152
|
+
<style scoped>
|
|
153
|
+
.selected{background-color:#b8c2cc}.create-conversation-button{border-bottom-left-radius:9px;border-bottom-right-radius:9px}
|
|
154
|
+
</style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useConversationStore } from '#imports';
|
|
3
|
+
|
|
4
|
+
import { MenuOptions } from './ChatWindow.vue';
|
|
5
|
+
|
|
6
|
+
const { toggleChat } = useConversationStore();
|
|
7
|
+
|
|
8
|
+
const emit = defineEmits<{
|
|
9
|
+
(event: 'itemSelected', value: MenuOptions): void;
|
|
10
|
+
}>();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div class="header bg-blue-500">
|
|
15
|
+
<div class="flex flex-row text-center text-white w-full">
|
|
16
|
+
<div
|
|
17
|
+
class="flex-1 grow flex items-center h-full header-button"
|
|
18
|
+
@click="emit('itemSelected', MenuOptions.LIST)"
|
|
19
|
+
>
|
|
20
|
+
<p class="flex-1 py-0 px-2 m-0">
|
|
21
|
+
All Chats
|
|
22
|
+
</p>
|
|
23
|
+
</div>
|
|
24
|
+
<div
|
|
25
|
+
class="flex-1 flex items-center h-full header-button"
|
|
26
|
+
@click="emit('itemSelected', MenuOptions.CREATE)"
|
|
27
|
+
>
|
|
28
|
+
<p class="flex-1 py-0 px-2 m-0">
|
|
29
|
+
New Chat
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
<div
|
|
33
|
+
class="flex-shrink flex items-center h-full header-button"
|
|
34
|
+
@click="toggleChat"
|
|
35
|
+
>
|
|
36
|
+
<CommonSvgIcon
|
|
37
|
+
class="flex-1 flex items-center justify-center"
|
|
38
|
+
fill-color="white"
|
|
39
|
+
icon="close"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<style scoped lang="postcss">
|
|
47
|
+
.header {
|
|
48
|
+
border-top-left-radius: 9px;
|
|
49
|
+
border-top-right-radius: 9px;
|
|
50
|
+
padding: .25rem;
|
|
51
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
|
|
52
|
+
position: relative;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
display: flex;
|
|
55
|
+
}
|
|
56
|
+
.header-title {
|
|
57
|
+
align-self: center;
|
|
58
|
+
padding: 10px;
|
|
59
|
+
flex: 1;
|
|
60
|
+
user-select: none;
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.header-button {
|
|
65
|
+
align-self: center;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
border-radius: 5px;
|
|
68
|
+
padding: .5rem;
|
|
69
|
+
&:hover {
|
|
70
|
+
@apply shadow;
|
|
71
|
+
&:active {
|
|
72
|
+
@apply shadow-inner;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.icon-button {
|
|
78
|
+
width: 40px;
|
|
79
|
+
height: 40px;
|
|
80
|
+
padding: 13px;
|
|
81
|
+
margin-left: auto;
|
|
82
|
+
margin-right: 10px;
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.header-button img, .header-button svg {
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media (max-width: 450px) {
|
|
93
|
+
.header {
|
|
94
|
+
border-radius: 0;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { toRefs } from 'vue';
|
|
3
|
+
type Props = {
|
|
4
|
+
from: string;
|
|
5
|
+
time: string;
|
|
6
|
+
text: string;
|
|
7
|
+
inbound: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = defineProps<Props>();
|
|
11
|
+
|
|
12
|
+
const { from, time, text, inbound } = toRefs(props);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="clearfix">
|
|
17
|
+
<div
|
|
18
|
+
class="w-3/4 mx-4"
|
|
19
|
+
:class="{ 'float-right': !inbound }"
|
|
20
|
+
>
|
|
21
|
+
<div class="flex items-start items-center mb-4 text-sm">
|
|
22
|
+
<CommonSvgIcon icon="person" />
|
|
23
|
+
<div class="flex-1 overflow-hidden">
|
|
24
|
+
<p class="text-gray-500 text-xs mt-0 pt-1">
|
|
25
|
+
{{ from }}
|
|
26
|
+
</p>
|
|
27
|
+
<p
|
|
28
|
+
class="rounded border-2 border-gray-100 leading-normal m-0 p-2"
|
|
29
|
+
:class="{'bg-blue-500 text-white' : !inbound, 'bg-gray-100 text-black' : inbound}"
|
|
30
|
+
>
|
|
31
|
+
{{ text }}
|
|
32
|
+
</p>
|
|
33
|
+
<p class="text-gray-500 text-xs mt-0 pt-1">
|
|
34
|
+
{{ time }}
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { storeToRefs } from 'pinia';
|
|
3
|
+
import { useConversationStore } from '#imports';
|
|
4
|
+
import MessageInput from './MessageInput.vue';
|
|
5
|
+
import { sendMessageEventHook } from '../../composables/useEventHooks';
|
|
6
|
+
import type { User } from '../../models/user';
|
|
7
|
+
import type { Conversation } from '../../models/conversation';
|
|
8
|
+
|
|
9
|
+
const conversationStore = useConversationStore();
|
|
10
|
+
|
|
11
|
+
const { selectedConversation, user } = storeToRefs(conversationStore);
|
|
12
|
+
|
|
13
|
+
const { getName } = conversationStore;
|
|
14
|
+
|
|
15
|
+
// methods
|
|
16
|
+
const isInbound = (userArg: User): boolean => {
|
|
17
|
+
return userArg.id !== user.value.data.id;
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="flex justify-between flex-col h-full overflow-y-hidden">
|
|
23
|
+
<div class="overflow-y-auto">
|
|
24
|
+
<div class="z-50 sticky flex pin-t border-b-4 border-blue-500 bg-gray-300 overflow-x-auto">
|
|
25
|
+
<div class="flex flex-row">
|
|
26
|
+
<div
|
|
27
|
+
v-for="currentUser in selectedConversation?.users"
|
|
28
|
+
:key="currentUser.id"
|
|
29
|
+
class="py-1"
|
|
30
|
+
>
|
|
31
|
+
<div
|
|
32
|
+
v-if="currentUser.id !== user.id"
|
|
33
|
+
class="flex items-center px-4 border-r-2 border-gray-400"
|
|
34
|
+
>
|
|
35
|
+
<CommonSvgIcon icon="person" />
|
|
36
|
+
<div class="text-sm py-2">
|
|
37
|
+
<p class="pt-2 text-black leading-none">
|
|
38
|
+
{{ getName(currentUser) }}
|
|
39
|
+
</p>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div
|
|
45
|
+
v-if="Object.keys(selectedConversation as Conversation[]).length > 0 && selectedConversation?.user?.id !== user.id"
|
|
46
|
+
class="py-1"
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
class="flex items-center px-4 border-r-2 border-gray-400"
|
|
50
|
+
>
|
|
51
|
+
<CommonSvgIcon icon="person" />
|
|
52
|
+
<div class="text-sm py-2">
|
|
53
|
+
<p class="pt-2 text-black leading-none">
|
|
54
|
+
{{ getName(selectedConversation?.user as User) }}
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div>
|
|
63
|
+
<CommonChatMessage
|
|
64
|
+
v-for="message in selectedConversation?.messages"
|
|
65
|
+
:key="message.id"
|
|
66
|
+
:from="message?.user?.name"
|
|
67
|
+
:text="message.message"
|
|
68
|
+
:time="message.created_at"
|
|
69
|
+
:inbound="isInbound(message?.user as User)"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<MessageInput @send-message="(message: string) => {console.log('message event: ', message); sendMessageEventHook.trigger(message)}" />
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { toRefs } from 'vue';
|
|
3
|
+
import { toggleChatWindowEventHook } from '../../composables/useEventHooks';
|
|
4
|
+
import ChatWindow from './ChatWindow.vue';
|
|
5
|
+
import SvgIcon from '../core/SvgIcon.vue';
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
hasNotifications: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>();
|
|
12
|
+
|
|
13
|
+
const { hasNotifications } = toRefs(props);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div>
|
|
18
|
+
<div
|
|
19
|
+
class="launcher"
|
|
20
|
+
@click="toggleChatWindowEventHook.trigger()"
|
|
21
|
+
>
|
|
22
|
+
<SvgIcon icon="chat" />
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div
|
|
26
|
+
v-if="hasNotifications"
|
|
27
|
+
class="bell"
|
|
28
|
+
>
|
|
29
|
+
<SvgIcon icon="bell" />
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<ChatWindow
|
|
33
|
+
@close="toggleChatWindowEventHook.trigger()"
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<style scoped>
|
|
39
|
+
.launcher{background-position:50%;background-repeat:no-repeat;border-radius:50%;bottom:25px;box-shadow:none;cursor:pointer;height:60px;right:75px;transition:box-shadow .2s ease-in-out;width:60px}.bell,.launcher{position:fixed;z-index:9999}.bell{bottom:60px;padding:2px 0;right:15px}.bell svg{height:90px}
|
|
40
|
+
</style>
|