@opentiny/vue-renderless 3.10.6 → 3.10.7
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/common/deps/popper.js +16 -8
- package/package.json +1 -1
package/common/deps/popper.js
CHANGED
|
@@ -21,6 +21,7 @@ const DEFAULTS = {
|
|
|
21
21
|
modifiers,
|
|
22
22
|
modifiersIgnored: []
|
|
23
23
|
};
|
|
24
|
+
const getRealWindow = () => window.tinyGetRealWindow ? window.tinyGetRealWindow() : window;
|
|
24
25
|
const getRealElement = (el) => el.jquery ? el[0] : el;
|
|
25
26
|
const setStyle = (el, styles) => {
|
|
26
27
|
const isNumeric = (n) => n !== "" && !isNaN(parseFloat(n)) && isFinite(n);
|
|
@@ -109,14 +110,17 @@ const getScrollParent = (el) => {
|
|
|
109
110
|
};
|
|
110
111
|
const getOffsetRectRelativeToCustomParent = (el, parent, fixed) => {
|
|
111
112
|
let { top, left, width, height } = getBoundingClientRect(el);
|
|
112
|
-
let parentRect = getBoundingClientRect(parent);
|
|
113
113
|
if (fixed) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
return {
|
|
115
|
+
top,
|
|
116
|
+
left,
|
|
117
|
+
bottom: top + height,
|
|
118
|
+
right: left + width,
|
|
119
|
+
width,
|
|
120
|
+
height
|
|
121
|
+
};
|
|
119
122
|
}
|
|
123
|
+
let parentRect = getBoundingClientRect(parent);
|
|
120
124
|
let rect = {
|
|
121
125
|
top: top - parentRect.top,
|
|
122
126
|
left: left - parentRect.left,
|
|
@@ -171,6 +175,9 @@ const getAllScrollParents = (el, parents = []) => {
|
|
|
171
175
|
const parent = el.parentNode;
|
|
172
176
|
if (parent) {
|
|
173
177
|
isScrollElement(parent) && parents.push(parent);
|
|
178
|
+
if (getStyleComputedProperty(parent, "position") === "fixed") {
|
|
179
|
+
return parents;
|
|
180
|
+
}
|
|
174
181
|
return getAllScrollParents(parent, parents);
|
|
175
182
|
}
|
|
176
183
|
return parents;
|
|
@@ -374,10 +381,11 @@ Popper.prototype._getBoundaries = function(data, padding, boundariesElement) {
|
|
|
374
381
|
let isFixed2 = data.offsets.popper.position === "fixed";
|
|
375
382
|
let scrollTop = isFixed2 ? 0 : getScrollTopValue(scrollParent);
|
|
376
383
|
let scrollLeft = isFixed2 ? 0 : getScrollLeftValue(scrollParent);
|
|
384
|
+
const viewportWindow = getRealWindow();
|
|
377
385
|
boundaries = {
|
|
378
386
|
top: 0 - (offsetParentRect.top - scrollTop),
|
|
379
|
-
right:
|
|
380
|
-
bottom:
|
|
387
|
+
right: viewportWindow.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
|
|
388
|
+
bottom: viewportWindow.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
|
|
381
389
|
left: 0 - (offsetParentRect.left - scrollLeft)
|
|
382
390
|
};
|
|
383
391
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-renderless",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.7",
|
|
4
4
|
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
|
|
5
5
|
"homepage": "https://opentiny.design/tiny-vue",
|
|
6
6
|
"keywords": [
|