uikit 3.14.4-dev.5e7e87ba7 → 3.14.4-dev.6002e7046
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 +5 -1
- package/dist/css/uikit-core-rtl.css +14 -3
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +14 -3
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +16 -28
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +16 -28
- 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 +27 -17
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +27 -17
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +4 -2
- 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 +1 -1
- 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 +1 -1
- 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 +17 -8
- 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 +194 -161
- package/dist/js/uikit-core.min.js +15 -12
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +197 -162
- package/dist/js/uikit.min.js +15 -12
- package/package.json +11 -11
- package/src/images/components/navbar-toggle-icon.svg +17 -14
- package/src/js/api/hooks.js +5 -1
- package/src/js/api/state.js +1 -1
- package/src/js/components/notification.js +3 -1
- package/src/js/core/drop.js +32 -33
- package/src/js/core/navbar.js +3 -1
- package/src/js/core/offcanvas.js +8 -4
- package/src/js/core/toggle.js +3 -5
- package/src/js/mixin/modal.js +15 -12
- package/src/js/mixin/position.js +5 -4
- package/src/js/mixin/style.js +11 -0
- package/src/js/mixin/togglable.js +11 -3
- package/src/js/util/animation.js +5 -4
- package/src/js/util/class.js +3 -1
- package/src/js/util/position.js +96 -90
- package/src/less/components/dropbar.less +11 -0
- package/src/less/components/nav.less +3 -1
- package/src/less/components/navbar.less +17 -3
- package/src/less/theme/navbar.less +5 -32
- package/src/scss/components/dropbar.scss +11 -0
- package/src/scss/components/nav.scss +3 -1
- package/src/scss/components/navbar.scss +17 -3
- package/src/scss/mixins-theme.scss +3 -28
- package/src/scss/mixins.scss +2 -0
- package/src/scss/theme/navbar.scss +5 -5
- package/src/scss/variables-theme.scss +8 -4
- package/src/scss/variables.scss +7 -1
- package/tests/drop.html +4 -6
- package/tests/dropbar.html +10 -8
- package/tests/index.html +1 -1
- package/tests/js/index.js +1 -4
- package/tests/navbar.html +48 -21
- package/tests/position.html +17 -4
- package/tests/search.html +2 -2
- package/tests/sticky-navbar.html +12 -12
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.6002e7046",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -34,27 +34,27 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://getuikit.com",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@babel/core": "^7.
|
|
38
|
-
"@babel/preset-env": "^7.
|
|
37
|
+
"@babel/core": "^7.18.6",
|
|
38
|
+
"@babel/preset-env": "^7.18.6",
|
|
39
39
|
"@rollup/plugin-alias": "^3.1.9",
|
|
40
40
|
"@rollup/plugin-babel": "^5.3.1",
|
|
41
41
|
"@rollup/plugin-replace": "^4.0.0",
|
|
42
42
|
"archiver": "^5.3.1",
|
|
43
|
-
"camelcase": "^
|
|
43
|
+
"camelcase": "^7.0.0",
|
|
44
44
|
"clean-css": "^5.3.0",
|
|
45
45
|
"dateformat": "^5.0.3",
|
|
46
|
-
"esbuild": "^0.14.
|
|
47
|
-
"eslint": "^8.
|
|
46
|
+
"esbuild": "^0.14.48",
|
|
47
|
+
"eslint": "^8.19.0",
|
|
48
48
|
"eslint-config-prettier": "^8.5.0",
|
|
49
49
|
"fs-extra": "^10.1.0",
|
|
50
|
-
"glob": "^8.0.
|
|
51
|
-
"inquirer": "^
|
|
52
|
-
"less": "^4.1.
|
|
50
|
+
"glob": "^8.0.3",
|
|
51
|
+
"inquirer": "^9.0.0",
|
|
52
|
+
"less": "^4.1.3",
|
|
53
53
|
"minimist": "^1.2.6",
|
|
54
54
|
"number-precision": "^1.5.2",
|
|
55
55
|
"p-limit": "^4.0.0",
|
|
56
|
-
"prettier": "^2.
|
|
57
|
-
"rollup": "^2.
|
|
56
|
+
"prettier": "^2.7.1",
|
|
57
|
+
"rollup": "^2.76.0",
|
|
58
58
|
"rollup-plugin-esbuild": "^4.9.1",
|
|
59
59
|
"rollup-plugin-html": "^0.2.1",
|
|
60
60
|
"rollup-plugin-modify": "^3.0.0",
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
|
|
2
|
+
<style>
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
.uk-navbar-toggle-animate svg > [class*='line-'] {
|
|
5
|
+
transition: 0.2s ease-in-out;
|
|
6
|
+
transition-property: transform, opacity,;
|
|
7
|
+
transform-origin: center;
|
|
8
|
+
opacity: 1;
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
.uk-navbar-toggle svg > .line-3 { opacity: 0; }
|
|
12
|
+
.uk-navbar-toggle-animate[aria-expanded="true"] svg > .line-3 { opacity: 1; }
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.uk-navbar-toggle[aria-expanded="true"] svg > .line-1 { transform: translateY(6px) scaleX(0); }
|
|
17
|
-
.uk-navbar-toggle[aria-expanded="true"] svg > .line-4 { transform: translateY(-6px) scaleX(0); }
|
|
14
|
+
.uk-navbar-toggle-animate[aria-expanded="true"] svg > .line-2 { transform: rotate(45deg); }
|
|
15
|
+
.uk-navbar-toggle-animate[aria-expanded="true"] svg > .line-3 { transform: rotate(-45deg); }
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
.uk-navbar-toggle-animate[aria-expanded="true"] svg > .line-1,
|
|
18
|
+
.uk-navbar-toggle-animate[aria-expanded="true"] svg > .line-4 { opacity: 0; }
|
|
19
|
+
.uk-navbar-toggle-animate[aria-expanded="true"] svg > .line-1 { transform: translateY(6px) scaleX(0); }
|
|
20
|
+
.uk-navbar-toggle-animate[aria-expanded="true"] svg > .line-4 { transform: translateY(-6px) scaleX(0); }
|
|
21
|
+
|
|
22
|
+
</style>
|
|
20
23
|
<rect class="line-1" y="3" width="20" height="2" />
|
|
21
24
|
<rect class="line-2" y="9" width="20" height="2" />
|
|
22
25
|
<rect class="line-3" y="9" width="20" height="2" />
|
package/src/js/api/hooks.js
CHANGED
|
@@ -96,7 +96,11 @@ export default function (UIkit) {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
if (write && result !== false) {
|
|
99
|
-
fastdom.write(() =>
|
|
99
|
+
fastdom.write(() => {
|
|
100
|
+
if (this._connected) {
|
|
101
|
+
write.call(this, this._data, types);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
100
104
|
}
|
|
101
105
|
}
|
|
102
106
|
}
|
package/src/js/api/state.js
CHANGED
|
@@ -56,7 +56,9 @@ export default {
|
|
|
56
56
|
this.$mount(
|
|
57
57
|
append(
|
|
58
58
|
container,
|
|
59
|
-
`<div class="${this.clsMsg}${
|
|
59
|
+
`<div class="${this.clsMsg}${
|
|
60
|
+
this.status ? ` ${this.clsMsg}-${this.status}` : ''
|
|
61
|
+
}" role="alert">
|
|
60
62
|
<a href class="${this.clsClose}" data-uk-close></a>
|
|
61
63
|
<div>${this.message}</div>
|
|
62
64
|
</div>`
|
package/src/js/core/drop.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Container from '../mixin/container';
|
|
2
2
|
import Lazyload from '../mixin/lazyload';
|
|
3
3
|
import Position from '../mixin/position';
|
|
4
|
+
import Style from '../mixin/style';
|
|
4
5
|
import Togglable from '../mixin/togglable';
|
|
5
6
|
import {
|
|
6
7
|
addClass,
|
|
@@ -34,7 +35,7 @@ import { preventBackgroundScroll, preventOverscroll } from '../mixin/modal';
|
|
|
34
35
|
export let active;
|
|
35
36
|
|
|
36
37
|
export default {
|
|
37
|
-
mixins: [Container, Lazyload, Position, Togglable],
|
|
38
|
+
mixins: [Container, Lazyload, Position, Style, Togglable],
|
|
38
39
|
|
|
39
40
|
args: 'pos',
|
|
40
41
|
|
|
@@ -48,7 +49,7 @@ export default {
|
|
|
48
49
|
stretch: Boolean,
|
|
49
50
|
delayShow: Number,
|
|
50
51
|
delayHide: Number,
|
|
51
|
-
|
|
52
|
+
autoUpdate: Boolean,
|
|
52
53
|
clsDrop: String,
|
|
53
54
|
animateOut: Boolean,
|
|
54
55
|
bgScroll: Boolean,
|
|
@@ -64,7 +65,7 @@ export default {
|
|
|
64
65
|
stretch: false,
|
|
65
66
|
delayShow: 0,
|
|
66
67
|
delayHide: 800,
|
|
67
|
-
|
|
68
|
+
autoUpdate: true,
|
|
68
69
|
clsDrop: false,
|
|
69
70
|
animateOut: false,
|
|
70
71
|
bgScroll: true,
|
|
@@ -108,6 +109,7 @@ export default {
|
|
|
108
109
|
|
|
109
110
|
disconnected() {
|
|
110
111
|
if (this.isActive()) {
|
|
112
|
+
this.hide(false);
|
|
111
113
|
active = null;
|
|
112
114
|
}
|
|
113
115
|
},
|
|
@@ -241,7 +243,8 @@ export default {
|
|
|
241
243
|
|
|
242
244
|
this.tracker.init();
|
|
243
245
|
|
|
244
|
-
|
|
246
|
+
const update = () => this.$emit();
|
|
247
|
+
const handlers = [
|
|
245
248
|
on(
|
|
246
249
|
document,
|
|
247
250
|
pointerDown,
|
|
@@ -270,29 +273,28 @@ export default {
|
|
|
270
273
|
}
|
|
271
274
|
}),
|
|
272
275
|
|
|
276
|
+
on(window, 'resize', update),
|
|
277
|
+
|
|
278
|
+
(() => {
|
|
279
|
+
const observer = observeResize(
|
|
280
|
+
scrollParents(this.$el).concat(this.targetEl),
|
|
281
|
+
update
|
|
282
|
+
);
|
|
283
|
+
return () => observer.disconnect();
|
|
284
|
+
})(),
|
|
285
|
+
|
|
286
|
+
...(this.autoUpdate
|
|
287
|
+
? [on([document, scrollParents(this.$el)], 'scroll', update)]
|
|
288
|
+
: []),
|
|
289
|
+
|
|
273
290
|
...(this.bgScroll
|
|
274
291
|
? []
|
|
275
292
|
: [preventOverscroll(this.$el), preventBackgroundScroll()]),
|
|
293
|
+
];
|
|
276
294
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
const handler = () => this.$emit();
|
|
281
|
-
return [
|
|
282
|
-
on(window, 'resize', handler),
|
|
283
|
-
on([document, scrollParents(this.$el)], 'scroll', handler),
|
|
284
|
-
(() => {
|
|
285
|
-
const observer = observeResize(
|
|
286
|
-
scrollParents(this.$el),
|
|
287
|
-
handler
|
|
288
|
-
);
|
|
289
|
-
return () => observer.disconnect();
|
|
290
|
-
})(),
|
|
291
|
-
];
|
|
292
|
-
})()),
|
|
293
|
-
]) {
|
|
294
|
-
once(this.$el, 'hide', handler, { self: true });
|
|
295
|
-
}
|
|
295
|
+
once(this.$el, 'hide', () => handlers.forEach((handler) => handler()), {
|
|
296
|
+
self: true,
|
|
297
|
+
});
|
|
296
298
|
},
|
|
297
299
|
},
|
|
298
300
|
|
|
@@ -401,13 +403,13 @@ export default {
|
|
|
401
403
|
|
|
402
404
|
position() {
|
|
403
405
|
removeClass(this.$el, `${this.clsDrop}-stack`);
|
|
404
|
-
|
|
406
|
+
attr(this.$el, 'style', this._style);
|
|
405
407
|
|
|
406
408
|
// Ensure none positioned element does not generate scrollbars
|
|
407
409
|
this.$el.hidden = true;
|
|
408
410
|
|
|
409
411
|
const boundary = query(this.boundary, this.$el);
|
|
410
|
-
const boundaryOffset =
|
|
412
|
+
const boundaryOffset = offset(boundary || window);
|
|
411
413
|
const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
|
|
412
414
|
const viewportOffset = this.getViewportOffset(this.$el);
|
|
413
415
|
|
|
@@ -417,15 +419,12 @@ export default {
|
|
|
417
419
|
];
|
|
418
420
|
|
|
419
421
|
for (const [i, [axis, prop]] of dirs) {
|
|
420
|
-
if (includes([axis, true], this.stretch)) {
|
|
422
|
+
if (this.axis !== axis && includes([axis, true], this.stretch)) {
|
|
421
423
|
css(this.$el, {
|
|
422
|
-
[prop]:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
boundaryOffset[prop],
|
|
427
|
-
viewports[i][prop] - 2 * viewportOffset
|
|
428
|
-
),
|
|
424
|
+
[prop]: Math.min(
|
|
425
|
+
boundaryOffset[prop],
|
|
426
|
+
viewports[i][prop] - 2 * viewportOffset
|
|
427
|
+
),
|
|
429
428
|
[`overflow-${axis}`]: 'auto',
|
|
430
429
|
});
|
|
431
430
|
}
|
package/src/js/core/navbar.js
CHANGED
|
@@ -38,6 +38,8 @@ export default {
|
|
|
38
38
|
offset: Number,
|
|
39
39
|
boundary: Boolean,
|
|
40
40
|
target: Boolean,
|
|
41
|
+
targetX: Boolean,
|
|
42
|
+
targetY: Boolean,
|
|
41
43
|
clsDrop: String,
|
|
42
44
|
delayShow: Number,
|
|
43
45
|
delayHide: Number,
|
|
@@ -386,7 +388,7 @@ export default {
|
|
|
386
388
|
|
|
387
389
|
methods: {
|
|
388
390
|
getActive() {
|
|
389
|
-
return
|
|
391
|
+
return includes(this.dropdowns, active?.$el) && active;
|
|
390
392
|
},
|
|
391
393
|
|
|
392
394
|
transitionTo(newHeight, el) {
|
package/src/js/core/offcanvas.js
CHANGED
|
@@ -119,9 +119,12 @@ export default {
|
|
|
119
119
|
addClass(parent(this.panel), this.clsMode);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
const { body, scrollingElement } = document;
|
|
123
|
+
|
|
124
|
+
addClass(body, this.clsContainer, this.clsFlip);
|
|
125
|
+
css(body, 'touch-action', 'pan-y pinch-zoom');
|
|
124
126
|
css(this.$el, 'display', 'block');
|
|
127
|
+
css(this.panel, 'maxWidth', scrollingElement.clientWidth);
|
|
125
128
|
addClass(this.$el, this.clsOverlay);
|
|
126
129
|
addClass(
|
|
127
130
|
this.panel,
|
|
@@ -129,8 +132,8 @@ export default {
|
|
|
129
132
|
this.mode === 'reveal' ? '' : this.clsMode
|
|
130
133
|
);
|
|
131
134
|
|
|
132
|
-
height(
|
|
133
|
-
addClass(
|
|
135
|
+
height(body); // force reflow
|
|
136
|
+
addClass(body, this.clsContainerAnimation);
|
|
134
137
|
|
|
135
138
|
this.clsContainerAnimation && suppressUserScale();
|
|
136
139
|
},
|
|
@@ -162,6 +165,7 @@ export default {
|
|
|
162
165
|
removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);
|
|
163
166
|
removeClass(this.$el, this.clsOverlay);
|
|
164
167
|
css(this.$el, 'display', '');
|
|
168
|
+
css(this.panel, 'maxWidth', '');
|
|
165
169
|
removeClass(document.body, this.clsContainer, this.clsFlip);
|
|
166
170
|
},
|
|
167
171
|
},
|
package/src/js/core/toggle.js
CHANGED
|
@@ -181,7 +181,7 @@ export default {
|
|
|
181
181
|
},
|
|
182
182
|
|
|
183
183
|
{
|
|
184
|
-
name: '
|
|
184
|
+
name: 'hide show',
|
|
185
185
|
|
|
186
186
|
self: true,
|
|
187
187
|
|
|
@@ -189,10 +189,8 @@ export default {
|
|
|
189
189
|
return this.target;
|
|
190
190
|
},
|
|
191
191
|
|
|
192
|
-
handler(
|
|
193
|
-
|
|
194
|
-
this.updateAria(toggled);
|
|
195
|
-
}
|
|
192
|
+
handler({ type }) {
|
|
193
|
+
this.updateAria(type === 'show');
|
|
196
194
|
},
|
|
197
195
|
},
|
|
198
196
|
|
package/src/js/mixin/modal.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
includes,
|
|
10
10
|
isFocusable,
|
|
11
11
|
last,
|
|
12
|
+
noop,
|
|
12
13
|
on,
|
|
13
14
|
once,
|
|
14
15
|
parent,
|
|
@@ -134,8 +135,8 @@ export default {
|
|
|
134
135
|
);
|
|
135
136
|
|
|
136
137
|
if (this.overlay) {
|
|
137
|
-
once(this.$el, '
|
|
138
|
-
once(this.$el, '
|
|
138
|
+
once(this.$el, 'hidden', preventOverscroll(this.$el), { self: true });
|
|
139
|
+
once(this.$el, 'hidden', preventBackgroundScroll(), { self: true });
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
if (this.stack) {
|
|
@@ -217,10 +218,6 @@ export default {
|
|
|
217
218
|
active.splice(active.indexOf(this), 1);
|
|
218
219
|
}
|
|
219
220
|
|
|
220
|
-
if (!active.length) {
|
|
221
|
-
css(document.body, 'overflowY', '');
|
|
222
|
-
}
|
|
223
|
-
|
|
224
221
|
css(this.$el, 'zIndex', '');
|
|
225
222
|
|
|
226
223
|
if (!active.some((modal) => modal.clsPage === this.clsPage)) {
|
|
@@ -337,16 +334,22 @@ export function preventOverscroll(el) {
|
|
|
337
334
|
return () => events.forEach((fn) => fn());
|
|
338
335
|
}
|
|
339
336
|
|
|
337
|
+
let prevented;
|
|
340
338
|
export function preventBackgroundScroll() {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
339
|
+
if (prevented) {
|
|
340
|
+
return noop;
|
|
341
|
+
}
|
|
342
|
+
prevented = true;
|
|
343
|
+
|
|
344
|
+
const { scrollingElement } = document;
|
|
345
|
+
css(scrollingElement, {
|
|
346
|
+
overflowY: 'hidden',
|
|
344
347
|
touchAction: 'none',
|
|
348
|
+
paddingRight: width(window) - scrollingElement.clientWidth,
|
|
345
349
|
});
|
|
346
|
-
css(documentElement, 'overflowY', 'hidden');
|
|
347
350
|
return () => {
|
|
348
|
-
|
|
349
|
-
css(
|
|
351
|
+
prevented = false;
|
|
352
|
+
css(scrollingElement, { overflowY: '', touchAction: '', paddingRight: '' });
|
|
350
353
|
};
|
|
351
354
|
}
|
|
352
355
|
|
package/src/js/mixin/position.js
CHANGED
|
@@ -35,6 +35,7 @@ export default {
|
|
|
35
35
|
methods: {
|
|
36
36
|
positionAt(element, target, boundary) {
|
|
37
37
|
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
38
|
+
const placement = [this.flip && 'flip', this.shift && 'shift'];
|
|
38
39
|
|
|
39
40
|
const attach = {
|
|
40
41
|
element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
|
|
@@ -43,9 +44,10 @@ export default {
|
|
|
43
44
|
|
|
44
45
|
if (this.axis === 'y') {
|
|
45
46
|
for (const prop in attach) {
|
|
46
|
-
attach[prop]
|
|
47
|
+
attach[prop].reverse();
|
|
47
48
|
}
|
|
48
|
-
offset
|
|
49
|
+
offset.reverse();
|
|
50
|
+
placement.reverse();
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
const [scrollElement] = scrollParents(element, /auto|scroll/);
|
|
@@ -59,8 +61,7 @@ export default {
|
|
|
59
61
|
attach,
|
|
60
62
|
offset,
|
|
61
63
|
boundary,
|
|
62
|
-
|
|
63
|
-
shift: this.shift,
|
|
64
|
+
placement,
|
|
64
65
|
viewportOffset: this.getViewportOffset(element),
|
|
65
66
|
});
|
|
66
67
|
|
|
@@ -168,9 +168,16 @@ export function toggleTransition(cmp) {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
const prevProps = Object.fromEntries(
|
|
171
|
-
[
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
[
|
|
172
|
+
'padding',
|
|
173
|
+
'border',
|
|
174
|
+
'width',
|
|
175
|
+
'height',
|
|
176
|
+
'overflowY',
|
|
177
|
+
'overflowX',
|
|
178
|
+
marginProp,
|
|
179
|
+
marginStartProp,
|
|
180
|
+
].map((key) => [key, el.style[key]])
|
|
174
181
|
);
|
|
175
182
|
|
|
176
183
|
const dim = dimensions(el);
|
|
@@ -188,6 +195,7 @@ export function toggleTransition(cmp) {
|
|
|
188
195
|
height: dim.height,
|
|
189
196
|
width: dim.width,
|
|
190
197
|
...css(el, [
|
|
198
|
+
'overflow',
|
|
191
199
|
'padding',
|
|
192
200
|
'borderTop',
|
|
193
201
|
'borderRight',
|
package/src/js/util/animation.js
CHANGED
|
@@ -4,7 +4,7 @@ import { css, propName } from './style';
|
|
|
4
4
|
import { startsWith, toNodes } from './lang';
|
|
5
5
|
import { addClass, hasClass, removeClass, removeClasses } from './class';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function transition(element, props, duration = 400, timing = 'linear') {
|
|
8
8
|
duration = Math.round(duration);
|
|
9
9
|
return Promise.all(
|
|
10
10
|
toNodes(element).map(
|
|
@@ -67,7 +67,7 @@ export const Transition = {
|
|
|
67
67
|
|
|
68
68
|
const animationPrefix = 'uk-animation-';
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
function animate(element, animation, duration = 200, origin, out) {
|
|
71
71
|
return Promise.all(
|
|
72
72
|
toNodes(element).map(
|
|
73
73
|
(element) =>
|
|
@@ -101,7 +101,8 @@ export function animate(element, animation, duration = 200, origin, out) {
|
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
const
|
|
104
|
+
const inProgressRe = new RegExp(`${animationPrefix}(enter|leave)`);
|
|
105
|
+
|
|
105
106
|
export const Animation = {
|
|
106
107
|
in: animate,
|
|
107
108
|
|
|
@@ -110,7 +111,7 @@ export const Animation = {
|
|
|
110
111
|
},
|
|
111
112
|
|
|
112
113
|
inProgress(element) {
|
|
113
|
-
return
|
|
114
|
+
return inProgressRe.test(attr(element, 'class'));
|
|
114
115
|
},
|
|
115
116
|
|
|
116
117
|
cancel(element) {
|
package/src/js/util/class.js
CHANGED
|
@@ -10,7 +10,9 @@ export function removeClass(element, ...args) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function removeClasses(element, cls) {
|
|
13
|
-
attr(element, 'class', (value) =>
|
|
13
|
+
attr(element, 'class', (value) =>
|
|
14
|
+
(value || '').replace(new RegExp(`\\b${cls}\\b\\s?`, 'g'), '')
|
|
15
|
+
);
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export function replaceClass(element, ...args) {
|