@eturnity/eturnity_reusable_components 8.4.0 → 8.4.2
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/package.json
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12.75C5.5 13.4404 6.17157 14 7 14C7.82843 14 8.5 13.4404 8.5 12.75H5.5Z" fill="white"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 1.25C8 0.559644 7.55228 -3.91405e-08 7 -8.74228e-08C6.44772 -1.35705e-07 6 0.559644 6 1.25L8 1.25Z" fill="white"/>
|
|
4
|
+
<path d="M7 1C4.79086 1 3 2.64162 3 4.66667V6.55904C3 8.11545 2.54599 9.63806 1.69361 10.9403L1 12H13L12.3064 10.9403C11.454 9.63806 11 8.11545 11 6.55904V4.66667C11 2.64162 9.20914 1 7 1Z" fill="white"/>
|
|
5
|
+
</svg>
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
:color="color"
|
|
20
20
|
data-test-id="icon_striked_line"
|
|
21
21
|
/>
|
|
22
|
+
<CountWrapper v-if="count > 0" data-test-id="icon_count">
|
|
23
|
+
{{ counter }}
|
|
24
|
+
</CountWrapper>
|
|
22
25
|
</Wrapper>
|
|
23
26
|
</template>
|
|
24
27
|
|
|
@@ -34,7 +37,7 @@
|
|
|
34
37
|
// isStriked = "true"
|
|
35
38
|
// />
|
|
36
39
|
|
|
37
|
-
import { onMounted, reactive, watch } from 'vue'
|
|
40
|
+
import { computed, onMounted, reactive, watch } from 'vue'
|
|
38
41
|
import styled from 'vue3-styled-components'
|
|
39
42
|
import { fetchIcon } from './iconCache.mjs'
|
|
40
43
|
|
|
@@ -69,6 +72,10 @@
|
|
|
69
72
|
required: false,
|
|
70
73
|
default: null,
|
|
71
74
|
},
|
|
75
|
+
count: {
|
|
76
|
+
required: false,
|
|
77
|
+
default: 0,
|
|
78
|
+
},
|
|
72
79
|
animation: {
|
|
73
80
|
required: false,
|
|
74
81
|
default: 'none',
|
|
@@ -92,6 +99,21 @@
|
|
|
92
99
|
line-height: 0;
|
|
93
100
|
`
|
|
94
101
|
|
|
102
|
+
const CountWrapper = styled('div')`
|
|
103
|
+
position: absolute;
|
|
104
|
+
top: -7px;
|
|
105
|
+
right: -7px;
|
|
106
|
+
background-color: ${({ theme }) => theme.colors.red};
|
|
107
|
+
color: ${({ theme }) => theme.colors.white};
|
|
108
|
+
border-radius: 4px;
|
|
109
|
+
width: 15px;
|
|
110
|
+
height: 15px;
|
|
111
|
+
display: flex;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
align-items: center;
|
|
114
|
+
font-size: 10px;
|
|
115
|
+
`
|
|
116
|
+
|
|
95
117
|
const StrikedLine = styled('div', { color: String })`
|
|
96
118
|
display: flex;
|
|
97
119
|
position: absolute;
|
|
@@ -145,6 +167,10 @@
|
|
|
145
167
|
icon.html = await fetchIcon(props.name.toLowerCase())
|
|
146
168
|
}
|
|
147
169
|
|
|
170
|
+
const counter = computed(() =>
|
|
171
|
+
props.count > 9 ? '9+' : props.count.toString()
|
|
172
|
+
)
|
|
173
|
+
|
|
148
174
|
onMounted(() => loadSvg())
|
|
149
175
|
|
|
150
176
|
watch(() => props.name, loadSvg)
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
:is-disabled="disabled"
|
|
48
48
|
:is-error="hasError"
|
|
49
49
|
:min-width="minWidth"
|
|
50
|
+
:name="inputName"
|
|
50
51
|
:no-border="noBorder"
|
|
51
52
|
:placeholder="placeholder"
|
|
52
53
|
:type="inputTypeData"
|
|
@@ -392,6 +393,11 @@
|
|
|
392
393
|
default: 'off',
|
|
393
394
|
type: String,
|
|
394
395
|
},
|
|
396
|
+
inputName: {
|
|
397
|
+
required: false,
|
|
398
|
+
default: '',
|
|
399
|
+
type: String,
|
|
400
|
+
},
|
|
395
401
|
},
|
|
396
402
|
data() {
|
|
397
403
|
return {
|