@eturnity/eturnity_reusable_components 7.12.7-EPDM-10602.2 → 7.12.7-EPDM-10335.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.
Files changed (52) hide show
  1. package/.storybook/preview.js +1 -1
  2. package/package.json +19 -23
  3. package/src/App.vue +2 -2
  4. package/src/assets/svgIcons/split.svg +88 -6
  5. package/src/components/addNewButton/index.vue +5 -3
  6. package/src/components/buttons/buttonIcon/index.vue +1 -1
  7. package/src/components/buttons/closeButton/index.vue +1 -1
  8. package/src/components/buttons/mainButton/index.vue +6 -1
  9. package/src/components/deleteIcon/DeleteIcon.stories.js +7 -7
  10. package/src/components/deleteIcon/index.vue +25 -21
  11. package/src/components/draggableInputHandle/index.vue +24 -25
  12. package/src/components/dropdown/index.vue +129 -110
  13. package/src/components/errorMessage/index.vue +10 -5
  14. package/src/components/filter/filterSettings.vue +58 -97
  15. package/src/components/filter/index.vue +3 -3
  16. package/src/components/filter/parentDropdown.vue +2 -2
  17. package/src/components/icon/iconCache.js +23 -0
  18. package/src/components/icon/iconCollection.vue +2 -2
  19. package/src/components/icon/index.vue +67 -70
  20. package/src/components/iconWrapper/index.vue +1 -4
  21. package/src/components/infoCard/index.vue +2 -3
  22. package/src/components/infoText/index.vue +1 -1
  23. package/src/components/inputs/checkbox/index.vue +21 -6
  24. package/src/components/inputs/inputNumber/index.vue +8 -11
  25. package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
  26. package/src/components/inputs/inputText/index.vue +3 -3
  27. package/src/components/inputs/radioButton/index.vue +1 -1
  28. package/src/components/inputs/searchInput/index.vue +28 -11
  29. package/src/components/inputs/select/index.vue +199 -55
  30. package/src/components/inputs/select/option/index.vue +36 -11
  31. package/src/components/inputs/slider/index.vue +16 -16
  32. package/src/components/inputs/switchField/index.vue +2 -2
  33. package/src/components/inputs/textAreaInput/index.vue +1 -1
  34. package/src/components/inputs/toggle/index.vue +2 -2
  35. package/src/components/label/index.vue +27 -31
  36. package/src/components/modals/modal/index.vue +2 -6
  37. package/src/components/navigationTabs/index.vue +27 -20
  38. package/src/components/pageSubtitle/index.vue +1 -1
  39. package/src/components/pageTitle/index.vue +4 -4
  40. package/src/components/pagination/index.vue +1 -1
  41. package/src/components/progressBar/index.vue +1 -1
  42. package/src/components/projectMarker/index.vue +16 -9
  43. package/src/components/sideMenu/index.vue +1 -1
  44. package/src/components/spinner/index.vue +7 -11
  45. package/src/components/tableDropdown/index.vue +30 -37
  46. package/src/components/tables/mainTable/exampleNested.vue +1 -1
  47. package/src/components/tables/mainTable/index.vue +10 -9
  48. package/src/components/tables/viewTable/index.vue +2 -2
  49. package/src/components/threeDots/index.vue +1 -1
  50. package/src/components/videoThumbnail/index.vue +95 -100
  51. package/src/main.js +4 -11
  52. package/src/assets/svgIcons/anchor.svg +0 -18
@@ -28,7 +28,9 @@
28
28
  <select-button-wrapper :disabled="disabled">
29
29
  <selectButton
30
30
  ref="select"
31
+ class="select-button"
31
32
  @click="toggleDropdown"
33
+ :selectWidth="selectWidth"
32
34
  :selectHeight="selectHeight"
33
35
  :height="height"
34
36
  :selectMinHeight="selectMinHeight"
@@ -39,9 +41,9 @@
39
41
  buttonFontColor || colorMode == 'dark' ? 'white' : 'black'
40
42
  "
41
43
  :hasError="hasError"
42
- :isSearchBarVisible="isSearchBarVisible"
44
+ :hasNoPadding="isSearchBarVisible || !hasSelectButtonPadding"
43
45
  :disabled="disabled"
44
- @keydown.native="onKeyDown"
46
+ @keydown="onKeyDown"
45
47
  :showBorder="showBorder"
46
48
  :data-id="dataId"
47
49
  :paddingLeft="paddingLeft"
@@ -64,7 +66,7 @@
64
66
  :value="textSearch"
