@eturnity/eturnity_reusable_components 7.51.16-EPDM-13568.0 → 7.51.16-EPDM-13568.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.51.16-EPDM-13568.0",
3
+ "version": "7.51.16-EPDM-13568.2",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
package/src/App.vue CHANGED
@@ -1,22 +1,22 @@
1
1
  <template>
2
- <ThemeProvider :style="{ height: '100%' }" :theme="getTheme()">
2
+ <ThemeProvider :style="{ height: '100%' }" :theme="theme">
3
3
  <RouterView />
4
4
  </ThemeProvider>
5
5
  </template>
6
6
 
7
7
  <script>
8
8
  import { ThemeProvider } from 'vue3-styled-components'
9
- import theme from './assets/theme'
9
+ import theme from '@/assets/theme.js'
10
10
 
11
11
  export default {
12
12
  name: 'App',
13
13
  components: {
14
14
  ThemeProvider,
15
15
  },
16
- methods: {
17
- getTheme() {
18
- return theme
19
- },
16
+ setup() {
17
+ return {
18
+ theme,
19
+ }
20
20
  },
21
21
  }
22
22
  </script>
@@ -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>
@@ -0,0 +1,5 @@
1
+ <svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.48791 8.60607C2.0063 8.2283 2.71145 7.71445 3.97197 7.71445C4.5703 7.71445 5.04544 7.82349 5.45393 7.99996C5.84112 8.16724 6.14723 8.38769 6.39326 8.56488L6.4106 8.57737C6.67117 8.76496 6.86936 8.90486 7.10995 9.00878C7.33842 9.10745 7.62765 9.18186 8.04848 9.18186C8.83404 9.18186 9.16094 8.94855 9.63985 8.60676C9.77269 8.51195 9.91723 8.4088 10.0865 8.29996C10.405 8.09514 10.8293 8.18732 11.0341 8.50586C11.2389 8.82439 11.1467 9.24866 10.8282 9.45348C10.7333 9.5145 10.6339 9.58693 10.5267 9.66506C10.0086 10.0426 9.3078 10.5533 8.04848 10.5533C7.45001 10.5533 6.97476 10.4442 6.56619 10.2678C6.17879 10.1005 5.87258 9.87993 5.62647 9.70269L5.60933 9.69035C5.34871 9.50272 5.15058 9.36282 4.91005 9.25891C4.68167 9.16025 4.39259 9.08586 3.97197 9.08586C3.18671 9.08586 2.8624 9.31732 2.38624 9.65715C2.24614 9.75714 2.09289 9.86651 1.91089 9.98213C1.59124 10.1852 1.16749 10.0907 0.964421 9.77102C0.761356 9.45136 0.855873 9.02761 1.17553 8.82455C1.27346 8.76234 1.37636 8.68735 1.48791 8.60607Z" fill="#5900CC"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.48791 5.17755C2.0063 4.79979 2.71145 4.28594 3.97197 4.28594C4.5703 4.28594 5.04544 4.39497 5.45393 4.57145C5.84112 4.73872 6.14723 4.95918 6.39326 5.13636L6.4106 5.14885C6.67117 5.33645 6.86936 5.47635 7.10995 5.58026C7.33842 5.67894 7.62765 5.75334 8.04848 5.75334C8.83404 5.75334 9.16094 5.52004 9.63985 5.17824C9.77269 5.08344 9.91723 4.98028 10.0865 4.87144C10.405 4.66662 10.8293 4.75881 11.0341 5.07734C11.2389 5.39588 11.1467 5.82014 10.8282 6.02496C10.7333 6.08599 10.6339 6.15842 10.5267 6.23654C10.0086 6.61409 9.3078 7.12475 8.04848 7.12475C7.45001 7.12475 6.97476 7.01572 6.56619 6.83926C6.17879 6.67194 5.87258 6.45142 5.62647 6.27417L5.60933 6.26183C5.34871 6.0742 5.15058 5.93431 4.91005 5.83039C4.68167 5.73173 4.39259 5.65734 3.97197 5.65734C3.18671 5.65734 2.8624 5.88881 2.38624 6.22864C2.24614 6.32863 2.09289 6.438 1.91089 6.55361C1.59124 6.75668 1.16749 6.66216 0.964421 6.3425C0.761356 6.02285 0.855873 5.5991 1.17553 5.39603C1.27346 5.33382 1.37636 5.25884 1.48791 5.17755Z" fill="#5900CC"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.48791 1.74904C2.0063 1.37127 2.71145 0.857422 3.97197 0.857422C4.5703 0.857422 5.04544 0.966459 5.45393 1.14293C5.84112 1.31021 6.14723 1.53066 6.39326 1.70785L6.4106 1.72034C6.67117 1.90793 6.86936 2.04783 7.10995 2.15175C7.33842 2.25042 7.62765 2.32483 8.04848 2.32483C8.83404 2.32483 9.16094 2.09152 9.63985 1.74973C9.77269 1.65492 9.91723 1.55177 10.0865 1.44293C10.405 1.23811 10.8293 1.33029 11.0341 1.64883C11.2389 1.96736 11.1467 2.39163 10.8282 2.59645C10.7333 2.65747 10.6339 2.7299 10.5267 2.80803C10.0086 3.18557 9.3078 3.69623 8.04848 3.69623C7.45001 3.69623 6.97476 3.58721 6.56619 3.41075C6.17879 3.24343 5.87258 3.0229 5.62647 2.84566L5.60933 2.83332C5.34871 2.64569 5.15058 2.50579 4.91005 2.40188C4.68167 2.30322 4.39259 2.22883 3.97197 2.22883C3.18671 2.22883 2.8624 2.46029 2.38624 2.80012C2.24614 2.90011 2.09289 3.00948 1.91089 3.1251C1.59124 3.32816 1.16749 3.23365 0.964421 2.91399C0.761356 2.59433 0.855873 2.17058 1.17553 1.96752C1.27346 1.90531 1.37636 1.83032 1.48791 1.74904Z" fill="#5900CC"/>
5
+ </svg>
@@ -1,7 +1,7 @@
1
1
  const theme = {
2
2
  colors: {
3
- primary: '#48a2d0',
4
- secondary: '#fdb813',
3
+ primary: '#5900CC',
4
+ secondary: '#FAF5FF',
5
5
  tertiary: '#d5d5d5',
6
6
  black: '#263238',
7
7
  yellow: '#fdb813',
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <PageContainer :should-position="shouldPosition">
3
- <ButtonContainer :data-id="dataId">
3
+ <ButtonContainer :data-id="dataId" :data-qa-id="dataQaId">
4
4
  <PlusButtonSvg />
5
5
  </ButtonContainer>
6
6
  </PageContainer>
@@ -57,6 +57,10 @@
57
57
  type: String,
58
58
  default: '',
59
59
  },
60
+ dataQaId: {
61
+ type: String,
62
+ default: '',
63
+ },
60
64
  },
61
65
  }
