uikit 3.25.23-dev.0ea1d51 → 3.25.23-dev.9ebc131
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 +4 -0
- package/build/scss.js +83 -54
- 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 +4 -4
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +324 -32
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +324 -32
- 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 +1 -1
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +1 -1
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +191 -191
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +1 -1
- 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 +5 -3
- 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 +100 -85
- 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 +97 -80
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/component.js +12 -8
- package/src/js/components/tooltip.js +4 -2
- package/src/js/core/accordion.js +11 -7
- package/src/js/core/drop.js +10 -32
- package/src/js/core/dropnav.js +1 -1
- package/src/js/core/overflow-fade.js +6 -5
- package/src/js/mixin/event.js +31 -0
- package/src/js/mixin/modal.js +26 -34
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.25.23-dev.
|
|
5
|
+
"version": "3.25.23-dev.9ebc131",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/api/component.js
CHANGED
|
@@ -2,7 +2,7 @@ import { $$, camelize, hyphenate, isEmpty, isPlainObject } from 'uikit-util';
|
|
|
2
2
|
import App from './app';
|
|
3
3
|
|
|
4
4
|
const PREFIX = 'uk-';
|
|
5
|
-
const
|
|
5
|
+
const elementComponents = new WeakMap();
|
|
6
6
|
|
|
7
7
|
export const components = {};
|
|
8
8
|
|
|
@@ -60,7 +60,7 @@ export function createComponent(name, element, data, ...args) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export function getComponents(element) {
|
|
63
|
-
return element
|
|
63
|
+
return elementComponents.get(element) || {};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export function getComponent(element, name) {
|
|
@@ -68,17 +68,21 @@ export function getComponent(element, name) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export function attachToElement(element, instance) {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
let components = elementComponents.get(element);
|
|
72
|
+
|
|
73
|
+
if (!components) {
|
|
74
|
+
components = {};
|
|
75
|
+
elementComponents.set(element, components);
|
|
73
76
|
}
|
|
74
77
|
|
|
75
|
-
|
|
78
|
+
components[instance.$options.name] = instance;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
export function detachFromElement(element, instance) {
|
|
79
|
-
|
|
82
|
+
const components = elementComponents.get(element);
|
|
83
|
+
delete components?.[instance.$options.name];
|
|
80
84
|
|
|
81
|
-
if (isEmpty(
|
|
82
|
-
delete
|
|
85
|
+
if (isEmpty(components)) {
|
|
86
|
+
elementComponents.delete(element);
|
|
83
87
|
}
|
|
84
88
|
}
|
|
@@ -176,8 +176,10 @@ function getAlignment(el, target, [dir, align]) {
|
|
|
176
176
|
|
|
177
177
|
function parseProps(options) {
|
|
178
178
|
const { el, id, data } = options;
|
|
179
|
-
return
|
|
179
|
+
return {
|
|
180
|
+
title: getData(el, 'title'),
|
|
181
|
+
delay: getData(el, 'delay'),
|
|
180
182
|
...parseOptions(getData(el, id), ['title']),
|
|
181
183
|
...data,
|
|
182
|
-
}
|
|
184
|
+
};
|
|
183
185
|
}
|
package/src/js/core/accordion.js
CHANGED
|
@@ -26,6 +26,8 @@ import { maybeDefaultPreventClick } from '../mixin/event';
|
|
|
26
26
|
import Togglable from '../mixin/togglable';
|
|
27
27
|
import { keyMap } from '../util/keys';
|
|
28
28
|
|
|
29
|
+
const wrappers = new WeakMap();
|
|
30
|
+
|
|
29
31
|
export default {
|
|
30
32
|
mixins: [Class, Togglable],
|
|
31
33
|
|
|
@@ -60,7 +62,9 @@ export default {
|
|
|
60
62
|
},
|
|
61
63
|
|
|
62
64
|
contents({ content }) {
|
|
63
|
-
return this.items.map(
|
|
65
|
+
return this.items.map(
|
|
66
|
+
(item) => wrappers.get(item)?.firstElementChild || $(content, item),
|
|
67
|
+
);
|
|
64
68
|
},
|
|
65
69
|
},
|
|
66
70
|
|
|
@@ -200,13 +204,13 @@ function hide(el, hide) {
|
|
|
200
204
|
}
|
|
201
205
|
|
|
202
206
|
async function transition(el, show, { content, duration, velocity, transition }) {
|
|
203
|
-
|
|
207
|
+
let wrapper = wrappers.get(el);
|
|
208
|
+
content = wrapper?.firstElementChild || $(content, el);
|
|
204
209
|
|
|
205
|
-
if (!
|
|
206
|
-
|
|
210
|
+
if (!wrapper) {
|
|
211
|
+
wrapper = wrapAll(content, '<div>');
|
|
212
|
+
wrappers.set(el, wrapper);
|
|
207
213
|
}
|
|
208
|
-
|
|
209
|
-
const wrapper = el._wrapper;
|
|
210
214
|
css(wrapper, 'overflow', 'hidden');
|
|
211
215
|
const currentHeight = toFloat(css(wrapper, 'height'));
|
|
212
216
|
|
|
@@ -224,7 +228,7 @@ async function transition(el, show, { content, duration, velocity, transition })
|
|
|
224
228
|
await Transition.start(wrapper, { height: show ? endHeight : 0 }, duration, transition);
|
|
225
229
|
|
|
226
230
|
unwrap(content);
|
|
227
|
-
delete
|
|
231
|
+
wrappers.delete(el);
|
|
228
232
|
|
|
229
233
|
if (!show) {
|
|
230
234
|
hide(content, true);
|
package/src/js/core/drop.js
CHANGED
|
@@ -20,21 +20,17 @@ import {
|
|
|
20
20
|
overflowParents,
|
|
21
21
|
parent,
|
|
22
22
|
pick,
|
|
23
|
-
pointerCancel,
|
|
24
|
-
pointerDown,
|
|
25
23
|
pointerEnter,
|
|
26
24
|
pointerLeave,
|
|
27
|
-
pointerUp,
|
|
28
25
|
query,
|
|
29
26
|
removeClass,
|
|
30
27
|
} from 'uikit-util';
|
|
31
28
|
import { generateId } from '../api/instance';
|
|
32
29
|
import Class from '../mixin/class';
|
|
33
30
|
import Container from '../mixin/container';
|
|
34
|
-
import { maybeDefaultPreventClick } from '../mixin/event';
|
|
31
|
+
import { maybeDefaultPreventClick, onEscape, onOutsidePointer } from '../mixin/event';
|
|
35
32
|
import Position, { storeScrollPosition } from '../mixin/position';
|
|
36
33
|
import Togglable from '../mixin/togglable';
|
|
37
|
-
import { keyMap } from '../util/keys';
|
|
38
34
|
import { preventBackgroundScroll } from '../util/scroll';
|
|
39
35
|
|
|
40
36
|
export let active;
|
|
@@ -457,7 +453,6 @@ export default {
|
|
|
457
453
|
},
|
|
458
454
|
},
|
|
459
455
|
};
|
|
460
|
-
|
|
461
456
|
function getViewport(el, target) {
|
|
462
457
|
return offsetViewport(overflowParents(target).find((parent) => parent.contains(el)));
|
|
463
458
|
}
|
|
@@ -502,11 +497,7 @@ function listenForScroll(drop, fn = () => drop.$emit()) {
|
|
|
502
497
|
}
|
|
503
498
|
|
|
504
499
|
function listenForEscClose(drop) {
|
|
505
|
-
return
|
|
506
|
-
if (e.keyCode === keyMap.ESC) {
|
|
507
|
-
drop.hide(false);
|
|
508
|
-
}
|
|
509
|
-
});
|
|
500
|
+
return onEscape(() => drop.hide(false));
|
|
510
501
|
}
|
|
511
502
|
|
|
512
503
|
function listenForScrollClose(drop) {
|
|
@@ -514,25 +505,12 @@ function listenForScrollClose(drop) {
|
|
|
514
505
|
}
|
|
515
506
|
|
|
516
507
|
function listenForBackgroundClose(drop) {
|
|
517
|
-
return
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
({ defaultPrevented, type, target: newTarget }) => {
|
|
526
|
-
if (
|
|
527
|
-
!defaultPrevented &&
|
|
528
|
-
type === pointerUp &&
|
|
529
|
-
target === newTarget &&
|
|
530
|
-
!drop.targetEl?.contains(target)
|
|
531
|
-
) {
|
|
532
|
-
drop.hide(false);
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
true,
|
|
536
|
-
);
|
|
537
|
-
});
|
|
508
|
+
return onOutsidePointer(
|
|
509
|
+
(target) => {
|
|
510
|
+
if (!drop.targetEl?.contains(target)) {
|
|
511
|
+
drop.hide(false);
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
(target) => !drop.$el.contains(target),
|
|
515
|
+
);
|
|
538
516
|
}
|
package/src/js/core/dropnav.js
CHANGED
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
dropbar =
|
|
80
80
|
this._dropbar || query(dropbar, this.$el) || $(`+ .${this.clsDropbar}`, this.$el);
|
|
81
81
|
|
|
82
|
-
return dropbar
|
|
82
|
+
return dropbar || (this._dropbar = $('<div>'));
|
|
83
83
|
},
|
|
84
84
|
|
|
85
85
|
dropContainer(_, $el) {
|
|
@@ -55,11 +55,12 @@ export default {
|
|
|
55
55
|
|
|
56
56
|
update: {
|
|
57
57
|
read() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
return {
|
|
59
|
+
overflow: [
|
|
60
|
+
this.$el.scrollWidth - this.$el.clientWidth,
|
|
61
|
+
this.$el.scrollHeight - this.$el.clientHeight,
|
|
62
|
+
],
|
|
63
|
+
};
|
|
63
64
|
},
|
|
64
65
|
|
|
65
66
|
write({ overflow }) {
|
package/src/js/mixin/event.js
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
|
+
import { pointerCancel, pointerDown, pointerUp } from '../util/env';
|
|
2
|
+
import { on, once } from '../util/event';
|
|
3
|
+
import { keyMap } from '../util/keys';
|
|
4
|
+
|
|
1
5
|
export function maybeDefaultPreventClick(e) {
|
|
2
6
|
if (e.target.closest('a[href="#"],a[href=""]')) {
|
|
3
7
|
e.preventDefault();
|
|
4
8
|
}
|
|
5
9
|
}
|
|
10
|
+
|
|
11
|
+
export function onEscape(handler, isEligible = () => true) {
|
|
12
|
+
return on(document, 'keydown', (e) => {
|
|
13
|
+
if (e.keyCode === keyMap.ESC && isEligible()) {
|
|
14
|
+
handler(e);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function onOutsidePointer(handler, isOutside, isEligible) {
|
|
20
|
+
return on(document, pointerDown, ({ target }) => {
|
|
21
|
+
if (!isOutside(target) || (isEligible && !isEligible())) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
once(
|
|
26
|
+
document,
|
|
27
|
+
`${pointerUp} ${pointerCancel} scroll`,
|
|
28
|
+
({ defaultPrevented, type, target: newTarget }) => {
|
|
29
|
+
if (!defaultPrevented && type === pointerUp && target === newTarget) {
|
|
30
|
+
handler(target);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
true,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
}
|
package/src/js/mixin/modal.js
CHANGED
|
@@ -13,9 +13,6 @@ import {
|
|
|
13
13
|
on,
|
|
14
14
|
once,
|
|
15
15
|
parent,
|
|
16
|
-
pointerCancel,
|
|
17
|
-
pointerDown,
|
|
18
|
-
pointerUp,
|
|
19
16
|
removeClass,
|
|
20
17
|
toFloat,
|
|
21
18
|
} from 'uikit-util';
|
|
@@ -23,11 +20,13 @@ import { awaitFrame } from '../util/await';
|
|
|
23
20
|
import { preventBackgroundScroll } from '../util/scroll';
|
|
24
21
|
import Class from './class';
|
|
25
22
|
import Container from './container';
|
|
26
|
-
import { maybeDefaultPreventClick } from './event';
|
|
23
|
+
import { maybeDefaultPreventClick, onEscape, onOutsidePointer } from './event';
|
|
27
24
|
import Togglable from './togglable';
|
|
28
25
|
|
|
29
26
|
const active = [];
|
|
30
27
|
|
|
28
|
+
const pendingReject = new WeakMap();
|
|
29
|
+
|
|
31
30
|
export default {
|
|
32
31
|
mixins: [Class, Container, Togglable],
|
|
33
32
|
|
|
@@ -230,10 +229,13 @@ export default {
|
|
|
230
229
|
};
|
|
231
230
|
|
|
232
231
|
function animate(el, show, { transitionElement, _toggle }) {
|
|
232
|
+
let rejectAnimation;
|
|
233
|
+
|
|
233
234
|
return new Promise((resolve, reject) =>
|
|
234
235
|
once(el, 'show hide', () => {
|
|
235
|
-
el
|
|
236
|
-
|
|
236
|
+
pendingReject.get(el)?.();
|
|
237
|
+
rejectAnimation = reject;
|
|
238
|
+
pendingReject.set(el, reject);
|
|
237
239
|
|
|
238
240
|
_toggle(el, show);
|
|
239
241
|
|
|
@@ -257,11 +259,15 @@ function animate(el, show, { transitionElement, _toggle }) {
|
|
|
257
259
|
toMs(css(transitionElement, 'transitionDuration')),
|
|
258
260
|
);
|
|
259
261
|
}),
|
|
260
|
-
).then(() =>
|
|
262
|
+
).then(() => {
|
|
263
|
+
if (pendingReject.get(el) === rejectAnimation) {
|
|
264
|
+
pendingReject.delete(el);
|
|
265
|
+
}
|
|
266
|
+
});
|
|
261
267
|
}
|
|
262
268
|
|
|
263
269
|
function toMs(time) {
|
|
264
|
-
return time
|
|
270
|
+
return toFloat(time) * (endsWith(time, 'ms') ? 1 : 1000);
|
|
265
271
|
}
|
|
266
272
|
|
|
267
273
|
function preventBackgroundFocus(modal) {
|
|
@@ -282,35 +288,21 @@ function preventBackgroundFocus(modal) {
|
|
|
282
288
|
}
|
|
283
289
|
|
|
284
290
|
function listenForBackgroundClose(modal) {
|
|
285
|
-
return
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
(modal.overlay
|
|
289
|
-
|
|
290
|
-
modal.panel.contains(target)
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
once(
|
|
296
|
-
document,
|
|
297
|
-
`${pointerUp} ${pointerCancel} scroll`,
|
|
298
|
-
({ defaultPrevented, type, target: newTarget }) => {
|
|
299
|
-
if (!defaultPrevented && type === pointerUp && target === newTarget) {
|
|
300
|
-
modal.hide();
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
true,
|
|
304
|
-
);
|
|
305
|
-
});
|
|
291
|
+
return onOutsidePointer(
|
|
292
|
+
() => modal.hide(),
|
|
293
|
+
(target) =>
|
|
294
|
+
(!modal.overlay || modal.$el.contains(target)) &&
|
|
295
|
+
Boolean(modal.panel) &&
|
|
296
|
+
!modal.panel.contains(target),
|
|
297
|
+
() => last(active) === modal,
|
|
298
|
+
);
|
|
306
299
|
}
|
|
307
300
|
|
|
308
301
|
function listenForEscClose(modal) {
|
|
309
|
-
return
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
});
|
|
302
|
+
return onEscape(
|
|
303
|
+
() => modal.hide(),
|
|
304
|
+
() => last(active) === modal,
|
|
305
|
+
);
|
|
314
306
|
}
|
|
315
307
|
|
|
316
308
|
function setAriaExpanded(el, toggled) {
|