@eturnity/eturnity_reusable_components 7.12.7-EPDM-10335.0 → 7.12.7-EPDM-10528.1
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 -19
- package/src/App.vue +2 -2
- package/src/assets/svgIcons/charger_icon_white.svg +44 -0
- package/src/assets/svgIcons/energy_meter.svg +12 -0
- package/src/assets/svgIcons/house_3d-1.svg +8 -0
- package/src/assets/svgIcons/house_3d.svg +8 -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 +8 -7
- package/src/components/card/index.vue +95 -0
- 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 +5 -10
- package/src/components/filter/filterSettings.vue +97 -58
- 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 +77 -67
- package/src/components/iconWrapper/index.vue +4 -1
- package/src/components/infoCard/index.vue +3 -2
- package/src/components/infoText/index.vue +1 -1
- package/src/components/inputs/checkbox/index.vue +6 -21
- package/src/components/inputs/inputNumber/index.vue +11 -8
- package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
- package/src/components/inputs/inputText/index.vue +3 -3
- package/src/components/inputs/radioButton/index.vue +1 -1
- package/src/components/inputs/searchInput/index.vue +11 -28
- package/src/components/inputs/select/index.vue +67 -195
- package/src/components/inputs/select/option/index.vue +11 -36
- 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 +31 -27
- package/src/components/modals/modal/index.vue +6 -2
- package/src/components/navigationTabs/index.vue +20 -27
- package/src/components/pageSubtitle/index.vue +1 -1
- package/src/components/pageTitle/index.vue +4 -4
- package/src/components/pagination/index.vue +1 -1
- package/src/components/progressBar/index.vue +1 -1
- package/src/components/projectMarker/index.vue +9 -16
- package/src/components/sideMenu/index.vue +1 -1
- package/src/components/spinner/index.vue +11 -7
- package/src/components/tableDropdown/index.vue +37 -30
- package/src/components/tables/mainTable/exampleNested.vue +1 -1
- package/src/components/tables/mainTable/index.vue +9 -10
- 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
- package/src/components/icon/iconCache.js +0 -23
@@ -28,9 +28,7 @@
|
|
28
28
|
<select-button-wrapper :disabled="disabled">
|
29
29
|
<selectButton
|
30
30
|
ref="select"
|
31
|
-
class="select-button"
|
32
31
|
@click="toggleDropdown"
|
33
|
-
:selectWidth="selectWidth"
|
34
32
|
:selectHeight="selectHeight"
|
35
33
|
:height="height"
|
36
34
|
:selectMinHeight="selectMinHeight"
|
@@ -41,9 +39,9 @@
|
|
41
39
|
buttonFontColor || colorMode == 'dark' ? 'white' : 'black'
|
42
40
|
"
|
43
41
|
:hasError="hasError"
|
44
|
-
:
|
42
|
+
:isSearchBarVisible="isSearchBarVisible"
|
45
43
|
:disabled="disabled"
|
46
|
-
@keydown="onKeyDown"
|
44
|
+
@keydown.native="onKeyDown"
|
47
45
|
:showBorder="showBorder"
|
48
46
|
:data-id="dataId"
|
49
47
|
:paddingLeft="paddingLeft"
|
@@ -66,7 +64,7 @@
|
|
66
64
|
:value="textSearch"
|
67
65
|
@keydown.stop="onKeyDown"
|
68
66
|
@input-change="searchChange"
|
69
|
-
@click.stop
|
67
|
+
@click.native.stop
|
70
68
|
/>
|
71
69
|
<selector
|
72
70
|
v-else
|
@@ -99,33 +97,28 @@
|
|
99
97
|
/>
|
100
98
|
</Caret>
|
101
99
|
</selectButton>
|
102
|
-
<DropdownWrapper
|
103
|
-
<
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
:
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
@option-hovered="optionHovered"
|
125
|
-
>
|
126
|
-
<slot name="dropdown"></slot>
|
127
|
-
</selectDropdown>
|
128
|
-
</Teleport>
|
100
|
+
<DropdownWrapper>
|
101
|
+
<selectDropdown
|
102
|
+
ref="dropdown"
|
103
|
+
v-show="isDropdownOpen"
|
104
|
+
:position="dropdownPosition"
|
105
|
+
:offset="dropdownOffset"
|
106
|
+
:hoveredIndex="hoveredIndex"
|
107
|
+
:hoveredValue="hoveredValue"
|
108
|
+
:isActive="isActive"
|
109
|
+
:optionWidth="optionWidth"
|
110
|
+
:hoveredBgColor="colorMode == 'dark' ? '#000000' : dropdownBgColor"
|
111
|
+
:bgColor="colorMode == 'dark' ? 'black' : dropdownBgColor"
|
112
|
+
:fontColor="
|
113
|
+
dropdownFontColor || colorMode == 'dark' ? 'white' : 'black'
|
114
|
+
"
|
115
|
+
:selectedValue="selectedValue"
|
116
|
+
@option-selected="optionSelected"
|
117
|
+
@option-hovered="optionHovered"
|
118
|
+
@mouseleave="optionLeave"
|
119
|
+
>
|
120
|
+
<slot name="dropdown"></slot>
|
121
|
+
</selectDropdown>
|
129
122
|
</DropdownWrapper>
|
130
123
|
</select-button-wrapper>
|
131
124
|
</input-wrapper>
|
@@ -140,9 +133,8 @@
|
|
140
133
|
// optionWidth="50%"
|
141
134
|
// label="that is a label"
|
142
135
|
// alignItems="vertical"
|
143
|
-
// label-data-id="test-
|
136
|
+
// label-data-id="test-label0data-id"
|
144
137
|
// data-id="test-data-id"
|
145
|
-
// :hasSelectButtonPadding="false"
|
146
138
|
// >
|
147
139
|
// <template #selector="{selectedValue}">
|
148
140
|
// value selected: {{selectedValue}}
|
@@ -155,8 +147,7 @@
|
|
155
147
|
// </template>
|
156
148
|
// </Select>
|
157
149
|
|
158
|
-
import
|
159
|
-
import styled from 'vue3-styled-components'
|
150
|
+
import styled from 'vue-styled-components'
|
160
151
|
import InfoText from '../../infoText'
|
161
152
|
import icon from '../../icon'
|
162
153
|
import inputText from '../inputText'
|
@@ -172,7 +163,7 @@ const Caret = styled.div`
|
|
172
163
|
width: ${CARET_WIDTH};
|
173
164
|
min-width: ${CARET_WIDTH};
|
174
165
|
height: 100%;
|
175
|
-
align-items:
|
166
|
+
align-items: stretch;
|
176
167
|
cursor: pointer;
|
177
168
|
margin-left: auto;
|
178
169
|
`
|
@@ -210,10 +201,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
210
201
|
const optionalLabel = styled.span`
|
211
202
|
font-weight: 300;
|
212
203
|
`
|
213
|
-
const inputProps = {
|
214
|
-
selectWidth: String,
|
215
|
-
optionWidth: String
|
216
|
-
}
|
204
|
+
const inputProps = { selectWidth: String, optionWidth: String }
|
217
205
|
const Container = styled('div', inputProps)`
|
218
206
|
width: ${(props) => props.selectWidth};
|
219
207
|
position: relative;
|
@@ -240,10 +228,9 @@ const selectButtonAttrs = {
|
|
240
228
|
hasError: Boolean,
|
241
229
|
disabled: Boolean,
|
242
230
|
selectHeight: String,
|
243
|
-
selectWidth: String,
|
244
231
|
height: String,
|
245
232
|
selectMinHeight: String,
|
246
|
-
|
233
|
+
isSearchBarVisible: Boolean,
|
247
234
|
showBorder: Boolean,
|
248
235
|
paddingLeft: String
|
249
236
|
}
|
@@ -251,9 +238,8 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
251
238
|
position: relative;
|
252
239
|
box-sizing: border-box;
|
253
240
|
border-radius: 4px;
|
254
|
-
max-width: ${(props) => (props.selectWidth ? props.selectWidth : '100%')};
|
255
241
|
${(props) =>
|
256
|
-
props.
|
242
|
+
props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}`};
|
257
243
|
text-align: left;
|
258
244
|
min-height: ${(props) =>
|
259
245
|
props.selectHeight
|
@@ -265,7 +251,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
265
251
|
: '36px'};
|
266
252
|
display: flex;
|
267
253
|
align-items: center;
|
268
|
-
height: ${(props) => props.selectHeight};
|
254
|
+
max-height: ${(props) => props.selectHeight};
|
269
255
|
${({ showBorder, theme, hasError }) =>
|
270
256
|
showBorder &&
|
271
257
|
`
|
@@ -297,17 +283,18 @@ const selectDropdownAttrs = {
|
|
297
283
|
fontColor: String,
|
298
284
|
optionWidth: String,
|
299
285
|
hoveredIndex: Number,
|
300
|
-
fontSize: String,
|
301
|
-
dropdownPosition: Object,
|
302
286
|
hoveredValue: Number | String,
|
303
|
-
selectedValue: Number | String
|
287
|
+
selectedValue: Number | String,
|
288
|
+
position: String,
|
289
|
+
offset: String
|
304
290
|
}
|
305
291
|
const selectDropdown = styled('div', selectDropdownAttrs)`
|
306
292
|
box-sizing: border-box;
|
307
|
-
z-index: ${(props) => (props.isActive ? '2' : '
|
293
|
+
z-index: ${(props) => (props.isActive ? '2' : '1')};
|
308
294
|
position: absolute;
|
309
|
-
top: ${(props) => props.
|
310
|
-
|
295
|
+
top: ${(props) => (props.position === 'bottom' ? props.offset : 'auto')};
|
296
|
+
bottom: ${(props) =>
|
297
|
+
props.position === 'top' ? `calc(100% + ${props.offset})` : 'auto'};
|
311
298
|
border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
|
312
299
|
border-radius: 4px;
|
313
300
|
display: flex;
|
@@ -332,9 +319,7 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
332
319
|
? props.theme.colors[props.hoveredBgColor]
|
333
320
|
: props.hoveredBgColor};
|
334
321
|
}
|
335
|
-
font-size: ${(props) => props.fontSize};
|
336
322
|
`
|
337
|
-
selectDropdown.emits = ['option-hovered', 'option-selected']
|
338
323
|
const DropdownWrapper = styled('div')`
|
339
324
|
position: relative;
|
340
325
|
`
|
@@ -347,10 +332,6 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
347
332
|
grid-template-columns: ${(props) =>
|
348
333
|
props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
|
349
334
|
`
|
350
|
-
|
351
|
-
const DROPDOWN_HEIGHT_OFFSET = 4
|
352
|
-
const DROPDOWN_TOP_OFFSET = 21
|
353
|
-
|
354
335
|
export default {
|
355
336
|
name: 'RCselect',
|
356
337
|
|
@@ -417,6 +398,14 @@ export default {
|
|
417
398
|
buttonFontColor: {
|
418
399
|
required: false
|
419
400
|
},
|
401
|
+
dropdownPosition: {
|
402
|
+
required: false,
|
403
|
+
default: 'bottom'
|
404
|
+
},
|
405
|
+
dropdownOffset: {
|
406
|
+
required: false,
|
407
|
+
default: '5px'
|
408
|
+
},
|
420
409
|
dropdownBgColor: {
|
421
410
|
required: false,
|
422
411
|
default: 'grey5'
|
@@ -462,10 +451,6 @@ export default {
|
|
462
451
|
type: String,
|
463
452
|
default: ''
|
464
453
|
},
|
465
|
-
hasSelectButtonPadding: {
|
466
|
-
type: Boolean,
|
467
|
-
default: true
|
468
|
-
},
|
469
454
|
isDraggable: {
|
470
455
|
type: Boolean,
|
471
456
|
default: false
|
@@ -487,7 +472,6 @@ export default {
|
|
487
472
|
Caret,
|
488
473
|
Selector,
|
489
474
|
inputText,
|
490
|
-
Teleport,
|
491
475
|
draggableInputHandle
|
492
476
|
},
|
493
477
|
|
@@ -499,38 +483,23 @@ export default {
|
|
499
483
|
isActive: false,
|
500
484
|
textSearch: '',
|
501
485
|
hoveredIndex: 0,
|
502
|
-
|
503
|
-
|
504
|
-
left: null,
|
505
|
-
top: null
|
506
|
-
},
|
507
|
-
dropdownWidth: null,
|
508
|
-
hoveredValue: null
|
486
|
+
hoveredValue: null,
|
487
|
+
isClickOutsideActive: false
|
509
488
|
}
|
510
489
|
},
|
511
490
|
mounted() {
|
512
|
-
this.observeDropdownHeight()
|
513
|
-
this.observeSelectWidth()
|
514
|
-
window.addEventListener('resize', this.handleSetDropdownOffet)
|
515
|
-
},
|
516
|
-
beforeMount() {
|
517
491
|
this.selectedValue = this.value
|
518
492
|
document.addEventListener('click', this.clickOutside)
|
519
|
-
this.getDropdownPosition()
|
520
|
-
window.removeEventListener('resize', this.handleSetDropdownOffet)
|
521
|
-
if (this.dropdownResizeObserver) this.dropdownResizeObserver.disconnect()
|
522
|
-
if (this.selectResizeObserver) this.selectResizeObserver.disconnect()
|
523
493
|
},
|
524
|
-
|
494
|
+
beforeDestroy() {
|
525
495
|
document.removeEventListener('click', this.clickOutside)
|
526
496
|
},
|
527
497
|
methods: {
|
528
498
|
focus() {
|
529
499
|
this.isActive = true
|
530
500
|
},
|
531
|
-
blur(
|
501
|
+
blur() {
|
532
502
|
this.isActive = false
|
533
|
-
this.$emit('blur', e)
|
534
503
|
},
|
535
504
|
toggleDropdown() {
|
536
505
|
this.isDropdownOpen = !this.isDropdownOpen
|
@@ -546,9 +515,6 @@ export default {
|
|
546
515
|
this.blur()
|
547
516
|
this.isDropdownOpen = false
|
548
517
|
},
|
549
|
-
clearSearch() {
|
550
|
-
this.textSearch = ''
|
551
|
-
},
|
552
518
|
optionSelected(e) {
|
553
519
|
this.selectedValue = e
|
554
520
|
this.closeDropdown()
|
@@ -577,15 +543,15 @@ export default {
|
|
577
543
|
searchChange(value) {
|
578
544
|
this.textSearch = value
|
579
545
|
this.$emit('search-change', value)
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
el.
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
546
|
+
this.$refs.dropdown.$children
|
547
|
+
.map((component) => component.$el)
|
548
|
+
.forEach((el) => {
|
549
|
+
if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
|
550
|
+
el.style.display = 'none'
|
551
|
+
} else {
|
552
|
+
el.style.display = 'inherit'
|
553
|
+
}
|
554
|
+
})
|
589
555
|
},
|
590
556
|
clickOutside(event) {
|
591
557
|
const dropdownRef = this.$refs.dropdown
|
@@ -595,7 +561,6 @@ export default {
|
|
595
561
|
if (
|
596
562
|
this.$refs.select.$el == event.target ||
|
597
563
|
this.$refs.select.$el.contains(event.target) ||
|
598
|
-
event.target.id === 'more-button' ||
|
599
564
|
event.target.parentNode === dropdownRef.$el
|
600
565
|
) {
|
601
566
|
return
|
@@ -609,92 +574,13 @@ export default {
|
|
609
574
|
} else if (e.key == 'ArrowUp') {
|
610
575
|
this.onArrowPress(-1)
|
611
576
|
} else if (e.key == 'Enter') {
|
612
|
-
const optionHoveredComponent =
|
613
|
-
|
614
|
-
|
577
|
+
const optionHoveredComponent =
|
578
|
+
this.$refs.dropdown.$children[
|
579
|
+
(this.hoveredIndex - 1 + this.optionLength) % this.optionLength
|
580
|
+
]
|
615
581
|
this.optionSelected(optionHoveredComponent.$el.dataset.value)
|
616
582
|
}
|
617
583
|
},
|
618
|
-
// If some part of the dropdown menu is outside viewport of the bottom of the screen,
|
619
|
-
// we need to offset it and display it at the top of the select dropdown instead
|
620
|
-
async getDropdownPosition() {
|
621
|
-
if (
|
622
|
-
!this.$refs.dropdownWrapperRef ||
|
623
|
-
!this.$refs.select ||
|
624
|
-
!this.$refs.dropdown
|
625
|
-
) {
|
626
|
-
return
|
627
|
-
}
|
628
|
-
await this.$nextTick()
|
629
|
-
const isDisplayedAtBottom = await this.generateDropdownPosition()
|
630
|
-
await this.$nextTick()
|
631
|
-
// If the dropdown menu is going to be displayed at the bottom,
|
632
|
-
// we need reverify its position after a dom update (nextTick)
|
633
|
-
if (isDisplayedAtBottom) this.generateDropdownPosition()
|
634
|
-
},
|
635
|
-
async generateDropdownPosition() {
|
636
|
-
const isDropdownNotCompletelyVisible =
|
637
|
-
await this.isBottomOfDropdownOutOfViewport()
|
638
|
-
const dropdownWrapperEl = this.$refs.dropdownWrapperRef.$el
|
639
|
-
const selectButtonHeight = this.$refs.select.$el.clientHeight
|
640
|
-
const dropdownHeight = this.$refs.dropdown.$el.clientHeight
|
641
|
-
const dropdownWrapperRelativeHeight =
|
642
|
-
dropdownWrapperEl.getBoundingClientRect().top +
|
643
|
-
window.scrollY +
|
644
|
-
DROPDOWN_HEIGHT_OFFSET
|
645
|
-
|
646
|
-
const top = isDropdownNotCompletelyVisible
|
647
|
-
? dropdownWrapperRelativeHeight
|
648
|
-
: dropdownWrapperRelativeHeight -
|
649
|
-
dropdownHeight -
|
650
|
-
selectButtonHeight -
|
651
|
-
DROPDOWN_TOP_OFFSET
|
652
|
-
const left = this.dropdownPosition.left
|
653
|
-
? this.dropdownPosition.left
|
654
|
-
: dropdownWrapperEl.getBoundingClientRect().left + window.scrollX
|
655
|
-
|
656
|
-
this.dropdownPosition = { left: Math.floor(left), top: Math.floor(top) }
|
657
|
-
|
658
|
-
return isDropdownNotCompletelyVisible
|
659
|
-
},
|
660
|
-
async isBottomOfDropdownOutOfViewport() {
|
661
|
-
if (!this.$refs.dropdown) {
|
662
|
-
return false
|
663
|
-
}
|
664
|
-
await this.$nextTick()
|
665
|
-
const rect = this.$refs.dropdown.$el.getBoundingClientRect()
|
666
|
-
const windowHeight =
|
667
|
-
window.innerHeight || document.documentElement.clientHeight
|
668
|
-
|
669
|
-
// using Math.floor because the offsets may contain decimals we are not going to consider here
|
670
|
-
return Math.floor(rect.top) + Math.floor(rect.height) <= windowHeight
|
671
|
-
},
|
672
|
-
observeDropdownHeight() {
|
673
|
-
if (!this.$refs.dropdown) return
|
674
|
-
this.dropdownResizeObserver = new ResizeObserver(() => {
|
675
|
-
this.$nextTick(() => this.getDropdownPosition())
|
676
|
-
})
|
677
|
-
this.dropdownResizeObserver.observe(this.$refs.dropdown.$el)
|
678
|
-
},
|
679
|
-
handleSetDropdownOffet() {
|
680
|
-
if (!this.$refs.select) return
|
681
|
-
this.dropdownPosition.left = Math.floor(
|
682
|
-
this.$refs.select.$el.getBoundingClientRect().left
|
683
|
-
)
|
684
|
-
this.getDropdownWidth()
|
685
|
-
},
|
686
|
-
observeSelectWidth() {
|
687
|
-
if (!this.$refs.select) return
|
688
|
-
this.selectResizeObserver = new ResizeObserver(() =>
|
689
|
-
this.$nextTick(() => this.getDropdownWidth())
|
690
|
-
)
|
691
|
-
this.selectResizeObserver.observe(this.$refs.dropdown.$el)
|
692
|
-
},
|
693
|
-
async getDropdownWidth() {
|
694
|
-
if (!this.$refs.select) return
|
695
|
-
await this.$nextTick()
|
696
|
-
this.dropdownWidth = `${this.$refs.select.$el.clientWidth}px`
|
697
|
-
},
|
698
584
|
onArrowPress(dir) {
|
699
585
|
let newHoveredElem
|
700
586
|
const currentHoveredElem = this.$refs.dropdown.$el.querySelector(
|
@@ -726,34 +612,20 @@ export default {
|
|
726
612
|
return 0
|
727
613
|
},
|
728
614
|
isSearchBarVisible() {
|
729
|
-
return this.isSearchable && this.
|
730
|
-
},
|
731
|
-
getOptionWidth() {
|
732
|
-
if (this.optionWidth) return this.optionWidth
|
733
|
-
|
734
|
-
return this.dropdownWidth
|
735
|
-
},
|
736
|
-
isSelectDropdownShown() {
|
737
|
-
return (
|
738
|
-
this.isDropdownOpen &&
|
739
|
-
this.dropdownPosition.left !== null &&
|
740
|
-
(!this.isSearchable || this.isSearchable)
|
741
|
-
)
|
615
|
+
return this.isSearchable && this.isDropdownOpen
|
742
616
|
}
|
743
617
|
},
|
744
618
|
watch: {
|
745
619
|
value(val) {
|
746
620
|
this.selectedValue = val
|
747
621
|
},
|
748
|
-
|
622
|
+
isDropdownOpen(val) {
|
623
|
+
this.$emit('is-dropdown-open', val)
|
749
624
|
if (val) {
|
750
625
|
setTimeout(() => {
|
751
626
|
this.isClickOutsideActive = true
|
752
627
|
}, 10)
|
753
|
-
await this.$nextTick()
|
754
|
-
this.handleSetDropdownOffet()
|
755
628
|
} else {
|
756
|
-
this.dropdownPosition.left = null
|
757
629
|
setTimeout(() => {
|
758
630
|
this.isClickOutsideActive = false
|
759
631
|
}, 10)
|
@@ -12,8 +12,6 @@
|
|
12
12
|
@mouseover="hoverHandler"
|
13
13
|
:cursorType="cursorType"
|
14
14
|
:isDisabled="isDisabled"
|
15
|
-
:disabledBgColor="disabledBgColor"
|
16
|
-
:disabledTextColor="disabledTextColor"
|
17
15
|
:backgroundColor="colorMode == 'dark' ? '#000000' : backgroundColor"
|
18
16
|
:title="hoverText"
|
19
17
|
>
|
@@ -24,14 +22,12 @@
|
|
24
22
|
<script>
|
25
23
|
// import selectButton from './selectButton'
|
26
24
|
// import selectDropdown from './selectDropDown'
|
27
|
-
import styled from '
|
25
|
+
import styled from 'vue-styled-components'
|
28
26
|
const optionProps = {
|
29
27
|
isDisabled: Boolean,
|
30
28
|
hoveredBgColor: String,
|
31
29
|
cursorType: String,
|
32
|
-
backgroundColor: String
|
33
|
-
disabledBgColor: String,
|
34
|
-
disabledTextColor: String
|
30
|
+
backgroundColor: String
|
35
31
|
}
|
36
32
|
const optionContainer = styled('div', optionProps)`
|
37
33
|
display: flex;
|
@@ -43,33 +39,19 @@ const optionContainer = styled('div', optionProps)`
|
|
43
39
|
gap: 14px;
|
44
40
|
width: 100%;
|
45
41
|
background-color: ${(props) =>
|
46
|
-
props.
|
47
|
-
? props.theme.colors[props.disabledBgColor]
|
48
|
-
? props.theme.colors[props.disabledBgColor]
|
49
|
-
: props.disabledBgColor
|
50
|
-
: props.theme.colors[props.backgroundColor]
|
42
|
+
props.theme.colors[props.backgroundColor]
|
51
43
|
? props.theme.colors[props.backgroundColor]
|
52
|
-
: props.backgroundColor}
|
44
|
+
: props.backgroundColor};
|
53
45
|
box-sizing: inherit;
|
54
46
|
background-color: ${(props) =>
|
55
47
|
props.theme.colors[props.backgroundColor]
|
56
48
|
? props.theme.colors[props.backgroundColor]
|
57
49
|
: props.backgroundColor};
|
58
50
|
color: ${(props) =>
|
59
|
-
props.isDisabled
|
60
|
-
? !!props.disabledTextColor
|
61
|
-
? props.theme.colors[props.disabledTextColor]
|
62
|
-
? props.theme.colors[props.disabledTextColor]
|
63
|
-
: props.disabledTextColor
|
64
|
-
: props.theme.colors.grey3
|
65
|
-
: 'inherit'};
|
51
|
+
props.isDisabled ? props.theme.colors.grey3 : 'inherit'};
|
66
52
|
&:hover {
|
67
53
|
background-color: ${(props) =>
|
68
|
-
|
69
|
-
? props.theme.colors[props.disabledBgColor]
|
70
|
-
? props.theme.colors[props.disabledBgColor]
|
71
|
-
: props.disabledBgColor
|
72
|
-
: props.theme.colors[props.hoveredBgColor]
|
54
|
+
props.theme.colors[props.hoveredBgColor]
|
73
55
|
? props.theme.colors[props.hoveredBgColor]
|
74
56
|
: props.hoveredBgColor} !important;
|
75
57
|
}
|
@@ -77,7 +59,7 @@ const optionContainer = styled('div', optionProps)`
|
|
77
59
|
|
78
60
|
export default {
|
79
61
|
name: 'RCoption',
|
80
|
-
|
62
|
+
|
81
63
|
props: {
|
82
64
|
value: {
|
83
65
|
required: true
|
@@ -91,7 +73,7 @@ export default {
|
|
91
73
|
},
|
92
74
|
cursorType: {
|
93
75
|
required: false,
|
94
|
-
default: '
|
76
|
+
default: 'cursor'
|
95
77
|
},
|
96
78
|
backgroundColor: {
|
97
79
|
required: false,
|
@@ -103,28 +85,21 @@ export default {
|
|
103
85
|
isDisabled: {
|
104
86
|
required: false,
|
105
87
|
default: false
|
106
|
-
},
|
107
|
-
disabledBgColor: {
|
108
|
-
required: false,
|
109
|
-
default: 'white'
|
110
|
-
},
|
111
|
-
disabledTextColor: {
|
112
|
-
required: false,
|
113
|
-
default: null
|
114
88
|
}
|
115
89
|
},
|
116
90
|
|
117
91
|
components: { optionContainer },
|
92
|
+
|
118
93
|
data() {
|
119
94
|
return {}
|
120
95
|
},
|
121
96
|
methods: {
|
122
|
-
clickHandler(
|
97
|
+
clickHandler() {
|
123
98
|
if (this.isDisabled) {
|
124
99
|
// prevent emitter if the option is disabled
|
125
100
|
return
|
126
101
|
} else {
|
127
|
-
this.$parent.$emit('option-selected', this.value
|
102
|
+
this.$parent.$emit('option-selected', this.value)
|
128
103
|
}
|
129
104
|
},
|
130
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
|
|
@@ -45,7 +45,7 @@
|
|
45
45
|
>
|
46
46
|
<label-text :size="size" :fontColor="fontColor">{{ label }}</label-text>
|
47
47
|
<info-text
|
48
|
-
@click.stop
|
48
|
+
@click.native.stop
|
49
49
|
v-if="infoTextMessage"
|
50
50
|
:text="infoTextMessage"
|
51
51
|
/>
|
@@ -70,7 +70,7 @@
|
|
70
70
|
// :disabled="false"
|
71
71
|
// />
|
72
72
|
|
73
|
-
import styled from '
|
73
|
+
import styled from 'vue-styled-components'
|
74
74
|
import InfoText from '../../infoText'
|
75
75
|
import theme from '../../../assets/theme'
|
76
76
|
const Container = styled.div``
|
@@ -44,7 +44,7 @@
|
|
44
44
|
>
|
45
45
|
<label-text :size="size" :fontColor="fontColor">{{ label }}</label-text>
|
46
46
|
<info-text
|
47
|
-
@click.stop
|
47
|
+
@click.native.stop
|
48
48
|
v-if="infoTextMessage"
|
49
49
|
:text="infoTextMessage"
|
50
50
|
/>
|
@@ -70,7 +70,7 @@
|
|
70
70
|
// data-id="test_data_id"
|
71
71
|
// />
|
72
72
|
|
73
|
-
import styled from '
|
73
|
+
import styled from 'vue-styled-components'
|
74
74
|
import InfoText from '../../infoText'
|
75
75
|
|
76
76
|
const Container = styled.div`
|