uikit 3.17.9-dev.9f100be74 → 3.17.9-dev.f43c05fb3
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 +10 -2
- 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 +1 -1
- package/dist/js/components/filter.js +2 -2
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +6 -6
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +6 -6
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +2 -2
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +21 -25
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +21 -25
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +3 -3
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +21 -25
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +3 -3
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +4 -4
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +2 -2
- 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 +54 -47
- 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 +62 -55
- package/dist/js/uikit.min.js +1 -1
- package/package.json +12 -12
- package/src/js/api/component.js +2 -2
- package/src/js/api/instance.js +2 -2
- package/src/js/api/observables.js +2 -2
- package/src/js/api/options.js +14 -14
- package/src/js/components/filter.js +1 -2
- package/src/js/components/notification.js +1 -2
- package/src/js/components/sortable.js +4 -5
- package/src/js/components/tooltip.js +1 -2
- package/src/js/core/accordion.js +1 -2
- package/src/js/core/drop.js +23 -20
- package/src/js/core/dropnav.js +2 -3
- package/src/js/core/form-custom.js +5 -5
- package/src/js/core/icon.js +5 -6
- package/src/js/core/navbar.js +1 -2
- package/src/js/core/overflow-auto.js +3 -3
- package/src/js/core/scroll.js +1 -2
- package/src/js/core/scrollspy-nav.js +1 -2
- package/src/js/core/sticky.js +2 -5
- package/src/js/core/switcher.js +10 -12
- package/src/js/core/tab.js +2 -2
- package/src/js/core/toggle.js +3 -5
- package/src/js/mixin/animate.js +7 -7
- package/src/js/mixin/internal/animate-fade.js +2 -2
- package/src/js/mixin/modal.js +4 -6
- package/src/js/mixin/slider-drag.js +1 -2
- package/src/js/mixin/slider-nav.js +7 -8
- package/src/js/mixin/togglable.js +8 -8
- package/src/js/util/dimensions.js +4 -4
- package/src/js/util/event.js +6 -7
- package/src/js/util/lang.js +10 -10
- package/src/js/util/position.js +1 -2
- package/src/js/util/selector.js +2 -2
- package/src/js/util/style.js +2 -2
- package/src/js/util/viewport.js +25 -16
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.17.9-dev.
|
|
5
|
+
"version": "3.17.9-dev.f43c05fb3",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -22,31 +22,31 @@
|
|
|
22
22
|
"packageManager": "pnpm@8.10.1",
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@rollup/plugin-alias": "^5.0.1",
|
|
25
|
-
"@rollup/plugin-replace": "^5.0.
|
|
26
|
-
"archiver": "^6.0.
|
|
25
|
+
"@rollup/plugin-replace": "^5.0.5",
|
|
26
|
+
"archiver": "^6.0.1",
|
|
27
27
|
"camelcase": "^8.0.0",
|
|
28
28
|
"chokidar-cli": "^3.0.0",
|
|
29
29
|
"clean-css": "^5.3.2",
|
|
30
30
|
"dateformat": "^5.0.3",
|
|
31
31
|
"esbuild": "^0.19.5",
|
|
32
|
-
"eslint": "^8.
|
|
32
|
+
"eslint": "^8.53.0",
|
|
33
33
|
"eslint-config-prettier": "^9.0.0",
|
|
34
34
|
"execa": "^8.0.1",
|
|
35
35
|
"fs-extra": "^11.1.1",
|
|
36
|
-
"glob": "^10.3.
|
|
37
|
-
"inquirer": "^9.2.
|
|
38
|
-
"less": "^4.
|
|
36
|
+
"glob": "^10.3.10",
|
|
37
|
+
"inquirer": "^9.2.12",
|
|
38
|
+
"less": "^4.2.0",
|
|
39
39
|
"minimist": "^1.2.8",
|
|
40
40
|
"number-precision": "^1.6.0",
|
|
41
41
|
"p-limit": "^5.0.0",
|
|
42
|
-
"prettier": "^3.0
|
|
43
|
-
"prettier-plugin-organize-imports": "^3.2.
|
|
44
|
-
"rollup": "^4.
|
|
42
|
+
"prettier": "^3.1.0",
|
|
43
|
+
"prettier-plugin-organize-imports": "^3.2.4",
|
|
44
|
+
"rollup": "^4.4.0",
|
|
45
45
|
"rollup-plugin-esbuild": "^6.1.0",
|
|
46
46
|
"rollup-plugin-modify": "^3.0.0",
|
|
47
|
-
"rtlcss": "^4.1.
|
|
47
|
+
"rtlcss": "^4.1.1",
|
|
48
48
|
"semver": "^7.5.4",
|
|
49
|
-
"svgo": "^3.0.
|
|
49
|
+
"svgo": "^3.0.3"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build-scss": "node build/scss",
|
package/src/js/api/component.js
CHANGED
|
@@ -41,8 +41,8 @@ export function createComponent(name, element, data, ...args) {
|
|
|
41
41
|
return Component.options.functional
|
|
42
42
|
? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] })
|
|
43
43
|
: element
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
? $$(element).map(init)[0]
|
|
45
|
+
: init();
|
|
46
46
|
|
|
47
47
|
function init(element) {
|
|
48
48
|
const instance = getComponent(element, name);
|
package/src/js/api/instance.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { remove
|
|
1
|
+
import { remove } from 'uikit-util';
|
|
2
2
|
import { attachToElement, createComponent, detachFromElement, getComponent } from './component';
|
|
3
3
|
import { update } from './global';
|
|
4
4
|
import { callConnected, callDisconnected, callHook } from './hooks';
|
|
@@ -11,7 +11,7 @@ export default function (App) {
|
|
|
11
11
|
|
|
12
12
|
instance.$options.el = el;
|
|
13
13
|
|
|
14
|
-
if (
|
|
14
|
+
if (document.contains(el)) {
|
|
15
15
|
callConnected(instance);
|
|
16
16
|
}
|
|
17
17
|
};
|
package/src/js/api/options.js
CHANGED
|
@@ -90,8 +90,8 @@ function concatStrat(parentVal, childVal) {
|
|
|
90
90
|
? parentVal
|
|
91
91
|
? parentVal.concat(childVal)
|
|
92
92
|
: isArray(childVal)
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
? childVal
|
|
94
|
+
: [childVal]
|
|
95
95
|
: parentVal;
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -140,14 +140,14 @@ export function parseOptions(options, args = []) {
|
|
|
140
140
|
? startsWith(options, '{')
|
|
141
141
|
? JSON.parse(options)
|
|
142
142
|
: args.length && !includes(options, ':')
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
? { [args[0]]: options }
|
|
144
|
+
: options.split(';').reduce((options, option) => {
|
|
145
|
+
const [key, value] = option.split(/:(.*)/);
|
|
146
|
+
if (key && !isUndefined(value)) {
|
|
147
|
+
options[key.trim()] = value.trim();
|
|
148
|
+
}
|
|
149
|
+
return options;
|
|
150
|
+
}, {})
|
|
151
151
|
: {};
|
|
152
152
|
} catch (e) {
|
|
153
153
|
return {};
|
|
@@ -173,8 +173,8 @@ function toList(value) {
|
|
|
173
173
|
return isArray(value)
|
|
174
174
|
? value
|
|
175
175
|
: isString(value)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
? value
|
|
177
|
+
.split(listRe)
|
|
178
|
+
.map((value) => (isNumeric(value) ? toNumber(value) : toBoolean(value.trim())))
|
|
179
|
+
: [value];
|
|
180
180
|
}
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
$$,
|
|
4
4
|
append,
|
|
5
5
|
attr,
|
|
6
|
-
closest,
|
|
7
6
|
css,
|
|
8
7
|
data,
|
|
9
8
|
each,
|
|
@@ -82,7 +81,7 @@ export default {
|
|
|
82
81
|
return;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
if (
|
|
84
|
+
if (e.target.closest('a,button')) {
|
|
86
85
|
e.preventDefault();
|
|
87
86
|
this.apply(e.current);
|
|
88
87
|
}
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
$,
|
|
3
3
|
append,
|
|
4
4
|
apply,
|
|
5
|
-
closest,
|
|
6
5
|
css,
|
|
7
6
|
isVisible,
|
|
8
7
|
parent,
|
|
@@ -81,7 +80,7 @@ export default {
|
|
|
81
80
|
|
|
82
81
|
events: {
|
|
83
82
|
click(e) {
|
|
84
|
-
if (
|
|
83
|
+
if (e.target.closest('a[href="#"],a[href=""]')) {
|
|
85
84
|
e.preventDefault();
|
|
86
85
|
}
|
|
87
86
|
this.close();
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
toggleClass,
|
|
31
31
|
Transition,
|
|
32
32
|
trigger,
|
|
33
|
-
within,
|
|
34
33
|
} from 'uikit-util';
|
|
35
34
|
import Animate from '../mixin/animate';
|
|
36
35
|
import Class from '../mixin/class';
|
|
@@ -181,15 +180,15 @@ export default {
|
|
|
181
180
|
methods: {
|
|
182
181
|
init(e) {
|
|
183
182
|
const { target, button, defaultPrevented } = e;
|
|
184
|
-
const [placeholder] = this.items.filter((el) =>
|
|
183
|
+
const [placeholder] = this.items.filter((el) => el.contains(target));
|
|
185
184
|
|
|
186
185
|
if (
|
|
187
186
|
!placeholder ||
|
|
188
187
|
defaultPrevented ||
|
|
189
188
|
button > 0 ||
|
|
190
189
|
isInput(target) ||
|
|
191
|
-
|
|
192
|
-
(this.handle && !
|
|
190
|
+
target.closest(`.${this.clsNoDrag}`) ||
|
|
191
|
+
(this.handle && !target.closest(this.handle))
|
|
193
192
|
) {
|
|
194
193
|
return;
|
|
195
194
|
}
|
|
@@ -280,7 +279,7 @@ export default {
|
|
|
280
279
|
},
|
|
281
280
|
|
|
282
281
|
remove(element) {
|
|
283
|
-
if (!
|
|
282
|
+
if (!this.target.contains(element)) {
|
|
284
283
|
return;
|
|
285
284
|
}
|
|
286
285
|
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
pointerEnter,
|
|
17
17
|
pointerLeave,
|
|
18
18
|
remove,
|
|
19
|
-
within,
|
|
20
19
|
} from 'uikit-util';
|
|
21
20
|
import { generateId } from '../api/instance';
|
|
22
21
|
import { parseOptions } from '../api/options';
|
|
@@ -112,7 +111,7 @@ export default {
|
|
|
112
111
|
this.hide,
|
|
113
112
|
false,
|
|
114
113
|
(e) =>
|
|
115
|
-
(e.type === pointerDown && !
|
|
114
|
+
(e.type === pointerDown && !this.$el.contains(e.target)) ||
|
|
116
115
|
(e.type === 'keydown' && e.keyCode === keyMap.ESC),
|
|
117
116
|
),
|
|
118
117
|
on([document, ...overflowParents(this.$el)], 'scroll', update, {
|
package/src/js/core/accordion.js
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
toggleClass,
|
|
18
18
|
Transition,
|
|
19
19
|
unwrap,
|
|
20
|
-
within,
|
|
21
20
|
wrapAll,
|
|
22
21
|
} from 'uikit-util';
|
|
23
22
|
import { generateId } from '../api/instance';
|
|
@@ -86,7 +85,7 @@ export default {
|
|
|
86
85
|
contents(items) {
|
|
87
86
|
for (const el of items) {
|
|
88
87
|
const isOpen = hasClass(
|
|
89
|
-
this.items.find((item) =>
|
|
88
|
+
this.items.find((item) => item.contains(el)),
|
|
90
89
|
this.clsOpen,
|
|
91
90
|
);
|
|
92
91
|
|
package/src/js/core/drop.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
$,
|
|
2
3
|
addClass,
|
|
3
4
|
append,
|
|
4
5
|
apply,
|
|
@@ -160,7 +161,7 @@ export default {
|
|
|
160
161
|
!defaultPrevented &&
|
|
161
162
|
hash &&
|
|
162
163
|
isSameSiteAnchor(current) &&
|
|
163
|
-
!
|
|
164
|
+
!this.$el.contains($(hash))
|
|
164
165
|
) {
|
|
165
166
|
this.hide(false);
|
|
166
167
|
}
|
|
@@ -298,7 +299,7 @@ export default {
|
|
|
298
299
|
handler({ target }) {
|
|
299
300
|
if (this.$el !== target) {
|
|
300
301
|
active =
|
|
301
|
-
active === null &&
|
|
302
|
+
active === null && this.$el.contains(target) && this.isToggled()
|
|
302
303
|
? this
|
|
303
304
|
: active;
|
|
304
305
|
return;
|
|
@@ -340,7 +341,7 @@ export default {
|
|
|
340
341
|
}
|
|
341
342
|
|
|
342
343
|
let prev;
|
|
343
|
-
while (active && prev !== active && !
|
|
344
|
+
while (active && prev !== active && !active.$el.contains(this.$el)) {
|
|
344
345
|
prev = active;
|
|
345
346
|
active.hide(false, false);
|
|
346
347
|
}
|
|
@@ -463,7 +464,7 @@ function getPositionedElements(el) {
|
|
|
463
464
|
}
|
|
464
465
|
|
|
465
466
|
function getViewport(el, target) {
|
|
466
|
-
return offsetViewport(overflowParents(target).find((parent) =>
|
|
467
|
+
return offsetViewport(overflowParents(target).find((parent) => parent.contains(el)));
|
|
467
468
|
}
|
|
468
469
|
|
|
469
470
|
function createToggleComponent(drop) {
|
|
@@ -505,22 +506,24 @@ function listenForScrollClose(drop) {
|
|
|
505
506
|
|
|
506
507
|
function listenForBackgroundClose(drop) {
|
|
507
508
|
return on(document, pointerDown, ({ target }) => {
|
|
508
|
-
if (
|
|
509
|
-
|
|
510
|
-
document,
|
|
511
|
-
`${pointerUp} ${pointerCancel} scroll`,
|
|
512
|
-
({ defaultPrevented, type, target: newTarget }) => {
|
|
513
|
-
if (
|
|
514
|
-
!defaultPrevented &&
|
|
515
|
-
type === pointerUp &&
|
|
516
|
-
target === newTarget &&
|
|
517
|
-
!(drop.targetEl && within(target, drop.targetEl))
|
|
518
|
-
) {
|
|
519
|
-
drop.hide(false);
|
|
520
|
-
}
|
|
521
|
-
},
|
|
522
|
-
true,
|
|
523
|
-
);
|
|
509
|
+
if (drop.$el.contains(target)) {
|
|
510
|
+
return;
|
|
524
511
|
}
|
|
512
|
+
|
|
513
|
+
once(
|
|
514
|
+
document,
|
|
515
|
+
`${pointerUp} ${pointerCancel} scroll`,
|
|
516
|
+
({ defaultPrevented, type, target: newTarget }) => {
|
|
517
|
+
if (
|
|
518
|
+
!defaultPrevented &&
|
|
519
|
+
type === pointerUp &&
|
|
520
|
+
target === newTarget &&
|
|
521
|
+
!(drop.targetEl && within(target, drop.targetEl))
|
|
522
|
+
) {
|
|
523
|
+
drop.hide(false);
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
true,
|
|
527
|
+
);
|
|
525
528
|
});
|
|
526
529
|
}
|
package/src/js/core/dropnav.js
CHANGED
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
selFocusable,
|
|
21
21
|
toFloat,
|
|
22
22
|
Transition,
|
|
23
|
-
within,
|
|
24
23
|
} from 'uikit-util';
|
|
25
24
|
import Class from '../mixin/class';
|
|
26
25
|
import Container from '../mixin/container';
|
|
@@ -90,7 +89,7 @@ export default {
|
|
|
90
89
|
if (this.dropContainer !== $el) {
|
|
91
90
|
for (const el of $$(`.${clsDrop}`, this.dropContainer)) {
|
|
92
91
|
const target = this.getDropdown(el)?.targetEl;
|
|
93
|
-
if (!includes(dropdowns, el) && target &&
|
|
92
|
+
if (!includes(dropdowns, el) && target && this.$el.contains(target)) {
|
|
94
93
|
dropdowns.push(el);
|
|
95
94
|
}
|
|
96
95
|
}
|
|
@@ -143,7 +142,7 @@ export default {
|
|
|
143
142
|
active &&
|
|
144
143
|
includes(active.mode, 'hover') &&
|
|
145
144
|
active.targetEl &&
|
|
146
|
-
!
|
|
145
|
+
!current.contains(active.targetEl) &&
|
|
147
146
|
!active.isDelaying
|
|
148
147
|
) {
|
|
149
148
|
active.hide(false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $, $$,
|
|
1
|
+
import { $, $$, isInput, matches, parent, selInput } from 'uikit-util';
|
|
2
2
|
import Class from '../mixin/class';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
@@ -43,9 +43,9 @@ export default {
|
|
|
43
43
|
const value = input.files?.[0]
|
|
44
44
|
? input.files[0].name
|
|
45
45
|
: matches(input, 'select') &&
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
(option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
|
|
47
|
+
? option.textContent
|
|
48
|
+
: input.value;
|
|
49
49
|
|
|
50
50
|
if (prev !== value) {
|
|
51
51
|
target[prop] = value;
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
65
65
|
name: 'reset',
|
|
66
66
|
|
|
67
67
|
el() {
|
|
68
|
-
return
|
|
68
|
+
return this.$el.closest('form');
|
|
69
69
|
},
|
|
70
70
|
|
|
71
71
|
handler() {
|
package/src/js/core/icon.js
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
addClass,
|
|
4
4
|
apply,
|
|
5
5
|
attr,
|
|
6
|
-
closest,
|
|
7
6
|
css,
|
|
8
7
|
each,
|
|
9
8
|
hasAttr,
|
|
@@ -110,7 +109,7 @@ export const NavParentIcon = {
|
|
|
110
109
|
|
|
111
110
|
beforeConnect() {
|
|
112
111
|
const icon = this.$props.icon;
|
|
113
|
-
this.icon =
|
|
112
|
+
this.icon = this.$el.closest('.uk-nav-primary') ? `${icon}-large` : icon;
|
|
114
113
|
},
|
|
115
114
|
};
|
|
116
115
|
|
|
@@ -126,8 +125,8 @@ export const Search = {
|
|
|
126
125
|
hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length
|
|
127
126
|
? 'search-large'
|
|
128
127
|
: parents(this.$el, '.uk-search-navbar').length
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
? 'search-navbar'
|
|
129
|
+
: this.$props.icon;
|
|
131
130
|
|
|
132
131
|
if (hasAttr(this.$el, 'aria-label')) {
|
|
133
132
|
return;
|
|
@@ -137,7 +136,7 @@ export const Search = {
|
|
|
137
136
|
const label = this.t('toggle');
|
|
138
137
|
attr(this.$el, 'aria-label', label);
|
|
139
138
|
} else {
|
|
140
|
-
const button =
|
|
139
|
+
const button = this.$el.closest('a,button');
|
|
141
140
|
if (button) {
|
|
142
141
|
const label = this.t('submit');
|
|
143
142
|
attr(button, 'aria-label', label);
|
|
@@ -172,7 +171,7 @@ const ButtonComponent = {
|
|
|
172
171
|
mixins: [I18n],
|
|
173
172
|
|
|
174
173
|
beforeConnect() {
|
|
175
|
-
const button =
|
|
174
|
+
const button = this.$el.closest('a,button');
|
|
176
175
|
|
|
177
176
|
attr(button, 'role', this.role !== null && isTag(button, 'a') ? 'button' : this.role);
|
|
178
177
|
|
package/src/js/core/navbar.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
$$,
|
|
3
3
|
addClass,
|
|
4
|
-
closest,
|
|
5
4
|
css,
|
|
6
5
|
hasClass,
|
|
7
6
|
observeResize,
|
|
@@ -32,7 +31,7 @@ export default {
|
|
|
32
31
|
},
|
|
33
32
|
|
|
34
33
|
computed: {
|
|
35
|
-
navbarContainer: (_, $el) => closest(
|
|
34
|
+
navbarContainer: (_, $el) => $el.closest('.uk-navbar-container'),
|
|
36
35
|
|
|
37
36
|
dropbarOffset: ({ dropbarTransparentMode }, $el) =>
|
|
38
37
|
dropbarTransparentMode === 'behind' ? $el.offsetHeight : 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css, dimensions, height, isVisible } from 'uikit-util';
|
|
2
2
|
import { resize } from '../api/observables';
|
|
3
3
|
import Class from '../mixin/class';
|
|
4
4
|
|
|
@@ -18,9 +18,9 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
computed: {
|
|
21
|
-
container: ({ selContainer }, $el) => closest(
|
|
21
|
+
container: ({ selContainer }, $el) => $el.closest(selContainer),
|
|
22
22
|
|
|
23
|
-
content: ({ selContent }, $el) => closest(
|
|
23
|
+
content: ({ selContent }, $el) => $el.closest(selContent),
|
|
24
24
|
},
|
|
25
25
|
|
|
26
26
|
observe: resize({
|
package/src/js/core/scroll.js
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
on,
|
|
7
7
|
scrollIntoView,
|
|
8
8
|
trigger,
|
|
9
|
-
within,
|
|
10
9
|
} from 'uikit-util';
|
|
11
10
|
|
|
12
11
|
export default {
|
|
@@ -61,7 +60,7 @@ function clickHandler(e) {
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
for (const instance of instances) {
|
|
64
|
-
if (
|
|
63
|
+
if (instance.$el.contains(e.target) && isSameSiteAnchor(instance.$el)) {
|
|
65
64
|
e.preventDefault();
|
|
66
65
|
if (window.location.href !== instance.$el.href) {
|
|
67
66
|
window.history.pushState({}, '', instance.$el.href);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
$$,
|
|
3
|
-
closest,
|
|
4
3
|
getCoveringElement,
|
|
5
4
|
getTargetedElement,
|
|
6
5
|
hasClass,
|
|
@@ -35,7 +34,7 @@ export default {
|
|
|
35
34
|
links: (_, $el) => $$('a[href*="#"]', $el).filter((el) => el.hash && isSameSiteAnchor(el)),
|
|
36
35
|
|
|
37
36
|
elements({ closest: selector }) {
|
|
38
|
-
return this.links.map((el) => closest(
|
|
37
|
+
return this.links.map((el) => el.closest(selector || '*'));
|
|
39
38
|
},
|
|
40
39
|
},
|
|
41
40
|
|
package/src/js/core/sticky.js
CHANGED
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
toPx,
|
|
26
26
|
toggleClass,
|
|
27
27
|
trigger,
|
|
28
|
-
within,
|
|
29
28
|
} from 'uikit-util';
|
|
30
29
|
import { resize, scroll, viewport } from '../api/observables';
|
|
31
30
|
import Class from '../mixin/class';
|
|
@@ -253,7 +252,7 @@ export default {
|
|
|
253
252
|
|
|
254
253
|
css(placeholder, { height, width, margin });
|
|
255
254
|
|
|
256
|
-
if (!
|
|
255
|
+
if (!document.contains(placeholder)) {
|
|
257
256
|
placeholder.hidden = true;
|
|
258
257
|
}
|
|
259
258
|
(sticky ? before : after)(this.$el, placeholder);
|
|
@@ -456,9 +455,7 @@ function parseProp(value, el, propOffset, padding) {
|
|
|
456
455
|
const refElement = value === true ? parent(el) : query(value, el);
|
|
457
456
|
return (
|
|
458
457
|
getOffset(refElement).bottom -
|
|
459
|
-
(padding && refElement
|
|
460
|
-
? toFloat(css(refElement, 'paddingBottom'))
|
|
461
|
-
: 0)
|
|
458
|
+
(padding && refElement?.contains(el) ? toFloat(css(refElement, 'paddingBottom')) : 0)
|
|
462
459
|
);
|
|
463
460
|
}
|
|
464
461
|
}
|
package/src/js/core/switcher.js
CHANGED
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
$$,
|
|
3
3
|
attr,
|
|
4
4
|
children,
|
|
5
|
-
closest,
|
|
6
5
|
css,
|
|
7
6
|
data,
|
|
8
7
|
endsWith,
|
|
@@ -15,7 +14,6 @@ import {
|
|
|
15
14
|
queryAll,
|
|
16
15
|
toArray,
|
|
17
16
|
toggleClass,
|
|
18
|
-
within,
|
|
19
17
|
} from 'uikit-util';
|
|
20
18
|
import { generateId } from '../api/instance';
|
|
21
19
|
import { lazyload, swipe } from '../api/observables';
|
|
@@ -61,7 +59,7 @@ export default {
|
|
|
61
59
|
|
|
62
60
|
children(_, $el) {
|
|
63
61
|
return children($el).filter((child) =>
|
|
64
|
-
this.toggles.some((toggle) =>
|
|
62
|
+
this.toggles.some((toggle) => child.contains(toggle)),
|
|
65
63
|
);
|
|
66
64
|
},
|
|
67
65
|
},
|
|
@@ -132,14 +130,14 @@ export default {
|
|
|
132
130
|
keyCode === keyMap.HOME
|
|
133
131
|
? 0
|
|
134
132
|
: keyCode === keyMap.END
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
? 'last'
|
|
134
|
+
: (keyCode === keyMap.LEFT && !isVertical) ||
|
|
135
|
+
(keyCode === keyMap.UP && isVertical)
|
|
136
|
+
? 'previous'
|
|
137
|
+
: (keyCode === keyMap.RIGHT && !isVertical) ||
|
|
138
|
+
(keyCode === keyMap.DOWN && isVertical)
|
|
139
|
+
? 'next'
|
|
140
|
+
: -1;
|
|
143
141
|
|
|
144
142
|
if (~i) {
|
|
145
143
|
e.preventDefault();
|
|
@@ -165,7 +163,7 @@ export default {
|
|
|
165
163
|
},
|
|
166
164
|
|
|
167
165
|
handler(e) {
|
|
168
|
-
if (
|
|
166
|
+
if (e.target.closest('a,button')) {
|
|
169
167
|
e.preventDefault();
|
|
170
168
|
this.show(data(e.current, this.attrItem));
|
|
171
169
|
}
|
package/src/js/core/tab.js
CHANGED
|
@@ -21,8 +21,8 @@ export default {
|
|
|
21
21
|
const cls = hasClass(this.$el, 'uk-tab-left')
|
|
22
22
|
? 'uk-tab-left'
|
|
23
23
|
: hasClass(this.$el, 'uk-tab-right')
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
? 'uk-tab-right'
|
|
25
|
+
: false;
|
|
26
26
|
|
|
27
27
|
if (cls) {
|
|
28
28
|
this.$create('toggle', this.$el, { cls, mode: 'media', media: this.media });
|
package/src/js/core/toggle.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attr,
|
|
3
|
-
closest,
|
|
4
3
|
hasAttr,
|
|
5
4
|
hasClass,
|
|
6
5
|
includes,
|
|
@@ -15,7 +14,6 @@ import {
|
|
|
15
14
|
pointerLeave,
|
|
16
15
|
queryAll,
|
|
17
16
|
trigger,
|
|
18
|
-
within,
|
|
19
17
|
} from 'uikit-util';
|
|
20
18
|
import { lazyload } from '../api/observables';
|
|
21
19
|
import Media from '../mixin/media';
|
|
@@ -85,7 +83,7 @@ export default {
|
|
|
85
83
|
pointerDown,
|
|
86
84
|
() => trigger(this.$el, 'blur'),
|
|
87
85
|
true,
|
|
88
|
-
(e) => !
|
|
86
|
+
(e) => !this.$el.contains(e.target),
|
|
89
87
|
);
|
|
90
88
|
|
|
91
89
|
// Prevent initial click to prevent double toggle through focus + click
|
|
@@ -163,8 +161,8 @@ export default {
|
|
|
163
161
|
let link;
|
|
164
162
|
if (
|
|
165
163
|
this._preventClick ||
|
|
166
|
-
|
|
167
|
-
((link =
|
|
164
|
+
e.target.closest('a[href="#"], a[href=""]') ||
|
|
165
|
+
((link = e.target.closest('a[href]')) &&
|
|
168
166
|
(!this.isToggled(this.target) ||
|
|
169
167
|
(link.hash && matches(this.target, link.hash))))
|
|
170
168
|
) {
|
package/src/js/mixin/animate.js
CHANGED
|
@@ -20,13 +20,13 @@ export default {
|
|
|
20
20
|
name === 'fade'
|
|
21
21
|
? fade
|
|
22
22
|
: name === 'delayed-fade'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
? (...args) => fade(...args, 40)
|
|
24
|
+
: name
|
|
25
|
+
? slide
|
|
26
|
+
: () => {
|
|
27
|
+
action();
|
|
28
|
+
return Promise.resolve();
|
|
29
|
+
};
|
|
30
30
|
|
|
31
31
|
return animationFn(action, target, this.duration).catch(noop);
|
|
32
32
|
},
|
|
@@ -93,8 +93,8 @@ export default function fade(action, target, duration, stagger = 0) {
|
|
|
93
93
|
return hasClass(target, clsLeave)
|
|
94
94
|
? waitTransitionend(target).then(enterFn)
|
|
95
95
|
: hasClass(target, clsEnter)
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
? waitTransitionend(target).then(leaveFn).then(enterFn)
|
|
97
|
+
: leaveFn().then(enterFn);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
function transitionIndex(target, next) {
|