65
67
  @keydown.stop="onKeyDown"
66
68
  @input-change="searchChange"
67
- @click.native.stop
69
+ @click.stop
68
70
  />
69
71
  <selector
70
72
  v-else
@@ -97,26 +99,33 @@
97
99
  />
98
100
  </Caret>
99
101
  </selectButton>
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>
102
+ <DropdownWrapper ref="dropdownWrapperRef">
103
+ <Teleport to="#portal-target">
104
+ <selectDropdown
105
+ ref="dropdown"
106
+ v-show="isSelectDropdownShown"
107
+ :dropdownPosition="dropdownPosition"
108
+ :hoveredIndex="hoveredIndex"
109
+ :hoveredValue="hoveredValue"
110
+ :isActive="isActive"
111
+ :optionWidth="getOptionWidth"
112
+ :hoveredBgColor="
113
+ colorMode == 'dark' ? '#000000' : dropdownBgColor
114
+ "
115
+ :bgColor="
116
+ dropdownBgColor || colorMode == 'dark' ? 'black' : 'white'
117
+ "
118
+ :fontColor="
119
+ dropdownFontColor || colorMode == 'dark' ? 'white' : 'black'
120
+ "
121
+ :fontSize="fontSize"
122
+ :selectedValue="selectedValue"
123
+ @option-selected="optionSelected"
124
+ @option-hovered="optionHovered"
125
+ >
126
+ <slot name="dropdown"></slot>
127
+ </selectDropdown>
128
+ </Teleport>
120
129
  </DropdownWrapper>
121
130
  </select-button-wrapper>
122
131
  </input-wrapper>
@@ -131,8 +140,9 @@
131
140
  // optionWidth="50%"
132
141
  // label="that is a label"
133
142
  // alignItems="vertical"
134
- // label-data-id="test-label0data-id"
143
+ // label-data-id="test-label-data-id"
135
144
  // data-id="test-data-id"
145
+ // :hasSelectButtonPadding="false"
136
146
  // >
137
147
  // <template #selector="{selectedValue}">
138
148
  // value selected: {{selectedValue}}
@@ -145,7 +155,8 @@
145
155
  // </template>
146
156
  // </Select>
147
157
 
148
- import styled from 'vue-styled-components'
158
+ import { Teleport } from 'vue'
159
+ import styled from 'vue3-styled-components'
149
160
  import InfoText from '../../infoText'
150
161
  import icon from '../../icon'
151
162
  import inputText from '../inputText'
@@ -161,7 +172,7 @@ const Caret = styled.div`
161
172
  width: ${CARET_WIDTH};
162
173
  min-width: ${CARET_WIDTH};
163
174
  height: 100%;
164
- align-items: stretch;
175
+ align-items: center;
165
176
  cursor: pointer;
166
177
  margin-left: auto;
167
178
  `
@@ -172,7 +183,10 @@ const selectorProps = {
172
183
  showBorder: Boolean
173
184
  }
174
185
  const Selector = styled('div', selectorProps)`
175
- ${(props) => props.selectWidth === '100%' ? 'width: 100%;' : `width: calc(${props.selectWidth} -
186
+ ${(props) =>
187
+ props.selectWidth === '100%'
188
+ ? 'width: 100%;'
189
+ : `width: calc(${props.selectWidth} -
176
190
  (
177
191
  ${CARET_WIDTH} +
178
192
  ${props.paddingLeft}
@@ -181,8 +195,7 @@ const Selector = styled('div', selectorProps)`
181
195
  );
182
196
  white-space: nowrap;
183
197
  text-overflow: ellipsis;
184
- overflow: hidden;`
185
- }
198
+ overflow: hidden;`}
186
199
  `
187
200
 
188
201
  const labelAttrs = { fontSize: String, fontColor: String }
@@ -197,7 +210,10 @@ const InputLabel = styled('div', labelAttrs)`
197
210
  const optionalLabel = styled.span`
198
211
  font-weight: 300;
199
212
  `
200
- const inputProps = { selectWidth: String, optionWidth: String }
213
+ const inputProps = {
214
+ selectWidth: String,
215
+ optionWidth: String
216
+ }
201
217
  const Container = styled('div', inputProps)`
202
218
  width: ${(props) => props.selectWidth};
203
219
  position: relative;
@@ -224,9 +240,10 @@ const selectButtonAttrs = {
224
240
  hasError: Boolean,
225
241
  disabled: Boolean,
226
242
  selectHeight: String,
243
+ selectWidth: String,
227
244
  height: String,
228
245
  selectMinHeight: String,
229
- isSearchBarVisible: Boolean,
246
+ hasNoPadding: Boolean,
230
247
  showBorder: Boolean,
231
248
  paddingLeft: String
232
249
  }
@@ -234,8 +251,9 @@ const selectButton = styled('div', selectButtonAttrs)`
234
251
  position: relative;
