@webitel/ui-sdk 26.8.75 → 26.8.77
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/{clients-BmeOR90W.js → clients-B8-WDK4d.js} +66 -79
- package/dist/{components-C-ri6OSQ.js → components-fKLMXHe_.js} +11 -11
- package/dist/{enums-BvonmHq2.js → enums-B_9ZBu01.js} +2 -2
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +3 -3
- package/dist/ui-sdk.umd.cjs +610 -612
- package/dist/{useValidation-0JwQGpLM.js → useValidation-CEed9cxY.js} +1 -1
- package/dist/{utils-CzBdLnFt.js → utils-BZHq8qMH.js} +1 -1
- package/dist/wt-action-bar-D74sgDCk.js +94 -0
- package/dist/{wt-button-D-nFhi1f.js → wt-button-BwPz__rU.js} +2 -2
- package/dist/{wt-chat-emoji-CLhgb02d.js → wt-chat-emoji-DcVCe4jW.js} +4 -4
- package/dist/{wt-datepicker-DCa23hYx.js → wt-datepicker-BgjjbOMX.js} +2 -2
- package/dist/{wt-display-chip-items-B7QLz9QM.js → wt-display-chip-items-D-v25BUi.js} +2 -2
- package/dist/{wt-dual-panel-D-LChluY.js → wt-dual-panel-Cs_Yzfxt.js} +1 -1
- package/dist/{wt-expansion-card-CToBA1fy.js → wt-expansion-card-BT586Mul.js} +1 -1
- package/dist/{wt-expansion-panel-af2t3VrM.js → wt-expansion-panel-kZmHSvPU.js} +1 -1
- package/dist/{wt-icon-action-DYBTs3Mf.js → wt-icon-action-DJzm0kEk.js} +1 -1
- package/dist/{wt-icon-btn-BfhuUt8-.js → wt-icon-btn-BzraLc-w.js} +1 -1
- package/dist/{wt-icon-WyFAGc4t.js → wt-icon-iRDqWkjp.js} +19 -19
- package/dist/{wt-notifications-bar-CvKwuTEg.js → wt-notifications-bar-ZIMKBDqL.js} +2 -2
- package/dist/{wt-player-B2etfN5v.js → wt-player-CFrKSilF.js} +3 -3
- package/dist/{wt-screen-recordings-action-CepB2pqh.js → wt-screen-recordings-action-CVHZAWjl.js} +1 -1
- package/dist/{wt-search-bar-B4YkhgIB.js → wt-search-bar-DosqJLXT.js} +1 -1
- package/dist/{wt-send-message-popup-BhZ7K_Vs.js → wt-send-message-popup-BpgjqxvU.js} +2 -2
- package/dist/{wt-status-select-ELI7j73g.js → wt-status-select-Dnv9tj7o.js} +1 -1
- package/dist/{wt-timepicker-C3v9Cp2e.js → wt-timepicker-B4MOaSEZ.js} +2 -2
- package/dist/{wt-toast-DxQBRGm2.js → wt-toast-BcgNZFCD.js} +2 -2
- package/dist/{wt-tree-table-C5sxm-Eb.js → wt-tree-table-xXbBeLUc.js} +1 -1
- package/dist/{wt-type-extension-value-input-gQGgxMcJ.js → wt-type-extension-value-input-D86gV8RI.js} +3 -3
- package/dist/{wt-vidstack-player-B37Mdf0u.js → wt-vidstack-player-BzyyVEji.js} +4 -4
- package/package.json +1 -1
- package/src/assets/icons/sprite/call--filled.svg +1 -1
- package/src/assets/icons/sprite/call-add-to--filled.svg +2 -2
- package/src/assets/icons/sprite/call-add-to.svg +2 -3
- package/src/assets/icons/sprite/call-disconnect--filled.svg +2 -2
- package/src/assets/icons/sprite/call-disconnect.svg +2 -2
- package/src/assets/icons/sprite/call-end--filled.svg +2 -1
- package/src/assets/icons/sprite/call-end.svg +2 -2
- package/src/assets/icons/sprite/call-inbound--filled.svg +2 -3
- package/src/assets/icons/sprite/call-inbound.svg +2 -2
- package/src/assets/icons/sprite/call-missed--filled.svg +2 -2
- package/src/assets/icons/sprite/call-missed.svg +2 -2
- package/src/assets/icons/sprite/call-outbound--filled.svg +2 -2
- package/src/assets/icons/sprite/call-outbound.svg +2 -2
- package/src/assets/icons/sprite/call-ringing--filled.svg +3 -4
- package/src/assets/icons/sprite/call-ringing.svg +3 -2
- package/src/assets/icons/sprite/call-transfer--filled.svg +2 -2
- package/src/assets/icons/sprite/call-transfer.svg +2 -2
- package/src/assets/icons/sprite/call.svg +1 -2
- package/src/components/transitions/__tests__/ExpandTransition.spec.js +15 -0
- package/src/components/transitions/__tests__/WtReplaceTransition.spec.js +66 -0
- package/src/components/transitions/__tests__/WtTransition.spec.js +35 -0
- package/src/components/wt-action-bar/WtActionBarActionsOrder.js +1 -1
- package/src/components/wt-action-bar/__tests__/WtActionBar.spec.js +121 -0
- package/src/components/wt-action-bar/wt-action-bar.vue +57 -33
- package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +65 -4
- package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +81 -2
- package/src/components/wt-avatar/__tests__/WtAvatar.spec.js +111 -0
- package/src/components/wt-badge/__tests__/WtBadge.spec.js +80 -0
- package/src/components/wt-badge-new/__tests__/WtBadge.spec.js +61 -0
- package/src/components/wt-breadcrumb/__tests__/WtBreadcrumb.spec.js +117 -0
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +37 -5
- package/src/components/wt-call-media-metric/__tests__/WtCallMediaMetric.spec.js +84 -0
- package/src/components/wt-card/__tests__/WtCard.spec.js +20 -0
- package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +63 -0
- package/src/components/wt-chip/__tests__/WtChip.spec.js +32 -0
- package/src/components/wt-confirm-dialog/__tests__/WtConfirmDialog.spec.js +92 -0
- package/src/components/wt-context-menu/__tests__/WtContextMenu.spec.js +146 -1
- package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +57 -0
- package/src/components/wt-datepicker/__tests__/WtDatepicker.spec.js +53 -0
- package/src/components/wt-datetime-text/__tests__/WtDatetimeText.spec.js +49 -0
- package/src/components/wt-divider/__tests__/WtDivider.spec.js +30 -0
- package/src/components/wt-dual-panel/__tests__/WtDualPanel.spec.js +120 -0
- package/src/components/wt-dummy/__tests__/WtDummy.spec.js +63 -1
- package/src/components/wt-empty/__tests__/WtEmpty.spec.js +84 -0
- package/src/components/wt-error-page/__tests__/WtErrorPage.spec.js +60 -0
- package/src/components/wt-expansion-card/__tests__/WtExpansionCard.spec.js +63 -0
- package/src/components/wt-expansion-panel/__tests__/WtExpansionPanel.spec.js +48 -9
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +81 -10
- package/src/components/wt-hint/__tests__/WtHint.spec.js +44 -1
- package/src/components/wt-icon/__tests__/WtIcon.spec.js +29 -0
- package/src/components/wt-icon-action/__tests__/WtIconAction.spec.js +79 -0
- package/src/components/wt-icon-action/wt-icon-action.vue +1 -1
- package/src/components/wt-icon-btn/__tests__/WtIconBtn.spec.js +46 -0
- package/src/components/wt-image/__tests__/WtImage.spec.js +83 -0
- package/src/components/wt-indicator/__tests__/WtIndicator.spec.js +23 -0
- package/src/components/wt-input-number/__tests__/WtInputNumber.spec.js +77 -0
- package/src/components/wt-input-text/__tests__/WtInputText.spec.js +85 -0
- package/src/components/wt-intersection-observer/__tests__/WtIntersectionObserver.spec.js +24 -3
- package/src/components/wt-item-link/__tests__/WtItemLink.spec.js +93 -1
- package/src/components/wt-label/__tests__/WtLabel.spec.js +49 -1
- package/src/components/wt-load-bar/__tests__/WtLoadBar.spec.js +49 -0
- package/src/components/wt-loader/__tests__/WtLoader.spec.js +26 -1
- package/src/components/wt-logo/__tests__/WtLogo.spec.js +55 -0
- package/src/components/wt-menubar/__tests__/WtMenubar.spec.js +30 -0
- package/src/components/wt-message/__tests__/WtMessage.spec.js +46 -0
- package/src/components/wt-multi-select/__tests__/WtMultiSelect.spec.js +106 -0
- package/src/components/wt-page-header/__tests__/WtPageHeader.spec.js +111 -0
- package/src/components/wt-password/__tests__/WtPassword.spec.js +107 -0
- package/src/components/wt-popover/__tests__/WtPopover.spec.js +73 -0
- package/src/components/wt-progress-bar/__tests__/WtProgressBar.spec.js +34 -0
- package/src/components/wt-radio/__tests__/WtRadio.spec.js +45 -0
- package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +48 -0
- package/src/components/wt-search-bar/__tests__/WtSearchBar.spec.js +74 -13
- package/src/components/wt-single-select/__tests__/WtSingleSelect.spec.js +117 -0
- package/src/components/wt-slider/__tests__/WtSlider.spec.js +100 -0
- package/src/components/wt-stepper/__tests__/WtStepper.spec.js +105 -0
- package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +47 -0
- package/src/components/wt-table/__tests__/WtTable.spec.js +237 -0
- package/src/components/wt-table-actions/__tests__/WtTableActions.spec.js +153 -1
- package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +147 -0
- package/src/components/wt-tabs/__tests__/WtTabs.spec.js +55 -0
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +49 -0
- package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +29 -0
- package/src/components/wt-tree/__tests__/WtTree.spec.js +126 -2
- package/src/components/wt-tree-line/__tests__/WtTreeLine.spec.js +205 -0
- package/src/components/wt-tree-table/__tests__/WtTreeTable.spec.js +155 -0
- package/src/components/wt-tree-table-row/__tests__/WtTreeTableRow.spec.js +176 -0
- package/src/components/wt-vidstack-player/__tests__/WtVidstackPlayer.spec.js +82 -0
- package/src/enums/IconAction/{IconAction.enum.js → IconAction.ts} +4 -2
- package/src/enums/index.ts +1 -1
- package/src/modules/ObjectPermissions/components/_internal/permissions-tab-content.vue +1 -1
- package/types/.tsbuildinfo +1 -1
- package/types/components/wt-action-bar/wt-action-bar.vue.d.ts +349 -105
- package/types/components/wt-datetime-text/__tests__/WtDatetimeText.spec.d.ts +1 -0
- package/types/components/wt-divider/__tests__/WtDivider.spec.d.ts +1 -0
- package/types/components/wt-dual-panel/__tests__/WtDualPanel.spec.d.ts +1 -0
- package/types/components/wt-empty/__tests__/WtEmpty.spec.d.ts +1 -0
- package/types/components/wt-error-page/__tests__/WtErrorPage.spec.d.ts +1 -0
- package/types/components/wt-expansion-card/__tests__/WtExpansionCard.spec.d.ts +1 -0
- package/types/components/wt-image/__tests__/WtImage.spec.d.ts +1 -0
- package/types/components/wt-input-number/__tests__/WtInputNumber.spec.d.ts +1 -0
- package/types/components/wt-input-text/__tests__/WtInputText.spec.d.ts +1 -0
- package/types/components/wt-logo/__tests__/WtLogo.spec.d.ts +1 -0
- package/types/components/wt-menubar/__tests__/WtMenubar.spec.d.ts +1 -0
- package/types/components/wt-message/__tests__/WtMessage.spec.d.ts +1 -0
- package/types/components/wt-multi-select/__tests__/WtMultiSelect.spec.d.ts +1 -0
- package/types/components/wt-page-header/__tests__/WtPageHeader.spec.d.ts +1 -0
- package/types/components/wt-password/__tests__/WtPassword.spec.d.ts +1 -0
- package/types/components/wt-popover/__tests__/WtPopover.spec.d.ts +1 -0
- package/types/components/wt-single-select/__tests__/WtSingleSelect.spec.d.ts +1 -0
- package/types/components/wt-slider/__tests__/WtSlider.spec.d.ts +1 -0
- package/types/components/wt-stepper/__tests__/WtStepper.spec.d.ts +1 -0
- package/types/components/wt-table/__tests__/WtTable.spec.d.ts +1 -0
- package/types/components/wt-tree-line/__tests__/WtTreeLine.spec.d.ts +1 -0
- package/types/components/wt-tree-table/__tests__/WtTreeTable.spec.d.ts +1 -0
- package/types/components/wt-tree-table-row/__tests__/WtTreeTableRow.spec.d.ts +1 -0
- package/types/components/wt-vidstack-player/__tests__/WtVidstackPlayer.spec.d.ts +1 -0
- package/types/enums/IconAction/IconAction.d.ts +31 -0
- package/types/enums/index.d.ts +1 -1
- package/dist/wt-action-bar-D4wDtBqb.js +0 -87
- package/src/components/wt-action-bar/__tests__/wt-action-bar.spec.js +0 -10
- package/src/components/wt-avatar/__tests__/wt-avatar.spec.js +0 -10
- package/src/components/wt-badge/__tests__/wt-badge.spec.js +0 -10
- package/src/components/wt-breadcrumb/__tests__/wt-breadcrumb.spec.js +0 -14
- package/src/components/wt-dual-panel/__tests__/WtDualPanel.js +0 -62
- package/src/components/wt-empty/__tests__/wt-empty.spec.js +0 -10
- package/src/components/wt-error-page/__tests__/wt-error-page.spec.js +0 -30
- package/src/components/wt-image/__tests__/wt-image.spec.js +0 -10
- package/src/components/wt-logo/__tests__/wt-logo.spec.js +0 -10
- package/src/components/wt-page-header/__tests__/wt-page-header.spec.js +0 -10
- package/src/components/wt-stepper/__tests__/WtStepper.spec.vue.js +0 -19
- package/types/enums/IconAction/IconAction.enum.d.ts +0 -30
- /package/types/components/{wt-action-bar/__tests__/wt-action-bar.spec.d.ts → transitions/__tests__/WtReplaceTransition.spec.d.ts} +0 -0
- /package/types/components/{wt-avatar/__tests__/wt-avatar.spec.d.ts → transitions/__tests__/WtTransition.spec.d.ts} +0 -0
- /package/types/components/{wt-badge/__tests__/wt-badge.spec.d.ts → wt-action-bar/__tests__/WtActionBar.spec.d.ts} +0 -0
- /package/types/components/{wt-breadcrumb/__tests__/wt-breadcrumb.spec.d.ts → wt-avatar/__tests__/WtAvatar.spec.d.ts} +0 -0
- /package/types/components/{wt-empty/__tests__/wt-empty.spec.d.ts → wt-badge/__tests__/WtBadge.spec.d.ts} +0 -0
- /package/types/components/{wt-dual-panel/__tests__/WtDualPanel.d.ts → wt-badge-new/__tests__/WtBadge.spec.d.ts} +0 -0
- /package/types/components/{wt-error-page/__tests__/wt-error-page.spec.d.ts → wt-breadcrumb/__tests__/WtBreadcrumb.spec.d.ts} +0 -0
- /package/types/components/{wt-image/__tests__/wt-image.spec.d.ts → wt-call-media-metric/__tests__/WtCallMediaMetric.spec.d.ts} +0 -0
- /package/types/components/{wt-logo/__tests__/wt-logo.spec.d.ts → wt-card/__tests__/WtCard.spec.d.ts} +0 -0
- /package/types/components/{wt-page-header/__tests__/wt-page-header.spec.d.ts → wt-confirm-dialog/__tests__/WtConfirmDialog.spec.d.ts} +0 -0
- /package/types/components/{wt-stepper/__tests__/WtStepper.spec.vue.d.ts → wt-copy-action/__tests__/WtCopyAction.spec.d.ts} +0 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtTreeLine from '../wt-tree-line.vue';
|
|
4
|
+
|
|
5
|
+
const leaf = {
|
|
6
|
+
label: 'Leaf',
|
|
7
|
+
};
|
|
8
|
+
const parent = {
|
|
9
|
+
label: 'Parent',
|
|
10
|
+
children: [
|
|
11
|
+
{
|
|
12
|
+
label: 'Child 1',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: 'Child 2',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
describe('WtTreeLine', () => {
|
|
21
|
+
it('renders a component', () => {
|
|
22
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
23
|
+
props: {
|
|
24
|
+
data: leaf,
|
|
25
|
+
modelValue: null,
|
|
26
|
+
itemLabel: 'label',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
expect(wrapper.find('.wt-tree-line').exists()).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('renders the item label', () => {
|
|
33
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
34
|
+
props: {
|
|
35
|
+
data: leaf,
|
|
36
|
+
modelValue: null,
|
|
37
|
+
itemLabel: 'label',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
expect(wrapper.find('.wt-tree-line__label').text()).toBe('Leaf');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('does not render an expand toggle for a leaf node', () => {
|
|
44
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
45
|
+
props: {
|
|
46
|
+
data: leaf,
|
|
47
|
+
modelValue: null,
|
|
48
|
+
itemLabel: 'label',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
expect(
|
|
52
|
+
wrapper
|
|
53
|
+
.findComponent({
|
|
54
|
+
name: 'wt-icon-btn',
|
|
55
|
+
})
|
|
56
|
+
.exists(),
|
|
57
|
+
).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('renders an expand toggle for a node with children', () => {
|
|
61
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
62
|
+
props: {
|
|
63
|
+
data: parent,
|
|
64
|
+
modelValue: null,
|
|
65
|
+
itemLabel: 'label',
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
expect(
|
|
69
|
+
wrapper
|
|
70
|
+
.findComponent({
|
|
71
|
+
name: 'wt-icon-btn',
|
|
72
|
+
})
|
|
73
|
+
.exists(),
|
|
74
|
+
).toBe(true);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('renders a nested wt-tree-line per child', () => {
|
|
78
|
+
const wrapper = mount(WtTreeLine, {
|
|
79
|
+
props: {
|
|
80
|
+
data: parent,
|
|
81
|
+
modelValue: null,
|
|
82
|
+
itemLabel: 'label',
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
const labels = wrapper.findAll('.wt-tree-line__label').map((l) => l.text());
|
|
86
|
+
expect(labels).toEqual([
|
|
87
|
+
'Parent',
|
|
88
|
+
'Child 1',
|
|
89
|
+
'Child 2',
|
|
90
|
+
]);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('emits update:modelValue with the raw data for a leaf when clicked', async () => {
|
|
94
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
95
|
+
props: {
|
|
96
|
+
data: leaf,
|
|
97
|
+
modelValue: null,
|
|
98
|
+
itemLabel: 'label',
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
await wrapper.find('.wt-tree-line__label-wrapper').trigger('click');
|
|
102
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
103
|
+
leaf,
|
|
104
|
+
]);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('emits update:modelValue with itemData value when itemData is provided', async () => {
|
|
108
|
+
const keyedLeaf = {
|
|
109
|
+
id: 'a',
|
|
110
|
+
label: 'A',
|
|
111
|
+
};
|
|
112
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
113
|
+
props: {
|
|
114
|
+
data: keyedLeaf,
|
|
115
|
+
modelValue: null,
|
|
116
|
+
itemLabel: 'label',
|
|
117
|
+
itemData: 'id',
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
await wrapper.find('.wt-tree-line__label-wrapper').trigger('click');
|
|
121
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
122
|
+
'a',
|
|
123
|
+
]);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('toggles collapsed state (and does not emit) when clicking a node with children, unless allowParent', async () => {
|
|
127
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
128
|
+
props: {
|
|
129
|
+
data: parent,
|
|
130
|
+
modelValue: null,
|
|
131
|
+
itemLabel: 'label',
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
await wrapper.find('.wt-tree-line__label-wrapper').trigger('click');
|
|
135
|
+
expect(wrapper.emitted()['update:modelValue']).toBeFalsy();
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// NOTE: `allowParent`'s early-return branch only applies to nodes without children,
|
|
139
|
+
// and for those it emits the exact same value as the default (final) emit below it —
|
|
140
|
+
// so toggling `allowParent` has no observable effect on a leaf's click behavior, and
|
|
141
|
+
// none at all on a node with children (the collapse-toggle branch always wins first).
|
|
142
|
+
// Asserting the current (seemingly no-op) behavior rather than an intended one.
|
|
143
|
+
it('has no observable effect on click behavior for a leaf node', async () => {
|
|
144
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
145
|
+
props: {
|
|
146
|
+
data: leaf,
|
|
147
|
+
modelValue: null,
|
|
148
|
+
itemLabel: 'label',
|
|
149
|
+
allowParent: true,
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
await wrapper.find('.wt-tree-line__label-wrapper').trigger('click');
|
|
153
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
154
|
+
leaf,
|
|
155
|
+
]);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('marks the node active when it matches modelValue', () => {
|
|
159
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
160
|
+
props: {
|
|
161
|
+
data: leaf,
|
|
162
|
+
modelValue: leaf,
|
|
163
|
+
itemLabel: 'label',
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
expect(wrapper.find('.wt-tree-line__label-wrapper').classes()).toContain(
|
|
167
|
+
'active',
|
|
168
|
+
);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('marks the node searched when data has the searched flag', () => {
|
|
172
|
+
const searchedLeaf = {
|
|
173
|
+
label: 'Leaf',
|
|
174
|
+
searched: true,
|
|
175
|
+
};
|
|
176
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
177
|
+
props: {
|
|
178
|
+
data: searchedLeaf,
|
|
179
|
+
modelValue: null,
|
|
180
|
+
itemLabel: 'label',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
expect(wrapper.find('.wt-tree-line__label-wrapper').classes()).toContain(
|
|
184
|
+
'searched',
|
|
185
|
+
);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('toggles multi-select values into an array in multiple mode', async () => {
|
|
189
|
+
const wrapper = shallowMount(WtTreeLine, {
|
|
190
|
+
props: {
|
|
191
|
+
data: leaf,
|
|
192
|
+
modelValue: [],
|
|
193
|
+
itemLabel: 'label',
|
|
194
|
+
itemData: 'label',
|
|
195
|
+
multiple: true,
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
await wrapper.find('.wt-tree-line__label-wrapper').trigger('click');
|
|
199
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
200
|
+
[
|
|
201
|
+
'Leaf',
|
|
202
|
+
],
|
|
203
|
+
]);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtTreeTable from '../wt-tree-table.vue';
|
|
4
|
+
|
|
5
|
+
const headers = [
|
|
6
|
+
{
|
|
7
|
+
value: 'name',
|
|
8
|
+
text: 'Name',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
value: 'age',
|
|
12
|
+
text: 'Age',
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const data = [
|
|
17
|
+
{
|
|
18
|
+
id: 1,
|
|
19
|
+
name: 'Alice',
|
|
20
|
+
age: 30,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 2,
|
|
24
|
+
name: 'Bob',
|
|
25
|
+
age: 25,
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
describe('WtTreeTable', () => {
|
|
30
|
+
it('renders a component', () => {
|
|
31
|
+
const wrapper = shallowMount(WtTreeTable, {
|
|
32
|
+
props: {
|
|
33
|
+
headers,
|
|
34
|
+
data,
|
|
35
|
+
childrenProp: 'children',
|
|
36
|
+
selected: [],
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
expect(wrapper.classes()).toContain('wt-tree-table');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('renders a header cell per header, an actions header, and a row per data item', () => {
|
|
43
|
+
const wrapper = shallowMount(WtTreeTable, {
|
|
44
|
+
props: {
|
|
45
|
+
headers,
|
|
46
|
+
data,
|
|
47
|
+
childrenProp: 'children',
|
|
48
|
+
selected: [],
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
expect(wrapper.findAll('.wt-tree-table-th').length).toBe(headers.length);
|
|
52
|
+
expect(wrapper.find('.wt-tree-table-th__actions').exists()).toBe(true);
|
|
53
|
+
expect(
|
|
54
|
+
wrapper.findAllComponents({
|
|
55
|
+
name: 'wt-tree-table-row',
|
|
56
|
+
}).length,
|
|
57
|
+
).toBe(data.length);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('does not render the actions header when gridActions is false', () => {
|
|
61
|
+
const wrapper = shallowMount(WtTreeTable, {
|
|
62
|
+
props: {
|
|
63
|
+
headers,
|
|
64
|
+
data,
|
|
65
|
+
childrenProp: 'children',
|
|
66
|
+
selected: [],
|
|
67
|
+
gridActions: false,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
expect(wrapper.find('.wt-tree-table-th__actions').exists()).toBe(false);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('renders a select-all checkbox on the first header when selectable', () => {
|
|
74
|
+
const wrapper = shallowMount(WtTreeTable, {
|
|
75
|
+
props: {
|
|
76
|
+
headers,
|
|
77
|
+
data,
|
|
78
|
+
childrenProp: 'children',
|
|
79
|
+
selected: [],
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
expect(
|
|
83
|
+
wrapper
|
|
84
|
+
.findComponent({
|
|
85
|
+
name: 'wt-checkbox',
|
|
86
|
+
})
|
|
87
|
+
.exists(),
|
|
88
|
+
).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('emits sort with the next sort order for a sortable column', async () => {
|
|
92
|
+
const sortableHeaders = [
|
|
93
|
+
{
|
|
94
|
+
value: 'name',
|
|
95
|
+
text: 'Name',
|
|
96
|
+
sort: null,
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
const wrapper = mount(WtTreeTable, {
|
|
100
|
+
props: {
|
|
101
|
+
headers: sortableHeaders,
|
|
102
|
+
data,
|
|
103
|
+
childrenProp: 'children',
|
|
104
|
+
selected: [],
|
|
105
|
+
sortable: true,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
await wrapper.find('.wt-tree-table-th').trigger('click');
|
|
109
|
+
expect(wrapper.emitted().sort).toBeTruthy();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('emits update:selected when a row toggles selection, given an explicit selected prop', async () => {
|
|
113
|
+
const wrapper = shallowMount(WtTreeTable, {
|
|
114
|
+
props: {
|
|
115
|
+
headers,
|
|
116
|
+
data,
|
|
117
|
+
childrenProp: 'children',
|
|
118
|
+
selected: [],
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
const row = wrapper.findComponent({
|
|
122
|
+
name: 'wt-tree-table-row',
|
|
123
|
+
});
|
|
124
|
+
await row.vm.$emit('update:selected', {
|
|
125
|
+
data: data[0],
|
|
126
|
+
select: true,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
expect(wrapper.emitted()['update:selected'][0]).toEqual([
|
|
130
|
+
[
|
|
131
|
+
data[0],
|
|
132
|
+
],
|
|
133
|
+
]);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('emits update:selected with all nested elements when select-all is toggled on', async () => {
|
|
137
|
+
const wrapper = shallowMount(WtTreeTable, {
|
|
138
|
+
props: {
|
|
139
|
+
headers,
|
|
140
|
+
data,
|
|
141
|
+
childrenProp: 'children',
|
|
142
|
+
selected: [],
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
await wrapper
|
|
146
|
+
.findComponent({
|
|
147
|
+
name: 'wt-checkbox',
|
|
148
|
+
})
|
|
149
|
+
.vm.$emit('update:selected', true);
|
|
150
|
+
|
|
151
|
+
expect(wrapper.emitted()['update:selected'][0]).toEqual([
|
|
152
|
+
data,
|
|
153
|
+
]);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtTreeTableRow from '../wt-tree-table-row.vue';
|
|
4
|
+
|
|
5
|
+
const dataHeaders = [
|
|
6
|
+
{
|
|
7
|
+
value: 'name',
|
|
8
|
+
text: 'Name',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
value: 'age',
|
|
12
|
+
text: 'Age',
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const leafRow = {
|
|
17
|
+
id: 1,
|
|
18
|
+
name: 'Alice',
|
|
19
|
+
age: 30,
|
|
20
|
+
};
|
|
21
|
+
const parentRow = {
|
|
22
|
+
id: 2,
|
|
23
|
+
name: 'Bob',
|
|
24
|
+
age: 40,
|
|
25
|
+
children: [
|
|
26
|
+
{
|
|
27
|
+
id: 3,
|
|
28
|
+
name: 'Charlie',
|
|
29
|
+
age: 10,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
describe('WtTreeTableRow', () => {
|
|
35
|
+
it('renders a component', () => {
|
|
36
|
+
const wrapper = shallowMount(WtTreeTableRow, {
|
|
37
|
+
props: {
|
|
38
|
+
data: leafRow,
|
|
39
|
+
rowPosition: 0,
|
|
40
|
+
childrenProp: 'children',
|
|
41
|
+
selectedElements: [],
|
|
42
|
+
dataHeaders,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
expect(wrapper.find('.wt-tree-table-row').exists()).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('renders a cell with the value for each header', () => {
|
|
49
|
+
const wrapper = shallowMount(WtTreeTableRow, {
|
|
50
|
+
props: {
|
|
51
|
+
data: leafRow,
|
|
52
|
+
rowPosition: 0,
|
|
53
|
+
childrenProp: 'children',
|
|
54
|
+
selectedElements: [],
|
|
55
|
+
dataHeaders,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const cells = wrapper.findAll('.wt-tree-table-td');
|
|
59
|
+
expect(cells[0].text()).toContain('Alice');
|
|
60
|
+
expect(cells[1].text()).toContain('30');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('applies the alternate class on odd row positions', () => {
|
|
64
|
+
const wrapper = shallowMount(WtTreeTableRow, {
|
|
65
|
+
props: {
|
|
66
|
+
data: leafRow,
|
|
67
|
+
rowPosition: 1,
|
|
68
|
+
childrenProp: 'children',
|
|
69
|
+
selectedElements: [],
|
|
70
|
+
dataHeaders,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
expect(wrapper.find('.wt-tree-table-row').classes()).toContain(
|
|
74
|
+
'wt-tree-table-row--alternate',
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('does not render an expand toggle for a row without children', () => {
|
|
79
|
+
const wrapper = shallowMount(WtTreeTableRow, {
|
|
80
|
+
props: {
|
|
81
|
+
data: leafRow,
|
|
82
|
+
rowPosition: 0,
|
|
83
|
+
childrenProp: 'children',
|
|
84
|
+
selectedElements: [],
|
|
85
|
+
dataHeaders,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
expect(
|
|
89
|
+
wrapper
|
|
90
|
+
.findComponent({
|
|
91
|
+
name: 'wt-icon-btn',
|
|
92
|
+
})
|
|
93
|
+
.exists(),
|
|
94
|
+
).toBe(false);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('renders an expand toggle and nested rows once expanded, for a row with children', async () => {
|
|
98
|
+
const wrapper = mount(WtTreeTableRow, {
|
|
99
|
+
props: {
|
|
100
|
+
data: parentRow,
|
|
101
|
+
rowPosition: 0,
|
|
102
|
+
childrenProp: 'children',
|
|
103
|
+
selectedElements: [],
|
|
104
|
+
dataHeaders,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
const toggle = wrapper.findComponent({
|
|
108
|
+
name: 'wt-icon-btn',
|
|
109
|
+
});
|
|
110
|
+
expect(toggle.exists()).toBe(true);
|
|
111
|
+
expect(wrapper.findAll('tr').length).toBe(1);
|
|
112
|
+
|
|
113
|
+
await toggle.trigger('click');
|
|
114
|
+
|
|
115
|
+
expect(wrapper.findAll('tr').length).toBe(2);
|
|
116
|
+
expect(wrapper.findAll('tr')[1].text()).toContain('Charlie');
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('does not render a selection checkbox unless selectable', () => {
|
|
120
|
+
const wrapper = shallowMount(WtTreeTableRow, {
|
|
121
|
+
props: {
|
|
122
|
+
data: leafRow,
|
|
123
|
+
rowPosition: 0,
|
|
124
|
+
childrenProp: 'children',
|
|
125
|
+
selectedElements: [],
|
|
126
|
+
dataHeaders,
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
expect(
|
|
130
|
+
wrapper
|
|
131
|
+
.findComponent({
|
|
132
|
+
name: 'wt-checkbox',
|
|
133
|
+
})
|
|
134
|
+
.exists(),
|
|
135
|
+
).toBe(false);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('emits update:selected with the row data when the checkbox is toggled', async () => {
|
|
139
|
+
const wrapper = shallowMount(WtTreeTableRow, {
|
|
140
|
+
props: {
|
|
141
|
+
data: leafRow,
|
|
142
|
+
rowPosition: 0,
|
|
143
|
+
childrenProp: 'children',
|
|
144
|
+
selectedElements: [],
|
|
145
|
+
dataHeaders,
|
|
146
|
+
selectable: true,
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
await wrapper
|
|
150
|
+
.findComponent({
|
|
151
|
+
name: 'wt-checkbox',
|
|
152
|
+
})
|
|
153
|
+
.vm.$emit('update:selected', true);
|
|
154
|
+
|
|
155
|
+
expect(wrapper.emitted()['update:selected'][0]).toEqual([
|
|
156
|
+
{
|
|
157
|
+
data: leafRow,
|
|
158
|
+
select: true,
|
|
159
|
+
},
|
|
160
|
+
]);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it('does not render an actions cell when gridActions is false', () => {
|
|
164
|
+
const wrapper = shallowMount(WtTreeTableRow, {
|
|
165
|
+
props: {
|
|
166
|
+
data: leafRow,
|
|
167
|
+
rowPosition: 0,
|
|
168
|
+
childrenProp: 'children',
|
|
169
|
+
selectedElements: [],
|
|
170
|
+
dataHeaders,
|
|
171
|
+
gridActions: false,
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
expect(wrapper.find('.wt-tree-table-td__actions').exists()).toBe(false);
|
|
175
|
+
});
|
|
176
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import { ComponentSize } from '../../../enums';
|
|
4
|
+
import WtVidstackPlayer from '../wt-vidstack-player.vue';
|
|
5
|
+
|
|
6
|
+
describe('WtVidstackPlayer', () => {
|
|
7
|
+
it('renders a component', () => {
|
|
8
|
+
const wrapper = shallowMount(WtVidstackPlayer);
|
|
9
|
+
expect(wrapper.classes()).toContain('wt-vidstack-player');
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('defaults to the sm size class', () => {
|
|
13
|
+
const wrapper = shallowMount(WtVidstackPlayer);
|
|
14
|
+
expect(wrapper.classes()).toContain('wt-vidstack-player--sm');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('applies a custom size class', () => {
|
|
18
|
+
const wrapper = shallowMount(WtVidstackPlayer, {
|
|
19
|
+
props: {
|
|
20
|
+
size: ComponentSize.LG,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
expect(wrapper.classes()).toContain('wt-vidstack-player--lg');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('applies the video-object-fit modifier class', () => {
|
|
27
|
+
const wrapper = shallowMount(WtVidstackPlayer, {
|
|
28
|
+
props: {
|
|
29
|
+
videoObjectFit: 'cover',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
expect(wrapper.classes()).toContain(
|
|
33
|
+
'wt-vidstack-player-video-object-fit--cover',
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('applies stretch/static/hide-background/mirror modifier classes', () => {
|
|
38
|
+
const wrapper = shallowMount(WtVidstackPlayer, {
|
|
39
|
+
props: {
|
|
40
|
+
stretch: true,
|
|
41
|
+
static: true,
|
|
42
|
+
hideBackground: true,
|
|
43
|
+
mirrorVideo: true,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
expect(wrapper.classes()).toEqual(
|
|
47
|
+
expect.arrayContaining([
|
|
48
|
+
'wt-vidstack-player--stretch',
|
|
49
|
+
'wt-vidstack-player--static',
|
|
50
|
+
'wt-vidstack-player--hide-background',
|
|
51
|
+
'wt-vidstack-player--mirror-video',
|
|
52
|
+
]),
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('emits close when the layout requests close', async () => {
|
|
57
|
+
const wrapper = shallowMount(WtVidstackPlayer);
|
|
58
|
+
await wrapper
|
|
59
|
+
.findComponent({
|
|
60
|
+
name: 'VideoLayout',
|
|
61
|
+
})
|
|
62
|
+
.vm.$emit('close-player');
|
|
63
|
+
expect(wrapper.emitted().close).toBeTruthy();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('renders default content/controls-panel slots with the current size scope', () => {
|
|
67
|
+
const wrapper = mount(WtVidstackPlayer, {
|
|
68
|
+
props: {
|
|
69
|
+
size: ComponentSize.MD,
|
|
70
|
+
},
|
|
71
|
+
slots: {
|
|
72
|
+
content: `<template #content="{ size }"><div class="content-size">{{ size }}</div></template>`,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
expect(wrapper.find('.content-size').text()).toBe(ComponentSize.MD);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('exposes the root element ref', () => {
|
|
79
|
+
const wrapper = shallowMount(WtVidstackPlayer);
|
|
80
|
+
expect(wrapper.vm.rootEl).toBeInstanceOf(HTMLElement);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const IconAction =
|
|
1
|
+
export const IconAction = {
|
|
2
2
|
REFRESH: 'refresh',
|
|
3
3
|
ADD: 'add',
|
|
4
4
|
RESET_MEMBERS: 'reset-members',
|
|
@@ -26,6 +26,8 @@ const IconAction = Object.freeze({
|
|
|
26
26
|
CHAT: 'chat',
|
|
27
27
|
SORT: 'sort',
|
|
28
28
|
LOGOUT: 'logout',
|
|
29
|
-
}
|
|
29
|
+
} as const;
|
|
30
|
+
|
|
31
|
+
export type IconAction = (typeof IconAction)[keyof typeof IconAction];
|
|
30
32
|
|
|
31
33
|
export default IconAction;
|
package/src/enums/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ export { DefaultWorkspaceTabSettings } from './DefaultWorkspaceTabSettings/Defau
|
|
|
21
21
|
export { EmptyCause } from './EmptyCause/EmptyCause';
|
|
22
22
|
export { ExportFormat } from './ExportFormat/ExportFormat.enum';
|
|
23
23
|
export { FormatDateMode } from './FormatDateMode/FormatDateMode';
|
|
24
|
-
export {
|
|
24
|
+
export { IconAction } from './IconAction/IconAction';
|
|
25
25
|
export { IconColor } from './IconColor/IconColor';
|
|
26
26
|
export { LoginOptions } from './LoginOptions/LoginOptions';
|
|
27
27
|
export { MessageColor } from './MessageColor/MessageColor';
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
<script setup>
|
|
99
99
|
import { computed } from 'vue';
|
|
100
100
|
import { useI18n } from 'vue-i18n';
|
|
101
|
-
import IconAction from '../../../../enums
|
|
101
|
+
import { IconAction } from '../../../../enums';
|
|
102
102
|
import { useTableEmpty } from '../../../TableComponentModule/composables/useTableEmpty';
|
|
103
103
|
import { AccessMode, AccessRuleName } from '../../enums';
|
|
104
104
|
import { DEFAULT_PERMISSIONS_USER_ACCESS } from '../../types/PermissionsUserAccess';
|