uikit 3.13.9 → 3.13.11-dev.98491b3f4
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 +34 -1
- package/build/build.js +4 -1
- package/dist/css/uikit-core-rtl.css +41 -6
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +41 -6
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +41 -4
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +41 -4
- 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 +7 -3
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +7 -3
- 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 +18 -11
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +18 -11
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +18 -11
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- 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 +62 -30
- 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 +328 -260
- 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 +371 -266
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/sortable.js +2 -3
- package/src/js/components/tooltip.js +38 -3
- package/src/js/core/drop.js +20 -16
- package/src/js/core/navbar.js +18 -6
- package/src/js/core/scrollspy-nav.js +4 -9
- package/src/js/core/sticky.js +28 -16
- package/src/js/core/toggle.js +8 -8
- package/src/js/mixin/media.js +12 -9
- package/src/js/mixin/modal.js +6 -2
- package/src/js/mixin/parallax.js +5 -1
- package/src/js/mixin/position.js +24 -24
- package/src/js/uikit-core.js +0 -4
- package/src/js/util/lang.js +0 -4
- package/src/js/util/position.js +180 -125
- package/src/js/util/viewport.js +42 -22
- package/src/less/components/drop.less +0 -1
- package/src/less/components/dropdown.less +11 -1
- package/src/less/components/icon.less +3 -0
- package/src/less/components/nav.less +22 -0
- package/src/less/components/navbar.less +26 -2
- package/src/less/components/search.less +2 -0
- package/src/less/theme/dropdown.less +4 -0
- package/src/less/theme/nav.less +6 -0
- package/src/less/theme/navbar.less +4 -0
- package/src/less/theme/search.less +6 -0
- package/src/scss/components/drop.scss +0 -1
- package/src/scss/components/dropdown.scss +11 -1
- package/src/scss/components/icon.scss +3 -0
- package/src/scss/components/nav.scss +22 -0
- package/src/scss/components/navbar.scss +26 -2
- package/src/scss/components/search.scss +2 -0
- package/src/scss/mixins-theme.scss +5 -0
- package/src/scss/mixins.scss +5 -0
- package/src/scss/theme/dropdown.scss +4 -0
- package/src/scss/theme/nav.scss +6 -0
- package/src/scss/theme/navbar.scss +4 -0
- package/src/scss/theme/search.scss +6 -0
- package/src/scss/variables-theme.scss +5 -1
- package/src/scss/variables.scss +5 -1
- package/tests/animation.html +216 -214
- package/tests/dropdown.html +16 -2
- package/tests/nav.html +27 -0
- package/tests/navbar.html +55 -4
- package/tests/position.html +38 -39
- package/tests/sticky-parallax.html +16 -0
- package/tests/sticky.html +212 -36
- package/src/js/core/core.js +0 -25
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.13.
|
|
5
|
+
"version": "3.13.11-dev.98491b3f4",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -10,14 +10,13 @@ import {
|
|
|
10
10
|
css,
|
|
11
11
|
findIndex,
|
|
12
12
|
getEventPos,
|
|
13
|
-
getViewport,
|
|
14
13
|
hasTouch,
|
|
15
14
|
height,
|
|
16
15
|
index,
|
|
17
16
|
isEmpty,
|
|
18
17
|
isInput,
|
|
19
18
|
off,
|
|
20
|
-
|
|
19
|
+
offsetViewport,
|
|
21
20
|
on,
|
|
22
21
|
parent,
|
|
23
22
|
pointerDown,
|
|
@@ -324,7 +323,7 @@ function trackScroll(pos) {
|
|
|
324
323
|
.some((scrollEl) => {
|
|
325
324
|
let { scrollTop: scroll, scrollHeight } = scrollEl;
|
|
326
325
|
|
|
327
|
-
const { top, bottom, height } =
|
|
326
|
+
const { top, bottom, height } = offsetViewport(scrollEl);
|
|
328
327
|
|
|
329
328
|
if (top < y && top + 35 > y) {
|
|
330
329
|
scroll -= dist;
|
|
@@ -6,9 +6,11 @@ import {
|
|
|
6
6
|
attr,
|
|
7
7
|
flipPosition,
|
|
8
8
|
hasAttr,
|
|
9
|
+
includes,
|
|
9
10
|
isFocusable,
|
|
10
11
|
isTouch,
|
|
11
12
|
matches,
|
|
13
|
+
offset,
|
|
12
14
|
on,
|
|
13
15
|
once,
|
|
14
16
|
pointerDown,
|
|
@@ -104,10 +106,12 @@ export default {
|
|
|
104
106
|
|
|
105
107
|
this.positionAt(this.tooltip, this.$el);
|
|
106
108
|
|
|
109
|
+
const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);
|
|
110
|
+
|
|
107
111
|
this.origin =
|
|
108
|
-
this.
|
|
109
|
-
? `${flipPosition(
|
|
110
|
-
: `${
|
|
112
|
+
this.axis === 'y'
|
|
113
|
+
? `${flipPosition(dir)}-${align}`
|
|
114
|
+
: `${align}-${flipPosition(dir)}`;
|
|
111
115
|
});
|
|
112
116
|
|
|
113
117
|
this.toggleElement(this.tooltip, true);
|
|
@@ -143,3 +147,34 @@ function makeFocusable(el) {
|
|
|
143
147
|
attr(el, 'tabindex', '0');
|
|
144
148
|
}
|
|
145
149
|
}
|
|
150
|
+
|
|
151
|
+
function getAlignment(el, target, [dir, align]) {
|
|
152
|
+
const elOffset = offset(el);
|
|
153
|
+
const targetOffset = offset(target);
|
|
154
|
+
const properties = [
|
|
155
|
+
['left', 'right'],
|
|
156
|
+
['top', 'bottom'],
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
for (const props of properties) {
|
|
160
|
+
if (elOffset[props[0]] >= targetOffset[props[1]]) {
|
|
161
|
+
dir = props[1];
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
if (elOffset[props[1]] <= targetOffset[props[0]]) {
|
|
165
|
+
dir = props[0];
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const props = includes(properties[0], dir) ? properties[1] : properties[0];
|
|
171
|
+
if (elOffset[props[0]] === targetOffset[props[0]]) {
|
|
172
|
+
align = props[0];
|
|
173
|
+
} else if (elOffset[props[1]] === targetOffset[props[1]]) {
|
|
174
|
+
align = props[1];
|
|
175
|
+
} else {
|
|
176
|
+
align = 'center';
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return [dir, align];
|
|
180
|
+
}
|
package/src/js/core/drop.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
matches,
|
|
15
15
|
MouseTracker,
|
|
16
16
|
offset,
|
|
17
|
+
offsetViewport,
|
|
17
18
|
on,
|
|
18
19
|
once,
|
|
19
20
|
parent,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
pointerUp,
|
|
25
26
|
query,
|
|
26
27
|
removeClass,
|
|
28
|
+
scrollParents,
|
|
27
29
|
toggleClass,
|
|
28
30
|
within,
|
|
29
31
|
} from 'uikit-util';
|
|
@@ -243,12 +245,6 @@ export default {
|
|
|
243
245
|
}
|
|
244
246
|
}),
|
|
245
247
|
on(window, 'resize', () => this.$emit()),
|
|
246
|
-
on(
|
|
247
|
-
document,
|
|
248
|
-
'scroll',
|
|
249
|
-
({ target }) => target.contains(this.$el) && this.$emit(),
|
|
250
|
-
true
|
|
251
|
-
),
|
|
252
248
|
]) {
|
|
253
249
|
once(this.$el, 'hide', handler, { self: true });
|
|
254
250
|
}
|
|
@@ -359,25 +355,33 @@ export default {
|
|
|
359
355
|
},
|
|
360
356
|
|
|
361
357
|
position() {
|
|
362
|
-
const boundary = query(this.boundary, this.$el) || window;
|
|
363
358
|
removeClass(this.$el, `${this.clsDrop}-stack`);
|
|
364
359
|
toggleClass(this.$el, `${this.clsDrop}-boundary`, this.boundaryAlign);
|
|
365
360
|
|
|
366
|
-
const
|
|
367
|
-
const
|
|
368
|
-
const
|
|
361
|
+
const boundary = query(this.boundary, this.$el);
|
|
362
|
+
const [scrollParent] = scrollParents(this.$el);
|
|
363
|
+
const scrollParentOffset = offsetViewport(scrollParent);
|
|
364
|
+
const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
|
|
365
|
+
|
|
366
|
+
css(this.$el, 'maxWidth', '');
|
|
367
|
+
const maxWidth = scrollParentOffset.width - (boundary ? 0 : 2 * this.viewportPadding);
|
|
369
368
|
|
|
370
369
|
if (this.pos[1] === 'justify') {
|
|
371
|
-
const prop = this.
|
|
370
|
+
const prop = this.axis === 'y' ? 'width' : 'height';
|
|
371
|
+
const targetOffset = offset(this.target);
|
|
372
|
+
const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
|
|
372
373
|
css(this.$el, prop, alignTo[prop]);
|
|
373
|
-
} else if (
|
|
374
|
-
this.$el.offsetWidth >
|
|
375
|
-
Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left)
|
|
376
|
-
) {
|
|
374
|
+
} else if (this.$el.offsetWidth > maxWidth) {
|
|
377
375
|
addClass(this.$el, `${this.clsDrop}-stack`);
|
|
378
376
|
}
|
|
379
377
|
|
|
380
|
-
|
|
378
|
+
css(this.$el, 'maxWidth', maxWidth);
|
|
379
|
+
|
|
380
|
+
this.positionAt(
|
|
381
|
+
this.$el,
|
|
382
|
+
boundary && this.boundaryAlign ? boundary : this.target,
|
|
383
|
+
boundary
|
|
384
|
+
);
|
|
381
385
|
},
|
|
382
386
|
},
|
|
383
387
|
};
|
package/src/js/core/navbar.js
CHANGED
|
@@ -27,8 +27,6 @@ import {
|
|
|
27
27
|
within,
|
|
28
28
|
} from 'uikit-util';
|
|
29
29
|
|
|
30
|
-
const navItem = '.uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle';
|
|
31
|
-
|
|
32
30
|
export default {
|
|
33
31
|
mixins: [Class, Container],
|
|
34
32
|
|
|
@@ -48,7 +46,7 @@ export default {
|
|
|
48
46
|
},
|
|
49
47
|
|
|
50
48
|
data: {
|
|
51
|
-
dropdown:
|
|
49
|
+
dropdown: '.uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle',
|
|
52
50
|
align: isRtl ? 'right' : 'left',
|
|
53
51
|
clsDrop: 'uk-navbar-dropdown',
|
|
54
52
|
mode: undefined,
|
|
@@ -134,8 +132,22 @@ export default {
|
|
|
134
132
|
immediate: true,
|
|
135
133
|
},
|
|
136
134
|
|
|
137
|
-
toggles
|
|
138
|
-
|
|
135
|
+
toggles: {
|
|
136
|
+
get({ dropdown }, $el) {
|
|
137
|
+
return $$(dropdown, $el);
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
watch() {
|
|
141
|
+
const justify = hasClass(this.$el, 'uk-navbar-justify');
|
|
142
|
+
for (const container of $$(
|
|
143
|
+
'.uk-navbar-nav, .uk-navbar-left, .uk-navbar-right',
|
|
144
|
+
this.$el
|
|
145
|
+
)) {
|
|
146
|
+
css(container, 'flexGrow', justify ? $$(this.dropdown, container).length : '');
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
immediate: true,
|
|
139
151
|
},
|
|
140
152
|
},
|
|
141
153
|
|
|
@@ -297,7 +309,7 @@ export default {
|
|
|
297
309
|
return this.dropbar;
|
|
298
310
|
},
|
|
299
311
|
|
|
300
|
-
handler(_, { $el, dir }) {
|
|
312
|
+
handler(_, { $el, pos: [dir] = [] }) {
|
|
301
313
|
if (!hasClass($el, this.clsDrop)) {
|
|
302
314
|
return;
|
|
303
315
|
}
|
|
@@ -2,11 +2,10 @@ import Scroll from '../mixin/scroll';
|
|
|
2
2
|
import {
|
|
3
3
|
$$,
|
|
4
4
|
closest,
|
|
5
|
-
getViewport,
|
|
6
|
-
getViewportClientHeight,
|
|
7
5
|
hasClass,
|
|
8
6
|
isVisible,
|
|
9
7
|
offset,
|
|
8
|
+
offsetViewport,
|
|
10
9
|
scrollParents,
|
|
11
10
|
toggleClass,
|
|
12
11
|
trigger,
|
|
@@ -65,19 +64,15 @@ export default {
|
|
|
65
64
|
|
|
66
65
|
const [scrollElement] = scrollParents(targets, /auto|scroll/, true);
|
|
67
66
|
const { scrollTop, scrollHeight } = scrollElement;
|
|
68
|
-
const
|
|
67
|
+
const viewport = offsetViewport(scrollElement);
|
|
68
|
+
const max = scrollHeight - viewport.height;
|
|
69
69
|
let active = false;
|
|
70
70
|
|
|
71
71
|
if (scrollTop === max) {
|
|
72
72
|
active = length - 1;
|
|
73
73
|
} else {
|
|
74
74
|
for (const i in targets) {
|
|
75
|
-
if (
|
|
76
|
-
offset(targets[i]).top -
|
|
77
|
-
offset(getViewport(scrollElement)).top -
|
|
78
|
-
this.offset >
|
|
79
|
-
0
|
|
80
|
-
) {
|
|
75
|
+
if (offset(targets[i]).top - viewport.top - this.offset > 0) {
|
|
81
76
|
break;
|
|
82
77
|
}
|
|
83
78
|
active = +i;
|
package/src/js/core/sticky.js
CHANGED
|
@@ -10,11 +10,10 @@ import {
|
|
|
10
10
|
clamp,
|
|
11
11
|
css,
|
|
12
12
|
dimensions,
|
|
13
|
-
fastdom,
|
|
14
13
|
height as getHeight,
|
|
15
14
|
offset as getOffset,
|
|
16
|
-
getScrollingElement,
|
|
17
15
|
intersectRect,
|
|
16
|
+
isNumeric,
|
|
18
17
|
isString,
|
|
19
18
|
isVisible,
|
|
20
19
|
noop,
|
|
@@ -37,8 +36,10 @@ export default {
|
|
|
37
36
|
|
|
38
37
|
props: {
|
|
39
38
|
position: String,
|
|
40
|
-
top:
|
|
39
|
+
top: Boolean,
|
|
41
40
|
bottom: Boolean,
|
|
41
|
+
start: Boolean,
|
|
42
|
+
end: Boolean,
|
|
42
43
|
offset: String,
|
|
43
44
|
animation: String,
|
|
44
45
|
clsActive: String,
|
|
@@ -52,8 +53,10 @@ export default {
|
|
|
52
53
|
|
|
53
54
|
data: {
|
|
54
55
|
position: 'top',
|
|
55
|
-
top:
|
|
56
|
+
top: false,
|
|
56
57
|
bottom: false,
|
|
58
|
+
start: false,
|
|
59
|
+
end: false,
|
|
57
60
|
offset: 0,
|
|
58
61
|
animation: '',
|
|
59
62
|
clsActive: 'uk-active',
|
|
@@ -76,6 +79,9 @@ export default {
|
|
|
76
79
|
},
|
|
77
80
|
|
|
78
81
|
connected() {
|
|
82
|
+
this.start = this.start || this.top;
|
|
83
|
+
this.end = this.end || this.bottom;
|
|
84
|
+
|
|
79
85
|
this.placeholder =
|
|
80
86
|
$('+ .uk-sticky-placeholder', this.$el) ||
|
|
81
87
|
$('<div class="uk-sticky-placeholder"></div>');
|
|
@@ -110,7 +116,7 @@ export default {
|
|
|
110
116
|
return;
|
|
111
117
|
}
|
|
112
118
|
|
|
113
|
-
|
|
119
|
+
setTimeout(() => {
|
|
114
120
|
const targetOffset = getOffset($(location.hash));
|
|
115
121
|
const elOffset = getOffset(this.$el);
|
|
116
122
|
|
|
@@ -150,7 +156,7 @@ export default {
|
|
|
150
156
|
|
|
151
157
|
if (hide) {
|
|
152
158
|
this.show();
|
|
153
|
-
|
|
159
|
+
requestAnimationFrame(() => css(this.selTarget, 'transition', ''));
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
const referenceElement = this.isFixed ? this.placeholder : this.$el;
|
|
@@ -169,13 +175,17 @@ export default {
|
|
|
169
175
|
const overflow = Math.max(0, height + offset - windowHeight);
|
|
170
176
|
const topOffset = getOffset(referenceElement).top;
|
|
171
177
|
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const end =
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
const start =
|
|
179
|
+
(this.start === false
|
|
180
|
+
? topOffset
|
|
181
|
+
: parseProp(this.start, this.$el, topOffset)) - offset;
|
|
182
|
+
const end =
|
|
183
|
+
this.end === false
|
|
184
|
+
? document.scrollingElement.scrollHeight - windowHeight
|
|
185
|
+
: parseProp(this.end, this.$el, topOffset + height, true) -
|
|
186
|
+
getOffset(this.$el).height +
|
|
187
|
+
overflow -
|
|
188
|
+
offset;
|
|
179
189
|
|
|
180
190
|
return {
|
|
181
191
|
start,
|
|
@@ -221,7 +231,9 @@ export default {
|
|
|
221
231
|
prevDir,
|
|
222
232
|
scroll,
|
|
223
233
|
prevScroll,
|
|
224
|
-
offsetParentTop: getOffset(
|
|
234
|
+
offsetParentTop: getOffset(
|
|
235
|
+
(this.isFixed ? this.placeholder : this.$el).offsetParent
|
|
236
|
+
).top,
|
|
225
237
|
overflowScroll: clamp(
|
|
226
238
|
overflowScroll + clamp(scroll, start, end) - clamp(prevScroll, start, end),
|
|
227
239
|
0,
|
|
@@ -376,8 +388,8 @@ function parseProp(value, el, propOffset, padding) {
|
|
|
376
388
|
return 0;
|
|
377
389
|
}
|
|
378
390
|
|
|
379
|
-
if (isString(value) && value.match(/^-?\d/)) {
|
|
380
|
-
return propOffset + toPx(value);
|
|
391
|
+
if (isNumeric(value) || (isString(value) && value.match(/^-?\d/))) {
|
|
392
|
+
return propOffset + toPx(value, 'height', el, true);
|
|
381
393
|
} else {
|
|
382
394
|
const refElement = value === true ? parent(el) : query(value, el);
|
|
383
395
|
return (
|
package/src/js/core/toggle.js
CHANGED
|
@@ -156,15 +156,7 @@ export default {
|
|
|
156
156
|
{
|
|
157
157
|
name: 'click',
|
|
158
158
|
|
|
159
|
-
filter() {
|
|
160
|
-
return includes(this.mode, 'click');
|
|
161
|
-
},
|
|
162
|
-
|
|
163
159
|
handler(e) {
|
|
164
|
-
if (this._preventClick) {
|
|
165
|
-
return (this._preventClick = null);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
160
|
let link;
|
|
169
161
|
if (
|
|
170
162
|
closest(e.target, 'a[href="#"], a[href=""]') ||
|
|
@@ -175,6 +167,14 @@ export default {
|
|
|
175
167
|
e.preventDefault();
|
|
176
168
|
}
|
|
177
169
|
|
|
170
|
+
if (this._preventClick) {
|
|
171
|
+
return (this._preventClick = null);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (!includes(this.mode, 'click')) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
178
|
this.toggle();
|
|
179
179
|
},
|
|
180
180
|
},
|
package/src/js/mixin/media.js
CHANGED
|
@@ -20,16 +20,19 @@ export default {
|
|
|
20
20
|
|
|
21
21
|
connected() {
|
|
22
22
|
const media = toMedia(this.media);
|
|
23
|
-
this.
|
|
24
|
-
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
this.matchMedia = true;
|
|
24
|
+
if (media) {
|
|
25
|
+
this.mediaObj = window.matchMedia(media);
|
|
26
|
+
const handler = () => {
|
|
27
|
+
this.matchMedia = this.mediaObj.matches;
|
|
28
|
+
trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
|
|
29
|
+
};
|
|
30
|
+
this.offMediaObj = on(this.mediaObj, 'change', () => {
|
|
31
|
+
handler();
|
|
32
|
+
this.$emit('resize');
|
|
33
|
+
});
|
|
29
34
|
handler();
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
handler();
|
|
35
|
+
}
|
|
33
36
|
},
|
|
34
37
|
|
|
35
38
|
disconnected() {
|
package/src/js/mixin/modal.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
append,
|
|
5
5
|
attr,
|
|
6
6
|
css,
|
|
7
|
+
endsWith,
|
|
7
8
|
includes,
|
|
8
9
|
isFocusable,
|
|
9
10
|
last,
|
|
@@ -15,7 +16,6 @@ import {
|
|
|
15
16
|
pointerUp,
|
|
16
17
|
removeClass,
|
|
17
18
|
toFloat,
|
|
18
|
-
toMs,
|
|
19
19
|
width,
|
|
20
20
|
within,
|
|
21
21
|
} from 'uikit-util';
|
|
@@ -245,7 +245,7 @@ function animate({ transitionElement, _toggle }) {
|
|
|
245
245
|
return (el, show) =>
|
|
246
246
|
new Promise((resolve, reject) =>
|
|
247
247
|
once(el, 'show hide', () => {
|
|
248
|
-
el._reject
|
|
248
|
+
el._reject?.();
|
|
249
249
|
el._reject = reject;
|
|
250
250
|
|
|
251
251
|
_toggle(el, show);
|
|
@@ -269,3 +269,7 @@ function animate({ transitionElement, _toggle }) {
|
|
|
269
269
|
})
|
|
270
270
|
).then(() => delete el._reject);
|
|
271
271
|
}
|
|
272
|
+
|
|
273
|
+
function toMs(time) {
|
|
274
|
+
return time ? (endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000) : 0;
|
|
275
|
+
}
|
package/src/js/mixin/parallax.js
CHANGED
|
@@ -79,12 +79,16 @@ export default {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
function transformFn(prop, el, stops) {
|
|
82
|
-
|
|
82
|
+
let unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
83
83
|
let transformFn;
|
|
84
84
|
|
|
85
85
|
if (prop === 'x' || prop === 'y') {
|
|
86
86
|
prop = `translate${ucfirst(prop)}`;
|
|
87
87
|
transformFn = (stop) => toFloat(toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
|
|
88
|
+
} else if (prop === 'scale') {
|
|
89
|
+
unit = '';
|
|
90
|
+
transformFn = (stop) =>
|
|
91
|
+
getUnit([stop]) ? toPx(stop, 'width', el, true) / el.offsetWidth : stop;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
if (stops.length === 1) {
|
package/src/js/mixin/position.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
flipPosition,
|
|
4
4
|
getCssVar,
|
|
5
5
|
offset as getOffset,
|
|
6
|
+
includes,
|
|
6
7
|
isNumeric,
|
|
7
8
|
isRtl,
|
|
8
9
|
positionAt,
|
|
@@ -20,49 +21,48 @@ export default {
|
|
|
20
21
|
pos: `bottom-${isRtl ? 'right' : 'left'}`,
|
|
21
22
|
flip: true,
|
|
22
23
|
offset: false,
|
|
24
|
+
viewportPadding: 10,
|
|
23
25
|
},
|
|
24
26
|
|
|
25
27
|
connected() {
|
|
26
28
|
this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
|
|
27
|
-
this.
|
|
28
|
-
this.align = this.pos[1];
|
|
29
|
+
this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
|
|
29
30
|
},
|
|
30
31
|
|
|
31
32
|
methods: {
|
|
32
33
|
positionAt(element, target, boundary) {
|
|
33
|
-
const
|
|
34
|
-
const dir = this.pos[0];
|
|
35
|
-
const align = this.pos[1];
|
|
34
|
+
const [dir, align] = this.pos;
|
|
36
35
|
|
|
37
36
|
let { offset } = this;
|
|
38
37
|
if (!isNumeric(offset)) {
|
|
39
38
|
const node = $(offset);
|
|
40
39
|
offset = node
|
|
41
|
-
? getOffset(node)[axis === 'x' ? 'left' : 'top'] -
|
|
42
|
-
getOffset(target)[axis === 'x' ? 'right' : 'bottom']
|
|
40
|
+
? getOffset(node)[this.axis === 'x' ? 'left' : 'top'] -
|
|
41
|
+
getOffset(target)[this.axis === 'x' ? 'right' : 'bottom']
|
|
43
42
|
: 0;
|
|
44
43
|
}
|
|
45
44
|
offset = toPx(offset) + toPx(getCssVar('position-offset', element));
|
|
45
|
+
offset = [includes(['left', 'top'], dir) ? -offset : +offset, 0];
|
|
46
46
|
|
|
47
|
-
const
|
|
48
|
-
element,
|
|
49
|
-
target,
|
|
50
|
-
|
|
51
|
-
axis === 'x' ? `${dir} ${align}` : `${align} ${dir}`,
|
|
52
|
-
axis === 'x'
|
|
53
|
-
? `${dir === 'left' ? -offset : offset}`
|
|
54
|
-
: ` ${dir === 'top' ? -offset : offset}`,
|
|
55
|
-
null,
|
|
56
|
-
this.flip,
|
|
57
|
-
boundary
|
|
58
|
-
).target;
|
|
47
|
+
const attach = {
|
|
48
|
+
element: [flipPosition(dir), align],
|
|
49
|
+
target: [dir, align],
|
|
50
|
+
};
|
|
59
51
|
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
if (this.axis === 'y') {
|
|
53
|
+
for (const prop in attach) {
|
|
54
|
+
attach[prop] = attach[prop].reverse();
|
|
55
|
+
}
|
|
56
|
+
offset = offset.reverse();
|
|
57
|
+
}
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
positionAt(element, target, {
|
|
60
|
+
attach,
|
|
61
|
+
offset,
|
|
62
|
+
boundary,
|
|
63
|
+
viewportPadding: this.viewportPadding,
|
|
64
|
+
flip: this.flip,
|
|
65
|
+
});
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
};
|
package/src/js/uikit-core.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import UIkit from './api/index';
|
|
2
|
-
import Core from './core/core';
|
|
3
2
|
import boot from './api/boot';
|
|
4
3
|
import * as components from './core/index';
|
|
5
4
|
import { each } from 'uikit-util';
|
|
@@ -7,9 +6,6 @@ import { each } from 'uikit-util';
|
|
|
7
6
|
// register components
|
|
8
7
|
each(components, (component, name) => UIkit.component(name, component));
|
|
9
8
|
|
|
10
|
-
// core functionality
|
|
11
|
-
UIkit.use(Core);
|
|
12
|
-
|
|
13
9
|
boot(UIkit);
|
|
14
10
|
|
|
15
11
|
export default UIkit;
|
package/src/js/util/lang.js
CHANGED
|
@@ -133,10 +133,6 @@ export function toWindow(element) {
|
|
|
133
133
|
return document?.defaultView || window;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
export function toMs(time) {
|
|
137
|
-
return time ? (endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000) : 0;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
136
|
export function isEqual(value, other) {
|
|
141
137
|
return (
|
|
142
138
|
value === other ||
|