uikit 3.13.11-dev.eb080f280 → 3.14.0
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 +6 -2
- package/dist/css/uikit-core-rtl.css +4 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +4 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +4 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +4 -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 +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +4 -2
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +4 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +2 -2
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +4 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +1 -1
- 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 +86 -58
- 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 +90 -60
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/slider.js +1 -1
- package/src/js/core/cover.js +27 -14
- package/src/js/core/drop.js +22 -2
- package/src/js/core/height-match.js +1 -1
- package/src/js/core/margin.js +9 -2
- package/src/js/core/scrollspy-nav.js +2 -2
- package/src/js/mixin/parallax.js +3 -2
- package/src/js/util/lang.js +34 -38
- package/src/js/util/position.js +9 -9
- package/src/less/components/nav.less +1 -0
- package/src/less/components/utility.less +1 -0
- package/src/scss/components/nav.scss +1 -0
- package/src/scss/components/utility.scss +1 -0
- package/tests/alert.html +1 -1
- package/tests/drop.html +154 -80
- package/tests/navbar.html +1 -1
- package/tests/parallax.html +1 -1
- package/tests/sticky-parallax.html +8 -8
- package/tests/sticky.html +4 -4
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "uikit",
|
|
3
3
|
"title": "UIkit",
|
|
4
4
|
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.14.0",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
let left = 0;
|
|
80
80
|
const sets = [];
|
|
81
81
|
const width = dimensions(this.list).width;
|
|
82
|
-
for (let i
|
|
82
|
+
for (let i = 0; i < this.slides.length; i++) {
|
|
83
83
|
const slideWidth = dimensions(this.slides[i]).width;
|
|
84
84
|
|
|
85
85
|
if (left + slideWidth > width) {
|
package/src/js/core/cover.js
CHANGED
|
@@ -26,25 +26,38 @@ export default {
|
|
|
26
26
|
|
|
27
27
|
update: {
|
|
28
28
|
read() {
|
|
29
|
-
const
|
|
30
|
-
const {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
width: this.width || el.naturalWidth || el.videoWidth || el.clientWidth,
|
|
35
|
-
height: this.height || el.naturalHeight || el.videoHeight || el.clientHeight,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
width: width + (width % 2 ? 1 : 0),
|
|
39
|
-
height: height + (height % 2 ? 1 : 0),
|
|
40
|
-
}
|
|
41
|
-
);
|
|
29
|
+
const { ratio, cover } = Dimensions;
|
|
30
|
+
const { $el, width, height } = this;
|
|
31
|
+
|
|
32
|
+
let dim = { width, height };
|
|
42
33
|
|
|
43
34
|
if (!dim.width || !dim.height) {
|
|
35
|
+
const intrinsic = {
|
|
36
|
+
width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,
|
|
37
|
+
height: $el.naturalHeight || $el.videoHeight || $el.clientHeight,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
if (dim.width) {
|
|
41
|
+
dim = ratio(intrinsic, 'width', dim.width);
|
|
42
|
+
} else if (height) {
|
|
43
|
+
dim = ratio(intrinsic, 'height', dim.height);
|
|
44
|
+
} else {
|
|
45
|
+
dim = intrinsic;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const { offsetHeight: coverHeight, offsetWidth: coverWidth } =
|
|
50
|
+
getPositionedParent($el) || parent($el);
|
|
51
|
+
const coverDim = cover(dim, {
|
|
52
|
+
width: coverWidth + (coverWidth % 2 ? 1 : 0),
|
|
53
|
+
height: coverHeight + (coverHeight % 2 ? 1 : 0),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
if (!coverDim.width || !coverDim.height) {
|
|
44
57
|
return false;
|
|
45
58
|
}
|
|
46
59
|
|
|
47
|
-
return
|
|
60
|
+
return coverDim;
|
|
48
61
|
},
|
|
49
62
|
|
|
50
63
|
write({ height, width }) {
|
package/src/js/core/drop.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
isTouch,
|
|
14
14
|
matches,
|
|
15
15
|
MouseTracker,
|
|
16
|
+
observeResize,
|
|
16
17
|
offset,
|
|
17
18
|
offsetViewport,
|
|
18
19
|
on,
|
|
@@ -44,6 +45,7 @@ export default {
|
|
|
44
45
|
boundaryAlign: Boolean,
|
|
45
46
|
delayShow: Number,
|
|
46
47
|
delayHide: Number,
|
|
48
|
+
display: String,
|
|
47
49
|
clsDrop: String,
|
|
48
50
|
},
|
|
49
51
|
|
|
@@ -54,6 +56,7 @@ export default {
|
|
|
54
56
|
boundaryAlign: false,
|
|
55
57
|
delayShow: 0,
|
|
56
58
|
delayHide: 800,
|
|
59
|
+
display: null,
|
|
57
60
|
clsDrop: false,
|
|
58
61
|
animation: ['uk-animation-fade'],
|
|
59
62
|
cls: 'uk-open',
|
|
@@ -244,7 +247,23 @@ export default {
|
|
|
244
247
|
this.hide(false);
|
|
245
248
|
}
|
|
246
249
|
}),
|
|
247
|
-
|
|
250
|
+
|
|
251
|
+
...(this.display === 'static'
|
|
252
|
+
? []
|
|
253
|
+
: (() => {
|
|
254
|
+
const handler = () => this.$emit();
|
|
255
|
+
return [
|
|
256
|
+
on(window, 'resize', handler),
|
|
257
|
+
on(document, 'scroll', handler, true),
|
|
258
|
+
(() => {
|
|
259
|
+
const observer = observeResize(
|
|
260
|
+
scrollParents(this.$el),
|
|
261
|
+
handler
|
|
262
|
+
);
|
|
263
|
+
return () => observer.disconnect();
|
|
264
|
+
})(),
|
|
265
|
+
];
|
|
266
|
+
})()),
|
|
248
267
|
]) {
|
|
249
268
|
once(this.$el, 'hide', handler, { self: true });
|
|
250
269
|
}
|
|
@@ -364,7 +383,8 @@ export default {
|
|
|
364
383
|
const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
|
|
365
384
|
|
|
366
385
|
css(this.$el, 'maxWidth', '');
|
|
367
|
-
const maxWidth =
|
|
386
|
+
const maxWidth =
|
|
387
|
+
scrollParentOffset.width - (this.boundaryAlign ? 0 : 2 * this.viewportPadding);
|
|
368
388
|
|
|
369
389
|
if (this.pos[1] === 'justify') {
|
|
370
390
|
const prop = this.axis === 'y' ? 'width' : 'height';
|
package/src/js/core/margin.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import Resize from '../mixin/resize';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
isRtl,
|
|
4
|
+
isVisible,
|
|
5
|
+
observeMutation,
|
|
6
|
+
offsetPosition,
|
|
7
|
+
toArray,
|
|
8
|
+
toggleClass,
|
|
9
|
+
} from 'uikit-util';
|
|
3
10
|
|
|
4
11
|
export default {
|
|
5
12
|
mixins: [Resize],
|
|
@@ -15,7 +22,7 @@ export default {
|
|
|
15
22
|
},
|
|
16
23
|
|
|
17
24
|
resizeTargets() {
|
|
18
|
-
return [this.$el, this.$el.children];
|
|
25
|
+
return [this.$el, ...toArray(this.$el.children)];
|
|
19
26
|
},
|
|
20
27
|
|
|
21
28
|
connected() {
|
|
@@ -71,7 +71,7 @@ export default {
|
|
|
71
71
|
if (scrollTop === max) {
|
|
72
72
|
active = length - 1;
|
|
73
73
|
} else {
|
|
74
|
-
for (
|
|
74
|
+
for (let i = 0; i < targets.length; i++) {
|
|
75
75
|
if (offset(targets[i]).top - viewport.top - this.offset > 0) {
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
@@ -90,7 +90,7 @@ export default {
|
|
|
90
90
|
const changed = active !== false && !hasClass(this.elements[active], this.cls);
|
|
91
91
|
|
|
92
92
|
this.links.forEach((el) => el.blur());
|
|
93
|
-
for (
|
|
93
|
+
for (let i = 0; i < this.elements.length; i++) {
|
|
94
94
|
toggleClass(this.elements[i], this.cls, +i === active);
|
|
95
95
|
}
|
|
96
96
|
|
package/src/js/mixin/parallax.js
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
createEvent,
|
|
5
5
|
css,
|
|
6
6
|
Dimensions,
|
|
7
|
-
each,
|
|
8
7
|
findIndex,
|
|
9
8
|
isNumber,
|
|
10
9
|
isString,
|
|
@@ -65,7 +64,9 @@ export default {
|
|
|
65
64
|
|
|
66
65
|
methods: {
|
|
67
66
|
reset() {
|
|
68
|
-
|
|
67
|
+
for (const prop in this.getCss(0)) {
|
|
68
|
+
css(this.$el, prop, '');
|
|
69
|
+
}
|
|
69
70
|
},
|
|
70
71
|
|
|
71
72
|
getCss(percent) {
|
package/src/js/util/lang.js
CHANGED
|
@@ -200,48 +200,44 @@ export function pointInRect(point, rect) {
|
|
|
200
200
|
);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const aProp = prop === 'width' ? 'height' : 'width';
|
|
206
|
-
|
|
207
|
-
return {
|
|
208
|
-
[aProp]: dimensions[prop]
|
|
209
|
-
? Math.round((value * dimensions[aProp]) / dimensions[prop])
|
|
210
|
-
: dimensions[aProp],
|
|
211
|
-
[prop]: value,
|
|
212
|
-
};
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
contain(dimensions, maxDimensions) {
|
|
216
|
-
dimensions = { ...dimensions };
|
|
217
|
-
|
|
218
|
-
each(
|
|
219
|
-
dimensions,
|
|
220
|
-
(_, prop) =>
|
|
221
|
-
(dimensions =
|
|
222
|
-
dimensions[prop] > maxDimensions[prop]
|
|
223
|
-
? this.ratio(dimensions, prop, maxDimensions[prop])
|
|
224
|
-
: dimensions)
|
|
225
|
-
);
|
|
203
|
+
function ratio(dimensions, prop, value) {
|
|
204
|
+
const aProp = prop === 'width' ? 'height' : 'width';
|
|
226
205
|
|
|
227
|
-
|
|
228
|
-
|
|
206
|
+
return {
|
|
207
|
+
[aProp]: dimensions[prop]
|
|
208
|
+
? Math.round((value * dimensions[aProp]) / dimensions[prop])
|
|
209
|
+
: dimensions[aProp],
|
|
210
|
+
[prop]: value,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
229
213
|
|
|
230
|
-
|
|
231
|
-
|
|
214
|
+
function contain(dimensions, maxDimensions) {
|
|
215
|
+
dimensions = { ...dimensions };
|
|
232
216
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
(dimensions
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
217
|
+
for (const prop in dimensions) {
|
|
218
|
+
dimensions =
|
|
219
|
+
dimensions[prop] > maxDimensions[prop]
|
|
220
|
+
? ratio(dimensions, prop, maxDimensions[prop])
|
|
221
|
+
: dimensions;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return dimensions;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function cover(dimensions, maxDimensions) {
|
|
228
|
+
dimensions = contain(dimensions, maxDimensions);
|
|
229
|
+
|
|
230
|
+
for (const prop in dimensions) {
|
|
231
|
+
dimensions =
|
|
232
|
+
dimensions[prop] < maxDimensions[prop]
|
|
233
|
+
? ratio(dimensions, prop, maxDimensions[prop])
|
|
234
|
+
: dimensions;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return dimensions;
|
|
238
|
+
}
|
|
241
239
|
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
};
|
|
240
|
+
export const Dimensions = { ratio, contain, cover };
|
|
245
241
|
|
|
246
242
|
export function getIndex(i, elements, current = 0, finite = false) {
|
|
247
243
|
elements = toNodes(elements);
|
package/src/js/util/position.js
CHANGED
|
@@ -38,8 +38,7 @@ function attachTo(element, target, options) {
|
|
|
38
38
|
|
|
39
39
|
const position = offset(element);
|
|
40
40
|
const targetOffset = offset(target);
|
|
41
|
-
for (const i
|
|
42
|
-
const [prop, dir, start, end] = dirs[i];
|
|
41
|
+
for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
|
|
43
42
|
position[start] = position[dir] =
|
|
44
43
|
targetOffset[start] +
|
|
45
44
|
moveBy(attach.target[i], end, targetOffset[prop]) -
|
|
@@ -53,8 +52,6 @@ function attachTo(element, target, options) {
|
|
|
53
52
|
function attachToWithFlip(element, target, options) {
|
|
54
53
|
const position = attachTo(element, target, options);
|
|
55
54
|
const targetDim = offset(target);
|
|
56
|
-
const viewports = scrollParents(element, /auto|scroll/);
|
|
57
|
-
const [scrollElement] = viewports;
|
|
58
55
|
|
|
59
56
|
let {
|
|
60
57
|
flip,
|
|
@@ -65,12 +62,15 @@ function attachToWithFlip(element, target, options) {
|
|
|
65
62
|
viewportPadding,
|
|
66
63
|
} = options;
|
|
67
64
|
|
|
65
|
+
let viewports = scrollParents(element);
|
|
66
|
+
if (boundary === target) {
|
|
67
|
+
viewports = viewports.filter((viewport) => viewport !== boundary);
|
|
68
|
+
}
|
|
69
|
+
const [scrollElement] = viewports;
|
|
68
70
|
viewports.push(viewport);
|
|
69
71
|
|
|
70
72
|
const offsetPosition = { ...position };
|
|
71
|
-
for (const i
|
|
72
|
-
const [prop, dir, start, end] = dirs[i];
|
|
73
|
-
|
|
73
|
+
for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
|
|
74
74
|
if (flip !== true && !includes(flip, dir)) {
|
|
75
75
|
continue;
|
|
76
76
|
}
|
|
@@ -85,7 +85,7 @@ function attachToWithFlip(element, target, options) {
|
|
|
85
85
|
viewport[end] -= viewportPadding;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
if (boundary && !
|
|
88
|
+
if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
|
|
89
89
|
viewport = getIntersectionArea(viewport, offset(boundary));
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -202,7 +202,7 @@ function intersectLine(dimA, dimB, dir) {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
function flipDir(prop) {
|
|
205
|
-
for (
|
|
205
|
+
for (let i = 0; i < dirs.length; i++) {
|
|
206
206
|
const index = dirs[i].indexOf(prop);
|
|
207
207
|
if (~index) {
|
|
208
208
|
return dirs[1 - i][(index % 2) + 2];
|
|
@@ -152,6 +152,7 @@ $dragover-box-shadow: 0 0 20px rgba(100,100,100,0.3)
|
|
|
152
152
|
========================================================================== */
|
|
153
153
|
|
|
154
154
|
.uk-resize { resize: both; }
|
|
155
|
+
.uk-resize-horizontal { resize: horizontal; }
|
|
155
156
|
.uk-resize-vertical { resize: vertical; }
|
|
156
157
|
|
|
157
158
|
|
package/tests/alert.html
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
|
|
74
74
|
<h2>Animations</h2>
|
|
75
75
|
|
|
76
|
-
<div uk-alert="animation: uk-animation-scale-up; duration:1000">
|
|
76
|
+
<div uk-alert="animation: uk-animation-scale-up; duration: 1000">
|
|
77
77
|
<a href="#" class="uk-alert-close" uk-close></a>
|
|
78
78
|
<p><strong>Alert!</strong> Lorem ipsum <a href="#">dolor</a> sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
|
|
79
79
|
</div>
|