uikit 3.16.16-dev.1d3cd4b76 → 3.16.16-dev.7b3ba4436
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 +3 -3
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +26 -25
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +26 -25
- 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 +2 -2
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +2 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +26 -25
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +2 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +26 -25
- 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 +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +21 -30
- 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 +63 -69
- package/dist/js/uikit.min.js +1 -1
- package/package.json +7 -7
- package/src/js/api/global.js +1 -1
- package/src/js/components/filter.js +2 -2
- package/src/js/components/internal/slider-transitioner.js +15 -15
- package/src/js/components/slider.js +2 -1
- package/src/js/core/drop.js +2 -2
- package/src/js/core/modal.js +19 -21
- package/src/js/mixin/internal/slideshow-transitioner.js +16 -14
- package/src/js/mixin/parallax.js +2 -1
- package/src/js/mixin/slider-drag.js +12 -6
- package/src/js/mixin/slider-nav.js +1 -1
- package/src/js/mixin/slider.js +3 -17
- package/src/js/util/lang.js +0 -9
- package/tests/modal.html +16 -15
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.16.16-dev.
|
|
5
|
+
"version": "3.16.16-dev.7b3ba4436",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"camelcase": "^7.0.1",
|
|
28
28
|
"clean-css": "^5.3.2",
|
|
29
29
|
"dateformat": "^5.0.3",
|
|
30
|
-
"esbuild": "^0.17.
|
|
31
|
-
"eslint": "^8.
|
|
30
|
+
"esbuild": "^0.17.18",
|
|
31
|
+
"eslint": "^8.39.0",
|
|
32
32
|
"eslint-config-prettier": "^8.8.0",
|
|
33
33
|
"fs-extra": "^11.1.1",
|
|
34
|
-
"glob": "^10.2.
|
|
35
|
-
"inquirer": "^9.
|
|
34
|
+
"glob": "^10.2.2",
|
|
35
|
+
"inquirer": "^9.2.0",
|
|
36
36
|
"less": "^4.1.3",
|
|
37
37
|
"minimist": "^1.2.8",
|
|
38
38
|
"number-precision": "^1.6.0",
|
|
39
39
|
"p-limit": "^4.0.0",
|
|
40
|
-
"prettier": "^2.8.
|
|
41
|
-
"rollup": "^3.
|
|
40
|
+
"prettier": "^2.8.8",
|
|
41
|
+
"rollup": "^3.21.0",
|
|
42
42
|
"rollup-plugin-esbuild": "^5.0.0",
|
|
43
43
|
"rollup-plugin-modify": "^3.0.0",
|
|
44
44
|
"rtlcss": "^4.1.0",
|
package/src/js/api/global.js
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
clamp,
|
|
5
5
|
createEvent,
|
|
6
6
|
css,
|
|
7
|
-
Deferred,
|
|
8
7
|
dimensions,
|
|
9
8
|
findIndex,
|
|
10
9
|
includes,
|
|
@@ -17,8 +16,6 @@ import {
|
|
|
17
16
|
} from 'uikit-util';
|
|
18
17
|
|
|
19
18
|
export default function (prev, next, dir, { center, easing, list }) {
|
|
20
|
-
const deferred = new Deferred();
|
|
21
|
-
|
|
22
19
|
const from = prev
|
|
23
20
|
? getLeft(prev, list, center)
|
|
24
21
|
: getLeft(next, list, center) + dimensions(next).width * dir;
|
|
@@ -26,6 +23,8 @@ export default function (prev, next, dir, { center, easing, list }) {
|
|
|
26
23
|
? getLeft(next, list, center)
|
|
27
24
|
: from + dimensions(prev).width * dir * (isRtl ? -1 : 1);
|
|
28
25
|
|
|
26
|
+
let resolve;
|
|
27
|
+
|
|
29
28
|
return {
|
|
30
29
|
dir,
|
|
31
30
|
|
|
@@ -45,26 +44,27 @@ export default function (prev, next, dir, { center, easing, list }) {
|
|
|
45
44
|
dir,
|
|
46
45
|
});
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
return new Promise((res) => {
|
|
48
|
+
resolve ||= res;
|
|
49
|
+
Transition.start(
|
|
50
|
+
list,
|
|
51
|
+
{ transform: translate(-to * (isRtl ? -1 : 1), 'px') },
|
|
52
|
+
duration,
|
|
53
|
+
timing
|
|
54
|
+
).then(resolve, noop);
|
|
55
|
+
});
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
cancel() {
|
|
59
|
-
Transition.cancel(list);
|
|
59
|
+
return Transition.cancel(list);
|
|
60
60
|
},
|
|
61
61
|
|
|
62
62
|
reset() {
|
|
63
63
|
css(list, 'transform', '');
|
|
64
64
|
},
|
|
65
65
|
|
|
66
|
-
forward(duration, percent = this.percent()) {
|
|
67
|
-
|
|
66
|
+
async forward(duration, percent = this.percent()) {
|
|
67
|
+
await this.cancel();
|
|
68
68
|
return this.show(duration, percent, true);
|
|
69
69
|
},
|
|
70
70
|
|
|
@@ -155,7 +155,7 @@ function centerEl(el, list) {
|
|
|
155
155
|
return dimensions(list).width / 2 - dimensions(el).width / 2;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
function getElLeft(el, list) {
|
|
159
159
|
return (
|
|
160
160
|
(el &&
|
|
161
161
|
(position(el).left + (isRtl ? dimensions(el).width - dimensions(list).width : 0)) *
|
|
@@ -93,7 +93,8 @@ export default {
|
|
|
93
93
|
if (this.center) {
|
|
94
94
|
if (
|
|
95
95
|
left < width / 2 &&
|
|
96
|
-
left + slideWidth + dimensions(
|
|
96
|
+
left + slideWidth + dimensions(getIndex(+i + 1, this.slides)).width / 2 >
|
|
97
|
+
width / 2
|
|
97
98
|
) {
|
|
98
99
|
sets.push(+i);
|
|
99
100
|
left = width / 2 - slideWidth / 2;
|
package/src/js/core/drop.js
CHANGED
|
@@ -89,8 +89,8 @@ export default {
|
|
|
89
89
|
},
|
|
90
90
|
|
|
91
91
|
target({ target, targetX, targetY }, $el) {
|
|
92
|
-
targetX
|
|
93
|
-
targetY
|
|
92
|
+
targetX ||= target || this.targetEl;
|
|
93
|
+
targetY ||= target || this.targetEl;
|
|
94
94
|
|
|
95
95
|
return [
|
|
96
96
|
targetX === true ? window : query(targetX, $el),
|
package/src/js/core/modal.js
CHANGED
|
@@ -2,12 +2,13 @@ import Modal from '../mixin/modal';
|
|
|
2
2
|
import {
|
|
3
3
|
$,
|
|
4
4
|
addClass,
|
|
5
|
+
assign,
|
|
5
6
|
css,
|
|
6
|
-
Deferred,
|
|
7
7
|
hasClass,
|
|
8
8
|
height,
|
|
9
9
|
html,
|
|
10
10
|
isString,
|
|
11
|
+
noop,
|
|
11
12
|
on,
|
|
12
13
|
removeClass,
|
|
13
14
|
} from 'uikit-util';
|
|
@@ -88,8 +89,7 @@ function install({ modal }) {
|
|
|
88
89
|
i18n.ok
|
|
89
90
|
}</button>
|
|
90
91
|
</div>`,
|
|
91
|
-
options
|
|
92
|
-
(deferred) => deferred.resolve()
|
|
92
|
+
options
|
|
93
93
|
);
|
|
94
94
|
};
|
|
95
95
|
|
|
@@ -105,7 +105,7 @@ function install({ modal }) {
|
|
|
105
105
|
</div>
|
|
106
106
|
</form>`,
|
|
107
107
|
options,
|
|
108
|
-
(
|
|
108
|
+
() => Promise.reject()
|
|
109
109
|
);
|
|
110
110
|
};
|
|
111
111
|
|
|
@@ -124,7 +124,7 @@ function install({ modal }) {
|
|
|
124
124
|
</div>
|
|
125
125
|
</form>`,
|
|
126
126
|
options,
|
|
127
|
-
(
|
|
127
|
+
() => null,
|
|
128
128
|
(dialog) => $('input', dialog.$el).value
|
|
129
129
|
);
|
|
130
130
|
};
|
|
@@ -134,7 +134,7 @@ function install({ modal }) {
|
|
|
134
134
|
cancel: 'Cancel',
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
function openDialog(tmpl, options, hideFn, submitFn) {
|
|
137
|
+
function openDialog(tmpl, options, hideFn = noop, submitFn = noop) {
|
|
138
138
|
options = {
|
|
139
139
|
bgClose: false,
|
|
140
140
|
escClose: true,
|
|
@@ -144,21 +144,19 @@ function install({ modal }) {
|
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
const dialog = modal.dialog(tmpl(options), options);
|
|
147
|
-
const deferred = new Deferred();
|
|
148
|
-
|
|
149
|
-
let resolved = false;
|
|
150
|
-
|
|
151
|
-
on(dialog.$el, 'submit', 'form', (e) => {
|
|
152
|
-
e.preventDefault();
|
|
153
|
-
deferred.resolve(submitFn?.(dialog));
|
|
154
|
-
resolved = true;
|
|
155
|
-
dialog.hide();
|
|
156
|
-
});
|
|
157
147
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
148
|
+
return assign(
|
|
149
|
+
new Promise((resolve) => {
|
|
150
|
+
const off = on(dialog.$el, 'hide', () => resolve(hideFn()));
|
|
151
|
+
|
|
152
|
+
on(dialog.$el, 'submit', 'form', (e) => {
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
resolve(submitFn(dialog));
|
|
155
|
+
off();
|
|
156
|
+
dialog.hide();
|
|
157
|
+
});
|
|
158
|
+
}),
|
|
159
|
+
{ dialog }
|
|
160
|
+
);
|
|
163
161
|
}
|
|
164
162
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { clamp, createEvent, css,
|
|
1
|
+
import { clamp, createEvent, css, noop, Transition, trigger } from 'uikit-util';
|
|
2
2
|
|
|
3
3
|
export default function Transitioner(prev, next, dir, { animation, easing }) {
|
|
4
4
|
const { percent, translate, show = noop } = animation;
|
|
5
5
|
const props = show(dir);
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
let resolve;
|
|
7
8
|
|
|
8
9
|
return {
|
|
9
10
|
dir,
|
|
@@ -17,19 +18,20 @@ export default function Transitioner(prev, next, dir, { animation, easing }) {
|
|
|
17
18
|
triggerUpdate(next, 'itemin', { percent, duration, timing, dir });
|
|
18
19
|
triggerUpdate(prev, 'itemout', { percent: 1 - percent, duration, timing, dir });
|
|
19
20
|
|
|
20
|
-
Promise
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
return new Promise((res) => {
|
|
22
|
+
resolve ||= res;
|
|
23
|
+
Promise.all([
|
|
24
|
+
Transition.start(next, props[1], duration, timing),
|
|
25
|
+
Transition.start(prev, props[0], duration, timing),
|
|
26
|
+
]).then(() => {
|
|
27
|
+
this.reset();
|
|
28
|
+
resolve();
|
|
29
|
+
}, noop);
|
|
30
|
+
});
|
|
29
31
|
},
|
|
30
32
|
|
|
31
33
|
cancel() {
|
|
32
|
-
Transition.cancel([next, prev]);
|
|
34
|
+
return Transition.cancel([next, prev]);
|
|
33
35
|
},
|
|
34
36
|
|
|
35
37
|
reset() {
|
|
@@ -38,8 +40,8 @@ export default function Transitioner(prev, next, dir, { animation, easing }) {
|
|
|
38
40
|
}
|
|
39
41
|
},
|
|
40
42
|
|
|
41
|
-
forward(duration, percent = this.percent()) {
|
|
42
|
-
|
|
43
|
+
async forward(duration, percent = this.percent()) {
|
|
44
|
+
await this.cancel();
|
|
43
45
|
return this.show(duration, percent, true);
|
|
44
46
|
},
|
|
45
47
|
|
package/src/js/mixin/parallax.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Media from '../mixin/media';
|
|
2
2
|
import { getMaxPathLength } from '../util/svg';
|
|
3
3
|
import {
|
|
4
|
+
clamp,
|
|
4
5
|
createEvent,
|
|
5
6
|
css,
|
|
6
7
|
Dimensions,
|
|
@@ -78,7 +79,7 @@ export default {
|
|
|
78
79
|
getCss(percent) {
|
|
79
80
|
const css = { transform: '', filter: '' };
|
|
80
81
|
for (const prop in this.props) {
|
|
81
|
-
this.props[prop](css, percent);
|
|
82
|
+
this.props[prop](css, clamp(percent));
|
|
82
83
|
}
|
|
83
84
|
css.willChange = Object.keys(css)
|
|
84
85
|
.filter((key) => css[key] !== '')
|
|
@@ -132,19 +132,18 @@ export default {
|
|
|
132
132
|
this.dragging = true;
|
|
133
133
|
this.dir = distance < 0 ? 1 : -1;
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
let { prevIndex } = this;
|
|
135
|
+
let { slides, prevIndex } = this;
|
|
137
136
|
let dis = Math.abs(distance);
|
|
138
|
-
let nextIndex = this.getIndex(prevIndex + this.dir
|
|
139
|
-
let width = this._getDistance(prevIndex, nextIndex)
|
|
137
|
+
let nextIndex = this.getIndex(prevIndex + this.dir);
|
|
138
|
+
let width = this._getDistance(prevIndex, nextIndex);
|
|
140
139
|
|
|
141
140
|
while (nextIndex !== prevIndex && dis > width) {
|
|
142
141
|
this.drag -= width * this.dir;
|
|
143
142
|
|
|
144
143
|
prevIndex = nextIndex;
|
|
145
144
|
dis -= width;
|
|
146
|
-
nextIndex = this.getIndex(prevIndex + this.dir
|
|
147
|
-
width = this._getDistance(prevIndex, nextIndex)
|
|
145
|
+
nextIndex = this.getIndex(prevIndex + this.dir);
|
|
146
|
+
width = this._getDistance(prevIndex, nextIndex);
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
this.percent = dis / width;
|
|
@@ -222,6 +221,13 @@ export default {
|
|
|
222
221
|
|
|
223
222
|
this.drag = this.percent = null;
|
|
224
223
|
},
|
|
224
|
+
|
|
225
|
+
_getDistance(prev, next) {
|
|
226
|
+
return (
|
|
227
|
+
this._getTransitioner(prev, prev !== next && next).getDistance() ||
|
|
228
|
+
this.slides[prev].offsetWidth
|
|
229
|
+
);
|
|
230
|
+
},
|
|
225
231
|
},
|
|
226
232
|
};
|
|
227
233
|
|
package/src/js/mixin/slider.js
CHANGED
|
@@ -3,17 +3,7 @@ import SliderNav from './slider-nav';
|
|
|
3
3
|
import SliderDrag from './slider-drag';
|
|
4
4
|
import SliderAutoplay from './slider-autoplay';
|
|
5
5
|
import { resize } from '../api/observables';
|
|
6
|
-
import {
|
|
7
|
-
$,
|
|
8
|
-
children,
|
|
9
|
-
clamp,
|
|
10
|
-
getIndex,
|
|
11
|
-
hasClass,
|
|
12
|
-
isNumber,
|
|
13
|
-
isRtl,
|
|
14
|
-
removeClass,
|
|
15
|
-
trigger,
|
|
16
|
-
} from 'uikit-util';
|
|
6
|
+
import { $, children, clamp, getIndex, hasClass, isRtl, removeClass, trigger } from 'uikit-util';
|
|
17
7
|
|
|
18
8
|
export default {
|
|
19
9
|
mixins: [SliderAutoplay, SliderDrag, SliderNav, I18n],
|
|
@@ -181,10 +171,6 @@ export default {
|
|
|
181
171
|
);
|
|
182
172
|
},
|
|
183
173
|
|
|
184
|
-
_getDistance(prev, next) {
|
|
185
|
-
return this._getTransitioner(prev, prev !== next && next).getDistance();
|
|
186
|
-
},
|
|
187
|
-
|
|
188
174
|
_translate(percent, prev = this.prevIndex, next = this.index) {
|
|
189
175
|
const transitioner = this._getTransitioner(prev === next ? false : prev, next);
|
|
190
176
|
transitioner.translate(percent);
|
|
@@ -198,8 +184,8 @@ export default {
|
|
|
198
184
|
options = this.transitionOptions
|
|
199
185
|
) {
|
|
200
186
|
return new this.Transitioner(
|
|
201
|
-
|
|
202
|
-
|
|
187
|
+
this.slides[prev] || prev,
|
|
188
|
+
this.slides[next] || next,
|
|
203
189
|
dir * (isRtl ? -1 : 1),
|
|
204
190
|
options
|
|
205
191
|
);
|
package/src/js/util/lang.js
CHANGED
|
@@ -278,12 +278,3 @@ export function memoize(fn) {
|
|
|
278
278
|
const cache = Object.create(null);
|
|
279
279
|
return (key) => cache[key] || (cache[key] = fn(key));
|
|
280
280
|
}
|
|
281
|
-
|
|
282
|
-
export class Deferred {
|
|
283
|
-
constructor() {
|
|
284
|
-
this.promise = new Promise((resolve, reject) => {
|
|
285
|
-
this.reject = reject;
|
|
286
|
-
this.resolve = resolve;
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
}
|
package/tests/modal.html
CHANGED
|
@@ -457,37 +457,38 @@
|
|
|
457
457
|
</div>
|
|
458
458
|
|
|
459
459
|
<script>
|
|
460
|
-
const {on} = UIkit
|
|
460
|
+
const { modal, util: { on } } = UIkit;
|
|
461
461
|
|
|
462
462
|
on('#js-modal-dialog', 'click', e => {
|
|
463
463
|
e.preventDefault();
|
|
464
464
|
e.target.blur();
|
|
465
|
-
|
|
465
|
+
modal.dialog('<p class="uk-modal-body">UIkit dialog!</p>');
|
|
466
466
|
});
|
|
467
467
|
|
|
468
|
-
on('#js-modal-alert', 'click', e => {
|
|
468
|
+
on('#js-modal-alert', 'click', async e => {
|
|
469
469
|
e.preventDefault();
|
|
470
470
|
e.target.blur();
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
);
|
|
471
|
+
await modal.alert('UIkit alert!');
|
|
472
|
+
console.log('Alert closed.');
|
|
474
473
|
});
|
|
475
474
|
|
|
476
|
-
on('#js-modal-confirm', 'click', e => {
|
|
475
|
+
on('#js-modal-confirm', 'click', async e => {
|
|
477
476
|
e.preventDefault();
|
|
478
477
|
e.target.blur();
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
|
|
479
|
+
try {
|
|
480
|
+
await modal.confirm('UIkit confirm!');
|
|
481
|
+
console.log('Confirmed.');
|
|
482
|
+
} catch (e) {
|
|
483
|
+
console.log('Rejected.')
|
|
484
|
+
}
|
|
483
485
|
});
|
|
484
486
|
|
|
485
|
-
on('#js-modal-prompt', 'click', e => {
|
|
487
|
+
on('#js-modal-prompt', 'click', async e => {
|
|
486
488
|
e.preventDefault();
|
|
487
489
|
e.target.blur();
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
);
|
|
490
|
+
const name = await modal.prompt('Name:', 'Your name');
|
|
491
|
+
console.log('Prompted:', name);
|
|
491
492
|
});
|
|
492
493
|
|
|
493
494
|
</script>
|