62
66
  </script>
@@ -1,19 +1,31 @@
1
1
  <template>
2
2
  <PageContainer>
3
3
  <ButtonWrapper
4
+ :button-size="buttonSize"
4
5
  :custom-color="customColor"
5
- :height="height"
6
6
  :is-disabled="isDisabled"
7
7
  :min-width="minWidth"
8
+ :theme-type="themeType"
9
+ :type="type"
10
+ :variant="variant"
8
11
  >
9
- <IconContainer :width="height">
12
+ <IconContainer
13
+ :button-size="buttonSize"
14
+ :theme-type="themeType"
15
+ :type="type"
16
+ :variant="variant"
17
+ >
10
18
  <Icon
11
- :color="fontColor ? fontColor : theme.colors.white"
19
+ :color="
20
+ iconColor ||
21
+ theme.mainButton[themeType][type][variant].textColor ||
22
+ theme.colors.white
23
+ "
12
24
  :name="iconName"
13
25
  size="14px"
14
26
  />
15
27
  </IconContainer>
16
- <ButtonContainer :font-color="fontColor" :font-size="fontSize">
28
+ <ButtonContainer :button-size="buttonSize">
17
29
  {{ text }}
18
30
  </ButtonContainer>
19
31
  </ButtonWrapper>
@@ -40,61 +52,96 @@
40
52
  const PageContainer = styled.div``
41
53
 
42
54
  const ButtonAttrs = {
55
+ type: String,
43
56
  isDisabled: Boolean,
44
57
  minWidth: String,
45
58
  customColor: String,
46
- height: String,
59
+ buttonSize: String,
60
+ themeType: String,
61
+ variant: String,
47
62
  }
48
63
  const ButtonWrapper = styled('div', ButtonAttrs)`
49
64
  display: grid;
50
65
  grid-template-columns: auto 1fr;
66
+ font-size: ${(props) =>
67
+ props.theme?.mainButton?.size?.[props.buttonSize]?.fontSize};
68
+ color: ${(props) =>
69
+ props.isDisabled
70
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
71
+ .disabled.textColor
72
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
73
+ .textColor};
51
74
  background-color: ${(props) =>
52
75
  props.isDisabled
53
- ? props.theme.colors.disabled
76
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
77
+ .disabled.backgroundColor
54
78
  : props.customColor
55
- ? props.theme.colors[props.customColor]
56
- ? props.theme.colors[props.customColor]
57
- : props.customColor
58
- : props.theme.colors.yellow};
79
+ ? props.customColor
80
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
81
+ .default};
82
+ border: ${(props) => {
83
+ const borderValue = props.isDisabled
84
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
85
+ .disabled.borderColor
86
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
87
+ .borderColor
88
+ return borderValue ? '1px solid ' + borderValue : 'none'
89
+ }};
59
90
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
60
91
  user-select: none;
61
92
  border-radius: 4px;
62
93
  overflow: hidden;
63
- min-width: ${(props) => (props.minWidth ? props.minWidth : 'initial')};
64
- height: ${(props) => props.height};
94
+ min-width: ${(props) => props.minWidth || 'initial'};
65
95
 
66
96
  &:hover {
67
- opacity: ${(props) => (props.isDisabled ? '1' : '0.8')};
97
+ background-color: ${(props) =>
98
+ props.isDisabled
99
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
100
+ .disabled.backgroundColor
101
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
102
+ .hover};
68
103
  }
69
104
 
70
105
  &:active {
71
- opacity: 1;
106
+ background-color: ${(props) =>
107
+ props.isDisabled
108
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
109
+ .disabled.backgroundColor
110
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
111
+ .active};
72
112
  }
73
113
  `
74
114
 
75
115
  const ButtonContainerAttrs = {
76
- fontSize: String,
77
- fontColor: String,
116
+ buttonSize: String,
78
117
  }
