uikit 3.14.4-dev.ce706e326 → 3.14.4-dev.d014a9a57
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 +9 -1
- package/dist/css/uikit-core-rtl.css +62 -46
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +62 -46
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +62 -47
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +62 -47
- 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 -5
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +27 -20
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +27 -20
- 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 +22 -7
- 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 +22 -7
- 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 +23 -16
- 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 +100 -56
- 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 +153 -92
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/images/{backgrounds/nav-parent-open.svg → components/nav-parent-icon-large.svg} +0 -0
- package/src/images/components/nav-parent-icon.svg +3 -0
- package/src/images/components/navbar-parent-icon.svg +3 -0
- package/src/js/components/filter.js +5 -3
- package/src/js/components/sortable.js +2 -3
- package/src/js/core/height-viewport.js +3 -1
- package/src/js/core/icon.js +16 -0
- package/src/js/core/index.js +2 -0
- package/src/js/core/navbar.js +44 -15
- package/src/js/core/sticky.js +8 -9
- package/src/js/mixin/position.js +24 -7
- package/src/js/mixin/slider-drag.js +20 -8
- package/src/js/mixin/togglable.js +8 -17
- package/src/js/util/position.js +1 -0
- package/src/js/util/viewport.js +2 -27
- package/src/less/components/dropdown.less +8 -0
- package/src/less/components/nav.less +6 -36
- package/src/less/components/navbar.less +96 -14
- package/src/less/theme/nav.less +0 -8
- package/src/less/theme/navbar.less +4 -6
- package/src/scss/components/dropdown.scss +8 -0
- package/src/scss/components/nav.scss +6 -25
- package/src/scss/components/navbar.scss +84 -14
- package/src/scss/mixins-theme.scss +13 -17
- package/src/scss/mixins.scss +12 -13
- package/src/scss/theme/nav.scss +0 -8
- package/src/scss/theme/navbar.scss +3 -2
- package/src/scss/variables-theme.scss +16 -10
- package/src/scss/variables.scss +16 -9
- package/tests/drop.html +66 -16
- package/tests/dropdown.html +103 -16
- package/tests/index.html +3 -3
- package/tests/nav.html +20 -87
- package/tests/navbar.html +283 -56
- package/tests/offcanvas.html +8 -8
- package/src/images/backgrounds/nav-parent-close.svg +0 -3
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.14.4-dev.
|
|
5
|
+
"version": "3.14.4-dev.d014a9a57",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
File without changes
|
|
@@ -103,7 +103,7 @@ export default {
|
|
|
103
103
|
});
|
|
104
104
|
},
|
|
105
105
|
|
|
106
|
-
setState(state, animate = true) {
|
|
106
|
+
async setState(state, animate = true) {
|
|
107
107
|
state = { filter: { '': '' }, sort: [], ...state };
|
|
108
108
|
|
|
109
109
|
trigger(this.$el, 'beforeFilter', [this, state]);
|
|
@@ -112,7 +112,7 @@ export default {
|
|
|
112
112
|
toggleClass(el, this.cls, !!matchFilter(el, this.attrItem, state))
|
|
113
113
|
);
|
|
114
114
|
|
|
115
|
-
Promise.all(
|
|
115
|
+
await Promise.all(
|
|
116
116
|
$$(this.target, this.$el).map((target) => {
|
|
117
117
|
const filterFn = () => {
|
|
118
118
|
applyState(state, target, getChildren(target));
|
|
@@ -120,7 +120,9 @@ export default {
|
|
|
120
120
|
};
|
|
121
121
|
return animate ? this.animate(filterFn, target) : filterFn();
|
|
122
122
|
})
|
|
123
|
-
)
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
trigger(this.$el, 'afterFilter', [this]);
|
|
124
126
|
},
|
|
125
127
|
|
|
126
128
|
updateState() {
|
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
remove,
|
|
27
27
|
removeClass,
|
|
28
28
|
scrollParents,
|
|
29
|
-
scrollTop,
|
|
30
29
|
toggleClass,
|
|
31
30
|
Transition,
|
|
32
31
|
trigger,
|
|
@@ -313,7 +312,7 @@ function trackScroll(pos) {
|
|
|
313
312
|
let last = Date.now();
|
|
314
313
|
trackTimer = setInterval(() => {
|
|
315
314
|
let { x, y } = pos;
|
|
316
|
-
y += scrollTop
|
|
315
|
+
y += document.scrollingElement.scrollTop;
|
|
317
316
|
|
|
318
317
|
const dist = (Date.now() - last) * 0.3;
|
|
319
318
|
last = Date.now();
|
|
@@ -334,7 +333,7 @@ function trackScroll(pos) {
|
|
|
334
333
|
}
|
|
335
334
|
|
|
336
335
|
if (scroll > 0 && scroll < scrollHeight - height) {
|
|
337
|
-
scrollTop
|
|
336
|
+
scrollEl.scrollTop = scroll;
|
|
338
337
|
return true;
|
|
339
338
|
}
|
|
340
339
|
});
|
|
@@ -56,7 +56,9 @@ export default {
|
|
|
56
56
|
0
|
|
57
57
|
);
|
|
58
58
|
} else {
|
|
59
|
-
const
|
|
59
|
+
const { body, scrollingElement } = document;
|
|
60
|
+
const isScrollingElement =
|
|
61
|
+
scrollingElement === scrollElement || body === scrollElement;
|
|
60
62
|
|
|
61
63
|
// on mobile devices (iOS and Android) window.innerHeight !== 100vh
|
|
62
64
|
minHeight = `calc(${isScrollingElement ? '100vh' : `${viewportHeight}px`}`;
|
package/src/js/core/icon.js
CHANGED
|
@@ -2,6 +2,9 @@ import SVG from './svg';
|
|
|
2
2
|
import closeIcon from '../../images/components/close-icon.svg';
|
|
3
3
|
import closeLarge from '../../images/components/close-large.svg';
|
|
4
4
|
import marker from '../../images/components/marker.svg';
|
|
5
|
+
import navParentIcon from '../../images/components/nav-parent-icon.svg';
|
|
6
|
+
import navParentIconLarge from '../../images/components/nav-parent-icon-large.svg';
|
|
7
|
+
import navbarParentIcon from '../../images/components/navbar-parent-icon.svg';
|
|
5
8
|
import navbarToggleIcon from '../../images/components/navbar-toggle-icon.svg';
|
|
6
9
|
import overlayIcon from '../../images/components/overlay-icon.svg';
|
|
7
10
|
import paginationNext from '../../images/components/pagination-next.svg';
|
|
@@ -19,6 +22,7 @@ import {
|
|
|
19
22
|
$,
|
|
20
23
|
addClass,
|
|
21
24
|
apply,
|
|
25
|
+
closest,
|
|
22
26
|
css,
|
|
23
27
|
each,
|
|
24
28
|
hasClass,
|
|
@@ -35,6 +39,9 @@ const icons = {
|
|
|
35
39
|
marker,
|
|
36
40
|
'close-icon': closeIcon,
|
|
37
41
|
'close-large': closeLarge,
|
|
42
|
+
'nav-parent-icon': navParentIcon,
|
|
43
|
+
'nav-parent-icon-large': navParentIconLarge,
|
|
44
|
+
'navbar-parent-icon': navbarParentIcon,
|
|
38
45
|
'navbar-toggle-icon': navbarToggleIcon,
|
|
39
46
|
'overlay-icon': overlayIcon,
|
|
40
47
|
'pagination-next': paginationNext,
|
|
@@ -96,6 +103,15 @@ export const IconComponent = {
|
|
|
96
103
|
},
|
|
97
104
|
};
|
|
98
105
|
|
|
106
|
+
export const NavParentIcon = {
|
|
107
|
+
extends: IconComponent,
|
|
108
|
+
|
|
109
|
+
beforeConnect() {
|
|
110
|
+
const icon = this.$props.icon;
|
|
111
|
+
this.icon = closest(this.$el, '.uk-nav-primary') ? `${icon}-large` : icon;
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
99
115
|
export const Slidenav = {
|
|
100
116
|
extends: IconComponent,
|
|
101
117
|
|
package/src/js/core/index.js
CHANGED
|
@@ -29,10 +29,12 @@ export { default as Video } from './video';
|
|
|
29
29
|
// Icon components
|
|
30
30
|
export { Close } from './icon';
|
|
31
31
|
export { Spinner } from './icon';
|
|
32
|
+
export { NavParentIcon} from './icon';
|
|
32
33
|
export { Slidenav as SlidenavNext } from './icon';
|
|
33
34
|
export { Slidenav as SlidenavPrevious } from './icon';
|
|
34
35
|
export { Search as SearchIcon } from './icon';
|
|
35
36
|
export { IconComponent as Marker } from './icon';
|
|
37
|
+
export { IconComponent as NavbarParentIcon } from './icon';
|
|
36
38
|
export { IconComponent as NavbarToggleIcon } from './icon';
|
|
37
39
|
export { IconComponent as OverlayIcon } from './icon';
|
|
38
40
|
export { IconComponent as PaginationNext } from './icon';
|
package/src/js/core/navbar.js
CHANGED
|
@@ -124,7 +124,6 @@ export default {
|
|
|
124
124
|
...this.$props,
|
|
125
125
|
boundary: this.boundary,
|
|
126
126
|
pos: this.pos,
|
|
127
|
-
offset: this.dropbar || this.offset,
|
|
128
127
|
}
|
|
129
128
|
);
|
|
130
129
|
},
|
|
@@ -285,8 +284,8 @@ export default {
|
|
|
285
284
|
return this.dropbar;
|
|
286
285
|
},
|
|
287
286
|
|
|
288
|
-
handler(
|
|
289
|
-
if (!
|
|
287
|
+
handler({ target }) {
|
|
288
|
+
if (!this.isDropbarDrop(target)) {
|
|
290
289
|
return;
|
|
291
290
|
}
|
|
292
291
|
|
|
@@ -294,7 +293,7 @@ export default {
|
|
|
294
293
|
after(this.dropbarAnchor || this.$el, this.dropbar);
|
|
295
294
|
}
|
|
296
295
|
|
|
297
|
-
addClass(
|
|
296
|
+
addClass(target, `${this.clsDrop}-dropbar`);
|
|
298
297
|
},
|
|
299
298
|
},
|
|
300
299
|
|
|
@@ -309,22 +308,47 @@ export default {
|
|
|
309
308
|
return this.dropbar;
|
|
310
309
|
},
|
|
311
310
|
|
|
312
|
-
handler(
|
|
313
|
-
if (!
|
|
311
|
+
handler({ target }) {
|
|
312
|
+
if (!this.isDropbarDrop(target)) {
|
|
314
313
|
return;
|
|
315
314
|
}
|
|
316
315
|
|
|
317
|
-
this._observer = observeResize(
|
|
316
|
+
this._observer = observeResize(target, () =>
|
|
318
317
|
this.transitionTo(
|
|
319
|
-
offset(
|
|
318
|
+
offset(target).bottom -
|
|
320
319
|
offset(this.dropbar).top +
|
|
321
|
-
toFloat(css(
|
|
322
|
-
|
|
320
|
+
toFloat(css(target, 'marginBottom')),
|
|
321
|
+
target
|
|
323
322
|
)
|
|
324
323
|
);
|
|
325
324
|
},
|
|
326
325
|
},
|
|
327
326
|
|
|
327
|
+
{
|
|
328
|
+
name: 'beforeposition',
|
|
329
|
+
|
|
330
|
+
el() {
|
|
331
|
+
return this.dropContainer;
|
|
332
|
+
},
|
|
333
|
+
|
|
334
|
+
filter() {
|
|
335
|
+
return this.dropbar;
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
handler(e, element, target, options) {
|
|
339
|
+
if (!this.isDropbarDrop(element)) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const dropbarOffset = offset(this.dropbar);
|
|
344
|
+
|
|
345
|
+
css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
|
|
346
|
+
|
|
347
|
+
options.offset[1] = dropbarOffset.top - offset(target).bottom;
|
|
348
|
+
options.viewportOffset += dropbarOffset.left;
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
|
|
328
352
|
{
|
|
329
353
|
name: 'beforehide',
|
|
330
354
|
|
|
@@ -336,12 +360,12 @@ export default {
|
|
|
336
360
|
return this.dropbar;
|
|
337
361
|
},
|
|
338
362
|
|
|
339
|
-
handler(e
|
|
363
|
+
handler(e) {
|
|
340
364
|
const active = this.getActive();
|
|
341
365
|
|
|
342
366
|
if (
|
|
343
367
|
matches(this.dropbar, ':hover') &&
|
|
344
|
-
active?.$el ===
|
|
368
|
+
active?.$el === e.target &&
|
|
345
369
|
!this.toggles.some((el) => active.target !== el && matches(el, ':focus'))
|
|
346
370
|
) {
|
|
347
371
|
e.preventDefault();
|
|
@@ -360,8 +384,8 @@ export default {
|
|
|
360
384
|
return this.dropbar;
|
|
361
385
|
},
|
|
362
386
|
|
|
363
|
-
handler(
|
|
364
|
-
if (!
|
|
387
|
+
handler({ target }) {
|
|
388
|
+
if (!this.isDropbarDrop(target)) {
|
|
365
389
|
return;
|
|
366
390
|
}
|
|
367
391
|
|
|
@@ -369,7 +393,7 @@ export default {
|
|
|
369
393
|
|
|
370
394
|
const active = this.getActive();
|
|
371
395
|
|
|
372
|
-
if (!active || active?.$el ===
|
|
396
|
+
if (!active || active?.$el === target) {
|
|
373
397
|
this.transitionTo(0);
|
|
374
398
|
}
|
|
375
399
|
},
|
|
@@ -409,6 +433,11 @@ export default {
|
|
|
409
433
|
getDropdown(el) {
|
|
410
434
|
return this.$getComponent(el, 'drop') || this.$getComponent(el, 'dropdown');
|
|
411
435
|
},
|
|
436
|
+
|
|
437
|
+
isDropbarDrop(el) {
|
|
438
|
+
const drop = this.getDropdown(el);
|
|
439
|
+
return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
|
|
440
|
+
},
|
|
412
441
|
},
|
|
413
442
|
};
|
|
414
443
|
|
package/src/js/core/sticky.js
CHANGED
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
remove,
|
|
24
24
|
removeClass,
|
|
25
25
|
replaceClass,
|
|
26
|
-
scrollTop,
|
|
27
26
|
toFloat,
|
|
28
27
|
toggleClass,
|
|
29
28
|
toPx,
|
|
@@ -125,7 +124,9 @@ export default {
|
|
|
125
124
|
},
|
|
126
125
|
|
|
127
126
|
handler() {
|
|
128
|
-
|
|
127
|
+
const { scrollingElement } = document;
|
|
128
|
+
|
|
129
|
+
if (!location.hash || scrollingElement.scrollTop === 0) {
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
132
|
|
|
@@ -134,13 +135,11 @@ export default {
|
|
|
134
135
|
const elOffset = getOffset(this.$el);
|
|
135
136
|
|
|
136
137
|
if (this.isFixed && intersectRect(targetOffset, elOffset)) {
|
|
137
|
-
scrollTop
|
|
138
|
-
window,
|
|
138
|
+
scrollingElement.scrollTop =
|
|
139
139
|
targetOffset.top -
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
);
|
|
140
|
+
elOffset.height -
|
|
141
|
+
toPx(this.targetOffset, 'height', this.placeholder) -
|
|
142
|
+
toPx(this.offset, 'height', this.placeholder);
|
|
144
143
|
}
|
|
145
144
|
});
|
|
146
145
|
},
|
|
@@ -238,7 +237,7 @@ export default {
|
|
|
238
237
|
start,
|
|
239
238
|
end,
|
|
240
239
|
}) {
|
|
241
|
-
const scroll = scrollTop
|
|
240
|
+
const scroll = document.scrollingElement.scrollTop;
|
|
242
241
|
const dir = prevScroll <= scroll ? 'down' : 'up';
|
|
243
242
|
|
|
244
243
|
return {
|
package/src/js/mixin/position.js
CHANGED
|
@@ -6,7 +6,9 @@ import {
|
|
|
6
6
|
includes,
|
|
7
7
|
isRtl,
|
|
8
8
|
positionAt,
|
|
9
|
+
scrollParents,
|
|
9
10
|
toPx,
|
|
11
|
+
trigger,
|
|
10
12
|
} from 'uikit-util';
|
|
11
13
|
|
|
12
14
|
export default {
|
|
@@ -44,17 +46,32 @@ export default {
|
|
|
44
46
|
offset = offset.reverse();
|
|
45
47
|
}
|
|
46
48
|
|
|
49
|
+
const [scrollElement] = scrollParents(element, /auto|scroll/);
|
|
50
|
+
const { scrollTop, scrollLeft } = scrollElement;
|
|
51
|
+
|
|
47
52
|
// Ensure none positioned element does not generate scrollbars
|
|
48
53
|
const elDim = dimensions(element);
|
|
49
54
|
css(element, { top: -elDim.height, left: -elDim.width });
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const args = [
|
|
57
|
+
element,
|
|
58
|
+
target,
|
|
59
|
+
{
|
|
60
|
+
attach,
|
|
61
|
+
offset,
|
|
62
|
+
boundary,
|
|
63
|
+
flip: this.flip,
|
|
64
|
+
viewportOffset: this.getViewportOffset(element),
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
trigger(element, 'beforeposition', args);
|
|
69
|
+
|
|
70
|
+
positionAt(...args);
|
|
71
|
+
|
|
72
|
+
// Restore scroll position
|
|
73
|
+
scrollElement.scrollTop = scrollTop;
|
|
74
|
+
scrollElement.scrollLeft = scrollLeft;
|
|
58
75
|
},
|
|
59
76
|
|
|
60
77
|
getPositionOffset(element) {
|
|
@@ -5,16 +5,18 @@ import {
|
|
|
5
5
|
includes,
|
|
6
6
|
isRtl,
|
|
7
7
|
isTouch,
|
|
8
|
+
noop,
|
|
8
9
|
off,
|
|
9
10
|
on,
|
|
10
|
-
pointerCancel,
|
|
11
|
-
pointerDown,
|
|
12
|
-
pointerMove,
|
|
13
|
-
pointerUp,
|
|
14
11
|
selInput,
|
|
15
12
|
trigger,
|
|
16
13
|
} from 'uikit-util';
|
|
17
14
|
|
|
15
|
+
const pointerOptions = { passive: false, capture: true };
|
|
16
|
+
const pointerDown = 'touchstart mousedown';
|
|
17
|
+
const pointerMove = 'touchmove mousemove';
|
|
18
|
+
const pointerUp = 'touchend touchcancel mouseup click input';
|
|
19
|
+
|
|
18
20
|
export default {
|
|
19
21
|
props: {
|
|
20
22
|
draggable: Boolean,
|
|
@@ -69,6 +71,16 @@ export default {
|
|
|
69
71
|
e.preventDefault();
|
|
70
72
|
},
|
|
71
73
|
},
|
|
74
|
+
|
|
75
|
+
{
|
|
76
|
+
// iOS workaround for slider stopping if swiping fast
|
|
77
|
+
name: `${pointerMove} ${pointerUp}`,
|
|
78
|
+
el() {
|
|
79
|
+
return this.list;
|
|
80
|
+
},
|
|
81
|
+
handler: noop,
|
|
82
|
+
...pointerOptions,
|
|
83
|
+
},
|
|
72
84
|
],
|
|
73
85
|
|
|
74
86
|
methods: {
|
|
@@ -89,10 +101,10 @@ export default {
|
|
|
89
101
|
this.prevIndex = this.index;
|
|
90
102
|
}
|
|
91
103
|
|
|
92
|
-
on(document, pointerMove, this.move,
|
|
104
|
+
on(document, pointerMove, this.move, pointerOptions);
|
|
93
105
|
|
|
94
106
|
// 'input' event is triggered by video controls
|
|
95
|
-
on(document,
|
|
107
|
+
on(document, pointerUp, this.end, pointerOptions);
|
|
96
108
|
|
|
97
109
|
css(this.list, 'userSelect', 'none');
|
|
98
110
|
},
|
|
@@ -172,8 +184,8 @@ export default {
|
|
|
172
184
|
},
|
|
173
185
|
|
|
174
186
|
end() {
|
|
175
|
-
off(document, pointerMove, this.move,
|
|
176
|
-
off(document,
|
|
187
|
+
off(document, pointerMove, this.move, pointerOptions);
|
|
188
|
+
off(document, pointerUp, this.end, pointerOptions);
|
|
177
189
|
|
|
178
190
|
if (this.dragging) {
|
|
179
191
|
this.dragging = null;
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
isFunction,
|
|
11
11
|
isVisible,
|
|
12
12
|
noop,
|
|
13
|
-
offset,
|
|
14
13
|
removeClass,
|
|
15
14
|
scrollParents,
|
|
16
15
|
startsWith,
|
|
@@ -232,7 +231,7 @@ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle },
|
|
|
232
231
|
|
|
233
232
|
Transition.cancel(el);
|
|
234
233
|
|
|
235
|
-
const [scrollElement] = scrollParents(el);
|
|
234
|
+
const [scrollElement] = scrollParents(el.offsetParent);
|
|
236
235
|
css(scrollElement, 'overflowX', 'hidden');
|
|
237
236
|
|
|
238
237
|
if (!isToggled(el)) {
|
|
@@ -243,17 +242,11 @@ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle },
|
|
|
243
242
|
duration = velocity * width + duration;
|
|
244
243
|
|
|
245
244
|
const percent = visible ? ((width + marginLeft * (right ? -1 : 1)) / width) * 100 : 0;
|
|
246
|
-
const offsetEl = offset(el);
|
|
247
|
-
const useClipPath = right
|
|
248
|
-
? offsetEl.right < scrollElement.clientWidth
|
|
249
|
-
: Math.round(offsetEl.left) > 0;
|
|
250
245
|
|
|
251
246
|
css(el, {
|
|
252
|
-
clipPath:
|
|
253
|
-
?
|
|
254
|
-
|
|
255
|
-
: `polygon(${100 - percent}% 0,100% 0,100% 100%,${100 - percent}% 100%)`
|
|
256
|
-
: '',
|
|
247
|
+
clipPath: right
|
|
248
|
+
? `polygon(0 0,${percent}% 0,${percent}% 100%,0 100%)`
|
|
249
|
+
: `polygon(${100 - percent}% 0,100% 0,100% 100%,${100 - percent}% 100%)`,
|
|
257
250
|
marginLeft: (((100 - percent) * (right ? 1 : -1)) / 100) * width,
|
|
258
251
|
});
|
|
259
252
|
|
|
@@ -262,7 +255,7 @@ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle },
|
|
|
262
255
|
? Transition.start(
|
|
263
256
|
el,
|
|
264
257
|
{
|
|
265
|
-
clipPath:
|
|
258
|
+
clipPath: `polygon(0 0,100% 0,100% 100%,0 100%)`,
|
|
266
259
|
marginLeft: 0,
|
|
267
260
|
},
|
|
268
261
|
duration * (1 - percent / 100),
|
|
@@ -271,11 +264,9 @@ function slideHorizontal({ isToggled, duration, velocity, transition, _toggle },
|
|
|
271
264
|
: Transition.start(
|
|
272
265
|
el,
|
|
273
266
|
{
|
|
274
|
-
clipPath:
|
|
275
|
-
?
|
|
276
|
-
|
|
277
|
-
: `polygon(100% 0,100% 0,100% 100%,100% 100%)`
|
|
278
|
-
: '',
|
|
267
|
+
clipPath: right
|
|
268
|
+
? `polygon(0 0,0 0,0 100%,0 100%)`
|
|
269
|
+
: `polygon(100% 0,100% 0,100% 100%,100% 100%)`,
|
|
279
270
|
marginLeft: (right ? 1 : -1) * width,
|
|
280
271
|
},
|
|
281
272
|
duration * (percent / 100),
|
package/src/js/util/position.js
CHANGED
package/src/js/util/viewport.js
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { css } from './style';
|
|
2
2
|
import { isVisible, parents } from './filter';
|
|
3
3
|
import { offset, offsetPosition } from './dimensions';
|
|
4
|
-
import {
|
|
5
|
-
clamp,
|
|
6
|
-
findIndex,
|
|
7
|
-
intersectRect,
|
|
8
|
-
isDocument,
|
|
9
|
-
isUndefined,
|
|
10
|
-
isWindow,
|
|
11
|
-
toFloat,
|
|
12
|
-
toNode,
|
|
13
|
-
toWindow,
|
|
14
|
-
ucfirst,
|
|
15
|
-
} from './lang';
|
|
4
|
+
import { clamp, findIndex, intersectRect, isWindow, toFloat, toWindow, ucfirst } from './lang';
|
|
16
5
|
|
|
17
6
|
export function isInView(element, offsetTop = 0, offsetLeft = 0) {
|
|
18
7
|
if (!isVisible(element)) {
|
|
@@ -35,20 +24,6 @@ export function isInView(element, offsetTop = 0, offsetLeft = 0) {
|
|
|
35
24
|
);
|
|
36
25
|
}
|
|
37
26
|
|
|
38
|
-
export function scrollTop(element, top) {
|
|
39
|
-
if (isWindow(element) || isDocument(element)) {
|
|
40
|
-
element = scrollingElement(element);
|
|
41
|
-
} else {
|
|
42
|
-
element = toNode(element);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (isUndefined(top)) {
|
|
46
|
-
return element.scrollTop;
|
|
47
|
-
} else {
|
|
48
|
-
element.scrollTop = top;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
27
|
export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
|
|
53
28
|
const parents = isVisible(element) ? scrollParents(element) : [];
|
|
54
29
|
return parents.reduce(
|
|
@@ -90,7 +65,7 @@ export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
|
|
|
90
65
|
(function step() {
|
|
91
66
|
const percent = ease(clamp((Date.now() - start) / duration));
|
|
92
67
|
|
|
93
|
-
scrollTop
|
|
68
|
+
element.scrollTop = scroll + top * percent;
|
|
94
69
|
|
|
95
70
|
// scroll more if we have not reached our destination
|
|
96
71
|
if (percent === 1) {
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
@dropdown-background: @global-muted-background;
|
|
26
26
|
@dropdown-color: @global-color;
|
|
27
27
|
|
|
28
|
+
@dropdown-large-padding: 40px;
|
|
29
|
+
|
|
28
30
|
@dropdown-nav-item-color: @global-muted-color;
|
|
29
31
|
@dropdown-nav-item-hover-color: @global-color;
|
|
30
32
|
@dropdown-nav-subtitle-font-size: @global-small-font-size;
|
|
@@ -69,6 +71,12 @@
|
|
|
69
71
|
.uk-dropdown.uk-open { display: block; }
|
|
70
72
|
|
|
71
73
|
|
|
74
|
+
/* Size modifier
|
|
75
|
+
========================================================================== */
|
|
76
|
+
|
|
77
|
+
.uk-dropdown-large { padding: @dropdown-large-padding; }
|
|
78
|
+
|
|
79
|
+
|
|
72
80
|
/* Stretch modifier
|
|
73
81
|
========================================================================== */
|
|
74
82
|
|