uikit 3.16.4-dev.fd2458e3b → 3.16.5-dev.dda1f1b31
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/.eslintrc.json +1 -0
- package/CHANGELOG.md +9 -1
- package/build/build.js +5 -4
- package/build/icons.js +2 -1
- package/build/less.js +2 -11
- package/build/prefix.js +2 -1
- package/build/release.js +4 -3
- package/build/scope.js +2 -1
- package/build/scss.js +2 -1
- package/build/util.js +3 -3
- 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 +12 -14
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +506 -22
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +2601 -310
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +2612 -323
- 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 +466 -43
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +184 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +2345 -49
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +184 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +2339 -49
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +472 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +2298 -11
- 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 +951 -931
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +153 -152
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +979 -954
- package/dist/js/uikit.min.js +1 -1
- package/package.json +2 -2
- package/src/images/icons/mastodon.svg +3 -0
- package/src/js/api/app.js +12 -0
- package/src/js/api/boot.js +64 -43
- package/src/js/api/component.js +60 -61
- package/src/js/api/computed.js +39 -0
- package/src/js/api/events.js +45 -0
- package/src/js/api/global.js +58 -56
- package/src/js/api/hooks.js +35 -114
- package/src/js/api/index.js +8 -24
- package/src/js/api/instance.js +55 -55
- package/src/js/api/log.js +10 -0
- package/src/js/api/observables.js +125 -0
- package/src/js/api/observer.js +76 -0
- package/src/js/{util → api}/options.js +38 -1
- package/src/js/api/props.js +102 -0
- package/src/js/api/state.js +26 -280
- package/src/js/api/update.js +77 -0
- package/src/js/api/watch.js +34 -0
- package/src/js/components/countdown.js +14 -16
- package/src/js/components/filter.js +18 -24
- package/src/js/components/internal/slider-preload.js +5 -6
- package/src/js/components/lightbox-panel.js +1 -1
- package/src/js/components/lightbox.js +11 -23
- package/src/js/components/parallax.js +8 -6
- package/src/js/components/slider.js +10 -0
- package/src/js/components/tooltip.js +2 -1
- package/src/js/core/accordion.js +5 -6
- package/src/js/core/cover.js +9 -9
- package/src/js/core/drop.js +13 -6
- package/src/js/core/dropnav.js +1 -1
- package/src/js/core/grid.js +2 -5
- package/src/js/core/height-match.js +9 -16
- package/src/js/core/height-viewport.js +5 -7
- package/src/js/core/img.js +12 -19
- package/src/js/core/leader.js +4 -2
- package/src/js/core/margin.js +11 -21
- package/src/js/core/modal.js +1 -1
- package/src/js/core/offcanvas.js +6 -2
- package/src/js/core/overflow-auto.js +5 -5
- package/src/js/core/responsive.js +5 -7
- package/src/js/core/scroll.js +19 -10
- package/src/js/core/scrollspy-nav.js +6 -5
- package/src/js/core/scrollspy.js +27 -36
- package/src/js/core/sticky.js +12 -10
- package/src/js/core/svg.js +4 -2
- package/src/js/core/switcher.js +11 -9
- package/src/js/core/toggle.js +4 -4
- package/src/js/core/video.js +6 -14
- package/src/js/mixin/modal.js +2 -1
- package/src/js/mixin/parallax.js +1 -1
- package/src/js/mixin/slider-nav.js +2 -1
- package/src/js/mixin/slider.js +9 -3
- package/src/js/util/filter.js +13 -0
- package/src/js/util/index.js +0 -1
- package/src/js/util/keys.js +11 -0
- package/src/js/util/lang.js +7 -7
- package/src/js/util/observer.js +4 -2
- package/src/js/util/scroll.js +42 -0
- package/src/js/util/svg.js +16 -0
- package/src/js/util/viewport.js +1 -1
- package/src/scss/mixins-theme.scss +1640 -1596
- package/src/scss/mixins.scss +1370 -1370
- package/src/scss/variables-theme.scss +1255 -1255
- package/src/scss/variables.scss +1113 -1113
- package/src/js/mixin/lazyload.js +0 -27
- package/src/js/mixin/resize.js +0 -11
- package/src/js/mixin/scroll.js +0 -32
- package/src/js/mixin/swipe.js +0 -72
- package/src/js/mixin/utils.js +0 -91
package/src/js/mixin/lazyload.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { $$, isFunction, observeIntersection, removeAttr, toNodes } from 'uikit-util';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
data: {
|
|
5
|
-
preload: 5,
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
methods: {
|
|
9
|
-
lazyload(observeTargets = this.$el, targets = this.$el) {
|
|
10
|
-
this.registerObserver(
|
|
11
|
-
observeIntersection(observeTargets, (entries, observer) => {
|
|
12
|
-
for (const el of toNodes(isFunction(targets) ? targets() : targets)) {
|
|
13
|
-
$$('[loading="lazy"]', el)
|
|
14
|
-
.slice(0, this.preload - 1)
|
|
15
|
-
.forEach((el) => removeAttr(el, 'loading'));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
for (const el of entries
|
|
19
|
-
.filter(({ isIntersecting }) => isIntersecting)
|
|
20
|
-
.map(({ target }) => target)) {
|
|
21
|
-
observer.unobserve(el);
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
);
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
package/src/js/mixin/resize.js
DELETED
package/src/js/mixin/scroll.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { on } from 'uikit-util';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
connected() {
|
|
5
|
-
registerScrollListener(this._uid, () => this.$emit('scroll'));
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
disconnected() {
|
|
9
|
-
unregisterScrollListener(this._uid);
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const scrollListeners = new Map();
|
|
14
|
-
let unbindScrollListener;
|
|
15
|
-
export function registerScrollListener(id, listener) {
|
|
16
|
-
unbindScrollListener =
|
|
17
|
-
unbindScrollListener ||
|
|
18
|
-
on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
|
|
19
|
-
passive: true,
|
|
20
|
-
capture: true,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
scrollListeners.set(id, listener);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function unregisterScrollListener(id) {
|
|
27
|
-
scrollListeners.delete(id);
|
|
28
|
-
if (unbindScrollListener && !scrollListeners.size) {
|
|
29
|
-
unbindScrollListener();
|
|
30
|
-
unbindScrollListener = null;
|
|
31
|
-
}
|
|
32
|
-
}
|
package/src/js/mixin/swipe.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getEventPos,
|
|
3
|
-
isTouch,
|
|
4
|
-
once,
|
|
5
|
-
parent,
|
|
6
|
-
pointerCancel,
|
|
7
|
-
pointerDown,
|
|
8
|
-
pointerUp,
|
|
9
|
-
trigger,
|
|
10
|
-
} from 'uikit-util';
|
|
11
|
-
import { registerEvent } from '../api/state';
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
props: {
|
|
15
|
-
swiping: Boolean,
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
data: {
|
|
19
|
-
swiping: true,
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
computed: {
|
|
23
|
-
swipeTarget(props, $el) {
|
|
24
|
-
return $el;
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
connected() {
|
|
29
|
-
if (!this.swiping) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
registerEvent(this, {
|
|
34
|
-
el: this.swipeTarget,
|
|
35
|
-
name: pointerDown,
|
|
36
|
-
passive: true,
|
|
37
|
-
handler(e) {
|
|
38
|
-
if (!isTouch(e)) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Handle Swipe Gesture
|
|
43
|
-
const pos = getEventPos(e);
|
|
44
|
-
const target = 'tagName' in e.target ? e.target : parent(e.target);
|
|
45
|
-
once(document, `${pointerUp} ${pointerCancel} scroll`, (e) => {
|
|
46
|
-
const { x, y } = getEventPos(e);
|
|
47
|
-
|
|
48
|
-
// swipe
|
|
49
|
-
if (
|
|
50
|
-
(e.type !== 'scroll' && target && x && Math.abs(pos.x - x) > 100) ||
|
|
51
|
-
(y && Math.abs(pos.y - y) > 100)
|
|
52
|
-
) {
|
|
53
|
-
setTimeout(() => {
|
|
54
|
-
trigger(target, 'swipe');
|
|
55
|
-
trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
function swipeDirection(x1, y1, x2, y2) {
|
|
65
|
-
return Math.abs(x1 - x2) >= Math.abs(y1 - y2)
|
|
66
|
-
? x1 - x2 > 0
|
|
67
|
-
? 'Left'
|
|
68
|
-
: 'Right'
|
|
69
|
-
: y1 - y2 > 0
|
|
70
|
-
? 'Up'
|
|
71
|
-
: 'Down';
|
|
72
|
-
}
|
package/src/js/mixin/utils.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { $, $$, css, on, scrollParents, width } from 'uikit-util';
|
|
2
|
-
|
|
3
|
-
export function getMaxPathLength(el) {
|
|
4
|
-
return Math.ceil(
|
|
5
|
-
Math.max(
|
|
6
|
-
0,
|
|
7
|
-
...$$('[stroke]', el).map((stroke) => {
|
|
8
|
-
try {
|
|
9
|
-
return stroke.getTotalLength();
|
|
10
|
-
} catch (e) {
|
|
11
|
-
return 0;
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
)
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
let prevented;
|
|
19
|
-
export function preventBackgroundScroll(el) {
|
|
20
|
-
// 'overscroll-behavior: contain' only works consistently if el overflows (Safari)
|
|
21
|
-
const off = on(
|
|
22
|
-
el,
|
|
23
|
-
'touchmove',
|
|
24
|
-
(e) => {
|
|
25
|
-
if (e.targetTouches.length !== 1) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
let [{ scrollHeight, clientHeight }] = scrollParents(e.target);
|
|
30
|
-
|
|
31
|
-
if (clientHeight >= scrollHeight && e.cancelable) {
|
|
32
|
-
e.preventDefault();
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{ passive: false }
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
if (prevented) {
|
|
39
|
-
return off;
|
|
40
|
-
}
|
|
41
|
-
prevented = true;
|
|
42
|
-
|
|
43
|
-
const { scrollingElement } = document;
|
|
44
|
-
css(scrollingElement, {
|
|
45
|
-
overflowY: CSS.supports('overflow', 'clip') ? 'clip' : 'hidden',
|
|
46
|
-
touchAction: 'none',
|
|
47
|
-
paddingRight: width(window) - scrollingElement.clientWidth || '',
|
|
48
|
-
});
|
|
49
|
-
return () => {
|
|
50
|
-
prevented = false;
|
|
51
|
-
off();
|
|
52
|
-
css(scrollingElement, { overflowY: '', touchAction: '', paddingRight: '' });
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function isSameSiteAnchor(el) {
|
|
57
|
-
return ['origin', 'pathname', 'search'].every((part) => el[part] === location[part]);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function getTargetElement(el) {
|
|
61
|
-
if (isSameSiteAnchor(el)) {
|
|
62
|
-
const id = decodeURIComponent(el.hash).substring(1);
|
|
63
|
-
return document.getElementById(id) || document.getElementsByName(id)[0];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function generateId(component, el = component.$el, postfix = '') {
|
|
68
|
-
if (el.id) {
|
|
69
|
-
return el.id;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
let id = `${component.$options.id}-${component._uid}${postfix}`;
|
|
73
|
-
|
|
74
|
-
if ($(`#${id}`)) {
|
|
75
|
-
id = generateId(component, el, `${postfix}-2`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return id;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export const keyMap = {
|
|
82
|
-
TAB: 9,
|
|
83
|
-
ESC: 27,
|
|
84
|
-
SPACE: 32,
|
|
85
|
-
END: 35,
|
|
86
|
-
HOME: 36,
|
|
87
|
-
LEFT: 37,
|
|
88
|
-
UP: 38,
|
|
89
|
-
RIGHT: 39,
|
|
90
|
-
DOWN: 40,
|
|
91
|
-
};
|