@webitel/ui-sdk 24.12.81 → 24.12.82

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "24.12.81",
3
+ "version": "24.12.82",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -0,0 +1,4 @@
1
+ export const WtTreeMode = {
2
+ Tree: 'tree',
3
+ List: 'list',
4
+ };
@@ -0,0 +1,23 @@
1
+ import { computed } from 'vue';
2
+ import { useI18n } from 'vue-i18n';
3
+ export const useWtTable = ({ headers }) => {
4
+ const { t } = useI18n();
5
+ const tableHeaders = computed(() => {
6
+ return headers
7
+ .filter((header) => header.show === undefined || header.show)
8
+ .map((header) => {
9
+ if (!header.text && header.locale) {
10
+ return {
11
+ ...header,
12
+ text: typeof header.locale === 'string'
13
+ ? t(header.locale)
14
+ : t(header.locale[0]),
15
+ };
16
+ }
17
+ return header;
18
+ });
19
+ });
20
+ return {
21
+ tableHeaders,
22
+ };
23
+ };
@@ -18,7 +18,7 @@ export const useWtTable = ({ headers }) => {
18
18
  text:
19
19
  typeof header.locale === 'string'
20
20
  ? t(header.locale)
21
- : t(header.locale[0]),
21
+ : t(header.locale[0], header.locale[1]),
22
22
  };
23
23
  }
24
24
  return header;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @augments WtApplication
3
+ * represents ui sections in Admin WtApplication
4
+ * without any relation to WtObjects (?)
5
+ */
6
+ export const AdminSections = {
7
+ Agents: 'agents',
8
+ Blacklist: 'blacklist',
9
+ Buckets: 'buckets',
10
+ Calendars: 'calendars',
11
+ Changelogs: 'changelogs',
12
+ ChatGateways: 'chat-gateways',
13
+ Chatplan: 'chatplan',
14
+ CognitiveProfiles: 'cognitive-profiles',
15
+ Communications: 'communications',
16
+ Configuration: 'configuration',
17
+ Dialplan: 'dialplan',
18
+ Devices: 'devices',
19
+ EmailProfiles: 'email-profiles',
20
+ Flow: 'flow',
21
+ Gateways: 'gateways',
22
+ GlobalVariables: 'global-variables',
23
+ ImportCsv: 'import-csv',
24
+ License: 'license',
25
+ Media: 'media',
26
+ Members: 'members',
27
+ Objects: 'objects',
28
+ PauseCause: 'pause-cause',
29
+ PauseTemplates: 'pause-templates',
30
+ Queues: 'queues',
31
+ Regions: 'regions',
32
+ ResourceGroups: 'resource-groups',
33
+ Resources: 'resources',
34
+ Roles: 'roles',
35
+ ShiftTemplates: 'shift-templates',
36
+ SingleSignOn: 'single-sign-on',
37
+ Skills: 'skills',
38
+ Storage: 'storage',
39
+ StoragePolicies: 'storage-policies',
40
+ Teams: 'teams',
41
+ Triggers: 'triggers',
42
+ Users: 'users',
43
+ WorkingConditions: 'working-conditions',
44
+ };
@@ -0,0 +1,3 @@
1
+ export const AuditorSections = {
2
+ Scorecards: 'scorecards',
3
+ };
@@ -0,0 +1,14 @@
1
+ export const CrmSections = {
2
+ Contacts: 'contacts',
3
+ Cases: 'cases',
4
+ // CONFIGURATION - LOOKUPS
5
+ Slas: 'slas',
6
+ ServiceCatalogs: 'service-catalogs',
7
+ Priorities: 'priorities',
8
+ Statuses: 'statuses',
9
+ Sources: 'sources',
10
+ CloseReasonGroups: 'close-reason-groups',
11
+ ContactGroups: 'contact-groups',
12
+ CaseSources: 'case-sources',
13
+ CustomLookups: 'custom-lookups',
14
+ };
@@ -0,0 +1,5 @@
1
+ export const SupervisorSections = {
2
+ Queues: 'queues',
3
+ Agents: 'agents',
4
+ ActiveCalls: 'activeCalls',
5
+ };
@@ -0,0 +1,9 @@
1
+ export const WtApplication = {
2
+ Admin: 'admin',
3
+ Agent: 'agent',
4
+ Supervisor: 'supervisor',
5
+ History: 'history',
6
+ Audit: 'audit',
7
+ Analytics: 'grafana',
8
+ Crm: 'crm',
9
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Represents existing Webitel entities
3
+ */
4
+ export const WtObject = {
5
+ Agent: 'agent',
6
+ Queue: 'queue',
7
+ Contact: 'contact',
8
+ Regions: 'regions',
9
+ };
@@ -0,0 +1,57 @@
1
+ import { ComponentSize } from '../enums/ComponentSize/ComponentSize';
2
+ const numerics = Object.values(ComponentSize).reduce((nums, size, index) => {
3
+ return {
4
+ ...nums,
5
+ [size]: index,
6
+ };
7
+ }, {});
8
+ /**
9
+ * Compare two sizes, returning a number indicating the difference between them.
10
+ *
11
+ * @param s1
12
+ * @param s2
13
+ * @returns {number}
14
+ *
15
+ * @example
16
+ * compareSize(ComponentSize.XS, ComponentSize.MD); // true
17
+ * compareSize(ComponentSize.LG, ComponentSize.SM); // false
18
+ */
19
+ export const compareSize = (s1, s2) => {
20
+ return numerics[s1] - numerics[s2];
21
+ };
22
+ /**
23
+ * Check if s1 is smaller than s2
24
+ * @param s1
25
+ * @param s2
26
+ * @returns {boolean}
27
+ */
28
+ export const smallerThen = (s1, s2) => {
29
+ return compareSize(s1, s2) < 0;
30
+ };
31
+ /**
32
+ * Check if s1 is smaller or equal to s2
33
+ * @param s1
34
+ * @param s2
35
+ * @returns {boolean}
36
+ */
37
+ export const smallerOrEqual = (s1, s2) => {
38
+ return compareSize(s1, s2) <= 0;
39
+ };
40
+ /**
41
+ * Check if s1 is greater than s2
42
+ * @param s1
43
+ * @param s2
44
+ * @returns {boolean}
45
+ */
46
+ export const greaterThen = (s1, s2) => {
47
+ return compareSize(s1, s2) > 0;
48
+ };
49
+ /**
50
+ * Check if s1 is greater or equal to s2
51
+ * @param s1
52
+ * @param s2
53
+ * @returns {boolean}
54
+ */
55
+ export const greaterOrEqual = (s1, s2) => {
56
+ return compareSize(s1, s2) >= 0;
57
+ };