@webitel/ui-sdk 26.6.59 → 26.6.61

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 (59) hide show
  1. package/dist/{clients-BDtL1Ajm.js → clients-DPvJvOx5.js} +1 -1
  2. package/dist/{components-CK9vGYUg.js → components-GEKIa6Vp.js} +1141 -2406
  3. package/dist/{enums-CBWwTuq7.js → enums-BwgSueOO.js} +32 -28
  4. package/dist/ui-sdk.css +1 -1
  5. package/dist/ui-sdk.js +73 -53
  6. package/dist/ui-sdk.umd.cjs +543 -541
  7. package/dist/{useValidation-B0voza7s.js → useValidation-Hdk6hzmc.js} +1 -1
  8. package/dist/{wt-action-bar-B17FBHD7.js → wt-action-bar-Dbt6CgEp.js} +2 -2
  9. package/dist/{wt-button-0kP5bPMs.js → wt-button-BDGLW4OG.js} +2 -2
  10. package/dist/{wt-chat-emoji-BiPhHNuw.js → wt-chat-emoji-CAn773-T.js} +4 -4
  11. package/dist/{wt-datepicker-baNcFWZ1.js → wt-datepicker-BjbWDS8B.js} +2 -2
  12. package/dist/{wt-display-chip-items-xm8cHws_.js → wt-display-chip-items-DAnyat0v.js} +1 -1
  13. package/dist/{wt-dual-panel-C5LZm1Tr.js → wt-dual-panel-C54Hwdwc.js} +1 -1
  14. package/dist/{wt-expansion-card-C2qETdn0.js → wt-expansion-card-CVPU9twV.js} +1 -1
  15. package/dist/{wt-expansion-panel-Dvzj9PTk.js → wt-expansion-panel-B1u06Hz8.js} +1 -1
  16. package/dist/{wt-icon-DIdpwmpC.js → wt-icon-Bd8GvqIt.js} +2 -1
  17. package/dist/{wt-icon-action-C8WN2oVD.js → wt-icon-action-mNjxBL1c.js} +1 -1
  18. package/dist/{wt-icon-btn-BLnhJADA.js → wt-icon-btn-BL4UZ7Fv.js} +1 -1
  19. package/dist/{wt-notifications-bar-Dx1YPqFu.js → wt-notifications-bar-Tg1pDfMR.js} +2 -2
  20. package/dist/{wt-player-CCwEyUzv.js → wt-player-B2-wweFq.js} +3 -3
  21. package/dist/{wt-search-bar-CiQJ9ViN.js → wt-search-bar-CPfD4657.js} +1 -1
  22. package/dist/{wt-send-message-popup-D07uZ7eL.js → wt-send-message-popup-Clb-abg5.js} +2 -2
  23. package/dist/wt-status-select-DCiMHd9K.js +77 -0
  24. package/dist/{wt-timepicker-DyM1OQX4.js → wt-timepicker-4bwYBaKQ.js} +2 -2
  25. package/dist/{wt-toast-KTAx-8zA.js → wt-toast-QzhZGeTp.js} +2 -2
  26. package/dist/{wt-tree-table-BlZEw4tr.js → wt-tree-table-DM_CRVQQ.js} +1 -1
  27. package/dist/{wt-type-extension-value-input-Tlnn-d1W.js → wt-type-extension-value-input-CP-xZ065.js} +3 -3
  28. package/dist/{wt-vidstack-player-Dvto6FG2.js → wt-vidstack-player-CuQ_SOHI.js} +4 -4
  29. package/package.json +1 -1
  30. package/src/api/clients/users/__tests__/users.spec.js +1 -0
  31. package/src/api/clients/users/users.js +26 -2
  32. package/src/assets/icons/sprite/index.ts +2 -0
  33. package/src/assets/icons/sprite/shield-check.svg +3 -0
  34. package/src/components/index.js +3 -3
  35. package/src/components/wt-card/_variables.css +4 -0
  36. package/src/components/wt-card/wt-card.vue +13 -0
  37. package/src/components/wt-indicator/_variables.css +7 -2
  38. package/src/components/wt-single-select/wt-single-select.vue +7 -0
  39. package/src/components/wt-status-select/__tests__/WtStatusSelect.spec.js +3 -3
  40. package/src/components/wt-status-select/_internals/StatusOptions.lookup.js +1 -1
  41. package/src/components/wt-status-select/wt-status-select.vue +80 -139
  42. package/src/css/components-variables.css +1 -1
  43. package/types/components/wt-card/wt-card.vue.d.ts +13 -0
  44. package/types/components/wt-single-select/wt-single-select.vue.d.ts +1 -0
  45. package/types/components/wt-status-select/wt-status-select.vue.d.ts +21 -1
  46. package/dist/AgentStatus.enum-C3IGHtvR.js +0 -9
  47. package/dist/wt-status-select-A5t6Vjm4.js +0 -101
  48. package/src/components/wt-select/__tests__/WtSelect.spec.js +0 -30
  49. package/src/components/wt-select/_variables.css +0 -12
  50. package/src/components/wt-select/mixins/__tests__/multiselectMixin.spec.js +0 -50
  51. package/src/components/wt-select/mixins/multiselectMixin.js +0 -279
  52. package/src/components/wt-select/multiselect.css +0 -239
  53. package/src/components/wt-select/wt-select.vue +0 -386
  54. package/src/components/wt-tags-input/mixin/taggableMixin.js +0 -43
  55. package/types/components/wt-select/__tests__/WtSelect.spec.d.ts +0 -1
  56. package/types/components/wt-select/mixins/__tests__/multiselectMixin.spec.d.ts +0 -1
  57. package/types/components/wt-select/mixins/multiselectMixin.d.ts +0 -129
  58. package/types/components/wt-select/wt-select.vue.d.ts +0 -229
  59. package/types/components/wt-tags-input/mixin/taggableMixin.d.ts +0 -7
