uikit 3.15.6 → 3.15.7-dev.b8781768c
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 +8 -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 +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +6 -5
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +6 -5
- 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 +6 -5
- 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 +6 -5
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- 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 +41 -31
- 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 +46 -35
- package/dist/js/uikit.min.js +2 -2
- package/package.json +2 -2
- package/src/js/core/accordion.js +41 -33
- package/src/js/mixin/slider-drag.js +5 -4
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.
|
|
5
|
+
"version": "3.15.7-dev.b8781768c",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"prefix": "node build/prefix",
|
|
21
21
|
"scope": "node build/scope",
|
|
22
22
|
"release": "node build/release",
|
|
23
|
-
"watch": "watch-run -i -p
|
|
23
|
+
"watch": "watch-run -i -p \"**/*.less\" -- node build/less",
|
|
24
24
|
"eslint": "eslint src/js",
|
|
25
25
|
"eslint-fix": "eslint --fix src/js"
|
|
26
26
|
},
|
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
|
+
}
|
|
@@ -14,9 +14,10 @@ import {
|
|
|
14
14
|
} from 'uikit-util';
|
|
15
15
|
|
|
16
16
|
const pointerOptions = { passive: false, capture: true };
|
|
17
|
+
const pointerUpOptions = { passive: true, capture: true };
|
|
17
18
|
const pointerDown = 'touchstart mousedown';
|
|
18
19
|
const pointerMove = 'touchmove mousemove';
|
|
19
|
-
const pointerUp = 'touchend touchcancel mouseup click input';
|
|
20
|
+
const pointerUp = 'touchend touchcancel mouseup click input scroll';
|
|
20
21
|
|
|
21
22
|
export default {
|
|
22
23
|
props: {
|
|
@@ -75,7 +76,7 @@ export default {
|
|
|
75
76
|
|
|
76
77
|
{
|
|
77
78
|
// iOS workaround for slider stopping if swiping fast
|
|
78
|
-
name:
|
|
79
|
+
name: pointerMove,
|
|
79
80
|
el() {
|
|
80
81
|
return this.list;
|
|
81
82
|
},
|
|
@@ -105,7 +106,7 @@ export default {
|
|
|
105
106
|
on(document, pointerMove, this.move, pointerOptions);
|
|
106
107
|
|
|
107
108
|
// 'input' event is triggered by video controls
|
|
108
|
-
on(document, pointerUp, this.end,
|
|
109
|
+
on(document, pointerUp, this.end, pointerUpOptions);
|
|
109
110
|
|
|
110
111
|
css(this.list, 'userSelect', 'none');
|
|
111
112
|
},
|
|
@@ -186,7 +187,7 @@ export default {
|
|
|
186
187
|
|
|
187
188
|
end() {
|
|
188
189
|
off(document, pointerMove, this.move, pointerOptions);
|
|
189
|
-
off(document, pointerUp, this.end,
|
|
190
|
+
off(document, pointerUp, this.end, pointerUpOptions);
|
|
190
191
|
|
|
191
192
|
if (this.dragging) {
|
|
192
193
|
this.dragging = null;
|