uikit 3.16.4-dev.fd2458e3b → 3.16.5-dev.dda1f1b31
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/.eslintrc.json +1 -0
- package/CHANGELOG.md +9 -1
- package/build/build.js +5 -4
- package/build/icons.js +2 -1
- package/build/less.js +2 -11
- package/build/prefix.js +2 -1
- package/build/release.js +4 -3
- package/build/scope.js +2 -1
- package/build/scss.js +2 -1
- package/build/util.js +3 -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 +12 -14
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +506 -22
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +2601 -310
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +2612 -323
- 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 +466 -43
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +184 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +2345 -49
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +184 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +2339 -49
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +472 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +2298 -11
- 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 +951 -931
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +153 -152
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +979 -954
- package/dist/js/uikit.min.js +1 -1
- package/package.json +2 -2
- package/src/images/icons/mastodon.svg +3 -0
- package/src/js/api/app.js +12 -0
- package/src/js/api/boot.js +64 -43
- package/src/js/api/component.js +60 -61
- package/src/js/api/computed.js +39 -0
- package/src/js/api/events.js +45 -0
- package/src/js/api/global.js +58 -56
- package/src/js/api/hooks.js +35 -114
- package/src/js/api/index.js +8 -24
- package/src/js/api/instance.js +55 -55
- package/src/js/api/log.js +10 -0
- package/src/js/api/observables.js +125 -0
- package/src/js/api/observer.js +76 -0
- package/src/js/{util → api}/options.js +38 -1
- package/src/js/api/props.js +102 -0
- package/src/js/api/state.js +26 -280
- package/src/js/api/update.js +77 -0
- package/src/js/api/watch.js +34 -0
- package/src/js/components/countdown.js +14 -16
- package/src/js/components/filter.js +18 -24
- package/src/js/components/internal/slider-preload.js +5 -6
- package/src/js/components/lightbox-panel.js +1 -1
- package/src/js/components/lightbox.js +11 -23
- package/src/js/components/parallax.js +8 -6
- package/src/js/components/slider.js +10 -0
- package/src/js/components/tooltip.js +2 -1
- package/src/js/core/accordion.js +5 -6
- package/src/js/core/cover.js +9 -9
- package/src/js/core/drop.js +13 -6
- package/src/js/core/dropnav.js +1 -1
- package/src/js/core/grid.js +2 -5
- package/src/js/core/height-match.js +9 -16
- package/src/js/core/height-viewport.js +5 -7
- package/src/js/core/img.js +12 -19
- package/src/js/core/leader.js +4 -2
- package/src/js/core/margin.js +11 -21
- package/src/js/core/modal.js +1 -1
- package/src/js/core/offcanvas.js +6 -2
- package/src/js/core/overflow-auto.js +5 -5
- package/src/js/core/responsive.js +5 -7
- package/src/js/core/scroll.js +19 -10
- package/src/js/core/scrollspy-nav.js +6 -5
- package/src/js/core/scrollspy.js +27 -36
- package/src/js/core/sticky.js +12 -10
- package/src/js/core/svg.js +4 -2
- package/src/js/core/switcher.js +11 -9
- package/src/js/core/toggle.js +4 -4
- package/src/js/core/video.js +6 -14
- package/src/js/mixin/modal.js +2 -1
- package/src/js/mixin/parallax.js +1 -1
- package/src/js/mixin/slider-nav.js +2 -1
- package/src/js/mixin/slider.js +9 -3
- package/src/js/util/filter.js +13 -0
- package/src/js/util/index.js +0 -1
- package/src/js/util/keys.js +11 -0
- package/src/js/util/lang.js +7 -7
- package/src/js/util/observer.js +4 -2
- package/src/js/util/scroll.js +42 -0
- package/src/js/util/svg.js +16 -0
- package/src/js/util/viewport.js +1 -1
- package/src/scss/mixins-theme.scss +1640 -1596
- package/src/scss/mixins.scss +1370 -1370
- package/src/scss/variables-theme.scss +1255 -1255
- package/src/scss/variables.scss +1113 -1113
- package/src/js/mixin/lazyload.js +0 -27
- package/src/js/mixin/resize.js +0 -11
- package/src/js/mixin/scroll.js +0 -32
- package/src/js/mixin/swipe.js +0 -72
- package/src/js/mixin/utils.js +0 -91
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.5-dev.dda1f1b31",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"eslint": "^8.35.0",
|
|
31
31
|
"eslint-config-prettier": "^8.6.0",
|
|
32
32
|
"fs-extra": "^11.1.0",
|
|
33
|
-
"glob": "^
|
|
33
|
+
"glob": "^9.2.1",
|
|
34
34
|
"inquirer": "^9.1.4",
|
|
35
35
|
"less": "^4.1.3",
|
|
36
36
|
"minimist": "^1.2.8",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="m18.5,6.87c0-3.95-2.59-5.11-2.59-5.11-1.31-.6-3.55-.85-5.88-.87h-.06c-2.33.02-4.57.27-5.88.87,0,0-2.59,1.16-2.59,5.11,0,.91-.02,1.99.01,3.14.09,3.87.71,7.68,4.28,8.62,1.65.44,3.06.53,4.2.47,2.07-.11,3.23-.74,3.23-.74l-.07-1.5s-1.48.47-3.14.41c-1.64-.06-3.38-.18-3.64-2.2-.02-.18-.04-.37-.04-.57,0,0,1.61.39,3.66.49,1.25.06,2.42-.07,3.61-.22,2.28-.27,4.27-1.68,4.52-2.97.39-2.02.36-4.94.36-4.94Zm-3.05,5.09h-1.9v-4.65c0-.98-.41-1.48-1.24-1.48-.91,0-1.37.59-1.37,1.76v2.54h-1.89v-2.54c0-1.17-.46-1.76-1.37-1.76-.82,0-1.24.5-1.24,1.48v4.65h-1.9v-4.79c0-.98.25-1.76.75-2.33.52-.58,1.19-.87,2.03-.87.97,0,1.71.37,2.19,1.12l.47.79.47-.79c.49-.75,1.22-1.12,2.19-1.12.84,0,1.51.29,2.03.87.5.58.75,1.35.75,2.33v4.79Z"/>
|
|
3
|
+
</svg>
|
package/src/js/api/boot.js
CHANGED
|
@@ -1,59 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { callConnected, callDisconnected } from './hooks';
|
|
2
|
+
import { components, createComponent, getComponent, getComponents } from './component';
|
|
3
|
+
import { apply, hasAttr, inBrowser, isPlainObject, startsWith, trigger } from '../util';
|
|
3
4
|
|
|
4
|
-
export default function (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (!inBrowser || !window.MutationObserver) {
|
|
8
|
-
return;
|
|
5
|
+
export default function (App) {
|
|
6
|
+
if (inBrowser && window.MutationObserver) {
|
|
7
|
+
requestAnimationFrame(() => init(App));
|
|
9
8
|
}
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
function init(App) {
|
|
12
|
+
trigger(document, 'uikit:init', App);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if (document.body) {
|
|
15
|
+
apply(document.body, connect);
|
|
16
|
+
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
childList: true,
|
|
22
|
-
subtree: true,
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(
|
|
27
|
-
document,
|
|
28
|
-
{
|
|
29
|
-
attributes: true,
|
|
30
|
-
subtree: true,
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
UIkit._initialized = true;
|
|
18
|
+
new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(document, {
|
|
19
|
+
childList: true,
|
|
20
|
+
subtree: true,
|
|
35
21
|
});
|
|
36
22
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(document, {
|
|
24
|
+
attributes: true,
|
|
25
|
+
subtree: true,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
App._initialized = true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function applyChildListMutation({ addedNodes, removedNodes }) {
|
|
32
|
+
for (const node of addedNodes) {
|
|
33
|
+
apply(node, connect);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
for (const node of removedNodes) {
|
|
37
|
+
apply(node, disconnect);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function applyAttributeMutation({ target, attributeName }) {
|
|
42
|
+
const name = getComponentName(attributeName);
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
if (name) {
|
|
45
|
+
if (hasAttr(target, attributeName)) {
|
|
46
|
+
createComponent(name, target);
|
|
47
|
+
return;
|
|
44
48
|
}
|
|
49
|
+
|
|
50
|
+
getComponent(target, name)?.$destroy();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function connect(node) {
|
|
55
|
+
const components = getComponents(node);
|
|
56
|
+
for (const name in getComponents(node)) {
|
|
57
|
+
callConnected(components[name]);
|
|
45
58
|
}
|
|
46
59
|
|
|
47
|
-
|
|
60
|
+
for (const attributeName of node.getAttributeNames()) {
|
|
48
61
|
const name = getComponentName(attributeName);
|
|
62
|
+
name && createComponent(name, node);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
49
65
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
function disconnect(node) {
|
|
67
|
+
const components = getComponents(node);
|
|
68
|
+
for (const name in getComponents(node)) {
|
|
69
|
+
callDisconnected(components[name]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
55
72
|
|
|
56
|
-
|
|
57
|
-
|
|
73
|
+
function getComponentName(attribute) {
|
|
74
|
+
if (startsWith(attribute, 'data-')) {
|
|
75
|
+
attribute = attribute.slice(5);
|
|
58
76
|
}
|
|
77
|
+
|
|
78
|
+
const cmp = components[attribute];
|
|
79
|
+
return cmp && (isPlainObject(cmp) ? cmp : cmp.options).name;
|
|
59
80
|
}
|
package/src/js/api/component.js
CHANGED
|
@@ -1,85 +1,84 @@
|
|
|
1
|
-
import
|
|
1
|
+
import App from './app';
|
|
2
|
+
import { $$, camelize, hyphenate, isEmpty, isPlainObject } from '../util';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const { data: DATA, prefix: PREFIX } = UIkit;
|
|
4
|
+
const PREFIX = 'uk-';
|
|
5
|
+
const DATA = '__uikit__';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
name = hyphenate(name);
|
|
9
|
-
const id = PREFIX + name;
|
|
7
|
+
export const components = {};
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
components[id] = components[`data-${id}`] = UIkit.extend(components[id]);
|
|
14
|
-
}
|
|
9
|
+
export function component(name, options) {
|
|
10
|
+
const id = PREFIX + hyphenate(name);
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
if (!options) {
|
|
13
|
+
if (isPlainObject(components[id])) {
|
|
14
|
+
components[id] = App.extend(components[id]);
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
return components[id];
|
|
18
|
+
}
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
const component = UIkit.component(name);
|
|
20
|
+
name = camelize(name);
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
? new component({ data: isPlainObject(element) ? element : [...arguments] })
|
|
26
|
-
: element
|
|
27
|
-
? $$(element).map(init)[0]
|
|
28
|
-
: init();
|
|
22
|
+
App[name] = (element, data) => createComponent(name, element, data);
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
const instance = UIkit.getComponent(element, name);
|
|
24
|
+
const opt = isPlainObject(options) ? { ...options } : options.options;
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
instance.$destroy();
|
|
36
|
-
} else {
|
|
37
|
-
return instance;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
26
|
+
opt.id = id;
|
|
27
|
+
opt.name = name;
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
};
|
|
29
|
+
opt.install?.(App, opt, name);
|
|
44
30
|
|
|
45
|
-
|
|
31
|
+
if (App._initialized && !opt.functional) {
|
|
32
|
+
requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
|
|
33
|
+
}
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
return (components[id] = opt);
|
|
36
|
+
}
|
|
49
37
|
|
|
50
|
-
|
|
38
|
+
export function createComponent(name, element, data) {
|
|
39
|
+
const Component = component(name);
|
|
51
40
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
return Component.options.functional
|
|
42
|
+
? new Component({ data: isPlainObject(element) ? element : [...arguments] })
|
|
43
|
+
: element
|
|
44
|
+
? $$(element).map(init)[0]
|
|
45
|
+
: init();
|
|
55
46
|
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
function init(element) {
|
|
48
|
+
const instance = getComponent(element, name);
|
|
58
49
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
for (const name in node[DATA]) {
|
|
65
|
-
node[DATA][name]._callConnected();
|
|
50
|
+
if (instance) {
|
|
51
|
+
if (data) {
|
|
52
|
+
instance.$destroy();
|
|
53
|
+
} else {
|
|
54
|
+
return instance;
|
|
66
55
|
}
|
|
67
56
|
}
|
|
68
57
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
};
|
|
58
|
+
return new Component({ el: element, data });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
74
61
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
62
|
+
export function getComponents(element) {
|
|
63
|
+
return element[DATA] || {};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function getComponent(element, name) {
|
|
67
|
+
return getComponents(element)[name];
|
|
80
68
|
}
|
|
81
69
|
|
|
82
|
-
export function
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
export function attachToElement(element, instance) {
|
|
71
|
+
if (!element[DATA]) {
|
|
72
|
+
element[DATA] = {};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
element[DATA][instance.$options.name] = instance;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function detachFromElement(element, instance) {
|
|
79
|
+
delete element[DATA]?.[instance.$options.name];
|
|
80
|
+
|
|
81
|
+
if (!isEmpty(element[DATA])) {
|
|
82
|
+
delete element[DATA];
|
|
83
|
+
}
|
|
85
84
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { hasOwn, isUndefined } from '../util';
|
|
2
|
+
|
|
3
|
+
export function initComputed(instance) {
|
|
4
|
+
const { computed } = instance.$options;
|
|
5
|
+
|
|
6
|
+
instance._computed = {};
|
|
7
|
+
|
|
8
|
+
if (computed) {
|
|
9
|
+
for (const key in computed) {
|
|
10
|
+
registerComputed(instance, key, computed[key]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function registerComputed(instance, key, cb) {
|
|
16
|
+
Object.defineProperty(instance, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
|
|
19
|
+
get() {
|
|
20
|
+
const { _computed, $props, $el } = instance;
|
|
21
|
+
|
|
22
|
+
if (!hasOwn(_computed, key)) {
|
|
23
|
+
_computed[key] = (cb.get || cb).call(instance, $props, $el);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return _computed[key];
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
set(value) {
|
|
30
|
+
const { _computed } = instance;
|
|
31
|
+
|
|
32
|
+
_computed[key] = cb.set ? cb.set.call(instance, value) : value;
|
|
33
|
+
|
|
34
|
+
if (isUndefined(_computed[key])) {
|
|
35
|
+
delete _computed[key];
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { hasOwn, isArray, isFunction, isPlainObject, isString, on } from '../util';
|
|
2
|
+
|
|
3
|
+
export function initEvents(instance) {
|
|
4
|
+
instance._events = [];
|
|
5
|
+
for (const event of instance.$options.events || []) {
|
|
6
|
+
if (hasOwn(event, 'handler')) {
|
|
7
|
+
registerEvent(instance, event);
|
|
8
|
+
} else {
|
|
9
|
+
for (const key in event) {
|
|
10
|
+
registerEvent(instance, event[key], key);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function unbindEvents(instance) {
|
|
17
|
+
instance._events.forEach((unbind) => unbind());
|
|
18
|
+
delete instance._events;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function registerEvent(instance, event, key) {
|
|
22
|
+
let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event)
|
|
23
|
+
? event
|
|
24
|
+
: { name: key, handler: event };
|
|
25
|
+
el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;
|
|
26
|
+
|
|
27
|
+
if (isArray(el)) {
|
|
28
|
+
el.forEach((el) => registerEvent(instance, { ...event, el }, key));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (!el || (filter && !filter.call(instance))) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
instance._events.push(
|
|
37
|
+
on(
|
|
38
|
+
el,
|
|
39
|
+
name,
|
|
40
|
+
delegate ? (isString(delegate) ? delegate : delegate.call(instance, instance)) : null,
|
|
41
|
+
isString(handler) ? instance[handler] : handler.bind(instance),
|
|
42
|
+
{ passive, capture, self }
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
}
|
package/src/js/api/global.js
CHANGED
|
@@ -1,72 +1,74 @@
|
|
|
1
|
-
import
|
|
1
|
+
import App from './app';
|
|
2
|
+
import { init } from './state';
|
|
3
|
+
import { callUpdate } from './update';
|
|
4
|
+
import { mergeOptions } from './options';
|
|
5
|
+
import { component, getComponent, getComponents } from './component';
|
|
6
|
+
import { $, apply, isString, parents, toNode } from '../util';
|
|
7
|
+
|
|
8
|
+
App.component = component;
|
|
9
|
+
App.getComponents = getComponents;
|
|
10
|
+
App.getComponent = getComponent;
|
|
11
|
+
|
|
12
|
+
App.use = function (plugin) {
|
|
13
|
+
if (plugin.installed) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
2
16
|
|
|
3
|
-
|
|
4
|
-
|
|
17
|
+
plugin.call(null, this);
|
|
18
|
+
plugin.installed = true;
|
|
5
19
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
20
|
+
return this;
|
|
21
|
+
};
|
|
10
22
|
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
App.mixin = function (mixin, component) {
|
|
24
|
+
component = (isString(component) ? this.component(component) : component) || this;
|
|
25
|
+
component.options = mergeOptions(component.options, mixin);
|
|
26
|
+
};
|
|
13
27
|
|
|
14
|
-
|
|
15
|
-
};
|
|
28
|
+
App.extend = function (options) {
|
|
29
|
+
options = options || {};
|
|
16
30
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
31
|
+
const Super = this;
|
|
32
|
+
const Sub = function UIkitComponent(options) {
|
|
33
|
+
init(this, options);
|
|
20
34
|
};
|
|
21
35
|
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
Sub.prototype = Object.create(Super.prototype);
|
|
37
|
+
Sub.prototype.constructor = Sub;
|
|
38
|
+
Sub.options = mergeOptions(Super.options, options);
|
|
24
39
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this._init(options);
|
|
28
|
-
};
|
|
40
|
+
Sub.super = Super;
|
|
41
|
+
Sub.extend = Super.extend;
|
|
29
42
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Sub.options = mergeOptions(Super.options, options);
|
|
43
|
+
return Sub;
|
|
44
|
+
};
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
export function update(element, e) {
|
|
47
|
+
element = element ? toNode(element) : document.body;
|
|
36
48
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
UIkit.update = function (element, e) {
|
|
41
|
-
element = element ? toNode(element) : document.body;
|
|
49
|
+
for (const parentEl of parents(element).reverse()) {
|
|
50
|
+
updateElement(parentEl, e);
|
|
51
|
+
}
|
|
42
52
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
53
|
+
apply(element, (element) => updateElement(element, e));
|
|
54
|
+
}
|
|
46
55
|
|
|
47
|
-
|
|
48
|
-
};
|
|
56
|
+
App.update = update;
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
set(element) {
|
|
57
|
-
container = $(element);
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
function update(data, e) {
|
|
62
|
-
if (!data) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
for (const name in data) {
|
|
67
|
-
if (data[name]._connected) {
|
|
68
|
-
data[name]._callUpdate(e);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
58
|
+
function updateElement(element, e) {
|
|
59
|
+
const components = getComponents(element);
|
|
60
|
+
for (const name in components) {
|
|
61
|
+
callUpdate(components[name], e);
|
|
71
62
|
}
|
|
72
63
|
}
|
|
64
|
+
|
|
65
|
+
let container;
|
|
66
|
+
Object.defineProperty(App, 'container', {
|
|
67
|
+
get() {
|
|
68
|
+
return container || document.body;
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
set(element) {
|
|
72
|
+
container = $(element);
|
|
73
|
+
},
|
|
74
|
+
});
|