@eturnity/eturnity_reusable_components 7.35.1-EPDM-10620.3 → 7.35.1-EPDM-10620.5
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
@@ -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]
|
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
|
-
:
|
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
|
-
<
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
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
|
-
<
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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
|
-
</
|
73
|
-
<
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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,17 +135,26 @@
|
|
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
|
134
|
-
width:
|
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`
|
138
153
|
position: fixed;
|
139
154
|
bottom: 30px;
|
140
155
|
left: 50%;
|
156
|
+
width: auto;
|
157
|
+
max-width: 70%;
|
141
158
|
transform: translateX(-50%);
|
142
159
|
`
|
143
160
|
|
@@ -163,6 +180,7 @@
|
|
163
180
|
align-items: center;
|
164
181
|
height: 100%;
|
165
182
|
padding-right: 20px;
|
183
|
+
white-space: nowrap;
|
166
184
|
border-right: 1px solid rgba(255, 255, 255, 0.2);
|
167
185
|
`
|
168
186
|
|
@@ -171,10 +189,11 @@
|
|
171
189
|
align-items: center;
|
172
190
|
justify-content: space-between;
|
173
191
|
width: 100%;
|
192
|
+
padding: 16px;
|
174
193
|
`
|
175
194
|
|
176
195
|
const BoxTitle = styled.div`
|
177
|
-
font-size:
|
196
|
+
font-size: 13px;
|
178
197
|
color: ${(props) => props.theme.colors.white};
|
179
198
|
`
|
180
199
|
|
@@ -186,7 +205,7 @@
|
|
186
205
|
color: ${(props) => props.theme.colors.white};
|
187
206
|
border-radius: 4px;
|
188
207
|
padding: 8px 10px 8px 20px;
|
189
|
-
font-size:
|
208
|
+
font-size: 13px;
|
190
209
|
height: 40px;
|
191
210
|
`
|
192
211
|
|
@@ -194,11 +213,10 @@
|
|
194
213
|
justify-content: center;
|
195
214
|
flex-direction: column;
|
196
215
|
height: auto;
|
197
|
-
gap: 25px;
|
198
216
|
align-items: flex-start;
|
199
217
|
border-radius: 4px;
|
200
218
|
width: 400px;
|
201
|
-
padding:
|
219
|
+
padding: 0px;
|
202
220
|
`
|
203
221
|
|
204
222
|
const ButtonContainer = styled.div`
|
@@ -235,6 +253,7 @@
|
|
235
253
|
}
|
236
254
|
|
237
255
|
const ListItem = styled('div', ListAttrs)`
|
256
|
+
width: max-content;
|
238
257
|
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
239
258
|
color: ${(props) => props.disabled && props.theme.colors.grey3};
|
240
259
|
|
@@ -263,11 +282,24 @@
|
|
263
282
|
}
|
264
283
|
`
|
265
284
|
|
285
|
+
const ExpandedList = styled.div`
|
286
|
+
width: 100%;
|
287
|
+
display: flex;
|
288
|
+
flex-direction: column;
|
289
|
+
`
|
290
|
+
|
266
291
|
const ExpandedListItem = styled(ListItem)`
|
267
292
|
display: flex;
|
268
293
|
width: 100%;
|
269
294
|
justify-content: space-between;
|
270
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
|
+
}
|
271
303
|
`
|
272
304
|
|
273
305
|
const ListItemWrapper = styled.div`
|
@@ -313,6 +345,8 @@
|
|
313
345
|
EmptyText,
|
314
346
|
BoxTitle,
|
315
347
|
Divider,
|
348
|
+
DividerContainer,
|
349
|
+
ExpandedList,
|
316
350
|
},
|
317
351
|
props: {
|
318
352
|
optionsList: {
|
@@ -331,13 +365,16 @@
|
|
331
365
|
optionLimit: 4,
|
332
366
|
showOverlay: false,
|
333
367
|
expanded: false,
|
334
|
-
|
368
|
+
expandedOptions: [],
|
335
369
|
}
|
336
370
|
},
|
337
371
|
computed: {
|
338
372
|
hasComponent() {
|
339
373
|
return this.optionsList.some((item) => item.component)
|
340
374
|
},
|
375
|
+
limitedOptions() {
|
376
|
+
return this.expandedOptions.filter((option) => !option.component)
|
377
|
+
},
|
341
378
|
},
|
342
379
|
watch: {
|
343
380
|
optionsList() {
|
@@ -349,15 +386,17 @@
|
|
349
386
|
},
|
350
387
|
methods: {
|
351
388
|
initializeOptions() {
|
352
|
-
this.
|
353
|
-
.map((
|
354
|
-
|
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 }
|
355
395
|
})
|
356
|
-
.filter((item) => !item.component)
|
357
396
|
.slice(0, this.optionLimit)
|
358
397
|
},
|
359
398
|
toggleElement(type) {
|
360
|
-
this.
|
399
|
+
this.expandedOptions = this.optionsList.map((item) => {
|
361
400
|
if (item.type === type) {
|
362
401
|
item.open = !item.open
|
363
402
|
} else item.open = false
|
@@ -367,7 +406,7 @@
|
|
367
406
|
},
|
368
407
|
expandOptions() {
|
369
408
|
this.expanded = !this.expanded
|
370
|
-
this.
|
409
|
+
this.expandedOptions = this.optionsList
|
371
410
|
},
|
372
411
|
},
|
373
412
|
}
|