uikit 3.16.9 → 3.16.11-dev.23226dadb
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 +13 -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 +24 -28
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +85 -562
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +96 -574
- 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 +79 -72
- 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 +79 -72
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +14 -18
- 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 +256 -280
- 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 +381 -407
- package/dist/js/uikit.min.js +1 -1
- package/package.json +4 -4
- package/src/js/api/boot.js +1 -1
- package/src/js/api/computed.js +7 -1
- package/src/js/api/hooks.js +7 -4
- package/src/js/api/observer.js +43 -43
- package/src/js/api/options.js +1 -0
- package/src/js/api/update.js +15 -36
- package/src/js/api/watch.js +33 -20
- package/src/js/components/filter.js +23 -29
- package/src/js/components/lightbox.js +12 -14
- package/src/js/components/sortable.js +13 -19
- package/src/js/core/accordion.js +32 -45
- package/src/js/core/drop.js +1 -1
- package/src/js/core/dropnav.js +37 -43
- package/src/js/core/height-match.js +2 -8
- package/src/js/core/navbar.js +3 -12
- package/src/js/core/scrollspy-nav.js +10 -12
- package/src/js/core/scrollspy.js +10 -12
- package/src/js/core/switcher.js +30 -37
- package/src/js/{util → mixin/internal}/scroll.js +1 -5
- package/src/js/mixin/modal.js +1 -1
- package/src/js/mixin/slider-nav.js +80 -76
- package/src/js/mixin/slider.js +10 -8
- package/src/js/util/fastdom.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.16.
|
|
5
|
+
"version": "3.16.11-dev.23226dadb",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"eslint-config-prettier": "^8.7.0",
|
|
33
33
|
"fs-extra": "^11.1.0",
|
|
34
34
|
"glob": "^9.3.0",
|
|
35
|
-
"inquirer": "^9.1.
|
|
35
|
+
"inquirer": "^9.1.5",
|
|
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.5",
|
|
41
|
+
"rollup": "^3.20.0",
|
|
42
42
|
"rollup-plugin-esbuild": "^5.0.0",
|
|
43
43
|
"rollup-plugin-html": "^0.2.1",
|
|
44
44
|
"rollup-plugin-modify": "^3.0.0",
|
package/src/js/api/boot.js
CHANGED
|
@@ -4,7 +4,7 @@ import { apply, hasAttr, inBrowser, isPlainObject, startsWith, trigger } from 'u
|
|
|
4
4
|
|
|
5
5
|
export default function (App) {
|
|
6
6
|
if (inBrowser && window.MutationObserver) {
|
|
7
|
-
if (document.
|
|
7
|
+
if (document.body) {
|
|
8
8
|
requestAnimationFrame(() => init(App));
|
|
9
9
|
} else {
|
|
10
10
|
new MutationObserver((records, observer) => {
|
package/src/js/api/computed.js
CHANGED
|
@@ -12,7 +12,13 @@ export function initComputed(instance) {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function
|
|
15
|
+
export function resetComputed(instance) {
|
|
16
|
+
const values = { ...instance._computed };
|
|
17
|
+
instance._computed = {};
|
|
18
|
+
return values;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function registerComputed(instance, key, cb) {
|
|
16
22
|
Object.defineProperty(instance, key, {
|
|
17
23
|
enumerable: true,
|
|
18
24
|
|
package/src/js/api/hooks.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { log } from './log';
|
|
2
|
-
import {
|
|
2
|
+
import { initWatches } from './watch';
|
|
3
|
+
import { callUpdate, initUpdates } from './update';
|
|
3
4
|
import { initEvents, unbindEvents } from './events';
|
|
4
5
|
import { initProps, initPropsObserver } from './props';
|
|
5
|
-
import { disconnectObservers, initObservers } from './observer';
|
|
6
|
+
import { disconnectObservers, initObservers, initWatchObserver } from './observer';
|
|
6
7
|
|
|
7
8
|
export function callHook(instance, hook) {
|
|
8
9
|
LOG && log(instance, hook);
|
|
@@ -23,10 +24,12 @@ export function callConnected(instance) {
|
|
|
23
24
|
instance._connected = true;
|
|
24
25
|
|
|
25
26
|
initEvents(instance);
|
|
26
|
-
|
|
27
|
+
initUpdates(instance);
|
|
28
|
+
initWatches(instance);
|
|
27
29
|
initObservers(instance);
|
|
30
|
+
|
|
28
31
|
initPropsObserver(instance);
|
|
29
|
-
|
|
32
|
+
initWatchObserver(instance);
|
|
30
33
|
|
|
31
34
|
callHook(instance, 'connected');
|
|
32
35
|
callUpdate(instance);
|
package/src/js/api/observer.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
isArray,
|
|
5
|
-
isEqual,
|
|
6
|
-
isFunction,
|
|
7
|
-
isPlainObject,
|
|
8
|
-
isString,
|
|
9
|
-
} from 'uikit-util';
|
|
1
|
+
import { registerComputed } from './computed';
|
|
2
|
+
import { callWatches, registerWatch } from './watch';
|
|
3
|
+
import { hasOwn, includes, isArray, isFunction, isString } from 'uikit-util';
|
|
10
4
|
|
|
11
5
|
export function initObservers(instance) {
|
|
12
6
|
instance._observers = [];
|
|
13
|
-
instance._observerUpdates = new Map();
|
|
14
7
|
for (const observer of instance.$options.observe || []) {
|
|
15
8
|
if (hasOwn(observer, 'handler')) {
|
|
16
9
|
registerObservable(instance, observer);
|
|
17
10
|
} else {
|
|
18
|
-
for (const
|
|
19
|
-
registerObservable(instance,
|
|
11
|
+
for (const observable of observer) {
|
|
12
|
+
registerObservable(instance, observable);
|
|
20
13
|
}
|
|
21
14
|
}
|
|
22
15
|
}
|
|
@@ -28,57 +21,64 @@ export function registerObserver(instance, ...observer) {
|
|
|
28
21
|
|
|
29
22
|
export function disconnectObservers(instance) {
|
|
30
23
|
for (const observer of instance._observers) {
|
|
31
|
-
observer
|
|
32
|
-
instance._observerUpdates.delete(observer);
|
|
24
|
+
observer.disconnect();
|
|
33
25
|
}
|
|
34
26
|
}
|
|
35
27
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
update(observer);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function registerObservable(instance, observable, key) {
|
|
43
|
-
let {
|
|
44
|
-
observe,
|
|
45
|
-
target = instance.$el,
|
|
46
|
-
handler,
|
|
47
|
-
options,
|
|
48
|
-
filter,
|
|
49
|
-
args,
|
|
50
|
-
} = isPlainObject(observable) ? observable : { type: key, handler: observable };
|
|
28
|
+
function registerObservable(instance, observable) {
|
|
29
|
+
let { observe, target = instance.$el, handler, options, filter, args } = observable;
|
|
51
30
|
|
|
52
31
|
if (filter && !filter.call(instance, instance)) {
|
|
53
32
|
return;
|
|
54
33
|
}
|
|
55
34
|
|
|
56
|
-
const
|
|
35
|
+
const key = `_observe${instance._observers.length}`;
|
|
36
|
+
if (isFunction(target) && !(key in instance)) {
|
|
37
|
+
registerComputed(instance, key, () => target.call(instance, instance));
|
|
38
|
+
}
|
|
39
|
+
|
|
57
40
|
handler = isString(handler) ? instance[handler] : handler.bind(instance);
|
|
58
41
|
|
|
59
42
|
if (isFunction(options)) {
|
|
60
43
|
options = options.call(instance, instance);
|
|
61
44
|
}
|
|
62
45
|
|
|
63
|
-
const observer = observe(
|
|
46
|
+
const observer = observe(key in instance ? instance[key] : target, handler, options, args);
|
|
47
|
+
|
|
48
|
+
if (isFunction(target) && isArray(instance[key]) && observer.unobserve) {
|
|
49
|
+
registerWatch(
|
|
50
|
+
instance,
|
|
51
|
+
{
|
|
52
|
+
handler(targets, prev) {
|
|
53
|
+
for (const target of prev) {
|
|
54
|
+
!includes(targets, target) && observer.unobserve(target);
|
|
55
|
+
}
|
|
64
56
|
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
for (const target of targets) {
|
|
58
|
+
!includes(prev, target) && observer.observe(target);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
immediate: false,
|
|
62
|
+
},
|
|
63
|
+
key
|
|
64
|
+
);
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
registerObserver(instance, observer);
|
|
70
68
|
}
|
|
71
69
|
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
const newTargets = targetFn.call(instance, instance);
|
|
70
|
+
export function initWatchObserver(instance) {
|
|
71
|
+
let { el, computed } = instance.$options;
|
|
75
72
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
if (!computed && !instance._watches) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
const observer = new MutationObserver(() => callWatches(instance));
|
|
78
|
+
observer.observe(instance._observeTarget || el, {
|
|
79
|
+
childList: true,
|
|
80
|
+
subtree: true,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
registerObserver(instance, observer);
|
|
84
84
|
}
|
package/src/js/api/options.js
CHANGED
package/src/js/api/update.js
CHANGED
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { assign, fastdom, isPlainObject } from 'uikit-util';
|
|
2
|
+
|
|
3
|
+
export function initUpdates(instance) {
|
|
4
|
+
instance._updates = [...(instance.$options.update || [])];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function prependUpdate(instance, update) {
|
|
8
|
+
instance._updates.unshift(update);
|
|
9
|
+
}
|
|
4
10
|
|
|
5
11
|
export function callUpdate(instance, e = 'update') {
|
|
6
12
|
if (!instance._connected) {
|
|
7
13
|
return;
|
|
8
14
|
}
|
|
9
15
|
|
|
10
|
-
if (e === 'update' || e === 'resize') {
|
|
11
|
-
callWatches(instance);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
16
|
if (!instance.$options.update) {
|
|
15
17
|
return;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
if (!instance.
|
|
19
|
-
instance.
|
|
20
|
+
if (!instance._queued) {
|
|
21
|
+
instance._queued = new Set();
|
|
20
22
|
fastdom.read(() => {
|
|
21
23
|
if (instance._connected) {
|
|
22
|
-
runUpdates(instance, instance.
|
|
24
|
+
runUpdates(instance, instance._queued);
|
|
23
25
|
}
|
|
24
|
-
delete instance.
|
|
26
|
+
delete instance._queued;
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
instance.
|
|
30
|
+
instance._queued.add(e.type || e);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
function runUpdates(instance, types) {
|
|
32
|
-
for (const { read, write, events = [] } of instance
|
|
34
|
+
for (const { read, write, events = [] } of instance._updates) {
|
|
33
35
|
if (!types.has('update') && !events.some((type) => types.has(type))) {
|
|
34
36
|
continue;
|
|
35
37
|
}
|
|
@@ -52,26 +54,3 @@ function runUpdates(instance, types) {
|
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
export function initUpdateObserver(instance) {
|
|
57
|
-
let { el, computed, observe } = instance.$options;
|
|
58
|
-
|
|
59
|
-
if (!computed && !observe?.some((options) => isFunction(options.target))) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
for (const key in computed || {}) {
|
|
64
|
-
if (computed[key].document) {
|
|
65
|
-
el = el.ownerDocument;
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const observer = new MutationObserver(() => callWatches(instance));
|
|
71
|
-
observer.observe(el, {
|
|
72
|
-
childList: true,
|
|
73
|
-
subtree: true,
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
registerObserver(instance, observer);
|
|
77
|
-
}
|
package/src/js/api/watch.js
CHANGED
|
@@ -1,34 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { resetComputed } from './computed';
|
|
2
|
+
import { prependUpdate } from './update';
|
|
3
|
+
import { hasOwn, isEqual, isPlainObject } from 'uikit-util';
|
|
4
|
+
|
|
5
|
+
export function initWatches(instance) {
|
|
6
|
+
instance._watches = [];
|
|
7
|
+
for (const watches of instance.$options.watch || []) {
|
|
8
|
+
for (const [name, watch] of Object.entries(watches)) {
|
|
9
|
+
registerWatch(instance, watch, name);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
instance._initial = true;
|
|
13
|
+
prependUpdate(instance, { read: () => callWatches(instance), events: ['resize'] });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function registerWatch(instance, watch, name) {
|
|
17
|
+
instance._watches.push({
|
|
18
|
+
name,
|
|
19
|
+
...(isPlainObject(watch) ? watch : { handler: watch }),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (watch.document) {
|
|
23
|
+
instance._observeTarget = instance.$options.el.ownerDocumentocument;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
3
26
|
|
|
4
27
|
export function callWatches(instance) {
|
|
5
|
-
if (instance.
|
|
28
|
+
if (!instance._connected) {
|
|
6
29
|
return;
|
|
7
30
|
}
|
|
8
31
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
instance._watch = fastdom.read(() => {
|
|
12
|
-
if (instance._connected) {
|
|
13
|
-
runWatches(instance, initial);
|
|
14
|
-
}
|
|
15
|
-
instance._watch = null;
|
|
16
|
-
}, true);
|
|
32
|
+
runWatches(instance, instance._initial);
|
|
33
|
+
instance._initial = false;
|
|
17
34
|
}
|
|
18
35
|
|
|
19
36
|
function runWatches(instance, initial) {
|
|
20
|
-
const values =
|
|
21
|
-
instance._computed = {};
|
|
37
|
+
const values = resetComputed(instance);
|
|
22
38
|
|
|
23
|
-
for (const
|
|
39
|
+
for (const { name, handler, immediate = true } of instance._watches) {
|
|
24
40
|
if (
|
|
25
|
-
|
|
26
|
-
((
|
|
27
|
-
(hasOwn(values, key) && !isEqual(values[key], instance[key])))
|
|
41
|
+
(initial && immediate) ||
|
|
42
|
+
(hasOwn(values, name) && !isEqual(values[name], instance[name]))
|
|
28
43
|
) {
|
|
29
|
-
|
|
44
|
+
handler.call(instance, instance[name], initial ? undefined : values[name]);
|
|
30
45
|
}
|
|
31
46
|
}
|
|
32
|
-
|
|
33
|
-
callObserverUpdates(instance);
|
|
34
47
|
}
|
|
@@ -42,41 +42,35 @@ export default {
|
|
|
42
42
|
},
|
|
43
43
|
|
|
44
44
|
computed: {
|
|
45
|
-
toggles
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
watch(toggles) {
|
|
51
|
-
this.updateState();
|
|
52
|
-
|
|
53
|
-
const actives = $$(this.selActive, this.$el);
|
|
54
|
-
for (const toggle of toggles) {
|
|
55
|
-
if (this.selActive !== false) {
|
|
56
|
-
toggleClass(toggle, this.cls, includes(actives, toggle));
|
|
57
|
-
}
|
|
58
|
-
const button = findButton(toggle);
|
|
59
|
-
if (isTag(button, 'a')) {
|
|
60
|
-
attr(button, 'role', 'button');
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
45
|
+
toggles({ attrItem }, $el) {
|
|
46
|
+
return $$(`[${attrItem}],[data-${attrItem}]`, $el);
|
|
47
|
+
},
|
|
64
48
|
|
|
65
|
-
|
|
49
|
+
children({ target }, $el) {
|
|
50
|
+
return $$(`${target} > *`, $el);
|
|
66
51
|
},
|
|
52
|
+
},
|
|
67
53
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
54
|
+
watch: {
|
|
55
|
+
toggles(toggles) {
|
|
56
|
+
this.updateState();
|
|
72
57
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
const actives = $$(this.selActive, this.$el);
|
|
59
|
+
for (const toggle of toggles) {
|
|
60
|
+
if (this.selActive !== false) {
|
|
61
|
+
toggleClass(toggle, this.cls, includes(actives, toggle));
|
|
76
62
|
}
|
|
77
|
-
|
|
63
|
+
const button = findButton(toggle);
|
|
64
|
+
if (isTag(button, 'a')) {
|
|
65
|
+
attr(button, 'role', 'button');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
78
69
|
|
|
79
|
-
|
|
70
|
+
children(list, prev) {
|
|
71
|
+
if (prev) {
|
|
72
|
+
this.updateState();
|
|
73
|
+
}
|
|
80
74
|
},
|
|
81
75
|
},
|
|
82
76
|
|
|
@@ -10,21 +10,19 @@ export default {
|
|
|
10
10
|
data: { toggle: 'a' },
|
|
11
11
|
|
|
12
12
|
computed: {
|
|
13
|
-
toggles
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
watch(toggles) {
|
|
19
|
-
this.hide();
|
|
20
|
-
for (const toggle of toggles) {
|
|
21
|
-
if (isTag(toggle, 'a')) {
|
|
22
|
-
attr(toggle, 'role', 'button');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
13
|
+
toggles({ toggle }, $el) {
|
|
14
|
+
return $$(toggle, $el);
|
|
15
|
+
},
|
|
16
|
+
},
|
|
26
17
|
|
|
27
|
-
|
|
18
|
+
watch: {
|
|
19
|
+
toggles(toggles) {
|
|
20
|
+
this.hide();
|
|
21
|
+
for (const toggle of toggles) {
|
|
22
|
+
if (isTag(toggle, 'a')) {
|
|
23
|
+
attr(toggle, 'role', 'button');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
28
26
|
},
|
|
29
27
|
},
|
|
30
28
|
|
|
@@ -92,29 +92,23 @@ export default {
|
|
|
92
92
|
return children(this.target);
|
|
93
93
|
},
|
|
94
94
|
|
|
95
|
-
isEmpty
|
|
96
|
-
|
|
97
|
-
return isEmpty(this.items);
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
watch(empty) {
|
|
101
|
-
toggleClass(this.target, this.clsEmpty, empty);
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
immediate: true,
|
|
95
|
+
isEmpty() {
|
|
96
|
+
return isEmpty(this.items);
|
|
105
97
|
},
|
|
106
98
|
|
|
107
|
-
handles
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
handles({ handle }, el) {
|
|
100
|
+
return handle ? $$(handle, el) : this.items;
|
|
101
|
+
},
|
|
102
|
+
},
|
|
111
103
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
104
|
+
watch: {
|
|
105
|
+
isEmpty(empty) {
|
|
106
|
+
toggleClass(this.target, this.clsEmpty, empty);
|
|
107
|
+
},
|
|
116
108
|
|
|
117
|
-
|
|
109
|
+
handles(handles, prev) {
|
|
110
|
+
css(prev, { touchAction: '', userSelect: '' });
|
|
111
|
+
css(handles, { touchAction: hasTouch ? 'none' : '', userSelect: 'none' }); // touchAction set to 'none' causes a performance drop in Chrome 80
|
|
118
112
|
},
|
|
119
113
|
},
|
|
120
114
|
|
package/src/js/core/accordion.js
CHANGED
|
@@ -53,61 +53,48 @@ export default {
|
|
|
53
53
|
},
|
|
54
54
|
|
|
55
55
|
computed: {
|
|
56
|
-
items
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
watch(items, prev) {
|
|
62
|
-
if (prev || hasClass(items, this.clsOpen)) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const active =
|
|
67
|
-
(this.active !== false && items[Number(this.active)]) ||
|
|
68
|
-
(!this.collapsible && items[0]);
|
|
56
|
+
items({ targets }, $el) {
|
|
57
|
+
return $$(targets, $el);
|
|
58
|
+
},
|
|
69
59
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
60
|
+
toggles({ toggle }) {
|
|
61
|
+
return this.items.map((item) => $(toggle, item));
|
|
62
|
+
},
|
|
74
63
|
|
|
75
|
-
|
|
64
|
+
contents({ content }) {
|
|
65
|
+
return this.items.map((item) => item._wrapper?.firstElementChild || $(content, item));
|
|
76
66
|
},
|
|
67
|
+
},
|
|
77
68
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
69
|
+
watch: {
|
|
70
|
+
items(items, prev) {
|
|
71
|
+
if (prev || hasClass(items, this.clsOpen)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
82
74
|
|
|
83
|
-
|
|
84
|
-
this
|
|
85
|
-
|
|
75
|
+
const active =
|
|
76
|
+
(this.active !== false && items[Number(this.active)]) ||
|
|
77
|
+
(!this.collapsible && items[0]);
|
|
86
78
|
|
|
87
|
-
|
|
79
|
+
if (active) {
|
|
80
|
+
this.toggle(active, false);
|
|
81
|
+
}
|
|
88
82
|
},
|
|
89
83
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
(item) => item._wrapper?.firstElementChild || $(content, item)
|
|
94
|
-
);
|
|
95
|
-
},
|
|
84
|
+
toggles() {
|
|
85
|
+
this.$emit();
|
|
86
|
+
},
|
|
96
87
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.clsOpen
|
|
104
|
-
)
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
this.$emit();
|
|
108
|
-
},
|
|
88
|
+
contents(items) {
|
|
89
|
+
for (const el of items) {
|
|
90
|
+
const isOpen = hasClass(
|
|
91
|
+
this.items.find((item) => within(el, item)),
|
|
92
|
+
this.clsOpen
|
|
93
|
+
);
|
|
109
94
|
|
|
110
|
-
|
|
95
|
+
hide(el, !isOpen);
|
|
96
|
+
}
|
|
97
|
+
this.$emit();
|
|
111
98
|
},
|
|
112
99
|
},
|
|
113
100
|
|
package/src/js/core/drop.js
CHANGED
|
@@ -3,7 +3,7 @@ import Position from '../mixin/position';
|
|
|
3
3
|
import Container from '../mixin/container';
|
|
4
4
|
import Togglable from '../mixin/togglable';
|
|
5
5
|
import { keyMap } from '../util/keys';
|
|
6
|
-
import { preventBackgroundScroll } from '../
|
|
6
|
+
import { preventBackgroundScroll } from '../mixin/internal/scroll';
|
|
7
7
|
import {
|
|
8
8
|
addClass,
|
|
9
9
|
append,
|