79
118
  const ButtonContainer = styled('div', ButtonContainerAttrs)`
80
- font-size: ${(props) => props.fontSize};
81
- color: ${(props) =>
82
- props.fontColor ? props.fontColor : props.theme.colors.white};
83
119
  display: flex;
84
120
  align-items: center;
85
121
  justify-content: center;
86
- padding: 0 14px;
122
+ padding: ${(props) =>
123
+ props.theme?.mainButton?.size?.[props.buttonSize]?.padding};
87
124
  `
88
125
 
89
126
  const IconContainerAttrs = {
90
- width: String,
127
+ buttonSize: String,
128
+ themeType: String,
129
+ type: String,
130
+ variant: String,
91
131
  }
92
132
  const IconContainer = styled('div', IconContainerAttrs)`
93
133
  display: grid;
94
134
  align-items: center;
95
135
  justify-items: center;
96
- width: ${(props) => props.width};
97
- background: ${(props) => props.theme.colors.white + '1a'};
136
+ width: ${(props) =>
137
+ props.theme?.mainButton?.size?.[props.buttonSize]?.iconWidth};
138
+ background: rgba(255, 255, 255, 0.1);
139
+ border-right: ${(props) => {
140
+ const borderColor =
141
+ props.theme.mainButton[props.themeType][props.type][props.variant]
142
+ .borderColor
143
+ return borderColor ? `1px solid ${borderColor}` : 'none'
144
+ }};
98
145
  `
99
146
 
100
147
  export default {
@@ -107,35 +154,53 @@
107
154
  Icon,
108
155
  },
109
156
  props: {
157
+ type: {
158
+ required: false,
159
+ default: 'primary',
160
+ type: String,
161
+ },
162
+ variant: {
163
+ required: false,
164
+ default: 'main',
165
+ type: String,
166
+ },
167
+ themeType: {
168
+ type: String,
169
+ default: 'light',
170
+ required: false,
171
+ },
172
+ buttonSize: {
173
+ type: String,
174
+ default: 'medium',
175
+ required: false,
176
+ },
110
177
  isDisabled: {
111
178
  required: false,
112
179
  default: false,
180
+ type: Boolean,
113
181
  },
114
182
  text: {
115
183
  required: true,
184
+ type: String,
116
185
  },
117
186
  minWidth: {
118
187
  required: false,
119
188
  default: null,
189
+ type: String,
120
190
  },
121
191
  customColor: {
122
192
  required: false,
123
193
  default: null,
194
+ type: String,
124
195
  },
125
196
  iconName: {
126
197
  required: true,
198
+ type: String,
127
199
  },
128
- fontColor: {
200
+ iconColor: {
129
201
  required: false,
130
202
  default: null,
131
- },
132
- fontSize: {
133
- required: false,
134
- default: '13px',
135
- },
136
- height: {
137
- required: false,
138
- default: '30px',
203
+ type: String,
139
204
  },
140
205
  },
141
206
  data() {
@@ -143,5 +208,14 @@
143
208
  theme: Theme,
144
209
  }
145
210
  },
211
+ // computed: {
212
+ // getIconColor() {
213
+ // console.log(this.theme[this.themeType][this.type][this.variant])
214
+ // return (
215
+ // this.iconColor ||
216
+ // this.theme[this.themeType][this.type][this.variant].textColor
217
+ // )
218
+ // },
219
+ // },
146
220
  }
147
221
  </script>
@@ -2,17 +2,21 @@
2
2
  <PageContainer>
3
3
  <ButtonContainer
4
4
  :id="id"
5
+ :button-size="buttonSize"
5
6
  :custom-color="customColor"
6
7
  :data-id="dataId"
8
+ :data-qa-id="dataQaId"
7
9
  :font-color="fontColor"
8
10
  :height="height"
9
11
  :is-disabled="isDisabled"
10
12
  :min-width="minWidth"
11
13
  :no-wrap="noWrap"
14
+ :theme-type="theme"
12
15
  :type="type"
16
+ :variant="variant"
13
17
  >
14
18
  <LabelComponent :has-icon="Boolean(icon)">
15
- <Icon v-if="icon" :name="icon" :color="iconColor" size="14px" />
19
+ <Icon v-if="icon" :color="iconColor" :name="icon" size="14px" />
16
20
  {{ text }}
17
21
  </LabelComponent>
18
22
  </ButtonContainer>
@@ -45,30 +49,40 @@
45
49
  fontColor: String,
46
50
  noWrap: Boolean,
47
51
  height: String,
52
+ variant: String,
53
+ buttonSize: String,
54
+ themeType: String,
48
55
  }
