@eturnity/eturnity_reusable_components 8.7.5-qa-16-02-21.4 → 8.7.5-qa-16-02-21.6

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.7.5-qa-16-02-21.4",
3
+ "version": "8.7.5-qa-16-02-21.6",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -162,6 +162,7 @@
162
162
  :hovered-index="hoveredIndex"
163
163
  :hovered-value="hoveredValue"
164
164
  :is-active="isActive"
165
+ :is-fixed-dropdown-position="isFixedDropdownPosition"
165
166
  :is-parent-modal="isParentModal"
166
167
  :min-width="minWidth"
167
168
  :no-relative="noRelative"
@@ -394,12 +395,14 @@
394
395
  noRelative: Boolean,
395
396
  minWidth: String,
396
397
  isParentModal: Boolean,
398
+ isFixedDropdownPosition: Boolean,
397
399
  }
398
400
  const SelectDropdown = styled('div', selectDropdownAttrs)`
399
401
  box-sizing: border-box;
400
402
  z-index: ${(props) =>
401
403
  props.isActive ? '2' : props.isParentModal ? '9999999' : '99999'};
402
- position: absolute;
404
+ position: ${(props) =>
405
+ props.isFixedDropdownPosition ? 'fixed' : 'absolute'};
403
406
  top: 0px;
404
407
  left: 0px;
405
408
  border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
@@ -649,6 +652,11 @@
649
652
  type: String,
650
653
  required: false,
651
654
  },
655
+ isFixedDropdownPosition: {
656
+ type: Boolean,
657
+ required: false,
658
+ default: false,
659
+ },
652
660
  },
653
661
 
654
662
  data() {
@@ -673,10 +681,10 @@
673
681
  }
674
682
  },
675
683
  setup() {
676
- const rcModalRef = inject('rcModalRef')
684
+ const modalRef = inject('modalRef')
677
685
 
678
686
  return {
679
- rcModalRef,
687
+ modalRef,
680
688
  }
681
689
  },
682
690
  computed: {
@@ -735,7 +743,7 @@
735
743
  )
736
744
  },
737
745
  isParentModal() {
738
- return !!this.rcModalRef
746
+ return !!this.modalRef
739
747
  },
740
748
  },
741
749
  watch: {
@@ -750,7 +758,7 @@
750
758
  }, 10)
751
759
  await this.$nextTick()
752
760
  this.handleSetDropdownOffet()
753
- this.calculateSelectTopPosition()
761
+ if (!this.isFixedDropdownPosition) this.calculateSelectTopPosition()
754
762
  } else {
755
763
  this.dropdownPosition.left = null
756
764
  if (this.animationFrameId) {
@@ -788,7 +796,11 @@
788
796
  this.observeDropdownHeight()
789
797
  this.observeSelectWidth()
790
798
  window.addEventListener('resize', this.handleSetDropdownOffet)
791
- document.body.addEventListener('scroll', this.calculateSelectTopPosition)
799
+ if (!this.isFixedDropdownPosition)
800
+ document.body.addEventListener(
801
+ 'scroll',
802
+ this.calculateSelectTopPosition
803
+ )
792
804
  },
793
805
  beforeMount() {
794
806
  this.selectedValue = this.value
@@ -797,10 +809,12 @@
797
809
  window.removeEventListener('resize', this.handleSetDropdownOffet)
798
810
  if (this.dropdownResizeObserver) this.dropdownResizeObserver.disconnect()
799
811
  if (this.selectResizeObserver) this.selectResizeObserver.disconnect()
800
- document.body.removeEventListener(
801
- 'scroll',
802
- this.calculateSelectTopPosition
803
- )
812
+ if (!this.isFixedDropdownPosition) {
813
+ document.body.removeEventListener(
814
+ 'scroll',
815
+ this.calculateSelectTopPosition
816
+ )
817
+ }
804
818
  },
805
819
  unmounted() {
806
820
  document.removeEventListener('click', this.clickOutside)
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <PageWrapper
3
3
  v-if="isOpen"
4
- ref="rcModalRef"
4
+ ref="modalRef"
5
5
  :backdrop="backdrop"
6
6
  :is-open="isOpen"
7
7
  :position="position"
@@ -151,11 +151,11 @@
151
151
  },
152
152
  },
153
153
  setup() {
154
- const rcModalRef = ref(null)
155
- provide('rcModalRef', rcModalRef)
154
+ const modalRef = ref(null)
155
+ provide('modalRef', modalRef)
156
156
 
157
157
  return {
158
- rcModalRef,
158
+ modalRef,
159
159
  }
160
160
  },
161
161
  watch: {