uikit 3.15.9-dev.ffad54c1a → 3.15.10-dev.6ba1ea187
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 -0
- 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 +44 -52
- 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 +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 +44 -52
- 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 +4 -4
- 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 +47 -55
- package/dist/js/uikit.min.js +2 -2
- package/package.json +1 -1
- package/src/js/api/state.js +2 -2
- package/src/js/mixin/animate.js +1 -4
- package/src/js/mixin/internal/animate-slide.js +47 -53
- package/tests/filter.html +2 -2
- package/tests/lightbox.html +2 -2
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.15.
|
|
5
|
+
"version": "3.15.10-dev.6ba1ea187",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/api/state.js
CHANGED
|
@@ -115,8 +115,8 @@ export default function (UIkit) {
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
UIkit.prototype.registerObserver = function (observer) {
|
|
119
|
-
this._observers.push(observer);
|
|
118
|
+
UIkit.prototype.registerObserver = function (...observer) {
|
|
119
|
+
this._observers.push(...observer);
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
UIkit.prototype._disconnectObservers = function () {
|
package/src/js/mixin/animate.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
attr,
|
|
2
3
|
children,
|
|
3
4
|
css,
|
|
4
5
|
fastdom,
|
|
5
6
|
includes,
|
|
6
7
|
index,
|
|
7
|
-
isEqual,
|
|
8
8
|
isVisible,
|
|
9
|
-
noop,
|
|
10
9
|
observeMutation,
|
|
11
10
|
offset,
|
|
12
11
|
parent,
|
|
@@ -21,14 +20,10 @@ export default async function (action, target, duration) {
|
|
|
21
20
|
|
|
22
21
|
// Get current state
|
|
23
22
|
const currentProps = nodes.map((el) => getProps(el, true));
|
|
24
|
-
const targetProps = css(target, ['height', 'padding']);
|
|
23
|
+
const targetProps = { ...css(target, ['height', 'padding']), display: 'block' };
|
|
25
24
|
|
|
26
25
|
// Cancel previous animations
|
|
27
|
-
|
|
28
|
-
nodes.forEach(Transition.cancel);
|
|
29
|
-
reset(target);
|
|
30
|
-
|
|
31
|
-
const { promise, observer } = awaitMutation(target);
|
|
26
|
+
await Promise.all(nodes.concat(target).map(Transition.cancel));
|
|
32
27
|
|
|
33
28
|
// Adding, sorting, removing nodes
|
|
34
29
|
action();
|
|
@@ -37,23 +32,23 @@ export default async function (action, target, duration) {
|
|
|
37
32
|
nodes = nodes.concat(children(target).filter((el) => !includes(nodes, el)));
|
|
38
33
|
|
|
39
34
|
// Wait for update to propagate
|
|
40
|
-
|
|
41
|
-
observer.disconnect();
|
|
42
|
-
await Promise.resolve();
|
|
43
|
-
} else {
|
|
44
|
-
await promise;
|
|
45
|
-
}
|
|
35
|
+
await awaitMutation();
|
|
46
36
|
|
|
47
37
|
// Force update
|
|
48
38
|
fastdom.flush();
|
|
49
39
|
|
|
50
40
|
// Get new state
|
|
41
|
+
const targetStyle = attr(target, 'style');
|
|
51
42
|
const targetPropsTo = css(target, ['height', 'padding']);
|
|
52
43
|
const [propsTo, propsFrom] = getTransitionProps(target, nodes, currentProps);
|
|
44
|
+
const attrsTo = nodes.map((el) => ({
|
|
45
|
+
class: attr(el, 'class'),
|
|
46
|
+
style: attr(el, 'style'),
|
|
47
|
+
}));
|
|
53
48
|
|
|
54
49
|
// Reset to previous state
|
|
55
50
|
nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));
|
|
56
|
-
css(target,
|
|
51
|
+
css(target, targetProps);
|
|
57
52
|
|
|
58
53
|
// Start transitions on next frame
|
|
59
54
|
await awaitFrame();
|
|
@@ -62,13 +57,19 @@ export default async function (action, target, duration) {
|
|
|
62
57
|
.map((el, i) => parent(el) === target && Transition.start(el, propsTo[i], duration, 'ease'))
|
|
63
58
|
.concat(Transition.start(target, targetPropsTo, duration, 'ease'));
|
|
64
59
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
try {
|
|
61
|
+
await Promise.all(transitions);
|
|
62
|
+
nodes.forEach((el, i) => {
|
|
63
|
+
attr(el, attrsTo[i]);
|
|
64
|
+
if (parent(el) === target) {
|
|
65
|
+
css(el, 'display', propsTo[i].opacity === 0 ? 'none' : '');
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
attr(target, 'style', targetStyle);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
attr(nodes, 'style', '');
|
|
71
|
+
resetProps(target, targetProps);
|
|
72
|
+
}
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
function getProps(el, opacity) {
|
|
@@ -122,47 +123,40 @@ function getTransitionProps(target, nodes, currentProps) {
|
|
|
122
123
|
return [propsTo, propsFrom];
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
opacity: '',
|
|
130
|
-
pointerEvents: '',
|
|
131
|
-
position: '',
|
|
132
|
-
top: '',
|
|
133
|
-
marginTop: '',
|
|
134
|
-
marginLeft: '',
|
|
135
|
-
transform: '',
|
|
136
|
-
width: '',
|
|
137
|
-
zIndex: '',
|
|
138
|
-
});
|
|
139
|
-
css(el, { height: '', display: '', padding: '' });
|
|
126
|
+
function resetProps(el, props) {
|
|
127
|
+
for (const prop in props) {
|
|
128
|
+
css(el, prop, '');
|
|
129
|
+
}
|
|
140
130
|
}
|
|
141
131
|
|
|
142
132
|
function getPositionWithMargin(el) {
|
|
143
133
|
const { height, width } = offset(el);
|
|
144
|
-
const { top, left } = position(el);
|
|
145
|
-
const { marginLeft, marginTop } = css(el, ['marginTop', 'marginLeft']);
|
|
146
134
|
|
|
147
|
-
return {
|
|
135
|
+
return {
|
|
136
|
+
height,
|
|
137
|
+
width,
|
|
138
|
+
transform: '',
|
|
139
|
+
...position(el),
|
|
140
|
+
...css(el, ['marginTop', 'marginLeft']),
|
|
141
|
+
};
|
|
148
142
|
}
|
|
149
143
|
|
|
150
144
|
function awaitFrame() {
|
|
151
145
|
return new Promise((resolve) => requestAnimationFrame(resolve));
|
|
152
146
|
}
|
|
153
147
|
|
|
154
|
-
function awaitMutation(
|
|
155
|
-
|
|
156
|
-
const promise = new Promise(
|
|
157
|
-
(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
))
|
|
148
|
+
function awaitMutation() {
|
|
149
|
+
const text = document.createTextNode('');
|
|
150
|
+
const promise = new Promise((resolve) =>
|
|
151
|
+
observeMutation(
|
|
152
|
+
text,
|
|
153
|
+
(_, observer) => {
|
|
154
|
+
resolve();
|
|
155
|
+
observer.disconnect();
|
|
156
|
+
},
|
|
157
|
+
{ characterData: true }
|
|
158
|
+
)
|
|
166
159
|
);
|
|
167
|
-
|
|
160
|
+
text.data = 1;
|
|
161
|
+
return promise;
|
|
168
162
|
}
|
package/tests/filter.html
CHANGED
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
on(document.body, 'beforeFilter afterFilter', (e, filter, state) =>
|
|
27
27
|
console.log(e.type, filter, state)
|
|
28
28
|
);
|
|
29
|
-
on('#js-animation-switcher', 'change', () =>
|
|
30
|
-
attr($$('.js-filter-animation'), 'animation',
|
|
29
|
+
on('#js-animation-switcher', 'change', (e) =>
|
|
30
|
+
attr($$('.js-filter-animation'), 'animation', e.target.value)
|
|
31
31
|
);
|
|
32
32
|
});
|
|
33
33
|
|
package/tests/lightbox.html
CHANGED
|
@@ -275,8 +275,8 @@
|
|
|
275
275
|
|
|
276
276
|
const {$, attr, on } = UIkit.util;
|
|
277
277
|
|
|
278
|
-
on('#js-animation-switcher', 'change', () =>
|
|
279
|
-
attr($('#js-lightbox-animation'), 'animation',
|
|
278
|
+
on('#js-animation-switcher', 'change', (e) =>
|
|
279
|
+
attr($('#js-lightbox-animation'), 'animation', e.target.value)
|
|
280
280
|
);
|
|
281
281
|
|
|
282
282
|
on('#js-lightbox', 'click', (e) => {
|