49
56
  const ButtonContainer = styled('div', ButtonAttrs)`
50
57
  display: flex;
51
58
  justify-content: center;
52
- padding: 7px 15px;
53
- font-size: 14px;
59
+ padding: ${(props) =>
60
+ props.theme?.mainButton?.size?.[props.buttonSize]?.padding};
61
+ font-size: ${(props) =>
62
+ props.theme?.mainButton?.size?.[props.buttonSize]?.fontSize};
54
63
  color: ${(props) =>
55
64
  props.isDisabled
56
- ? props.theme.colors.white
57
- : props.fontColor
58
- ? props.fontColor
59
- : props.theme.colors.white};
65
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
66
+ .disabled.textColor
67
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
68
+ .textColor};
60
69
  background-color: ${(props) =>
61
70
  props.isDisabled
62
- ? props.theme.colors.disabled
71
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
72
+ .disabled.backgroundColor
63
73
  : props.customColor
64
74
  ? props.customColor
65
- : props.type === 'primary'
66
- ? props.theme.colors.black
67
- : props.type === 'secondary'
68
- ? props.theme.colors.grey3
69
- : props.type === 'cancel'
70
- ? props.theme.colors.red
71
- : props.theme.colors.black};
75
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
76
+ .default};
77
+
78
+ border: ${(props) => {
79
+ const borderValue = props.isDisabled
80
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
81
+ .disabled.borderColor
82
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
83
+ .borderColor
84
+ return borderValue ? '1px solid ' + borderValue : 'none'
85
+ }};
72
86
  border-radius: 4px;
73
87
  text-align: center;
74
88
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
@@ -78,11 +92,21 @@
78
92
  height: ${(props) => props.height};
79
93
 
80
94
  &:hover {
81
- opacity: ${(props) => (props.isDisabled ? '1' : '0.8')};
95
+ background-color: ${(props) =>
96
+ props.isDisabled
97
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
98
+ .disabled.backgroundColor
99
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
100
+ .hover};
82
101
  }
83
102
 
84
103
  &:active {
85
- opacity: 1;
104
+ background-color: ${(props) =>
105
+ props.isDisabled
106
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
107
+ .disabled.backgroundColor
108
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
109
+ .active};
86
110
  }
87
111
  `
88
112
 
@@ -108,7 +132,12 @@
108
132
  props: {
109
133
  type: {
110
134
  required: false,
111
- default: 'primary',
135
+ default: 'primary', // primary, secondary, tertiary, ghost
136
+ type: String,
137
+ },
138
+ variant: {
139
+ required: false,
140
+ default: 'main', // main, cancel
112
141
  type: String,
113
142
  },
114
143
  isDisabled: {
@@ -164,6 +193,19 @@
164
193
  type: String,
165
194
  default: '',
166
195
  },
196
+ dataQaId: {
197
+ type: String,
198
+ default: '',
199
+ },
200
+ theme: {
201
+ type: String,
202
+ default: 'light',
203
+ },
204
+ buttonSize: {
205
+ type: String,
206
+ default: 'medium',
207
+ required: false,
208
+ },
167
209
  },
168
210
  }
169
211
  </script>
@@ -297,12 +297,13 @@
297
297
  <MainButton
298
298
  v-if="buttonText.cancel"
299
299
  :text="buttonText.cancel"
300
- type="cancel"
300
+ type="primary"
301
+ variant="cancel"
301
302
  @click="$emit('on-cancel-view')"
302
303
  />
303
304
  <ResetContainer v-if="!filterViews || !filterViews.length">
304
305
  <ResetButton @click="$emit('on-reset-filters')">
305
- <Icon :color="theme.colors.blue" :name="'update'" size="14px" />
306
+ <Icon :color="theme.colors.primary" :name="'update'" size="14px" />
306
307
  <div>{{ $gettext('reset_filters') }}</div>
307
308
  </ResetButton>
308
309
  </ResetContainer>
@@ -475,7 +476,7 @@
475
476
  margin-top: 20px;
476
477
  align-self: center;
477
478
  font-size: 13px;
478
- color: ${(props) => props.theme.colors.blue};
479
+ color: ${(props) => props.theme.colors.primary};
479
480
  cursor: pointer;
480
481
  `
481
482
 
@@ -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;
@@ -121,6 +143,7 @@
121
143
  background-color: ${(props) =>
122
144
  props.backgroundColor ? props.backgroundColor : 'transparent'};
123
145
  padding: ${(props) => (props.backgroundColor ? '3px' : '0')};
146
+ border-radius: 4px;
124
147
  }
125
148
  svg path:not(.fix) {
126
149
  ${({ theme, color }) => color && `fill: ${theme.colors[color] || color};`}
@@ -145,6 +168,10 @@
145
168
  icon.html = await fetchIcon(props.name.toLowerCase())
146
169
  }
147
170
 
171
+ const counter = computed(() =>
172
+ props.count > 9 ? '9+' : props.count.toString()
173
+ )
174
+
148
175
  onMounted(() => loadSvg())
149
176
 
150
177
  watch(() => props.name, loadSvg)
@@ -4,6 +4,7 @@
4
4
  :border-radius="borderRadius"
5
5
  :color="iconColor"
6
6
  :data-id="dataId"
7
+ :data-qa-id="dataQaId"
7
8
  :disabled="disabled"
8
9
  :has-border="hasBorder"
9
10
  :hovered-background-color="hoveredBackgroundColor"
@@ -154,6 +155,10 @@
154
155
  type: String,
155
156
  default: '',
156
157
  },
158
+ dataQaId: {
159
+ type: String,
160
+ default: '',
161
+ },
157
162
  isHovered: {
158
163
  required: false,
159
164
  default: false,
@@ -19,6 +19,7 @@
19
19
  <TextWrapper :style="wrapperStyle">
20
20
  <TextOverlay
21
21
  ref="infoBox"
22
+ :app-theme="appTheme"
22
23
  :image="image"
23
24
  :style="boxStyle"
24
25
  :width="infoBoxWidth"
@@ -36,7 +37,7 @@
36
37
  </slot>
37
38
  </span>
38
39
  </TextOverlay>
39
- <Arrow :image="image" :style="arrowStyle" />
40
+ <!-- <Arrow :image="image" :style="arrowStyle" /> -->
40
41
  </TextWrapper>
41
42
  </Teleport>
42
43
  </PageContainer>
@@ -57,11 +58,14 @@
57
58
  import styled from 'vue3-styled-components'
58
59
  import theme from '../../assets/theme.js'
59
60
 
60
- const TextOverlay = styled('div')`
61
- background-color: ${(props) =>
62
- props.image ? props.theme.colors.white : props.theme.colors.black};
61
+ const TextOverlayAttrs = {
62
+ appTheme: String,
63
+ image: Boolean,
64
+ width: Number,
65
+ }
66
+ const TextOverlay = styled('div', TextOverlayAttrs)`
63
67
  color: ${(props) =>
64
- props.image ? props.theme.colors.grey1 : props.theme.colors.white};
68
+ props.image ? props.theme.colors.grey1 : props.theme.colors.black};
65
69
  font-size: ${(props) => (props.image ? '12px' : '13px')};
66
70
  border-radius: 4px;
67
71
  padding: 10px;
@@ -82,16 +86,20 @@
82
86
  }
83
87
  `
