@eturnity/eturnity_reusable_components 8.13.13-EPDM-12459.0 → 8.13.13-EPDM-14533.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "8.13.13-EPDM-12459.0",
3
+ "version": "8.13.13-EPDM-14533.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -109,7 +109,11 @@
109
109
  >
110
110
  <slot name="selector" :selected-value="selectedValue"></slot>
111
111
  </Selector>
112
- <Caret class="caret_dropdown" :color-mode="colorMode">
112
+ <Caret
113
+ class="caret_dropdown"
114
+ :color-mode="colorMode"
115
+ @click.stop="toggleCaretDropdown"
116
+ >
113
117
  <Icon
114
118
  v-if="isDropdownOpen"
115
119
  :color="
@@ -138,11 +142,12 @@
138
142
  v-show="isSelectDropdownShown"
139
143
  ref="dropdown"
140
144
  :bg-color="
141
- colorMode == 'dark' || colorMode == 'transparent'
145
+ dropdownBgColor ||
146
+ colorMode == 'dark' ||
147
+ colorMode == 'transparent'
142
148
  ? 'black'
143
149
  : 'white'
144
150
  "
145
- class="rc-select-dropdown"
146
151
  :dropdown-position="dropdownPosition"
147
152
  :font-color="
148
153
  dropdownFontColor ||
@@ -162,17 +167,10 @@
162
167
  :hovered-index="hoveredIndex"
163
168
  :hovered-value="hoveredValue"
164
169
  :is-active="isActive"
165
- :is-fixed-dropdown-position="isFixedDropdownPosition"
166
- :is-parent-modal="isParentModal"
167
170
  :min-width="minWidth"
168
171
  :no-relative="noRelative"
169
172
  :option-width="getOptionWidth"
170
173
  :selected-value="selectedValue"
171
- :style="{
172
- transform: `translate(${dropdownPosition?.left}px, ${
173
- noRelative ? 'auto' : `${dropdownPosition?.top}px`
174
- })`,
175
- }"
176
174
  @mouseleave="optionLeave"
177
175
  @option-hovered="optionHovered"
178
176
  @option-selected="optionSelected"
@@ -210,7 +208,7 @@
210
208
  // </template>
211
209
  // </Select>
212
210
 
213
- import { Teleport, inject } from 'vue'
211
+ import { Teleport } from 'vue'
214
212
  import styled from 'vue3-styled-components'
215
213
  import InfoText from '../../infoText'
216
214
  import Icon from '../../icon'
@@ -394,17 +392,14 @@
394
392
  selectedValue: Number | String,
395
393
  noRelative: Boolean,
396
394
  minWidth: String,
397
- isParentModal: Boolean,
398
- isFixedDropdownPosition: Boolean,
399
395
  }