235
252
  box-sizing: border-box;
236
253
  border-radius: 4px;
254
+ max-width: ${(props) => (props.selectWidth ? props.selectWidth : '100%')};
237
255
  ${(props) =>
238
- props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}`};
256
+ props.hasNoPadding ? '' : `padding-left: ${props.paddingLeft}`};
239
257
  text-align: left;
240
258
  min-height: ${(props) =>
241
259
  props.selectHeight
@@ -247,7 +265,7 @@ const selectButton = styled('div', selectButtonAttrs)`
247
265
  : '36px'};
248
266
  display: flex;
249
267
  align-items: center;
250
- max-height: ${(props) => props.selectHeight};
268
+ height: ${(props) => props.selectHeight};
251
269
  ${({ showBorder, theme, hasError }) =>
252
270
  showBorder &&
253
271
  `
@@ -279,14 +297,17 @@ const selectDropdownAttrs = {
279
297
  fontColor: String,
280
298
  optionWidth: String,
281
299
  hoveredIndex: Number,
300
+ fontSize: String,
301
+ dropdownPosition: Object,
282
302
  hoveredValue: Number | String,
283
303
  selectedValue: Number | String
284
304
  }
285
305
  const selectDropdown = styled('div', selectDropdownAttrs)`
286
306
  box-sizing: border-box;
287
- z-index: ${(props) => (props.isActive ? '2' : '1')};
307
+ z-index: ${(props) => (props.isActive ? '2' : '99999')};
288
308
  position: absolute;
289
- top: 5px;
309
+ top: ${(props) => props.dropdownPosition?.top}px;
310
+ left: ${(props) => props.dropdownPosition?.left}px;
290
311
  border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
291
312
  border-radius: 4px;
292
313
  display: flex;
@@ -311,7 +332,9 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
311
332
  ? props.theme.colors[props.hoveredBgColor]
312
333
  : props.hoveredBgColor};
313
334
  }
335
+ font-size: ${(props) => props.fontSize};
314
336
  `
337
+ selectDropdown.emits = ['option-hovered', 'option-selected']
315
338
  const DropdownWrapper = styled('div')`
316
339
  position: relative;