84
88
 
85
- const Arrow = styled('div')`
86
- position: absolute;
87
- width: 0;
88
- height: 0;
89
- border: 8px solid transparent;
90
- border-top-color: ${(props) =>
91
- props.image ? props.theme.colors.white : props.theme.colors.black};
92
- filter: ${(props) =>
93
- props.image ? 'drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1))' : 'none'};
94
- `
89
+ // const Arrow = styled('div')`
90
+ // position: absolute;
91
+ // width: 0;
92
+ // height: 0;
93
+ // border: 8px solid transparent;
94
+ // border-top-color: ${(props) =>
95
+ // props.image
96
+ // ? props.theme.colors.white
97
+ // : props.appTheme === 'dark'
98
+ // ? props.theme.colors.grey5
99
+ // : props.theme.colors.black};
100
+ // filter: ${(props) =>
101
+ // props.image ? 'drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1))' : 'none'};
102
+ // `
95
103
 
96
104
  const PageContainer = styled('div')`
97
105
  display: inline-block;
@@ -113,7 +121,7 @@
113
121
  components: {
114
122
  IconComponent,
115
123
  TextOverlay,
116
- Arrow,
124
+ // Arrow,
117
125
  PageContainer,
118
126
  TextWrapper,
119
127
  OverlayImage,
@@ -165,6 +173,11 @@
165
173
  default: false,
166
174
  required: false,
167
175
  },
176
+ appTheme: {
177
+ type: String,
178
+ default: 'light', // light or dark
179
+ required: false,
180
+ },
168
181
  },
169
182
  setup(props) {
170
183
  const isVisible = ref(false)
@@ -182,7 +195,11 @@
182
195
 
183
196
  const textStyle = computed(() => ({
184
197
  fontSize: props.image ? '12px' : '13px',
185
- color: props.image ? theme.colors.grey1 : theme.colors.white,
198
+ color: props.image
199
+ ? theme.colors.grey1
200
+ : props.appTheme === 'dark'
201
+ ? theme.colors.black
202
+ : theme.colors.white,
186
203
  textAlign: props.image ? 'right' : 'left',
187
204
  }))
188
205
 
@@ -312,7 +329,9 @@
312
329
  overflowY: 'auto',
313
330
  backgroundColor: props.image
314
331
  ? theme.colors.white
315
- : theme.colors.black,
332
+ : props.appTheme === 'light'
333
+ ? theme.colors.black
334
+ : theme.colors.grey5,
316
335
  }
317
336
  }
318
337
 
@@ -354,7 +373,6 @@
354
373
  }
355
374
 
356
375
  const updatePosition = async () => {
357
- console.log('updatePosition')
358
376
  if (!infoBox.value || !textContent.value) return
359
377
 
360
378
  // First make the content visible but hidden to get accurate measurements
@@ -13,6 +13,7 @@
13
13
  <InputCheckbox
14
14
  :checked="isChecked"
15
15
  :data-id="dataId"
16
+ :data-qa-id="dataQaId"
16
17
  type="checkbox"
17
18
  @change="onChangeHandler(!isChecked)"
18
19
  />
@@ -214,6 +215,10 @@
214
215
  type: String,
215
216
  default: '',
216
217
  },
218
+ dataQaId: {
219
+ type: String,
220
+ default: '',
221
+ },
217
222
  cursorType: {
218
223
  type: String,
219
224
  default: 'pointer',
@@ -15,6 +15,7 @@
15
15
  <LabelWrapper v-if="labelText">
16
16
  <LabelText
17
17
  :data-id="labelDataId"
18
+ :data-test-id="labelDataTestId"
18
19
  :label-font-color="labelFontColor"
19
20
  :label-font-weight="labelFontWeight"
20
21
  >
@@ -24,6 +25,7 @@
24
25
  <InfoText
25
26
  v-if="labelInfoText"
26
27
  :align-arrow="labelInfoAlign"
28
+ :app-theme="appTheme"
27
29
  :text="labelInfoText"
28
30
  />
29
31
  </LabelWrapper>
@@ -40,6 +42,7 @@
40
42
  "
41
43
  :color-mode="colorMode"
42
44
  :data-id="inputDataId"
45
+ :data-qa-id="dataQaId"
43
46
  :disabled="disabled"
44
47
  :font-color="colorMode === 'transparent' ? 'white' : fontColor"
45
48
  :font-size="fontSize"
@@ -472,6 +475,10 @@
472
475
  },
473
476
  inheritAttrs: false,
474
477
  props: {
478
+ appTheme: {
479
+ type: String,
480
+ required: false,
481
+ },
475
482
  placeholder: {
476
483
  type: String,
477
484
  required: false,
@@ -647,6 +654,10 @@
647
654
  required: false,
648
655
  default: '',
649
656
  },
657
+ dataQaId: {
658
+ required: false,
659
+ default: '',
660
+ },
650
661
  showSelect: {
651
662
  type: Boolean,
652
663
  default: false,
@@ -21,6 +21,7 @@
21
21
  <InfoText
22
22
  v-if="infoTextMessage != ''"
23
23
  :align-arrow="infoTextAlign"
24
+ :app-theme="appTheme"
24
25
  data-test-id="info_text_message"
25
26
  :size="fontSize ? fontSize : '16px'"
26
27
  :text="infoTextMessage"
@@ -34,6 +35,7 @@
34
35
  :background-color="backgroundColor"
35
36
  :border-color="borderColor"
36
37
  :data-id="inputDataId"
38
+ :data-qa-id="dataQaId"
37
39
  data-test-id="input"
38
40
  :default-padding="defaultPadding"
39
41
  :disabled="disabled"
@@ -262,6 +264,11 @@
262
264
  default: '',
263
265
  type: String,
264
266
  },
267
+ appTheme: {
268
+ type: String,
269
+ required: false,
270
+ default: 'light',
271
+ },
265
272
  alignItems: {
266
273
  required: false,
267
274
  default: 'horizontal',
@@ -378,6 +385,11 @@
378
385
  default: '',
379
386
  type: String,
380
387
  },
388
+ dataQaId: {
389
+ required: false,
390
+ default: '',
391
+ type: String,
392
+ },
381
393
  iconName: {
382
394
  required: false,
383
395
  default: null,
@@ -17,6 +17,7 @@
17
17
  <Radio
18
18
  :checked="selectedOption === item.value"
19
19
  :data-id="`radio_button_${dataId}_option_${item.value}`"
20
+ :data-qa-id="dataQaId"
20
21
  :data-test-id="'radioInput_' + item.value"
21
22
  :disabled="item.disabled"
22
23
  :name="'radioButtons_' + radioName"
@@ -296,6 +297,11 @@
296
297
  required: false,
297
298
  type: String,
298
299
  },
300
+ dataQaId: {
301
+ type: String,
302
+ default: '',
303
+ required: false,
304
+ },
299
305
  colorMode: {
300
306
  default: '',
301
307
  required: false,
@@ -5,6 +5,7 @@
5
5
  <InputContainer
6
6
  ref="inputElement"
7
7
  :data-id="dataId"
8
+ :data-qa-id="dataQaId"
8
9
  :disabled="disabled"
9
10
  :has-focus="hasFocus"
10
11
  :input-width="inputWidth"
@@ -128,6 +129,11 @@
128
129
  default: '',
129
130
  type: [String, Number],
130
131
  },
132
+ dataQaId: {
133
+ required: false,
134
+ default: '',
135
+ type: String,
136
+ },
131
137
  iconPosition: {
132
138
  type: String,
133
139
  default: 'right',
@@ -13,6 +13,7 @@
13
13
  <LabelWrapper
14
14
  v-if="label"
15
15
  :data-id="labelDataId"
16
+ :data-qa-id="dataQaId + '_label'"
16
17
  :info-text-message="!!infoTextMessage || !!$slots.infoText"
17
18
  >
18
19
  <InputLabel
@@ -51,6 +52,7 @@
51
52
  class="select-button"
52
53
  :color-mode="colorMode"
53
54
  :data-id="dataId"
55
+ :data-qa-id="dataQaId"
54
56
  :disabled="disabled"
55
57
  :font-color="
56
58
  buttonFontColor || colorMode == 'dark' || colorMode == 'transparent'
@@ -605,6 +607,10 @@
605
607
  type: String,
606
608
  default: '',
607
609
  },
610
+ dataQaId: {
611
+ type: String,
612
+ default: '',
613
+ },
608
614
  hasSelectButtonPadding: {
609
615
  required: false,
610
616
  type: Boolean,
@@ -18,6 +18,7 @@
18
18
  >
19
19
  <textarea
20
20
  :data-id="inputDataId"
21
+ :data-qa-id="dataQaId"
21
22
  :disabled="isDisabled"
22
23
  :placeholder="placeholder"
23
24
  :resize="resize"
@@ -185,6 +186,11 @@
185
186
  required: false,
186
187
  default: '',
187
188
  },
189
+ dataQaId: {
190
+ required: false,
191
+ default: '',
192
+ type: String,
193
+ },
188
194
  },
189
195
  methods: {
190
196
  onChangeHandler($event) {
@@ -2,6 +2,7 @@
2
2
  <Container>
3
3
  <FlexWrapper
4
4
  :data-id="dataId"
5
+ :data-qa-id="dataQaId"
5
6
  data-test-id="page_wrapper"
6
7
  :disabled="disabled"
7
8
  :size="size"
@@ -304,6 +305,10 @@
304
305
  type: String,
305
306
  default: '',
306
307
  },
308
+ dataQaId: {
309
+ type: String,
310
+ default: '',
311
+ },
307
312
  },
308
313
  methods: {
309
314
  onToggleChange() {
@@ -2,10 +2,9 @@
2
2
  <PageWrapper
3
3
  :backdrop="backdrop"
4
4
  :class="{ visible: isOpen, hidden: !isOpen }"
5
- :is-open="isOpen"
6
5
  :position="position"
7
6
  >
8
- <ModalContainer :overflow="overflowRule" @click="onClickModalContainer">
7
+ <ModalContainer v-if="isOpen" :overflow="overflowRule" @click="onClickModalContainer">
9
8
  <Spinner v-if="isLoading" :limited-to-modal="true" size="50px" />
10
9
  <ContentContainer :visible="!isLoading">
11
10
  <slot></slot>
@@ -35,7 +34,7 @@
35
34
  visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
36
35
  `
