@eturnity/eturnity_reusable_components 7.18.0-EPDM-10335.1 → 7.18.0-qa-dev03.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 -19
- package/src/App.vue +2 -2
- package/src/assets/svgIcons/anchor.svg +18 -0
- package/src/assets/svgIcons/flatten_roof.svg +20 -0
- package/src/assets/svgIcons/split.svg +6 -88
- 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/card/index.vue +24 -25
- 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 +75 -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 +10 -10
- 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 +55 -199
- 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,26 @@
|
|
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
|
-
:selectedValue="selectedValue"
|
123
|
-
@option-selected="optionSelected"
|
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
|
+
:hoveredIndex="hoveredIndex"
|
105
|
+
:hoveredValue="hoveredValue"
|
106
|
+
:isActive="isActive"
|
107
|
+
:optionWidth="optionWidth"
|
108
|
+
:hoveredBgColor="colorMode == 'dark' ? '#000000' : dropdownBgColor"
|
109
|
+
:bgColor="colorMode == 'dark' ? 'black' : dropdownBgColor"
|
110
|
+
:fontColor="
|
111
|
+
dropdownFontColor || colorMode == 'dark' ? 'white' : 'black'
|
112
|
+
"
|
113
|
+
:selectedValue="selectedValue"
|
114
|
+
@option-selected="optionSelected"
|
115
|
+
@option-hovered="optionHovered"
|
116
|
+
@mouseleave="optionLeave"
|
117
|
+
>
|
118
|
+
<slot name="dropdown"></slot>
|
119
|
+
</selectDropdown>
|
129
120
|
</DropdownWrapper>
|
130
121
|
</select-button-wrapper>
|
131
122
|
</input-wrapper>
|
@@ -140,9 +131,8 @@
|
|
140
131
|
// optionWidth="50%"
|
141
132
|
// label="that is a label"
|
142
133
|
// alignItems="vertical"
|
143
|
-
// label-data-id="test-
|
134
|
+
// label-data-id="test-label0data-id"
|
144
135
|
// data-id="test-data-id"
|
145
|
-
// :hasSelectButtonPadding="false"
|
146
136
|
// >
|
147
137
|
// <template #selector="{selectedValue}">
|
148
138
|
// value selected: {{selectedValue}}
|
@@ -155,8 +145,7 @@
|
|
155
145
|
// </template>
|
156
146
|
// </Select>
|
157
147
|
|
158
|
-
import
|
159
|
-
import styled from 'vue3-styled-components'
|
148
|
+
import styled from 'vue-styled-components'
|
160
149
|
import InfoText from '../../infoText'
|
161
150
|
import icon from '../../icon'
|
162
151
|
import inputText from '../inputText'
|
@@ -172,7 +161,7 @@ const Caret = styled.div`
|
|
172
161
|
width: ${CARET_WIDTH};
|
173
162
|
min-width: ${CARET_WIDTH};
|
174
163
|
height: 100%;
|
175
|
-
align-items:
|
164
|
+
align-items: stretch;
|
176
165
|
cursor: pointer;
|
177
166
|
margin-left: auto;
|
178
167
|
`
|
@@ -183,10 +172,7 @@ const selectorProps = {
|
|
183
172
|
showBorder: Boolean
|
184
173
|
}
|
185
174
|
const Selector = styled('div', selectorProps)`
|
186
|
-
${(props) =>
|
187
|
-
props.selectWidth === '100%'
|
188
|
-
? 'width: 100%;'
|
189
|
-
: `width: calc(${props.selectWidth} -
|
175
|
+
${(props) => props.selectWidth === '100%' ? 'width: 100%;' : `width: calc(${props.selectWidth} -
|
190
176
|
(
|
191
177
|
${CARET_WIDTH} +
|
192
178
|
${props.paddingLeft}
|
@@ -195,7 +181,8 @@ const Selector = styled('div', selectorProps)`
|
|
195
181
|
);
|
196
182
|
white-space: nowrap;
|
197
183
|
text-overflow: ellipsis;
|
198
|
-
overflow: hidden;`
|
184
|
+
overflow: hidden;`
|
185
|
+
}
|
199
186
|
`
|
200
187
|
|
201
188
|
const labelAttrs = { fontSize: String, fontColor: String }
|
@@ -210,10 +197,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
210
197
|
const optionalLabel = styled.span`
|
211
198
|
font-weight: 300;
|
212
199
|
`
|
213
|
-
const inputProps = {
|
214
|
-
selectWidth: String,
|
215
|
-
optionWidth: String
|
216
|
-
}
|
200
|
+
const inputProps = { selectWidth: String, optionWidth: String }
|
217
201
|
const Container = styled('div', inputProps)`
|
218
202
|
width: ${(props) => props.selectWidth};
|
219
203
|
position: relative;
|
@@ -240,10 +224,9 @@ const selectButtonAttrs = {
|
|
240
224
|
hasError: Boolean,
|
241
225
|
disabled: Boolean,
|
242
226
|
selectHeight: String,
|
243
|
-
selectWidth: String,
|
244
227
|
height: String,
|
245
228
|
selectMinHeight: String,
|
246
|
-
|
229
|
+
isSearchBarVisible: Boolean,
|
247
230
|
showBorder: Boolean,
|
248
231
|
paddingLeft: String
|
249
232
|
}
|
@@ -251,9 +234,8 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
251
234
|
position: relative;
|
252
235
|
box-sizing: border-box;
|
253
236
|
border-radius: 4px;
|
254
|
-
max-width: ${(props) => (props.selectWidth ? props.selectWidth : '100%')};
|
255
237
|
${(props) =>
|
256
|
-
props.
|
238
|
+
props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}`};
|
257
239
|
text-align: left;
|
258
240
|
min-height: ${(props) =>
|
259
241
|
props.selectHeight
|
@@ -265,7 +247,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
265
247
|
: '36px'};
|
266
248
|
display: flex;
|
267
249
|
align-items: center;
|
268
|
-
height: ${(props) => props.selectHeight};
|
250
|
+
max-height: ${(props) => props.selectHeight};
|
269
251
|
${({ showBorder, theme, hasError }) =>
|
270
252
|
showBorder &&
|
271
253
|
`
|
@@ -297,17 +279,14 @@ const selectDropdownAttrs = {
|
|
297
279
|
fontColor: String,
|
298
280
|
optionWidth: String,
|
299
281
|
hoveredIndex: Number,
|
300
|
-
fontSize: String,
|
301
|
-
dropdownPosition: Object,
|
302
282
|
hoveredValue: Number | String,
|
303
283
|
selectedValue: Number | String
|
304
284
|
}
|
305
285
|
const selectDropdown = styled('div', selectDropdownAttrs)`
|
306
286
|
box-sizing: border-box;
|
307
|
-
z-index: ${(props) => (props.isActive ? '2' : '
|
287
|
+
z-index: ${(props) => (props.isActive ? '2' : '1')};
|
308
288
|
position: absolute;
|
309
|
-
top:
|
310
|
-
left: ${(props) => props.dropdownPosition?.left}px;
|
289
|
+
top: 5px;
|
311
290
|
border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
|
312
291
|
border-radius: 4px;
|
313
292
|
display: flex;
|
@@ -332,9 +311,7 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
332
311
|
? props.theme.colors[props.hoveredBgColor]
|
333
312
|
: props.hoveredBgColor};
|
334
313
|
}
|
335
|
-
font-size: ${(props) => props.fontSize};
|
336
314
|
`
|
337
|
-
selectDropdown.emits = ['option-hovered', 'option-selected']
|
338
315
|
const DropdownWrapper = styled('div')`
|
339
316
|
position: relative;
|
340
317
|
`
|
@@ -347,10 +324,6 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
347
324
|
grid-template-columns: ${(props) =>
|
348
325
|
props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
|
349
326
|
`
|
350
|
-
|
351
|
-
const DROPDOWN_HEIGHT_OFFSET = 4
|
352
|
-
const DROPDOWN_TOP_OFFSET = 21
|
353
|
-
|
354
327
|
export default {
|
355
328
|
name: 'RCselect',
|
356
329
|
|
@@ -462,10 +435,6 @@ export default {
|
|
462
435
|
type: String,
|
463
436
|
default: ''
|
464
437
|
},
|
465
|
-
hasSelectButtonPadding: {
|
466
|
-
type: Boolean,
|
467
|
-
default: true
|
468
|
-
},
|
469
438
|
isDraggable: {
|
470
439
|
type: Boolean,
|
471
440
|
default: false
|
@@ -487,7 +456,6 @@ export default {
|
|
487
456
|
Caret,
|
488
457
|
Selector,
|
489
458
|
inputText,
|
490
|
-
Teleport,
|
491
459
|
draggableInputHandle
|
492
460
|
},
|
493
461
|
|
@@ -499,38 +467,23 @@ export default {
|
|
499
467
|
isActive: false,
|
500
468
|
textSearch: '',
|
501
469
|
hoveredIndex: 0,
|
502
|
-
|
503
|
-
|
504
|
-
left: null,
|
505
|
-
top: null
|
506
|
-
},
|
507
|
-
dropdownWidth: null,
|
508
|
-
hoveredValue: null
|
470
|
+
hoveredValue: null,
|
471
|
+
isClickOutsideActive: false
|
509
472
|
}
|
510
473
|
},
|
511
474
|
mounted() {
|
512
|
-
this.observeDropdownHeight()
|
513
|
-
this.observeSelectWidth()
|
514
|
-
window.addEventListener('resize', this.handleSetDropdownOffet)
|
515
|
-
},
|
516
|
-
beforeMount() {
|
517
475
|
this.selectedValue = this.value
|
518
476
|
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
477
|
},
|
524
|
-
|
478
|
+
beforeDestroy() {
|
525
479
|
document.removeEventListener('click', this.clickOutside)
|
526
480
|
},
|
527
481
|
methods: {
|
528
482
|
focus() {
|
529
483
|
this.isActive = true
|
530
484
|
},
|
531
|
-
blur(
|
485
|
+
blur() {
|
532
486
|
this.isActive = false
|
533
|
-
this.$emit('blur', e)
|
534
487
|
},
|
535
488
|
toggleDropdown() {
|
536
489
|
this.isDropdownOpen = !this.isDropdownOpen
|
@@ -546,9 +499,6 @@ export default {
|
|
546
499
|
this.blur()
|
547
500
|
this.isDropdownOpen = false
|
548
501
|
},
|
549
|
-
clearSearch() {
|
550
|
-
this.textSearch = ''
|
551
|
-
},
|
552
502
|
optionSelected(e) {
|
553
503
|
this.selectedValue = e
|
554
504
|
this.closeDropdown()
|
@@ -577,15 +527,15 @@ export default {
|
|
577
527
|
searchChange(value) {
|
578
528
|
this.textSearch = value
|
579
529
|
this.$emit('search-change', value)
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
el.
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
530
|
+
this.$refs.dropdown.$children
|
531
|
+
.map((component) => component.$el)
|
532
|
+
.forEach((el) => {
|
533
|
+
if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
|
534
|
+
el.style.display = 'none'
|
535
|
+
} else {
|
536
|
+
el.style.display = 'inherit'
|
537
|
+
}
|
538
|
+
})
|
589
539
|
},
|
590
540
|
clickOutside(event) {
|
591
541
|
const dropdownRef = this.$refs.dropdown
|
@@ -595,7 +545,6 @@ export default {
|
|
595
545
|
if (
|
596
546
|
this.$refs.select.$el == event.target ||
|
597
547
|
this.$refs.select.$el.contains(event.target) ||
|
598
|
-
event.target.id === 'more-button' ||
|
599
548
|
event.target.parentNode === dropdownRef.$el
|
600
549
|
) {
|
601
550
|
return
|
@@ -609,92 +558,13 @@ export default {
|
|
609
558
|
} else if (e.key == 'ArrowUp') {
|
610
559
|
this.onArrowPress(-1)
|
611
560
|
} else if (e.key == 'Enter') {
|
612
|
-
const optionHoveredComponent =
|
613
|
-
|
614
|
-
|
561
|
+
const optionHoveredComponent =
|
562
|
+
this.$refs.dropdown.$children[
|
563
|
+
(this.hoveredIndex - 1 + this.optionLength) % this.optionLength
|
564
|
+
]
|
615
565
|
this.optionSelected(optionHoveredComponent.$el.dataset.value)
|
616
566
|
}
|
617
567
|
},
|
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
568
|
onArrowPress(dir) {
|
699
569
|
let newHoveredElem
|
700
570
|
const currentHoveredElem = this.$refs.dropdown.$el.querySelector(
|
@@ -726,34 +596,20 @@ export default {
|
|
726
596
|
return 0
|
727
597
|
},
|
728
598
|
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
|
-
)
|
599
|
+
return this.isSearchable && this.isDropdownOpen
|
742
600
|
}
|
743
601
|
},
|
744
602
|
watch: {
|
745
603
|
value(val) {
|
746
604
|
this.selectedValue = val
|
747
605
|
},
|
748
|
-
|
606
|
+
isDropdownOpen(val) {
|
607
|
+
this.$emit('is-dropdown-open', val)
|
749
608
|
if (val) {
|
750
609
|
setTimeout(() => {
|
751
610
|
this.isClickOutsideActive = true
|
752
611
|
}, 10)
|
753
|
-
await this.$nextTick()
|
754
|
-
this.handleSetDropdownOffet()
|
755
612
|
} else {
|
756
|
-
this.dropdownPosition.left = null
|
757
613
|
setTimeout(() => {
|
758
614
|
this.isClickOutsideActive = false
|
759
615
|
}, 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`
|