uikit 3.25.24-dev.66bb413 → 3.25.24-dev.683b9f8
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/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 +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +10 -29
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +10 -29
- 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 +1 -1
- 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 +6 -7
- 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 +66 -77
- 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 +66 -77
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/core/scrollspy.js +10 -20
- package/src/js/mixin/modal.js +3 -24
- package/src/js/mixin/togglable.js +5 -6
- package/src/js/util/animation.js +58 -41
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.24-dev.
|
|
5
|
+
"version": "3.25.24-dev.683b9f8",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/core/scrollspy.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
$$,
|
|
3
|
-
css,
|
|
4
|
-
filter,
|
|
5
|
-
data as getData,
|
|
6
|
-
once,
|
|
7
|
-
removeClass,
|
|
8
|
-
toggleClass,
|
|
9
|
-
trigger,
|
|
10
|
-
} from 'uikit-util';
|
|
1
|
+
import { $$, css, filter, data as getData, removeClass, toggleClass, trigger } from 'uikit-util';
|
|
11
2
|
import { intersection } from '../api/observables';
|
|
12
3
|
import { awaitTimeout } from '../util/await';
|
|
13
4
|
|
|
@@ -121,16 +112,15 @@ export default {
|
|
|
121
112
|
toggleClass(el, clsInView, inview);
|
|
122
113
|
toggleClass(el, state.cls);
|
|
123
114
|
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
115
|
+
const match = state.cls.match(/\buk-animation-[\w-]+/g);
|
|
116
|
+
if (match) {
|
|
117
|
+
const animations = (inview && el.getAnimations?.()) || [];
|
|
118
|
+
|
|
119
|
+
let active = true;
|
|
120
|
+
state.off = () => (active = false);
|
|
121
|
+
|
|
122
|
+
const cleanup = () => active && removeClass(el, match);
|
|
123
|
+
Promise.all(animations.map(({ finished }) => finished)).then(cleanup, cleanup);
|
|
134
124
|
}
|
|
135
125
|
|
|
136
126
|
trigger(el, inview ? 'inview' : 'outview');
|
package/src/js/mixin/modal.js
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
append,
|
|
5
5
|
css,
|
|
6
6
|
dimensions,
|
|
7
|
-
endsWith,
|
|
8
7
|
includes,
|
|
9
8
|
isFocusable,
|
|
10
9
|
isSameSiteAnchor,
|
|
@@ -239,25 +238,9 @@ function animate(el, show, { transitionElement, _toggle }) {
|
|
|
239
238
|
|
|
240
239
|
_toggle(el, show);
|
|
241
240
|
|
|
242
|
-
|
|
243
|
-
transitionElement,
|
|
244
|
-
|
|
245
|
-
() => {
|
|
246
|
-
once(transitionElement, 'transitionend transitioncancel', resolve, {
|
|
247
|
-
self: true,
|
|
248
|
-
});
|
|
249
|
-
clearTimeout(timer);
|
|
250
|
-
},
|
|
251
|
-
{ self: true },
|
|
252
|
-
);
|
|
253
|
-
|
|
254
|
-
const timer = setTimeout(
|
|
255
|
-
() => {
|
|
256
|
-
off();
|
|
257
|
-
resolve();
|
|
258
|
-
},
|
|
259
|
-
toMs(css(transitionElement, 'transitionDuration')),
|
|
260
|
-
);
|
|
241
|
+
Promise.all(
|
|
242
|
+
(transitionElement.getAnimations?.() ?? []).map(({ finished }) => finished),
|
|
243
|
+
).then(resolve, reject);
|
|
261
244
|
}),
|
|
262
245
|
).then(() => {
|
|
263
246
|
if (pendingReject.get(el) === rejectAnimation) {
|
|
@@ -266,10 +249,6 @@ function animate(el, show, { transitionElement, _toggle }) {
|
|
|
266
249
|
});
|
|
267
250
|
}
|
|
268
251
|
|
|
269
|
-
function toMs(time) {
|
|
270
|
-
return toFloat(time) * (endsWith(time, 'ms') ? 1 : 1000);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
252
|
function preventBackgroundFocus(modal) {
|
|
274
253
|
return on(document, 'focusin', (e) => {
|
|
275
254
|
if (last(active) !== modal || modal.$el.contains(e.target)) {
|
|
@@ -242,15 +242,14 @@ async function toggleTransition(el, show, { animation, duration, velocity, trans
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
function toggleAnimation(el, show, cmp) {
|
|
246
|
-
const { animation, duration, _toggle } = cmp;
|
|
245
|
+
async function toggleAnimation(el, show, cmp) {
|
|
246
|
+
const { animation, duration, origin, _toggle } = cmp;
|
|
247
247
|
|
|
248
248
|
if (show) {
|
|
249
249
|
_toggle(el, true);
|
|
250
|
-
return Animation.in(el, animation[0], duration,
|
|
250
|
+
return Animation.in(el, animation[0], duration, origin);
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
);
|
|
253
|
+
await Animation.out(el, animation[1] || animation[0], duration, origin);
|
|
254
|
+
_toggle(el, false);
|
|
256
255
|
}
|
package/src/js/util/animation.js
CHANGED
|
@@ -62,47 +62,66 @@ export const Transition = {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
const clsAnimation = 'uk-animation';
|
|
65
|
-
const
|
|
66
|
-
const animationCanceled = 'animationcanceled';
|
|
65
|
+
const activeAnimations = new WeakMap();
|
|
67
66
|
|
|
68
67
|
function animate(element, animation, duration = 200, origin, out) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
68
|
+
const animateFn = async (element) => {
|
|
69
|
+
if (!Element.prototype.getAnimations) {
|
|
70
|
+
return element;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
cancel(element);
|
|
74
|
+
|
|
75
|
+
const existingAnimations = element.getAnimations();
|
|
76
|
+
|
|
77
|
+
const classes = [
|
|
78
|
+
animation,
|
|
79
|
+
clsAnimation,
|
|
80
|
+
`${clsAnimation}-${out ? 'leave' : 'enter'}`,
|
|
81
|
+
origin && `uk-transform-origin-${origin}`,
|
|
82
|
+
out && `${clsAnimation}-reverse`,
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
css(element, 'animationDuration', `${duration}ms`);
|
|
86
|
+
addClass(element, classes);
|
|
87
|
+
|
|
88
|
+
const animations = element
|
|
89
|
+
.getAnimations()
|
|
90
|
+
.filter((animation) => !existingAnimations.includes(animation));
|
|
91
|
+
const data = { animations, classes };
|
|
92
|
+
|
|
93
|
+
activeAnimations.set(element, data);
|
|
94
|
+
|
|
95
|
+
try {
|
|
96
|
+
await Promise.all(animations.map(({ finished }) => finished));
|
|
97
|
+
return element;
|
|
98
|
+
} finally {
|
|
99
|
+
cleanup(element, data);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return Promise.all(toNodes(element).map(animateFn));
|
|
104
|
+
}
|
|
94
105
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
function cleanup(element, data) {
|
|
107
|
+
if (activeAnimations.get(element) === data) {
|
|
108
|
+
activeAnimations.delete(element);
|
|
109
|
+
css(element, 'animationDuration', '');
|
|
110
|
+
removeClass(element, data.classes);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
100
113
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
function cancel(elements) {
|
|
115
|
+
for (const element of toNodes(elements)) {
|
|
116
|
+
const data = activeAnimations.get(element);
|
|
117
|
+
|
|
118
|
+
if (data) {
|
|
119
|
+
for (const animation of data.animations) {
|
|
120
|
+
animation.cancel();
|
|
121
|
+
}
|
|
122
|
+
cleanup(element, data);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
106
125
|
}
|
|
107
126
|
|
|
108
127
|
export const Animation = {
|
|
@@ -113,10 +132,8 @@ export const Animation = {
|
|
|
113
132
|
},
|
|
114
133
|
|
|
115
134
|
inProgress(element) {
|
|
116
|
-
return
|
|
135
|
+
return activeAnimations.has(element);
|
|
117
136
|
},
|
|
118
137
|
|
|
119
|
-
cancel
|
|
120
|
-
trigger(element, animationCanceled);
|
|
121
|
-
},
|
|
138
|
+
cancel,
|
|
122
139
|
};
|