@eturnity/eturnity_reusable_components 7.35.1-EPDM-10620.4 → 7.35.1-EPDM-10620.6

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.35.1-EPDM-10620.4",
3
+ "version": "7.35.1-EPDM-10620.6",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -613,7 +613,9 @@
613
613
  if (this.isDropdownOpen) {
614
614
  return this.$refs.dropdown.$el.childElementCount > 1
615
615
  ? this.$refs.dropdown.$el.childElementCount
616
- : this.$refs.dropdown.$el.children[0].childElementCount
616
+ : !!this.$refs.dropdown.$el.children[0]
617
+ ? this.$refs.dropdown.$el.children[0].childElementCount
618
+ : 0
617
619
  }
618
620
 
619
621
  return 0
@@ -15,6 +15,7 @@
15
15
  :is-disabled="isDisabled"
16
16
  :min-width="minWidth"
17
17
  :padding="padding"
18
+ :text-color="textColor"
18
19
  :title="hoverText"
19
20
  @click="clickHandler"
20
21
  @mouseover="hoverHandler"
@@ -36,6 +37,7 @@
36
37
  disabledBgColor: String,
37
38
  disabledTextColor: String,
38
39
  padding: String,
40
+ textColor: String,
39
41
  }
40
42
  const OptionContainer = styled('div', optionProps)`
41
43
  display: flex;
@@ -67,7 +69,9 @@
67
69
  ? props.theme.colors[props.disabledTextColor]
68
70
  : props.disabledTextColor
69
71
  : props.theme.colors.grey3
70
- : 'inherit'};
72
+ : props.theme.colors[props.textColor]
73
+ ? props.theme.colors[props.textColor]
74
+ : props.textColor};
71
75
  &:hover {
72
76
  background-color: ${(props) =>
73
77
  !!props.disabledTextColor && props.isDisabled
@@ -125,6 +129,10 @@
125
129
  required: false,
126
130
  default: '12px 10px',
127
131
  },
132
+ textColor: {
133
+ type: true,
134
+ default: 'inherit',
135
+ },
128
136
  },
129
137
  emits: ['option-hovered', 'option-selected'],
130
138
  data() {
@@ -51,39 +51,47 @@
51
51
  />
52
52
  </IconContainer>
53
53
  </TitleContainer>
54
- <Divider />
55
- <ExpandedListItem
56
- v-for="item in limitedOptions"
57
- :key="item.type"
58
- :disabled="item.disabled || false"
59
- :hover-color="item.hoverColor"
60
- @click="!item?.component && $emit('on-' + item.type)"
61
- >
62
- <ListItemWrapper
63
- v-if="item?.component"
64
- @click="!item.disabled && toggleElement(item.type)"
54
+ <DividerContainer>
55
+ <Divider />
56
+ </DividerContainer>
57
+ <ExpandedList>
58
+ <ExpandedListItem
59
+ v-for="item in expandedOptions"
60
+ :key="item.type"
61
+ :disabled="item.disabled || false"
62
+ :hover-color="item.hoverColor"
63
+ @click="
64
+ !item?.component && !item.disabled && $emit('on-' + item.type)
65
+ "
65
66
  >
66
- <ListItemTitle>
67
- {{ item.name }}
68
- <InfoText
69
- v-if="item.disabled && item.disabledInfo"
70
- :text="item.disabledInfo"
67
+ <ListItemWrapper
68
+ v-if="item?.component"
69
+ @click="!item.disabled && toggleElement(item.type)"
70
+ >
71
+ <ListItemTitle>
72
+ {{ item.name }}
73
+ <InfoText
74
+ v-if="item.disabled && item.disabledInfo"
75
+ :text="item.disabledInfo"
76
+ />
77
+ </ListItemTitle>
78
+ <Icon
79
+ color="white"
80
+ :cursor="item.disabled ? 'not-allowed' : 'pointer'"
81
+ name="arrow_right"
82
+ size="20px"
71
83
  />
72
- </ListItemTitle>
73
- <Icon
74
- color="white"
75
- :cursor="item.disabled ? 'not-allowed' : 'pointer'"
76
- name="arrow_right"
77
- size="20px"
78
- />
79
- </ListItemWrapper>
80
- <template v-else>
81
- {{ item.name }}
82
- </template>
83
- <OptionsContainer v-if="item?.component && item.open">
84
- <slot :name="item.component"></slot>
85
- </OptionsContainer>
86
- </ExpandedListItem>
84
+ </ListItemWrapper>
85
+ <template v-else>
86
+ {{ item.name }}
87
+ </template>
88
+ <OptionsContainer
89
+ v-if="item?.component && item.open && !item.disabled"
90
+ >
91
+ <slot :name="item.component"></slot>
92
+ </OptionsContainer>
93
+ </ExpandedListItem>
94
+ </ExpandedList>
87
95
  </CenterBox>
88
96
  </CenterPageContainer>
89
97
  </PageWrapper>
@@ -127,11 +135,18 @@
127
135
  import InfoText from '../infoText'
128
136
  import Icon from '../icon'
129
137
 
130
- const PageWrapper = styled.div``
138
+ const PageWrapper = styled.div`
139
+ font-size: 13px;
140
+ `
141
+
142
+ const DividerContainer = styled.div`
143
+ display: contents;
144
+ `
131
145
 
132
146
  const Divider = styled.div`
