forked from webex/widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwc.ts
More file actions
107 lines (98 loc) · 3.31 KB
/
Copy pathwc.ts
File metadata and controls
107 lines (98 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import r2wc from '@r2wc/react-to-web-component';
import UserStateComponent from './components/UserState/user-state';
import StationLoginComponent from './components/StationLogin/station-login';
import CallControlComponent from './components/task/CallControl/call-control';
import CallControlCADComponent from './components/task/CallControl/call-control';
import IncomingTaskComponent from './components/task/IncomingTask/incoming-task';
import TaskListComponent from './components/task/TaskList/task-list';
import OutdialCallComponent from './components/task/OutdialCall/outdial-call';
const WebUserState = r2wc(UserStateComponent, {
props: {
// type '"string" | "number" | "boolean" | "function" | "json"
idleCodes: 'json',
setAgentStatus: 'function',
isSettingAgentStatus: 'boolean',
elapsedTime: 'number',
lastIdleStateChangeElapsedTime: 'number',
currentState: 'string',
customState: 'json',
logger: 'function',
},
});
if (!customElements.get('component-cc-user-state')) {
customElements.define('component-cc-user-state', WebUserState);
}
const WebStationLogin = r2wc(StationLoginComponent, {
props: {
teams: 'json',
loginOptions: 'json',
login: 'function',
logout: 'function',
loginSuccess: 'json',
loginFailure: 'json',
logoutSuccess: 'json',
setDeviceType: 'function',
setDialNumber: 'function',
setTeam: 'function',
isAgentLoggedIn: 'boolean',
handleContinue: 'function',
deviceType: 'string',
showMultipleLoginAlert: 'boolean',
logger: 'function',
},
});
if (!customElements.get('component-cc-station-login')) {
customElements.define('component-cc-station-login', WebStationLogin);
}
const commonPropsForCallControl: Record<string, 'string' | 'number' | 'boolean' | 'function' | 'json'> = {
currentTask: 'json',
audioRef: 'json',
wrapupCodes: 'json',
wrapupRequired: 'boolean',
toggleHold: 'function',
toggleRecording: 'function',
endCall: 'function',
wrapupCall: 'function',
isHeld: 'boolean',
setIsHeld: 'function',
};
const WebCallControlCADComponent = r2wc(CallControlCADComponent, {
props: commonPropsForCallControl,
});
const WebCallControl = r2wc(CallControlComponent, {
props: commonPropsForCallControl,
});
if (!customElements.get('component-cc-call-control-cad')) {
customElements.define('component-cc-call-control-cad', WebCallControlCADComponent);
}
if (!customElements.get('component-cc-call-control')) {
customElements.define('component-cc-call-control', WebCallControl);
}
const WebIncomingTask = r2wc(IncomingTaskComponent, {
props: {
incomingTask: 'json',
isBrowser: 'boolean',
accept: 'function',
reject: 'function',
},
});
if (!customElements.get('component-cc-incoming-task')) {
customElements.define('component-cc-incoming-task', WebIncomingTask);
}
const WebTaskList = r2wc(TaskListComponent, {
props: {
currentTask: 'json',
taskList: 'json',
isBrowser: 'boolean',
acceptTask: 'function',
declineTask: 'function',
logger: 'function',
},
});
if (!customElements.get('component-cc-task-list')) {
customElements.define('component-cc-task-list', WebTaskList);
}
const WebOutdialCallComponent = r2wc(OutdialCallComponent);
if (!customElements.get('component-cc-out-dial-call')) {
customElements.define('component-cc-out-dial-call', WebOutdialCallComponent);
}