uikit 3.12.3-dev.ebebb4f57 → 3.13.0
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 +7 -4
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +7 -4
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +7 -4
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +7 -4
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +3 -3
- 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 +11 -2
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +13 -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 +61 -10
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +28 -15
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +12 -3
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +28 -15
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +11 -2
- 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 +12 -20
- 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 +360 -365
- 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 +376 -379
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/hooks.js +3 -3
- package/src/js/api/state.js +14 -39
- package/src/js/components/countdown.js +2 -2
- package/src/js/components/lightbox.js +1 -1
- package/src/js/components/parallax.js +3 -1
- package/src/js/components/slider-parallax.js +6 -4
- package/src/js/components/slider.js +1 -1
- package/src/js/core/accordion.js +6 -3
- package/src/js/core/core.js +2 -17
- package/src/js/core/cover.js +3 -6
- package/src/js/core/drop.js +15 -33
- package/src/js/core/form-custom.js +8 -9
- package/src/js/core/grid.js +2 -1
- package/src/js/core/height-match.js +12 -2
- package/src/js/core/height-viewport.js +8 -7
- package/src/js/core/icon.js +9 -16
- package/src/js/core/img.js +5 -16
- package/src/js/core/index.js +0 -1
- package/src/js/core/leader.js +7 -13
- package/src/js/core/margin.js +16 -1
- package/src/js/core/overflow-auto.js +7 -10
- package/src/js/core/responsive.js +7 -0
- package/src/js/core/scroll.js +6 -2
- package/src/js/core/scrollspy-nav.js +19 -16
- package/src/js/core/scrollspy.js +5 -11
- package/src/js/core/sticky.js +22 -31
- package/src/js/core/svg.js +16 -14
- package/src/js/core/switcher.js +4 -0
- package/src/js/core/toggle.js +28 -20
- package/src/js/core/video.js +2 -8
- package/src/js/mixin/media.js +28 -8
- package/src/js/mixin/parallax.js +2 -1
- package/src/js/mixin/position.js +10 -18
- package/src/js/mixin/resize.js +11 -0
- package/src/js/mixin/scroll.js +32 -0
- package/src/js/mixin/slider.js +2 -1
- package/src/js/util/class.js +1 -6
- package/src/js/util/mouse.js +1 -1
- package/src/js/util/observer.js +57 -20
- package/src/js/util/selector.js +24 -23
- package/src/less/components/modal.less +6 -3
- package/src/scss/components/modal.scss +6 -3
- package/tests/grid.html +9 -9
- package/tests/js/index.js +1 -1
- package/tests/slider.html +1 -1
- package/tests/slideshow.html +1 -1
- package/tests/sticky.html +0 -6
- package/src/js/core/gif.js +0 -22
package/src/js/mixin/slider.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Resize from './resize';
|
|
1
2
|
import SliderAutoplay from './slider-autoplay';
|
|
2
3
|
import SliderDrag from './slider-drag';
|
|
3
4
|
import SliderNav from './slider-nav';
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
} from 'uikit-util';
|
|
16
17
|
|
|
17
18
|
export default {
|
|
18
|
-
mixins: [SliderAutoplay, SliderDrag, SliderNav],
|
|
19
|
+
mixins: [SliderAutoplay, SliderDrag, SliderNav, Resize],
|
|
19
20
|
|
|
20
21
|
props: {
|
|
21
22
|
clsActivated: Boolean,
|
package/src/js/util/class.js
CHANGED
|
@@ -20,12 +20,7 @@ export function replaceClass(element, ...args) {
|
|
|
20
20
|
|
|
21
21
|
export function hasClass(element, cls) {
|
|
22
22
|
[cls] = getClasses(cls);
|
|
23
|
-
|
|
24
|
-
if (cls && node.classList.contains(cls)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
23
|
+
return !!cls && toNodes(element).some((node) => node.classList.contains(cls));
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
export function toggleClass(element, cls, force) {
|
package/src/js/util/mouse.js
CHANGED
package/src/js/util/observer.js
CHANGED
|
@@ -1,33 +1,70 @@
|
|
|
1
|
+
import { on } from './event';
|
|
1
2
|
import { toNodes } from './lang';
|
|
3
|
+
import { fastdom } from './fastdom';
|
|
2
4
|
|
|
3
|
-
// Old chromium based browsers (UC Browser) did not implement `isIntersecting`
|
|
4
|
-
export const hasIntersectionObserver =
|
|
5
|
-
window.IntersectionObserver && 'isIntersecting' in IntersectionObserverEntry.prototype;
|
|
6
5
|
export function observeIntersection(targets, cb, options, intersecting = true) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return observer;
|
|
6
|
+
return observe(
|
|
7
|
+
IntersectionObserver,
|
|
8
|
+
targets,
|
|
9
|
+
intersecting
|
|
10
|
+
? (entries, observer) => {
|
|
11
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
12
|
+
cb(entries, observer);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
: cb,
|
|
16
|
+
options
|
|
17
|
+
);
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
const hasResizeObserver = window.ResizeObserver;
|
|
23
21
|
export function observeResize(targets, cb, options = { box: 'border-box' }) {
|
|
24
|
-
if (
|
|
22
|
+
if (hasResizeObserver) {
|
|
23
|
+
return observe(ResizeObserver, targets, cb, options);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Fallback Safari < 13.1
|
|
27
|
+
initResizeListener();
|
|
28
|
+
listeners.add(cb);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
disconnect() {
|
|
32
|
+
listeners.delete(cb);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let listeners;
|
|
38
|
+
function initResizeListener() {
|
|
39
|
+
if (listeners) {
|
|
25
40
|
return;
|
|
26
41
|
}
|
|
27
42
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
listeners = new Set();
|
|
44
|
+
|
|
45
|
+
// throttle 'resize'
|
|
46
|
+
let pendingResize;
|
|
47
|
+
const handleResize = () => {
|
|
48
|
+
if (pendingResize) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
pendingResize = true;
|
|
52
|
+
fastdom.read(() => (pendingResize = false));
|
|
53
|
+
for (const listener of listeners) {
|
|
54
|
+
listener();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
on(window, 'load resize', handleResize);
|
|
59
|
+
on(document, 'loadedmetadata load', handleResize, true);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function observeMutation(targets, cb, options) {
|
|
63
|
+
return observe(MutationObserver, targets, cb, options);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function observe(Observer, targets, cb, options) {
|
|
67
|
+
const observer = new Observer(cb);
|
|
31
68
|
for (const el of toNodes(targets)) {
|
|
32
69
|
observer.observe(el, options);
|
|
33
70
|
}
|
package/src/js/util/selector.js
CHANGED
|
@@ -28,40 +28,41 @@ function getContext(selector, context = document) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
|
|
31
|
+
const sanatize = memoize((selector) => selector.replace(contextSanitizeRe, '$1 *'));
|
|
31
32
|
|
|
32
33
|
function _query(selector, context = document, queryFn) {
|
|
33
34
|
if (!selector || !isString(selector)) {
|
|
34
35
|
return selector;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
selector = selector
|
|
38
|
+
selector = sanatize(selector);
|
|
38
39
|
|
|
39
40
|
if (isContextSelector(selector)) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const selectors = selector.substr(1).trim().split(' ');
|
|
52
|
-
const prev = (ctx || context).previousElementSibling;
|
|
53
|
-
ctx = matches(prev, selector.substr(1)) ? prev : null;
|
|
54
|
-
selector = selectors.slice(1).join(' ');
|
|
41
|
+
const split = splitSelector(selector);
|
|
42
|
+
selector = '';
|
|
43
|
+
for (let sel of split) {
|
|
44
|
+
let ctx = context;
|
|
45
|
+
|
|
46
|
+
if (sel[0] === '!') {
|
|
47
|
+
const selectors = sel.substr(1).trim().split(' ');
|
|
48
|
+
ctx = closest(parent(context), selectors[0]);
|
|
49
|
+
sel = selectors.slice(1).join(' ').trim();
|
|
50
|
+
if (!sel.length && split.length === 1) {
|
|
51
|
+
return ctx;
|
|
55
52
|
}
|
|
53
|
+
}
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
if (sel[0] === '-') {
|
|
56
|
+
const selectors = sel.substr(1).trim().split(' ');
|
|
57
|
+
const prev = (ctx || context).previousElementSibling;
|
|
58
|
+
ctx = matches(prev, sel.substr(1)) ? prev : null;
|
|
59
|
+
sel = selectors.slice(1).join(' ');
|
|
60
|
+
}
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
if (ctx) {
|
|
63
|
+
selector += `${selector ? ',' : ''}${domPath(ctx)} ${sel}`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
65
66
|
|
|
66
67
|
context = document;
|
|
67
68
|
}
|
|
@@ -139,8 +139,9 @@
|
|
|
139
139
|
/*
|
|
140
140
|
* 1. Create position context for spinner and close button
|
|
141
141
|
* 2. Dimensions
|
|
142
|
-
* 3.
|
|
143
|
-
* 4.
|
|
142
|
+
* 3. `!important` is needed to overwrite `uk-width-auto`. See `#modal-media-image` in tests
|
|
143
|
+
* 4. Style
|
|
144
|
+
* 5. Slide-in transition
|
|
144
145
|
*/
|
|
145
146
|
|
|
146
147
|
.uk-modal-dialog {
|
|
@@ -151,8 +152,10 @@
|
|
|
151
152
|
margin: 0 auto;
|
|
152
153
|
width: @modal-dialog-width;
|
|
153
154
|
/* 3 */
|
|
154
|
-
|
|
155
|
+
max-width: 100% !important;
|
|
155
156
|
/* 4 */
|
|
157
|
+
background: @modal-dialog-background;
|
|
158
|
+
/* 5 */
|
|
156
159
|
opacity: 0;
|
|
157
160
|
transform: translateY(-100px);
|
|
158
161
|
transition: 0.3s linear;
|
|
@@ -139,8 +139,9 @@ $modal-close-outside-hover-color: $global-inverse-color !default;
|
|
|
139
139
|
/*
|
|
140
140
|
* 1. Create position context for spinner and close button
|
|
141
141
|
* 2. Dimensions
|
|
142
|
-
* 3.
|
|
143
|
-
* 4.
|
|
142
|
+
* 3. `!important` is needed to overwrite `uk-width-auto`. See `#modal-media-image` in tests
|
|
143
|
+
* 4. Style
|
|
144
|
+
* 5. Slide-in transition
|
|
144
145
|
*/
|
|
145
146
|
|
|
146
147
|
.uk-modal-dialog {
|
|
@@ -151,8 +152,10 @@ $modal-close-outside-hover-color: $global-inverse-color !default;
|
|
|
151
152
|
margin: 0 auto;
|
|
152
153
|
width: $modal-dialog-width;
|
|
153
154
|
/* 3 */
|
|
154
|
-
|
|
155
|
+
max-width: 100% !important;
|
|
155
156
|
/* 4 */
|
|
157
|
+
background: $modal-dialog-background;
|
|
158
|
+
/* 5 */
|
|
156
159
|
opacity: 0;
|
|
157
160
|
transform: translateY(-100px);
|
|
158
161
|
transition: 0.3s linear;
|
package/tests/grid.html
CHANGED
|
@@ -508,15 +508,15 @@
|
|
|
508
508
|
<h3>Medium / Small</h3>
|
|
509
509
|
|
|
510
510
|
<div class="uk-grid-divider uk-grid-column-medium uk-grid-row-small uk-child-width-1-4@m" uk-grid>
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
511
|
+
<div><div class="uk-panel">1-4-M</div></div>
|
|
512
|
+
<div><div class="uk-panel">1-4-M</div></div>
|
|
513
|
+
<div><div class="uk-panel">1-4-M</div></div>
|
|
514
|
+
<div><div class="uk-panel">1-4-M</div></div>
|
|
515
|
+
<div><div class="uk-panel">1-4-M</div></div>
|
|
516
|
+
<div><div class="uk-panel">1-4-M</div></div>
|
|
517
|
+
<div><div class="uk-panel">1-4-M</div></div>
|
|
518
|
+
<div><div class="uk-panel">1-4-M</div></div>
|
|
519
|
+
</div>
|
|
520
520
|
|
|
521
521
|
<h2>Divider</h2>
|
|
522
522
|
|
package/tests/js/index.js
CHANGED
package/tests/slider.html
CHANGED
package/tests/slideshow.html
CHANGED
package/tests/sticky.html
CHANGED
|
@@ -143,12 +143,6 @@
|
|
|
143
143
|
<td>self</td>
|
|
144
144
|
<td>The target element to apply active and inactive classes to. Defaults to the element itself.</td>
|
|
145
145
|
</tr>
|
|
146
|
-
<tr>
|
|
147
|
-
<td><code>width-element</code></td>
|
|
148
|
-
<td>CSS Selector</td>
|
|
149
|
-
<td>false</td>
|
|
150
|
-
<td>The element the Sticky should get its width from in active mode.</td>
|
|
151
|
-
</tr>
|
|
152
146
|
<tr>
|
|
153
147
|
<td><code>show-on-up</code></td>
|
|
154
148
|
<td>Boolean</td>
|
package/src/js/core/gif.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { isInView } from 'uikit-util';
|
|
2
|
-
|
|
3
|
-
// Deprecated
|
|
4
|
-
export default {
|
|
5
|
-
update: {
|
|
6
|
-
read(data) {
|
|
7
|
-
const inview = isInView(this.$el);
|
|
8
|
-
|
|
9
|
-
if (!inview || data.isInView === inview) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
data.isInView = inview;
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
write() {
|
|
17
|
-
this.$el.src = '' + this.$el.src; // force self-assign
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
events: ['scroll', 'resize'],
|
|
21
|
-
},
|
|
22
|
-
};
|