uikit 3.20.10-dev.de039bb62 → 3.20.11-dev.3a41e0fa6
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 +15 -3
- package/build/release.js +1 -1
- package/build/scope.js +4 -9
- 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 +2 -7
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +3 -3
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +3 -3
- 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 +6 -6
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +6 -6
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +13 -8
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +6 -6
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +11 -8
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +5 -8
- 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 +115 -111
- 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 +125 -124
- package/dist/js/uikit.min.js +1 -1
- package/package.json +4 -3
- package/src/js/api/observer.js +2 -2
- package/src/js/components/filter.js +1 -8
- package/src/js/components/internal/slider-transitioner.js +6 -0
- package/src/js/components/sortable.js +7 -9
- package/src/js/core/icon.js +2 -1
- package/src/js/core/svg.js +7 -3
- package/src/js/mixin/media.js +1 -1
- package/src/js/mixin/parallax.js +2 -2
- package/src/js/mixin/slider-parallax.js +5 -0
- package/src/js/mixin/slider.js +2 -2
- package/src/js/util/filter.js +3 -3
- package/src/js/util/selector.js +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.20.
|
|
5
|
+
"version": "3.20.11-dev.3a41e0fa6",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"chokidar-cli": "^3.0.0",
|
|
29
29
|
"clean-css": "^5.3.3",
|
|
30
30
|
"dateformat": "^5.0.3",
|
|
31
|
-
"esbuild": "^0.
|
|
31
|
+
"esbuild": "^0.21.2",
|
|
32
32
|
"eslint": "^9.1.1",
|
|
33
33
|
"eslint-config-prettier": "^9.1.0",
|
|
34
|
-
"execa": "^
|
|
34
|
+
"execa": "^9.0.2",
|
|
35
35
|
"fs-extra": "^11.2.0",
|
|
36
36
|
"glob": "^10.3.12",
|
|
37
37
|
"globals": "^15.0.0",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"rollup-plugin-modify": "^3.0.0",
|
|
48
48
|
"rtlcss": "^4.1.1",
|
|
49
49
|
"semver": "^7.6.0",
|
|
50
|
+
"strip-css-comments": "^5.0.0",
|
|
50
51
|
"svgo": "^3.2.0"
|
|
51
52
|
},
|
|
52
53
|
"scripts": {
|
package/src/js/api/observer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasOwn, includes, isArray, isFunction, isString } from 'uikit-util';
|
|
1
|
+
import { hasOwn, includes, isArray, isFunction, isString, toNodes } from 'uikit-util';
|
|
2
2
|
import { registerComputed } from './computed';
|
|
3
3
|
import { registerWatch } from './watch';
|
|
4
4
|
|
|
@@ -28,7 +28,7 @@ function registerObservable(instance, observable) {
|
|
|
28
28
|
|
|
29
29
|
const key = `_observe${instance._observers.length}`;
|
|
30
30
|
if (isFunction(target) && !hasOwn(instance, key)) {
|
|
31
|
-
registerComputed(instance, key, () => target.call(instance, instance));
|
|
31
|
+
registerComputed(instance, key, () => toNodes(target.call(instance, instance)));
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
handler = isString(handler) ? instance[handler] : handler.bind(instance);
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
attr,
|
|
6
6
|
css,
|
|
7
7
|
data,
|
|
8
|
-
each,
|
|
9
8
|
fastdom,
|
|
10
9
|
children as getChildren,
|
|
11
10
|
hasClass,
|
|
@@ -139,7 +138,7 @@ function isEqualState(stateA, stateB) {
|
|
|
139
138
|
}
|
|
140
139
|
|
|
141
140
|
function applyState(state, target, children) {
|
|
142
|
-
const selector =
|
|
141
|
+
const selector = Object.values(state.filter).join('');
|
|
143
142
|
|
|
144
143
|
for (const el of children) {
|
|
145
144
|
css(el, 'display', selector && !matches(el, selector) ? 'none' : '');
|
|
@@ -195,12 +194,6 @@ function matchFilter(
|
|
|
195
194
|
: stateSort === sort && stateOrder === order;
|
|
196
195
|
}
|
|
197
196
|
|
|
198
|
-
function getSelector({ filter }) {
|
|
199
|
-
let selector = '';
|
|
200
|
-
each(filter, (value) => (selector += value || ''));
|
|
201
|
-
return selector;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
197
|
function sortItems(nodes, sort, order) {
|
|
205
198
|
return [...nodes].sort(
|
|
206
199
|
(a, b) =>
|
|
@@ -32,8 +32,14 @@ export default function (prev, next, dir, { center, easing, list }) {
|
|
|
32
32
|
const timing = linear ? 'linear' : easing;
|
|
33
33
|
duration -= Math.round(duration * clamp(percent, -1, 1));
|
|
34
34
|
|
|
35
|
+
// Force previous transition to be canceled in Safari
|
|
36
|
+
css(list, 'transitionProperty', 'none');
|
|
37
|
+
|
|
35
38
|
this.translate(percent);
|
|
36
39
|
|
|
40
|
+
// Reset the forced transition property
|
|
41
|
+
css(list, 'transitionProperty', '');
|
|
42
|
+
|
|
37
43
|
percent = prev ? percent : clamp(percent, 0, 1);
|
|
38
44
|
triggerUpdate(this.getItemIn(), 'itemin', { percent, duration, timing, dir });
|
|
39
45
|
prev &&
|
|
@@ -217,14 +217,14 @@ export default {
|
|
|
217
217
|
move: throttle(function (e) {
|
|
218
218
|
assign(this.pos, getEventPos(e));
|
|
219
219
|
|
|
220
|
-
if (
|
|
221
|
-
this
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
Math.abs(this.pos.y - this.origin.y) > this.threshold
|
|
220
|
+
if (
|
|
221
|
+
!this.drag &&
|
|
222
|
+
(Math.abs(this.pos.x - this.origin.x) > this.threshold ||
|
|
223
|
+
Math.abs(this.pos.y - this.origin.y) > this.threshold)
|
|
225
224
|
) {
|
|
226
225
|
this.start(e);
|
|
227
226
|
}
|
|
227
|
+
this.$emit('move');
|
|
228
228
|
}),
|
|
229
229
|
|
|
230
230
|
end() {
|
|
@@ -437,10 +437,8 @@ function throttle(fn) {
|
|
|
437
437
|
return function (...args) {
|
|
438
438
|
if (!throttled) {
|
|
439
439
|
throttled = true;
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
fn.call(this, ...args);
|
|
443
|
-
});
|
|
440
|
+
fn.call(this, ...args);
|
|
441
|
+
requestAnimationFrame(() => (throttled = false));
|
|
444
442
|
}
|
|
445
443
|
};
|
|
446
444
|
}
|
package/src/js/core/icon.js
CHANGED
|
@@ -35,6 +35,7 @@ import spinner from '../../images/components/spinner.svg';
|
|
|
35
35
|
import totop from '../../images/components/totop.svg';
|
|
36
36
|
import I18n from '../mixin/i18n';
|
|
37
37
|
import Svg from '../mixin/svg';
|
|
38
|
+
import { stringToSvg } from './svg';
|
|
38
39
|
|
|
39
40
|
const icons = {
|
|
40
41
|
spinner,
|
|
@@ -261,7 +262,7 @@ function getIcon(icon) {
|
|
|
261
262
|
}
|
|
262
263
|
|
|
263
264
|
if (!parsed[icon]) {
|
|
264
|
-
parsed[icon] =
|
|
265
|
+
parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);
|
|
265
266
|
}
|
|
266
267
|
|
|
267
268
|
return parsed[icon].cloneNode(true);
|
package/src/js/core/svg.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
$,
|
|
3
2
|
addClass,
|
|
4
3
|
attr,
|
|
5
4
|
css,
|
|
@@ -107,8 +106,7 @@ function parseSVG(svg, icon) {
|
|
|
107
106
|
svg = parseSymbols(svg)[icon] || svg;
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
|
|
111
|
-
return svg?.hasChildNodes() && svg;
|
|
109
|
+
return stringToSvg(svg);
|
|
112
110
|
}
|
|
113
111
|
|
|
114
112
|
const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
|
|
@@ -133,3 +131,9 @@ function applyAnimation(el) {
|
|
|
133
131
|
css(el, '--uk-animation-stroke', length);
|
|
134
132
|
}
|
|
135
133
|
}
|
|
134
|
+
|
|
135
|
+
export function stringToSvg(string) {
|
|
136
|
+
const container = document.createElement('template');
|
|
137
|
+
container.innerHTML = string;
|
|
138
|
+
return container.content.firstElementChild;
|
|
139
|
+
}
|
package/src/js/mixin/media.js
CHANGED
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
function toMedia(value, element) {
|
|
44
44
|
if (isString(value)) {
|
|
45
45
|
if (startsWith(value, '@')) {
|
|
46
|
-
value = toFloat(css(element, `--uk-breakpoint-${value.
|
|
46
|
+
value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));
|
|
47
47
|
} else if (isNaN(value)) {
|
|
48
48
|
return value;
|
|
49
49
|
}
|
package/src/js/mixin/parallax.js
CHANGED
|
@@ -260,14 +260,14 @@ function backgroundCoverFn(prop, el, stops, props) {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
function getBackgroundPos(el, prop) {
|
|
263
|
-
return getCssValue(el, `background-position-${prop.
|
|
263
|
+
return getCssValue(el, `background-position-${prop.slice(-1)}`, '');
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
function setBackgroundPosFn(bgProps, positions, props) {
|
|
267
267
|
return function (css, percent) {
|
|
268
268
|
for (const prop of bgProps) {
|
|
269
269
|
const value = getValue(props[prop], percent);
|
|
270
|
-
css[`background-position-${prop.
|
|
270
|
+
css[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
}
|
|
@@ -40,6 +40,11 @@ export default {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const target = this.parallaxTarget;
|
|
43
|
+
|
|
44
|
+
if (!target) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
const start = toPx(this.parallaxStart, 'height', target, true);
|
|
44
49
|
const end = toPx(this.parallaxEnd, 'height', target, true);
|
|
45
50
|
const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);
|
package/src/js/mixin/slider.js
CHANGED
|
@@ -176,7 +176,7 @@ export default {
|
|
|
176
176
|
return this.getIndex(index, prevIndex);
|
|
177
177
|
},
|
|
178
178
|
|
|
179
|
-
_show(prev, next, force) {
|
|
179
|
+
async _show(prev, next, force) {
|
|
180
180
|
this._transitioner = this._getTransitioner(prev, next, this.dir, {
|
|
181
181
|
easing: force
|
|
182
182
|
? next.offsetWidth < 600
|
|
@@ -188,7 +188,7 @@ export default {
|
|
|
188
188
|
|
|
189
189
|
if (!force && !prev) {
|
|
190
190
|
this._translate(1);
|
|
191
|
-
return
|
|
191
|
+
return;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
const { length } = this.stack;
|
package/src/js/util/filter.js
CHANGED
|
@@ -82,8 +82,8 @@ export function isSameSiteAnchor(el) {
|
|
|
82
82
|
|
|
83
83
|
export function getTargetedElement(el) {
|
|
84
84
|
if (isSameSiteAnchor(el)) {
|
|
85
|
-
|
|
86
|
-
const id = decodeURIComponent(
|
|
87
|
-
return
|
|
85
|
+
const { hash, ownerDocument } = toNode(el);
|
|
86
|
+
const id = decodeURIComponent(hash).slice(1);
|
|
87
|
+
return ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0];
|
|
88
88
|
}
|
|
89
89
|
}
|
package/src/js/util/selector.js
CHANGED
|
@@ -47,9 +47,9 @@ const parseSelector = memoize((selector) => {
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
const parsePositionSelector = memoize((selector) => {
|
|
50
|
-
selector = selector.
|
|
50
|
+
selector = selector.slice(1).trim();
|
|
51
51
|
const index = selector.indexOf(' ');
|
|
52
|
-
return ~index ? [selector.
|
|
52
|
+
return ~index ? [selector.slice(0, index), selector.slice(index + 1)] : [selector, ''];
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
function _query(selector, context = document, queryFn) {
|