uikit 3.13.11-dev.d3de726ee → 3.14.1-dev.49070546c
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 +20 -0
- 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 +19 -5
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +19 -5
- 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 +5 -3
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +5 -3
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +5 -3
- 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 +20 -6
- 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 +122 -61
- 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 +126 -63
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/core/accordion.js +21 -5
- 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/mixin/parallax.js +4 -3
- package/src/js/mixin/position.js +1 -1
- package/src/js/mixin/togglable.js +16 -2
- package/src/js/util/lang.js +34 -38
- package/src/js/util/position.js +6 -3
- 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/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.1-dev.49070546c",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/core/accordion.js
CHANGED
|
@@ -28,7 +28,6 @@ export default {
|
|
|
28
28
|
multiple: Boolean,
|
|
29
29
|
toggle: String,
|
|
30
30
|
content: String,
|
|
31
|
-
transition: String,
|
|
32
31
|
offset: Number,
|
|
33
32
|
},
|
|
34
33
|
|
|
@@ -41,19 +40,16 @@ export default {
|
|
|
41
40
|
clsOpen: 'uk-open',
|
|
42
41
|
toggle: '> .uk-accordion-title',
|
|
43
42
|
content: '> .uk-accordion-content',
|
|
44
|
-
transition: 'ease',
|
|
45
43
|
offset: 0,
|
|
46
44
|
},
|
|
47
45
|
|
|
48
46
|
computed: {
|
|
49
47
|
items: {
|
|
50
48
|
get({ targets }, $el) {
|
|
51
|
-
return $$(targets, $el)
|
|
49
|
+
return $$(targets, $el);
|
|
52
50
|
},
|
|
53
51
|
|
|
54
52
|
watch(items, prev) {
|
|
55
|
-
items.forEach((el) => hide($(this.content, el), !hasClass(el, this.clsOpen)));
|
|
56
|
-
|
|
57
53
|
if (prev || hasClass(items, this.clsOpen)) {
|
|
58
54
|
return;
|
|
59
55
|
}
|
|
@@ -73,6 +69,26 @@ export default {
|
|
|
73
69
|
toggles({ toggle }) {
|
|
74
70
|
return this.items.map((item) => $(toggle, item));
|
|
75
71
|
},
|
|
72
|
+
|
|
73
|
+
contents: {
|
|
74
|
+
get({ content }) {
|
|
75
|
+
return this.items.map((item) => $(content, item));
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
watch(items) {
|
|
79
|
+
for (const el of items) {
|
|
80
|
+
hide(
|
|
81
|
+
el,
|
|
82
|
+
!hasClass(
|
|
83
|
+
this.items.find((item) => item.contains(el)),
|
|
84
|
+
this.clsOpen
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
immediate: true,
|
|
91
|
+
},
|
|
76
92
|
},
|
|
77
93
|
|
|
78
94
|
connected() {
|
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() {
|
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) {
|
|
@@ -332,7 +333,7 @@ function getValue(stops, percent) {
|
|
|
332
333
|
return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
333
334
|
}
|
|
334
335
|
|
|
335
|
-
const unitRe = /^-?\d+(
|
|
336
|
+
const unitRe = /^-?\d+(\S*)/;
|
|
336
337
|
function getUnit(stops, defaultUnit) {
|
|
337
338
|
for (const stop of stops) {
|
|
338
339
|
const match = stop.match?.(unitRe);
|
package/src/js/mixin/position.js
CHANGED
|
@@ -24,6 +24,7 @@ export default {
|
|
|
24
24
|
cls: Boolean,
|
|
25
25
|
animation: 'list',
|
|
26
26
|
duration: Number,
|
|
27
|
+
velocity: Number,
|
|
27
28
|
origin: String,
|
|
28
29
|
transition: String,
|
|
29
30
|
},
|
|
@@ -32,8 +33,9 @@ export default {
|
|
|
32
33
|
cls: false,
|
|
33
34
|
animation: [false],
|
|
34
35
|
duration: 200,
|
|
36
|
+
velocity: 0.2,
|
|
35
37
|
origin: false,
|
|
36
|
-
transition: '
|
|
38
|
+
transition: 'ease',
|
|
37
39
|
clsEnter: 'uk-togglabe-enter',
|
|
38
40
|
clsLeave: 'uk-togglabe-leave',
|
|
39
41
|
|
|
@@ -44,6 +46,7 @@ export default {
|
|
|
44
46
|
paddingBottom: '',
|
|
45
47
|
marginTop: '',
|
|
46
48
|
marginBottom: '',
|
|
49
|
+
boxShadow: '',
|
|
47
50
|
},
|
|
48
51
|
|
|
49
52
|
hideProps: {
|
|
@@ -53,6 +56,7 @@ export default {
|
|
|
53
56
|
paddingBottom: 0,
|
|
54
57
|
marginTop: 0,
|
|
55
58
|
marginBottom: 0,
|
|
59
|
+
boxShadow: 'none',
|
|
56
60
|
},
|
|
57
61
|
},
|
|
58
62
|
|
|
@@ -147,7 +151,15 @@ export default {
|
|
|
147
151
|
},
|
|
148
152
|
};
|
|
149
153
|
|
|
150
|
-
export function toggleHeight({
|
|
154
|
+
export function toggleHeight({
|
|
155
|
+
isToggled,
|
|
156
|
+
duration,
|
|
157
|
+
velocity,
|
|
158
|
+
initProps,
|
|
159
|
+
hideProps,
|
|
160
|
+
transition,
|
|
161
|
+
_toggle,
|
|
162
|
+
}) {
|
|
151
163
|
return (el, show) => {
|
|
152
164
|
const inProgress = Transition.inProgress(el);
|
|
153
165
|
const inner = el.hasChildNodes()
|
|
@@ -168,6 +180,8 @@ export function toggleHeight({ isToggled, duration, initProps, hideProps, transi
|
|
|
168
180
|
fastdom.flush();
|
|
169
181
|
|
|
170
182
|
const endHeight = height(el) + (inProgress ? 0 : inner);
|
|
183
|
+
duration = velocity * el.offsetHeight + duration;
|
|
184
|
+
|
|
171
185
|
height(el, currentHeight);
|
|
172
186
|
|
|
173
187
|
return (
|
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
|
@@ -52,8 +52,6 @@ function attachTo(element, target, options) {
|
|
|
52
52
|
function attachToWithFlip(element, target, options) {
|
|
53
53
|
const position = attachTo(element, target, options);
|
|
54
54
|
const targetDim = offset(target);
|
|
55
|
-
const viewports = scrollParents(element, /auto|scroll/);
|
|
56
|
-
const [scrollElement] = viewports;
|
|
57
55
|
|
|
58
56
|
let {
|
|
59
57
|
flip,
|
|
@@ -64,6 +62,11 @@ function attachToWithFlip(element, target, options) {
|
|
|
64
62
|
viewportPadding,
|
|
65
63
|
} = options;
|
|
66
64
|
|
|
65
|
+
let viewports = scrollParents(element);
|
|
66
|
+
if (boundary === target) {
|
|
67
|
+
viewports = viewports.filter((viewport) => viewport !== boundary);
|
|
68
|
+
}
|
|
69
|
+
const [scrollElement] = viewports;
|
|
67
70
|
viewports.push(viewport);
|
|
68
71
|
|
|
69
72
|
const offsetPosition = { ...position };
|
|
@@ -82,7 +85,7 @@ function attachToWithFlip(element, target, options) {
|
|
|
82
85
|
viewport[end] -= viewportPadding;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
if (boundary && !
|
|
88
|
+
if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
|
|
86
89
|
viewport = getIntersectionArea(viewport, offset(boundary));
|
|
87
90
|
}
|
|
88
91
|
|
|
@@ -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>
|