uikit 3.13.1-dev.dedbd3fce → 3.13.2-dev.696f00752
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/.eslintrc.json +9 -0
- package/CHANGELOG.md +22 -0
- package/dist/css/uikit-core-rtl.css +31 -71
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +31 -71
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +31 -71
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +31 -71
- 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 +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- 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 +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 +60 -31
- 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 +218 -208
- 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 +220 -211
- package/dist/js/uikit.min.js +1 -1
- package/package.json +10 -10
- package/src/js/components/tooltip.js +2 -3
- package/src/js/core/cover.js +1 -1
- package/src/js/core/drop.js +7 -10
- package/src/js/core/navbar.js +12 -13
- package/src/js/core/responsive.js +1 -1
- package/src/js/core/sticky.js +1 -1
- package/src/js/core/switcher.js +7 -13
- package/src/js/mixin/media.js +4 -4
- package/src/js/mixin/position.js +53 -24
- package/src/js/util/dimensions.js +2 -2
- package/src/js/util/position.js +125 -129
- package/src/js/util/style.js +13 -19
- package/src/less/components/drop.less +3 -11
- package/src/less/components/dropdown.less +3 -11
- package/src/less/components/navbar.less +13 -23
- package/src/less/components/offcanvas.less +19 -1
- package/src/less/components/tooltip.less +2 -11
- package/src/less/theme/navbar.less +1 -3
- package/src/scss/components/drop.scss +3 -11
- package/src/scss/components/dropdown.scss +3 -11
- package/src/scss/components/navbar.scss +13 -23
- package/src/scss/components/offcanvas.scss +19 -1
- package/src/scss/components/tooltip.scss +2 -11
- package/src/scss/mixins-theme.scss +1 -2
- package/src/scss/mixins.scss +0 -1
- package/src/scss/theme/navbar.scss +0 -2
- package/src/scss/variables-theme.scss +7 -5
- package/src/scss/variables.scss +7 -5
- package/tests/drop.html +1 -1
- package/tests/navbar.html +2 -8
- package/tests/position.html +38 -39
- package/tests/search.html +1 -1
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.2-dev.696f00752",
|
|
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.
|
|
37
|
+
"@babel/core": "^7.17.8",
|
|
38
38
|
"@babel/preset-env": "^7.16.4",
|
|
39
39
|
"@rollup/plugin-alias": "^3.1.9",
|
|
40
|
-
"@rollup/plugin-babel": "^5.3.
|
|
40
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
41
41
|
"@rollup/plugin-replace": "^3.0.1",
|
|
42
42
|
"archiver": "^5.3.0",
|
|
43
43
|
"camelcase": "^6.3.0",
|
|
44
44
|
"clean-css": "^5.2.4",
|
|
45
45
|
"dateformat": "^5.0.3",
|
|
46
|
-
"esbuild": "^0.14.
|
|
47
|
-
"eslint": "^8.
|
|
48
|
-
"eslint-config-prettier": "^8.
|
|
49
|
-
"fs-extra": "^10.0.
|
|
46
|
+
"esbuild": "^0.14.27",
|
|
47
|
+
"eslint": "^8.11.0",
|
|
48
|
+
"eslint-config-prettier": "^8.5.0",
|
|
49
|
+
"fs-extra": "^10.0.1",
|
|
50
50
|
"glob": "^7.2.0",
|
|
51
|
-
"inquirer": "^8.2.
|
|
51
|
+
"inquirer": "^8.2.1",
|
|
52
52
|
"less": "^4.1.2",
|
|
53
53
|
"minimist": "^1.2.5",
|
|
54
54
|
"number-precision": "^1.5.2",
|
|
55
55
|
"p-limit": "^4.0.0",
|
|
56
|
-
"prettier": "^2.
|
|
57
|
-
"rollup": "^2.
|
|
56
|
+
"prettier": "^2.6.0",
|
|
57
|
+
"rollup": "^2.70.1",
|
|
58
58
|
"rollup-plugin-esbuild": "^4.8.2",
|
|
59
59
|
"rollup-plugin-html": "^0.2.1",
|
|
60
60
|
"rollup-plugin-modify": "^3.0.0",
|
|
@@ -35,7 +35,6 @@ export default {
|
|
|
35
35
|
animation: ['uk-animation-scale-up'],
|
|
36
36
|
duration: 100,
|
|
37
37
|
cls: 'uk-active',
|
|
38
|
-
clsPos: 'uk-tooltip',
|
|
39
38
|
},
|
|
40
39
|
|
|
41
40
|
beforeConnect() {
|
|
@@ -91,8 +90,8 @@ export default {
|
|
|
91
90
|
_show() {
|
|
92
91
|
this.tooltip = append(
|
|
93
92
|
this.container,
|
|
94
|
-
`<div class="
|
|
95
|
-
<div class="
|
|
93
|
+
`<div class="uk-${this.$options.name}">
|
|
94
|
+
<div class="uk-${this.$options.name}-inner">${this.title}</div>
|
|
96
95
|
</div>`
|
|
97
96
|
);
|
|
98
97
|
|
package/src/js/core/cover.js
CHANGED
package/src/js/core/drop.js
CHANGED
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
},
|
|
64
64
|
|
|
65
65
|
connected() {
|
|
66
|
-
this.
|
|
66
|
+
this.clsDrop = this.$props.clsDrop || `uk-${this.$options.name}`;
|
|
67
67
|
addClass(this.$el, this.clsDrop);
|
|
68
68
|
|
|
69
69
|
if (this.toggle && !this.target) {
|
|
@@ -129,7 +129,7 @@ export default {
|
|
|
129
129
|
if (this.isToggled()) {
|
|
130
130
|
this.hide(false);
|
|
131
131
|
} else {
|
|
132
|
-
this.show(toggle
|
|
132
|
+
this.show(toggle?.$el, false);
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
},
|
|
@@ -141,7 +141,7 @@ export default {
|
|
|
141
141
|
|
|
142
142
|
handler(e, toggle) {
|
|
143
143
|
e.preventDefault();
|
|
144
|
-
this.show(toggle
|
|
144
|
+
this.show(toggle?.$el);
|
|
145
145
|
},
|
|
146
146
|
},
|
|
147
147
|
|
|
@@ -352,23 +352,20 @@ export default {
|
|
|
352
352
|
},
|
|
353
353
|
|
|
354
354
|
position() {
|
|
355
|
-
const boundary =
|
|
355
|
+
const boundary = query(this.boundary, this.$el) || window;
|
|
356
356
|
removeClass(this.$el, `${this.clsDrop}-stack`);
|
|
357
357
|
toggleClass(this.$el, `${this.clsDrop}-boundary`, this.boundaryAlign);
|
|
358
358
|
|
|
359
359
|
const boundaryOffset = offset(boundary);
|
|
360
|
-
const
|
|
360
|
+
const targetOffset = offset(this.target);
|
|
361
|
+
const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
|
|
361
362
|
|
|
362
363
|
if (this.align === 'justify') {
|
|
363
364
|
const prop = this.getAxis() === 'y' ? 'width' : 'height';
|
|
364
365
|
css(this.$el, prop, alignTo[prop]);
|
|
365
366
|
} else if (
|
|
366
|
-
boundary &&
|
|
367
367
|
this.$el.offsetWidth >
|
|
368
|
-
|
|
369
|
-
boundaryOffset.right - alignTo.left,
|
|
370
|
-
alignTo.right - boundaryOffset.left
|
|
371
|
-
)
|
|
368
|
+
Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left)
|
|
372
369
|
) {
|
|
373
370
|
addClass(this.$el, `${this.clsDrop}-stack`);
|
|
374
371
|
}
|
package/src/js/core/navbar.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
isVisible,
|
|
17
17
|
matches,
|
|
18
18
|
noop,
|
|
19
|
+
offset,
|
|
19
20
|
once,
|
|
20
21
|
parent,
|
|
21
22
|
query,
|
|
@@ -42,7 +43,6 @@ export default {
|
|
|
42
43
|
delayShow: Number,
|
|
43
44
|
delayHide: Number,
|
|
44
45
|
dropbar: Boolean,
|
|
45
|
-
dropbarMode: String,
|
|
46
46
|
dropbarAnchor: Boolean,
|
|
47
47
|
duration: Number,
|
|
48
48
|
},
|
|
@@ -59,7 +59,6 @@ export default {
|
|
|
59
59
|
flip: 'x',
|
|
60
60
|
boundary: true,
|
|
61
61
|
dropbar: false,
|
|
62
|
-
dropbarMode: 'slide',
|
|
63
62
|
dropbarAnchor: false,
|
|
64
63
|
duration: 200,
|
|
65
64
|
forceHeight: true,
|
|
@@ -68,8 +67,8 @@ export default {
|
|
|
68
67
|
},
|
|
69
68
|
|
|
70
69
|
computed: {
|
|
71
|
-
boundary({ boundary
|
|
72
|
-
return boundary === true
|
|
70
|
+
boundary({ boundary }, $el) {
|
|
71
|
+
return boundary === true ? $el : boundary;
|
|
73
72
|
},
|
|
74
73
|
|
|
75
74
|
dropbarAnchor({ dropbarAnchor }, $el) {
|
|
@@ -276,10 +275,16 @@ export default {
|
|
|
276
275
|
return this.dropbar;
|
|
277
276
|
},
|
|
278
277
|
|
|
279
|
-
handler() {
|
|
278
|
+
handler(_, { $el }) {
|
|
279
|
+
if (!hasClass($el, this.clsDrop)) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
|
|
280
283
|
if (!parent(this.dropbar)) {
|
|
281
284
|
after(this.dropbarAnchor || this.$el, this.dropbar);
|
|
282
285
|
}
|
|
286
|
+
|
|
287
|
+
addClass($el, `${this.clsDrop}-dropbar`);
|
|
283
288
|
},
|
|
284
289
|
},
|
|
285
290
|
|
|
@@ -299,16 +304,10 @@ export default {
|
|
|
299
304
|
return;
|
|
300
305
|
}
|
|
301
306
|
|
|
302
|
-
if (this.dropbarMode === 'slide') {
|
|
303
|
-
addClass(this.dropbar, 'uk-navbar-dropbar-slide');
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
this.clsDrop && addClass($el, `${this.clsDrop}-dropbar`);
|
|
307
|
-
|
|
308
307
|
if (dir === 'bottom') {
|
|
309
308
|
this.transitionTo(
|
|
310
|
-
$el.
|
|
311
|
-
|
|
309
|
+
offset($el).bottom -
|
|
310
|
+
offset(this.dropbar).top +
|
|
312
311
|
toFloat(css($el, 'marginBottom')),
|
|
313
312
|
$el
|
|
314
313
|
);
|
package/src/js/core/sticky.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
height as getHeight,
|
|
15
15
|
offset as getOffset,
|
|
16
16
|
getScrollingElement,
|
|
17
|
+
intersectRect,
|
|
17
18
|
isString,
|
|
18
19
|
isVisible,
|
|
19
20
|
noop,
|
|
@@ -29,7 +30,6 @@ import {
|
|
|
29
30
|
toPx,
|
|
30
31
|
trigger,
|
|
31
32
|
within,
|
|
32
|
-
intersectRect,
|
|
33
33
|
} from 'uikit-util';
|
|
34
34
|
|
|
35
35
|
export default {
|
package/src/js/core/switcher.js
CHANGED
|
@@ -148,27 +148,21 @@ export default {
|
|
|
148
148
|
|
|
149
149
|
show(item) {
|
|
150
150
|
const prev = this.index();
|
|
151
|
-
const next = getIndex(
|
|
152
|
-
|
|
153
|
-
children(this.$el)
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
if (prev === next) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
151
|
+
const next = getIndex(item, this.toggles, prev);
|
|
152
|
+
const active = getIndex(this.children[next], children(this.$el));
|
|
160
153
|
children(this.$el).forEach((child, i) => {
|
|
161
|
-
toggleClass(child, this.cls,
|
|
162
|
-
attr(this.toggles[i], 'aria-expanded',
|
|
154
|
+
toggleClass(child, this.cls, active === i);
|
|
155
|
+
attr(this.toggles[i], 'aria-expanded', active === i);
|
|
163
156
|
});
|
|
164
157
|
|
|
158
|
+
const animate = prev >= 0 && prev !== next;
|
|
165
159
|
this.connects.forEach(async ({ children }) => {
|
|
166
160
|
await this.toggleElement(
|
|
167
161
|
toNodes(children).filter((child) => hasClass(child, this.cls)),
|
|
168
162
|
false,
|
|
169
|
-
|
|
163
|
+
animate
|
|
170
164
|
);
|
|
171
|
-
await this.toggleElement(children[
|
|
165
|
+
await this.toggleElement(children[active], true, animate);
|
|
172
166
|
});
|
|
173
167
|
},
|
|
174
168
|
},
|
package/src/js/mixin/media.js
CHANGED
package/src/js/mixin/position.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
$,
|
|
3
3
|
flipPosition,
|
|
4
|
+
getCssVar,
|
|
4
5
|
offset as getOffset,
|
|
6
|
+
includes,
|
|
5
7
|
isNumeric,
|
|
6
8
|
isRtl,
|
|
7
9
|
positionAt,
|
|
8
|
-
|
|
9
|
-
toggleClass,
|
|
10
|
+
toPx,
|
|
10
11
|
} from 'uikit-util';
|
|
11
12
|
|
|
12
13
|
export default {
|
|
@@ -14,14 +15,12 @@ export default {
|
|
|
14
15
|
pos: String,
|
|
15
16
|
offset: null,
|
|
16
17
|
flip: Boolean,
|
|
17
|
-
clsPos: String,
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
data: {
|
|
21
21
|
pos: `bottom-${isRtl ? 'right' : 'left'}`,
|
|
22
22
|
flip: true,
|
|
23
23
|
offset: false,
|
|
24
|
-
clsPos: '',
|
|
25
24
|
},
|
|
26
25
|
|
|
27
26
|
connected() {
|
|
@@ -32,13 +31,11 @@ export default {
|
|
|
32
31
|
|
|
33
32
|
methods: {
|
|
34
33
|
positionAt(element, target, boundary) {
|
|
35
|
-
removeClasses(element, `${this.clsPos}-(top|bottom|left|right)(-[a-z]+)?`);
|
|
36
|
-
|
|
37
|
-
let { offset } = this;
|
|
38
34
|
const axis = this.getAxis();
|
|
39
35
|
const dir = this.pos[0];
|
|
40
36
|
const align = this.pos[1];
|
|
41
37
|
|
|
38
|
+
let { offset } = this;
|
|
42
39
|
if (!isNumeric(offset)) {
|
|
43
40
|
const node = $(offset);
|
|
44
41
|
offset = node
|
|
@@ -46,28 +43,60 @@ export default {
|
|
|
46
43
|
getOffset(target)[axis === 'x' ? 'right' : 'bottom']
|
|
47
44
|
: 0;
|
|
48
45
|
}
|
|
46
|
+
offset += toPx(getCssVar('position-margin-offset', element));
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
this.dir = axis === 'x' ? x : y;
|
|
64
|
-
this.align = axis === 'x' ? y : x;
|
|
48
|
+
positionAt(element, target, {
|
|
49
|
+
boundary,
|
|
50
|
+
flip: this.flip,
|
|
51
|
+
attach: {
|
|
52
|
+
element: axis === 'x' ? [flipPosition(dir), align] : [align, flipPosition(dir)],
|
|
53
|
+
target: axis === 'x' ? [dir, align] : [align, dir],
|
|
54
|
+
},
|
|
55
|
+
offset:
|
|
56
|
+
axis === 'x'
|
|
57
|
+
? [dir === 'left' ? -offset : +offset, 0]
|
|
58
|
+
: [0, dir === 'top' ? -offset : +offset],
|
|
59
|
+
});
|
|
65
60
|
|
|
66
|
-
|
|
61
|
+
[this.dir, this.align] = getAlignment(element, target);
|
|
62
|
+
console.log(this.dir, this.align);
|
|
67
63
|
},
|
|
68
64
|
|
|
69
65
|
getAxis() {
|
|
70
|
-
return
|
|
66
|
+
return includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
|
|
71
67
|
},
|
|
72
68
|
},
|
|
73
69
|
};
|
|
70
|
+
|
|
71
|
+
function getAlignment(el, target) {
|
|
72
|
+
const elOffset = getOffset(el);
|
|
73
|
+
const targetOffset = getOffset(target);
|
|
74
|
+
const properties = [
|
|
75
|
+
['left', 'right'],
|
|
76
|
+
['top', 'bottom'],
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
let dir;
|
|
80
|
+
for (const props of properties) {
|
|
81
|
+
if (elOffset[props[0]] > targetOffset[props[1]]) {
|
|
82
|
+
dir = props[1];
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
if (elOffset[props[1]] < targetOffset[props[0]]) {
|
|
86
|
+
dir = props[0];
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let align;
|
|
92
|
+
const props = includes(properties[0], dir) ? properties[1] : properties[0];
|
|
93
|
+
if (elOffset[props[0]] === targetOffset[props[0]]) {
|
|
94
|
+
align = props[0];
|
|
95
|
+
} else if (elOffset[props[1]] === targetOffset[props[1]]) {
|
|
96
|
+
align = props[1];
|
|
97
|
+
} else {
|
|
98
|
+
align = 'center';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return [dir, align];
|
|
102
|
+
}
|
|
@@ -41,8 +41,8 @@ export function offset(element, coordinates) {
|
|
|
41
41
|
const offsetBy = { height: scrollY, width: scrollX };
|
|
42
42
|
|
|
43
43
|
for (const dir in dirs) {
|
|
44
|
-
for (const
|
|
45
|
-
currentOffset[
|
|
44
|
+
for (const prop of dirs[dir]) {
|
|
45
|
+
currentOffset[prop] += offsetBy[dir];
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|