uikit 3.12.3-dev.ebebb4f57 → 3.13.0
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 +9 -1
- package/dist/css/uikit-core-rtl.css +7 -4
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +7 -4
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +7 -4
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +7 -4
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +3 -3
- 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 +11 -2
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +13 -4
- 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 +61 -10
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +28 -15
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +12 -3
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +28 -15
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +11 -2
- 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 +12 -20
- 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 +360 -365
- 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 +376 -379
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/hooks.js +3 -3
- package/src/js/api/state.js +14 -39
- package/src/js/components/countdown.js +2 -2
- package/src/js/components/lightbox.js +1 -1
- package/src/js/components/parallax.js +3 -1
- package/src/js/components/slider-parallax.js +6 -4
- package/src/js/components/slider.js +1 -1
- package/src/js/core/accordion.js +6 -3
- package/src/js/core/core.js +2 -17
- package/src/js/core/cover.js +3 -6
- package/src/js/core/drop.js +15 -33
- package/src/js/core/form-custom.js +8 -9
- package/src/js/core/grid.js +2 -1
- package/src/js/core/height-match.js +12 -2
- package/src/js/core/height-viewport.js +8 -7
- package/src/js/core/icon.js +9 -16
- package/src/js/core/img.js +5 -16
- package/src/js/core/index.js +0 -1
- package/src/js/core/leader.js +7 -13
- package/src/js/core/margin.js +16 -1
- package/src/js/core/overflow-auto.js +7 -10
- package/src/js/core/responsive.js +7 -0
- package/src/js/core/scroll.js +6 -2
- package/src/js/core/scrollspy-nav.js +19 -16
- package/src/js/core/scrollspy.js +5 -11
- package/src/js/core/sticky.js +22 -31
- package/src/js/core/svg.js +16 -14
- package/src/js/core/switcher.js +4 -0
- package/src/js/core/toggle.js +28 -20
- package/src/js/core/video.js +2 -8
- package/src/js/mixin/media.js +28 -8
- package/src/js/mixin/parallax.js +2 -1
- package/src/js/mixin/position.js +10 -18
- package/src/js/mixin/resize.js +11 -0
- package/src/js/mixin/scroll.js +32 -0
- package/src/js/mixin/slider.js +2 -1
- package/src/js/util/class.js +1 -6
- package/src/js/util/mouse.js +1 -1
- package/src/js/util/observer.js +57 -20
- package/src/js/util/selector.js +24 -23
- package/src/less/components/modal.less +6 -3
- package/src/scss/components/modal.scss +6 -3
- package/tests/grid.html +9 -9
- package/tests/js/index.js +1 -1
- package/tests/slider.html +1 -1
- package/tests/slideshow.html +1 -1
- package/tests/sticky.html +0 -6
- package/src/js/core/gif.js +0 -22
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.
|
|
5
|
+
"version": "3.13.0",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
package/src/js/api/hooks.js
CHANGED
|
@@ -11,7 +11,7 @@ export default function (UIkit) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
this._data = {};
|
|
14
|
-
this.
|
|
14
|
+
this._computed = {};
|
|
15
15
|
|
|
16
16
|
this._initProps();
|
|
17
17
|
|
|
@@ -105,8 +105,8 @@ export default function (UIkit) {
|
|
|
105
105
|
const {
|
|
106
106
|
$options: { computed },
|
|
107
107
|
} = this;
|
|
108
|
-
const values = { ...this.
|
|
109
|
-
this.
|
|
108
|
+
const values = { ...this._computed };
|
|
109
|
+
this._computed = {};
|
|
110
110
|
|
|
111
111
|
for (const key in computed) {
|
|
112
112
|
const { watch, immediate } = computed[key];
|
package/src/js/api/state.js
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
data as getData,
|
|
5
5
|
hasOwn,
|
|
6
6
|
hyphenate,
|
|
7
|
-
includes,
|
|
8
7
|
isArray,
|
|
9
8
|
isFunction,
|
|
10
9
|
isNumeric,
|
|
@@ -62,7 +61,7 @@ export default function (UIkit) {
|
|
|
62
61
|
UIkit.prototype._initComputeds = function () {
|
|
63
62
|
const { computed } = this.$options;
|
|
64
63
|
|
|
65
|
-
this.
|
|
64
|
+
this._computed = {};
|
|
66
65
|
|
|
67
66
|
if (computed) {
|
|
68
67
|
for (const key in computed) {
|
|
@@ -101,22 +100,19 @@ export default function (UIkit) {
|
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
for (const { events = [] } of this.$options.update || []) {
|
|
105
|
-
if (includes(events, 'scroll')) {
|
|
106
|
-
registerScrollListener(this._uid, () => this.$emit('scroll'));
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
103
|
};
|
|
111
104
|
|
|
112
105
|
UIkit.prototype._unbindEvents = function () {
|
|
113
106
|
this._events.forEach((unbind) => unbind());
|
|
114
107
|
delete this._events;
|
|
115
|
-
unregisterScrollListener(this._uid);
|
|
116
108
|
};
|
|
117
109
|
|
|
118
110
|
UIkit.prototype._initObservers = function () {
|
|
119
|
-
this._observers = [
|
|
111
|
+
this._observers = [initPropsObserver(this)];
|
|
112
|
+
|
|
113
|
+
if (this.$options.computed) {
|
|
114
|
+
this.registerObserver(initChildListObserver(this));
|
|
115
|
+
}
|
|
120
116
|
};
|
|
121
117
|
|
|
122
118
|
UIkit.prototype.registerObserver = function (observer) {
|
|
@@ -170,22 +166,22 @@ function registerComputed(component, key, cb) {
|
|
|
170
166
|
enumerable: true,
|
|
171
167
|
|
|
172
168
|
get() {
|
|
173
|
-
const {
|
|
169
|
+
const { _computed, $props, $el } = component;
|
|
174
170
|
|
|
175
|
-
if (!hasOwn(
|
|
176
|
-
|
|
171
|
+
if (!hasOwn(_computed, key)) {
|
|
172
|
+
_computed[key] = (cb.get || cb).call(component, $props, $el);
|
|
177
173
|
}
|
|
178
174
|
|
|
179
|
-
return
|
|
175
|
+
return _computed[key];
|
|
180
176
|
},
|
|
181
177
|
|
|
182
178
|
set(value) {
|
|
183
|
-
const {
|
|
179
|
+
const { _computed } = component;
|
|
184
180
|
|
|
185
|
-
|
|
181
|
+
_computed[key] = cb.set ? cb.set.call(component, value) : value;
|
|
186
182
|
|
|
187
|
-
if (isUndefined(
|
|
188
|
-
delete
|
|
183
|
+
if (isUndefined(_computed[key])) {
|
|
184
|
+
delete _computed[key];
|
|
189
185
|
}
|
|
190
186
|
},
|
|
191
187
|
});
|
|
@@ -312,24 +308,3 @@ function initPropsObserver(component) {
|
|
|
312
308
|
|
|
313
309
|
return observer;
|
|
314
310
|
}
|
|
315
|
-
|
|
316
|
-
const scrollListeners = new Map();
|
|
317
|
-
let unbindScrollListener;
|
|
318
|
-
function registerScrollListener(id, listener) {
|
|
319
|
-
unbindScrollListener =
|
|
320
|
-
unbindScrollListener ||
|
|
321
|
-
on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
|
|
322
|
-
passive: true,
|
|
323
|
-
capture: true,
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
scrollListeners.set(id, listener);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
function unregisterScrollListener(id) {
|
|
330
|
-
scrollListeners.delete(id);
|
|
331
|
-
if (unbindScrollListener && !scrollListeners.size) {
|
|
332
|
-
unbindScrollListener();
|
|
333
|
-
unbindScrollListener = null;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
connected() {
|
|
20
|
-
this.date = Date.parse(this.date);
|
|
20
|
+
this.date = Date.parse(this.$props.date);
|
|
21
21
|
this.start();
|
|
22
22
|
},
|
|
23
23
|
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
continue;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
let digits = String(Math.
|
|
73
|
+
let digits = String(Math.trunc(timespan[unit]));
|
|
74
74
|
|
|
75
75
|
digits = digits.length < 2 ? `0${digits}` : digits;
|
|
76
76
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import Resize from '../mixin/resize';
|
|
2
|
+
import Scroll from '../mixin/scroll';
|
|
1
3
|
import Parallax from '../mixin/parallax';
|
|
2
4
|
import { css, parent, query, scrolledOver, toPx } from 'uikit-util';
|
|
3
5
|
|
|
4
6
|
export default {
|
|
5
|
-
mixins: [Parallax],
|
|
7
|
+
mixins: [Parallax, Resize, Scroll],
|
|
6
8
|
|
|
7
9
|
props: {
|
|
8
10
|
target: String,
|
|
@@ -8,10 +8,12 @@ export default {
|
|
|
8
8
|
selItem: '!li',
|
|
9
9
|
},
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
item(
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
connected() {
|
|
12
|
+
this.item = query(this.selItem, this.$el);
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
disconnected() {
|
|
16
|
+
this.item = null;
|
|
15
17
|
},
|
|
16
18
|
|
|
17
19
|
events: [
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
return (
|
|
46
46
|
finite ||
|
|
47
47
|
Math.ceil(getWidth(this.list)) <
|
|
48
|
-
Math.
|
|
48
|
+
Math.trunc(dimensions(this.list).width + getMaxElWidth(this.list) + this.center)
|
|
49
49
|
);
|
|
50
50
|
},
|
|
51
51
|
|
package/src/js/core/accordion.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
$,
|
|
6
6
|
$$,
|
|
7
7
|
attr,
|
|
8
|
+
fastdom,
|
|
8
9
|
filter,
|
|
9
10
|
getIndex,
|
|
10
11
|
hasClass,
|
|
@@ -135,9 +136,11 @@ export default {
|
|
|
135
136
|
|
|
136
137
|
if (show) {
|
|
137
138
|
const toggle = $(this.$props.toggle, el);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
fastdom.read(() => {
|
|
140
|
+
if (!isInView(toggle)) {
|
|
141
|
+
scrollIntoView(toggle, { offset: this.offset });
|
|
142
|
+
}
|
|
143
|
+
});
|
|
141
144
|
}
|
|
142
145
|
});
|
|
143
146
|
}
|
package/src/js/core/core.js
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import { css,
|
|
1
|
+
import { css, inBrowser, on, toMs } from 'uikit-util';
|
|
2
2
|
|
|
3
|
-
export default function (
|
|
3
|
+
export default function () {
|
|
4
4
|
if (!inBrowser) {
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
// throttle 'resize'
|
|
9
|
-
let pendingResize;
|
|
10
|
-
const handleResize = () => {
|
|
11
|
-
if (pendingResize) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
pendingResize = true;
|
|
15
|
-
fastdom.read(() => (pendingResize = false));
|
|
16
|
-
UIkit.update(null, 'resize');
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
on(window, 'load resize', handleResize);
|
|
20
|
-
on(document, 'loadedmetadata load', handleResize, true);
|
|
21
|
-
observeResize(document.documentElement, handleResize);
|
|
22
|
-
|
|
23
8
|
let started = 0;
|
|
24
9
|
on(
|
|
25
10
|
document,
|
package/src/js/core/cover.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Video from './video';
|
|
2
|
-
import { css, Dimensions,
|
|
2
|
+
import { css, Dimensions, parent } from 'uikit-util';
|
|
3
|
+
import Resize from '../mixin/resize';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
|
-
mixins: [Video],
|
|
6
|
+
mixins: [Resize, Video],
|
|
6
7
|
|
|
7
8
|
props: {
|
|
8
9
|
width: Number,
|
|
@@ -13,10 +14,6 @@ export default {
|
|
|
13
14
|
automute: true,
|
|
14
15
|
},
|
|
15
16
|
|
|
16
|
-
connected() {
|
|
17
|
-
this.registerObserver(observeResize(this.$el, () => this.$emit('resize')));
|
|
18
|
-
},
|
|
19
|
-
|
|
20
17
|
update: {
|
|
21
18
|
read() {
|
|
22
19
|
const el = this.$el;
|
package/src/js/core/drop.js
CHANGED
|
@@ -58,25 +58,12 @@ export default {
|
|
|
58
58
|
container: false,
|
|
59
59
|
},
|
|
60
60
|
|
|
61
|
-
computed: {
|
|
62
|
-
boundary({ boundary }, $el) {
|
|
63
|
-
return boundary === true ? window : query(boundary, $el);
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
clsDrop({ clsDrop }) {
|
|
67
|
-
return clsDrop || `uk-${this.$options.name}`;
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
clsPos() {
|
|
71
|
-
return this.clsDrop;
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
|
|
75
61
|
created() {
|
|
76
62
|
this.tracker = new MouseTracker();
|
|
77
63
|
},
|
|
78
64
|
|
|
79
65
|
connected() {
|
|
66
|
+
this.clsPos = this.clsDrop = this.$props.clsDrop || `uk-${this.$options.name}`;
|
|
80
67
|
addClass(this.$el, this.clsDrop);
|
|
81
68
|
|
|
82
69
|
if (this.toggle && !this.target) {
|
|
@@ -224,9 +211,7 @@ export default {
|
|
|
224
211
|
|
|
225
212
|
this.tracker.init();
|
|
226
213
|
|
|
227
|
-
|
|
228
|
-
this.$el,
|
|
229
|
-
'hide',
|
|
214
|
+
for (const handler of [
|
|
230
215
|
on(
|
|
231
216
|
document,
|
|
232
217
|
pointerDown,
|
|
@@ -248,19 +233,16 @@ export default {
|
|
|
248
233
|
true
|
|
249
234
|
)
|
|
250
235
|
),
|
|
251
|
-
{ self: true }
|
|
252
|
-
);
|
|
253
236
|
|
|
254
|
-
once(
|
|
255
|
-
this.$el,
|
|
256
|
-
'hide',
|
|
257
237
|
on(document, 'keydown', (e) => {
|
|
258
238
|
if (e.keyCode === 27) {
|
|
259
239
|
this.hide(false);
|
|
260
240
|
}
|
|
261
241
|
}),
|
|
262
|
-
|
|
263
|
-
)
|
|
242
|
+
on(window, 'resize', () => this.$emit('resize')),
|
|
243
|
+
]) {
|
|
244
|
+
once(this.$el, 'hide', handler, { self: true });
|
|
245
|
+
}
|
|
264
246
|
},
|
|
265
247
|
},
|
|
266
248
|
|
|
@@ -370,28 +352,28 @@ export default {
|
|
|
370
352
|
},
|
|
371
353
|
|
|
372
354
|
position() {
|
|
355
|
+
const boundary = this.boundary === true ? window : query(this.boundary, this.$el);
|
|
373
356
|
removeClass(this.$el, `${this.clsDrop}-stack`);
|
|
374
357
|
toggleClass(this.$el, `${this.clsDrop}-boundary`, this.boundaryAlign);
|
|
375
358
|
|
|
376
|
-
const
|
|
377
|
-
const alignTo = this.boundaryAlign ?
|
|
359
|
+
const boundaryOffset = offset(boundary);
|
|
360
|
+
const alignTo = this.boundaryAlign ? boundaryOffset : offset(this.target);
|
|
378
361
|
|
|
379
362
|
if (this.align === 'justify') {
|
|
380
363
|
const prop = this.getAxis() === 'y' ? 'width' : 'height';
|
|
381
364
|
css(this.$el, prop, alignTo[prop]);
|
|
382
365
|
} else if (
|
|
383
|
-
|
|
366
|
+
boundary &&
|
|
384
367
|
this.$el.offsetWidth >
|
|
385
|
-
Math.max(
|
|
368
|
+
Math.max(
|
|
369
|
+
boundaryOffset.right - alignTo.left,
|
|
370
|
+
alignTo.right - boundaryOffset.left
|
|
371
|
+
)
|
|
386
372
|
) {
|
|
387
373
|
addClass(this.$el, `${this.clsDrop}-stack`);
|
|
388
374
|
}
|
|
389
375
|
|
|
390
|
-
this.positionAt(
|
|
391
|
-
this.$el,
|
|
392
|
-
this.boundaryAlign ? this.boundary : this.target,
|
|
393
|
-
this.boundary
|
|
394
|
-
);
|
|
376
|
+
this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
|
|
395
377
|
},
|
|
396
378
|
},
|
|
397
379
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Class from '../mixin/class';
|
|
2
|
-
import { $, $$, closest, isInput, matches, parent,
|
|
2
|
+
import { $, $$, closest, isInput, matches, parent, selInput } from 'uikit-util';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
mixins: [Class],
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
return (
|
|
28
28
|
target &&
|
|
29
29
|
((target === true && parent(this.input) === $el && this.input.nextElementSibling) ||
|
|
30
|
-
|
|
30
|
+
$(target, $el))
|
|
31
31
|
);
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -42,13 +42,12 @@ export default {
|
|
|
42
42
|
let option;
|
|
43
43
|
const prop = isInput(target) ? 'value' : 'textContent';
|
|
44
44
|
const prev = target[prop];
|
|
45
|
-
const value =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
: input.value;
|
|
45
|
+
const value = input.files?.[0]
|
|
46
|
+
? input.files[0].name
|
|
47
|
+
: matches(input, 'select') &&
|
|
48
|
+
(option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
|
|
49
|
+
? option.textContent
|
|
50
|
+
: input.value;
|
|
52
51
|
|
|
53
52
|
if (prev !== value) {
|
|
54
53
|
target[prop] = value;
|
package/src/js/core/grid.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Margin from './margin';
|
|
2
2
|
import Class from '../mixin/class';
|
|
3
|
+
import Scroll from '../mixin/scroll';
|
|
3
4
|
import {
|
|
4
5
|
addClass,
|
|
5
6
|
children,
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
export default {
|
|
15
16
|
extends: Margin,
|
|
16
17
|
|
|
17
|
-
mixins: [Class],
|
|
18
|
+
mixins: [Class, Scroll],
|
|
18
19
|
|
|
19
20
|
name: 'grid',
|
|
20
21
|
|
|
@@ -16,11 +16,21 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
|
|
18
18
|
computed: {
|
|
19
|
-
elements
|
|
20
|
-
|
|
19
|
+
elements: {
|
|
20
|
+
get({ target }, $el) {
|
|
21
|
+
return $$(target, $el);
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
watch() {
|
|
25
|
+
this.$reset();
|
|
26
|
+
},
|
|
21
27
|
},
|
|
22
28
|
},
|
|
23
29
|
|
|
30
|
+
resizeTargets() {
|
|
31
|
+
return this.elements;
|
|
32
|
+
},
|
|
33
|
+
|
|
24
34
|
update: {
|
|
25
35
|
read() {
|
|
26
36
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Class from '../mixin/class';
|
|
2
|
+
import Resize from '../mixin/resize';
|
|
2
3
|
import {
|
|
3
4
|
boxModelAdjust,
|
|
4
5
|
css,
|
|
@@ -11,11 +12,10 @@ import {
|
|
|
11
12
|
offset,
|
|
12
13
|
query,
|
|
13
14
|
toFloat,
|
|
14
|
-
trigger,
|
|
15
15
|
} from 'uikit-util';
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
|
-
mixins: [Class],
|
|
18
|
+
mixins: [Class, Resize],
|
|
19
19
|
|
|
20
20
|
props: {
|
|
21
21
|
expand: Boolean,
|
|
@@ -31,6 +31,11 @@ export default {
|
|
|
31
31
|
minHeight: 0,
|
|
32
32
|
},
|
|
33
33
|
|
|
34
|
+
resizeTargets() {
|
|
35
|
+
// check for offsetTop change
|
|
36
|
+
return [this.$el, document.documentElement];
|
|
37
|
+
},
|
|
38
|
+
|
|
34
39
|
update: {
|
|
35
40
|
read({ minHeight: prev }) {
|
|
36
41
|
if (!isVisible(this.$el)) {
|
|
@@ -71,13 +76,9 @@ export default {
|
|
|
71
76
|
return { minHeight, prev };
|
|
72
77
|
},
|
|
73
78
|
|
|
74
|
-
write({ minHeight
|
|
79
|
+
write({ minHeight }) {
|
|
75
80
|
css(this.$el, { minHeight });
|
|
76
81
|
|
|
77
|
-
if (minHeight !== prev) {
|
|
78
|
-
trigger(this.$el, 'resize');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
82
|
if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
|
|
82
83
|
css(this.$el, 'minHeight', this.minHeight);
|
|
83
84
|
}
|
package/src/js/core/icon.js
CHANGED
|
@@ -101,36 +101,29 @@ export const Slidenav = {
|
|
|
101
101
|
|
|
102
102
|
beforeConnect() {
|
|
103
103
|
addClass(this.$el, 'uk-slidenav');
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
computed: {
|
|
107
|
-
icon({ icon }, $el) {
|
|
108
|
-
return hasClass($el, 'uk-slidenav-large') ? `${icon}-large` : icon;
|
|
109
|
-
},
|
|
104
|
+
const icon = this.$props.icon;
|
|
105
|
+
this.icon = hasClass(this.$el, 'uk-slidenav-large') ? `${icon}-large` : icon;
|
|
110
106
|
},
|
|
111
107
|
};
|
|
112
108
|
|
|
113
109
|
export const Search = {
|
|
114
110
|
extends: IconComponent,
|
|
115
111
|
|
|
116
|
-
|
|
117
|
-
icon
|
|
118
|
-
|
|
112
|
+
beforeConnect() {
|
|
113
|
+
this.icon =
|
|
114
|
+
hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length
|
|
119
115
|
? 'search-large'
|
|
120
|
-
: parents(
|
|
116
|
+
: parents(this.$el, '.uk-search-navbar').length
|
|
121
117
|
? 'search-navbar'
|
|
122
|
-
: icon;
|
|
123
|
-
},
|
|
118
|
+
: this.$props.icon;
|
|
124
119
|
},
|
|
125
120
|
};
|
|
126
121
|
|
|
127
122
|
export const Close = {
|
|
128
123
|
extends: IconComponent,
|
|
129
124
|
|
|
130
|
-
|
|
131
|
-
icon()
|
|
132
|
-
return `close-${hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon'}`;
|
|
133
|
-
},
|
|
125
|
+
beforeConnect() {
|
|
126
|
+
this.icon = `close-${hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon'}`;
|
|
134
127
|
},
|
|
135
128
|
};
|
|
136
129
|
|
package/src/js/core/img.js
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
escape,
|
|
9
9
|
fragment,
|
|
10
10
|
hasAttr,
|
|
11
|
-
hasIntersectionObserver,
|
|
12
11
|
includes,
|
|
13
12
|
isArray,
|
|
14
13
|
isEmpty,
|
|
@@ -47,29 +46,19 @@ export default {
|
|
|
47
46
|
loading: 'lazy',
|
|
48
47
|
},
|
|
49
48
|
|
|
50
|
-
computed: {
|
|
51
|
-
target: {
|
|
52
|
-
get({ target }) {
|
|
53
|
-
return [this.$el, ...queryAll(target, this.$el)];
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
watch() {
|
|
57
|
-
this.$reset();
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
|
|
62
49
|
connected() {
|
|
63
|
-
if (this.loading !== 'lazy'
|
|
50
|
+
if (this.loading !== 'lazy') {
|
|
64
51
|
this.load();
|
|
65
52
|
return;
|
|
66
53
|
}
|
|
67
54
|
|
|
55
|
+
const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
|
|
56
|
+
|
|
68
57
|
if (nativeLazyLoad && isImg(this.$el)) {
|
|
69
58
|
this.$el.loading = 'lazy';
|
|
70
59
|
setSrcAttrs(this.$el);
|
|
71
60
|
|
|
72
|
-
if (
|
|
61
|
+
if (target.length === 1) {
|
|
73
62
|
return;
|
|
74
63
|
}
|
|
75
64
|
}
|
|
@@ -78,7 +67,7 @@ export default {
|
|
|
78
67
|
|
|
79
68
|
this.registerObserver(
|
|
80
69
|
observeIntersection(
|
|
81
|
-
|
|
70
|
+
target,
|
|
82
71
|
(entries, observer) => {
|
|
83
72
|
this.load();
|
|
84
73
|
observer.disconnect();
|
package/src/js/core/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export { default as Alert } from './alert';
|
|
|
3
3
|
export { default as Cover } from './cover';
|
|
4
4
|
export { default as Drop, default as Dropdown } from './drop';
|
|
5
5
|
export { default as FormCustom } from './form-custom';
|
|
6
|
-
export { default as Gif } from './gif';
|
|
7
6
|
export { default as Grid } from './grid';
|
|
8
7
|
export { default as HeightMatch } from './height-match';
|
|
9
8
|
export { default as HeightViewport } from './height-viewport';
|
package/src/js/core/leader.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import Class from '../mixin/class';
|
|
2
2
|
import Media from '../mixin/media';
|
|
3
3
|
import { attr, getCssVar, toggleClass, unwrap, wrapInner } from 'uikit-util';
|
|
4
|
+
import Resize from '../mixin/resize';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
|
-
mixins: [Class, Media],
|
|
7
|
+
mixins: [Class, Media, Resize],
|
|
7
8
|
|
|
8
9
|
props: {
|
|
9
10
|
fill: String,
|
|
@@ -31,26 +32,19 @@ export default {
|
|
|
31
32
|
},
|
|
32
33
|
|
|
33
34
|
update: {
|
|
34
|
-
read(
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
width = Math.floor(this.$el.offsetWidth / 2);
|
|
35
|
+
read() {
|
|
36
|
+
const width = Math.trunc(this.$el.offsetWidth / 2);
|
|
38
37
|
|
|
39
38
|
return {
|
|
40
39
|
width,
|
|
41
40
|
fill: this.fill,
|
|
42
|
-
changed: changed || prev !== width,
|
|
43
41
|
hide: !this.matchMedia,
|
|
44
42
|
};
|
|
45
43
|
},
|
|
46
44
|
|
|
47
|
-
write(
|
|
48
|
-
toggleClass(this.wrapper, this.clsHide,
|
|
49
|
-
|
|
50
|
-
if (data.changed) {
|
|
51
|
-
data.changed = false;
|
|
52
|
-
attr(this.wrapper, this.attrFill, new Array(data.width).join(data.fill));
|
|
53
|
-
}
|
|
45
|
+
write({ width, fill, hide }) {
|
|
46
|
+
toggleClass(this.wrapper, this.clsHide, hide);
|
|
47
|
+
attr(this.wrapper, this.attrFill, new Array(width).join(fill));
|
|
54
48
|
},
|
|
55
49
|
|
|
56
50
|
events: ['resize'],
|
package/src/js/core/margin.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Resize from '../mixin/resize';
|
|
2
|
+
import { isRtl, isVisible, observeMutation, offsetPosition, toggleClass } from 'uikit-util';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
5
|
+
mixins: [Resize],
|
|
6
|
+
|
|
4
7
|
props: {
|
|
5
8
|
margin: String,
|
|
6
9
|
firstColumn: Boolean,
|
|
@@ -11,6 +14,18 @@ export default {
|
|
|
11
14
|
firstColumn: 'uk-first-column',
|
|
12
15
|
},
|
|
13
16
|
|
|
17
|
+
resizeTargets() {
|
|
18
|
+
return this.$el.children;
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
connected() {
|
|
22
|
+
this.registerObserver(
|
|
23
|
+
observeMutation(this.$el, () => this.$reset(), {
|
|
24
|
+
childList: true,
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
|
|
14
29
|
update: {
|
|
15
30
|
read() {
|
|
16
31
|
const rows = getRows(this.$el.children);
|