uikit 3.17.9-dev.9f100be74 → 3.17.9-dev.f43c05fb3
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 +10 -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 +6 -6
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +6 -6
- 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 +3 -3
- 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 +3 -3
- 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 +2 -2
- 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 +54 -47
- 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 +62 -55
- 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/instance.js +2 -2
- package/src/js/api/observables.js +2 -2
- package/src/js/api/options.js +14 -14
- 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 +1 -2
- 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 +25 -16
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,
|
|
@@ -70,7 +70,9 @@ export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
|
|
|
70
70
|
const scroll = element.scrollTop;
|
|
71
71
|
const duration = getDuration(Math.abs(top));
|
|
72
72
|
const start = Date.now();
|
|
73
|
-
const
|
|
73
|
+
const isScrollingElement = scrollingElement(element) === element;
|
|
74
|
+
const targetTop = offset(targetEl).top + (isScrollingElement ? 0 : scroll);
|
|
75
|
+
|
|
74
76
|
let prev = 0;
|
|
75
77
|
let frames = 15;
|
|
76
78
|
|
|
@@ -78,7 +80,10 @@ export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
|
|
|
78
80
|
const percent = ease(clamp((Date.now() - start) / duration));
|
|
79
81
|
let diff = 0;
|
|
80
82
|
if (parents[0] === element && scroll + top < maxScroll) {
|
|
81
|
-
diff =
|
|
83
|
+
diff =
|
|
84
|
+
offset(targetEl).top +
|
|
85
|
+
(isScrollingElement ? 0 : element.scrollTop) -
|
|
86
|
+
targetTop;
|
|
82
87
|
const coverEl = getCoveringElement(targetEl);
|
|
83
88
|
diff -= coverEl ? offset(coverEl).height : 0;
|
|
84
89
|
}
|
|
@@ -199,21 +204,25 @@ export function offsetViewport(scrollElement) {
|
|
|
199
204
|
}
|
|
200
205
|
|
|
201
206
|
export function getCoveringElement(target) {
|
|
202
|
-
return target.ownerDocument
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
(el)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
return target.ownerDocument.elementsFromPoint(offset(target).left, 0).find(
|
|
208
|
+
(el) =>
|
|
209
|
+
!el.contains(target) &&
|
|
210
|
+
((hasPosition(el, 'fixed') &&
|
|
211
|
+
zIndex(
|
|
212
|
+
parents(target)
|
|
213
|
+
.reverse()
|
|
214
|
+
.find((parent) => !parent.contains(el) && !hasPosition(parent, 'static')),
|
|
215
|
+
) < zIndex(el)) ||
|
|
216
|
+
(hasPosition(el, 'sticky') && parent(el).contains(target))),
|
|
217
|
+
);
|
|
210
218
|
}
|
|
211
219
|
|
|
212
|
-
function
|
|
213
|
-
return (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
function zIndex(element) {
|
|
221
|
+
return toFloat(css(element, 'zIndex'));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function hasPosition(element, position) {
|
|
225
|
+
return css(element, 'position') === position;
|
|
217
226
|
}
|
|
218
227
|
|
|
219
228
|
function scrollingElement(element) {
|