@webitel/ui-sdk 26.8.138 → 26.8.140

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.
Files changed (57) hide show
  1. package/dist/clients-B87Nx03m.js +42474 -0
  2. package/dist/{components-DirfTDyC.js → components-peYTVwLb.js} +1238 -1156
  3. package/dist/{convertDuration-y5tRHrgE.js → convertDuration-CIPonKKW.js} +1 -1
  4. package/dist/{enums-CLu6QDOc.js → enums-CKer6GJR.js} +0 -1
  5. package/dist/ui-sdk.css +1 -1
  6. package/dist/ui-sdk.js +3 -3
  7. package/dist/ui-sdk.umd.cjs +650 -650
  8. package/dist/{useValidation-BO5PKJ7c.js → useValidation-B1EJdGM4.js} +1 -1
  9. package/dist/{utils-DVfDViCh.js → utils-DQQQIpjz.js} +1 -1
  10. package/dist/{wt-action-bar-RruYJ0y6.js → wt-action-bar-CJiWenUy.js} +2 -2
  11. package/dist/{wt-badge-LyfZxvmI.js → wt-badge-B3NI2a3-.js} +1 -1
  12. package/dist/{wt-button-COHcpvhY.js → wt-button-DSs8WAg-.js} +2 -2
  13. package/dist/{wt-chat-emoji-D7UDa2Xn.js → wt-chat-emoji-D72hYTJU.js} +4 -4
  14. package/dist/{wt-datepicker-D5ARLEeQ.js → wt-datepicker-Cx8yPH4d.js} +2 -2
  15. package/dist/{wt-display-chip-items-Dqwb5b-S.js → wt-display-chip-items-DwdzIwJH.js} +2 -2
  16. package/dist/{wt-dual-panel-BRgwCFK_.js → wt-dual-panel-BHfOeLJZ.js} +1 -1
  17. package/dist/{wt-expansion-card-JQxugKar.js → wt-expansion-card-CNkGLQvo.js} +1 -1
  18. package/dist/{wt-expansion-panel-BHxaV6pi.js → wt-expansion-panel-CGFamfkt.js} +1 -1
  19. package/dist/{wt-icon-CgzRk5RS.js → wt-icon-Cr_aDKIX.js} +1 -1
  20. package/dist/{wt-icon-action-DqN65BiE.js → wt-icon-action-DnDFrScL.js} +1 -1
  21. package/dist/{wt-icon-btn-DwwaYWSw.js → wt-icon-btn-Dy4odu2Q.js} +1 -1
  22. package/dist/{wt-notifications-bar-BlybO6wl.js → wt-notifications-bar-BDtvykT7.js} +2 -2
  23. package/dist/{wt-player-CVj1a9-l.js → wt-player-BjnujOrP.js} +3 -3
  24. package/dist/{wt-screen-recordings-action-DKCrbDdO.js → wt-screen-recordings-action-CHlh4sNO.js} +1 -1
  25. package/dist/{wt-search-bar-DpsACKmt.js → wt-search-bar-Bp9M1oCq.js} +1 -1
  26. package/dist/{wt-send-message-popup-CQ0-OKQE.js → wt-send-message-popup-D3KQ6fqe.js} +3 -3
  27. package/dist/{wt-status-select-CwrK_Q9v.js → wt-status-select-DItpCCVE.js} +2 -2
  28. package/dist/{wt-table-C_Vk3v8K.js → wt-table-ByNazLN3.js} +3 -3
  29. package/dist/{wt-timepicker-DhXZ0OI8.js → wt-timepicker-BW0HmFJI.js} +2 -2
  30. package/dist/{wt-toast-CrvaF-UL.js → wt-toast-CAoQkSuJ.js} +2 -2
  31. package/dist/{wt-tree-table-BqV7-6Pz.js → wt-tree-table-Rf2Jq-39.js} +1 -1
  32. package/dist/{wt-type-extension-value-input-DPFFWC81.js → wt-type-extension-value-input-BQjSYAdt.js} +6 -6
  33. package/dist/{wt-vidstack-player-DB7M5VzI.js → wt-vidstack-player-DwS6IkZJ.js} +5 -5
  34. package/package.json +1 -1
  35. package/src/components/index.js +3 -0
  36. package/src/components/wt-navigation-rail/__tests__/WtNavigationRail.spec.js +90 -0
  37. package/src/components/wt-navigation-rail/_internals/navigation-rail-button.vue +79 -0
  38. package/src/components/wt-navigation-rail/_variables.css +45 -0
  39. package/src/components/wt-navigation-rail/types/WtNavigationRail.ts +19 -0
  40. package/src/components/wt-navigation-rail/wt-navigation-rail.vue +108 -0
  41. package/src/components/wt-page/__tests__/WtPage.spec.js +60 -1
  42. package/src/components/wt-page/wt-page.vue +40 -3
  43. package/src/css/components-variables.css +1 -0
  44. package/src/enums/WebitelApplications/AdminSections.ts +0 -1
  45. package/src/modules/Userinfo/classes/ApplicationsAccess.ts +6 -6
  46. package/src/modules/Userinfo/classes/__tests__/ApplicationsAccess.spec.ts +2 -9
  47. package/src/modules/Userinfo/mappings/__tests__/mappings.spec.ts +10 -12
  48. package/src/modules/Userinfo/mappings/mappings.ts +2 -2
  49. package/types/.tsbuildinfo +1 -1
  50. package/types/components/index.d.ts +3 -1
  51. package/types/components/wt-navigation-rail/__tests__/WtNavigationRail.spec.d.ts +1 -0
  52. package/types/components/wt-navigation-rail/_internals/navigation-rail-button.vue.d.ts +12 -0
  53. package/types/components/wt-navigation-rail/types/WtNavigationRail.d.ts +17 -0
  54. package/types/components/wt-navigation-rail/wt-navigation-rail.vue.d.ts +25 -0
  55. package/types/components/wt-page/wt-page.vue.d.ts +20 -1
  56. package/types/enums/WebitelApplications/AdminSections.d.ts +0 -1
  57. package/dist/clients-CKBvYoKf.js +0 -42456
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <nav
3
+ v-if="hasItems"
4
+ class="wt-navigation-rail"
5
+ aria-label="Navigation rail"
6
+ >
7
+ <template v-for="section of sections" :key="section.name">
8
+ <div
9
+ v-if="section.items.length"
10
+ :class="['wt-navigation-rail__group', `wt-navigation-rail__group--${section.name}`]"
11
+ >
12
+ <ul class="wt-navigation-rail__list">
13
+ <li v-for="item of section.items" :key="item.id">
14
+ <navigation-rail-button
15
+ :item="item"
16
+ :active="item.id === activeItemId"
17
+ @select="emit('select', $event)"
18
+ />
19
+ </li>
20
+ </ul>
21
+ </div>
22
+ </template>
23
+ </nav>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import { computed } from 'vue';
28
+
29
+ import NavigationRailButton from './_internals/navigation-rail-button.vue';
30
+ import type { NavigationRailItem } from './types/WtNavigationRail';
31
+
32
+ /**
33
+ * Vertical app navigation. Holds no routing logic: emits `select`,
34
+ * host application decides what to do (navigate, open panel, etc.).
35
+ * Lists are data-driven by props. Renders nothing while both lists are empty.
36
+ */
37
+ const props = withDefaults(
38
+ defineProps<{
39
+ /** Buttons pinned to the top */
40
+ topItems?: NavigationRailItem[];
41
+ /** Buttons pinned to the bottom */
42
+ bottomItems?: NavigationRailItem[];
43
+ /** Id of the active item */
44
+ activeItemId?: string;
45
+ }>(),
46
+ {
47
+ topItems: () => [],
48
+ bottomItems: () => [],
49
+ activeItemId: '',
50
+ },
51
+ );
52
+
53
+ const hasItems = computed(
54
+ () => !!props.topItems.length || !!props.bottomItems.length,
55
+ );
56
+
57
+ const sections = computed(
58
+ () =>
59
+ [
60
+ {
61
+ name: 'top',
62
+ items: props.topItems,
63
+ },
64
+ {
65
+ name: 'bottom',
66
+ items: props.bottomItems,
67
+ },
68
+ ] as const,
69
+ );
70
+
71
+ const emit = defineEmits<{
72
+ /** Fires on click of enabled item */
73
+ select: [
74
+ item: NavigationRailItem,
75
+ ];
76
+ }>();
77
+ </script>
78
+
79
+ <style scoped>
80
+ .wt-navigation-rail {
81
+ display: flex;
82
+ flex-direction: column;
83
+ flex: 0 0 auto;
84
+ gap: var(--wt-navigation-rail-gap);
85
+ box-sizing: border-box;
86
+ background: var(--wt-navigation-rail-background);
87
+ padding: var(--wt-navigation-rail-padding-y) var(--wt-navigation-rail-padding-x);
88
+ width: var(--wt-navigation-rail-width);
89
+ min-height: 0;
90
+ }
91
+
92
+ .wt-navigation-rail__group--bottom {
93
+ margin-top: auto;
94
+ }
95
+
96
+ .wt-navigation-rail__group,
97
+ .wt-navigation-rail__list {
98
+ display: flex;
99
+ flex-direction: column;
100
+ gap: var(--wt-navigation-rail-gap);
101
+ }
102
+
103
+ .wt-navigation-rail__list {
104
+ margin: 0;
105
+ padding: 0;
106
+ list-style: none;
107
+ }
108
+ </style>
@@ -1,4 +1,4 @@
1
- import { shallowMount } from '@vue/test-utils';
1
+ import { mount, shallowMount } from '@vue/test-utils';
2
2
 