@@ -1,17 +1,18 @@
1
1
  <template>
2
- <wt-select
3
- :clearable="false"
2
+ <wt-single-select
3
+ :show-clear="false"
4
4
  :options="availableOptions"
5
- :searchable="false"
6
- :value="selectedOption"
5
+ :filterable="false"
6
+ :model-value="selectedOption"
7
7
  class="wt-status-select"
8
- track-by="value"
8
+ data-key="value"
9
+ :size="ComponentSize.SM"
9
10
  @closed="closedHandler"
10
- @input="inputHandler"
11
+ @update:model-value="inputHandler"
11
12
  >
12
- <template #singleLabel="{ option }">
13
+ <template #value="{ value }">
13
14
  <wt-indicator
14
- :color="option.color"
15
+ :color="value.color"
15
16
  :text="duration"
16
17
  />
17
18
  </template>
@@ -21,151 +22,91 @@
21
22
  :text="option.text"
22
23
  />
23
24
  </template>
24
- </wt-select>
25
+ </wt-single-select>
25
26
  </template>
26
27
 
27
- <script>
28
- import AgentStatus from '../../enums/AgentStatus/AgentStatus.enum.js';
28
+ <script setup lang="ts">
29
+ import { computed } from 'vue';
30
+ import { useI18n } from 'vue-i18n';
31
+ import { AgentStatus, ComponentSize } from '../../enums';
29
32
  import convertDuration from '../../scripts/convertDuration.js';
30
33
  import StatusOptions from './_internals/StatusOptions.lookup.js';
31
34
 