37
36
 
38
- const pageAttrs = { isOpen: Boolean, backdrop: String, position: String }
37
+ const pageAttrs = { backdrop: String, position: String }
39
38
  const PageWrapper = styled('div', pageAttrs)`
40
39
  position: ${(props) => props.position}
41
40
  display: grid;
@@ -59,7 +59,8 @@
59
59
  <MainButton :text="$gettext('Delete')" @click="onDelete" />
60
60
  <MainButton
61
61
  :text="$gettext('Cancel')"
62
- type="cancel"
62
+ type="primary"
63
+ variant="cancel"
63
64
  @click="closeDeleteModal"
64
65
  />
65
66
  </CtaContainer>
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  :class="className"
4
4
  :data-id="dataId"
5
+ :data-qa-id="dataQaId"
5
6
  :style="style"
6
7
  @mousedown="elementMouseDown"
7
8
  @touchstart="elementTouchDown"
@@ -64,6 +65,10 @@
64
65
  type: String,
65
66
  default: '',
66
67
  },
68
+ dataQaId: {
69
+ type: String,
70
+ default: '',
71
+ },
67
72
  className: {
68
73
  type: String,
69
74
  default: 'vdr',
@@ -13,27 +13,49 @@
13
13
  @click="$emit('tab-click', { activeKey: item.key })"
14
14
  >
15
15
  <IconContainer :is-active="activeTab === item.key">
16
- <Icon color="#fff" cursor="pointer" :name="item.icon" size="18px" />
16
+ <Icon
17
+ :color="
18
+ activeTab === item.key
19
+ ? theme.colors.white
20
+ : theme.colors.primary
21
+ "
22
+ cursor="pointer"
23
+ :name="item.icon"
24
+ size="18px"
25
+ />
17
26
  </IconContainer>
18
- <ListText>{{ $gettext(item.label) }}</ListText>
27
+ <ListText :is-active="activeTab === item.key">{{
28
+ $gettext(item.label)
29
+ }}</ListText>
19
30
  </ListItem>
20
31
  <CollapseWrapper v-else :key="idx + item.key">
21
32
  <CollapseContainer
22
33
  :data-id="`sub_menu_settings_${item.key}`"
34
+ :is-active="activeParentTab === item.key"
23
35
  @click="toggleActiveDropdown(item.key)"
24
36
  >
25
37
  <IconContainer :is-active="activeParentTab === item.key">
26
38
  <Icon
27
- color="#fff"
39
+ :color="
40
+ activeParentTab === item.key
41
+ ? theme.colors.white
42
+ : theme.colors.primary
43
+ "
28
44
  cursor="pointer"
29
45
  :name="item.icon"
30
46
  size="18px"
31
47
  />
32
48
  </IconContainer>
33
- <ListText>{{ $gettext(item.label) }}</ListText>
49
+ <ListText :is-active="activeTab === item.key">{{
50
+ $gettext(item.label)
51
+ }}</ListText>
34
52
  <ArrowContainer>
35
53
  <Icon
36
- color="white"
54
+ :color="
55
+ activeDropdown === item.key
56
+ ? theme.colors.white
57
+ : theme.colors.primary
58
+ "
37
59
  :name="activeDropdown === item.key ? 'arrow_up' : 'arrow_down'"
38
60
  size="10px"
39
61
  />
@@ -66,7 +88,7 @@
66
88
  @click="$emit('on-logout')"
67
89
  >
68
90
  <RotateIcon
69
- color="#fff"
91
+ :color="theme.colors.primary"
70
92
  cursor="pointer"
71
93
  name="initial_situation"
72
94
  size="18px"
@@ -81,16 +103,17 @@
81
103
  import styled from 'vue3-styled-components'
82
104
  import Icon from '../icon'
83
105
  import Spinner from '../spinner'
106
+ import theme from '@/assets/theme.js'
84
107
 
85
108
  const PageAttrs = { isLoading: Boolean }
86
109
  const PageContainer = styled('div', PageAttrs)`