3
3
  import WtPage from '../wt-page.vue';
4
4
 
@@ -32,4 +32,63 @@ describe('WtPage', () => {
32
32
  const wrapper = shallowMount(WtPage);
33
33
  expect(wrapper.find('.wt-page__header').exists()).toBe(false);
34
34
  });
35
+
36
+ describe('navigation rail', () => {
37
+ const navigationRail = {
38
+ topItems: [
39
+ {
40
+ id: 'home',
41
+ icon: 'home',
42
+ label: 'Home',
43
+ },
44
+ ],
45
+ activeItemId: 'home',
46
+ };
47
+ const mountPage = (props) =>
48
+ mount(WtPage, {
49
+ props,
50
+ global: {
51
+ stubs: {
52
+ WtButton: false,
53
+ },
54
+ },
55
+ });
56
+
57
+ it('does not render rail without navigationRail prop', () => {
58
+ const wrapper = mountPage({});
59
+ expect(wrapper.find('.wt-navigation-rail').exists()).toBe(false);
60
+ });
61
+
62
+ it('does not render rail while both lists are empty', () => {
63
+ const wrapper = mountPage({
64
+ navigationRail: {
65
+ topItems: [],
66
+ bottomItems: [],
67
+ },
68
+ });
69
+ expect(wrapper.find('.wt-navigation-rail').exists()).toBe(false);
70
+ });
71
+
72
+ it('renders rail outside of the body when a list is not empty', () => {
73
+ const wrapper = mountPage({
74
+ navigationRail,
75
+ });
76
+ expect(
77
+ wrapper.find('.wt-page__main > .wt-navigation-rail').exists(),
78
+ ).toBe(true);
79
+ expect(wrapper.find('.wt-page__body .wt-navigation-rail').exists()).toBe(
80
+ false,
81
+ );
82
+ });
83
+
84
+ it('emits navigation-select on rail item click', async () => {
85
+ const wrapper = mountPage({
86
+ navigationRail,
87
+ });
88
+ await wrapper.find('button').trigger('click');
89
+ expect(wrapper.emitted('navigation-select')[0]).toEqual([
90
+ navigationRail.topItems[0],
91
+ ]);
92
+ });
93
+ });
35
94
  });