32
- export default {
33
- name: 'WtStatusSelect',
34
- model: {
35
- prop: 'status',
36
- event: 'change',
37
- },
38
- /**
39
- * @emits {string} change - Fires when status changes. Emits changed status value
40
- * @emits {Event} closed - Fires when dropdown is closed
41
- */
42
- props: {
43
- /**
44
- * Component is looking for value from AgentStatus enum
45
- * @type {string}
46
- * @default AgentStatus.OFFLINE
47
- */
48
- status: {
49
- type: String,
50
- default: AgentStatus.OFFLINE,
51
- },
52
- /**
53
- * If seconds number, converts to hh:mm:ss format
54
- * @type {string | number}
55
- * @default 0
56
- */
57
- statusDuration: {
58
- type: [
59
- String,
60
- Number,
61
- ],
62
- default: 0,
63
- },
64
- /**
65
- * If passed, replaces default status-select options. Should have 3 required properties: "color", "text" and "value"
66
- * @type {Array}
67
- */
68
- options: {
69
- type: Array,
70
- },
71
- // size: {
72
- // type: String,
73
- // default: 'md',
74
- // options: ['sm', 'md'],
75
- // },
76
- },
77
- emits: [
78
- 'change',
79
- 'closed',
80
- ],
81
- computed: {
82
- selectedOption() {
83
- return this.statusOptions.find((option) => option.value === this.status);
84
- },
85
- statusOptions() {
86
- return this.options
87
- ? this.options
88
- : StatusOptions.map((opt) => ({
89
- ...opt,
90
- text: this.$t(opt.locale),
91
- }));
92
- },
93
- availableOptions() {
94
- return this.statusOptions.reduce((options, opt) => {
95
- // PAUSE option is always passed
96
- if (
97
- (this.status === opt.value && opt.value !== AgentStatus.PAUSE) ||
98
- opt.value === AgentStatus.BREAK_OUT
99
- ) {
100
- // skip breakout option
101
- return options;
102
- }
103
- options.push(opt);
104
- return options;
105
- }, []);
106
- },
107
- duration() {
108
- /* The check commented below limits the display of time in the status to 8 characters.
109
- Accordingly, if the agent is in the status of 100 hours (100: 00: 00),
110
- then this time will be displayed as NaN:NaN:NaN */
35
+ interface StatusOption {
36
+ color: string;
37
+ text: string;
38
+ value: string;
39
+ locale?: string;
40
+ }
111
41
 
112
- // if (typeof this.statusDuration === 'string' && this.statusDuration.length === 8) return this.statusDuration;
113
- if (typeof this.statusDuration === 'string') return this.statusDuration;
114
- if (this.statusDuration !== undefined) {
115
- return convertDuration(this.statusDuration);
116
- }
117
- return this.selectedOption.text;
118
- },
42
+ const props = withDefaults(
43
+ defineProps<{
44
+ status?: string;
45
+ statusDuration?: string | number;
46
+ options?: StatusOption[];
47
+ }>(),
48
+ {
49
+ status: AgentStatus.OFFLINE,
50
+ statusDuration: 0,
119
51
  },
120
- methods: {
121
- inputHandler(value) {
122
- this.$emit('change', value.value);
123
- },
124
- closedHandler(event) {
125
- this.$emit('closed', event);
126
- },
127
- },
128
- };
129
- </script>
52
+ );
130
53
 
131
- <style scoped>
132
- .wt-status-select.wt-select {
133
- box-shadow: var(--elevation-5);
134
- }
54
+ const emit = defineEmits<{
55
+ change: [
56
+ value: string,
57
+ ];
58
+ closed: [
59
+ event: Event,
60
+ ];
61
+ }>();
135
62
 
136
- .wt-status-select.wt-select :deep(.multiselect) {
137
- min-height: 0;
138
- }
63
+ const { t } = useI18n();
139
64
 
140
- .wt-status-select.wt-select :deep(.multiselect__tags) {
141
- border: none;
142
- background: var(--wt-status-select-background-color);
143
- padding: var(--wt-status-select-padding);
144
- min-height: 0;
145
- }
65
+ const statusOptions = computed<StatusOption[]>(() =>
66
+ props.options
67
+ ? props.options
68
+ : StatusOptions.map((opt) => ({
69
+ ...opt,
70
+ text: t(opt.locale),
71
+ })),
72
+ );
146
73
 
147
- .wt-status-select.wt-select :deep(.multiselect__select) {
148
- top: 0;
149
- right: 0;
150
- }
74
+ const selectedOption = computed<StatusOption | undefined>(() =>
75
+ statusOptions.value.find((option) => option.value === props.status),
76
+ );
151
77
 
152
- .wt-status-select.wt-select :deep(.multiselect__content-wrapper) {
153
- border: none;
154
- background: transparent;
155
- }
78
+ const availableOptions = computed<StatusOption[]>(() =>
79
+ statusOptions.value.reduce<StatusOption[]>((options, opt) => {
80
+ // PAUSE option is always passed
81
+ if (
82
+ (props.status === opt.value && opt.value !== AgentStatus.PAUSE) ||
83
+ opt.value === AgentStatus.BREAK_OUT
84
+ ) {
85
+ // skip breakout option
86
+ return options;
87
+ }
88
+ options.push(opt);
89
+ return options;
90
+ }, []),
91
+ );
156
92
 
157
- .wt-status-select.wt-select :deep(.multiselect__option) {
158
- background: var(--wt-status-select-option-background-color);
159
- padding: 0;
160
- min-height: 0;
161
- color: var(--wt-status-select-option-text-color);
162
- }
93
+ const duration = computed<string>(() => {
94
+ /* The check commented below limits the display of time in the status to 8 characters.
95
+ Accordingly, if the agent is in the status of 100 hours (100: 00: 00),
96
+ then this time will be displayed as NaN:NaN:NaN */
97
+
98
+ // if (typeof props.statusDuration === 'string' && props.statusDuration.length === 8) return props.statusDuration;
99
+ if (typeof props.statusDuration === 'string') return props.statusDuration;
100
+ if (props.statusDuration !== undefined)
101
+ return convertDuration(props.statusDuration);
102
+ return selectedOption.value?.text ?? '';
103
+ });
163
104
 
164
- .wt-status-select.wt-select :deep(.multiselect__option--highlight) {
165
- background: var(--wt-status-select-option-background-hover-color);
105
+ function inputHandler(value: StatusOption) {
106
+ emit('change', value.value);
166
107
  }
167
108
 
168
- .wt-status-select.wt-select :deep(.multiselect__option--selected) {
169
- /* background: var(--wt-status-select-option-background-selected-color); */
109
+ function closedHandler(event: Event) {
110
+ emit('closed', event);
170
111
  }
171
- </style>
112
+ </script>
@@ -7,6 +7,7 @@
7
7
  @import "../components/wt-breadcrumb/_variables.css";
8
8
  @import "../components/wt-button-select/_variables.css";
9
9
  @import "../components/wt-button/_variables.css";
10
+ @import "../components/wt-card/_variables.css";
10
11
  @import "../components/wt-checkbox/_variables.css";
11
12
  @import "../components/wt-chip/_variables.css";
12
13
  @import "../components/wt-context-menu/_variables.css";
@@ -37,7 +38,6 @@
37
38
  @import "../components/wt-radio/_variables.css";
38
39
  @import "../components/wt-rounded-action/_variables.css";
39
40
  @import "../components/wt-search-bar/_variables.css";
40
- @import "../components/wt-select/_variables.css";
41
41
  @import "../components/wt-slider/_variables.css";
42
42
  @import "../components/wt-status-select/_variables.css";
43
43
  @import "../components/wt-stepper/_variables.css";
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -4,6 +4,7 @@ interface Props extends SelectProps {
4
4
  placeholder?: string;
5
5
  required?: boolean;
6
6
  disabled?: boolean;
7
+ size?: string | null;
7
8
  /**
8
9
  * true disables all options but keeps dropdown visible
9
10
  */
@@ -1,3 +1,23 @@
1
+ interface StatusOption {
2
+ color: string;
3
+ text: string;
4
+ value: string;
5
+ locale?: string;
6
+ }
7
+ type __VLS_Props = {
8
+ status?: string;
9
+ statusDuration?: string | number;
10
+ options?: StatusOption[];
11
+ };
12
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ closed: (event: Event) => any;
14
+ change: (value: string) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ onClosed?: (event: Event) => any;
17
+ onChange?: (value: string) => any;
18
+ }>, {
19
+ status: string;
20
+ statusDuration: string | number;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
22
  declare const _default: typeof __VLS_export;
2
23
  export default _default;
3
- declare const __VLS_export: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
@@ -1,9 +0,0 @@
1
- //#region src/enums/AgentStatus/AgentStatus.enum.js
2
- var e = Object.freeze({
3
- ONLINE: "online",
4
- PAUSE: "pause",
5
- OFFLINE: "offline",
6
- BREAK_OUT: "break_out"
7
- });
8
- //#endregion
9
- export { e as t };
@@ -1,101 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { t } from "./AgentStatus.enum-C3IGHtvR.js";
3
- import { t as n } from "./convertDuration-1K7fuEpO.js";
4
- import { createBlock as r, createVNode as i, openBlock as a, resolveComponent as o, withCtx as s } from "vue";
5
- //#region src/components/wt-status-select/_internals/StatusOptions.lookup.js
6
- var c = [
7
- {
8
- locale: "webitelUI.statusSelect.online",
9
- color: "success",
10
- value: t.ONLINE
11
- },
12
- {
13
- locale: "webitelUI.statusSelect.pause",
14
- color: "primary",
15
- value: t.PAUSE
16
- },
17
- {
18
- locale: "webitelUI.statusSelect.offline",
19
- color: "disabled",
20
- value: t.OFFLINE
21
- },
22
- {
23
- locale: "webitelUI.statusSelect.breakOut",
24
- color: "break-out",
25
- value: t.BREAK_OUT
26
- }
27
- ], l = {
28
- name: "WtStatusSelect",
29
- model: {
30
- prop: "status",
31
- event: "change"
32
- },
33
- props: {
34
- status: {
35
- type: String,
36
- default: t.OFFLINE
37
- },
38
- statusDuration: {
39
- type: [String, Number],
40
- default: 0
41
- },
42
- options: { type: Array }
43
- },
44
- emits: ["change", "closed"],
45
- computed: {
46
- selectedOption() {
47
- return this.statusOptions.find((e) => e.value === this.status);
48
- },
49
- statusOptions() {
50
- return this.options ? this.options : c.map((e) => ({
51
- ...e,
52
- text: this.$t(e.locale)
53
- }));
54
- },
55
- availableOptions() {
56
- return this.statusOptions.reduce((e, n) => (this.status === n.value && n.value !== t.PAUSE || n.value === t.BREAK_OUT || e.push(n), e), []);
57
- },
58
- duration() {
59
- return typeof this.statusDuration == "string" ? this.statusDuration : this.statusDuration === void 0 ? this.selectedOption.text : n(this.statusDuration);
60
- }
61
- },
62
- methods: {
63
- inputHandler(e) {
64
- this.$emit("change", e.value);
65
- },
66
- closedHandler(e) {
67
- this.$emit("closed", e);
68
- }
69
- }
70
- };
71
- function u(e, t, n, c, l, u) {
72
- let d = o("wt-indicator"), f = o("wt-select");
73
- return a(), r(f, {
74
- clearable: !1,
75
- options: u.availableOptions,
76
- searchable: !1,
77
- value: u.selectedOption,
78
- class: "wt-status-select",
79
- "track-by": "value",
80
- onClosed: u.closedHandler,
81
- onInput: u.inputHandler
82
- }, {
83
- singleLabel: s(({ option: e }) => [i(d, {
84
- color: e.color,
85
- text: u.duration
86
- }, null, 8, ["color", "text"])]),
87
- option: s(({ option: e }) => [i(d, {
88
- color: e.color,
89
- text: e.text
90
- }, null, 8, ["color", "text"])]),
91
- _: 1
92
- }, 8, [
93
- "options",
94
- "value",
95
- "onClosed",
96
- "onInput"
97
- ]);
98
- }
99
- var d = /*#__PURE__*/ e(l, [["render", u], ["__scopeId", "data-v-580212cb"]]);
100
- //#endregion
101
- export { d as default };
@@ -1,30 +0,0 @@
1
- import { mount, shallowMount } from '@vue/test-utils';
2
-
3
- import WtLabel from '../../wt-label/wt-label.vue';
4
- import WtSelect from '../wt-select.vue';
5
-
6
- describe('WtSelect', () => {
7
- it('renders a component', () => {
8
- const wrapper = shallowMount(WtSelect, {
9
- stubs: {
10
- WtLabel,
11
- WtIcon: true,
12
- },
13
- });
14
- expect(wrapper.classes('wt-select')).toBe(true);
15
- });
16
-
17
- it('renders label text when passed', () => {
18
- const label = 'Hello there';
19
- const wrapper = mount(WtSelect, {
20
- stubs: {
21
- WtLabel,
22
- WtIcon: true,
23
- },
24
- props: {
25
- label,
26
- },
27
- });
28
- expect(wrapper.find('.wt-label').text()).toBe(label);
29
- });
30
- });
@@ -1,12 +0,0 @@
1
- :root {
2
- --select-icon-top-pos: var(--spacing-xs);
3
- --select-chip-top-pos: var(--spacing-xs);
4
-
5
- --select-caret-right-pos: var(--input-padding);
6
-
7
- --select-tags-border: var(
8
- --input-border
9
- ); /* right pos = 10px spacing + clear icon size + clear offset */
10
-
11
- --select-options-padding: var(--input-padding);
12
- }
@@ -1,50 +0,0 @@
1
- import { shallowMount } from '@vue/test-utils';
2
-
3
- import MultiselectMixin from '../multiselectMixin.js';
4
-
5
- const Component = {
6
- mixins: [
7
- MultiselectMixin,
8
- ],
9
- render() {},
10
- };
11
-
12
- describe('MultiselectMixin', () => {
13
- it('renders a component', () => {
14
- const wrapper = shallowMount(Component);
15
- expect(wrapper.exists()).toBe(true);
16
- });
17
-
18
- it('Correctly computes internal search options', () => {
19
- const options = [
20
- '1',
21
- '2',
22
- ];
23
- const wrapper = shallowMount(Component, {
24
- props: {
25
- options,
26
- },
27
- });
28
- expect(wrapper.vm.selectOptions).toEqual(options);
29
- });
30
-
31
- it('Correctly computes internal search options: search case', async () => {
32
- const options = [
33
- '1',
34
- '2',
35
- ];
36
- const searchOptions = [
37
- '1',
38
- ];
39
- const wrapper = shallowMount(Component, {
40
- props: {
41
- options,
42
- searchMethod: () => ({
43
- items: searchOptions,
44
- }),
45
- },
46
- });
47
- await wrapper.vm.$nextTick();
48
- expect(wrapper.vm.selectOptions).toEqual(searchOptions);
49
- });
50
- });