@eturnity/eturnity_reusable_components 8.7.5-qa-16-02-21.3 → 8.7.5-qa-16-02-21.4
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
@@ -162,6 +162,7 @@
|
|
162
162
|
:hovered-index="hoveredIndex"
|
163
163
|
:hovered-value="hoveredValue"
|
164
164
|
:is-active="isActive"
|
165
|
+
:is-parent-modal="isParentModal"
|
165
166
|
:min-width="minWidth"
|
166
167
|
:no-relative="noRelative"
|
167
168
|
:option-width="getOptionWidth"
|
@@ -208,7 +209,7 @@
|
|
208
209
|
// </template>
|
209
210
|
// </Select>
|
210
211
|
|
211
|
-
import { Teleport } from 'vue'
|
212
|
+
import { Teleport, inject } from 'vue'
|
212
213
|
import styled from 'vue3-styled-components'
|
213
214
|
import InfoText from '../../infoText'
|
214
215
|
import Icon from '../../icon'
|
@@ -392,10 +393,12 @@
|
|
392
393
|
selectedValue: Number | String,
|
393
394
|
noRelative: Boolean,
|
394
395
|
minWidth: String,
|
396
|
+
isParentModal: Boolean,
|
395
397
|
}
|
396
398
|
const SelectDropdown = styled('div', selectDropdownAttrs)`
|
397
399
|
box-sizing: border-box;
|
398
|
-
z-index: ${(props) =>
|
400
|
+
z-index: ${(props) =>
|
401
|
+
props.isActive ? '2' : props.isParentModal ? '9999999' : '99999'};
|
399
402
|
position: absolute;
|
400
403
|
top: 0px;
|
401
404
|
left: 0px;
|
@@ -669,6 +672,13 @@
|
|
669
672
|
animationFrameId: null,
|
670
673
|
}
|
671
674
|
},
|
675
|
+
setup() {
|
676
|
+
const rcModalRef = inject('rcModalRef')
|
677
|
+
|
678
|
+
return {
|
679
|
+
rcModalRef,
|
680
|
+
}
|
681
|
+
},
|
672
682
|
computed: {
|
673
683
|
optionLength() {
|
674
684
|
if (this.isDropdownOpen) {
|
@@ -724,6 +734,9 @@
|
|
724
734
|
/windows phone/i.test(userAgent)
|
725
735
|
)
|
726
736
|
},
|
737
|
+
isParentModal() {
|
738
|
+
return !!this.rcModalRef
|
739
|
+
},
|
727
740
|
},
|
728
741
|
watch: {
|
729
742
|
value(val) {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<PageWrapper
|
3
3
|
v-if="isOpen"
|
4
|
+
ref="rcModalRef"
|
4
5
|
:backdrop="backdrop"
|
5
6
|
:is-open="isOpen"
|
6
7
|
:position="position"
|
@@ -30,6 +31,7 @@
|
|
30
31
|
// <div>Data....</div>
|
31
32
|
// </modal>
|
32
33
|
|
34
|
+
import { ref, provide } from 'vue'
|
33
35
|
import styled from 'vue3-styled-components'
|
34
36
|
import CloseButton from '../../buttons/closeButton'
|
35
37
|
import Spinner from '../../spinner'
|
@@ -148,44 +150,34 @@
|
|
148
150
|
default: 'auto',
|
149
151
|
},
|
150
152
|
},
|
153
|
+
setup() {
|
154
|
+
const rcModalRef = ref(null)
|
155
|
+
provide('rcModalRef', rcModalRef)
|
156
|
+
|
157
|
+
return {
|
158
|
+
rcModalRef,
|
159
|
+
}
|
160
|
+
},
|
151
161
|
watch: {
|
152
162
|
isOpen: {
|
153
163
|
immediate: true,
|
154
164
|
handler(isOpen) {
|
155
|
-
|
156
|
-
if (
|
165
|
+
document.body.style.overflow = isOpen ? 'hidden' : null
|
166
|
+
if (isOpen) {
|
167
|
+
window.addEventListener('keydown', this.handleKeyDown)
|
168
|
+
} else {
|
157
169
|
window.removeEventListener('keydown', this.handleKeyDown)
|
158
170
|
}
|
159
171
|
},
|
160
172
|
},
|
161
173
|
},
|
162
174
|
beforeUnmount() {
|
163
|
-
|
175
|
+
document.body.style.overflow = null
|
164
176
|
window.removeEventListener('keydown', this.handleKeyDown)
|
165
177
|
},
|
166
178
|
methods: {
|
167
|
-
setElementsStyle(isOpen) {
|
168
|
-
this.setSelectDropdownsStyle(isOpen)
|
169
|
-
document.body.style.overflow = isOpen ? 'hidden' : null
|
170
|
-
},
|
171
|
-
setSelectDropdownsStyle(isOpen) {
|
172
|
-
const zIndex = isOpen ? '9999999' : '99999'
|
173
|
-
const items = document.getElementsByClassName('rc-select-dropdown')
|
174
|
-
|
175
|
-
const updateZIndex = () => {
|
176
|
-
Array.from(items).forEach((item) => {
|
177
|
-
item.style.zIndex = zIndex
|
178
|
-
})
|
179
|
-
}
|
180
|
-
|
181
|
-
if (isOpen) {
|
182
|
-
setTimeout(updateZIndex, 100)
|
183
|
-
} else {
|
184
|
-
updateZIndex()
|
185
|
-
}
|
186
|
-
},
|
187
179
|
onCloseModal() {
|
188
|
-
|
180
|
+
document.body.style.overflow = null
|
189
181
|
this.$emit('on-close')
|
190
182
|
},
|
191
183
|
handleKeyDown({ key }) {
|