uikit 3.25.4 → 3.25.5-dev.7f39b03
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/.prettierignore +0 -1
- package/CHANGELOG.md +11 -0
- package/README.md +0 -1
- package/build/publishDev.js +2 -3
- package/build/release.js +1 -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 +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 +19 -13
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +19 -13
- 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 -7
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +1 -7
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +19 -19
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +1 -7
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +19 -19
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +5 -6
- 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 +55 -13
- 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 +77 -30
- package/dist/js/uikit.min.js +1 -1
- package/package.json +64 -63
- package/src/js/components/sortable.js +5 -6
- package/src/js/core/drop.js +8 -1
- package/src/js/core/overflow-fade.js +83 -8
- package/src/js/mixin/slider-drag.js +21 -14
- package/src/js/util/attr.js +1 -5
- package/src/less/components/nav.less +0 -1
- package/src/scss/components/nav.scss +0 -1
- package/tests/upload.html +2 -2
package/package.json
CHANGED
|
@@ -1,64 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
2
|
+
"name": "uikit",
|
|
3
|
+
"title": "UIkit",
|
|
4
|
+
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
|
|
5
|
+
"version": "3.25.5-dev.7f39b03",
|
|
6
|
+
"main": "dist/js/uikit.js",
|
|
7
|
+
"style": "dist/css/uikit.css",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"*.css",
|
|
10
|
+
"./src/js/*.js",
|
|
11
|
+
"./dist/**/*.js"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build-scss": "node build/scss",
|
|
15
|
+
"compile": "pnpm compile-less && pnpm compile-js",
|
|
16
|
+
"compile-js": "node build/build",
|
|
17
|
+
"compile-less": "pnpm icons && node build/less",
|
|
18
|
+
"compile-rtl": "pnpm compile-less rtl",
|
|
19
|
+
"icons": "node build/icons",
|
|
20
|
+
"prefix": "node build/prefix",
|
|
21
|
+
"scope": "node build/scope",
|
|
22
|
+
"release": "node build/release",
|
|
23
|
+
"watch": "chokidar \"**/*.less\" --initial -i \"node_modules\" -c \"node build/less\""
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/uikit/uikit.git"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/uikit/uikit/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://getuikit.com",
|
|
34
|
+
"packageManager": "pnpm@10.27.0",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@eslint/js": "^9.39.2",
|
|
37
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
38
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
39
|
+
"archiver": "^7.0.1",
|
|
40
|
+
"camelcase": "^9.0.0",
|
|
41
|
+
"chokidar-cli": "^3.0.0",
|
|
42
|
+
"clean-css": "^5.3.3",
|
|
43
|
+
"date-fns": "^4.1.0",
|
|
44
|
+
"esbuild": "^0.27.2",
|
|
45
|
+
"eslint": "^9.39.2",
|
|
46
|
+
"eslint-config-prettier": "^10.1.8",
|
|
47
|
+
"execa": "^9.6.1",
|
|
48
|
+
"fs-extra": "^11.3.2",
|
|
49
|
+
"glob": "^13.0.0",
|
|
50
|
+
"globals": "^17.0.0",
|
|
51
|
+
"inquirer": "^13.1.0",
|
|
52
|
+
"less": "^4.5.1",
|
|
53
|
+
"minimist": "^1.2.8",
|
|
54
|
+
"number-precision": "^1.6.0",
|
|
55
|
+
"p-limit": "^7.2.0",
|
|
56
|
+
"prettier": "^3.7.4",
|
|
57
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
58
|
+
"rollup": "^4.53.5",
|
|
59
|
+
"rollup-plugin-esbuild": "^6.2.1",
|
|
60
|
+
"rtlcss": "^4.3.0",
|
|
61
|
+
"semver": "^7.7.3",
|
|
62
|
+
"strip-css-comments": "^5.0.0",
|
|
63
|
+
"svgo": "^4.0.0"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -142,8 +142,7 @@ export default {
|
|
|
142
142
|
sortable.target,
|
|
143
143
|
target,
|
|
144
144
|
placeholder,
|
|
145
|
-
x,
|
|
146
|
-
y,
|
|
145
|
+
{ x, y },
|
|
147
146
|
sortable === previous && data.moved !== target,
|
|
148
147
|
);
|
|
149
148
|
|
|
@@ -365,7 +364,7 @@ function findTarget(items, point) {
|
|
|
365
364
|
return items[findIndex(items, (item) => pointInRect(point, dimensions(item)))];
|
|
366
365
|
}
|
|
367
366
|
|
|
368
|
-
function findInsertTarget(list, target, placeholder,
|
|
367
|
+
function findInsertTarget(list, target, placeholder, point, sameList) {
|
|
369
368
|
if (!children(list).length) {
|
|
370
369
|
return;
|
|
371
370
|
}
|
|
@@ -373,7 +372,7 @@ function findInsertTarget(list, target, placeholder, x, y, sameList) {
|
|
|
373
372
|
const rect = dimensions(target);
|
|
374
373
|
if (!sameList) {
|
|
375
374
|
if (!isHorizontal(list, placeholder)) {
|
|
376
|
-
return y < rect.top + rect.height / 2 ? target : target.nextElementSibling;
|
|
375
|
+
return point.y < rect.top + rect.height / 2 ? target : target.nextElementSibling;
|
|
377
376
|
}
|
|
378
377
|
|
|
379
378
|
return target;
|
|
@@ -386,8 +385,8 @@ function findInsertTarget(list, target, placeholder, x, y, sameList) {
|
|
|
386
385
|
);
|
|
387
386
|
|
|
388
387
|
const [pointerPos, lengthProp, startProp, endProp] = sameRow
|
|
389
|
-
? [x, 'width', 'left', 'right']
|
|
390
|
-
: [y, 'height', 'top', 'bottom'];
|
|
388
|
+
? [point.x, 'width', 'left', 'right']
|
|
389
|
+
: [point.y, 'height', 'top', 'bottom'];
|
|
391
390
|
|
|
392
391
|
const diff =
|
|
393
392
|
placeholderRect[lengthProp] < rect[lengthProp]
|
package/src/js/core/drop.js
CHANGED
|
@@ -338,6 +338,9 @@ export default {
|
|
|
338
338
|
append(this.container, this.$el);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
// Mark enter early so isToggled() detects show when using delayShow
|
|
342
|
+
addClass(this.$el, this.clsEnter);
|
|
343
|
+
|
|
341
344
|
this.showTimer = setTimeout(
|
|
342
345
|
() => this.toggleElement(this.$el, true),
|
|
343
346
|
(delay && this.delayShow) || 0,
|
|
@@ -345,7 +348,11 @@ export default {
|
|
|
345
348
|
},
|
|
346
349
|
|
|
347
350
|
hide(delay = true, animate = true) {
|
|
348
|
-
const hide = () =>
|
|
351
|
+
const hide = () => {
|
|
352
|
+
// Ensure enter class is removed if show is canceled early
|
|
353
|
+
removeClass(this.$el, this.clsEnter);
|
|
354
|
+
this.toggleElement(this.$el, false, this.animateOut && animate);
|
|
355
|
+
};
|
|
349
356
|
|
|
350
357
|
this.clearTimers();
|
|
351
358
|
|
|
@@ -1,22 +1,45 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
children,
|
|
3
|
+
clamp,
|
|
4
|
+
css,
|
|
5
|
+
getEventPos,
|
|
6
|
+
hasClass,
|
|
7
|
+
isInput,
|
|
8
|
+
isTouch,
|
|
9
|
+
on,
|
|
10
|
+
pointerCancel,
|
|
11
|
+
pointerDown,
|
|
12
|
+
pointerMove,
|
|
13
|
+
pointerUp,
|
|
14
|
+
selInput,
|
|
15
|
+
toggleClass,
|
|
16
|
+
} from 'uikit-util';
|
|
2
17
|
import { mutation, resize } from '../api/observables';
|
|
3
18
|
|
|
4
19
|
export default {
|
|
5
20
|
data: {
|
|
21
|
+
threshold: 5,
|
|
6
22
|
fadeDuration: 0.05,
|
|
7
23
|
},
|
|
8
24
|
|
|
9
|
-
events:
|
|
10
|
-
|
|
25
|
+
events: [
|
|
26
|
+
{
|
|
27
|
+
name: 'scroll',
|
|
11
28
|
|
|
12
|
-
|
|
29
|
+
self: true,
|
|
13
30
|
|
|
14
|
-
|
|
31
|
+
passive: true,
|
|
15
32
|
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
handler() {
|
|
34
|
+
this.$emit();
|
|
35
|
+
},
|
|
18
36
|
},
|
|
19
|
-
|
|
37
|
+
{
|
|
38
|
+
name: pointerDown,
|
|
39
|
+
|
|
40
|
+
handler: handleMouseDrag,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
20
43
|
|
|
21
44
|
observe: [
|
|
22
45
|
mutation({
|
|
@@ -65,3 +88,55 @@ export default {
|
|
|
65
88
|
events: ['resize'],
|
|
66
89
|
},
|
|
67
90
|
};
|
|
91
|
+
|
|
92
|
+
function handleMouseDrag(e) {
|
|
93
|
+
const { target, button, defaultPrevented } = e;
|
|
94
|
+
|
|
95
|
+
if (
|
|
96
|
+
defaultPrevented ||
|
|
97
|
+
button > 0 ||
|
|
98
|
+
isTouch(e) ||
|
|
99
|
+
target.closest(selInput) ||
|
|
100
|
+
isInput(target)
|
|
101
|
+
) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
|
|
107
|
+
const pointerOptions = { passive: false, capture: true };
|
|
108
|
+
const { $el: el, threshold, $options } = this;
|
|
109
|
+
let started;
|
|
110
|
+
|
|
111
|
+
const off = on(document, pointerMove, move(e), pointerOptions);
|
|
112
|
+
on(document, [pointerUp, pointerCancel], end, { capture: true, once: true });
|
|
113
|
+
|
|
114
|
+
function move(e) {
|
|
115
|
+
let origin = getEventPos(e);
|
|
116
|
+
let pos = origin;
|
|
117
|
+
let lastPos = pos;
|
|
118
|
+
|
|
119
|
+
return function (e) {
|
|
120
|
+
lastPos = pos;
|
|
121
|
+
pos = getEventPos(e);
|
|
122
|
+
|
|
123
|
+
const isVertical = hasClass(el, `${$options.id}-vertical`);
|
|
124
|
+
const prop = isVertical ? 'y' : 'x';
|
|
125
|
+
|
|
126
|
+
started ||= Math.abs(pos[prop] - origin[prop]) > threshold;
|
|
127
|
+
|
|
128
|
+
if (started) {
|
|
129
|
+
const delta = lastPos[prop] - pos[prop];
|
|
130
|
+
el[isVertical ? 'scrollTop' : 'scrollLeft'] += delta;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function end() {
|
|
136
|
+
off();
|
|
137
|
+
|
|
138
|
+
if (started) {
|
|
139
|
+
setTimeout(on(el, 'click', (e) => e.preventDefault(), pointerOptions));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
css,
|
|
3
3
|
getEventPos,
|
|
4
4
|
includes,
|
|
5
|
+
isEqual,
|
|
5
6
|
isRtl,
|
|
6
7
|
isTouch,
|
|
7
8
|
noop,
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
} from 'uikit-util';
|
|
14
15
|
|
|
15
16
|
const pointerOptions = { passive: false, capture: true };
|
|
16
|
-
const pointerUpOptions = { passive: true, capture: true };
|
|
17
17
|
const pointerDown = 'touchstart mousedown';
|
|
18
18
|
const pointerMove = 'touchmove mousemove';
|
|
19
19
|
const pointerUp = 'touchend touchcancel mouseup click input scroll';
|
|
@@ -26,15 +26,20 @@ export default {
|
|
|
26
26
|
data: {
|
|
27
27
|
draggable: true,
|
|
28
28
|
threshold: 10,
|
|
29
|
+
angleThreshold: 45,
|
|
29
30
|
},
|
|
30
31
|
|
|
31
32
|
created() {
|
|
32
33
|
for (const key of ['start', 'move', 'end']) {
|
|
33
34
|
const fn = this[key];
|
|
34
35
|
this[key] = (e) => {
|
|
35
|
-
const pos = getEventPos(e)
|
|
36
|
+
const pos = getEventPos(e);
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
if (isRtl) {
|
|
39
|
+
pos.x = -pos.x;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
this.prevPos = isEqual(pos, this.pos) ? this.prevPos : this.pos;
|
|
38
43
|
this.pos = pos;
|
|
39
44
|
|
|
40
45
|
fn(e);
|
|
@@ -89,7 +94,7 @@ export default {
|
|
|
89
94
|
|
|
90
95
|
if (this._transitioner) {
|
|
91
96
|
this.percent = this._transitioner.percent();
|
|
92
|
-
this.drag += this._transitioner.getDistance() * this.percent * this.dir;
|
|
97
|
+
this.drag.x += this._transitioner.getDistance() * this.percent * this.dir;
|
|
93
98
|
|
|
94
99
|
this._transitioner.cancel();
|
|
95
100
|
this._transitioner.translate(this.percent);
|
|
@@ -104,17 +109,17 @@ export default {
|
|
|
104
109
|
on(document, pointerMove, this.move, pointerOptions);
|
|
105
110
|
|
|
106
111
|
// 'input' event is triggered by video controls
|
|
107
|
-
on(document, pointerUp, this.end,
|
|
112
|
+
on(document, pointerUp, this.end, { passive: true, capture: true, once: true });
|
|
108
113
|
|
|
109
114
|
css(this.list, 'userSelect', 'none');
|
|
110
115
|
},
|
|
111
116
|
|
|
112
117
|
move(e) {
|
|
113
|
-
const distance = this.pos - this.drag;
|
|
114
|
-
|
|
118
|
+
const distance = this.pos.x - this.drag.x;
|
|
115
119
|
if (
|
|
116
120
|
distance === 0 ||
|
|
117
|
-
this.
|
|
121
|
+
(!this.dragging && getAngle(this.pos, this.drag) > this.angleThreshold) ||
|
|
122
|
+
this.prevPos.x === this.pos.x ||
|
|
118
123
|
(!this.dragging && Math.abs(distance) < this.threshold)
|
|
119
124
|
) {
|
|
120
125
|
return;
|
|
@@ -131,7 +136,7 @@ export default {
|
|
|
131
136
|
let width = getDistance.call(this, prevIndex, nextIndex);
|
|
132
137
|
|
|
133
138
|
while (nextIndex !== prevIndex && dis > width) {
|
|
134
|
-
this.drag -= width * this.dir;
|
|
139
|
+
this.drag.x -= width * this.dir;
|
|
135
140
|
|
|
136
141
|
prevIndex = nextIndex;
|
|
137
142
|
dis -= width;
|
|
@@ -181,7 +186,6 @@ export default {
|
|
|
181
186
|
|
|
182
187
|
end() {
|
|
183
188
|
off(document, pointerMove, this.move, pointerOptions);
|
|
184
|
-
off(document, pointerUp, this.end, pointerUpOptions);
|
|
185
189
|
|
|
186
190
|
if (this.dragging) {
|
|
187
191
|
setTimeout(on(this.list, 'click', (e) => e.preventDefault(), pointerOptions));
|
|
@@ -194,15 +198,14 @@ export default {
|
|
|
194
198
|
this._show(false, this.index, true);
|
|
195
199
|
this._transitioner = null;
|
|
196
200
|
} else {
|
|
197
|
-
const dirChange =
|
|
198
|
-
(isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 ===
|
|
199
|
-
this.prevPos > this.pos;
|
|
200
|
-
this.index = dirChange ? this.index : this.prevIndex;
|
|
201
|
+
const dirChange = this.dir < 0 === this.prevPos.x > this.pos.x;
|
|
201
202
|
|
|
202
203
|
if (dirChange) {
|
|
203
204
|
trigger(this.slides[this.prevIndex], 'itemhidden', [this]);
|
|
204
205
|
trigger(this.slides[this.index], 'itemshown', [this]);
|
|
205
206
|
this.percent = 1 - this.percent;
|
|
207
|
+
} else {
|
|
208
|
+
this.index = this.prevIndex;
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
this.show(
|
|
@@ -234,3 +237,7 @@ function hasSelectableText(el) {
|
|
|
234
237
|
toArray(el.childNodes).some((el) => el.nodeType === 3 && el.textContent.trim())
|
|
235
238
|
);
|
|
236
239
|
}
|
|
240
|
+
|
|
241
|
+
function getAngle(pos1, pos2) {
|
|
242
|
+
return (Math.atan2(Math.abs(pos2.y - pos1.y), Math.abs(pos2.x - pos1.x)) * 180) / Math.PI;
|
|
243
|
+
}
|
package/src/js/util/attr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isObject, isUndefined, toNode, toNodes } from './lang';
|
|
2
2
|
|
|
3
3
|
export function attr(element, name, value) {
|
|
4
4
|
if (isObject(name)) {
|
|
@@ -12,10 +12,6 @@ export function attr(element, name, value) {
|
|
|
12
12
|
return toNode(element)?.getAttribute(name);
|
|
13
13
|
} else {
|
|
14
14
|
for (const el of toNodes(element)) {
|
|
15
|
-
if (isFunction(value)) {
|
|
16
|
-
value = value.call(el, attr(el, name));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
15
|
if (value === null) {
|
|
20
16
|
removeAttr(el, name);
|
|
21
17
|
} else {
|
package/tests/upload.html
CHANGED
|
@@ -145,13 +145,13 @@
|
|
|
145
145
|
<td><code>allow</code></td>
|
|
146
146
|
<td>String</td>
|
|
147
147
|
<td>false</td>
|
|
148
|
-
<td>File name filter
|
|
148
|
+
<td>File name filter (eg. *.png). Separate multiple values with a pipe (*.png|*.gif).</td>
|
|
149
149
|
</tr>
|
|
150
150
|
<tr>
|
|
151
151
|
<td><code>mime</code></td>
|
|
152
152
|
<td>String</td>
|
|
153
153
|
<td>false</td>
|
|
154
|
-
<td>File MIME type filter
|
|
154
|
+
<td>File MIME type filter (eg. image/*). Separate multiple values with a pipe (image/*|video/*).</td>
|
|
155
155
|
</tr>
|
|
156
156
|
<tr>
|
|
157
157
|
<td><code>maxSize</code></td>
|