@webitel/ui-sdk 24.12.48 → 24.12.51
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/CHANGELOG.md +13 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +9049 -9370
- package/dist/ui-sdk.umd.cjs +18 -22
- package/package.json +4 -4
- package/src/components/wt-badge/wt-badge.vue +51 -19
- package/src/components/wt-icon-action/iconMappings.js +14 -0
- package/src/components/wt-icon-action/wt-icon-action.vue +8 -4
- package/src/locale/en/en.js +17 -5
- package/src/locale/ru/ru.js +17 -5
- package/src/locale/ua/ua.js +17 -5
- package/src/components/wt-icon-action/IActionData.js +0 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "24.12.
|
|
3
|
+
"version": "24.12.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"plyr": "3.7.8",
|
|
130
130
|
"query-string": "^9.1.1",
|
|
131
131
|
"sortablejs": "^1.15.3",
|
|
132
|
-
"vue-i18n": "^
|
|
132
|
+
"vue-i18n": "^11.0.1",
|
|
133
133
|
"vue-multiselect": "^3.1.0",
|
|
134
134
|
"vue-observe-visibility": "^2.0.0-alpha.1",
|
|
135
135
|
"vue-router": "^4.4.5",
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"@rollup/rollup-linux-x64-gnu": "4.9.5"
|
|
181
181
|
},
|
|
182
182
|
"engines": {
|
|
183
|
-
"npm": "10
|
|
184
|
-
"node": "v22
|
|
183
|
+
"npm": "10",
|
|
184
|
+
"node": "v22"
|
|
185
185
|
}
|
|
186
186
|
}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
:class="{
|
|
4
|
-
|
|
2
|
+
<div
|
|
3
|
+
:class="{
|
|
4
|
+
'wt-badge--outside': outside,
|
|
5
|
+
'wt-badge--compat-mode': !hasSlot,
|
|
6
|
+
}"
|
|
5
7
|
class="wt-badge"
|
|
6
8
|
>
|
|
7
|
-
<
|
|
8
|
-
v-
|
|
9
|
-
:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
<span
|
|
10
|
+
v-show="!hidden"
|
|
11
|
+
:style="{ background: `var(--${colorVariable})` }"
|
|
12
|
+
class="wt-badge-indicator"
|
|
13
|
+
>
|
|
14
|
+
<img
|
|
15
|
+
v-if="iconBadgePic"
|
|
16
|
+
:alt="iconBadge"
|
|
17
|
+
:src="iconBadgePic"
|
|
18
|
+
class="wt-badge-indicator__pic"
|
|
19
|
+
/>
|
|
20
|
+
</span>
|
|
21
|
+
|
|
22
|
+
<slot />
|
|
23
|
+
</div>
|
|
14
24
|
</template>
|
|
15
25
|
|
|
16
26
|
<script>
|
|
@@ -34,6 +44,10 @@ export default {
|
|
|
34
44
|
iconBadge: {
|
|
35
45
|
type: String,
|
|
36
46
|
},
|
|
47
|
+
hidden: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
37
51
|
},
|
|
38
52
|
computed: {
|
|
39
53
|
iconBadgePic() {
|
|
@@ -48,6 +62,13 @@ export default {
|
|
|
48
62
|
return null;
|
|
49
63
|
}
|
|
50
64
|
},
|
|
65
|
+
/*
|
|
66
|
+
compatibility with old usage, when wt-badge was just placed in a wrapper,
|
|
67
|
+
being a sibling of the badged content, not wrapping badged content itself
|
|
68
|
+
*/
|
|
69
|
+
hasSlot() {
|
|
70
|
+
return !!this.$slots.default;
|
|
71
|
+
},
|
|
51
72
|
},
|
|
52
73
|
};
|
|
53
74
|
</script>
|
|
@@ -58,21 +79,32 @@ export default {
|
|
|
58
79
|
|
|
59
80
|
<style lang="scss" scoped>
|
|
60
81
|
.wt-badge {
|
|
61
|
-
position:
|
|
62
|
-
top: 0;
|
|
63
|
-
right: 0;
|
|
64
|
-
width: var(--wt-badge-size);
|
|
65
|
-
height: var(--wt-badge-size);
|
|
66
|
-
border-radius: 50%;
|
|
82
|
+
position: relative;
|
|
67
83
|
|
|
68
|
-
|
|
69
|
-
|
|
84
|
+
&:not(.wt-badge--compat-mode) {
|
|
85
|
+
width: fit-content;
|
|
86
|
+
height: fit-content;
|
|
70
87
|
}
|
|
71
88
|
|
|
72
|
-
|
|
89
|
+
.wt-badge-indicator {
|
|
73
90
|
position: absolute;
|
|
91
|
+
top: 0;
|
|
92
|
+
right: 0;
|
|
74
93
|
width: var(--wt-badge-size);
|
|
75
94
|
height: var(--wt-badge-size);
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
|
|
97
|
+
&__pic {
|
|
98
|
+
position: absolute;
|
|
99
|
+
width: var(--wt-badge-size);
|
|
100
|
+
height: var(--wt-badge-size);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&--outside {
|
|
105
|
+
.wt-badge-indicator {
|
|
106
|
+
transform: translate(100%, -100%);
|
|
107
|
+
}
|
|
76
108
|
}
|
|
77
109
|
}
|
|
78
110
|
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IconAction } from '../../enums/index.js';
|
|
2
|
+
|
|
3
|
+
export const WtIconActionIconMappings = Object.freeze({
|
|
4
|
+
[IconAction.ADD]: 'plus',
|
|
5
|
+
[IconAction.DELETE]: 'bucket',
|
|
6
|
+
[IconAction.DOWNLOAD]: 'download',
|
|
7
|
+
[IconAction.EDIT]: 'edit',
|
|
8
|
+
[IconAction.HISTORY]: 'history',
|
|
9
|
+
[IconAction.REFRESH]: 'refresh',
|
|
10
|
+
[IconAction.EXPAND]: 'expand',
|
|
11
|
+
[IconAction.COLLAPSE]: 'collapse',
|
|
12
|
+
[IconAction.FILTERS]: 'filter',
|
|
13
|
+
[IconAction.COLUMNS]: 'column-select',
|
|
14
|
+
});
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
<script setup>
|
|
15
15
|
import { computed } from 'vue';
|
|
16
16
|
import { useI18n } from 'vue-i18n';
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
import IconAction from '../../enums/IconAction/IconAction.enum.js';
|
|
19
|
+
import { WtIconActionIconMappings } from './iconMappings.js';
|
|
19
20
|
|
|
20
21
|
const props = defineProps({
|
|
21
22
|
/**
|
|
@@ -45,16 +46,19 @@ const emit = defineEmits(['click']);
|
|
|
45
46
|
const { t } = useI18n();
|
|
46
47
|
|
|
47
48
|
const iconAction = computed(() => {
|
|
48
|
-
const
|
|
49
|
+
const icon = WtIconActionIconMappings[props.action];
|
|
49
50
|
|
|
50
|
-
if (!
|
|
51
|
+
if (!icon) {
|
|
51
52
|
console.error(
|
|
52
53
|
`Unknown action for wt-icon-action component: ${props.action}`,
|
|
53
54
|
);
|
|
54
55
|
return { icon: 'edit', hint: props.action };
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
return
|
|
58
|
+
return {
|
|
59
|
+
icon,
|
|
60
|
+
hint: `webitelUI.iconAction.hints.${props.action}`,
|
|
61
|
+
};
|
|
58
62
|
});
|
|
59
63
|
</script>
|
|
60
64
|
|
package/src/locale/en/en.js
CHANGED
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
ChannelType,
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
|
+
|
|
8
9
|
import ChatGatewayProvider from '../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
|
|
10
|
+
import { IconAction } from '../../enums/index.js';
|
|
9
11
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
10
12
|
import AdminSections from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
11
13
|
import AuditorSections from '../../enums/WebitelApplications/AuditorSections.enum.js';
|
|
@@ -18,6 +20,9 @@ import { snakeToCamel } from '../../scripts/caseConverters.js';
|
|
|
18
20
|
export default {
|
|
19
21
|
// describes reusable buttons, actions, default titles, and other ui elements
|
|
20
22
|
reusable: {
|
|
23
|
+
download: 'Download',
|
|
24
|
+
history: 'History',
|
|
25
|
+
filter: ({ plural }) => plural(['Filter', 'Filters']),
|
|
21
26
|
total: 'Total',
|
|
22
27
|
ok: 'Ok',
|
|
23
28
|
save: 'Save',
|
|
@@ -349,11 +354,18 @@ export default {
|
|
|
349
354
|
breakOut: 'Break Out',
|
|
350
355
|
},
|
|
351
356
|
iconAction: {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
+
hints: {
|
|
358
|
+
[IconAction.DELETE]: ({ linked }) => linked('reusable.delete'),
|
|
359
|
+
[IconAction.EDIT]: ({ linked }) => linked('reusable.edit'),
|
|
360
|
+
[IconAction.ADD]: ({ linked }) => linked('reusable.add'),
|
|
361
|
+
[IconAction.HISTORY]: ({ linked }) => linked('reusable.history'),
|
|
362
|
+
[IconAction.DOWNLOAD]: ({ linked }) => linked('reusable.download'),
|
|
363
|
+
[IconAction.FILTERS]: ({ linked }) => linked('reusable.filter'),
|
|
364
|
+
[IconAction.COLUMNS]: 'Select columns',
|
|
365
|
+
[IconAction.REFRESH]: ({ linked }) => linked('reusable.refresh'),
|
|
366
|
+
[IconAction.EXPAND]: ({ linked }) => linked('reusable.expand'),
|
|
367
|
+
[IconAction.COLLAPSE]: ({ linked }) => linked('reusable.collapse'),
|
|
368
|
+
},
|
|
357
369
|
},
|
|
358
370
|
errorPages: {
|
|
359
371
|
goBack: 'Go back',
|
package/src/locale/ru/ru.js
CHANGED
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
ChannelType,
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
|
+
|
|
8
9
|
import ChatGatewayProvider from '../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
|
|
10
|
+
import { IconAction } from '../../enums/index.js';
|
|
9
11
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
10
12
|
import AdminSections from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
11
13
|
import AuditorSections from '../../enums/WebitelApplications/AuditorSections.enum.js';
|
|
@@ -18,6 +20,9 @@ import { snakeToCamel } from '../../scripts/caseConverters.js';
|
|
|
18
20
|
export default {
|
|
19
21
|
// describes reusable buttons, actions, default titles, and other ui elements
|
|
20
22
|
reusable: {
|
|
23
|
+
download: 'Скачать',
|
|
24
|
+
history: 'История',
|
|
25
|
+
filter: 'Фильтр | Фильтры',
|
|
21
26
|
total: 'Всего',
|
|
22
27
|
ok: 'Ок',
|
|
23
28
|
save: 'Сохранить',
|
|
@@ -347,11 +352,18 @@ export default {
|
|
|
347
352
|
breakOut: 'Принудительный перерыв',
|
|
348
353
|
},
|
|
349
354
|
iconAction: {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
+
hints: {
|
|
356
|
+
[IconAction.DELETE]: ({ linked }) => linked('reusable.delete'),
|
|
357
|
+
[IconAction.EDIT]: ({ linked }) => linked('reusable.edit'),
|
|
358
|
+
[IconAction.ADD]: ({ linked }) => linked('reusable.add'),
|
|
359
|
+
[IconAction.HISTORY]: ({ linked }) => linked('reusable.history'),
|
|
360
|
+
[IconAction.DOWNLOAD]: ({ linked }) => linked('reusable.download'),
|
|
361
|
+
[IconAction.FILTERS]: ({ linked }) => linked('reusable.filter', 2),
|
|
362
|
+
[IconAction.COLUMNS]: 'Добавить колонки',
|
|
363
|
+
[IconAction.REFRESH]: ({ linked }) => linked('reusable.refresh'),
|
|
364
|
+
[IconAction.EXPAND]: ({ linked }) => linked('reusable.expand'),
|
|
365
|
+
[IconAction.COLLAPSE]: ({ linked }) => linked('reusable.collapse'),
|
|
366
|
+
},
|
|
355
367
|
},
|
|
356
368
|
errorPages: {
|
|
357
369
|
goBack: 'Вернуться назад',
|
package/src/locale/ua/ua.js
CHANGED
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
ChannelType,
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
|
+
|
|
8
9
|
import ChatGatewayProvider from '../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
|
|
10
|
+
import { IconAction } from '../../enums/index.js';
|
|
9
11
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
10
12
|
import AdminSections from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
11
13
|
import AuditorSections from '../../enums/WebitelApplications/AuditorSections.enum.js';
|
|
@@ -18,6 +20,9 @@ import { snakeToCamel } from '../../scripts/caseConverters.js';
|
|
|
18
20
|
export default {
|
|
19
21
|
// describes reusable buttons, actions, default titles, and other ui elements
|
|
20
22
|
reusable: {
|
|
23
|
+
download: 'Завантажити',
|
|
24
|
+
history: 'Історія',
|
|
25
|
+
filter: 'Фільтр | Фільтри',
|
|
21
26
|
total: 'Всього',
|
|
22
27
|
ok: 'Ок',
|
|
23
28
|
save: 'Зберегти',
|
|
@@ -347,11 +352,18 @@ export default {
|
|
|
347
352
|
breakOut: 'Примусова перерва',
|
|
348
353
|
},
|
|
349
354
|
iconAction: {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
+
hints: {
|
|
356
|
+
[IconAction.DELETE]: ({ linked }) => linked('reusable.delete'),
|
|
357
|
+
[IconAction.EDIT]: ({ linked }) => linked('reusable.edit'),
|
|
358
|
+
[IconAction.ADD]: ({ linked }) => linked('reusable.add'),
|
|
359
|
+
[IconAction.HISTORY]: ({ linked }) => linked('reusable.history'),
|
|
360
|
+
[IconAction.DOWNLOAD]: ({ linked }) => linked('reusable.download'),
|
|
361
|
+
[IconAction.FILTERS]: ({ linked }) => linked('reusable.filter', 2),
|
|
362
|
+
[IconAction.COLUMNS]: 'Додати колонки',
|
|
363
|
+
[IconAction.REFRESH]: ({ linked }) => linked('reusable.refresh'),
|
|
364
|
+
[IconAction.EXPAND]: ({ linked }) => linked('reusable.expand'),
|
|
365
|
+
[IconAction.COLLAPSE]: ({ linked }) => linked('reusable.collapse'),
|
|
366
|
+
},
|
|
355
367
|
},
|
|
356
368
|
errorPages: {
|
|
357
369
|
goBack: 'Повернутись назад',
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import IconAction from '../../enums/IconAction/IconAction.enum.js';
|
|
2
|
-
|
|
3
|
-
const IActionData = Object.freeze({
|
|
4
|
-
[IconAction.ADD]: {
|
|
5
|
-
value: IconAction.ADD,
|
|
6
|
-
icon: 'plus',
|
|
7
|
-
hint: 'webitelUI.iconAction.addActionHint',
|
|
8
|
-
},
|
|
9
|
-
[IconAction.DELETE]: {
|
|
10
|
-
value: IconAction.DELETE,
|
|
11
|
-
icon: 'bucket',
|
|
12
|
-
hint: 'webitelUI.iconAction.deleteActionHint',
|
|
13
|
-
},
|
|
14
|
-
[IconAction.DOWNLOAD]: {
|
|
15
|
-
value: IconAction.DOWNLOAD,
|
|
16
|
-
icon: 'download',
|
|
17
|
-
hint: 'webitelUI.iconAction.downloadActionHint',
|
|
18
|
-
},
|
|
19
|
-
[IconAction.EDIT]: {
|
|
20
|
-
value: IconAction.EDIT,
|
|
21
|
-
icon: 'edit',
|
|
22
|
-
hint: 'webitelUI.iconAction.editActionHint',
|
|
23
|
-
},
|
|
24
|
-
[IconAction.HISTORY]: {
|
|
25
|
-
value: IconAction.HISTORY,
|
|
26
|
-
icon: 'history',
|
|
27
|
-
hint: 'webitelUI.iconAction.historyActionHint',
|
|
28
|
-
},
|
|
29
|
-
[IconAction.REFRESH]: {
|
|
30
|
-
value: IconAction.REFRESH,
|
|
31
|
-
icon: 'refresh',
|
|
32
|
-
hint: 'reusable.refresh',
|
|
33
|
-
},
|
|
34
|
-
[IconAction.EXPAND]: {
|
|
35
|
-
value: IconAction.EXPAND,
|
|
36
|
-
icon: 'expand',
|
|
37
|
-
hint: 'reusable.expand',
|
|
38
|
-
},
|
|
39
|
-
[IconAction.COLLAPSE]: {
|
|
40
|
-
value: IconAction.COLLAPSE,
|
|
41
|
-
icon: 'collapse',
|
|
42
|
-
hint: 'reusable.collapse',
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export { IActionData };
|