uikit 3.16.11-dev.cc1aeb568 → 3.16.12-dev.38cb458de
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 +6 -0
- package/build/release.js +1 -1
- package/dist/css/uikit-core-rtl.css +4 -14
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +4 -14
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +4 -14
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +4 -14
- 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 +3 -3
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +3 -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 +3 -2
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +3 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +2 -2
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +3 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +2 -2
- 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 +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 +155 -139
- 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 +156 -140
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/props.js +4 -12
- package/src/js/api/watch.js +3 -4
- package/src/js/core/icon.js +3 -5
- package/src/js/core/margin.js +2 -2
- package/src/js/core/scroll.js +3 -1
- package/src/js/core/svg.js +58 -125
- package/src/js/core/switcher.js +2 -2
- package/src/js/mixin/slider-drag.js +2 -2
- package/src/js/mixin/svg.js +86 -0
- package/src/js/mixin/togglable.js +2 -1
- package/src/js/util/dom.js +2 -2
- package/src/js/util/filter.js +2 -2
- package/src/less/components/dropbar.less +1 -1
- package/src/less/components/dropdown.less +1 -1
- package/src/less/components/lightbox.less +0 -1
- package/src/less/components/navbar.less +1 -1
- package/src/less/components/visibility.less +3 -1
- package/src/scss/components/dropbar.scss +1 -1
- package/src/scss/components/dropdown.scss +1 -1
- package/src/scss/components/lightbox.scss +0 -1
- package/src/scss/components/navbar.scss +1 -1
- package/src/scss/components/visibility.scss +3 -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.16.
|
|
5
|
+
"version": "3.16.12-dev.38cb458de",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/api/props.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { registerObserver } from './observer';
|
|
2
2
|
import { coerce, parseOptions } from './options';
|
|
3
|
-
import {
|
|
4
|
-
camelize,
|
|
5
|
-
data as getData,
|
|
6
|
-
hasOwn,
|
|
7
|
-
hyphenate,
|
|
8
|
-
isArray,
|
|
9
|
-
isUndefined,
|
|
10
|
-
startsWith,
|
|
11
|
-
} from 'uikit-util';
|
|
3
|
+
import { camelize, data as getData, hasOwn, hyphenate, isUndefined, startsWith } from 'uikit-util';
|
|
12
4
|
|
|
13
5
|
export function initProps(instance) {
|
|
14
6
|
const props = getProps(instance.$options);
|
|
@@ -70,13 +62,13 @@ function notIn(options, key) {
|
|
|
70
62
|
|
|
71
63
|
export function initPropsObserver(instance) {
|
|
72
64
|
const { $options, $props } = instance;
|
|
73
|
-
const { id,
|
|
65
|
+
const { id, props, el } = $options;
|
|
74
66
|
|
|
75
|
-
if (!props
|
|
67
|
+
if (!props) {
|
|
76
68
|
return;
|
|
77
69
|
}
|
|
78
70
|
|
|
79
|
-
const attributes =
|
|
71
|
+
const attributes = Object.keys(props);
|
|
80
72
|
const filter = attributes.map((key) => hyphenate(key)).concat(id);
|
|
81
73
|
|
|
82
74
|
const observer = new MutationObserver((records) => {
|
package/src/js/api/watch.js
CHANGED
|
@@ -20,11 +20,10 @@ export function registerWatch(instance, watch, name) {
|
|
|
20
20
|
export function runWatches(instance, values) {
|
|
21
21
|
for (const { name, handler, immediate = true } of instance._watches) {
|
|
22
22
|
if (
|
|
23
|
-
instance._initial
|
|
24
|
-
|
|
25
|
-
: hasOwn(values, name) && !isEqual(values[name], instance[name])
|
|
23
|
+
(instance._initial && immediate) ||
|
|
24
|
+
(hasOwn(values, name) && !isEqual(values[name], instance[name]))
|
|
26
25
|
) {
|
|
27
|
-
handler.call(instance, instance[name],
|
|
26
|
+
handler.call(instance, instance[name], values[name]);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
instance._initial = false;
|
package/src/js/core/icon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Svg from '../mixin/svg';
|
|
2
2
|
import I18n from '../mixin/i18n';
|
|
3
3
|
import closeIcon from '../../images/components/close-icon.svg';
|
|
4
4
|
import closeLarge from '../../images/components/close-large.svg';
|
|
@@ -64,13 +64,11 @@ const icons = {
|
|
|
64
64
|
const Icon = {
|
|
65
65
|
install,
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
mixins: [Svg],
|
|
68
68
|
|
|
69
69
|
args: 'icon',
|
|
70
70
|
|
|
71
|
-
props:
|
|
72
|
-
|
|
73
|
-
data: { include: [] },
|
|
71
|
+
props: { icon: String },
|
|
74
72
|
|
|
75
73
|
isIcon: true,
|
|
76
74
|
|
package/src/js/core/margin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isRtl, isVisible, offsetPosition,
|
|
1
|
+
import { children, isRtl, isVisible, offsetPosition, toggleClass } from 'uikit-util';
|
|
2
2
|
import { mutation, resize } from '../api/observables';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
},
|
|
22
22
|
}),
|
|
23
23
|
resize({
|
|
24
|
-
target: ({ $el }) => [$el, ...
|
|
24
|
+
target: ({ $el }) => [$el, ...children($el)],
|
|
25
25
|
}),
|
|
26
26
|
],
|
|
27
27
|
|
package/src/js/core/scroll.js
CHANGED
|
@@ -63,7 +63,9 @@ function clickHandler(e) {
|
|
|
63
63
|
for (const instance of instances) {
|
|
64
64
|
if (within(e.target, instance.$el) && isSameSiteAnchor(instance.$el)) {
|
|
65
65
|
e.preventDefault();
|
|
66
|
-
window.
|
|
66
|
+
if (window.location.href !== instance.$el.href) {
|
|
67
|
+
window.history.pushState({}, '', instance.$el.href);
|
|
68
|
+
}
|
|
67
69
|
instance.scrollTo(getTargetedElement(instance.$el));
|
|
68
70
|
}
|
|
69
71
|
}
|
package/src/js/core/svg.js
CHANGED
|
@@ -1,102 +1,65 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Svg from '../mixin/svg';
|
|
2
|
+
import Class from '../mixin/class';
|
|
2
3
|
import { getMaxPathLength } from '../util/svg';
|
|
4
|
+
import { mutation } from '../api/observables';
|
|
3
5
|
import {
|
|
4
6
|
$,
|
|
5
|
-
|
|
6
|
-
append,
|
|
7
|
+
addClass,
|
|
7
8
|
attr,
|
|
9
|
+
css,
|
|
8
10
|
includes,
|
|
9
11
|
isTag,
|
|
10
|
-
isVoidElement,
|
|
11
12
|
memoize,
|
|
12
|
-
noop,
|
|
13
|
-
observeIntersection,
|
|
14
13
|
once,
|
|
15
|
-
remove,
|
|
16
14
|
removeAttr,
|
|
17
15
|
startsWith,
|
|
18
|
-
toFloat,
|
|
19
16
|
} from 'uikit-util';
|
|
20
17
|
|
|
21
18
|
export default {
|
|
19
|
+
mixins: [Class, Svg],
|
|
20
|
+
|
|
22
21
|
args: 'src',
|
|
23
22
|
|
|
24
23
|
props: {
|
|
25
|
-
id: Boolean,
|
|
26
|
-
icon: String,
|
|
27
24
|
src: String,
|
|
28
|
-
|
|
29
|
-
width: Number,
|
|
30
|
-
height: Number,
|
|
31
|
-
ratio: Number,
|
|
32
|
-
class: String,
|
|
33
|
-
strokeAnimation: Boolean,
|
|
25
|
+
icon: String,
|
|
34
26
|
attributes: 'list',
|
|
27
|
+
strokeAnimation: Boolean,
|
|
35
28
|
},
|
|
36
29
|
|
|
37
30
|
data: {
|
|
38
|
-
ratio: 1,
|
|
39
|
-
include: ['style', 'class'],
|
|
40
|
-
class: '',
|
|
41
31
|
strokeAnimation: false,
|
|
42
32
|
},
|
|
43
33
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
observe: [
|
|
35
|
+
mutation({
|
|
36
|
+
async handler() {
|
|
37
|
+
const svg = await this.svg;
|
|
38
|
+
if (svg) {
|
|
39
|
+
applyAttributes.call(this, svg);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
options: {
|
|
43
|
+
attributes: true,
|
|
44
|
+
attributeFilter: ['id', 'class', 'style'],
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
48
|
+
|
|
49
|
+
async connected() {
|
|
50
|
+
if (includes(this.src, '#')) {
|
|
50
51
|
[this.src, this.icon] = this.src.split('#');
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
remove(this.svgEl);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
this.applyAttributes(svg, el);
|
|
62
|
-
|
|
63
|
-
return (this.svgEl = svg);
|
|
54
|
+
const svg = await this.svg;
|
|
55
|
+
if (svg) {
|
|
56
|
+
applyAttributes.call(this, svg);
|
|
57
|
+
if (this.strokeAnimation) {
|
|
58
|
+
applyAnimation(svg);
|
|
64
59
|
}
|
|
65
|
-
}, noop);
|
|
66
|
-
|
|
67
|
-
if (this.strokeAnimation) {
|
|
68
|
-
this.svg.then((el) => {
|
|
69
|
-
if (this._connected && el) {
|
|
70
|
-
applyAnimation(el);
|
|
71
|
-
registerObserver(
|
|
72
|
-
this,
|
|
73
|
-
observeIntersection(el, (records, observer) => {
|
|
74
|
-
applyAnimation(el);
|
|
75
|
-
observer.disconnect();
|
|
76
|
-
})
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
60
|
}
|
|
81
61
|
},
|
|
82
62
|
|
|
83
|
-
disconnected() {
|
|
84
|
-
this.svg.then((svg) => {
|
|
85
|
-
if (this._connected) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (isVoidElement(this.$el)) {
|
|
90
|
-
this.$el.hidden = false;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
remove(svg);
|
|
94
|
-
this.svgEl = null;
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
this.svg = null;
|
|
98
|
-
},
|
|
99
|
-
|
|
100
63
|
methods: {
|
|
101
64
|
async getSvg() {
|
|
102
65
|
if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
|
|
@@ -107,39 +70,28 @@ export default {
|
|
|
107
70
|
|
|
108
71
|
return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
|
|
109
72
|
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
110
75
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (includes(this.include, prop) && prop in this) {
|
|
114
|
-
attr(el, prop, this[prop]);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
for (const attribute in this.attributes) {
|
|
119
|
-
const [prop, value] = this.attributes[attribute].split(':', 2);
|
|
120
|
-
attr(el, prop, value);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (!this.id) {
|
|
124
|
-
removeAttr(el, 'id');
|
|
125
|
-
}
|
|
76
|
+
function applyAttributes(el) {
|
|
77
|
+
const { $el } = this;
|
|
126
78
|
|
|
127
|
-
|
|
128
|
-
let dimensions = props.map((prop) => this[prop]);
|
|
79
|
+
addClass(el, attr($el, 'class'));
|
|
129
80
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
81
|
+
for (let i = 0; i < $el.style.length; i++) {
|
|
82
|
+
const prop = $el.style[i];
|
|
83
|
+
css(el, prop, css($el, prop));
|
|
84
|
+
}
|
|
133
85
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
86
|
+
for (const attribute in this.attributes) {
|
|
87
|
+
const [prop, value] = this.attributes[attribute].split(':', 2);
|
|
88
|
+
attr(el, prop, value);
|
|
89
|
+
}
|
|
138
90
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
}
|
|
91
|
+
if (!this.$el.id) {
|
|
92
|
+
removeAttr(el, 'id');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
143
95
|
|
|
144
96
|
const loadSVG = memoize(async (src) => {
|
|
145
97
|
if (src) {
|
|
@@ -155,7 +107,7 @@ const loadSVG = memoize(async (src) => {
|
|
|
155
107
|
|
|
156
108
|
function parseSVG(svg, icon) {
|
|
157
109
|
if (icon && includes(svg, '<symbol')) {
|
|
158
|
-
svg = parseSymbols(svg
|
|
110
|
+
svg = parseSymbols(svg)[icon] || svg;
|
|
159
111
|
}
|
|
160
112
|
|
|
161
113
|
svg = $(svg.substr(svg.indexOf('<svg')));
|
|
@@ -163,43 +115,24 @@ function parseSVG(svg, icon) {
|
|
|
163
115
|
}
|
|
164
116
|
|
|
165
117
|
const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
|
|
166
|
-
const symbols = {};
|
|
167
118
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
symbols[svg] = {};
|
|
119
|
+
const parseSymbols = memoize(function (svg) {
|
|
120
|
+
const symbols = {};
|
|
171
121
|
|
|
172
|
-
|
|
122
|
+
symbolRe.lastIndex = 0;
|
|
173
123
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
124
|
+
let match;
|
|
125
|
+
while ((match = symbolRe.exec(svg))) {
|
|
126
|
+
symbols[match[3]] = `<svg xmlns="http://www.w3.org/2000/svg"${match[1]}svg>`;
|
|
178
127
|
}
|
|
179
128
|
|
|
180
|
-
return symbols
|
|
181
|
-
}
|
|
129
|
+
return symbols;
|
|
130
|
+
});
|
|
182
131
|
|
|
183
132
|
function applyAnimation(el) {
|
|
184
133
|
const length = getMaxPathLength(el);
|
|
185
134
|
|
|
186
135
|
if (length) {
|
|
187
|
-
el
|
|
136
|
+
css(el, '--uk-animation-stroke', length);
|
|
188
137
|
}
|
|
189
138
|
}
|
|
190
|
-
|
|
191
|
-
function insertSVG(el, root) {
|
|
192
|
-
if (isVoidElement(root) || isTag(root, 'canvas')) {
|
|
193
|
-
root.hidden = true;
|
|
194
|
-
|
|
195
|
-
const next = root.nextElementSibling;
|
|
196
|
-
return equals(el, next) ? next : after(root, el);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const last = root.lastElementChild;
|
|
200
|
-
return equals(el, last) ? last : append(root, el);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function equals(el, other) {
|
|
204
|
-
return isTag(el, 'svg') && isTag(other, 'svg') && el.innerHTML === other.innerHTML;
|
|
205
|
-
}
|
package/src/js/core/switcher.js
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
isNode,
|
|
18
18
|
matches,
|
|
19
19
|
queryAll,
|
|
20
|
+
toArray,
|
|
20
21
|
toggleClass,
|
|
21
|
-
toNodes,
|
|
22
22
|
within,
|
|
23
23
|
} from 'uikit-util';
|
|
24
24
|
|
|
@@ -242,7 +242,7 @@ export default {
|
|
|
242
242
|
const animate = prev >= 0 && prev !== next;
|
|
243
243
|
this.connects.forEach(async ({ children }) => {
|
|
244
244
|
await this.toggleElement(
|
|
245
|
-
|
|
245
|
+
toArray(children).filter((child) => hasClass(child, this.cls)),
|
|
246
246
|
false,
|
|
247
247
|
animate
|
|
248
248
|
);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
off,
|
|
10
10
|
on,
|
|
11
11
|
selInput,
|
|
12
|
-
|
|
12
|
+
toArray,
|
|
13
13
|
trigger,
|
|
14
14
|
} from 'uikit-util';
|
|
15
15
|
|
|
@@ -228,6 +228,6 @@ export default {
|
|
|
228
228
|
function hasSelectableText(el) {
|
|
229
229
|
return (
|
|
230
230
|
css(el, 'userSelect') !== 'none' &&
|
|
231
|
-
|
|
231
|
+
toArray(el.childNodes).some((el) => el.nodeType === 3 && el.textContent.trim())
|
|
232
232
|
);
|
|
233
233
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { after, append, attr, isTag, isVoidElement, noop, remove, toFloat } from 'uikit-util';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
args: 'src',
|
|
5
|
+
|
|
6
|
+
props: {
|
|
7
|
+
width: Number,
|
|
8
|
+
height: Number,
|
|
9
|
+
ratio: Number,
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
data: {
|
|
13
|
+
ratio: 1,
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
connected() {
|
|
17
|
+
this.svg = this.getSvg().then((el) => {
|
|
18
|
+
if (!this._connected) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const svg = insertSVG(el, this.$el);
|
|
23
|
+
|
|
24
|
+
if (this.svgEl && svg !== this.svgEl) {
|
|
25
|
+
remove(this.svgEl);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
applyWidthAndHeight.call(this, svg, el);
|
|
29
|
+
|
|
30
|
+
return (this.svgEl = svg);
|
|
31
|
+
}, noop);
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
disconnected() {
|
|
35
|
+
this.svg.then((svg) => {
|
|
36
|
+
if (this._connected) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (isVoidElement(this.$el)) {
|
|
41
|
+
this.$el.hidden = false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
remove(svg);
|
|
45
|
+
this.svgEl = null;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
this.svg = null;
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
methods: {
|
|
52
|
+
async getSvg() {},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function insertSVG(el, root) {
|
|
57
|
+
if (isVoidElement(root) || isTag(root, 'canvas')) {
|
|
58
|
+
root.hidden = true;
|
|
59
|
+
|
|
60
|
+
const next = root.nextElementSibling;
|
|
61
|
+
return equals(el, next) ? next : after(root, el);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const last = root.lastElementChild;
|
|
65
|
+
return equals(el, last) ? last : append(root, el);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function equals(el, other) {
|
|
69
|
+
return isTag(el, 'svg') && isTag(other, 'svg') && el.innerHTML === other.innerHTML;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function applyWidthAndHeight(el, ref) {
|
|
73
|
+
const props = ['width', 'height'];
|
|
74
|
+
let dimensions = props.map((prop) => this[prop]);
|
|
75
|
+
|
|
76
|
+
if (!dimensions.some((val) => val)) {
|
|
77
|
+
dimensions = props.map((prop) => attr(ref, prop));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const viewBox = attr(ref, 'viewBox');
|
|
81
|
+
if (viewBox && !dimensions.some((val) => val)) {
|
|
82
|
+
dimensions = viewBox.split(' ').slice(2);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
|
|
86
|
+
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
startsWith,
|
|
15
15
|
toFloat,
|
|
16
16
|
toggleClass,
|
|
17
|
+
toNode,
|
|
17
18
|
toNodes,
|
|
18
19
|
Transition,
|
|
19
20
|
trigger,
|
|
@@ -96,7 +97,7 @@ export default {
|
|
|
96
97
|
},
|
|
97
98
|
|
|
98
99
|
isToggled(el = this.$el) {
|
|
99
|
-
|
|
100
|
+
el = toNode(el);
|
|
100
101
|
return hasClass(el, this.clsEnter)
|
|
101
102
|
? true
|
|
102
103
|
: hasClass(el, this.clsLeave)
|
package/src/js/util/dom.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { once } from './event';
|
|
2
2
|
import { parent } from './filter';
|
|
3
3
|
import { find, findAll } from './selector';
|
|
4
|
-
import { isElement, isString, isUndefined, startsWith, toNode, toNodes } from './lang';
|
|
4
|
+
import { isElement, isString, isUndefined, startsWith, toArray, toNode, toNodes } from './lang';
|
|
5
5
|
|
|
6
6
|
export function ready(fn) {
|
|
7
7
|
if (document.readyState !== 'loading') {
|
|
@@ -59,7 +59,7 @@ export function wrapInner(element, structure) {
|
|
|
59
59
|
return toNodes(
|
|
60
60
|
toNodes(element).map((element) =>
|
|
61
61
|
element.hasChildNodes()
|
|
62
|
-
? wrapAll(
|
|
62
|
+
? wrapAll(toArray(element.childNodes), structure)
|
|
63
63
|
: append(element, structure)
|
|
64
64
|
)
|
|
65
65
|
);
|
package/src/js/util/filter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isElement, isString, startsWith, toNode, toNodes } from './lang';
|
|
1
|
+
import { isElement, isString, startsWith, toArray, toNode, toNodes } from './lang';
|
|
2
2
|
|
|
3
3
|
const voidElements = {
|
|
4
4
|
area: true,
|
|
@@ -77,7 +77,7 @@ export function parents(element, selector) {
|
|
|
77
77
|
|
|
78
78
|
export function children(element, selector) {
|
|
79
79
|
element = toNode(element);
|
|
80
|
-
const children = element ?
|
|
80
|
+
const children = element ? toArray(element.children) : [];
|
|
81
81
|
return selector ? filter(children, selector) : children;
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
.uk-dropbar:extend(.uk-light all) when (@dropbar-color-mode = light) {}
|
|
84
84
|
.uk-dropbar:extend(.uk-dark all) when (@dropbar-color-mode = dark) {}
|
|
85
85
|
|
|
86
|
-
.uk-dropbar :focus-visible {
|
|
86
|
+
.uk-dropbar :focus-visible when (@dropbar-color-mode = dark) {
|
|
87
87
|
outline-color: @dropbar-focus-outline !important;
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
.uk-dropdown:extend(.uk-light all) when (@dropdown-color-mode = light) {}
|
|
81
81
|
.uk-dropdown:extend(.uk-dark all) when (@dropdown-color-mode = dark) {}
|
|
82
82
|
|
|
83
|
-
.uk-dropdown :focus-visible {
|
|
83
|
+
.uk-dropdown :focus-visible when (@dropdown-color-mode = dark) {
|
|
84
84
|
outline-color: @dropdown-focus-outline !important;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
.uk-navbar-dropdown:extend(.uk-light all) when (@navbar-dropdown-color-mode = light) {}
|
|
403
403
|
.uk-navbar-dropdown:extend(.uk-dark all) when (@navbar-dropdown-color-mode = dark) {}
|
|
404
404
|
|
|
405
|
-
.uk-navbar-dropdown :focus-visible {
|
|
405
|
+
.uk-navbar-dropdown :focus-visible when (@navbar-dropdown-color-mode = dark) {
|
|
406
406
|
outline-color: @navbar-dropdown-focus-outline !important;
|
|
407
407
|
}
|
|
408
408
|
|
|
@@ -135,9 +135,11 @@
|
|
|
135
135
|
/*
|
|
136
136
|
* Keep space when hidden.
|
|
137
137
|
* Hide element without shrinking its dimension.
|
|
138
|
+
* Unfortunately, can't use `clip-path: inset(50%)` because hover won't work
|
|
139
|
+
* if the element is positioned outside of the toggle box.
|
|
138
140
|
*/
|
|
139
141
|
|
|
140
|
-
.uk-visible-toggle:not(:hover):not(:focus) .uk-invisible-hover:not(:focus-within) {
|
|
142
|
+
.uk-visible-toggle:not(:hover):not(:focus) .uk-invisible-hover:not(:focus-within) { opacity: 0 !important; }
|
|
141
143
|
|
|
142
144
|
|
|
143
145
|
/* Based on Hover Capability of the Pointing Device
|
|
@@ -83,7 +83,7 @@ $dropbar-large-padding-bottom: $dropbar-large-padding-top !def
|
|
|
83
83
|
@if ( $dropbar-color-mode == light ) { .uk-dropbar { @extend .uk-light !optional;} }
|
|
84
84
|
@if ( $dropbar-color-mode == dark ) { .uk-dropbar { @extend .uk-dark !optional;} }
|
|
85
85
|
|
|
86
|
-
.uk-dropbar :focus-visible {
|
|
86
|
+
.uk-dropbar :focus-visible when ($dropbar-color-mode = dark) {
|
|
87
87
|
outline-color: $dropbar-focus-outline !important;
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -80,7 +80,7 @@ $dropdown-nav-sublist-item-hover-color: $global-color !default;
|
|
|
80
80
|
@if ( $dropdown-color-mode == light ) { .uk-dropdown { @extend .uk-light !optional;} }
|
|
81
81
|
@if ( $dropdown-color-mode == dark ) { .uk-dropdown { @extend .uk-dark !optional;} }
|
|
82
82
|
|
|
83
|
-
.uk-dropdown :focus-visible {
|
|
83
|
+
.uk-dropdown :focus-visible when ($dropdown-color-mode = dark) {
|
|
84
84
|
outline-color: $dropdown-focus-outline !important;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -402,7 +402,7 @@ $navbar-dropdown-nav-sublist-item-active-color: $global-emphasis-color !default
|
|
|
402
402
|
@if ( $navbar-dropdown-color-mode == light ) { .uk-navbar-dropdown { @extend .uk-light !optional;} }
|
|
403
403
|
@if ( $navbar-dropdown-color-mode == dark ) { .uk-navbar-dropdown { @extend .uk-dark !optional;} }
|
|
404
404
|
|
|
405
|
-
.uk-navbar-dropdown :focus-visible {
|
|
405
|
+
.uk-navbar-dropdown :focus-visible when ($navbar-dropdown-color-mode = dark) {
|
|
406
406
|
outline-color: $navbar-dropdown-focus-outline !important;
|
|
407
407
|
}
|
|
408
408
|
|
|
@@ -135,9 +135,11 @@
|
|
|
135
135
|
/*
|
|
136
136
|
* Keep space when hidden.
|
|
137
137
|
* Hide element without shrinking its dimension.
|
|
138
|
+
* Unfortunately, can't use `clip-path: inset(50%)` because hover won't work
|
|
139
|
+
* if the element is positioned outside of the toggle box.
|
|
138
140
|
*/
|
|
139
141
|
|
|
140
|
-
.uk-visible-toggle:not(:hover):not(:focus) .uk-invisible-hover:not(:focus-within) {
|
|
142
|
+
.uk-visible-toggle:not(:hover):not(:focus) .uk-invisible-hover:not(:focus-within) { opacity: 0 !important; }
|
|
141
143
|
|
|
142
144
|
|
|
143
145
|
/* Based on Hover Capability of the Pointing Device
|