uikit 3.17.9-dev.73842811 → 3.17.9-dev.77c1d012a
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/CHANGELOG.md +16 -2
- package/dist/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +2 -2
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +9 -9
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +9 -9
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +2 -2
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +21 -25
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +21 -25
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +6 -6
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +21 -25
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +6 -6
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +4 -4
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +41 -33
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +64 -67
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +94 -103
- package/dist/js/uikit.min.js +1 -1
- package/package.json +12 -12
- package/src/js/api/component.js +2 -2
- package/src/js/api/events.js +1 -6
- package/src/js/api/instance.js +5 -5
- package/src/js/api/observables.js +2 -2
- package/src/js/api/options.js +15 -14
- package/src/js/api/props.js +13 -15
- package/src/js/components/filter.js +1 -2
- package/src/js/components/notification.js +1 -2
- package/src/js/components/sortable.js +4 -5
- package/src/js/components/tooltip.js +30 -35
- package/src/js/core/accordion.js +1 -2
- package/src/js/core/drop.js +23 -20
- package/src/js/core/dropnav.js +2 -3
- package/src/js/core/form-custom.js +5 -5
- package/src/js/core/icon.js +5 -6
- package/src/js/core/navbar.js +1 -2
- package/src/js/core/overflow-auto.js +3 -3
- package/src/js/core/scroll.js +1 -2
- package/src/js/core/scrollspy-nav.js +1 -2
- package/src/js/core/sticky.js +2 -5
- package/src/js/core/switcher.js +10 -12
- package/src/js/core/tab.js +2 -2
- package/src/js/core/toggle.js +3 -5
- package/src/js/mixin/animate.js +7 -7
- package/src/js/mixin/internal/animate-fade.js +2 -2
- package/src/js/mixin/modal.js +4 -6
- package/src/js/mixin/slider-drag.js +1 -2
- package/src/js/mixin/slider-nav.js +7 -8
- package/src/js/mixin/togglable.js +8 -8
- package/src/js/util/dimensions.js +4 -4
- package/src/js/util/event.js +6 -7
- package/src/js/util/lang.js +10 -10
- package/src/js/util/position.js +1 -2
- package/src/js/util/selector.js +2 -2
- package/src/js/util/style.js +2 -2
- package/src/js/util/viewport.js +18 -14
package/src/js/core/scroll.js
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
on,
|
|
7
7
|
scrollIntoView,
|
|
8
8
|
trigger,
|
|
9
|
-
within,
|
|
10
9
|
} from 'uikit-util';
|
|
11
10
|
|
|
12
11
|
export default {
|
|
@@ -61,7 +60,7 @@ function clickHandler(e) {
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
for (const instance of instances) {
|
|
64
|
-
if (
|
|
63
|
+
if (instance.$el.contains(e.target) && isSameSiteAnchor(instance.$el)) {
|
|
65
64
|
e.preventDefault();
|
|
66
65
|
if (window.location.href !== instance.$el.href) {
|
|
67
66
|
window.history.pushState({}, '', instance.$el.href);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
$$,
|
|
3
|
-
closest,
|
|
4
3
|
getCoveringElement,
|
|
5
4
|
getTargetedElement,
|
|
6
5
|
hasClass,
|
|
@@ -35,7 +34,7 @@ export default {
|
|
|
35
34
|
links: (_, $el) => $$('a[href*="#"]', $el).filter((el) => el.hash && isSameSiteAnchor(el)),
|
|
36
35
|
|
|
37
36
|
elements({ closest: selector }) {
|
|
38
|
-
return this.links.map((el) => closest(
|
|
37
|
+
return this.links.map((el) => el.closest(selector || '*'));
|
|
39
38
|
},
|
|
40
39
|
},
|
|
41
40
|
|
package/src/js/core/sticky.js
CHANGED
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
toPx,
|
|
26
26
|
toggleClass,
|
|
27
27
|
trigger,
|
|
28
|
-
within,
|
|
29
28
|
} from 'uikit-util';
|
|
30
29
|
import { resize, scroll, viewport } from '../api/observables';
|
|
31
30
|
import Class from '../mixin/class';
|
|
@@ -253,7 +252,7 @@ export default {
|
|
|
253
252
|
|
|
254
253
|
css(placeholder, { height, width, margin });
|
|
255
254
|
|
|
256
|
-
if (!
|
|
255
|
+
if (!document.contains(placeholder)) {
|
|
257
256
|
placeholder.hidden = true;
|
|
258
257
|
}
|
|
259
258
|
(sticky ? before : after)(this.$el, placeholder);
|
|
@@ -456,9 +455,7 @@ function parseProp(value, el, propOffset, padding) {
|
|
|
456
455
|
const refElement = value === true ? parent(el) : query(value, el);
|
|
457
456
|
return (
|
|
458
457
|
getOffset(refElement).bottom -
|
|
459
|
-
(padding && refElement
|
|
460
|
-
? toFloat(css(refElement, 'paddingBottom'))
|
|
461
|
-
: 0)
|
|
458
|
+
(padding && refElement?.contains(el) ? toFloat(css(refElement, 'paddingBottom')) : 0)
|
|
462
459
|
);
|
|
463
460
|
}
|
|
464
461
|
}
|
package/src/js/core/switcher.js
CHANGED
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
$$,
|
|
3
3
|
attr,
|
|
4
4
|
children,
|
|
5
|
-
closest,
|
|
6
5
|
css,
|
|
7
6
|
data,
|
|
8
7
|
endsWith,
|
|
@@ -15,7 +14,6 @@ import {
|
|
|
15
14
|
queryAll,
|
|
16
15
|
toArray,
|
|
17
16
|
toggleClass,
|
|
18
|
-
within,
|
|
19
17
|
} from 'uikit-util';
|
|
20
18
|
import { generateId } from '../api/instance';
|
|
21
19
|
import { lazyload, swipe } from '../api/observables';
|
|
@@ -61,7 +59,7 @@ export default {
|
|
|
61
59
|
|
|
62
60
|
children(_, $el) {
|
|
63
61
|
return children($el).filter((child) =>
|
|
64
|
-
this.toggles.some((toggle) =>
|
|
62
|
+
this.toggles.some((toggle) => child.contains(toggle)),
|
|
65
63
|
);
|
|
66
64
|
},
|
|
67
65
|
},
|
|
@@ -132,14 +130,14 @@ export default {
|
|
|
132
130
|
keyCode === keyMap.HOME
|
|
133
131
|
? 0
|
|
134
132
|
: keyCode === keyMap.END
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
? 'last'
|
|
134
|
+
: (keyCode === keyMap.LEFT && !isVertical) ||
|
|
135
|
+
(keyCode === keyMap.UP && isVertical)
|
|
136
|
+
? 'previous'
|
|
137
|
+
: (keyCode === keyMap.RIGHT && !isVertical) ||
|
|
138
|
+
(keyCode === keyMap.DOWN && isVertical)
|
|
139
|
+
? 'next'
|
|
140
|
+
: -1;
|
|
143
141
|
|
|
144
142
|
if (~i) {
|
|
145
143
|
e.preventDefault();
|
|
@@ -165,7 +163,7 @@ export default {
|
|
|
165
163
|
},
|
|
166
164
|
|
|
167
165
|
handler(e) {
|
|
168
|
-
if (
|
|
166
|
+
if (e.target.closest('a,button')) {
|
|
169
167
|
e.preventDefault();
|
|
170
168
|
this.show(data(e.current, this.attrItem));
|
|
171
169
|
}
|
package/src/js/core/tab.js
CHANGED
|
@@ -21,8 +21,8 @@ export default {
|
|
|
21
21
|
const cls = hasClass(this.$el, 'uk-tab-left')
|
|
22
22
|
? 'uk-tab-left'
|
|
23
23
|
: hasClass(this.$el, 'uk-tab-right')
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
? 'uk-tab-right'
|
|
25
|
+
: false;
|
|
26
26
|
|
|
27
27
|
if (cls) {
|
|
28
28
|
this.$create('toggle', this.$el, { cls, mode: 'media', media: this.media });
|
package/src/js/core/toggle.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attr,
|
|
3
|
-
closest,
|
|
4
3
|
hasAttr,
|
|
5
4
|
hasClass,
|
|
6
5
|
includes,
|
|
@@ -15,7 +14,6 @@ import {
|
|
|
15
14
|
pointerLeave,
|
|
16
15
|
queryAll,
|
|
17
16
|
trigger,
|
|
18
|
-
within,
|
|
19
17
|
} from 'uikit-util';
|
|
20
18
|
import { lazyload } from '../api/observables';
|
|
21
19
|
import Media from '../mixin/media';
|
|
@@ -85,7 +83,7 @@ export default {
|
|
|
85
83
|
pointerDown,
|
|
86
84
|
() => trigger(this.$el, 'blur'),
|
|
87
85
|
true,
|
|
88
|
-
(e) => !
|
|
86
|
+
(e) => !this.$el.contains(e.target),
|
|
89
87
|
);
|
|
90
88
|
|
|
91
89
|
// Prevent initial click to prevent double toggle through focus + click
|
|
@@ -163,8 +161,8 @@ export default {
|
|
|
163
161
|
let link;
|
|
164
162
|
if (
|
|
165
163
|
this._preventClick ||
|
|
166
|
-
|
|
167
|
-
((link =
|
|
164
|
+
e.target.closest('a[href="#"], a[href=""]') ||
|
|
165
|
+
((link = e.target.closest('a[href]')) &&
|
|
168
166
|
(!this.isToggled(this.target) ||
|
|
169
167
|
(link.hash && matches(this.target, link.hash))))
|
|
170
168
|
) {
|
package/src/js/mixin/animate.js
CHANGED
|
@@ -20,13 +20,13 @@ export default {
|
|
|
20
20
|
name === 'fade'
|
|
21
21
|
? fade
|
|
22
22
|
: name === 'delayed-fade'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
? (...args) => fade(...args, 40)
|
|
24
|
+
: name
|
|
25
|
+
? slide
|
|
26
|
+
: () => {
|
|
27
|
+
action();
|
|
28
|
+
return Promise.resolve();
|
|
29
|
+
};
|
|
30
30
|
|
|
31
31
|
return animationFn(action, target, this.duration).catch(noop);
|
|
32
32
|
},
|
|
@@ -93,8 +93,8 @@ export default function fade(action, target, duration, stagger = 0) {
|
|
|
93
93
|
return hasClass(target, clsLeave)
|
|
94
94
|
? waitTransitionend(target).then(enterFn)
|
|
95
95
|
: hasClass(target, clsEnter)
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
? waitTransitionend(target).then(leaveFn).then(enterFn)
|
|
97
|
+
: leaveFn().then(enterFn);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
function transitionIndex(target, next) {
|
package/src/js/mixin/modal.js
CHANGED
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
pointerUp,
|
|
19
19
|
removeClass,
|
|
20
20
|
toFloat,
|
|
21
|
-
within,
|
|
22
21
|
} from 'uikit-util';
|
|
23
22
|
import Class from './class';
|
|
24
23
|
import Container from './container';
|
|
@@ -89,8 +88,7 @@ export default {
|
|
|
89
88
|
!defaultPrevented &&
|
|
90
89
|
hash &&
|
|
91
90
|
isSameSiteAnchor(current) &&
|
|
92
|
-
!
|
|
93
|
-
$(hash, document.body)
|
|
91
|
+
!this.$el.contains($(hash))
|
|
94
92
|
) {
|
|
95
93
|
this.hide();
|
|
96
94
|
} else if (matches(current, this.selClose)) {
|
|
@@ -259,7 +257,7 @@ function toMs(time) {
|
|
|
259
257
|
|
|
260
258
|
function preventBackgroundFocus(modal) {
|
|
261
259
|
return on(document, 'focusin', (e) => {
|
|
262
|
-
if (last(active) === modal && !
|
|
260
|
+
if (last(active) === modal && !modal.$el.contains(e.target)) {
|
|
263
261
|
modal.$el.focus();
|
|
264
262
|
}
|
|
265
263
|
});
|
|
@@ -269,8 +267,8 @@ function listenForBackgroundClose(modal) {
|
|
|
269
267
|
return on(document, pointerDown, ({ target }) => {
|
|
270
268
|
if (
|
|
271
269
|
last(active) !== modal ||
|
|
272
|
-
(modal.overlay && !
|
|
273
|
-
|
|
270
|
+
(modal.overlay && !modal.$el.contains(target)) ||
|
|
271
|
+
modal.panel.contains(target)
|
|
274
272
|
) {
|
|
275
273
|
return;
|
|
276
274
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
closest,
|
|
3
2
|
css,
|
|
4
3
|
getEventPos,
|
|
5
4
|
includes,
|
|
@@ -57,7 +56,7 @@ export default {
|
|
|
57
56
|
if (
|
|
58
57
|
!this.draggable ||
|
|
59
58
|
(!isTouch(e) && hasSelectableText(e.target)) ||
|
|
60
|
-
|
|
59
|
+
e.target.closest(selInput) ||
|
|
61
60
|
e.button > 0 ||
|
|
62
61
|
this.length < 2
|
|
63
62
|
) {
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
append,
|
|
5
5
|
attr,
|
|
6
6
|
children,
|
|
7
|
-
closest,
|
|
8
7
|
data,
|
|
9
8
|
empty,
|
|
10
9
|
isNumeric,
|
|
@@ -151,7 +150,7 @@ export default {
|
|
|
151
150
|
|
|
152
151
|
handler(e) {
|
|
153
152
|
if (
|
|
154
|
-
|
|
153
|
+
e.target.closest('a,button') &&
|
|
155
154
|
(e.type === 'click' || e.keyCode === keyMap.SPACE)
|
|
156
155
|
) {
|
|
157
156
|
e.preventDefault();
|
|
@@ -184,12 +183,12 @@ export default {
|
|
|
184
183
|
keyCode === keyMap.HOME
|
|
185
184
|
? 0
|
|
186
185
|
: keyCode === keyMap.END
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
? 'last'
|
|
187
|
+
: keyCode === keyMap.LEFT
|
|
188
|
+
? 'previous'
|
|
189
|
+
: keyCode === keyMap.RIGHT
|
|
190
|
+
? 'next'
|
|
191
|
+
: -1;
|
|
193
192
|
|
|
194
193
|
if (~i) {
|
|
195
194
|
e.preventDefault();
|
|
@@ -64,10 +64,10 @@ export default {
|
|
|
64
64
|
isFunction(animate)
|
|
65
65
|
? animate
|
|
66
66
|
: animate === false || !this.hasAnimation
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
? toggleInstant
|
|
68
|
+
: this.hasTransition
|
|
69
|
+
? toggleTransition
|
|
70
|
+
: toggleAnimation
|
|
71
71
|
)(el, show, this);
|
|
72
72
|
|
|
73
73
|
const cls = show ? this.clsEnter : this.clsLeave;
|
|
@@ -100,10 +100,10 @@ export default {
|
|
|
100
100
|
return hasClass(el, this.clsEnter)
|
|
101
101
|
? true
|
|
102
102
|
: hasClass(el, this.clsLeave)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
? false
|
|
104
|
+
: this.cls
|
|
105
|
+
? hasClass(el, this.cls.split(' ')[0])
|
|
106
|
+
: isVisible(el);
|
|
107
107
|
},
|
|
108
108
|
|
|
109
109
|
_toggle(el, toggled) {
|
|
@@ -178,10 +178,10 @@ export function toPx(value, property = 'width', element = window, offsetDim = fa
|
|
|
178
178
|
unit === 'vh'
|
|
179
179
|
? getViewportHeight()
|
|
180
180
|
: unit === 'vw'
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
? width(toWindow(element))
|
|
182
|
+
: offsetDim
|
|
183
|
+
? element[`offset${ucfirst(property)}`]
|
|
184
|
+
: dimensions(element)[property],
|
|
185
185
|
value,
|
|
186
186
|
)
|
|
187
187
|
: value;
|
package/src/js/util/event.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { closest, within } from './filter';
|
|
2
1
|
import { isArray, isFunction, isString, toNode, toNodes } from './lang';
|
|
3
2
|
import { findAll } from './selector';
|
|
4
3
|
|
|
@@ -91,8 +90,8 @@ function delegate(selector, listener) {
|
|
|
91
90
|
selector[0] === '>'
|
|
92
91
|
? findAll(selector, e.currentTarget)
|
|
93
92
|
.reverse()
|
|
94
|
-
.
|
|
95
|
-
:
|
|
93
|
+
.find((element) => element.contains(e.target))
|
|
94
|
+
: e.target.closest(selector);
|
|
96
95
|
|
|
97
96
|
if (current) {
|
|
98
97
|
e.current = current;
|
|
@@ -126,10 +125,10 @@ export function toEventTargets(target) {
|
|
|
126
125
|
return isArray(target)
|
|
127
126
|
? target.map(toEventTarget).filter(Boolean)
|
|
128
127
|
: isString(target)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
? findAll(target)
|
|
129
|
+
: isEventTarget(target)
|
|
130
|
+
? [target]
|
|
131
|
+
: toNodes(target);
|
|
133
132
|
}
|
|
134
133
|
|
|
135
134
|
export function isTouch(e) {
|
package/src/js/util/lang.js
CHANGED
|
@@ -95,10 +95,10 @@ export function toBoolean(value) {
|
|
|
95
95
|
return isBoolean(value)
|
|
96
96
|
? value
|
|
97
97
|
: value === 'true' || value === '1' || value === ''
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
? true
|
|
99
|
+
: value === 'false' || value === '0'
|
|
100
|
+
? false
|
|
101
|
+
: value;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
export function toNumber(value) {
|
|
@@ -258,12 +258,12 @@ export function getIndex(i, elements, current = 0, finite = false) {
|
|
|
258
258
|
i = isNumeric(i)
|
|
259
259
|
? toNumber(i)
|
|
260
260
|
: i === 'next'
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
? current + 1
|
|
262
|
+
: i === 'previous'
|
|
263
|
+
? current - 1
|
|
264
|
+
: i === 'last'
|
|
265
|
+
? length - 1
|
|
266
|
+
: elements.indexOf(toNode(i));
|
|
267
267
|
|
|
268
268
|
if (finite) {
|
|
269
269
|
return clamp(i, 0, length - 1);
|
package/src/js/util/position.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { offset } from './dimensions';
|
|
2
|
-
import { within } from './filter';
|
|
3
2
|
import { clamp, isArray, ucfirst } from './lang';
|
|
4
3
|
import { css } from './style';
|
|
5
4
|
import { offsetViewport, overflowParents } from './viewport';
|
|
@@ -169,7 +168,7 @@ function getScrollArea(element, target, viewportOffset, i) {
|
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
function commonScrollParents(element, target) {
|
|
172
|
-
return overflowParents(target).filter((parent) =>
|
|
171
|
+
return overflowParents(target).filter((parent) => parent.contains(element));
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
function getIntersectionArea(...rects) {
|
package/src/js/util/selector.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { attr } from './attr';
|
|
2
|
-
import {
|
|
2
|
+
import { index, matches, parent } from './filter';
|
|
3
3
|
import { isDocument, isString, memoize, toNode, toNodes } from './lang';
|
|
4
4
|
|
|
5
5
|
export function query(selector, context) {
|
|
@@ -45,7 +45,7 @@ function _query(selector, context = document, queryFn) {
|
|
|
45
45
|
|
|
46
46
|
if (sel[0] === '!') {
|
|
47
47
|
const selectors = sel.substr(1).trim().split(' ');
|
|
48
|
-
ctx =
|
|
48
|
+
ctx = parent(context).closest(selectors[0]);
|
|
49
49
|
sel = selectors.slice(1).join(' ').trim();
|
|
50
50
|
if (!sel.length && split.length === 1) {
|
|
51
51
|
return ctx;
|
package/src/js/util/style.js
CHANGED
package/src/js/util/viewport.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { offset, offsetPosition } from './dimensions';
|
|
2
|
-
import { isVisible, parent, parents
|
|
2
|
+
import { isVisible, parent, parents } from './filter';
|
|
3
3
|
import {
|
|
4
4
|
clamp,
|
|
5
5
|
findIndex,
|
|
@@ -199,21 +199,25 @@ export function offsetViewport(scrollElement) {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
export function getCoveringElement(target) {
|
|
202
|
-
return target.ownerDocument
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
(el)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
202
|
+
return target.ownerDocument.elementsFromPoint(offset(target).left, 0).find(
|
|
203
|
+
(el) =>
|
|
204
|
+
!el.contains(target) &&
|
|
205
|
+
((hasPosition(el, 'fixed') &&
|
|
206
|
+
zIndex(
|
|
207
|
+
parents(target)
|
|
208
|
+
.reverse()
|
|
209
|
+
.find((parent) => !parent.contains(el) && !hasPosition(parent, 'static')),
|
|
210
|
+
) < zIndex(el)) ||
|
|
211
|
+
(hasPosition(el, 'sticky') && parent(el).contains(target))),
|
|
212
|
+
);
|
|
210
213
|
}
|
|
211
214
|
|
|
212
|
-
function
|
|
213
|
-
return (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
function zIndex(element) {
|
|
216
|
+
return toFloat(css(element, 'zIndex'));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function hasPosition(element, position) {
|
|
220
|
+
return css(element, 'position') === position;
|
|
217
221
|
}
|
|
218
222
|
|
|
219
223
|
function scrollingElement(element) {
|