@webitel/ui-sdk 26.8.52 → 26.8.54
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 +1 -1
- package/src/modules/Notifications/assets/audio/self-assigned-call.wav +0 -0
- package/src/modules/Notifications/store/NotificationsStoreModule.js +6 -0
- package/src/modules/TableComponentModule/composables/useTableEmpty.ts +35 -3
- package/types/.tsbuildinfo +1 -1
- package/types/modules/Notifications/store/NotificationsStoreModule.d.ts +1 -0
- package/types/modules/TableComponentModule/composables/useTableEmpty.d.ts +10 -2
package/package.json
CHANGED
|
Binary file
|
|
@@ -7,12 +7,16 @@ import newChatSound from '../assets/audio/chat-new.wav';
|
|
|
7
7
|
import newMessageSound from '../assets/audio/chat-new-message.wav';
|
|
8
8
|
import endCallSound from '../assets/audio/end-call.wav';
|
|
9
9
|
import ringingSound from '../assets/audio/ringing.mp3';
|
|
10
|
+
import selfAssignedCallSound from '../assets/audio/self-assigned-call.wav';
|
|
10
11
|
import endTask from '../assets/audio/task-end.wav';
|
|
11
12
|
import newTask from '../assets/audio/task-new.wav';
|
|
12
13
|
import notificationIcon from '../assets/img/notification-icon.png';
|
|
13
14
|
|
|
14
15
|
const NOTIFICATION_VISIBLE_INTERVAL = 2000;
|
|
15
16
|
|
|
17
|
+
// no CallActions member represents this - it is a client-only notification, not a CTI transport event
|
|
18
|
+
export const SELF_ASSIGNED_CALL_ACTION = 'self_assigned_call';
|
|
19
|
+
|
|
16
20
|
const getNotificationSound = (action) => {
|
|
17
21
|
switch (action) {
|
|
18
22
|
case JobState.Distribute:
|
|
@@ -31,6 +35,8 @@ const getNotificationSound = (action) => {
|
|
|
31
35
|
return new Audio(ringingSound);
|
|
32
36
|
case CallActions.Hangup:
|
|
33
37
|
return new Audio(endCallSound);
|
|
38
|
+
case SELF_ASSIGNED_CALL_ACTION:
|
|
39
|
+
return new Audio(selfAssignedCallSound);
|
|
34
40
|
default:
|
|
35
41
|
return false;
|
|
36
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import deepmerge from 'deepmerge';
|
|
2
|
-
import { computed, inject,
|
|
2
|
+
import { computed, inject, toRef } from 'vue';
|
|
3
3
|
import { useI18n } from 'vue-i18n';
|
|
4
4
|
|
|
5
5
|
import { EmptyCause } from '../../../enums/index';
|
|
@@ -9,6 +9,12 @@ import EmptyFiltersLight from '../_internals/assets/empty-filters-light.svg';
|
|
|
9
9
|
import EmptyTableDark from '../_internals/assets/empty-table-dark.svg';
|
|
10
10
|
import EmptyTableLight from '../_internals/assets/empty-table-light.svg';
|
|
11
11
|
|
|
12
|
+
type DeepPartial<T> = T extends object
|
|
13
|
+
? {
|
|
14
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
15
|
+
}
|
|
16
|
+
: T;
|
|
17
|
+
|
|
12
18
|
interface EmptyImageSet {
|
|
13
19
|
dark: string;
|
|
14
20
|
light: string;
|
|
@@ -41,9 +47,29 @@ export interface UseTableEmptySource {
|
|
|
41
47
|
isLoading?: Readable<boolean | undefined>;
|
|
42
48
|
}
|
|
43
49
|
|
|
50
|
+
type MaybeOverridesGetter =
|
|
51
|
+
| DeepPartial<EmptyStateConfig>
|
|
52
|
+
| Readable<DeepPartial<EmptyStateConfig>>
|
|
53
|
+
| (() => DeepPartial<EmptyStateConfig>);
|
|
54
|
+
|
|
55
|
+
const resolveOverrides = (
|
|
56
|
+
source: MaybeOverridesGetter,
|
|
57
|
+
): DeepPartial<EmptyStateConfig> => {
|
|
58
|
+
if (typeof source === 'function') return source();
|
|
59
|
+
if (source && typeof source === 'object' && 'value' in source) {
|
|
60
|
+
return source.value;
|
|
61
|
+
}
|
|
62
|
+
return source;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @param overrides plain object, ref, computed, or getter — use a reactive
|
|
67
|
+
* source (not a plain object literal) if any value inside depends on
|
|
68
|
+
* locale/dark mode, so it re-evaluates instead of freezing at first render
|
|
69
|
+
*/
|
|
44
70
|
export const useTableEmpty = (
|
|
45
71
|
{ dataList, filters, error, isLoading }: UseTableEmptySource = {},
|
|
46
|
-
overrides:
|
|
72
|
+
overrides: MaybeOverridesGetter = {},
|
|
47
73
|
) => {
|
|
48
74
|
const { t } = useI18n();
|
|
49
75
|
|
|
@@ -90,7 +116,13 @@ export const useTableEmpty = (
|
|
|
90
116
|
},
|
|
91
117
|
}));
|
|
92
118
|
|
|
93
|
-
const merged = computed(
|
|
119
|
+
const merged = computed<EmptyStateConfig>(
|
|
120
|
+
() =>
|
|
121
|
+
deepmerge(
|
|
122
|
+
defaults.value,
|
|
123
|
+
resolveOverrides(overrides),
|
|
124
|
+
) as EmptyStateConfig,
|
|
125
|
+
);
|
|
94
126
|
|
|
95
127
|
const darkMode = toRef(inject<boolean>('darkMode'));
|
|
96
128
|
|