uikit 3.15.21 → 3.15.22-dev.1a5585ce3
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 +11 -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 +2 -2
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +2 -2
- package/dist/js/components/lightbox-panel.js +2 -2
- package/dist/js/components/lightbox-panel.min.js +2 -2
- package/dist/js/components/lightbox.js +2 -2
- package/dist/js/components/lightbox.min.js +2 -2
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +2 -2
- package/dist/js/components/parallax.js +1 -1
- package/dist/js/components/parallax.min.js +2 -2
- package/dist/js/components/slider-parallax.js +1 -1
- package/dist/js/components/slider-parallax.min.js +2 -2
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +2 -2
- package/dist/js/components/slideshow-parallax.js +1 -1
- package/dist/js/components/slideshow-parallax.min.js +2 -2
- package/dist/js/components/slideshow.js +1 -1
- package/dist/js/components/slideshow.min.js +2 -2
- package/dist/js/components/sortable.js +2 -2
- package/dist/js/components/sortable.min.js +2 -2
- package/dist/js/components/tooltip.js +4 -3
- package/dist/js/components/tooltip.min.js +2 -2
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +2 -2
- package/dist/js/uikit-core.js +24 -18
- package/dist/js/uikit-core.min.js +2 -2
- package/dist/js/uikit-icons.js +3 -1
- package/dist/js/uikit-icons.min.js +2 -2
- package/dist/js/uikit.js +27 -20
- package/dist/js/uikit.min.js +2 -2
- package/package.json +1 -1
- package/src/images/icons/eye-slash.svg +5 -0
- package/src/images/icons/eye.svg +4 -0
- package/src/js/components/sortable.js +1 -1
- package/src/js/components/tooltip.js +3 -1
- package/src/js/core/accordion.js +1 -1
- package/src/js/core/drop.js +4 -4
- package/src/js/core/height-viewport.js +2 -2
- package/src/js/core/scroll.js +2 -1
- package/src/js/core/scrollspy-nav.js +1 -1
- package/src/js/mixin/modal.js +1 -1
- package/src/js/mixin/position.js +1 -1
- package/src/js/util/position.js +2 -2
- package/src/js/util/viewport.js +19 -6
- package/tests/icon.html +11 -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.15.
|
|
5
|
+
"version": "3.15.22-dev.1a5585ce3",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
|
2
|
+
<path fill="none" stroke="#000" d="m7.56,7.56c.62-.62,1.49-1.01,2.44-1.01,1.91,0,3.45,1.54,3.45,3.45,0,.95-.39,1.82-1.01,2.44" />
|
|
3
|
+
<path fill="none" stroke="#000" d="m19.5,10c-2.4,3.66-5.26,7-9.5,7h0,0,0c-4.24,0-7.1-3.34-9.49-7C2.89,6.34,5.75,3,9.99,3h0,0,0c4.25,0,7.11,3.34,9.5,7Z" />
|
|
4
|
+
<line fill="none" stroke="#000" x1="2.5" y1="2.5" x2="17.5" y2="17.5" />
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
|
2
|
+
<circle fill="none" stroke="#000" cx="10" cy="10" r="3.45" />
|
|
3
|
+
<path fill="none" stroke="#000" d="m19.5,10c-2.4,3.66-5.26,7-9.5,7h0,0,0c-4.24,0-7.1-3.34-9.49-7C2.89,6.34,5.75,3,9.99,3h0,0,0c4.25,0,7.11,3.34,9.5,7Z" />
|
|
4
|
+
</svg>
|
|
@@ -320,7 +320,7 @@ function trackScroll(pos) {
|
|
|
320
320
|
const dist = (Date.now() - last) * 0.3;
|
|
321
321
|
last = Date.now();
|
|
322
322
|
|
|
323
|
-
scrollParents(document.elementFromPoint(x, pos.y)
|
|
323
|
+
scrollParents(document.elementFromPoint(x, pos.y))
|
|
324
324
|
.reverse()
|
|
325
325
|
.some((scrollEl) => {
|
|
326
326
|
let { scrollTop: scroll, scrollHeight } = scrollEl;
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
pointerEnter,
|
|
18
18
|
pointerLeave,
|
|
19
19
|
remove,
|
|
20
|
+
scrollParents,
|
|
20
21
|
within,
|
|
21
22
|
} from 'uikit-util';
|
|
22
23
|
|
|
@@ -95,8 +96,9 @@ export default {
|
|
|
95
96
|
},
|
|
96
97
|
|
|
97
98
|
_show() {
|
|
99
|
+
const [scrollParent] = scrollParents(this.$el);
|
|
98
100
|
this.tooltip = append(
|
|
99
|
-
this.container,
|
|
101
|
+
within(scrollParent, this.container) ? scrollParent : this.container,
|
|
100
102
|
`<div id="${this.id}" class="uk-${this.$options.name}" role="tooltip">
|
|
101
103
|
<div class="uk-${this.$options.name}-inner">${this.title}</div>
|
|
102
104
|
</div>`
|
package/src/js/core/accordion.js
CHANGED
|
@@ -189,7 +189,7 @@ async function transition(el, show, { content, duration, velocity, transition })
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
function keepScrollPosition(el) {
|
|
192
|
-
const [scrollParent] = scrollParents(el,
|
|
192
|
+
const [scrollParent] = scrollParents(el, true);
|
|
193
193
|
let frame;
|
|
194
194
|
(function scroll() {
|
|
195
195
|
frame = requestAnimationFrame(() => {
|
package/src/js/core/drop.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
offsetViewport,
|
|
19
19
|
on,
|
|
20
20
|
once,
|
|
21
|
+
overflowParents,
|
|
21
22
|
parent,
|
|
22
23
|
pointerCancel,
|
|
23
24
|
pointerDown,
|
|
@@ -26,7 +27,6 @@ import {
|
|
|
26
27
|
pointerUp,
|
|
27
28
|
query,
|
|
28
29
|
removeClass,
|
|
29
|
-
scrollParents,
|
|
30
30
|
within,
|
|
31
31
|
} from 'uikit-util';
|
|
32
32
|
import { isSameSiteAnchor, preventBackgroundScroll, preventOverscroll } from '../mixin/modal';
|
|
@@ -296,7 +296,7 @@ export default {
|
|
|
296
296
|
|
|
297
297
|
(() => {
|
|
298
298
|
const observer = observeResize(
|
|
299
|
-
|
|
299
|
+
overflowParents(this.$el).concat(this.target),
|
|
300
300
|
update
|
|
301
301
|
);
|
|
302
302
|
return () => observer.disconnect();
|
|
@@ -304,7 +304,7 @@ export default {
|
|
|
304
304
|
|
|
305
305
|
...(this.autoUpdate
|
|
306
306
|
? [
|
|
307
|
-
on([document,
|
|
307
|
+
on([document, overflowParents(this.$el)], 'scroll', update, {
|
|
308
308
|
passive: true,
|
|
309
309
|
}),
|
|
310
310
|
]
|
|
@@ -498,5 +498,5 @@ function getPositionedElements(el) {
|
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
function getViewport(el, target) {
|
|
501
|
-
return offsetViewport(
|
|
501
|
+
return offsetViewport(overflowParents(target).find((parent) => within(el, parent)));
|
|
502
502
|
}
|
|
@@ -33,7 +33,7 @@ export default {
|
|
|
33
33
|
|
|
34
34
|
resizeTargets() {
|
|
35
35
|
// check for offsetTop change
|
|
36
|
-
return [this.$el, ...scrollParents(this.$el
|
|
36
|
+
return [this.$el, ...scrollParents(this.$el)];
|
|
37
37
|
},
|
|
38
38
|
|
|
39
39
|
update: {
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
const box = boxModelAdjust(this.$el, 'height', 'content-box');
|
|
47
47
|
|
|
48
48
|
const { body, scrollingElement } = document;
|
|
49
|
-
const [scrollElement] = scrollParents(this.$el
|
|
49
|
+
const [scrollElement] = scrollParents(this.$el);
|
|
50
50
|
const { height: viewportHeight } = offsetViewport(
|
|
51
51
|
scrollElement === body ? scrollingElement : scrollElement
|
|
52
52
|
);
|
package/src/js/core/scroll.js
CHANGED
|
@@ -65,6 +65,7 @@ function isSameSiteLink(el) {
|
|
|
65
65
|
|
|
66
66
|
export function getTargetElement(el) {
|
|
67
67
|
if (isSameSiteLink(el)) {
|
|
68
|
-
|
|
68
|
+
const id = decodeURIComponent(el.hash).substring(1);
|
|
69
|
+
return document.getElementById(id) || document.getElementsByName(id)[0];
|
|
69
70
|
}
|
|
70
71
|
}
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const [scrollElement] = scrollParents(targets,
|
|
66
|
+
const [scrollElement] = scrollParents(targets, true);
|
|
67
67
|
const { scrollTop, scrollHeight } = scrollElement;
|
|
68
68
|
const viewport = offsetViewport(scrollElement);
|
|
69
69
|
const max = scrollHeight - viewport.height;
|
package/src/js/mixin/modal.js
CHANGED
package/src/js/mixin/position.js
CHANGED
|
@@ -50,7 +50,7 @@ export default {
|
|
|
50
50
|
placement.reverse();
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const [scrollElement] = scrollParents(element
|
|
53
|
+
const [scrollElement] = scrollParents(element);
|
|
54
54
|
const { scrollTop, scrollLeft } = scrollElement;
|
|
55
55
|
|
|
56
56
|
// Ensure none positioned element does not generate scrollbars
|
package/src/js/util/position.js
CHANGED
|
@@ -2,7 +2,7 @@ import { css } from './style';
|
|
|
2
2
|
import { within } from './filter';
|
|
3
3
|
import { offset } from './dimensions';
|
|
4
4
|
import { clamp, isArray, ucfirst } from './lang';
|
|
5
|
-
import { offsetViewport,
|
|
5
|
+
import { offsetViewport, overflowParents } from './viewport';
|
|
6
6
|
|
|
7
7
|
const dirs = [
|
|
8
8
|
['width', 'x', 'left', 'right'],
|
|
@@ -169,7 +169,7 @@ function getScrollArea(element, target, viewportOffset, i) {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
function commonScrollParents(element, target) {
|
|
172
|
-
return
|
|
172
|
+
return overflowParents(target).filter((parent) => within(element, parent));
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
function getIntersectionArea(...rects) {
|
package/src/js/util/viewport.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { css } from './style';
|
|
2
2
|
import { isVisible, parents } from './filter';
|
|
3
3
|
import { offset, offsetPosition } from './dimensions';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
clamp,
|
|
6
|
+
findIndex,
|
|
7
|
+
includes,
|
|
8
|
+
intersectRect,
|
|
9
|
+
isWindow,
|
|
10
|
+
toFloat,
|
|
11
|
+
toWindow,
|
|
12
|
+
ucfirst,
|
|
13
|
+
} from './lang';
|
|
5
14
|
|
|
6
15
|
export function isInView(element, offsetTop = 0, offsetLeft = 0) {
|
|
7
16
|
if (!isVisible(element)) {
|
|
@@ -9,7 +18,7 @@ export function isInView(element, offsetTop = 0, offsetLeft = 0) {
|
|
|
9
18
|
}
|
|
10
19
|
|
|
11
20
|
return intersectRect(
|
|
12
|
-
...
|
|
21
|
+
...overflowParents(element)
|
|
13
22
|
.map((parent) => {
|
|
14
23
|
const { top, left, bottom, right } = offsetViewport(parent);
|
|
15
24
|
|
|
@@ -25,7 +34,7 @@ export function isInView(element, offsetTop = 0, offsetLeft = 0) {
|
|
|
25
34
|
}
|
|
26
35
|
|
|
27
36
|
export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
|
|
28
|
-
const parents = isVisible(element) ? scrollParents(element,
|
|
37
|
+
const parents = isVisible(element) ? scrollParents(element, false, ['hidden']) : [];
|
|
29
38
|
return parents.reduce(
|
|
30
39
|
(fn, scrollElement, i) => {
|
|
31
40
|
const { scrollTop, scrollHeight, offsetHeight } = scrollElement;
|
|
@@ -91,7 +100,7 @@ export function scrolledOver(element, startOffset = 0, endOffset = 0) {
|
|
|
91
100
|
return 0;
|
|
92
101
|
}
|
|
93
102
|
|
|
94
|
-
const [scrollElement] = scrollParents(element,
|
|
103
|
+
const [scrollElement] = scrollParents(element, true);
|
|
95
104
|
const { scrollHeight, scrollTop } = scrollElement;
|
|
96
105
|
const { height: viewportHeight } = offsetViewport(scrollElement);
|
|
97
106
|
const maxScroll = scrollHeight - viewportHeight;
|
|
@@ -103,7 +112,7 @@ export function scrolledOver(element, startOffset = 0, endOffset = 0) {
|
|
|
103
112
|
return clamp((scrollTop - start) / (end - start));
|
|
104
113
|
}
|
|
105
114
|
|
|
106
|
-
export function scrollParents(element,
|
|
115
|
+
export function scrollParents(element, scrollable = false, props = []) {
|
|
107
116
|
const scrollEl = scrollingElement(element);
|
|
108
117
|
|
|
109
118
|
let ancestors = parents(element).reverse();
|
|
@@ -118,13 +127,17 @@ export function scrollParents(element, overflowRe = /auto|scroll|hidden|clip/, s
|
|
|
118
127
|
.concat(
|
|
119
128
|
ancestors.filter(
|
|
120
129
|
(parent) =>
|
|
121
|
-
|
|
130
|
+
includes(['auto', 'scroll', ...props], css(parent, 'overflow')) &&
|
|
122
131
|
(!scrollable || parent.scrollHeight > offsetViewport(parent).height)
|
|
123
132
|
)
|
|
124
133
|
)
|
|
125
134
|
.reverse();
|
|
126
135
|
}
|
|
127
136
|
|
|
137
|
+
export function overflowParents(element) {
|
|
138
|
+
return scrollParents(element, false, ['hidden', 'clip']);
|
|
139
|
+
}
|
|
140
|
+
|
|
128
141
|
export function offsetViewport(scrollElement) {
|
|
129
142
|
const window = toWindow(scrollElement);
|
|
130
143
|
const {
|
package/tests/icon.html
CHANGED
|
@@ -87,6 +87,8 @@
|
|
|
87
87
|
<li><span class="uk-margin-small-right" uk-icon="icon: trash"></span> trash</li>
|
|
88
88
|
<li><span class="uk-margin-small-right" uk-icon="icon: move"></span> move</li>
|
|
89
89
|
<li><span class="uk-margin-small-right" uk-icon="icon: link"></span> link</li>
|
|
90
|
+
<li><span class="uk-margin-small-right" uk-icon="icon: eye"></span> eye</li>
|
|
91
|
+
<li><span class="uk-margin-small-right" uk-icon="icon: eye-slash"></span> eye-slash</li>
|
|
90
92
|
<li><span class="uk-margin-small-right" uk-icon="icon: question"></span> question</li>
|
|
91
93
|
<li><span class="uk-margin-small-right" uk-icon="icon: info"></span> info</li>
|
|
92
94
|
<li><span class="uk-margin-small-right" uk-icon="icon: warning"></span> warning</li>
|
|
@@ -264,9 +266,11 @@
|
|
|
264
266
|
<li><a class="uk-icon-link" href="#" uk-icon="icon: future"></a></li>
|
|
265
267
|
<li><a class="uk-icon-link" href="#" uk-icon="icon: crosshairs"></a></li>
|
|
266
268
|
<li><a class="uk-icon-link" href="#" uk-icon="icon: pencil"></a></li>
|
|
267
|
-
<li><a class="uk-icon-link" href="#" uk-icon="icon: link"></a></li>
|
|
268
269
|
<li><a class="uk-icon-link" href="#" uk-icon="icon: trash"></a></li>
|
|
269
270
|
<li><a class="uk-icon-link" href="#" uk-icon="icon: move"></a></li>
|
|
271
|
+
<li><a class="uk-icon-link" href="#" uk-icon="icon: link"></a></li>
|
|
272
|
+
<li><a class="uk-icon-link" href="#" uk-icon="icon: eye"></a></li>
|
|
273
|
+
<li><a class="uk-icon-link" href="#" uk-icon="icon: eye-slash"></a></li>
|
|
270
274
|
<li><a class="uk-icon-link" href="#" uk-icon="icon: question"></a></li>
|
|
271
275
|
<li><a class="uk-icon-link" href="#" uk-icon="icon: info"></a></li>
|
|
272
276
|
<li><a class="uk-icon-link" href="#" uk-icon="icon: warning"></a></li>
|
|
@@ -428,9 +432,11 @@
|
|
|
428
432
|
<li><a class="uk-icon-button" href="#" uk-icon="icon: future"></a></li>
|
|
429
433
|
<li><a class="uk-icon-button" href="#" uk-icon="icon: crosshairs"></a></li>
|
|
430
434
|
<li><a class="uk-icon-button" href="#" uk-icon="icon: pencil"></a></li>
|
|
431
|
-
<li><a class="uk-icon-button" href="#" uk-icon="icon: link"></a></li>
|
|
432
435
|
<li><a class="uk-icon-button" href="#" uk-icon="icon: trash"></a></li>
|
|
433
436
|
<li><a class="uk-icon-button" href="#" uk-icon="icon: move"></a></li>
|
|
437
|
+
<li><a class="uk-icon-button" href="#" uk-icon="icon: link"></a></li>
|
|
438
|
+
<li><a class="uk-icon-button" href="#" uk-icon="icon: eye"></a></li>
|
|
439
|
+
<li><a class="uk-icon-button" href="#" uk-icon="icon: eye-slash"></a></li>
|
|
434
440
|
<li><a class="uk-icon-button" href="#" uk-icon="icon: question"></a></li>
|
|
435
441
|
<li><a class="uk-icon-button" href="#" uk-icon="icon: info"></a></li>
|
|
436
442
|
<li><a class="uk-icon-button" href="#" uk-icon="icon: warning"></a></li>
|
|
@@ -590,9 +596,11 @@
|
|
|
590
596
|
<li><span uk-icon="ratio: 2; icon: future"></span></li>
|
|
591
597
|
<li><span uk-icon="ratio: 2; icon: crosshairs"></span></li>
|
|
592
598
|
<li><span uk-icon="ratio: 2; icon: pencil"></span></li>
|
|
593
|
-
<li><span uk-icon="ratio: 2; icon: link"></span></li>
|
|
594
599
|
<li><span uk-icon="ratio: 2; icon: trash"></span></li>
|
|
595
600
|
<li><span uk-icon="ratio: 2; icon: move"></span></li>
|
|
601
|
+
<li><span uk-icon="ratio: 2; icon: link"></span></li>
|
|
602
|
+
<li><span uk-icon="ratio: 2; icon: eye"></span></li>
|
|
603
|
+
<li><span uk-icon="ratio: 2; icon: eye-slash"></span></li>
|
|
596
604
|
<li><span uk-icon="ratio: 2; icon: question"></span></li>
|
|
597
605
|
<li><span uk-icon="ratio: 2; icon: info"></span></li>
|
|
598
606
|
<li><span uk-icon="ratio: 2; icon: warning"></span></li>
|