@@ -3,18 +3,48 @@
3
3
  <div v-if="$slots.header" class="wt-page__header">
4
4
  <slot name="header" />
5
5
  </div>
6
- <div class="wt-page__body">
7
- <!-- @slot Layouts of the page -->
8
- <slot />
6
+ <div class="wt-page__main">
7
+ <wt-navigation-rail
8
+ v-if="navigationRail"
9
+ :top-items="navigationRail.topItems"
10
+ :bottom-items="navigationRail.bottomItems"
11
+ :active-item-id="navigationRail.activeItemId"
12
+ @select="emit('navigation-select', $event)"
13
+ />
14
+ <div class="wt-page__body">
15
+ <!-- @slot Layouts of the page -->
16
+ <slot />
17
+ </div>
9
18
  </div>
10
19
  </div>
11
20
  </template>
12
21
 
13
22
  <script setup lang="ts">
23
+ import type { NavigationRailItem } from '../wt-navigation-rail/types/WtNavigationRail';
24
+ import WtNavigationRail from '../wt-navigation-rail/wt-navigation-rail.vue';
25
+
14
26
  /**
15
27
  * Top structural level of the interface: header + body, where the body
16
28
  * distributes its width between one or more `wt-layout`s.
29
+ * Optional navigation rail is shown at the left of the body and
30
+ * is hidden while both of its lists are empty.
17
31
  */
