@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.
- package/dist/{clients-BDtL1Ajm.js → clients-DPvJvOx5.js} +1 -1
- package/dist/{components-CK9vGYUg.js → components-GEKIa6Vp.js} +1141 -2406
- package/dist/{enums-CBWwTuq7.js → enums-BwgSueOO.js} +32 -28
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +73 -53
- package/dist/ui-sdk.umd.cjs +543 -541
- package/dist/{useValidation-B0voza7s.js → useValidation-Hdk6hzmc.js} +1 -1
- package/dist/{wt-action-bar-B17FBHD7.js → wt-action-bar-Dbt6CgEp.js} +2 -2
- package/dist/{wt-button-0kP5bPMs.js → wt-button-BDGLW4OG.js} +2 -2
- package/dist/{wt-chat-emoji-BiPhHNuw.js → wt-chat-emoji-CAn773-T.js} +4 -4
- package/dist/{wt-datepicker-baNcFWZ1.js → wt-datepicker-BjbWDS8B.js} +2 -2
- package/dist/{wt-display-chip-items-xm8cHws_.js → wt-display-chip-items-DAnyat0v.js} +1 -1
- package/dist/{wt-dual-panel-C5LZm1Tr.js → wt-dual-panel-C54Hwdwc.js} +1 -1
- package/dist/{wt-expansion-card-C2qETdn0.js → wt-expansion-card-CVPU9twV.js} +1 -1
- package/dist/{wt-expansion-panel-Dvzj9PTk.js → wt-expansion-panel-B1u06Hz8.js} +1 -1
- package/dist/{wt-icon-DIdpwmpC.js → wt-icon-Bd8GvqIt.js} +2 -1
- package/dist/{wt-icon-action-C8WN2oVD.js → wt-icon-action-mNjxBL1c.js} +1 -1
- package/dist/{wt-icon-btn-BLnhJADA.js → wt-icon-btn-BL4UZ7Fv.js} +1 -1
- package/dist/{wt-notifications-bar-Dx1YPqFu.js → wt-notifications-bar-Tg1pDfMR.js} +2 -2
- package/dist/{wt-player-CCwEyUzv.js → wt-player-B2-wweFq.js} +3 -3
- package/dist/{wt-search-bar-CiQJ9ViN.js → wt-search-bar-CPfD4657.js} +1 -1
- package/dist/{wt-send-message-popup-D07uZ7eL.js → wt-send-message-popup-Clb-abg5.js} +2 -2
- package/dist/wt-status-select-DCiMHd9K.js +77 -0
- package/dist/{wt-timepicker-DyM1OQX4.js → wt-timepicker-4bwYBaKQ.js} +2 -2
- package/dist/{wt-toast-KTAx-8zA.js → wt-toast-QzhZGeTp.js} +2 -2
- package/dist/{wt-tree-table-BlZEw4tr.js → wt-tree-table-DM_CRVQQ.js} +1 -1
- package/dist/{wt-type-extension-value-input-Tlnn-d1W.js → wt-type-extension-value-input-CP-xZ065.js} +3 -3
- package/dist/{wt-vidstack-player-Dvto6FG2.js → wt-vidstack-player-CuQ_SOHI.js} +4 -4
- package/package.json +1 -1
- package/src/api/clients/users/__tests__/users.spec.js +1 -0
- package/src/api/clients/users/users.js +26 -2
- package/src/assets/icons/sprite/index.ts +2 -0
- package/src/assets/icons/sprite/shield-check.svg +3 -0
- package/src/components/index.js +3 -3
- package/src/components/wt-card/_variables.css +4 -0
- package/src/components/wt-card/wt-card.vue +13 -0
- package/src/components/wt-indicator/_variables.css +7 -2
- package/src/components/wt-single-select/wt-single-select.vue +7 -0
- package/src/components/wt-status-select/__tests__/WtStatusSelect.spec.js +3 -3
- package/src/components/wt-status-select/_internals/StatusOptions.lookup.js +1 -1
- package/src/components/wt-status-select/wt-status-select.vue +80 -139
- package/src/css/components-variables.css +1 -1
- package/types/components/wt-card/wt-card.vue.d.ts +13 -0
- package/types/components/wt-single-select/wt-single-select.vue.d.ts +1 -0
- package/types/components/wt-status-select/wt-status-select.vue.d.ts +21 -1
- package/dist/AgentStatus.enum-C3IGHtvR.js +0 -9
- package/dist/wt-status-select-A5t6Vjm4.js +0 -101
- package/src/components/wt-select/__tests__/WtSelect.spec.js +0 -30
- package/src/components/wt-select/_variables.css +0 -12
- package/src/components/wt-select/mixins/__tests__/multiselectMixin.spec.js +0 -50
- package/src/components/wt-select/mixins/multiselectMixin.js +0 -279
- package/src/components/wt-select/multiselect.css +0 -239
- package/src/components/wt-select/wt-select.vue +0 -386
- package/src/components/wt-tags-input/mixin/taggableMixin.js +0 -43
- package/types/components/wt-select/__tests__/WtSelect.spec.d.ts +0 -1
- package/types/components/wt-select/mixins/__tests__/multiselectMixin.spec.d.ts +0 -1
- package/types/components/wt-select/mixins/multiselectMixin.d.ts +0 -129
- package/types/components/wt-select/wt-select.vue.d.ts +0 -229
- package/types/components/wt-tags-input/mixin/taggableMixin.d.ts +0 -7
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<wt-select
|
|
3
|
-
:
|
|
2
|
+
<wt-single-select
|
|
3
|
+
:show-clear="false"
|
|
4
4
|
:options="availableOptions"
|
|
5
|
-
:
|
|
6
|
-
:value="selectedOption"
|
|
5
|
+
:filterable="false"
|
|
6
|
+
:model-value="selectedOption"
|
|
7
7
|
class="wt-status-select"
|
|
8
|
-
|
|
8
|
+
data-key="value"
|
|
9
|
+
:size="ComponentSize.SM"
|
|
9
10
|
@closed="closedHandler"
|
|
10
|
-
@
|
|
11
|
+
@update:model-value="inputHandler"
|
|
11
12
|
>
|
|
12
|
-
<template #
|
|
13
|
+
<template #value="{ value }">
|
|
13
14
|
<wt-indicator
|
|
14
|
-
: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
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
54
|
+
const emit = defineEmits<{
|
|
55
|
+
change: [
|
|
56
|
+
value: string,
|
|
57
|
+
];
|
|
58
|
+
closed: [
|
|
59
|
+
event: Event,
|
|
60
|
+
];
|
|
61
|
+
}>();
|
|
135
62
|
|
|
136
|
-
|
|
137
|
-
min-height: 0;
|
|
138
|
-
}
|
|
63
|
+
const { t } = useI18n();
|
|
139
64
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
74
|
+
const selectedOption = computed<StatusOption | undefined>(() =>
|
|
75
|
+
statusOptions.value.find((option) => option.value === props.status),
|
|
76
|
+
);
|
|
151
77
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
165
|
-
|
|
105
|
+
function inputHandler(value: StatusOption) {
|
|
106
|
+
emit('change', value.value);
|
|
166
107
|
}
|
|
167
108
|
|
|
168
|
-
|
|
169
|
-
|
|
109
|
+
function closedHandler(event: Event) {
|
|
110
|
+
emit('closed', event);
|
|
170
111
|
}
|
|
171
|
-
</
|
|
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
|
+
};
|
|
@@ -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,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
|
-
});
|