133
- border-bottom: 1px solid ${({ theme }) => theme.colors.white};
134
- width: 100%;
147
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
148
+ width: 95%;
149
+ margin: 0 auto;
135
150
  `
136
151
 
137
152
  const PageContainer = styled.div`
@@ -154,10 +169,10 @@
154
169
 
155
170
  const OptionsContainer = styled.div`
156
171
  position: fixed;
157
- right: -300px;
172
+ right: -252px;
158
173
  background-color: ${(props) => props.theme.colors.black};
159
174
  border-radius: 4px;
160
- padding: 20px;
175
+ padding: 15px;
161
176
  `
162
177
 
163
178
  const SelectedContainer = styled.div`
@@ -174,10 +189,11 @@
174
189
  align-items: center;
175
190
  justify-content: space-between;
176
191
  width: 100%;
192
+ padding: 16px;
177
193
  `
178
194
 
179
195
  const BoxTitle = styled.div`
180
- font-size: 14px;
196
+ font-size: 13px;
181
197
  color: ${(props) => props.theme.colors.white};
182
198
  `
183
199
 
@@ -189,7 +205,7 @@
189
205
  color: ${(props) => props.theme.colors.white};
190
206
  border-radius: 4px;
191
207
  padding: 8px 10px 8px 20px;
192
- font-size: 14px;
208
+ font-size: 13px;
193
209
  height: 40px;
194
210
  `
195
211
 
@@ -197,11 +213,10 @@
197
213
  justify-content: center;
198
214
  flex-direction: column;
199
215
  height: auto;
200
- gap: 25px;
201
216
  align-items: flex-start;
202
217
  border-radius: 4px;
203
218
  width: 400px;
204
- padding: 20px;
219
+ padding: 0px;
205
220
  `
206
221
 
207
222
  const ButtonContainer = styled.div`
@@ -267,11 +282,24 @@
267
282
  }
268
283
  `
269
284
 
285
+ const ExpandedList = styled.div`
286
+ width: 100%;
287
+ display: flex;
288
+ flex-direction: column;
289
+ `
290
+
270
291
  const ExpandedListItem = styled(ListItem)`
271
292
  display: flex;
272
293
  width: 100%;
273
294
  justify-content: space-between;
274
295
  align-items: center;
296
+ padding: 13px 15px;
297
+
298
+ &:hover {
299
+ background: rgba(255, 255, 255, 0.1);
300
+ color: ${(props) =>
301
+ props.disabled ? props.theme.colors.grey3 : props.theme.colors.white};
302
+ }
275
303
  `
276
304
 
277
305
  const ListItemWrapper = styled.div`
@@ -317,6 +345,8 @@
317
345
  EmptyText,
318
346
  BoxTitle,
319
347
  Divider,
348
+ DividerContainer,
349
+ ExpandedList,
320
350
  },
321
351
  props: {
322
352
  optionsList: {
@@ -335,13 +365,16 @@
335
365
  optionLimit: 4,
336
366
  showOverlay: false,
337
367
  expanded: false,
338
- limitedOptions: [],
368
+ expandedOptions: [],
339
369
  }
340
370
  },
341
371
  computed: {
342
372
  hasComponent() {
343
373
  return this.optionsList.some((item) => item.component)
344
374
  },
375
+ limitedOptions() {
376
+ return this.expandedOptions.filter((option) => !option.component)
377
+ },
345
378
  },
346
379
  watch: {
347
380
  optionsList() {
@@ -353,15 +386,17 @@
353
386
  },
354
387
  methods: {
355
388
  initializeOptions() {
356
- this.limitedOptions = this.optionsList
357
- .map((item) => {
358
- return { ...item, open: false }
389
+ this.expandedOptions = [...this.optionsList]
390
+ .map((option, index) => {
391
+ const currentOption = this.expandedOptions[index]
392
+ const isOpen = !!currentOption ? currentOption.open : false
393
+
394
+ return { ...option, open: isOpen }
359
395
  })
360
- .filter((item) => !item.component)
361
396
  .slice(0, this.optionLimit)
362
397
  },
363
398
  toggleElement(type) {
364
- this.limitedOptions = this.optionsList.map((item) => {
399
+ this.expandedOptions = this.optionsList.map((item) => {
365
400
  if (item.type === type) {
366
401
  item.open = !item.open
367
402
  } else item.open = false
@@ -371,7 +406,7 @@
371
406
  },
372
407
  expandOptions() {
373
408
  this.expanded = !this.expanded
374
- this.limitedOptions = this.optionsList
409
+ this.expandedOptions = this.optionsList
375
410
  },
376
411
  },
377
412
  }