uikit 3.15.7-dev.05c3b3f6c → 3.15.7-dev.36b565a98
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 +4 -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 +2 -2
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +2 -3
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +2 -4
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +2 -4
- 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 +2 -2
- 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 +2 -2
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +2 -2
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +3 -4
- 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 +82 -82
- package/dist/js/uikit-core.min.js +2 -2
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +85 -89
- package/dist/js/uikit.min.js +2 -2
- package/package.json +1 -1
- package/src/js/api/boot.js +6 -8
- package/src/js/api/component.js +18 -21
- package/src/js/api/instance.js +6 -11
- package/src/js/api/state.js +11 -11
- package/src/js/components/filter.js +1 -2
- package/src/js/components/lightbox-panel.js +0 -2
- package/src/js/components/tooltip.js +2 -3
- package/src/js/core/accordion.js +41 -33
- package/src/js/core/icon.js +1 -1
- package/src/js/mixin/class.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.15.7-dev.
|
|
5
|
+
"version": "3.15.7-dev.36b565a98",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/api/boot.js
CHANGED
|
@@ -45,15 +45,13 @@ export default function (UIkit) {
|
|
|
45
45
|
function applyAttributeMutation({ target, attributeName }) {
|
|
46
46
|
const name = getComponentName(attributeName);
|
|
47
47
|
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
if (name) {
|
|
49
|
+
if (hasAttr(target, attributeName)) {
|
|
50
|
+
UIkit[name](target);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
UIkit[name](target);
|
|
54
|
-
return;
|
|
54
|
+
UIkit.getComponent(target, name)?.$destroy();
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
UIkit.getComponent(target, name)?.$destroy();
|
|
58
56
|
}
|
|
59
57
|
}
|
package/src/js/api/component.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { $$, camelize, hyphenate, isPlainObject
|
|
1
|
+
import { $$, camelize, hyphenate, isPlainObject } from 'uikit-util';
|
|
2
2
|
|
|
3
|
+
const components = {};
|
|
3
4
|
export default function (UIkit) {
|
|
4
|
-
const DATA = UIkit
|
|
5
|
-
|
|
6
|
-
const components = {};
|
|
5
|
+
const { data: DATA, prefix: PREFIX } = UIkit;
|
|
7
6
|
|
|
8
7
|
UIkit.component = function (name, options) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name = camelize(id);
|
|
8
|
+
name = hyphenate(name);
|
|
9
|
+
const id = PREFIX + name;
|
|
12
10
|
|
|
13
11
|
if (!options) {
|
|
14
|
-
if (isPlainObject(components[
|
|
15
|
-
components[
|
|
12
|
+
if (isPlainObject(components[id])) {
|
|
13
|
+
components[id] = components[`data-${id}`] = UIkit.extend(components[id]);
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
return components[
|
|
16
|
+
return components[id];
|
|
19
17
|
}
|
|
20
18
|
|
|
19
|
+
name = camelize(name);
|
|
20
|
+
|
|
21
21
|
UIkit[name] = function (element, data) {
|
|
22
22
|
const component = UIkit.component(name);
|
|
23
23
|
|
|
@@ -44,15 +44,16 @@ export default function (UIkit) {
|
|
|
44
44
|
|
|
45
45
|
const opt = isPlainObject(options) ? { ...options } : options.options;
|
|
46
46
|
|
|
47
|
+
opt.id = id;
|
|
47
48
|
opt.name = name;
|
|
48
49
|
|
|
49
50
|
opt.install?.(UIkit, opt, name);
|
|
50
51
|
|
|
51
52
|
if (UIkit._initialized && !opt.functional) {
|
|
52
|
-
requestAnimationFrame(() => UIkit[name](`[
|
|
53
|
+
requestAnimationFrame(() => UIkit[name](`[${id}],[data-${id}]`));
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
return (components[
|
|
56
|
+
return (components[id] = components[`data-${id}`] = isPlainObject(options) ? opt : options);
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
UIkit.getComponents = (element) => element?.[DATA] || {};
|
|
@@ -67,10 +68,7 @@ export default function (UIkit) {
|
|
|
67
68
|
|
|
68
69
|
for (const attribute of node.attributes) {
|
|
69
70
|
const name = getComponentName(attribute.name);
|
|
70
|
-
|
|
71
|
-
if (name && name in components) {
|
|
72
|
-
UIkit[name](node);
|
|
73
|
-
}
|
|
71
|
+
name && UIkit[name](node);
|
|
74
72
|
}
|
|
75
73
|
};
|
|
76
74
|
|
|
@@ -81,8 +79,7 @@ export default function (UIkit) {
|
|
|
81
79
|
};
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
export
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
82
|
+
export function getComponentName(attribute) {
|
|
83
|
+
const cmp = components[attribute];
|
|
84
|
+
return cmp && (isPlainObject(cmp) ? cmp : cmp.options).name;
|
|
85
|
+
}
|
package/src/js/api/instance.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isEmpty, remove, within } from 'uikit-util';
|
|
2
2
|
|
|
3
3
|
export default function (UIkit) {
|
|
4
4
|
const DATA = UIkit.data;
|
|
@@ -66,14 +66,9 @@ export default function (UIkit) {
|
|
|
66
66
|
|
|
67
67
|
UIkit.prototype.$getComponent = UIkit.getComponent;
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
$container
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
get() {
|
|
75
|
-
return componentName(this.$options.name);
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
});
|
|
69
|
+
Object.defineProperty(
|
|
70
|
+
UIkit.prototype,
|
|
71
|
+
'$container',
|
|
72
|
+
Object.getOwnPropertyDescriptor(UIkit, 'container')
|
|
73
|
+
);
|
|
79
74
|
}
|
package/src/js/api/state.js
CHANGED
|
@@ -73,7 +73,7 @@ export default function (UIkit) {
|
|
|
73
73
|
UIkit.prototype._initProps = function (props) {
|
|
74
74
|
let key;
|
|
75
75
|
|
|
76
|
-
props = props || getProps(this.$options
|
|
76
|
+
props = props || getProps(this.$options);
|
|
77
77
|
|
|
78
78
|
for (key in props) {
|
|
79
79
|
if (!isUndefined(props[key])) {
|
|
@@ -124,9 +124,9 @@ export default function (UIkit) {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
function getProps(opts
|
|
127
|
+
function getProps(opts) {
|
|
128
128
|
const data = {};
|
|
129
|
-
const { args = [], props = {}, el } = opts;
|
|
129
|
+
const { args = [], props = {}, el, id } = opts;
|
|
130
130
|
|
|
131
131
|
if (!props) {
|
|
132
132
|
return data;
|
|
@@ -149,7 +149,7 @@ function getProps(opts, name) {
|
|
|
149
149
|
data[key] = value;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
const options = parseOptions(getData(el,
|
|
152
|
+
const options = parseOptions(getData(el, id), args);
|
|
153
153
|
|
|
154
154
|
for (const key in options) {
|
|
155
155
|
const prop = camelize(key);
|
|
@@ -277,24 +277,24 @@ function initChildListObserver(component) {
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
function initPropsObserver(component) {
|
|
280
|
-
const { $
|
|
281
|
-
const { attrs, props, el } = $options;
|
|
280
|
+
const { $options, $props } = component;
|
|
281
|
+
const { id, attrs, props, el } = $options;
|
|
282
282
|
|
|
283
283
|
if (!props || attrs === false) {
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
const attributes = isArray(attrs) ? attrs : Object.keys(props);
|
|
288
|
-
const filter = attributes.map((key) => hyphenate(key)).concat(
|
|
288
|
+
const filter = attributes.map((key) => hyphenate(key)).concat(id);
|
|
289
289
|
|
|
290
290
|
const observer = new MutationObserver((records) => {
|
|
291
|
-
const data = getProps($options
|
|
291
|
+
const data = getProps($options);
|
|
292
292
|
if (
|
|
293
293
|
records.some(({ attributeName }) => {
|
|
294
294
|
const prop = attributeName.replace('data-', '');
|
|
295
|
-
return (
|
|
296
|
-
prop
|
|
297
|
-
)
|
|
295
|
+
return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(
|
|
296
|
+
(prop) => !isUndefined(data[prop]) && data[prop] !== $props[prop]
|
|
297
|
+
);
|
|
298
298
|
})
|
|
299
299
|
) {
|
|
300
300
|
component.$reset();
|
|
@@ -155,8 +155,7 @@ function applyState(state, target, children) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
function mergeState(el, attr, state) {
|
|
158
|
-
const
|
|
159
|
-
const { filter, group, sort, order = 'asc' } = filterBy;
|
|
158
|
+
const { filter, group, sort, order = 'asc' } = getFilter(el, attr);
|
|
160
159
|
|
|
161
160
|
if (filter || isUndefined(sort)) {
|
|
162
161
|
if (group) {
|
|
@@ -206,7 +206,6 @@ export default {
|
|
|
206
206
|
|
|
207
207
|
let matches;
|
|
208
208
|
const iframeAttrs = {
|
|
209
|
-
frameborder: '0',
|
|
210
209
|
allowfullscreen: '',
|
|
211
210
|
style: 'max-width: 100%; box-sizing: border-box;',
|
|
212
211
|
'uk-responsive': '',
|
|
@@ -248,7 +247,6 @@ export default {
|
|
|
248
247
|
item,
|
|
249
248
|
createEl('iframe', {
|
|
250
249
|
src,
|
|
251
|
-
frameborder: '0',
|
|
252
250
|
allowfullscreen: '',
|
|
253
251
|
class: 'uk-lightbox-iframe',
|
|
254
252
|
...attrs,
|
|
@@ -59,13 +59,12 @@ export default {
|
|
|
59
59
|
|
|
60
60
|
this._unbind = once(
|
|
61
61
|
document,
|
|
62
|
-
`
|
|
62
|
+
`keydown ${pointerDown}`,
|
|
63
63
|
this.hide,
|
|
64
64
|
false,
|
|
65
65
|
(e) =>
|
|
66
66
|
(e.type === pointerDown && !within(e.target, this.$el)) ||
|
|
67
|
-
(e.type === 'keydown' && e.keyCode === 27)
|
|
68
|
-
(e.type === 'show' && e.detail[0] !== this && e.detail[0].$name === this.$name)
|
|
67
|
+
(e.type === 'keydown' && e.keyCode === 27)
|
|
69
68
|
);
|
|
70
69
|
|
|
71
70
|
clearTimeout(this.showTimer);
|
package/src/js/core/accordion.js
CHANGED
|
@@ -11,9 +11,7 @@ import {
|
|
|
11
11
|
hasClass,
|
|
12
12
|
includes,
|
|
13
13
|
index,
|
|
14
|
-
|
|
15
|
-
noop,
|
|
16
|
-
scrollIntoView,
|
|
14
|
+
scrollParents,
|
|
17
15
|
toFloat,
|
|
18
16
|
toggleClass,
|
|
19
17
|
Transition,
|
|
@@ -108,52 +106,46 @@ export default {
|
|
|
108
106
|
return `${this.targets} ${this.$props.toggle}`;
|
|
109
107
|
},
|
|
110
108
|
|
|
111
|
-
handler(e) {
|
|
109
|
+
async handler(e) {
|
|
112
110
|
e.preventDefault();
|
|
113
|
-
|
|
111
|
+
|
|
112
|
+
this._off?.();
|
|
113
|
+
this._off = keepScrollPosition(e.target);
|
|
114
|
+
await this.toggle(index(this.toggles, e.current));
|
|
115
|
+
this._off();
|
|
114
116
|
},
|
|
115
117
|
},
|
|
116
118
|
],
|
|
117
119
|
|
|
118
120
|
methods: {
|
|
119
|
-
toggle(item, animate) {
|
|
120
|
-
|
|
121
|
+
async toggle(item, animate) {
|
|
122
|
+
item = this.items[getIndex(item, this.items)];
|
|
123
|
+
let items = [item];
|
|
121
124
|
const activeItems = filter(this.items, `.${this.clsOpen}`);
|
|
122
125
|
|
|
123
126
|
if (!this.multiple && !includes(activeItems, items[0])) {
|
|
124
127
|
items = items.concat(activeItems);
|
|
125
128
|
}
|
|
126
129
|
|
|
127
|
-
if (
|
|
128
|
-
!this.collapsible &&
|
|
129
|
-
activeItems.length < 2 &&
|
|
130
|
-
!filter(items, `:not(.${this.clsOpen})`).length
|
|
131
|
-
) {
|
|
130
|
+
if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {
|
|
132
131
|
return;
|
|
133
132
|
}
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return transition(el, show, this).then(() => {
|
|
146
|
-
if (show) {
|
|
147
|
-
const toggle = $(this.$props.toggle, el);
|
|
148
|
-
requestAnimationFrame(() => {
|
|
149
|
-
if (!isInView(toggle)) {
|
|
150
|
-
scrollIntoView(toggle, { offset: this.offset });
|
|
151
|
-
}
|
|
152
|
-
});
|
|
134
|
+
await Promise.all(
|
|
135
|
+
items.map((el) =>
|
|
136
|
+
this.toggleElement(el, !includes(activeItems, el), (el, show) => {
|
|
137
|
+
toggleClass(el, this.clsOpen, show);
|
|
138
|
+
attr($(this.$props.toggle, el), 'aria-expanded', show);
|
|
139
|
+
|
|
140
|
+
if (animate === false || !this.animation) {
|
|
141
|
+
hide($(this.content, el), !show);
|
|
142
|
+
return;
|
|
153
143
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
144
|
+
|
|
145
|
+
return transition(el, show, this);
|
|
146
|
+
})
|
|
147
|
+
)
|
|
148
|
+
);
|
|
157
149
|
},
|
|
158
150
|
},
|
|
159
151
|
};
|
|
@@ -193,3 +185,19 @@ async function transition(el, show, { content, duration, velocity, transition })
|
|
|
193
185
|
hide(content, true);
|
|
194
186
|
}
|
|
195
187
|
}
|
|
188
|
+
|
|
189
|
+
function keepScrollPosition(el) {
|
|
190
|
+
const scrollParent = scrollParents(el)[0];
|
|
191
|
+
let frame;
|
|
192
|
+
(function scroll() {
|
|
193
|
+
frame = requestAnimationFrame(() => {
|
|
194
|
+
const { top } = el.getBoundingClientRect();
|
|
195
|
+
if (top < 0) {
|
|
196
|
+
scrollParent.scrollTop += top;
|
|
197
|
+
}
|
|
198
|
+
scroll();
|
|
199
|
+
});
|
|
200
|
+
})();
|
|
201
|
+
|
|
202
|
+
return () => requestAnimationFrame(() => cancelAnimationFrame(frame));
|
|
203
|
+
}
|
package/src/js/core/icon.js
CHANGED
package/src/js/mixin/class.js
CHANGED