400
396
  const SelectDropdown = styled('div', selectDropdownAttrs)`
401
397
  box-sizing: border-box;
402
- z-index: ${(props) =>
403
- props.isActive ? '2' : props.isParentModal ? '9999999' : '99999'};
404
- position: ${(props) =>
405
- props.isFixedDropdownPosition ? 'fixed' : 'absolute'};
406
- top: 0px;
407
- left: 0px;
398
+ z-index: ${(props) => (props.isActive ? '2' : '99999')};
399
+ position: absolute;
400
+ top: ${(props) =>
401
+ props.noRelative ? 'auto' : props.dropdownPosition?.top + 'px'};
402
+ left: ${(props) => props.dropdownPosition?.left}px;
408
403
  border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
409
404
  border-radius: 4px;
410
405
  display: flex;
@@ -652,11 +647,6 @@
652
647
  type: String,
653
648
  required: false,
654
649
  },
655
- isFixedDropdownPosition: {
656
- type: Boolean,
657
- required: false,
658
- default: false,
659
- },
660
650
  },
661
651
 
662
652
  data() {
@@ -674,17 +664,6 @@
674
664
  },
675
665
  dropdownWidth: null,
676
666
  hoveredValue: null,
677
- isDisplayedAtBottom: true,
678
- selectTopPosition: 0,
679
- selectAndDropdownDistance: 0,
680
- animationFrameId: null,
681
- }
682
- },
683
- setup() {
684
- const modalRef = inject('modalRef')
685
-
686
- return {
687
- modalRef,
688
667
  }
689
668
  },
690
669
  computed: {
@@ -742,9 +721,6 @@
742
721
  /windows phone/i.test(userAgent)
743
722
  )
744
723
  },
745
- isParentModal() {
746
- return !!this.modalRef
747
- },
748
724
  },
749
725
  watch: {
750
726
  value(val) {
@@ -758,13 +734,8 @@
758
734
  }, 10)
759
735
  await this.$nextTick()
760
736
  this.handleSetDropdownOffet()
761
- if (!this.isFixedDropdownPosition) this.calculateSelectTopPosition()
762
737
  } else {
763
738
  this.dropdownPosition.left = null
764
- if (this.animationFrameId) {
765
- cancelAnimationFrame(this.animationFrameId)
766
- this.animationFrameId = null
767
- }
768
739
  setTimeout(() => {
769
740
  this.isClickOutsideActive = false
770
741
  }, 10)
@@ -777,30 +748,11 @@
777
748
  })
778
749
  }
779
750
  },
780
- isSelectDropdownShown(isShown) {
781
- if (!isShown) return
782
- // Need to wait for 1ms to make sure the dropdown menu is shown in the DOM
783
- // before getting the distance between the select and the dropdown menu
784
- setTimeout(() => {
785
- this.getDistanceBetweenSelectAndDropdownMenu()
786
- }, 100)
787
- },
788
- selectTopPosition() {
789
- this.dropdownPosition.top =
790
- this.selectTopPosition +
791
- this.$refs.select.$el.clientHeight +
792
- this.selectAndDropdownDistance
793
- },
794
751
  },
795
752
  mounted() {
796
753
  this.observeDropdownHeight()
797
754
  this.observeSelectWidth()
798
755
  window.addEventListener('resize', this.handleSetDropdownOffet)
799
- if (!this.isFixedDropdownPosition)
800
- document.body.addEventListener(
801
- 'scroll',
802
- this.calculateSelectTopPosition
803
- )
804
756
  },
805
757
  beforeMount() {
806
758
  this.selectedValue = this.value
@@ -809,12 +761,6 @@
809
761
  window.removeEventListener('resize', this.handleSetDropdownOffet)
810
762
  if (this.dropdownResizeObserver) this.dropdownResizeObserver.disconnect()
811
763
  if (this.selectResizeObserver) this.selectResizeObserver.disconnect()
812
- if (!this.isFixedDropdownPosition) {
813
- document.body.removeEventListener(
814
- 'scroll',
815
- this.calculateSelectTopPosition
816
- )
817
- }
818
764
  },
819
765
  unmounted() {
820
766
  document.removeEventListener('click', this.clickOutside)
@@ -920,11 +866,11 @@
920
866
  return
921
867
  }
922
868
  await this.$nextTick()
923
- this.isDisplayedAtBottom = await this.generateDropdownPosition()
869
+ const isDisplayedAtBottom = await this.generateDropdownPosition()
924
870
  // If the dropdown menu is going to be displayed at the bottom,
925
871
  // we need reverify its position after a dom update (nextTick)
926
872
  await this.$nextTick()
927
- if (this.isDisplayedAtBottom) this.generateDropdownPosition()
873
+ if (isDisplayedAtBottom) this.generateDropdownPosition()
928
874
  },
929
875
  async generateDropdownPosition() {
930
876
  const isDropdownNotCompletelyVisible =
@@ -1017,25 +963,6 @@
1017
963
  }
1018
964
  }
1019
965
  },
1020
- getDistanceBetweenSelectAndDropdownMenu() {
1021
- const wholeSelectTopPosition =
1022
- this.selectTopPosition + this.$refs.select.$el.clientHeight
1023
- this.selectAndDropdownDistance =
1024
- this.dropdownPosition.top - wholeSelectTopPosition
1025
- },
1026
- calculateSelectTopPosition() {
1027
- const selectRef = this.$refs.select
1028
- if (selectRef) {
1029
- const currentTopPosition =
1030
- selectRef.$el.getBoundingClientRect().top + window.scrollY
1031
- if (this.selectTopPosition !== currentTopPosition) {
1032
- this.selectTopPosition = currentTopPosition
1033
- }
1034
- }
1035
- this.animationFrameId = requestAnimationFrame(
1036
- this.calculateSelectTopPosition
1037
- )
1038
- },
1039
966
  },
1040
967
  }
1041
968
  </script>
@@ -1,11 +1,7 @@
1
1
  <template>
2
2
  <PageWrapper
3
3
  v-if="isOpen"
4
- <<<<<<< HEAD
5
- ref="modalRef"
6
- =======
7
4
  :add-padding-top="addPaddingTop"
8
- >>>>>>> master
9
5
  :backdrop="backdrop"
10
6
  :is-open="isOpen"
11
7
  :position="position"
@@ -40,7 +36,6 @@
40
36
  // <div>Data....</div>
41
37
  // </modal>
42
38
 
43
- import { ref, provide } from 'vue'
44
39
  import styled from 'vue3-styled-components'
45
40
  import CloseButton from '../../buttons/closeButton'
46
41
  import Spinner from '../../spinner'
@@ -63,14 +58,14 @@
63
58
  props.backdrop == 'dark'
64
59
  ? 'rgba(0, 0, 0, 0.4)'
65
60
  : 'rgba(255, 255, 255, 0.9)'};
66
- z-index: 9999999;
61
+ z-index: 99999;
67
62
  overflow: auto;
68
63
  padding-top: ${(props) => (props.addPaddingTop ? '80px' : '0')};
69
64
 
70
- @media (max-width: 425px) {
71
- background: white;
72
- }
73
- `
65
+ @media (max-width: 425px) {
66
+ background: white;
67
+ }
68
+ `
74
69
 
75
70
  const modalContainerAttrs = { overflow: String, isLoading: Boolean }
76
71
  const ModalContainer = styled('div', modalContainerAttrs)`
