@eturnity/eturnity_reusable_components 7.8.6-EPDM-7951.0 → 7.10.0
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/.storybook/preview.js +1 -1
- package/package.json +23 -18
- package/src/App.vue +2 -2
- package/src/assets/svgIcons/expand.svg +1 -0
- package/src/assets/svgIcons/split.svg +94 -0
- package/src/assets/theme.js +2 -0
- package/src/components/addNewButton/index.vue +3 -5
- package/src/components/buttons/buttonIcon/index.vue +1 -1
- package/src/components/buttons/closeButton/index.vue +1 -1
- package/src/components/buttons/mainButton/index.vue +1 -6
- package/src/components/deleteIcon/DeleteIcon.stories.js +7 -7
- package/src/components/deleteIcon/index.vue +21 -25
- package/src/components/draggableInputHandle/index.vue +25 -24
- package/src/components/dropdown/index.vue +110 -129
- package/src/components/errorMessage/index.vue +1 -1
- package/src/components/filter/filterSettings.vue +97 -55
- package/src/components/filter/index.vue +3 -3
- package/src/components/filter/parentDropdown.vue +2 -2
- package/src/components/icon/iconCollection.vue +2 -2
- package/src/components/icon/index.vue +55 -57
- package/src/components/iconWrapper/index.vue +5 -2
- package/src/components/infoCard/index.vue +3 -2
- package/src/components/infoText/index.vue +6 -2
- package/src/components/inputs/checkbox/index.vue +6 -21
- package/src/components/inputs/inputNumber/index.vue +12 -8
- package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
- package/src/components/inputs/inputText/index.vue +8 -3
- package/src/components/inputs/radioButton/index.vue +1 -1
- package/src/components/inputs/searchInput/index.vue +8 -7
- package/src/components/inputs/select/index.vue +72 -213
- package/src/components/inputs/select/option/index.vue +5 -5
- package/src/components/inputs/slider/index.vue +16 -16
- package/src/components/inputs/switchField/index.vue +2 -2
- package/src/components/inputs/textAreaInput/index.vue +1 -1
- package/src/components/inputs/toggle/index.vue +2 -2
- package/src/components/label/index.vue +32 -27
- package/src/components/modals/modal/index.vue +8 -13
- package/src/components/navigationTabs/index.vue +30 -37
- package/src/components/pageSubtitle/index.vue +1 -1
- package/src/components/pageTitle/index.vue +19 -20
- package/src/components/pagination/index.vue +1 -1
- package/src/components/progressBar/index.vue +1 -1
- package/src/components/projectMarker/index.vue +7 -10
- package/src/components/sideMenu/index.vue +1 -1
- package/src/components/spinner/index.vue +11 -6
- package/src/components/tableDropdown/index.vue +26 -21
- package/src/components/tables/mainTable/exampleNested.vue +1 -1
- package/src/components/tables/mainTable/index.vue +1 -2
- package/src/components/tables/viewTable/index.vue +2 -2
- package/src/components/threeDots/index.vue +1 -1
- package/src/components/videoThumbnail/index.vue +100 -95
- package/src/main.js +11 -4
@@ -30,9 +30,7 @@
|
|
30
30
|
<select-button-wrapper :disabled="disabled">
|
31
31
|
<selectButton
|
32
32
|
ref="select"
|
33
|
-
class="select-button"
|
34
33
|
@click="toggleDropdown"
|
35
|
-
:selectWidth="selectWidth"
|
36
34
|
:selectHeight="selectHeight"
|
37
35
|
:height="height"
|
38
36
|
:selectMinHeight="selectMinHeight"
|
@@ -43,17 +41,14 @@
|
|
43
41
|
buttonFontColor || colorMode == 'dark' ? 'white' : 'black'
|
44
42
|
"
|
45
43
|
:hasError="hasError"
|
46
|
-
:
|
44
|
+
:isSearchBarVisible="isSearchBarVisible"
|
47
45
|
:disabled="disabled"
|
48
|
-
@keydown="onKeyDown"
|
46
|
+
@keydown.native="onKeyDown"
|
49
47
|
:showBorder="showBorder"
|
50
48
|
:data-id="dataId"
|
51
49
|
:isDraggable="isDraggable"
|
52
|
-
>
|
53
|
-
<draggableInputHandle
|
54
|
-
v-if="isDraggable && !isSearchBarVisible"
|
55
|
-
:height="selectHeight"
|
56
|
-
/>
|
50
|
+
>
|
51
|
+
<draggableInputHandle v-if="isDraggable && !isSearchBarVisible" :height="selectHeight" />
|
57
52
|
<inputText
|
58
53
|
v-if="isSearchBarVisible"
|
59
54
|
ref="searchInput"
|
@@ -68,9 +63,9 @@
|
|
68
63
|
:value="textSearch"
|
69
64
|
@keydown.stop="onKeyDown"
|
70
65
|
@input-change="searchChange"
|
71
|
-
@click.stop
|
66
|
+
@click.native.stop
|
72
67
|
/>
|
73
|
-
<selector
|
68
|
+
<selector v-else>
|
74
69
|
<slot name="selector" :selectedValue="selectedValue"></slot>
|
75
70
|
</selector>
|
76
71
|
<Caret @click.stop="toggleCaretDropdown">
|
@@ -96,33 +91,26 @@
|
|
96
91
|
/>
|
97
92
|
</Caret>
|
98
93
|
</selectButton>
|
99
|
-
<DropdownWrapper
|
100
|
-
<
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
:selectedValue="selectedValue"
|
120
|
-
@option-selected="optionSelected"
|
121
|
-
@option-hovered="optionHovered"
|
122
|
-
>
|
123
|
-
<slot name="dropdown"></slot>
|
124
|
-
</selectDropdown>
|
125
|
-
</Teleport>
|
94
|
+
<DropdownWrapper>
|
95
|
+
<selectDropdown
|
96
|
+
ref="dropdown"
|
97
|
+
v-show="isDropdownOpen"
|
98
|
+
:hoveredIndex="hoveredIndex"
|
99
|
+
:hoveredValue="hoveredValue"
|
100
|
+
:isActive="isActive"
|
101
|
+
:optionWidth="optionWidth"
|
102
|
+
:hoveredBgColor="colorMode == 'dark' ? '#000000' : dropdownBgColor"
|
103
|
+
:bgColor="colorMode == 'dark' ? 'black' : dropdownBgColor"
|
104
|
+
:fontColor="
|
105
|
+
dropdownFontColor || colorMode == 'dark' ? 'white' : 'black'
|
106
|
+
"
|
107
|
+
:selectedValue="selectedValue"
|
108
|
+
@option-selected="optionSelected"
|
109
|
+
@option-hovered="optionHovered"
|
110
|
+
@mouseleave="optionLeave"
|
111
|
+
>
|
112
|
+
<slot name="dropdown"></slot>
|
113
|
+
</selectDropdown>
|
126
114
|
</DropdownWrapper>
|
127
115
|
</select-button-wrapper>
|
128
116
|
</input-wrapper>
|
@@ -137,9 +125,8 @@
|
|
137
125
|
// optionWidth="50%"
|
138
126
|
// label="that is a label"
|
139
127
|
// alignItems="vertical"
|
140
|
-
// label-data-id="test-
|
128
|
+
// label-data-id="test-label0data-id"
|
141
129
|
// data-id="test-data-id"
|
142
|
-
// :hasSelectButtonPadding="false"
|
143
130
|
// >
|
144
131
|
// <template #selector="{selectedValue}">
|
145
132
|
// value selected: {{selectedValue}}
|
@@ -152,8 +139,7 @@
|
|
152
139
|
// </template>
|
153
140
|
// </Select>
|
154
141
|
|
155
|
-
import
|
156
|
-
import styled from 'vue3-styled-components'
|
142
|
+
import styled from 'vue-styled-components'
|
157
143
|
import InfoText from '../../infoText'
|
158
144
|
import icon from '../../icon'
|
159
145
|
import inputText from '../inputText'
|
@@ -166,18 +152,13 @@ const Caret = styled.div`
|
|
166
152
|
width: 30px;
|
167
153
|
min-width: 30px;
|
168
154
|
height: 100%;
|
155
|
+
align-items: stretch
|
169
156
|
cursor: pointer;
|
170
157
|
margin-left: auto;
|
171
158
|
`
|
172
159
|
|
173
|
-
const Selector = styled
|
174
|
-
|
175
|
-
props.selectWidth
|
176
|
-
? props.selectWidth
|
177
|
-
: '100%'}; // set to same width as the select
|
178
|
-
white-space: nowrap;
|
179
|
-
text-overflow: ellipsis;
|
180
|
-
overflow: hidden;
|
160
|
+
const Selector = styled.div`
|
161
|
+
width: 100%;
|
181
162
|
`
|
182
163
|
|
183
164
|
const labelAttrs = { fontSize: String, fontColor: String }
|
@@ -186,16 +167,13 @@ const InputLabel = styled('div', labelAttrs)`
|
|
186
167
|
props.theme.colors[props.fontColor]
|
187
168
|
? props.theme.colors[props.fontColor]
|
188
169
|
: props.fontColor};
|
189
|
-
font-size: ${(props) => props.fontSize};
|
170
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
190
171
|
font-weight: 700;
|
191
172
|
`
|
192
173
|
const optionalLabel = styled.span`
|
193
174
|
font-weight: 300;
|
194
175
|
`
|
195
|
-
const inputProps = {
|
196
|
-
selectWidth: String,
|
197
|
-
optionWidth: String
|
198
|
-
}
|
176
|
+
const inputProps = { selectWidth: String, optionWidth: String }
|
199
177
|
const Container = styled('div', inputProps)`
|
200
178
|
width: ${(props) => (props.selectWidth ? props.selectWidth : '100%')};
|
201
179
|
position: relative;
|
@@ -222,22 +200,19 @@ const selectButtonAttrs = {
|
|
222
200
|
hasError: Boolean,
|
223
201
|
disabled: Boolean,
|
224
202
|
selectHeight: String,
|
225
|
-
selectWidth: String,
|
226
203
|
height: String,
|
227
204
|
selectMinHeight: String,
|
228
|
-
|
205
|
+
isSearchBarVisible: Boolean,
|
229
206
|
showBorder: Boolean,
|
230
|
-
isDraggable: Boolean
|
207
|
+
isDraggable: Boolean,
|
231
208
|
}
|
232
209
|
const selectButton = styled('div', selectButtonAttrs)`
|
233
210
|
position: relative;
|
234
211
|
box-sizing: border-box;
|
235
212
|
border-radius: 4px;
|
236
|
-
padding-left
|
237
|
-
props.hasNoPadding ? '0' : props.isDraggable ? '30px' : '15px'};
|
213
|
+
padding-left:${(props) => (props.isSearchBarVisible ? '0' : props.isDraggable?'30px':'15px')};
|
238
214
|
text-align: left;
|
239
215
|
border-radius: 4px;
|
240
|
-
max-width: ${(props) => (props.selectWidth ? props.selectWidth : '100%')};
|
241
216
|
min-height: ${(props) =>
|
242
217
|
props.selectHeight
|
243
218
|
? props.selectHeight
|
@@ -248,7 +223,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
248
223
|
: '36px'};
|
249
224
|
display: flex;
|
250
225
|
align-items: center;
|
251
|
-
height: ${(props) => props.selectHeight};
|
226
|
+
max-height: ${(props) => props.selectHeight};
|
252
227
|
${({ showBorder, theme, hasError }) =>
|
253
228
|
showBorder &&
|
254
229
|
`
|
@@ -266,10 +241,8 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
266
241
|
: props.fontColor};
|
267
242
|
${(props) => (props.disabled ? 'pointer-events: none' : '')};
|
268
243
|
overflow: hidden;
|
269
|
-
&
|
270
|
-
border-right
|
271
|
-
props.hasError ? props.theme.colors.red : props.theme.colors.grey4}
|
272
|
-
1px solid;
|
244
|
+
& >.handle{
|
245
|
+
border-right:${(props) =>props.hasError ? props.theme.colors.red : props.theme.colors.grey4} 1px solid;
|
273
246
|
}
|
274
247
|
`
|
275
248
|
const selectDropdownAttrs = {
|
@@ -279,17 +252,14 @@ const selectDropdownAttrs = {
|
|
279
252
|
selectWidth: String,
|
280
253
|
optionWidth: String,
|
281
254
|
hoveredIndex: Number,
|
282
|
-
fontSize: String,
|
283
|
-
dropdownPosition: Object,
|
284
255
|
hoveredValue: Number | String,
|
285
256
|
selectedValue: Number | String
|
286
257
|
}
|
287
258
|
const selectDropdown = styled('div', selectDropdownAttrs)`
|
288
259
|
box-sizing: border-box;
|
289
|
-
z-index:${(props) => (props.isActive ? '2' : '
|
290
|
-
position:
|
291
|
-
top:
|
292
|
-
left: ${(props) => props.dropdownPosition?.left}px;
|
260
|
+
z-index:${(props) => (props.isActive ? '2' : '1')};
|
261
|
+
position:absolute;
|
262
|
+
top:5px;
|
293
263
|
border:1px solid ${(props) => props.theme.colors.grey4}
|
294
264
|
border-radius:4px;
|
295
265
|
display: flex;
|
@@ -297,7 +267,7 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
297
267
|
align-items: flex-start;
|
298
268
|
padding: 0px;
|
299
269
|
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
300
|
-
width: ${(props) => props.optionWidth};
|
270
|
+
width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
|
301
271
|
background-color:${(props) =>
|
302
272
|
props.theme.colors[props.bgColor]
|
303
273
|
? props.theme.colors[props.bgColor]
|
@@ -314,9 +284,7 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
314
284
|
? props.theme.colors[props.hoveredBgColor]
|
315
285
|
: props.hoveredBgColor};
|
316
286
|
}
|
317
|
-
font-size: ${(props) => props.fontSize}
|
318
287
|
`
|
319
|
-
selectDropdown.emits = ['option-hovered', 'option-selected']
|
320
288
|
const DropdownWrapper = styled('div')`
|
321
289
|
position: relative;
|
322
290
|
`
|
@@ -329,10 +297,6 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
329
297
|
grid-template-columns: ${(props) =>
|
330
298
|
props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
|
331
299
|
`
|
332
|
-
|
333
|
-
const DROPDOWN_HEIGHT_OFFSET = 4
|
334
|
-
const DROPDOWN_TOP_OFFSET = 21
|
335
|
-
|
336
300
|
export default {
|
337
301
|
name: 'RCselect',
|
338
302
|
|
@@ -343,7 +307,7 @@ export default {
|
|
343
307
|
},
|
344
308
|
fontSize: {
|
345
309
|
required: false,
|
346
|
-
default:
|
310
|
+
default: null
|
347
311
|
},
|
348
312
|
label: {
|
349
313
|
required: false
|
@@ -446,10 +410,6 @@ export default {
|
|
446
410
|
type: String,
|
447
411
|
default: ''
|
448
412
|
},
|
449
|
-
hasSelectButtonPadding: {
|
450
|
-
type: Boolean,
|
451
|
-
default: true
|
452
|
-
},
|
453
413
|
isDraggable: {
|
454
414
|
type: Boolean,
|
455
415
|
default: false
|
@@ -471,7 +431,6 @@ export default {
|
|
471
431
|
Caret,
|
472
432
|
Selector,
|
473
433
|
inputText,
|
474
|
-
Teleport,
|
475
434
|
draggableInputHandle
|
476
435
|
},
|
477
436
|
|
@@ -482,38 +441,23 @@ export default {
|
|
482
441
|
isActive: false,
|
483
442
|
textSearch: '',
|
484
443
|
hoveredIndex: 0,
|
485
|
-
|
486
|
-
|
487
|
-
left: null,
|
488
|
-
top: null
|
489
|
-
},
|
490
|
-
dropdownWidth: null,
|
491
|
-
hoveredValue: null
|
444
|
+
hoveredValue: null,
|
445
|
+
isClickOutsideActive: false
|
492
446
|
}
|
493
447
|
},
|
494
448
|
mounted() {
|
495
|
-
this.observeDropdownHeight()
|
496
|
-
this.observeSelectWidth()
|
497
|
-
window.addEventListener('resize', this.handleSetDropdownOffet)
|
498
|
-
},
|
499
|
-
beforeMount() {
|
500
449
|
this.selectedValue = this.value
|
501
450
|
document.addEventListener('click', this.clickOutside)
|
502
|
-
this.getDropdownPosition()
|
503
|
-
window.removeEventListener('resize', this.handleSetDropdownOffet)
|
504
|
-
if (this.dropdownResizeObserver) this.dropdownResizeObserver.disconnect()
|
505
|
-
if (this.selectResizeObserver) this.selectResizeObserver.disconnect()
|
506
451
|
},
|
507
|
-
|
452
|
+
beforeDestroy() {
|
508
453
|
document.removeEventListener('click', this.clickOutside)
|
509
454
|
},
|
510
455
|
methods: {
|
511
456
|
focus() {
|
512
457
|
this.isActive = true
|
513
458
|
},
|
514
|
-
blur(
|
459
|
+
blur() {
|
515
460
|
this.isActive = false
|
516
|
-
this.$emit('blur', e)
|
517
461
|
},
|
518
462
|
toggleDropdown() {
|
519
463
|
this.isDropdownOpen = !this.isDropdownOpen
|
@@ -529,9 +473,6 @@ export default {
|
|
529
473
|
this.blur()
|
530
474
|
this.isDropdownOpen = false
|
531
475
|
},
|
532
|
-
clearSearch() {
|
533
|
-
this.textSearch = ''
|
534
|
-
},
|
535
476
|
optionSelected(e) {
|
536
477
|
this.selectedValue = e
|
537
478
|
this.closeDropdown()
|
@@ -560,15 +501,15 @@ export default {
|
|
560
501
|
searchChange(value) {
|
561
502
|
this.textSearch = value
|
562
503
|
this.$emit('search-change', value)
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
el.
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
504
|
+
this.$refs.dropdown.$children
|
505
|
+
.map((component) => component.$el)
|
506
|
+
.forEach((el) => {
|
507
|
+
if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
|
508
|
+
el.style.display = 'none'
|
509
|
+
} else {
|
510
|
+
el.style.display = 'inherit'
|
511
|
+
}
|
512
|
+
})
|
572
513
|
},
|
573
514
|
onSelectSlotClick() {
|
574
515
|
this.toggleDropdown()
|
@@ -581,7 +522,6 @@ export default {
|
|
581
522
|
if (
|
582
523
|
this.$refs.select.$el == event.target ||
|
583
524
|
this.$refs.select.$el.contains(event.target) ||
|
584
|
-
event.target.id === 'more-button' ||
|
585
525
|
event.target.parentNode === dropdownRef.$el
|
586
526
|
) {
|
587
527
|
return
|
@@ -595,92 +535,13 @@ export default {
|
|
595
535
|
} else if (e.key == 'ArrowUp') {
|
596
536
|
this.onArrowPress(-1)
|
597
537
|
} else if (e.key == 'Enter') {
|
598
|
-
const optionHoveredComponent =
|
599
|
-
|
600
|
-
|
538
|
+
const optionHoveredComponent =
|
539
|
+
this.$refs.dropdown.$children[
|
540
|
+
(this.hoveredIndex - 1 + this.optionLength) % this.optionLength
|
541
|
+
]
|
601
542
|
this.optionSelected(optionHoveredComponent.$el.dataset.value)
|
602
543
|
}
|
603
544
|
},
|
604
|
-
// If some part of the dropdown menu is outside viewport of the bottom of the screen,
|
605
|
-
// we need to offset it and display it at the top of the select dropdown instead
|
606
|
-
async getDropdownPosition() {
|
607
|
-
if (
|
608
|
-
!this.$refs.dropdownWrapperRef ||
|
609
|
-
!this.$refs.select ||
|
610
|
-
!this.$refs.dropdown
|
611
|
-
) {
|
612
|
-
return
|
613
|
-
}
|
614
|
-
await this.$nextTick()
|
615
|
-
const isDisplayedAtBottom = await this.generateDropdownPosition()
|
616
|
-
await this.$nextTick()
|
617
|
-
// If the dropdown menu is going to be displayed at the bottom,
|
618
|
-
// we need reverify its position after a dom update (nextTick)
|
619
|
-
if (isDisplayedAtBottom) this.generateDropdownPosition()
|
620
|
-
},
|
621
|
-
async generateDropdownPosition() {
|
622
|
-
const isDropdownNotCompletelyVisible =
|
623
|
-
await this.isBottomOfDropdownOutOfViewport()
|
624
|
-
const dropdownWrapperEl = this.$refs.dropdownWrapperRef.$el
|
625
|
-
const selectButtonHeight = this.$refs.select.$el.clientHeight
|
626
|
-
const dropdownHeight = this.$refs.dropdown.$el.clientHeight
|
627
|
-
const dropdownWrapperRelativeHeight =
|
628
|
-
dropdownWrapperEl.getBoundingClientRect().top +
|
629
|
-
window.scrollY +
|
630
|
-
DROPDOWN_HEIGHT_OFFSET
|
631
|
-
|
632
|
-
const top = isDropdownNotCompletelyVisible
|
633
|
-
? dropdownWrapperRelativeHeight
|
634
|
-
: dropdownWrapperRelativeHeight -
|
635
|
-
dropdownHeight -
|
636
|
-
selectButtonHeight -
|
637
|
-
DROPDOWN_TOP_OFFSET
|
638
|
-
const left = this.dropdownPosition.left
|
639
|
-
? this.dropdownPosition.left
|
640
|
-
: dropdownWrapperEl.getBoundingClientRect().left + window.scrollX
|
641
|
-
|
642
|
-
this.dropdownPosition = { left: Math.floor(left), top: Math.floor(top) }
|
643
|
-
|
644
|
-
return isDropdownNotCompletelyVisible
|
645
|
-
},
|
646
|
-
async isBottomOfDropdownOutOfViewport() {
|
647
|
-
if (!this.$refs.dropdown) {
|
648
|
-
return false
|
649
|
-
}
|
650
|
-
await this.$nextTick()
|
651
|
-
const rect = this.$refs.dropdown.$el.getBoundingClientRect()
|
652
|
-
const windowHeight =
|
653
|
-
window.innerHeight || document.documentElement.clientHeight
|
654
|
-
|
655
|
-
// using Math.floor because the offsets may contain decimals we are not going to consider here
|
656
|
-
return Math.floor(rect.top) + Math.floor(rect.height) <= windowHeight
|
657
|
-
},
|
658
|
-
observeDropdownHeight() {
|
659
|
-
if (!this.$refs.dropdown) return
|
660
|
-
this.dropdownResizeObserver = new ResizeObserver(() => {
|
661
|
-
this.$nextTick(() => this.getDropdownPosition())
|
662
|
-
})
|
663
|
-
this.dropdownResizeObserver.observe(this.$refs.dropdown.$el)
|
664
|
-
},
|
665
|
-
handleSetDropdownOffet() {
|
666
|
-
if (!this.$refs.select) return
|
667
|
-
this.dropdownPosition.left = Math.floor(
|
668
|
-
this.$refs.select.$el.getBoundingClientRect().left
|
669
|
-
)
|
670
|
-
this.getDropdownWidth()
|
671
|
-
},
|
672
|
-
observeSelectWidth() {
|
673
|
-
if (!this.$refs.select) return
|
674
|
-
this.selectResizeObserver = new ResizeObserver(() =>
|
675
|
-
this.$nextTick(() => this.getDropdownWidth())
|
676
|
-
)
|
677
|
-
this.selectResizeObserver.observe(this.$refs.dropdown.$el)
|
678
|
-
},
|
679
|
-
async getDropdownWidth() {
|
680
|
-
if (!this.$refs.select) return
|
681
|
-
await this.$nextTick()
|
682
|
-
this.dropdownWidth = `${this.$refs.select.$el.clientWidth}px`
|
683
|
-
},
|
684
545
|
onArrowPress(dir) {
|
685
546
|
let newHoveredElem
|
686
547
|
const currentHoveredElem = this.$refs.dropdown.$el.querySelector(
|
@@ -703,36 +564,34 @@ export default {
|
|
703
564
|
computed: {
|
704
565
|
optionLength() {
|
705
566
|
if (this.isDropdownOpen) {
|
706
|
-
|
567
|
+
// this filterRef is needed to check for the # of children on Filter dropdowns
|
568
|
+
const filterRef =
|
569
|
+
this.$refs.dropdown.$children &&
|
570
|
+
this.$refs.dropdown.$children.length > 1
|
571
|
+
? this.$refs.dropdown.$children
|
572
|
+
: this.$refs.dropdown.$children[0].$children
|
573
|
+
? this.$refs.dropdown.$children[0].$children
|
574
|
+
: this.$refs.dropdown.$children
|
575
|
+
return filterRef.length
|
707
576
|
} else {
|
708
577
|
return 0
|
709
578
|
}
|
710
579
|
},
|
711
580
|
isSearchBarVisible() {
|
712
581
|
return this.isSearchable && this.optionLength >= 5 && this.isDropdownOpen
|
713
|
-
},
|
714
|
-
getOptionWidth() {
|
715
|
-
if (this.optionWidth) return this.optionWidth
|
716
|
-
|
717
|
-
return this.dropdownWidth
|
718
|
-
},
|
719
|
-
isSelectDropdownShown() {
|
720
|
-
return this.isDropdownOpen && this.dropdownPosition.left !== null
|
721
582
|
}
|
722
583
|
},
|
723
584
|
watch: {
|
724
585
|
value(val) {
|
725
586
|
this.selectedValue = val
|
726
587
|
},
|
727
|
-
|
588
|
+
isDropdownOpen(val) {
|
589
|
+
this.$emit('is-dropdown-open', val)
|
728
590
|
if (val) {
|
729
591
|
setTimeout(() => {
|
730
592
|
this.isClickOutsideActive = true
|
731
593
|
}, 10)
|
732
|
-
await this.$nextTick()
|
733
|
-
this.handleSetDropdownOffet()
|
734
594
|
} else {
|
735
|
-
this.dropdownPosition.left = null
|
736
595
|
setTimeout(() => {
|
737
596
|
this.isClickOutsideActive = false
|
738
597
|
}, 10)
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<script>
|
23
23
|
// import selectButton from './selectButton'
|
24
24
|
// import selectDropdown from './selectDropDown'
|
25
|
-
import styled from '
|
25
|
+
import styled from 'vue-styled-components'
|
26
26
|
const optionProps = {
|
27
27
|
isDisabled: Boolean,
|
28
28
|
hoveredBgColor: String,
|
@@ -59,7 +59,7 @@ const optionContainer = styled('div', optionProps)`
|
|
59
59
|
|
60
60
|
export default {
|
61
61
|
name: 'RCoption',
|
62
|
-
|
62
|
+
|
63
63
|
props: {
|
64
64
|
value: {
|
65
65
|
required: true
|
@@ -73,7 +73,7 @@ export default {
|
|
73
73
|
},
|
74
74
|
cursorType: {
|
75
75
|
required: false,
|
76
|
-
default: '
|
76
|
+
default: 'cursor'
|
77
77
|
},
|
78
78
|
backgroundColor: {
|
79
79
|
required: false,
|
@@ -94,12 +94,12 @@ export default {
|
|
94
94
|
return {}
|
95
95
|
},
|
96
96
|
methods: {
|
97
|
-
clickHandler(
|
97
|
+
clickHandler() {
|
98
98
|
if (this.isDisabled) {
|
99
99
|
// prevent emitter if the option is disabled
|
100
100
|
return
|
101
101
|
} else {
|
102
|
-
this.$parent.$emit('option-selected', this.value
|
102
|
+
this.$parent.$emit('option-selected', this.value)
|
103
103
|
}
|
104
104
|
},
|
105
105
|
hoverHandler() {
|
@@ -21,8 +21,8 @@
|
|
21
21
|
// :minValue="10" //default is 0 if not specified
|
22
22
|
// :maxValue="500" //default is 100 if not specified
|
23
23
|
// />
|
24
|
-
import Slider from
|
25
|
-
import styled from
|
24
|
+
import Slider from "@vueform/slider/dist/slider.vue2.js"
|
25
|
+
import styled from "vue-styled-components"
|
26
26
|
|
27
27
|
const Container = styled.div`
|
28
28
|
margin: 16px 0 16px 21px;
|
@@ -81,45 +81,45 @@ const NumberText = styled.div`
|
|
81
81
|
`
|
82
82
|
|
83
83
|
export default {
|
84
|
-
name:
|
84
|
+
name: "slider",
|
85
85
|
components: {
|
86
86
|
Slider,
|
87
87
|
Container,
|
88
|
-
NumberText
|
88
|
+
NumberText,
|
89
89
|
},
|
90
90
|
props: {
|
91
91
|
value: {
|
92
92
|
required: false,
|
93
|
-
default: 0
|
93
|
+
default: 0,
|
94
94
|
},
|
95
95
|
unit: {
|
96
96
|
required: false,
|
97
|
-
default:
|
97
|
+
default: "",
|
98
98
|
},
|
99
99
|
minValue: {
|
100
100
|
required: false,
|
101
|
-
default: 0
|
101
|
+
default: 0,
|
102
102
|
},
|
103
103
|
maxValue: {
|
104
104
|
required: false,
|
105
|
-
default: 100
|
106
|
-
}
|
105
|
+
default: 100,
|
106
|
+
},
|
107
107
|
},
|
108
108
|
methods: {
|
109
109
|
onChange(value) {
|
110
|
-
this.$emit(
|
111
|
-
}
|
110
|
+
this.$emit("change", value)
|
111
|
+
},
|
112
112
|
},
|
113
113
|
mounted() {
|
114
114
|
// This is to add the 3 white lines to the slider button
|
115
|
-
let slider = document.querySelector(
|
116
|
-
let span1 = document.createElement(
|
117
|
-
let span2 = document.createElement(
|
118
|
-
let span3 = document.createElement(
|
115
|
+
let slider = document.querySelector(".slider-touch-area")
|
116
|
+
let span1 = document.createElement("span")
|
117
|
+
let span2 = document.createElement("span")
|
118
|
+
let span3 = document.createElement("span")
|
119
119
|
slider.appendChild(span1)
|
120
120
|
slider.appendChild(span2)
|
121
121
|
slider.appendChild(span3)
|
122
|
-
}
|
122
|
+
},
|
123
123
|
}
|
124
124
|
</script>
|
125
125
|
|
@@ -48,7 +48,7 @@
|
|
48
48
|
>
|
49
49
|
<label-text :size="size" :fontColor="fontColor">{{ label }}</label-text>
|
50
50
|
<info-text
|
51
|
-
@click.stop
|
51
|
+
@click.native.stop
|
52
52
|
v-if="infoTextMessage"
|
53
53
|
:text="infoTextMessage"
|
54
54
|
borderColor="#ccc"
|
@@ -76,7 +76,7 @@
|
|
76
76
|
// :disabled="false"
|
77
77
|
// />
|
78
78
|
|
79
|
-
import styled from '
|
79
|
+
import styled from 'vue-styled-components'
|
80
80
|
import InfoText from '../../infoText'
|
81
81
|
import theme from '../../../assets/theme'
|
82
82
|
const Container = styled.div``
|
@@ -47,7 +47,7 @@
|
|
47
47
|
>
|
48
48
|
<label-text :size="size" :fontColor="fontColor">{{ label }}</label-text>
|
49
49
|
<info-text
|
50
|
-
@click.stop
|
50
|
+
@click.native.stop
|
51
51
|
v-if="infoTextMessage"
|
52
52
|
:text="infoTextMessage"
|
53
53
|
borderColor="#ccc"
|
@@ -77,7 +77,7 @@
|
|
77
77
|
// data-id="test_data_id"
|
78
78
|
// />
|
79
79
|
|
80
|
-
import styled from '
|
80
|
+
import styled from 'vue-styled-components'
|
81
81
|
import InfoText from '../../infoText'
|
82
82
|
|
83
83
|
const Container = styled.div`
|