@webitel/ui-sdk 26.4.16 → 26.4.18
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/dist/displayText-Cbh4IOfM.js +5 -0
- package/dist/{index-CRJrntZh.js → index-B0AYwz58.js} +1 -1
- package/dist/{index-Bi3e-yvC.js → index-Dvhbo446.js} +1 -1
- package/dist/{install-BduuMOLN.js → install-CrJnxpPS.js} +1905 -1893
- package/dist/{isObject-CzE0nrvV.js → isObject-BsWrydYX.js} +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1 -1
- package/dist/ui-sdk.umd.cjs +241 -241
- package/dist/{useVidstackSrc-CLxGvfx7.js → useVidstackSrc-Bmp2wHly.js} +1 -1
- package/dist/{vidstack-Bq6c3Bam-BAJLRjUL.js → vidstack-Bq6c3Bam-N3JOOQyW.js} +3 -3
- package/dist/{vidstack-D2pY00kU-BUwc6A8v.js → vidstack-D2pY00kU-ByaRFZub.js} +3 -3
- package/dist/{vidstack-DDXt6fpN-CLi5zfDH.js → vidstack-DDXt6fpN-H7PZzMEr.js} +2 -2
- package/dist/{vidstack-D_-9AA6_-BV38l14i.js → vidstack-D_-9AA6_-BgRVFwPt.js} +2 -2
- package/dist/{vidstack-DqAw8m9J-jbgzgoAn.js → vidstack-DqAw8m9J-BODJkoui.js} +1 -1
- package/dist/{vidstack-audio-B4T0OD88.js → vidstack-audio-Cnpq73DL.js} +2 -2
- package/dist/{vidstack-dash-C-EzK5NU.js → vidstack-dash-Bzo3Gzfd.js} +4 -4
- package/dist/{vidstack-google-cast-BND83Re6.js → vidstack-google-cast--giiu8Z5.js} +4 -4
- package/dist/{vidstack-hls-xaDBRbO-.js → vidstack-hls-CrDFf1Gs.js} +4 -4
- package/dist/{vidstack-video-BDSTzD3w.js → vidstack-video-h7Tsw5LU.js} +3 -3
- package/dist/{vidstack-vimeo-B4xYeH9Q.js → vidstack-vimeo-CbcdGN2R.js} +4 -4
- package/dist/{vidstack-youtube-rDfIJqG7.js → vidstack-youtube-DKzx3LPK.js} +3 -3
- package/dist/{wt-action-bar-lVU52KrC.js → wt-action-bar-GCDVmO0b.js} +1 -1
- package/dist/{wt-button-select-C7wNgMqI.js → wt-button-select-BBsJj7FV.js} +1 -1
- package/dist/{wt-chat-emoji-D2nEPIDy.js → wt-chat-emoji-MhnNs-SG.js} +2 -2
- package/dist/{wt-confirm-dialog-CAX92f_I.js → wt-confirm-dialog-B4J3ZU2r.js} +1 -1
- package/dist/{wt-context-menu-2CaTxYJx.js → wt-context-menu-Cekc6Rva.js} +1 -1
- package/dist/{wt-copy-action-BrhZR265.js → wt-copy-action-CT_0bHmt.js} +1 -1
- package/dist/{wt-datepicker-2AQYoSOi.js → wt-datepicker-B513Tw-Z.js} +1 -1
- package/dist/wt-display-chip-items-CMB33VOU.js +47 -0
- package/dist/{wt-dual-panel-CGBeh_yX.js → wt-dual-panel-DjHHFx8Y.js} +1 -1
- package/dist/{wt-dummy-CiVhtg3s.js → wt-dummy-BivOEKRK.js} +1 -1
- package/dist/{wt-error-page-CbYKAqR3.js → wt-error-page-krwX0484.js} +1 -1
- package/dist/{wt-expansion-card-zBUn8aGk.js → wt-expansion-card-Mrne6YQJ.js} +1 -1
- package/dist/{wt-expansion-panel-BmkuYFI9.js → wt-expansion-panel-D0SABYA1.js} +1 -1
- package/dist/{wt-filters-panel-wrapper-B_kiQbJU.js → wt-filters-panel-wrapper-Dffe4cS8.js} +1 -1
- package/dist/{wt-galleria-DtV88s0G.js → wt-galleria-CB3UNqGT.js} +1 -1
- package/dist/{wt-navigation-menu-DPrkKcay.js → wt-navigation-menu-CozB-VN3.js} +1 -1
- package/dist/{wt-notifications-bar-B1MdVgU5.js → wt-notifications-bar-CBv9RpW3.js} +2 -2
- package/dist/{wt-pagination-DeNIA-Rj.js → wt-pagination-CrnHm3Ei.js} +37 -26
- package/dist/{wt-player-Z6LVaHke.js → wt-player-Be7Ts4oe.js} +2 -2
- package/dist/wt-screen-recordings-action-VJpYH40a.js +55 -0
- package/dist/{wt-search-bar-JemSkyKl.js → wt-search-bar-BNUpiOyg.js} +1 -1
- package/dist/{wt-selection-popup-DvScmlyg.js → wt-selection-popup-DZG_s5cn.js} +1 -1
- package/dist/{wt-start-page-C--6cL1x.js → wt-start-page-B1Ya211Z.js} +1 -1
- package/dist/{wt-status-select-B97OCBvE.js → wt-status-select-ByEBtG_Z.js} +1 -1
- package/dist/{wt-stepper-B48Se9mZ.js → wt-stepper-Bke8hGIN.js} +1 -1
- package/dist/{wt-table-actions-DYT34nCQ.js → wt-table-actions-D2QF78Jq.js} +1 -1
- package/dist/{wt-table-column-select-BMVbzN0g.js → wt-table-column-select-BtcIByjb.js} +2 -2
- package/dist/{wt-table-CemrI6D7.js → wt-table-rT0puxyU.js} +1 -1
- package/dist/{wt-tabs-A0gMEnTl.js → wt-tabs-BIn8m45h.js} +1 -1
- package/dist/{wt-tags-input-D9BVloW9.js → wt-tags-input-Bz3T5KC7.js} +2 -2
- package/dist/{wt-timepicker-zbgCNBxA.js → wt-timepicker-CuMYCWnA.js} +1 -1
- package/dist/{wt-tree-Di-glh2x.js → wt-tree-DftQx0vm.js} +2 -2
- package/dist/{wt-tree-table-BUDxyApa.js → wt-tree-table-Cqt8iSLj.js} +1 -1
- package/dist/{wt-type-extension-value-input-BZzPpD02.js → wt-type-extension-value-input-rX_qRFjQ.js} +2 -2
- package/dist/{wt-vidstack-player-IX8uh__X.js → wt-vidstack-player-CWmoXIAG.js} +10 -10
- package/package.json +5 -2
- package/src/api/clients/users/__tests__/users.spec.js +1 -1
- package/src/components/index.js +8 -0
- package/src/components/on-demand/wt-screen-recordings-action/wt-screen-recordings-action.vue +72 -0
- package/src/components/wt-button/__tests__/WtButton.spec.js +10 -5
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +13 -16
- package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +6 -2
- package/src/components/wt-chip/__tests__/WtChip.spec.js +3 -3
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +4 -17
- package/src/components/wt-icon/__tests__/WtIcon.spec.js +19 -2
- package/src/components/wt-pagination/__tests__/WtPagination.spec.js +80 -16
- package/src/components/wt-pagination/wt-pagination.vue +28 -8
- package/src/components/wt-radio/__tests__/WtRadio.spec.js +8 -2
- package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +98 -0
- package/src/components/wt-rounded-action/wt-rounded-action.vue +21 -8
- package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +9 -11
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +2 -2
- package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +18 -1
- package/src/components/wt-timepicker/__tests__/WtTimepicker.spec.js +9 -15
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +60 -80
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +6 -47
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +31 -3
- package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +16 -10
- package/src/modules/AuditForm/components/form-questions/options/__tests__/audit-form-question-options.spec.js +4 -6
- package/src/modules/AuditForm/components/form-questions/score/__tests__/audit-form-question-score.spec.js +2 -2
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +7 -51
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +12 -8
- package/types/components/on-demand/wt-screen-recordings-action/wt-screen-recordings-action.vue.d.ts +10 -0
- package/dist/wt-display-chip-items-DO2rtX0h.js +0 -46
- package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +0 -15
- package/src/components/wt-divider/__tests__/WtDivider.spec.js +0 -10
- package/src/components/wt-slider/__tests__/WtSlider.spec.js +0 -10
- package/src/components/wt-table/__tests__/WtTable.spec.js +0 -140
- package/src/modules/Filters/components/__tests__/filter-pagination.spec.js +0 -109
- package/src/modules/Filters/components/__tests__/filter-table-fields.spec.js +0 -112
- package/types/components/wt-copy-action/__tests__/WtCopyAction.spec.d.ts +0 -1
- package/types/components/wt-divider/__tests__/WtDivider.spec.d.ts +0 -1
- package/types/components/wt-slider/__tests__/WtSlider.spec.d.ts +0 -1
- package/types/components/wt-table/__tests__/WtTable.spec.d.ts +0 -1
- package/types/modules/Filters/components/__tests__/filter-pagination.spec.d.ts +0 -1
- package/types/modules/Filters/components/__tests__/filter-table-fields.spec.d.ts +0 -1
|
@@ -11,13 +11,20 @@ global.ResizeObserver = vi.fn().mockImplementation(() => ({
|
|
|
11
11
|
|
|
12
12
|
describe('WtSelectButton', () => {
|
|
13
13
|
it('renders a component', () => {
|
|
14
|
-
const wrapper = shallowMount(WtSelectButton
|
|
14
|
+
const wrapper = shallowMount(WtSelectButton, {
|
|
15
|
+
props: {
|
|
16
|
+
options: [],
|
|
17
|
+
},
|
|
18
|
+
});
|
|
15
19
|
expect(wrapper.classes('wt-button-select')).toBe(true);
|
|
16
20
|
});
|
|
17
21
|
|
|
18
22
|
it('renders a button content via default slot', () => {
|
|
19
23
|
const content = 'button content';
|
|
20
24
|
const wrapper = mount(WtSelectButton, {
|
|
25
|
+
props: {
|
|
26
|
+
options: [],
|
|
27
|
+
},
|
|
21
28
|
slots: {
|
|
22
29
|
default: content,
|
|
23
30
|
},
|
|
@@ -25,24 +32,14 @@ describe('WtSelectButton', () => {
|
|
|
25
32
|
expect(wrapper.find('.wt-button-select__button').text()).toBe(content);
|
|
26
33
|
});
|
|
27
34
|
|
|
28
|
-
it('
|
|
29
|
-
const wrapper =
|
|
35
|
+
it('emits click from main action button', async () => {
|
|
36
|
+
const wrapper = shallowMount(WtSelectButton, {
|
|
30
37
|
props: {
|
|
31
38
|
options: [],
|
|
32
39
|
},
|
|
33
40
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
.find((component) =>
|
|
39
|
-
component.classes().includes('wt-button-select__select-btn'),
|
|
40
|
-
);
|
|
41
|
-
arrowBtn.vm.$emit('click');
|
|
42
|
-
await wrapper.vm.$nextTick();
|
|
43
|
-
const wtIcon = wrapper.find('.wt-button-select__select-arrow');
|
|
44
|
-
expect(wtIcon.classes()).toContain(
|
|
45
|
-
'wt-button-select__select-arrow--active',
|
|
46
|
-
);
|
|
41
|
+
|
|
42
|
+
await wrapper.find('.wt-button-select__button').trigger('click');
|
|
43
|
+
expect(wrapper.emitted().click).toBeTruthy();
|
|
47
44
|
});
|
|
48
45
|
});
|
|
@@ -7,6 +7,9 @@ import WtCheckbox from '../wt-checkbox.vue';
|
|
|
7
7
|
describe('WtCheckbox', () => {
|
|
8
8
|
it('renders a component', () => {
|
|
9
9
|
const wrapper = shallowMount(WtCheckbox, {
|
|
10
|
+
props: {
|
|
11
|
+
selected: false,
|
|
12
|
+
},
|
|
10
13
|
stubs: {
|
|
11
14
|
WtLabel,
|
|
12
15
|
WtIcon,
|
|
@@ -24,6 +27,7 @@ describe('WtCheckbox', () => {
|
|
|
24
27
|
},
|
|
25
28
|
props: {
|
|
26
29
|
label,
|
|
30
|
+
selected: false,
|
|
27
31
|
},
|
|
28
32
|
});
|
|
29
33
|
expect(wrapper.find('.wt-checkbox__label').text()).toBe(label);
|
|
@@ -40,8 +44,8 @@ describe('WtCheckbox', () => {
|
|
|
40
44
|
selected,
|
|
41
45
|
},
|
|
42
46
|
});
|
|
43
|
-
wrapper.find('
|
|
44
|
-
expect(wrapper.emitted()
|
|
47
|
+
wrapper.find('input[type="checkbox"]').setValue(!selected);
|
|
48
|
+
expect(wrapper.emitted()['update:selected'][0]).toEqual([
|
|
45
49
|
!selected,
|
|
46
50
|
]);
|
|
47
51
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import WtChip from '../wt-chip.vue';
|
|
4
4
|
|
|
@@ -10,11 +10,11 @@ describe('WtChip', () => {
|
|
|
10
10
|
|
|
11
11
|
it('renders a chip content via default slot', () => {
|
|
12
12
|
const content = 'chip content';
|
|
13
|
-
const wrapper =
|
|
13
|
+
const wrapper = mount(WtChip, {
|
|
14
14
|
slots: {
|
|
15
15
|
default: content,
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
|
-
expect(wrapper.
|
|
18
|
+
expect(wrapper.text()).toContain(content);
|
|
19
19
|
});
|
|
20
20
|
});
|
|
@@ -9,27 +9,14 @@ describe('Filters Panel Wrapper', () => {
|
|
|
9
9
|
});
|
|
10
10
|
it('emits "reset" event at wt-table-actions "filterReset" event', () => {
|
|
11
11
|
const wrapper = shallowMount(FiltersPanelWrapper);
|
|
12
|
-
wrapper
|
|
13
|
-
.findComponent({
|
|
14
|
-
name: 'wt-table-actions',
|
|
15
|
-
})
|
|
16
|
-
.vm.$emit('input', 'filterReset');
|
|
12
|
+
wrapper.vm.tableActionsHandler('filterReset');
|
|
17
13
|
expect(wrapper.emitted().reset).toBeTruthy();
|
|
18
14
|
});
|
|
19
15
|
it(`toggles "filters-panel-wrapper--opened" class at
|
|
20
16
|
wt-table-actions "settings" event`, async () => {
|
|
21
17
|
const wrapper = shallowMount(FiltersPanelWrapper);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
25
|
-
wrapper
|
|
26
|
-
.findComponent({
|
|
27
|
-
name: 'wt-table-actions',
|
|
28
|
-
})
|
|
29
|
-
.vm.$emit('input', 'settings');
|
|
30
|
-
await wrapper.vm.$nextTick();
|
|
31
|
-
expect(wrapper.classes().includes('filters-panel-wrapper--opened')).toBe(
|
|
32
|
-
true,
|
|
33
|
-
);
|
|
18
|
+
const toggleSpy = vi.spyOn(wrapper.vm, 'toggleFiltersExpansion');
|
|
19
|
+
wrapper.vm.tableActionsHandler('settings');
|
|
20
|
+
expect(toggleSpy).toHaveBeenCalled();
|
|
34
21
|
});
|
|
35
22
|
});
|
|
@@ -12,7 +12,7 @@ describe('WtIcon', () => {
|
|
|
12
12
|
expect(wrapper.classes('wt-icon')).toBe(true);
|
|
13
13
|
});
|
|
14
14
|
it('correctly computes icon name', () => {
|
|
15
|
-
const iconName = '
|
|
15
|
+
const iconName = 'jest-bucket';
|
|
16
16
|
const wrapper = shallowMount(WtIcon, {
|
|
17
17
|
props: {
|
|
18
18
|
icon: 'bucket',
|
|
@@ -20,6 +20,23 @@ describe('WtIcon', () => {
|
|
|
20
20
|
iconPrefix: 'jest',
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
|
-
expect(wrapper.vm.
|
|
23
|
+
expect(wrapper.vm.iconSvg).toBe(iconName);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('applies size and color classes', () => {
|
|
27
|
+
const wrapper = shallowMount(WtIcon, {
|
|
28
|
+
props: {
|
|
29
|
+
icon: 'bucket',
|
|
30
|
+
size: 'sm',
|
|
31
|
+
color: 'error',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
expect(wrapper.classes()).toEqual(
|
|
36
|
+
expect.arrayContaining([
|
|
37
|
+
'wt-icon--size-sm',
|
|
38
|
+
'wt-icon--color-error',
|
|
39
|
+
]),
|
|
40
|
+
);
|
|
24
41
|
});
|
|
25
42
|
});
|
|
@@ -3,42 +3,106 @@ import { mount, shallowMount } from '@vue/test-utils';
|
|
|
3
3
|
import WtPagination from '../wt-pagination.vue';
|
|
4
4
|
|
|
5
5
|
describe('WtPagination', () => {
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
vi.useFakeTimers();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.useRealTimers();
|
|
12
|
+
});
|
|
13
|
+
|
|
6
14
|
it('renders a component', () => {
|
|
7
15
|
const wrapper = shallowMount(WtPagination);
|
|
8
16
|
expect(wrapper.classes('wt-pagination')).toBe(true);
|
|
9
17
|
});
|
|
10
18
|
|
|
11
19
|
it('debounces size change event when debounce prop is true', async () => {
|
|
12
|
-
const props = {
|
|
13
|
-
size: '10',
|
|
14
|
-
debounce: true,
|
|
15
|
-
debounceDelay: 100,
|
|
16
|
-
};
|
|
17
20
|
const wrapper = shallowMount(WtPagination, {
|
|
18
|
-
props
|
|
21
|
+
props: {
|
|
22
|
+
size: '10',
|
|
23
|
+
debounce: true,
|
|
24
|
+
debounceDelay: 100,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
await wrapper.setProps({
|
|
29
|
+
size: '20',
|
|
19
30
|
});
|
|
20
|
-
|
|
21
|
-
wrapper.setProps(props);
|
|
31
|
+
|
|
22
32
|
expect(wrapper.emitted().change).toBeFalsy();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
|
|
34
|
+
vi.advanceTimersByTime(1000);
|
|
35
|
+
expect(wrapper.emitted().change ?? []).toHaveLength(1);
|
|
36
|
+
expect(wrapper.emitted().change[0]).toEqual([
|
|
37
|
+
20,
|
|
38
|
+
]);
|
|
26
39
|
});
|
|
27
40
|
|
|
28
41
|
it('changes pages at icon btn click', async () => {
|
|
29
42
|
const wrapper = mount(WtPagination, {
|
|
30
43
|
props: {
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
prev: true,
|
|
45
|
+
next: true,
|
|
33
46
|
},
|
|
34
47
|
});
|
|
35
48
|
const pageControls = wrapper.findAllComponents({
|
|
36
49
|
name: 'wt-icon-btn',
|
|
37
50
|
});
|
|
38
|
-
|
|
39
|
-
pageControls.
|
|
40
|
-
|
|
51
|
+
|
|
52
|
+
pageControls[0].vm.$emit('click');
|
|
53
|
+
pageControls[1].vm.$emit('click');
|
|
54
|
+
|
|
41
55
|
expect(wrapper.emitted().prev.length).toBe(1);
|
|
42
56
|
expect(wrapper.emitted().next.length).toBe(1);
|
|
43
57
|
});
|
|
58
|
+
|
|
59
|
+
it('resets to default size when input value is null', async () => {
|
|
60
|
+
const wrapper = shallowMount(WtPagination, {
|
|
61
|
+
props: {
|
|
62
|
+
size: 25,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
wrapper.vm.inputHandler(null);
|
|
67
|
+
expect(wrapper.vm.internalSize).toBeNull();
|
|
68
|
+
|
|
69
|
+
await wrapper.vm.$nextTick();
|
|
70
|
+
await wrapper.vm.$nextTick();
|
|
71
|
+
|
|
72
|
+
expect(wrapper.vm.internalSize).toBe(10);
|
|
73
|
+
expect(wrapper.emitted().input).toBeTruthy();
|
|
74
|
+
expect(wrapper.emitted().input[0]).toEqual([
|
|
75
|
+
10,
|
|
76
|
+
]);
|
|
77
|
+
expect(wrapper.emitted().change).toBeTruthy();
|
|
78
|
+
expect(wrapper.emitted().change[0]).toEqual([
|
|
79
|
+
10,
|
|
80
|
+
]);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('normalizes out-of-range input values to default size', async () => {
|
|
84
|
+
const wrapper = shallowMount(WtPagination, {
|
|
85
|
+
props: {
|
|
86
|
+
size: 11,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
wrapper.vm.inputHandler(2000);
|
|
91
|
+
wrapper.vm.inputHandler(-1);
|
|
92
|
+
await wrapper.vm.$nextTick();
|
|
93
|
+
|
|
94
|
+
expect(wrapper.emitted().input).toEqual([
|
|
95
|
+
[
|
|
96
|
+
10,
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
10,
|
|
100
|
+
],
|
|
101
|
+
]);
|
|
102
|
+
expect(wrapper.emitted().change).toEqual([
|
|
103
|
+
[
|
|
104
|
+
10,
|
|
105
|
+
],
|
|
106
|
+
]);
|
|
107
|
+
});
|
|
44
108
|
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<wt-input-number
|
|
8
8
|
:max="1000"
|
|
9
9
|
:min="1"
|
|
10
|
-
:model-value="
|
|
10
|
+
:model-value="internalSize"
|
|
11
11
|
class="wt-pagination__size-input"
|
|
12
12
|
@update:model-value="inputHandler"
|
|
13
13
|
/>
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
<script>
|
|
36
36
|
import debounce from '../../scripts/debounce.js';
|
|
37
37
|
|
|
38
|
+
const DEFAULT_SIZE = 10;
|
|
39
|
+
|
|
38
40
|
export default {
|
|
39
41
|
name: 'WtPagination',
|
|
40
42
|
model: {
|
|
@@ -103,14 +105,20 @@ export default {
|
|
|
103
105
|
'next',
|
|
104
106
|
],
|
|
105
107
|
|
|
106
|
-
data
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
data() {
|
|
109
|
+
return {
|
|
110
|
+
internalSize: this.size != null ? +this.size : DEFAULT_SIZE,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
109
113
|
|
|
110
114
|
watch: {
|
|
111
|
-
|
|
115
|
+
internalSize(value) {
|
|
116
|
+
if (value === null) return;
|
|
112
117
|
this.changeSize(value);
|
|
113
118
|
},
|
|
119
|
+
size(value) {
|
|
120
|
+
this.internalSize = value != null ? +value : DEFAULT_SIZE;
|
|
121
|
+
},
|
|
114
122
|
},
|
|
115
123
|
|
|
116
124
|
created() {
|
|
@@ -120,10 +128,22 @@ export default {
|
|
|
120
128
|
|
|
121
129
|
methods: {
|
|
122
130
|
inputHandler(value) {
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
if (value === null) {
|
|
132
|
+
// @author r.zaritskyi
|
|
133
|
+
// https://github.com/webitel/webitel-ui-sdk/pull/1283#issue-4194972887
|
|
134
|
+
// If internalSize is already DEFAULT_SIZE, Vuex won't detect a change,
|
|
135
|
+
// Vue won't re-render wt-input-number, and the field stays empty.
|
|
136
|
+
// Setting null first forces a DOM update; nextTick restores the value.
|
|
137
|
+
this.internalSize = null;
|
|
138
|
+
this.$nextTick(() => {
|
|
139
|
+
this.internalSize = DEFAULT_SIZE;
|
|
140
|
+
this.$emit('input', DEFAULT_SIZE);
|
|
141
|
+
});
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const size = value >= 0 && value <= 1000 ? value : DEFAULT_SIZE;
|
|
145
|
+
this.internalSize = size;
|
|
125
146
|
this.$emit('input', size);
|
|
126
|
-
this.changeSize(size);
|
|
127
147
|
},
|
|
128
148
|
changeSize(value) {
|
|
129
149
|
this.$emit('change', value);
|
|
@@ -7,6 +7,10 @@ import WtRadio from '../wt-radio.vue';
|
|
|
7
7
|
describe('WtRadio', () => {
|
|
8
8
|
it('renders a component', () => {
|
|
9
9
|
const wrapper = shallowMount(WtRadio, {
|
|
10
|
+
props: {
|
|
11
|
+
selected: '',
|
|
12
|
+
value: 'v',
|
|
13
|
+
},
|
|
10
14
|
stubs: {
|
|
11
15
|
WtLabel,
|
|
12
16
|
WtIcon,
|
|
@@ -24,6 +28,8 @@ describe('WtRadio', () => {
|
|
|
24
28
|
},
|
|
25
29
|
props: {
|
|
26
30
|
label,
|
|
31
|
+
selected: '',
|
|
32
|
+
value: 'v',
|
|
27
33
|
},
|
|
28
34
|
});
|
|
29
35
|
expect(wrapper.find('.wt-radio__label').text()).toBe(label);
|
|
@@ -42,8 +48,8 @@ describe('WtRadio', () => {
|
|
|
42
48
|
value,
|
|
43
49
|
},
|
|
44
50
|
});
|
|
45
|
-
wrapper.find('
|
|
46
|
-
expect(wrapper.emitted()
|
|
51
|
+
wrapper.find('input[type="radio"]').setValue();
|
|
52
|
+
expect(wrapper.emitted()['update:selected'][0]).toEqual([
|
|
47
53
|
value,
|
|
48
54
|
]);
|
|
49
55
|
});
|
|
@@ -11,4 +11,102 @@ describe('WtRoundedAction', () => {
|
|
|
11
11
|
});
|
|
12
12
|
expect(wrapper.classes('wt-rounded-action')).toBe(true);
|
|
13
13
|
});
|
|
14
|
+
|
|
15
|
+
it('applies state classes from props', () => {
|
|
16
|
+
const wrapper = shallowMount(WtRoundedAction, {
|
|
17
|
+
props: {
|
|
18
|
+
icon: 'call',
|
|
19
|
+
active: true,
|
|
20
|
+
disabled: true,
|
|
21
|
+
rounded: true,
|
|
22
|
+
wide: true,
|
|
23
|
+
size: 'sm',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
expect(wrapper.classes()).toEqual(
|
|
28
|
+
expect.arrayContaining([
|
|
29
|
+
'wt-rounded-action--active',
|
|
30
|
+
'wt-rounded-action--disabled',
|
|
31
|
+
'wt-rounded-action--rounded',
|
|
32
|
+
'wt-rounded-action--wide',
|
|
33
|
+
'wt-rounded-action--size-sm',
|
|
34
|
+
]),
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('emits click event', async () => {
|
|
39
|
+
const wrapper = shallowMount(WtRoundedAction, {
|
|
40
|
+
props: {
|
|
41
|
+
icon: 'call',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
await wrapper.trigger('click');
|
|
46
|
+
expect(wrapper.emitted().click).toHaveLength(1);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('shows loader when loading is true', () => {
|
|
50
|
+
const wrapper = shallowMount(WtRoundedAction, {
|
|
51
|
+
props: {
|
|
52
|
+
icon: 'call',
|
|
53
|
+
loading: true,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
expect(
|
|
58
|
+
wrapper
|
|
59
|
+
.findComponent({
|
|
60
|
+
name: 'wt-loader',
|
|
61
|
+
})
|
|
62
|
+
.exists(),
|
|
63
|
+
).toBe(true);
|
|
64
|
+
expect(
|
|
65
|
+
wrapper
|
|
66
|
+
.findComponent({
|
|
67
|
+
name: 'wt-icon',
|
|
68
|
+
})
|
|
69
|
+
.exists(),
|
|
70
|
+
).toBe(false);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('hides loader 1s after loading becomes false', async () => {
|
|
74
|
+
vi.useFakeTimers();
|
|
75
|
+
const wrapper = shallowMount(WtRoundedAction, {
|
|
76
|
+
props: {
|
|
77
|
+
icon: 'call',
|
|
78
|
+
loading: true,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
await wrapper.setProps({
|
|
83
|
+
loading: false,
|
|
84
|
+
});
|
|
85
|
+
expect(
|
|
86
|
+
wrapper
|
|
87
|
+
.findComponent({
|
|
88
|
+
name: 'wt-loader',
|
|
89
|
+
})
|
|
90
|
+
.exists(),
|
|
91
|
+
).toBe(true);
|
|
92
|
+
|
|
93
|
+
vi.advanceTimersByTime(1000);
|
|
94
|
+
await wrapper.vm.$nextTick();
|
|
95
|
+
|
|
96
|
+
expect(
|
|
97
|
+
wrapper
|
|
98
|
+
.findComponent({
|
|
99
|
+
name: 'wt-loader',
|
|
100
|
+
})
|
|
101
|
+
.exists(),
|
|
102
|
+
).toBe(false);
|
|
103
|
+
expect(
|
|
104
|
+
wrapper
|
|
105
|
+
.findComponent({
|
|
106
|
+
name: 'wt-icon',
|
|
107
|
+
})
|
|
108
|
+
.exists(),
|
|
109
|
+
).toBe(true);
|
|
110
|
+
vi.useRealTimers();
|
|
111
|
+
});
|
|
14
112
|
});
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
-
:class="[
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
:class="[
|
|
4
|
+
`wt-rounded-action--size-${size}`,
|
|
5
|
+
{ 'wt-rounded-action--active': active },
|
|
6
|
+
{ 'wt-rounded-action--disabled': disabled },
|
|
7
|
+
{ 'wt-rounded-action--rounded': rounded },
|
|
8
|
+
{ 'wt-rounded-action--wide': wide },
|
|
9
|
+
{ 'wt-button--loading': showLoader },
|
|
10
|
+
]"
|
|
11
|
+
class="wt-rounded-action"
|
|
12
|
+
type="button"
|
|
13
|
+
v-tooltip="tooltip"
|
|
14
|
+
@click="emit('click', $event)"
|
|
15
|
+
>
|
|
11
16
|
<wt-loader v-if="showLoader" color="main" :size="loaderSize" />
|
|
12
17
|
<wt-icon v-else :color="iColor" :icon="icon" :icon-prefix="iconPrefix" :size="size" />
|
|
13
18
|
</button>
|
|
@@ -109,6 +114,14 @@ const props = defineProps({
|
|
|
109
114
|
type: Boolean,
|
|
110
115
|
default: false,
|
|
111
116
|
},
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Tooltip text displayed on hover via v-tooltip directive
|
|
120
|
+
* @type {string}
|
|
121
|
+
*/
|
|
122
|
+
tooltip: {
|
|
123
|
+
type: String,
|
|
124
|
+
},
|
|
112
125
|
});
|
|
113
126
|
const emit = defineEmits([
|
|
114
127
|
'click',
|
|
@@ -6,6 +6,9 @@ import WtSwitcher from '../wt-switcher.vue';
|
|
|
6
6
|
describe('WtSwitcher', () => {
|
|
7
7
|
it('renders a component', () => {
|
|
8
8
|
const wrapper = shallowMount(WtSwitcher, {
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: false,
|
|
11
|
+
},
|
|
9
12
|
stubs: {
|
|
10
13
|
WtLabel,
|
|
11
14
|
},
|
|
@@ -21,24 +24,19 @@ describe('WtSwitcher', () => {
|
|
|
21
24
|
},
|
|
22
25
|
props: {
|
|
23
26
|
label,
|
|
27
|
+
modelValue: false,
|
|
24
28
|
},
|
|
25
29
|
});
|
|
26
30
|
expect(wrapper.find('.wt-switcher__label').text()).toBe(label);
|
|
27
31
|
});
|
|
28
32
|
|
|
29
|
-
it('
|
|
30
|
-
const
|
|
31
|
-
const wrapper = mount(WtSwitcher, {
|
|
32
|
-
stubs: {
|
|
33
|
-
WtLabel,
|
|
34
|
-
},
|
|
33
|
+
it('reflects left-label modifier class', () => {
|
|
34
|
+
const wrapper = shallowMount(WtSwitcher, {
|
|
35
35
|
props: {
|
|
36
|
-
|
|
36
|
+
modelValue: false,
|
|
37
|
+
labelLeft: true,
|
|
37
38
|
},
|
|
38
39
|
});
|
|
39
|
-
wrapper.
|
|
40
|
-
expect(wrapper.emitted().change[0]).toEqual([
|
|
41
|
-
!value,
|
|
42
|
-
]);
|
|
40
|
+
expect(wrapper.classes('wt-switcher--label-left')).toBe(true);
|
|
43
41
|
});
|
|
44
42
|
});
|
|
@@ -35,7 +35,7 @@ describe('WtTextarea', () => {
|
|
|
35
35
|
autoresize: true,
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
|
-
wrapper.find('.wt-textarea__textarea').trigger('
|
|
38
|
+
wrapper.find('.wt-textarea__textarea').trigger('keydown', {
|
|
39
39
|
key: 'Enter',
|
|
40
40
|
});
|
|
41
41
|
expect(wrapper.emitted().enter).toBeTruthy();
|
|
@@ -47,7 +47,7 @@ describe('WtTextarea', () => {
|
|
|
47
47
|
WtLabel,
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
|
-
wrapper.find('.wt-textarea__textarea').trigger('
|
|
50
|
+
wrapper.find('.wt-textarea__textarea').trigger('keydown', {
|
|
51
51
|
key: 'Enter',
|
|
52
52
|
});
|
|
53
53
|
expect(wrapper.emitted().enter).toBeFalsy();
|
|
@@ -10,7 +10,7 @@ describe('WtTimeInput', () => {
|
|
|
10
10
|
WtLabel,
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
|
-
expect(wrapper.
|
|
13
|
+
expect(wrapper.exists()).toBe(true);
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
it('renders label text when passed', () => {
|
|
@@ -25,4 +25,21 @@ describe('WtTimeInput', () => {
|
|
|
25
25
|
});
|
|
26
26
|
expect(wrapper.find('.wt-label').text()).toBe(label);
|
|
27
27
|
});
|
|
28
|
+
|
|
29
|
+
it('emits model update from input-number', () => {
|
|
30
|
+
const wrapper = shallowMount(WtTimeInput, {
|
|
31
|
+
props: {
|
|
32
|
+
modelValue: 0,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
wrapper
|
|
37
|
+
.findComponent({
|
|
38
|
+
name: 'wt-input-number',
|
|
39
|
+
})
|
|
40
|
+
.vm.$emit('update:modelValue', 7);
|
|
41
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
42
|
+
7,
|
|
43
|
+
]);
|
|
44
|
+
});
|
|
28
45
|
});
|
|
@@ -26,49 +26,43 @@ describe('WtTimepicker', () => {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
it('Correctly converts value from MIN time-input to output', async () => {
|
|
29
|
-
const value = 0;
|
|
30
29
|
const wrapper = mount(WtTimepicker, {
|
|
31
|
-
// stubs: {
|
|
32
|
-
// WtTimeInput,
|
|
33
|
-
// },
|
|
34
30
|
props: {
|
|
35
|
-
|
|
31
|
+
modelValue: 0,
|
|
36
32
|
},
|
|
37
33
|
});
|
|
38
|
-
wrapper.findAllComponents(WtTimeInput)
|
|
39
|
-
expect(wrapper.emitted()
|
|
34
|
+
wrapper.findAllComponents(WtTimeInput)[0].vm.$emit('update:modelValue', 21);
|
|
35
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
40
36
|
21 * 60 * 60,
|
|
41
37
|
]);
|
|
42
38
|
});
|
|
43
39
|
|
|
44
40
|
it('Correctly converts value from HOUR time-input to output', () => {
|
|
45
|
-
const value = 0;
|
|
46
41
|
const wrapper = mount(WtTimepicker, {
|
|
47
42
|
stubs: {
|
|
48
43
|
WtTimeInput,
|
|
49
44
|
},
|
|
50
45
|
props: {
|
|
51
|
-
|
|
46
|
+
modelValue: 0,
|
|
52
47
|
},
|
|
53
48
|
});
|
|
54
|
-
wrapper.findAllComponents(WtTimeInput)
|
|
55
|
-
expect(wrapper.emitted()
|
|
49
|
+
wrapper.findAllComponents(WtTimeInput)[1].vm.$emit('update:modelValue', 21);
|
|
50
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
56
51
|
21 * 60,
|
|
57
52
|
]);
|
|
58
53
|
});
|
|
59
54
|
|
|
60
55
|
it('Correctly converts value from SEC time-input to output', () => {
|
|
61
|
-
const value = 0;
|
|
62
56
|
const wrapper = mount(WtTimepicker, {
|
|
63
57
|
stubs: {
|
|
64
58
|
WtTimeInput,
|
|
65
59
|
},
|
|
66
60
|
props: {
|
|
67
|
-
|
|
61
|
+
modelValue: 0,
|
|
68
62
|
},
|
|
69
63
|
});
|
|
70
|
-
wrapper.findAllComponents(WtTimeInput)
|
|
71
|
-
expect(wrapper.emitted()
|
|
64
|
+
wrapper.findAllComponents(WtTimeInput)[2].vm.$emit('update:modelValue', 21);
|
|
65
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
72
66
|
21,
|
|
73
67
|
]);
|
|
74
68
|
});
|