@eturnity/eturnity_reusable_components 7.51.3 → 7.51.4
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 +2 -3
- package/src/assets/gifs/spinner.gif +0 -0
- package/src/assets/svgIcons/checkmark.svg +3 -0
- package/src/assets/svgIcons/collapse_all.svg +4 -0
- package/src/assets/svgIcons/expand_all.svg +4 -0
- package/src/assets/svgIcons/export_document.svg +3 -0
- package/src/assets/svgIcons/hybrid.svg +4 -0
- package/src/assets/svgIcons/module.svg +3 -0
- package/src/assets/svgIcons/move_down.svg +3 -0
- package/src/assets/svgIcons/move_up.svg +3 -0
- package/src/assets/svgIcons/optimizer.svg +6 -0
- package/src/assets/svgIcons/string_design.svg +5 -0
- package/src/assets/svgIcons/string_directions.svg +10 -0
- package/src/components/banner/notificationBanner/index.vue +131 -0
- package/src/components/buttons/buttonIcon/index.vue +4 -2
- package/src/components/buttons/mainButton/index.vue +16 -2
- package/src/components/icon/index.vue +1 -0
- package/src/components/infoText/index.vue +38 -11
- package/src/components/inputs/checkbox/index.vue +19 -8
- package/src/components/inputs/inputNumber/index.vue +203 -13
- package/src/components/inputs/inputText/index.vue +23 -2
- package/src/components/inputs/radioButton/index.vue +27 -6
- package/src/components/inputs/select/index.vue +69 -25
- package/src/components/inputs/select/option/index.vue +11 -2
- package/src/components/markerItem/index.vue +8 -1
- package/src/components/spinner/index.vue +11 -0
- package/src/components/spinnerGif/index.vue +98 -0
- package/src/components/stringDesign/DropdownMenu/index.vue +981 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eturnity/eturnity_reusable_components",
|
3
|
-
"version": "7.51.
|
3
|
+
"version": "7.51.4",
|
4
4
|
"files": [
|
5
5
|
"dist",
|
6
6
|
"src"
|
@@ -16,8 +16,7 @@
|
|
16
16
|
"build-storybook": "storybook build",
|
17
17
|
"prettier": "prettier --write 'src/**/*.{js,vue}'",
|
18
18
|
"test": "jest",
|
19
|
-
"test-coverage": "jest --coverage"
|
20
|
-
"prepublishOnly": "npm run test"
|
19
|
+
"test-coverage": "jest --coverage"
|
21
20
|
},
|
22
21
|
"dependencies": {
|
23
22
|
"@originjs/vite-plugin-commonjs": "1.0.3",
|
Binary file
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M17.0686 17.0686C20.9771 13.1601 20.9771 6.83992 17.0686 2.93139C13.1601 -0.977131 6.83992 -0.977131 2.93139 2.93139C-0.977131 6.83992 -0.977131 13.1601 2.93139 17.0686C6.83992 20.9771 13.1601 20.9771 17.0686 17.0686ZM6.42412 8.50312L8.66944 10.7484L13.5759 5.842L15.3222 7.58836L10.4158 12.4948L8.66944 14.158L6.92308 12.4948L4.67775 10.2495L6.42412 8.50312Z" fill="white"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,4 @@
|
|
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="M6.99998 1.20459L11.3818 4.49095L10.6182 5.50914L6.99998 2.7955L3.3818 5.50914L2.61816 4.49095L6.99998 1.20459Z" fill="#263238"/>
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.99998 12.7954L11.3818 9.50905L10.6182 8.49086L6.99998 11.2045L3.3818 8.49086L2.61816 9.50905L6.99998 12.7954Z" fill="#263238"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M0.75 0H8.33405L11.7467 3.41264V6.7202H10.5248V4.88741H6.85927V1.22185H1.97185V12.2185H5.63741V13.4404H0.75V0ZM8.08112 1.47478V3.66556H10.2719L8.08112 1.47478ZM10.5554 7.99581L13.5233 10.9979L10.5554 14L9.68664 13.141L11.2017 11.6088H6.85805V10.387H11.2017L9.68664 8.85477L10.5554 7.99581Z" fill="#0D0D0D"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,4 @@
|
|
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="M4.22998 11.8962H10.5006H12.2505V10.1463V8.97906H14.0004V5.47917H12.2505V4.31283V2.56289V2.55151H10.5006V2.56289H8.58218L7.76617 4.31283H10.5006V10.1463H5.04599L4.22998 11.8962Z" fill="white"/>
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.2622 4.79738C6.91629 4.63687 6.53076 4.54729 6.12431 4.54729C4.63054 4.54729 3.41919 5.75796 3.41919 7.25241C3.41919 8.33588 4.05591 9.26984 4.97534 9.70158L7.2622 4.79738ZM5.44786 3.11681C5.44786 3.49042 5.7507 3.79326 6.12431 3.79326C6.49793 3.79326 6.80077 3.49042 6.80077 3.11681V1.76459C6.80077 1.39097 6.49793 1.08813 6.12431 1.08813C5.7507 1.08813 5.44786 1.39097 5.44786 1.76459V3.11681ZM2.02818 7.88939H0.675962C0.302349 7.88939 -0.000488281 7.58655 -0.000488281 7.21294C-0.000488281 6.83932 0.302349 6.53649 0.675962 6.53649H2.02818C2.4018 6.53649 2.70463 6.83932 2.70463 7.21294C2.70463 7.58655 2.4018 7.88939 2.02818 7.88939ZM3.7057 10.5877L2.74955 11.5439C2.4855 11.8079 2.05745 11.8079 1.7934 11.5439C1.52935 11.2798 1.52935 10.8518 1.7934 10.5877L2.74955 9.63155C3.0136 9.36751 3.44165 9.36751 3.7057 9.63155C3.96975 9.8956 3.96975 10.3237 3.7057 10.5877ZM2.74955 4.79432L1.7934 3.83817C1.52935 3.57412 1.52935 3.14607 1.7934 2.88202C2.05745 2.61797 2.4855 2.61797 2.74955 2.88202L3.7057 3.83817C3.96975 4.10222 3.96975 4.53027 3.7057 4.79432C3.44165 5.05837 3.0136 5.05837 2.74955 4.79432Z" fill="white"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
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="M11.0722 3.6H1.6V10.4H11.0722L7.87332 7.60217L7.18484 7L7.87332 6.39783L11.0722 3.6ZM12.4 9.43572V4.56428L9.61516 7L12.4 9.43572ZM0 2H1.6H12.4H14V3.6V10.4V12H12.4H1.6H0V10.4V3.6V2Z" fill="white"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<rect x="3.11079" y="3.10981" width="7.77778" height="7.77778" stroke="white" stroke-width="1.55556"/>
|
3
|
+
<line x1="3.72749" y1="10.3387" x2="10.7275" y2="3.3387" stroke="white" stroke-width="1.55556"/>
|
4
|
+
<line x1="-0.000366211" y1="7.05425" x2="2.99963" y2="7.05425" stroke="white" stroke-width="1.55556"/>
|
5
|
+
<line x1="10.9994" y1="6.99957" x2="13.9994" y2="6.99957" stroke="white" stroke-width="1.55556"/>
|
6
|
+
</svg>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<svg width="10" height="11" viewBox="0 0 10 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M2.85714 1.92857C2.85714 2.71755 2.21755 3.35714 1.42857 3.35714C0.639593 3.35714 0 2.71755 0 1.92857C0 1.13959 0.639593 0.5 1.42857 0.5C2.21755 0.5 2.85714 1.13959 2.85714 1.92857Z" fill="white"/>
|
3
|
+
<path d="M10 9.07143C10 9.86041 9.36041 10.5 8.57143 10.5C7.78245 10.5 7.14286 9.86041 7.14286 9.07143C7.14286 8.28245 7.78245 7.64286 8.57143 7.64286C9.36041 7.64286 10 8.28245 10 9.07143Z" fill="white"/>
|
4
|
+
<path d="M5.71429 3C5.71429 2.40827 6.19398 1.92857 6.78571 1.92857C7.37745 1.92857 7.85714 2.40827 7.85714 3V6.21429H9.28571V3C9.28571 1.61929 8.16643 0.5 6.78571 0.5C5.405 0.5 4.28571 1.61929 4.28571 3V8C4.28571 8.59173 3.80602 9.07143 3.21429 9.07143C2.62255 9.07143 2.14286 8.59173 2.14286 8V4.78571H0.714286V8C0.714286 9.38071 1.83357 10.5 3.21429 10.5C4.595 10.5 5.71429 9.38071 5.71429 8V3Z" fill="white"/>
|
5
|
+
</svg>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<svg width="30" height="30" viewBox="8 8 14 14" fill="#263238" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<g clip-path="url(#clip0_908_47480)" fill="#263238">
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.5 19.75V8.5H9.5V19.75C9.5 20.1642 9.83579 20.5 10.25 20.5C10.6642 20.5 11 20.1642 11 19.75V10.25C11 9.2835 11.7835 8.5 12.75 8.5C13.7165 8.5 14.5 9.2835 14.5 10.25V21.5H13.5V10.25C13.5 9.83579 13.1642 9.5 12.75 9.5C12.3358 9.5 12 9.83579 12 10.25V19.75C12 20.7165 11.2165 21.5 10.25 21.5C9.2835 21.5 8.5 20.7165 8.5 19.75ZM20 9.5H15.5V8.5H20C20.8284 8.5 21.5 9.17157 21.5 10C21.5 10.8284 20.8284 11.5 20 11.5H17C16.7239 11.5 16.5 11.7239 16.5 12C16.5 12.2761 16.7239 12.5 17 12.5H20C20.8284 12.5 21.5 13.1716 21.5 14C21.5 14.8284 20.8284 15.5 20 15.5H17C16.7239 15.5 16.5 15.7239 16.5 16C16.5 16.2761 16.7239 16.5 17 16.5H20C20.8284 16.5 21.5 17.1716 21.5 18C21.5 18.8284 20.8284 19.5 20 19.5H17C16.7239 19.5 16.5 19.7239 16.5 20C16.5 20.2761 16.7239 20.5 17 20.5H21.5V21.5H17C16.1716 21.5 15.5 20.8284 15.5 20C15.5 19.1716 16.1716 18.5 17 18.5H20C20.2761 18.5 20.5 18.2761 20.5 18C20.5 17.7239 20.2761 17.5 20 17.5H17C16.1716 17.5 15.5 16.8284 15.5 16C15.5 15.1716 16.1716 14.5 17 14.5H20C20.2761 14.5 20.5 14.2761 20.5 14C20.5 13.7239 20.2761 13.5 20 13.5H17C16.1716 13.5 15.5 12.8284 15.5 12C15.5 11.1716 16.1716 10.5 17 10.5H20C20.2761 10.5 20.5 10.2761 20.5 10C20.5 9.72386 20.2761 9.5 20 9.5Z" fill="white"/>
|
4
|
+
</g>
|
5
|
+
<defs>
|
6
|
+
<clipPath id="clip0_908_47480">
|
7
|
+
<rect width="14" height="14" fill="white" transform="translate(8 8)"/>
|
8
|
+
</clipPath>
|
9
|
+
</defs>
|
10
|
+
</svg>
|
@@ -0,0 +1,131 @@
|
|
1
|
+
<template>
|
2
|
+
<PageContainer v-if="showBanner">
|
3
|
+
<BannerContainer
|
4
|
+
:background-color="backgroundColor"
|
5
|
+
:text-color="textColor"
|
6
|
+
>
|
7
|
+
<IconContainer>
|
8
|
+
<RCIcon color="white" :name="iconName" size="20px" />
|
9
|
+
</IconContainer>
|
10
|
+
<TextContainer>
|
11
|
+
<TextContent>
|
12
|
+
{{ mainText }}
|
13
|
+
</TextContent>
|
14
|
+
</TextContainer>
|
15
|
+
<ButtonContainer>
|
16
|
+
<MainButton
|
17
|
+
:custom-color="theme.colors.white"
|
18
|
+
:font-color="theme.colors.black"
|
19
|
+
:text="buttonText"
|
20
|
+
@click="$emit('on-button-click')"
|
21
|
+
/>
|
22
|
+
</ButtonContainer>
|
23
|
+
</BannerContainer>
|
24
|
+
</PageContainer>
|
25
|
+
</template>
|
26
|
+
|
27
|
+
<script>
|
28
|
+
// import NotificationBanner from "@eturnity/eturnity_reusable_components/src/components/banner/notificationBanner"
|
29
|
+
import styled from 'vue3-styled-components'
|
30
|
+
import RCIcon from '../../icon'
|
31
|
+
import MainButton from '../../buttons/mainButton'
|
32
|
+
import theme from '@/assets/theme'
|
33
|
+
|
34
|
+
const PageContainer = styled.div`
|
35
|
+
position: fixed;
|
36
|
+
bottom: 24px;
|
37
|
+
left: 50%;
|
38
|
+
transform: translateX(-50%);
|
39
|
+
z-index: 999999;
|
40
|
+
`
|
41
|
+
|
42
|
+
const bannerAttrs = { backgroundColor: String, textColor: String }
|
43
|
+
const BannerContainer = styled('div', bannerAttrs)`
|
44
|
+
display: grid;
|
45
|
+
grid-template-columns: auto 1fr auto;
|
46
|
+
gap: 20px;
|
47
|
+
padding: 10px 20px;
|
48
|
+
border-radius: 4px;
|
49
|
+
align-items: center;
|
50
|
+
justify-content: center;
|
51
|
+
background-color: ${(props) => props.theme.colors[props.backgroundColor]};
|
52
|
+
color: ${(props) => props.theme.colors[props.textColor]};
|
53
|
+
font-size: 14px;
|
54
|
+
`
|
55
|
+
|
56
|
+
const IconContainer = styled.div``
|
57
|
+
|
58
|
+
const TextContainer = styled.div``
|
59
|
+
|
60
|
+
const TextContent = styled.div`
|
61
|
+
line-height: 150%;
|
62
|
+
`
|
63
|
+
|
64
|
+
const ButtonContainer = styled.div`
|
65
|
+
display: flex;
|
66
|
+
gap: 20px;
|
67
|
+
align-items: center;
|
68
|
+
justify-content: center;
|
69
|
+
`
|
70
|
+
|
71
|
+
export default {
|
72
|
+
name: 'NotificationBanner',
|
73
|
+
components: {
|
74
|
+
PageContainer,
|
75
|
+
BannerContainer,
|
76
|
+
RCIcon,
|
77
|
+
IconContainer,
|
78
|
+
TextContainer,
|
79
|
+
TextContent,
|
80
|
+
ButtonContainer,
|
81
|
+
MainButton,
|
82
|
+
},
|
83
|
+
props: {
|
84
|
+
backgroundColor: {
|
85
|
+
type: String,
|
86
|
+
default: 'green',
|
87
|
+
required: false,
|
88
|
+
},
|
89
|
+
textColor: {
|
90
|
+
type: String,
|
91
|
+
default: 'white',
|
92
|
+
required: false,
|
93
|
+
},
|
94
|
+
iconName: {
|
95
|
+
type: String,
|
96
|
+
default: 'checkmark',
|
97
|
+
required: false,
|
98
|
+
},
|
99
|
+
mainText: {
|
100
|
+
type: String,
|
101
|
+
required: true,
|
102
|
+
},
|
103
|
+
buttonText: {
|
104
|
+
type: String,
|
105
|
+
required: true,
|
106
|
+
},
|
107
|
+
isOpen: {
|
108
|
+
type: Boolean,
|
109
|
+
default: false,
|
110
|
+
required: true,
|
111
|
+
},
|
112
|
+
},
|
113
|
+
data() {
|
114
|
+
return {
|
115
|
+
theme,
|
116
|
+
showBanner: false,
|
117
|
+
}
|
118
|
+
},
|
119
|
+
watch: {
|
120
|
+
isOpen(newVal) {
|
121
|
+
if (newVal) {
|
122
|
+
this.showBanner = true
|
123
|
+
setTimeout(() => {
|
124
|
+
this.showBanner = false
|
125
|
+
this.$emit('on-close')
|
126
|
+
}, 10000)
|
127
|
+
}
|
128
|
+
},
|
129
|
+
},
|
130
|
+
}
|
131
|
+
</script>
|
@@ -52,7 +52,9 @@
|
|
52
52
|
props.isDisabled
|
53
53
|
? props.theme.colors.disabled
|
54
54
|
: props.customColor
|
55
|
-
? props.customColor
|
55
|
+
? props.theme.colors[props.customColor]
|
56
|
+
? props.theme.colors[props.customColor]
|
57
|
+
: props.customColor
|
56
58
|
: props.theme.colors.yellow};
|
57
59
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
58
60
|
user-select: none;
|
@@ -81,7 +83,7 @@
|
|
81
83
|
display: flex;
|
82
84
|
align-items: center;
|
83
85
|
justify-content: center;
|
84
|
-
padding: 0
|
86
|
+
padding: 0 14px;
|
85
87
|
`
|
86
88
|
|
87
89
|
const IconContainerAttrs = {
|
@@ -5,6 +5,7 @@
|
|
5
5
|
:custom-color="customColor"
|
6
6
|
:data-id="dataId"
|
7
7
|
:font-color="fontColor"
|
8
|
+
:height="height"
|
8
9
|
:is-disabled="isDisabled"
|
9
10
|
:min-width="minWidth"
|
10
11
|
:no-wrap="noWrap"
|
@@ -43,12 +44,19 @@
|
|
43
44
|
customColor: String,
|
44
45
|
fontColor: String,
|
45
46
|
noWrap: Boolean,
|
47
|
+
height: String,
|
46
48
|
}
|
47
49
|
const ButtonContainer = styled('div', ButtonAttrs)`
|
50
|
+
display: flex;
|
51
|
+
justify-content: center;
|
48
52
|
padding: 7px 15px;
|
49
|
-
font-size:
|
53
|
+
font-size: 14px;
|
50
54
|
color: ${(props) =>
|
51
|
-
props.
|
55
|
+
props.isDisabled
|
56
|
+
? props.theme.colors.white
|
57
|
+
: props.fontColor
|
58
|
+
? props.fontColor
|
59
|
+
: props.theme.colors.white};
|
52
60
|
background-color: ${(props) =>
|
53
61
|
props.isDisabled
|
54
62
|
? props.theme.colors.disabled
|
@@ -67,6 +75,7 @@
|
|
67
75
|
user-select: none;
|
68
76
|
${(props) => (props.minWidth ? `min-width: ${props.minWidth};` : '')};
|
69
77
|
${(props) => (props.noWrap ? `white-space: nowrap;` : '')};
|
78
|
+
height: ${(props) => props.height};
|
70
79
|
|
71
80
|
&:hover {
|
72
81
|
opacity: ${(props) => (props.isDisabled ? '1' : '0.8')};
|
@@ -141,6 +150,11 @@
|
|
141
150
|
default: null,
|
142
151
|
type: String,
|
143
152
|
},
|
153
|
+
height: {
|
154
|
+
required: false,
|
155
|
+
default: 'auto',
|
156
|
+
type: String,
|
157
|
+
},
|
144
158
|
id: {
|
145
159
|
required: false,
|
146
160
|
default: null,
|
@@ -2,14 +2,16 @@
|
|
2
2
|
<PageContainer ref="container">
|
3
3
|
<div
|
4
4
|
ref="icon"
|
5
|
-
|
6
|
-
@
|
7
|
-
@
|
5
|
+
data-test-id="infoText_trigger"
|
6
|
+
@click=";(isMobile || openTrigger === 'onClick') && toggleInfo()"
|
7
|
+
@mouseenter="!isMobile && openTrigger === 'onHover' && showInfo()"
|
8
|
+
@mouseleave="!isMobile && openTrigger === 'onHover' && hideInfo()"
|
8
9
|
>
|
9
10
|
<IconComponent
|
10
|
-
:color="iconColor"
|
11
|
-
cursor="pointer"
|
12
|
-
|
11
|
+
:color="iconColor || computedIconColor"
|
12
|
+
:cursor="isDisabled ? 'not-allowed' : 'pointer'"
|
13
|
+
:disabled="isDisabled"
|
14
|
+
:name="iconName"
|
13
15
|
:size="size"
|
14
16
|
/>
|
15
17
|
</div>
|
@@ -111,8 +113,9 @@
|
|
111
113
|
},
|
112
114
|
props: {
|
113
115
|
text: {
|
114
|
-
|
116
|
+
required: false,
|
115
117
|
default: '',
|
118
|
+
type: String,
|
116
119
|
},
|
117
120
|
size: {
|
118
121
|
type: String,
|
@@ -142,6 +145,20 @@
|
|
142
145
|
type: String,
|
143
146
|
default: '',
|
144
147
|
},
|
148
|
+
iconName: {
|
149
|
+
type: String,
|
150
|
+
default: 'info',
|
151
|
+
},
|
152
|
+
iconColor: {
|
153
|
+
type: String,
|
154
|
+
default: null,
|
155
|
+
required: false,
|
156
|
+
},
|
157
|
+
isDisabled: {
|
158
|
+
type: Boolean,
|
159
|
+
default: false,
|
160
|
+
required: false,
|
161
|
+
},
|
145
162
|
},
|
146
163
|
setup(props) {
|
147
164
|
const isVisible = ref(false)
|
@@ -155,6 +172,7 @@
|
|
155
172
|
const boxStyle = ref({})
|
156
173
|
const arrowStyle = ref({})
|
157
174
|
const wrapperStyle = ref({})
|
175
|
+
const isMobile = ref(window.innerWidth <= 768)
|
158
176
|
|
159
177
|
const textStyle = computed(() => ({
|
160
178
|
fontSize: props.image ? '12px' : '13px',
|
@@ -287,7 +305,10 @@
|
|
287
305
|
}
|
288
306
|
|
289
307
|
const handleClickOutside = (event) => {
|
290
|
-
if (
|
308
|
+
if (
|
309
|
+
(props.openTrigger === 'onClick' || isMobile.value) &&
|
310
|
+
isVisible.value
|
311
|
+
) {
|
291
312
|
const clickedElement = event.target
|
292
313
|
if (
|
293
314
|
infoBox.value &&
|
@@ -299,9 +320,14 @@
|
|
299
320
|
}
|
300
321
|
}
|
301
322
|
|
323
|
+
const handleResize = () => {
|
324
|
+
isMobile.value = window.innerWidth <= 768
|
325
|
+
updatePosition()
|
326
|
+
}
|
327
|
+
|
302
328
|
onMounted(() => {
|
303
329
|
window.addEventListener('scroll', handleScroll, { passive: true })
|
304
|
-
window.addEventListener('resize',
|
330
|
+
window.addEventListener('resize', handleResize)
|
305
331
|
document.addEventListener('scroll', handleScroll, {
|
306
332
|
passive: true,
|
307
333
|
capture: true,
|
@@ -311,7 +337,7 @@
|
|
311
337
|
|
312
338
|
onUnmounted(() => {
|
313
339
|
window.removeEventListener('scroll', handleScroll)
|
314
|
-
window.removeEventListener('resize',
|
340
|
+
window.removeEventListener('resize', handleResize)
|
315
341
|
document.removeEventListener('scroll', handleScroll, { capture: true })
|
316
342
|
document.removeEventListener('click', handleClickOutside)
|
317
343
|
})
|
@@ -339,10 +365,11 @@
|
|
339
365
|
wrapperStyle,
|
340
366
|
textStyle,
|
341
367
|
onImageLoad,
|
368
|
+
isMobile,
|
342
369
|
}
|
343
370
|
},
|
344
371
|
computed: {
|
345
|
-
|
372
|
+
computedIconColor() {
|
346
373
|
return this.buttonType === 'error'
|
347
374
|
? theme.colors.red
|
348
375
|
: theme.colors.mediumGray
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<CheckWrapper :has-label="hasLabel">
|
20
20
|
<span class="checkmark"></span>
|
21
21
|
</CheckWrapper>
|
22
|
-
<LabelText v-if="hasLabel">
|
22
|
+
<LabelText v-if="hasLabel" :is-disabled="isDisabled">
|
23
23
|
{{ label }}
|
24
24
|
</LabelText>
|
25
25
|
</Container>
|
@@ -90,18 +90,20 @@
|
|
90
90
|
? '16px'
|
91
91
|
: '25px'};
|
92
92
|
background-color: ${(props) =>
|
93
|
-
props.
|
93
|
+
props.isDisabled
|
94
|
+
? props.theme.colors.lightGray
|
95
|
+
: props.isChecked
|
94
96
|
? props.backgroundColor
|
95
97
|
? props.backgroundColor
|
96
98
|
: props.theme.colors.green
|
97
|
-
: props.isDisabled
|
98
|
-
? props.theme.colors.lightGray
|
99
99
|
: props.theme.colors.white};
|
100
100
|
border-radius: 4px;
|
101
101
|
border: 1px solid
|
102
102
|
${(props) =>
|
103
103
|
props.isChecked
|
104
|
-
? props.
|
104
|
+
? props.isDisabled
|
105
|
+
? props.theme.colors.lightGray
|
106
|
+
: props.backgroundColor
|
105
107
|
? props.backgroundColor
|
106
108
|
: props.theme.colors.green
|
107
109
|
: props.theme.colors.mediumGray};
|
@@ -140,7 +142,11 @@
|
|
140
142
|
: '10px'};
|
141
143
|
border: solid
|
142
144
|
${(props) =>
|
143
|
-
props.
|
145
|
+
props.isDisabled
|
146
|
+
? props.theme.colors.green
|
147
|
+
: props.checkColor
|
148
|
+
? props.checkColor
|
149
|
+
: props.theme.colors.white};
|
144
150
|
border-width: ${(props) =>
|
145
151
|
props.size === 'medium'
|
146
152
|
? '0 3px 3px 0'
|
@@ -160,11 +166,16 @@
|
|
160
166
|
width: 0;
|
161
167
|
`
|
162
168
|
|
163
|
-
const
|
169
|
+
const LabelTextAttrs = {
|
170
|
+
isDisabled: Boolean,
|
171
|
+
}
|
172
|
+
const LabelText = styled('div', LabelTextAttrs)`
|
164
173
|
font-size: 13px;
|
165
174
|
display: grid;
|
166
|
-
align-items:
|
175
|
+
align-items: center;
|
167
176
|
min-height: 18px;
|
177
|
+
color: ${(props) =>
|
178
|
+
props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
|
168
179
|
`
|
169
180
|
|
170
181
|
export default {
|