317
340
  `
@@ -324,6 +347,10 @@ const InputWrapper = styled('div', inputAttrs)`
324
347
  grid-template-columns: ${(props) =>
325
348
  props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
326
349
  `
350
+
351
+ const DROPDOWN_HEIGHT_OFFSET = 4
352
+ const DROPDOWN_TOP_OFFSET = 21
353
+
327
354
  export default {
328
355
  name: 'RCselect',
329
356
 
@@ -435,6 +462,10 @@ export default {
435
462
  type: String,
436
463
  default: ''
437
464
  },
465
+ hasSelectButtonPadding: {
466
+ type: Boolean,
467
+ default: true
468
+ },
438
469
  isDraggable: {
439
470
  type: Boolean,
440
471
  default: false
@@ -456,6 +487,7 @@ export default {
456
487
  Caret,
457
488
  Selector,
458
489
  inputText,
490
+ Teleport,
459
491
  draggableInputHandle
460
492
  },
461
493
 
@@ -467,23 +499,38 @@ export default {
467
499
  isActive: false,
468
500
  textSearch: '',
469
501
  hoveredIndex: 0,
470
- hoveredValue: null,
471
- isClickOutsideActive: false
502
+ isClickOutsideActive: false,
503
+ dropdownPosition: {
504
+ left: null,
505
+ top: null
506
+ },
507
+ dropdownWidth: null,
508
+ hoveredValue: null
472
509
  }
473
510
  },
474
511
  mounted() {
512
+ this.observeDropdownHeight()
513
+ this.observeSelectWidth()
514
+ window.addEventListener('resize', this.handleSetDropdownOffet)
515
+ },
516
+ beforeMount() {
475
517
  this.selectedValue = this.value
476
518
  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()
477
523
  },
478
- beforeDestroy() {
524
+ unmounted() {
479
525
  document.removeEventListener('click', this.clickOutside)
480
526
  },
481
527
  methods: {
482
528
  focus() {
483
529
  this.isActive = true
484
530
  },
485
- blur() {
531
+ blur(e) {
486
532
  this.isActive = false
533
+ this.$emit('blur', e)
487
534
  },
488
535
  toggleDropdown() {
489
536
  this.isDropdownOpen = !this.isDropdownOpen
@@ -499,6 +546,9 @@ export default {
499
546
  this.blur()
500
547
  this.isDropdownOpen = false
501
548
  },
549
+ clearSearch() {
550
+ this.textSearch = ''
551
+ },
502
552
  optionSelected(e) {
503
553
  this.selectedValue = e
504
554
  this.closeDropdown()
@@ -527,15 +577,15 @@ export default {
527
577
  searchChange(value) {
528
578
  this.textSearch = value
529
579
  this.$emit('search-change', value)
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
- })
580
+ const dropdownChildren = [...this.$refs.dropdown.$el.children]
581
+ dropdownChildren.forEach((el) => {
582
+ if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
583
+ el.style.display = 'none'
584
+
585
+ return
586
+ }
587
+ el.style.display = 'inherit'
588
+ })
539
589
  },
540
590
  clickOutside(event) {
541
591
  const dropdownRef = this.$refs.dropdown
@@ -545,6 +595,7 @@ export default {
545
595
  if (
546
596
  this.$refs.select.$el == event.target ||
547
597
  this.$refs.select.$el.contains(event.target) ||
598
+ event.target.id === 'more-button' ||
548
599
  event.target.parentNode === dropdownRef.$el
549
600
  ) {
550
601
  return
@@ -558,13 +609,92 @@ export default {
558
609
  } else if (e.key == 'ArrowUp') {
559
610
  this.onArrowPress(-1)
560
611
  } else if (e.key == 'Enter') {
561
- const optionHoveredComponent =
562
- this.$refs.dropdown.$children[
563
- (this.hoveredIndex - 1 + this.optionLength) % this.optionLength
564
- ]
612
+ const optionHoveredComponent = [...this.$refs.dropdown.$el.children][
613
+ (this.hoveredIndex - 1 + this.optionLength) % this.optionLength
614
+ ]
565
615
  this.optionSelected(optionHoveredComponent.$el.dataset.value)
566
616
  }
567
617
  },
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
+ },
568
698
  onArrowPress(dir) {
569
699
  let newHoveredElem
570
700
  const currentHoveredElem = this.$refs.dropdown.$el.querySelector(
@@ -596,20 +726,34 @@ export default {
596
726
  return 0
597
727
  },
598
728
  isSearchBarVisible() {
599
- return this.isSearchable && this.isDropdownOpen
729
+ return this.isSearchable && this.optionLength >= 5 && this.isDropdownOpen
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
+ )
600
742
  }
601
743
  },
602
744
  watch: {
603
745
  value(val) {
604
746
  this.selectedValue = val
605
747
  },
606
- isDropdownOpen(val) {
607
- this.$emit('is-dropdown-open', val)
748
+ async isDropdownOpen(val) {
608
749
  if (val) {
609
750
  setTimeout(() => {
610
751
  this.isClickOutsideActive = true
611
752
  }, 10)
753
+ await this.$nextTick()
754
+ this.handleSetDropdownOffet()
612
755
  } else {
756
+ this.dropdownPosition.left = null
613
757
  setTimeout(() => {
614
758
  this.isClickOutsideActive = false
615
759
  }, 10)
@@ -12,6 +12,8 @@
12
12
  @mouseover="hoverHandler"
13
13
  :cursorType="cursorType"
14
14
  :isDisabled="isDisabled"
15
+ :disabledBgColor="disabledBgColor"
16
+ :disabledTextColor="disabledTextColor"
15
17
  :backgroundColor="colorMode == 'dark' ? '#000000' : backgroundColor"
16
18
  :title="hoverText"
17
19
  >
@@ -22,12 +24,14 @@
22
24
  <script>
23
25
  // import selectButton from './selectButton'
24
26
  // import selectDropdown from './selectDropDown'
25
- import styled from 'vue-styled-components'
27
+ import styled from 'vue3-styled-components'
26
28
  const optionProps = {
27
29
  isDisabled: Boolean,
28
30
  hoveredBgColor: String,
29
31
  cursorType: String,
30
- backgroundColor: String
32
+ backgroundColor: String,
33
+ disabledBgColor: String,
34
+ disabledTextColor: String
31
35
  }
32
36
  const optionContainer = styled('div', optionProps)`
33
37
  display: flex;
@@ -39,19 +43,33 @@ const optionContainer = styled('div', optionProps)`
39
43
  gap: 14px;
40
44
  width: 100%;
41
45
  background-color: ${(props) =>
42
- props.theme.colors[props.backgroundColor]
46
+ props.isDisabled
47
+ ? props.theme.colors[props.disabledBgColor]
48
+ ? props.theme.colors[props.disabledBgColor]
49
+ : props.disabledBgColor
50
+ : props.theme.colors[props.backgroundColor]
43
51
  ? props.theme.colors[props.backgroundColor]
44
- : props.backgroundColor};
52
+ : props.backgroundColor} !important;
45
53
  box-sizing: inherit;
46
54
  background-color: ${(props) =>
47
55
  props.theme.colors[props.backgroundColor]
48
56
  ? props.theme.colors[props.backgroundColor]
49
57
  : props.backgroundColor};
50
58
  color: ${(props) =>
51
- props.isDisabled ? props.theme.colors.grey3 : 'inherit'};
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'};
52
66
  &:hover {
53
67
  background-color: ${(props) =>
54
- props.theme.colors[props.hoveredBgColor]
68
+ !!props.disabledTextColor && props.isDisabled
69
+ ? props.theme.colors[props.disabledBgColor]
70
+ ? props.theme.colors[props.disabledBgColor]
71
+ : props.disabledBgColor
72
+ : props.theme.colors[props.hoveredBgColor]
55
73
  ? props.theme.colors[props.hoveredBgColor]
56
74
  : props.hoveredBgColor} !important;
57
75
  }
@@ -59,7 +77,7 @@ const optionContainer = styled('div', optionProps)`
59
77
 
60
78
  export default {
61
79
  name: 'RCoption',
62
-
80
+ emits: ['option-hovered', 'option-selected'],
63
81
  props: {
64
82
  value: {
65
83
  required: true
@@ -73,7 +91,7 @@ export default {
73
91
  },
74
92
  cursorType: {
75
93
  required: false,
76
- default: 'cursor'
94
+ default: 'pointer'
77
95
  },
78
96
  backgroundColor: {
79
97
  required: false,
@@ -85,21 +103,28 @@ export default {
85
103
  isDisabled: {
86
104
  required: false,
87
105
  default: false
106
+ },
107
+ disabledBgColor: {
108
+ required: false,
109
+ default: 'white'
110
+ },
111
+ disabledTextColor: {
112
+ required: false,
113
+ default: null
88
114
  }
89
115
  },
90
116
 
91
117
  components: { optionContainer },
92
-
93
118
  data() {
94
119
  return {}
95
120
  },
96
121
  methods: {
97
- clickHandler() {
122
+ clickHandler(e) {
98
123
  if (this.isDisabled) {
99
124
  // prevent emitter if the option is disabled
100
125
  return
101
126
  } else {
102
- this.$parent.$emit('option-selected', this.value)
127
+ this.$parent.$emit('option-selected', this.value, e)
103
128
  }
104
129
  },
105
130
  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 "@vueform/slider/dist/slider.vue2.js"
25
- import styled from "vue-styled-components"
24
+ import Slider from '@vueform/slider'
25
+ import styled from 'vue3-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: "slider",
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("change", value)
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(".slider-touch-area")
116
- let span1 = document.createElement("span")
117
- let span2 = document.createElement("span")
118
- let span3 = document.createElement("span")
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.native.stop
48
+ @click.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 'vue-styled-components'
73
+ import styled from 'vue3-styled-components'
74
74
  import InfoText from '../../infoText'
75
75
  import theme from '../../../assets/theme'
76
76
  const Container = styled.div``
@@ -51,7 +51,7 @@
51
51
  // :isDisabled="true"
52
52
  // . fontSize="13px"
53
53
  // />
54
- import styled from 'vue-styled-components'
54
+ import styled from 'vue3-styled-components'
55
55
  import InfoText from '../../infoText'
56
56
  import ErrorMessage from '../../errorMessage'
57
57
 
@@ -44,7 +44,7 @@
44
44
  >
45
45
  <label-text :size="size" :fontColor="fontColor">{{ label }}</label-text>
46
46
  <info-text
47
- @click.native.stop
47
+ @click.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 'vue-styled-components'
73
+ import styled from 'vue3-styled-components'
74
74
  import InfoText from '../../infoText'
75
75
 
76
76
  const Container = styled.div`