@@ -168,14 +163,6 @@
168
163
  default: false,
169
164
  },
170
165
  },
171
- setup() {
172
- const modalRef = ref(null)
173
- provide('modalRef', modalRef)
174
-
175
- return {
176
- modalRef,
177
- }
178
- },
179
166
  watch: {
180
167
  isOpen: {
181
168
  immediate: true,
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <SpinnerContainer v-if="fullWidth" data-test-id="spinner_full_container">
3
3
  <Container>
4
- <SpinnerWrapper data-test-id="spinner_full_wrapper">
4
+ <SpinnerWrapper data-test-id="spinner_full_wrapper" :size="size">
5
5
  <img
6
6
  :class="{ white: isWhite }"
7
7
  data-test-id="spinner_full_icon"
@@ -16,7 +16,7 @@
16
16
  data-test-id="spinner_container"
17
17
  :limited-to-modal="limitedToModal"
18
18
  >
19
- <SpinnerWrapper data-test-id="spinner_wrapper">
19
+ <SpinnerWrapper data-test-id="spinner_wrapper" :size="size">
20
20
  <img
21
21
  :class="{ white: isWhite }"
22
22
  data-test-id="spinner_full_icon"
@@ -55,7 +55,7 @@
55
55
  width: ${(props) => (props.limitedToModal ? '100%' : 'inherit')};
56
56
  `
57
57
 
58
- const SpinnerWrapper = styled.div`
58
+ const SpinnerWrapper = styled('div', { size: String })`
59
59
  width: ${(props) => (props.size ? props.size : '60px')};
60
60
  height: auto;
61
61