87
- background-color: ${(props) =>
88
- props.isLoading ? props.theme.colors.white : props.theme.colors.grey6};
110
+ background-color: ${(props) => props.theme.colors.white};
89
111
  padding: 14px 12px;
90
112
  min-width: 220px;
91
113
  display: flex;
92
114
  flex-direction: column;
93
115
  justify-content: space-between;
116
+ border-right: 1px solid rgba(89, 0, 204, 0.2);
94
117
  `
95
118
 
96
119
  const ListContainer = styled.div`
@@ -109,17 +132,19 @@
109
132
  padding: 4px;
110
133
  border-radius: 6px;
111
134
  background-color: ${(props) =>
112
- props.isActive ? 'rgba(255, 255, 255, 0.1)' : ''};
135
+ props.isActive ? props.theme.colors.primary : ''};
113
136
 
114
137
  :hover {
115
- background-color: rgba(255, 255, 255, 0.1);
138
+ background-color: rgba(89, 0, 204, 0.2);
116
139
  }
117
140
  `
118
141
 
119
- const ListText = styled.div`
142
+ const ListTextAttrs = { isActive: Boolean }
143
+ const ListText = styled('div', ListTextAttrs)`
120
144
  font-size: 16px;
121
145
  font-weight: 700;
122
- color: ${(props) => props.theme.colors.white};
146
+ color: ${(props) =>
147
+ props.isActive ? props.theme.colors.white : props.theme.colors.primary};
123
148
  `