32
+ defineProps<{
33
+ /** Navigation rail config, rail is not rendered when omitted */
34
+ navigationRail?: {
35
+ topItems?: NavigationRailItem[];
36
+ bottomItems?: NavigationRailItem[];
37
+ activeItemId?: string;
38
+ };
39
+ }>();
40
+
41
+ const emit = defineEmits<{
42
+ /** Fires on click of enabled navigation rail item */
43
+ 'navigation-select': [
44
+ item: NavigationRailItem,
45
+ ];
46
+ }>();
47
+
18
48
  defineSlots<{
19
49
  header?: () => unknown;
20
50
  default?: () => unknown;
@@ -38,6 +68,13 @@ defineSlots<{
38
68
  flex: 0 0 auto;
39
69
  }
40
70
 
71
+ .wt-page__main {
72
+ display: flex;
73
+ flex: 1 1 auto;
74
+ min-width: 0;
75
+ min-height: 0;
76
+ }
77
+
41
78
  .wt-page__body {
42
79
  display: flex;
43
80
  position: relative;
@@ -31,6 +31,7 @@
31
31
  @import "../components/wt-loader/_variables.css";
32
32
  @import "../components/wt-logo/_variables.css";
33
33
  @import "../components/wt-navigation-bar/_variables.css";
34
+ @import "../components/wt-navigation-rail/_variables.css";
34
35
  @import "../components/wt-notifications-bar/_variables.css";
35
36
  @import "../components/wt-page/_variables.css";
36
37
  @import "../components/wt-page-wrapper/_variables.css";
@@ -39,7 +39,6 @@ export const AdminSections = {
39
39
  Teams: 'teams',
40
40
  Triggers: 'triggers',
41
41
  Users: 'users',
42
- WorkingConditions: 'working-conditions',
43
42
  QuickReplies: 'quick-replies',
44
43
  } as const;
45
44
 
@@ -139,10 +139,6 @@ const applicationsAccess = (value = true): ApplicationsAccessSchema => ({
139
139
  _enabled: value,
140
140
  _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.Media}`,
141
141
  },
142
- [AdminSections.WorkingConditions]: {
143
- _enabled: value,
144
- _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.WorkingConditions}`,
145
- },
146
142
  [AdminSections.QuickReplies]: {
147
143
  _enabled: value,
148
144
  _locale: `WtApplication.${WtApplication.Admin}.sections.${AdminSections.QuickReplies}`,
@@ -291,13 +287,17 @@ const applicationsAccess = (value = true): ApplicationsAccessSchema => ({
291
287
  _enabled: value,
292
288
  _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.ForecastCalculation}`,
293
289
  },
290
+ [WfmSections.ShiftTemplates]: {
291
+ _enabled: value,
292
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.ShiftTemplates}`,
293
+ },
294
294
  [WfmSections.PauseTemplates]: {
295
295
  _enabled: value,
296
296
  _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.PauseTemplates}`,
297
297
  },
298
- [WfmSections.ShiftTemplates]: {
298
+ [WfmSections.WorkingConditions]: {
299
299
  _enabled: value,
300
- _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.ShiftTemplates}`,
300
+ _locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.WorkingConditions}`,
301
301
  },
302
302
  },
303
303
  });
@@ -7,8 +7,9 @@ const wfmSections = [
7
7
  WfmSections.Agents,
8
8
  WfmSections.Schedules,
9
9
  WfmSections.ForecastCalculation,
10
- WfmSections.PauseTemplates,
11
10
  WfmSections.ShiftTemplates,
11
+ WfmSections.PauseTemplates,
12
+ WfmSections.WorkingConditions,
12
13
  ];
13
14
 
14
15
  describe('ApplicationsAccess', () => {
@@ -27,14 +28,6 @@ describe('ApplicationsAccess', () => {
27
28
  });
28
29
  });
29
30
 
30
- it('does not include lookups that are not moved to WFM yet', () => {
31
- const { access } = new ApplicationsAccess();
32
-
33
- expect(
34
- access[WtApplication.Wfm][WfmSections.WorkingConditions],
35
- ).toBeUndefined();
36
- });
37
-
38
31
  it('restores WFM as disabled when it is missing from saved access', () => {
39
32
  const { access } = new ApplicationsAccess({
40
33
  access: {
@@ -1,11 +1,6 @@
1
1
  import { describe, expect, it } from 'vitest';
2
2
 
3
- import {
4
- AdminSections,
5
- WfmSections,
6
- WtApplication,
7
- WtObject,
8
- } from '../../../../enums';
3
+ import { WfmSections, WtApplication, WtObject } from '../../../../enums';
9
4
  import { castWtObjectToUiSection } from '../../scripts/utils';
10
5
 
11
6
  describe('mapWtObjectToUiSection', () => {
@@ -15,12 +10,6 @@ describe('mapWtObjectToUiSection', () => {
15
10
  );
16
11
  });
17
12
 
18
- it('keeps Admin mapping for lookups that are not moved to WFM yet', () => {
19
- expect(
20
- castWtObjectToUiSection(WtApplication.Admin, WtObject.WorkingCondition),
21
- ).toBe(AdminSections.WorkingConditions);
22
- });
23
-
24
13
  it('maps shift templates to WFM only', () => {
25
14
  expect(
26
15
  castWtObjectToUiSection(WtApplication.Wfm, WtObject.ShiftTemplate),
@@ -38,4 +27,13 @@ describe('mapWtObjectToUiSection', () => {
38
27
  castWtObjectToUiSection(WtApplication.Admin, WtObject.PauseTemplate),
39
28
  ).toBeUndefined();
40
29
  });
30
+
31
+ it('maps working conditions to WFM only', () => {
32
+ expect(
33
+ castWtObjectToUiSection(WtApplication.Wfm, WtObject.WorkingCondition),
34
+ ).toBe(WfmSections.WorkingConditions);
35
+ expect(
36
+ castWtObjectToUiSection(WtApplication.Admin, WtObject.WorkingCondition),
37
+ ).toBeUndefined();
38
+ });
41
39
  });
@@ -241,7 +241,6 @@ export const mapWtObjectToUiSection: Partial<
241
241
  [WtObject.ChangeLog]: AdminSections.Changelogs,
242
242
  [WtObject.Configuration]: AdminSections.Configuration,
243
243
  [WtObject.GlobalVariable]: AdminSections.GlobalVariables,
244
- [WtObject.WorkingCondition]: AdminSections.WorkingConditions,
245
244
  [WtObject.Member]: AdminSections.Members,
246
245
  [WtObject.QuickReply]: AdminSections.QuickReplies,
247
246
  [WtObject.ActivityType]: AdminSections.ActivityTypes,
@@ -277,8 +276,9 @@ export const mapWtObjectToUiSection: Partial<
277
276
  // Wfm sections
278
277
  [WtApplication.Wfm]: {
279
278
  [WtObject.Agent]: WfmSections.Agents,
280
- [WtObject.PauseTemplate]: WfmSections.PauseTemplates,
281
279
  [WtObject.ShiftTemplate]: WfmSections.ShiftTemplates,
280
+ [WtObject.PauseTemplate]: WfmSections.PauseTemplates,
281
+ [WtObject.WorkingCondition]: WfmSections.WorkingConditions,
282
282
  },
283
283
  };
284
284