uikit 3.19.4 → 3.19.5-dev.8210c3e08
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 +10 -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 +7 -8
- 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 +58 -44
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +58 -44
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +59 -45
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +58 -44
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +58 -44
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +3 -3
- 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 +95 -60
- 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 +99 -65
- package/dist/js/uikit.min.js +1 -1
- package/eslint.config.js +8 -5
- package/package.json +3 -4
- package/src/js/api/observer.js +17 -5
- package/src/js/components/filter.js +4 -5
- package/src/js/core/drop.js +0 -6
- package/src/js/core/inverse.js +11 -1
- package/src/js/core/margin.js +1 -1
- package/src/js/core/switcher.js +6 -1
- package/src/js/core/toggle.js +1 -1
- package/src/js/util/selector.js +61 -37
- package/src/js/util/svg.js +1 -12
- package/tests/modal.html +2 -2
- package/build/package.json +0 -4
package/eslint.config.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import eslintJs from '@eslint/js';
|
|
2
|
+
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
3
|
+
import globals from 'globals';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
export default [
|
|
6
6
|
eslintJs.configs.recommended,
|
|
7
7
|
eslintConfigPrettier,
|
|
8
|
+
{
|
|
9
|
+
ignores: ['*', '!src/', '!src/*', '!src/js', '!build/', 'build/*', '!build/*.js'],
|
|
10
|
+
},
|
|
8
11
|
{
|
|
9
12
|
rules: {
|
|
10
13
|
'no-unused-vars': ['error', { caughtErrors: 'none' }],
|
|
11
14
|
},
|
|
12
15
|
languageOptions: {
|
|
13
|
-
ecmaVersion:
|
|
16
|
+
ecmaVersion: 'latest',
|
|
14
17
|
sourceType: 'module',
|
|
15
18
|
globals: {
|
|
16
19
|
...globals.browser,
|
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.19.
|
|
5
|
+
"version": "3.19.5-dev.8210c3e08",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"./src/js/*.js",
|
|
11
11
|
"./dist/**/*.js"
|
|
12
12
|
],
|
|
13
|
+
"type": "module",
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
15
16
|
"url": "git+https://github.com/uikit/uikit.git"
|
|
@@ -60,8 +61,6 @@
|
|
|
60
61
|
"prefix": "node build/prefix",
|
|
61
62
|
"scope": "node build/scope",
|
|
62
63
|
"release": "node build/release",
|
|
63
|
-
"watch": "chokidar \"**/*.less\" --initial -i \"node_modules\" -c \"node build/less\""
|
|
64
|
-
"eslint": "eslint src/js build/*.js",
|
|
65
|
-
"eslint-fix": "eslint --fix src/js build/*.js"
|
|
64
|
+
"watch": "chokidar \"**/*.less\" --initial -i \"node_modules\" -c \"node build/less\""
|
|
66
65
|
}
|
|
67
66
|
}
|
package/src/js/api/observer.js
CHANGED
|
@@ -46,21 +46,33 @@ function registerObservable(instance, observable) {
|
|
|
46
46
|
const targets = hasOwn(instance, key) ? instance[key] : target;
|
|
47
47
|
const observer = observe(targets, handler, options, args);
|
|
48
48
|
|
|
49
|
-
if (isFunction(target) && isArray(instance[key])
|
|
50
|
-
registerWatch(
|
|
49
|
+
if (isFunction(target) && isArray(instance[key])) {
|
|
50
|
+
registerWatch(
|
|
51
|
+
instance,
|
|
52
|
+
{ handler: updateTargets(observer, options), immediate: false },
|
|
53
|
+
key,
|
|
54
|
+
);
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
registerObserver(instance, observer);
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
function updateTargets(observer) {
|
|
60
|
+
function updateTargets(observer, options) {
|
|
57
61
|
return (targets, prev) => {
|
|
58
62
|
for (const target of prev) {
|
|
59
|
-
!includes(targets, target)
|
|
63
|
+
if (!includes(targets, target)) {
|
|
64
|
+
if (observer.unobserve) {
|
|
65
|
+
observer.unobserve(target);
|
|
66
|
+
} else {
|
|
67
|
+
observer.disconnect();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
for (const target of targets) {
|
|
63
|
-
!includes(prev, target)
|
|
73
|
+
if (!includes(prev, target) || !observer.unobserve) {
|
|
74
|
+
observer.observe(target, options);
|
|
75
|
+
}
|
|
64
76
|
}
|
|
65
77
|
};
|
|
66
78
|
}
|
|
@@ -118,10 +118,7 @@ export default {
|
|
|
118
118
|
|
|
119
119
|
await Promise.all(
|
|
120
120
|
$$(this.target, this.$el).map((target) => {
|
|
121
|
-
const filterFn = () =>
|
|
122
|
-
applyState(state, target, getChildren(target));
|
|
123
|
-
this.$update(this.$el);
|
|
124
|
-
};
|
|
121
|
+
const filterFn = () => applyState(state, target, getChildren(target));
|
|
125
122
|
return animate ? this.animate(filterFn, target) : filterFn();
|
|
126
123
|
}),
|
|
127
124
|
);
|
|
@@ -146,7 +143,9 @@ function isEqualState(stateA, stateB) {
|
|
|
146
143
|
function applyState(state, target, children) {
|
|
147
144
|
const selector = getSelector(state);
|
|
148
145
|
|
|
149
|
-
|
|
146
|
+
for (const el of children) {
|
|
147
|
+
css(el, 'display', selector && !matches(el, selector) ? 'none' : '');
|
|
148
|
+
}
|
|
150
149
|
|
|
151
150
|
const [sort, order] = state.sort;
|
|
152
151
|
|
package/src/js/core/drop.js
CHANGED
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
removeClass,
|
|
30
30
|
within,
|
|
31
31
|
} from 'uikit-util';
|
|
32
|
-
import { lazyload } from '../api/observables';
|
|
33
32
|
import Container from '../mixin/container';
|
|
34
33
|
import Position from '../mixin/position';
|
|
35
34
|
import Togglable from '../mixin/togglable';
|
|
@@ -129,11 +128,6 @@ export default {
|
|
|
129
128
|
css(this.$el, this._style);
|
|
130
129
|
},
|
|
131
130
|
|
|
132
|
-
observe: lazyload({
|
|
133
|
-
target: ({ toggle, $el }) => query(toggle, $el),
|
|
134
|
-
targets: ({ $el }) => $el,
|
|
135
|
-
}),
|
|
136
|
-
|
|
137
131
|
events: [
|
|
138
132
|
{
|
|
139
133
|
name: 'click',
|
package/src/js/core/inverse.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $$, css, dimensions, matches, observeResize, on, replaceClass } from 'uikit-util';
|
|
2
|
-
import { mutation } from '../api/observables';
|
|
2
|
+
import { intersection, mutation } from '../api/observables';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
props: {
|
|
@@ -17,6 +17,12 @@ export default {
|
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
observe: [
|
|
20
|
+
intersection({
|
|
21
|
+
handler([{ isIntersecting }]) {
|
|
22
|
+
this.isIntersecting = isIntersecting;
|
|
23
|
+
},
|
|
24
|
+
args: { intersecting: false },
|
|
25
|
+
}),
|
|
20
26
|
mutation({
|
|
21
27
|
target: ({ target }) => target,
|
|
22
28
|
options: { attributes: true, attributeFilter: ['class'], attributeOldValue: true },
|
|
@@ -55,6 +61,10 @@ export default {
|
|
|
55
61
|
|
|
56
62
|
update: {
|
|
57
63
|
read() {
|
|
64
|
+
if (!this.isIntersecting) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
|
|
58
68
|
for (const target of this.target) {
|
|
59
69
|
replaceClass(
|
|
60
70
|
target,
|
package/src/js/core/margin.js
CHANGED
|
@@ -15,10 +15,10 @@ export default {
|
|
|
15
15
|
observe: [
|
|
16
16
|
mutation({
|
|
17
17
|
options: {
|
|
18
|
-
childList: true,
|
|
19
18
|
attributes: true,
|
|
20
19
|
attributeFilter: ['style'],
|
|
21
20
|
},
|
|
21
|
+
target: ({ $el }) => [$el, ...children($el)],
|
|
22
22
|
}),
|
|
23
23
|
resize({
|
|
24
24
|
target: ({ $el }) => [$el, ...children($el)],
|
package/src/js/core/switcher.js
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
hasClass,
|
|
11
11
|
includes,
|
|
12
12
|
isNode,
|
|
13
|
+
isTag,
|
|
13
14
|
matches,
|
|
14
15
|
queryAll,
|
|
15
16
|
toArray,
|
|
@@ -188,7 +189,11 @@ export default {
|
|
|
188
189
|
],
|
|
189
190
|
|
|
190
191
|
update() {
|
|
191
|
-
|
|
192
|
+
for (const el of this.connects) {
|
|
193
|
+
if (isTag(el, 'ul')) {
|
|
194
|
+
attr(el, 'role', 'presentation');
|
|
195
|
+
}
|
|
196
|
+
}
|
|
192
197
|
attr(children(this.$el), 'role', 'presentation');
|
|
193
198
|
|
|
194
199
|
for (const index in this.toggles) {
|
package/src/js/core/toggle.js
CHANGED
package/src/js/util/selector.js
CHANGED
|
@@ -18,57 +18,87 @@ export function findAll(selector, context) {
|
|
|
18
18
|
return toNodes(_query(selector, toNode(context), 'querySelectorAll'));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
|
|
22
|
-
const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
|
|
23
|
-
|
|
24
21
|
function getContext(selector, context = document) {
|
|
25
|
-
return (isString(selector) &&
|
|
22
|
+
return (isString(selector) && parseSelector(selector).isContextSelector) || isDocument(context)
|
|
26
23
|
? context
|
|
27
24
|
: context.ownerDocument;
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
const
|
|
31
|
-
const
|
|
27
|
+
const addStarRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
|
|
28
|
+
const splitSelectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
|
|
29
|
+
const trailingCommaRe = /\s*,$/;
|
|
30
|
+
|
|
31
|
+
const parseSelector = memoize((selector) => {
|
|
32
|
+
selector = selector.replace(addStarRe, '$1 *');
|
|
33
|
+
let isContextSelector = false;
|
|
34
|
+
|
|
35
|
+
const selectors = [];
|
|
36
|
+
for (let sel of selector.match(splitSelectorRe)) {
|
|
37
|
+
sel = sel.replace(trailingCommaRe, '').trim();
|
|
38
|
+
if (sel[0] === '>') {
|
|
39
|
+
sel = `:scope ${sel}`;
|
|
40
|
+
}
|
|
41
|
+
isContextSelector ||= ['!', '+', '~', '-'].includes(sel[0]);
|
|
42
|
+
selectors.push(sel);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
selector: selectors.join(','),
|
|
47
|
+
selectors,
|
|
48
|
+
isContextSelector,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
32
51
|
|
|
33
52
|
function _query(selector, context = document, queryFn) {
|
|
34
53
|
if (!selector || !isString(selector)) {
|
|
35
54
|
return selector;
|
|
36
55
|
}
|
|
37
56
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (isContextSelector
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
for (let sel of split) {
|
|
44
|
-
let ctx = context;
|
|
45
|
-
|
|
46
|
-
if (sel[0] === '!') {
|
|
47
|
-
const selectors = sel.substr(1).trim().split(' ');
|
|
48
|
-
ctx = parent(context).closest(selectors[0]);
|
|
49
|
-
sel = selectors.slice(1).join(' ').trim();
|
|
50
|
-
if (!sel.length && split.length === 1) {
|
|
51
|
-
return ctx;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
57
|
+
const parsed = parseSelector(selector);
|
|
58
|
+
|
|
59
|
+
if (!parsed.isContextSelector) {
|
|
60
|
+
return _doQuery(context, queryFn, parsed.selector);
|
|
61
|
+
}
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
selector = '';
|
|
64
|
+
const isSingle = parsed.selectors.length === 1;
|
|
65
|
+
for (let sel of parsed.selectors) {
|
|
66
|
+
let ctx = context;
|
|
67
|
+
|
|
68
|
+
if (sel[0] === '!') {
|
|
69
|
+
const selectors = sel.substr(1).trim().split(' ');
|
|
70
|
+
ctx = parent(context).closest(selectors[0]);
|
|
71
|
+
sel = selectors.slice(1).join(' ').trim();
|
|
72
|
+
if (!sel.length && isSingle) {
|
|
73
|
+
return ctx;
|
|
60
74
|
}
|
|
75
|
+
}
|
|
61
76
|
|
|
62
|
-
|
|
63
|
-
|
|
77
|
+
if (sel[0] === '-') {
|
|
78
|
+
const selectors = sel.substr(1).trim().split(' ');
|
|
79
|
+
const prev = (ctx || context).previousElementSibling;
|
|
80
|
+
ctx = matches(prev, sel.substr(1)) ? prev : null;
|
|
81
|
+
sel = selectors.slice(1).join(' ');
|
|
82
|
+
if (!sel.length && isSingle) {
|
|
83
|
+
return ctx;
|
|
64
84
|
}
|
|
85
|
+
} else if (sel[0] === '~' || (sel[0] === '+' && isSingle)) {
|
|
86
|
+
return _doQuery(parent(ctx), queryFn, `:scope :nth-child(${index(ctx) + 1}) ${sel}`);
|
|
65
87
|
}
|
|
66
88
|
|
|
67
|
-
if (
|
|
68
|
-
|
|
89
|
+
if (ctx) {
|
|
90
|
+
selector += `${selector ? ',' : ''}${domPath(ctx)} ${sel}`;
|
|
69
91
|
}
|
|
70
92
|
}
|
|
71
93
|
|
|
94
|
+
if (!isDocument(context)) {
|
|
95
|
+
context = context.ownerDocument;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return _doQuery(context, queryFn, selector);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function _doQuery(context, queryFn, selector) {
|
|
72
102
|
try {
|
|
73
103
|
return context[queryFn](selector);
|
|
74
104
|
} catch (e) {
|
|
@@ -76,12 +106,6 @@ function _query(selector, context = document, queryFn) {
|
|
|
76
106
|
}
|
|
77
107
|
}
|
|
78
108
|
|
|
79
|
-
const selectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
|
|
80
|
-
|
|
81
|
-
const splitSelector = memoize((selector) =>
|
|
82
|
-
selector.match(selectorRe).map((selector) => selector.replace(/,$/, '').trim()),
|
|
83
|
-
);
|
|
84
|
-
|
|
85
109
|
function domPath(element) {
|
|
86
110
|
const names = [];
|
|
87
111
|
while (element.parentNode) {
|
package/src/js/util/svg.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import { $$ } from './dom';
|
|
2
2
|
|
|
3
3
|
export function getMaxPathLength(el) {
|
|
4
|
-
return Math.ceil(
|
|
5
|
-
Math.max(
|
|
6
|
-
0,
|
|
7
|
-
...$$('[stroke]', el).map((stroke) => {
|
|
8
|
-
try {
|
|
9
|
-
return stroke.getTotalLength();
|
|
10
|
-
} catch (e) {
|
|
11
|
-
return 0;
|
|
12
|
-
}
|
|
13
|
-
}),
|
|
14
|
-
),
|
|
15
|
-
);
|
|
4
|
+
return Math.ceil(Math.max(0, ...$$('[stroke]', el).map((stroke) => stroke.getTotalLength?.())));
|
|
16
5
|
}
|
package/tests/modal.html
CHANGED
|
@@ -382,14 +382,14 @@
|
|
|
382
382
|
<div id="modal-media-youtube" uk-modal>
|
|
383
383
|
<div class="uk-modal-dialog uk-width-auto uk-margin-auto-vertical">
|
|
384
384
|
<button class="uk-modal-close-outside" type="button" uk-close></button>
|
|
385
|
-
<iframe src="https://www.youtube-nocookie.com/embed/c2pz2mlSfXA" width="1920" height="1080" uk-responsive uk-video></iframe>
|
|
385
|
+
<iframe src="https://www.youtube-nocookie.com/embed/c2pz2mlSfXA" width="1920" height="1080" loading="lazy" uk-responsive uk-video></iframe>
|
|
386
386
|
</div>
|
|
387
387
|
</div>
|
|
388
388
|
|
|
389
389
|
<div id="modal-media-vimeo" uk-modal>
|
|
390
390
|
<div class="uk-modal-dialog uk-width-auto uk-margin-auto-vertical">
|
|
391
391
|
<button class="uk-modal-close-outside" type="button" uk-close></button>
|
|
392
|
-
<iframe src="https://player.vimeo.com/video/1084537" width="500" height="281" uk-responsive uk-video></iframe>
|
|
392
|
+
<iframe src="https://player.vimeo.com/video/1084537" width="500" height="281" loading="lazy" uk-responsive uk-video></iframe>
|
|
393
393
|
</div>
|
|
394
394
|
</div>
|
|
395
395
|
|
package/build/package.json
DELETED