uikit 3.20.9 → 3.20.10-dev.de039bb62
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/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 +2 -3
- 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 +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 +1 -1
- 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 +4 -3
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +71 -73
- 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 +75 -77
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/countdown.js +1 -3
- package/src/js/components/upload.js +3 -4
- package/src/js/core/inverse.js +14 -6
- package/src/js/core/scrollspy.js +8 -7
- package/src/js/mixin/togglable.js +1 -5
- package/src/js/util/animation.js +20 -19
- package/src/js/util/class.js +1 -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.20.
|
|
5
|
+
"version": "3.20.10-dev.de039bb62",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -79,9 +79,7 @@ export default {
|
|
|
79
79
|
continue;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
let digits =
|
|
83
|
-
|
|
84
|
-
digits = digits.length < 2 ? `0${digits}` : digits;
|
|
82
|
+
let digits = Math.trunc(timespan[unit]).toString().padStart(2, '0');
|
|
85
83
|
|
|
86
84
|
if (el.textContent !== digits) {
|
|
87
85
|
digits = digits.split('');
|
|
@@ -195,7 +195,7 @@ function stop(e) {
|
|
|
195
195
|
e.stopPropagation();
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
export function ajax(url, options) {
|
|
198
|
+
export async function ajax(url, options) {
|
|
199
199
|
const env = {
|
|
200
200
|
data: null,
|
|
201
201
|
method: 'GET',
|
|
@@ -205,9 +205,8 @@ export function ajax(url, options) {
|
|
|
205
205
|
responseType: '',
|
|
206
206
|
...options,
|
|
207
207
|
};
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
.then(() => send(url, env));
|
|
208
|
+
await env.beforeSend(env);
|
|
209
|
+
return send(url, env);
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
function send(url, env) {
|
package/src/js/core/inverse.js
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
$$,
|
|
3
3
|
css,
|
|
4
4
|
dimensions,
|
|
5
|
+
intersectRect,
|
|
5
6
|
matches,
|
|
6
7
|
observeResize,
|
|
7
8
|
on,
|
|
@@ -83,22 +84,29 @@ export default {
|
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
for (const target of toNodes(this.target)) {
|
|
86
|
-
|
|
87
|
-
target,
|
|
88
|
-
'uk-light uk-dark',
|
|
87
|
+
let color =
|
|
89
88
|
!this.selActive || matches(target, this.selActive)
|
|
90
89
|
? findTargetColor(target)
|
|
91
|
-
: ''
|
|
92
|
-
|
|
90
|
+
: '';
|
|
91
|
+
|
|
92
|
+
if (color !== false) {
|
|
93
|
+
replaceClass(target, 'uk-light uk-dark', color);
|
|
94
|
+
}
|
|
93
95
|
}
|
|
94
96
|
},
|
|
95
97
|
},
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
function findTargetColor(target) {
|
|
99
|
-
const
|
|
101
|
+
const dim = dimensions(target);
|
|
100
102
|
const viewport = dimensions(window);
|
|
101
103
|
|
|
104
|
+
if (!intersectRect(dim, viewport)) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const { left, top, height, width } = dim;
|
|
109
|
+
|
|
102
110
|
let last;
|
|
103
111
|
for (const percent of [0.25, 0.5, 0.75]) {
|
|
104
112
|
const elements = target.ownerDocument.elementsFromPoint(
|
package/src/js/core/scrollspy.js
CHANGED
|
@@ -5,12 +5,13 @@ import {
|
|
|
5
5
|
data as getData,
|
|
6
6
|
once,
|
|
7
7
|
removeClass,
|
|
8
|
-
removeClasses,
|
|
9
8
|
toggleClass,
|
|
10
9
|
trigger,
|
|
11
10
|
} from 'uikit-util';
|
|
12
11
|
import { intersection } from '../api/observables';
|
|
13
12
|
|
|
13
|
+
const clsInView = 'uk-scrollspy-inview';
|
|
14
|
+
|
|
14
15
|
export default {
|
|
15
16
|
args: 'cls',
|
|
16
17
|
|
|
@@ -30,7 +31,6 @@ export default {
|
|
|
30
31
|
margin: '-1px',
|
|
31
32
|
repeat: false,
|
|
32
33
|
delay: 0,
|
|
33
|
-
inViewClass: 'uk-scrollspy-inview',
|
|
34
34
|
}),
|
|
35
35
|
|
|
36
36
|
computed: {
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
elements(elements) {
|
|
42
42
|
if (this.hidden) {
|
|
43
43
|
// use `opacity:0` instead of `visibility:hidden` to make content focusable with keyboard
|
|
44
|
-
css(filter(elements, `:not(.${
|
|
44
|
+
css(filter(elements, `:not(.${clsInView})`), 'opacity', 0);
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
},
|
|
@@ -52,7 +52,7 @@ export default {
|
|
|
52
52
|
|
|
53
53
|
disconnected() {
|
|
54
54
|
for (const [el, state] of this.elementData.entries()) {
|
|
55
|
-
removeClass(el,
|
|
55
|
+
removeClass(el, clsInView, state?.cls || '');
|
|
56
56
|
}
|
|
57
57
|
delete this.elementData;
|
|
58
58
|
},
|
|
@@ -118,11 +118,12 @@ export default {
|
|
|
118
118
|
|
|
119
119
|
css(el, 'opacity', !inview && this.hidden ? 0 : '');
|
|
120
120
|
|
|
121
|
-
toggleClass(el,
|
|
121
|
+
toggleClass(el, clsInView, inview);
|
|
122
122
|
toggleClass(el, state.cls);
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
let match;
|
|
125
|
+
if ((match = state.cls.match(/\buk-animation-[\w-]+/g))) {
|
|
126
|
+
const removeAnimationClasses = () => removeClass(el, match);
|
|
126
127
|
if (inview) {
|
|
127
128
|
state.off = once(el, 'animationcancel animationend', removeAnimationClasses, {
|
|
128
129
|
self: true,
|
|
@@ -137,11 +137,7 @@ function toggleInstant(el, show, { _toggle }) {
|
|
|
137
137
|
return _toggle(el, show);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
el,
|
|
142
|
-
show,
|
|
143
|
-
{ animation, duration, velocity, transition, _toggle },
|
|
144
|
-
) {
|
|
140
|
+
async function toggleTransition(el, show, { animation, duration, velocity, transition, _toggle }) {
|
|
145
141
|
const [mode = 'reveal', startProp = 'top'] = animation[0]?.split('-') || [];
|
|
146
142
|
|
|
147
143
|
const dirs = [
|
package/src/js/util/animation.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { addClass, hasClass, removeClass, removeClasses } from './class';
|
|
1
|
+
import { addClass, hasClass, removeClass } from './class';
|
|
3
2
|
import { once, trigger } from './event';
|
|
4
|
-
import {
|
|
3
|
+
import { toNodes } from './lang';
|
|
5
4
|
import { css, propName } from './style';
|
|
6
5
|
|
|
7
6
|
const clsTransition = 'uk-transition';
|
|
@@ -15,10 +14,8 @@ function transition(element, props, duration = 400, timing = 'linear') {
|
|
|
15
14
|
(element) =>
|
|
16
15
|
new Promise((resolve, reject) => {
|
|
17
16
|
for (const name in props) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
css(element, name, value);
|
|
21
|
-
}
|
|
17
|
+
// Force reflow: transition won't run for previously hidden element
|
|
18
|
+
css(element, name);
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
const timer = setTimeout(() => trigger(element, transitionEnd), duration);
|
|
@@ -69,7 +66,7 @@ export const Transition = {
|
|
|
69
66
|
},
|
|
70
67
|
};
|
|
71
68
|
|
|
72
|
-
const
|
|
69
|
+
const clsAnimation = 'uk-animation';
|
|
73
70
|
const animationEnd = 'animationend';
|
|
74
71
|
const animationCanceled = 'animationcanceled';
|
|
75
72
|
|
|
@@ -78,7 +75,18 @@ function animate(element, animation, duration = 200, origin, out) {
|
|
|
78
75
|
toNodes(element).map(
|
|
79
76
|
(element) =>
|
|
80
77
|
new Promise((resolve, reject) => {
|
|
81
|
-
|
|
78
|
+
if (hasClass(element, clsAnimation)) {
|
|
79
|
+
trigger(element, animationCanceled);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const classes = [
|
|
83
|
+
animation,
|
|
84
|
+
clsAnimation,
|
|
85
|
+
`${clsAnimation}-${out ? 'leave' : 'enter'}`,
|
|
86
|
+
origin && `uk-transform-origin-${origin}`,
|
|
87
|
+
out && `${clsAnimation}-reverse`,
|
|
88
|
+
];
|
|
89
|
+
|
|
82
90
|
const timer = setTimeout(() => trigger(element, animationEnd), duration);
|
|
83
91
|
|
|
84
92
|
once(
|
|
@@ -90,25 +98,18 @@ function animate(element, animation, duration = 200, origin, out) {
|
|
|
90
98
|
type === animationCanceled ? reject() : resolve(element);
|
|
91
99
|
|
|
92
100
|
css(element, 'animationDuration', '');
|
|
93
|
-
|
|
101
|
+
removeClass(element, classes);
|
|
94
102
|
},
|
|
95
103
|
{ self: true },
|
|
96
104
|
);
|
|
97
105
|
|
|
98
106
|
css(element, 'animationDuration', `${duration}ms`);
|
|
99
|
-
addClass(element,
|
|
100
|
-
|
|
101
|
-
if (startsWith(animation, animationPrefix)) {
|
|
102
|
-
origin && addClass(element, `uk-transform-origin-${origin}`);
|
|
103
|
-
out && addClass(element, `${animationPrefix}reverse`);
|
|
104
|
-
}
|
|
107
|
+
addClass(element, classes);
|
|
105
108
|
}),
|
|
106
109
|
),
|
|
107
110
|
);
|
|
108
111
|
}
|
|
109
112
|
|
|
110
|
-
const inProgressRe = new RegExp(`${animationPrefix}(enter|leave)`);
|
|
111
|
-
|
|
112
113
|
export const Animation = {
|
|
113
114
|
in: animate,
|
|
114
115
|
|
|
@@ -117,7 +118,7 @@ export const Animation = {
|
|
|
117
118
|
},
|
|
118
119
|
|
|
119
120
|
inProgress(element) {
|
|
120
|
-
return
|
|
121
|
+
return hasClass(element, clsAnimation);
|
|
121
122
|
},
|
|
122
123
|
|
|
123
124
|
cancel(element) {
|
package/src/js/util/class.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { includes, isArray, isUndefined,
|
|
1
|
+
import { includes, isArray, isUndefined, toNodes } from './lang';
|
|
2
2
|
|
|
3
3
|
export function addClass(element, ...classes) {
|
|
4
4
|
for (const node of toNodes(element)) {
|
|
@@ -18,13 +18,6 @@ export function removeClass(element, ...classes) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function removeClasses(element, clsRegex) {
|
|
22
|
-
clsRegex = new RegExp(clsRegex);
|
|
23
|
-
for (const node of toNodes(element)) {
|
|
24
|
-
node.classList.remove(...toArray(node.classList).filter((cls) => cls.match(clsRegex)));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
21
|
export function replaceClass(element, oldClass, newClass) {
|
|
29
22
|
newClass = toClasses(newClass);
|
|
30
23
|
oldClass = toClasses(oldClass).filter((cls) => !includes(newClass, cls));
|