@webitel/ui-sdk 24.12.50 → 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 +6 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +164 -143
- package/dist/ui-sdk.umd.cjs +1 -1
- package/package.json +1 -1
- package/src/components/wt-badge/wt-badge.vue +51 -19
package/package.json
CHANGED
|
@@ -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>
|