124
149
 
125
150
  const IconContainer = styled('div', IconAttrs)`
@@ -128,18 +153,16 @@
128
153
  justify-items: center;
129
154
  width: 32px;
130
155
  height: 32px;
131
- background-color: ${(props) =>
132
- props.isActive ? props.theme.colors.red : 'rgba(255, 255, 255, 0.2)'};
133
156
  border-radius: 6px;
134
157
 
135
158
  ${({ isButton = false }) =>
136
159
  isButton &&
137
160
  `
138
- cursor: pointer;
139
- &:hover {
140
- background-color: rgba(255, 255, 255, 0.3);
141
- }
142
- `}
161
+ cursor: pointer;
162
+ &:hover {
163
+ background-color: rgba(89, 0, 204, 0.2);
164
+ }
165
+ `}
143
166
  `
144
167
 
145
168
  const SpinnerContainer = styled.div`
@@ -159,7 +182,7 @@
159
182
  const AppVersion = styled.p`
160
183
  font-size: 11px;
161
184
  line-height: 13px;
162
- color: ${(props) => props.theme.colors.white};
185
+ color: ${(props) => props.theme.colors.primary};
163
186
  margin-right: 6px;
164
187
  `
165
188
 
@@ -173,20 +196,19 @@
173
196
  margin-left: 65px;
174
197
  padding: 8px;
175
198
  border-radius: 6px;
176
- color: ${(props) => props.theme.colors.white};
199
+ color: ${(props) =>
200
+ props.isActive ? props.theme.colors.white : props.theme.colors.primary};
177
201
  font-weight: 700;
178
- ${({ isActive }) =>
179
- isActive &&
180
- `
181
- background: rgba(255, 255, 255, 0.1);
182
- `}
202
+ background: ${(props) =>
203
+ props.isActive ? props.theme.colors.primary : ''};
183
204
 
184
205
  &:hover {
185
- background: rgba(255, 255, 255, 0.1);
206
+ background: rgba(89, 0, 204, 0.2);
186
207
  }
187
208
  `
188
209
 
189
- const CollapseContainer = styled.div`
210
+ const CollapseContainerAttrs = { isActive: Boolean }
211
+ const CollapseContainer = styled('div', CollapseContainerAttrs)`
190
212
  display: grid;
191
213
  grid-template-columns: auto 1fr auto;
192
214
  grid-gap: 20px;
@@ -194,8 +216,16 @@
194
216
  border-radius: 6px;
195
217
  align-items: center;
196
218
  cursor: pointer;
219
+ background: ${(props) =>
220
+ props.isActive ? props.theme.colors.primary : ''};
221
+
197
222
  &:hover {
198
- background: rgba(255, 255, 255, 0.1);
223
+ background: rgba(89, 0, 204, 0.2);
224
+ }
225
+
226
+ div {
227
+ color: ${(props) =>
228
+ props.isActive ? props.theme.colors.white : props.theme.colors.primary};
199
229
  }
200
230
  `
201
231
 
@@ -252,6 +282,7 @@
252
282
  data() {
253
283
  return {
254
284
  activeDropdown: null,
285
+ theme,
255
286
  }
256
287
  },
257
288
  mounted() {
@@ -72,11 +72,11 @@
72
72
  ${(props) =>
73
73
  props.isWhite ? props.theme.colors.grey5 : props.theme.colors.white};
74
74
  border-top-color: ${(props) =>
75
- props.isWhite ? props.theme.colors.white : props.theme.colors.brightBlue};
75
+ props.isWhite ? props.theme.colors.white : props.theme.colors.primary};
76
76
  border-right-color: ${(props) =>
77
- props.isWhite ? props.theme.colors.white : props.theme.colors.brightBlue};
77
+ props.isWhite ? props.theme.colors.white : props.theme.colors.primary};
78
78
  border-bottom-color: ${(props) =>
79
- props.isWhite ? props.theme.colors.white : props.theme.colors.brightBlue};
79
+ props.isWhite ? props.theme.colors.white : props.theme.colors.primary};
80
80
  animation: spin 1s linear infinite;
81
81
  transform: rotate(90deg);
82
82
 
@@ -91,7 +91,7 @@
91
91
  }
92
92
 
93
93
  ::-webkit-scrollbar-thumb {
94
- border-bottom: 10px solid ${(props) => props.theme.colors.brightBlue}; // width of the actual scrollbar
94
+ border-bottom: 10px solid ${(props) => props.theme.colors.primary}; // width of the actual scrollbar
95
95
  border-radius: 4px;
96
96
  }
97
97
  `
@@ -154,7 +154,7 @@
154
154
 
155
155
  th {
156
156
  padding: 11px 15px;
157
- background-color: ${(props) => props.theme.colors.blue1};
157
+ background-color: ${(props) => props.theme.colors.grey5};
158
158
  cursor: auto;
159
159
  height: 40px;
160
160