uikit 3.16.24 → 3.16.25-dev.931f07bf4
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 +0 -9
- package/.prettierrc.json +3 -4
- package/CHANGELOG.md +6 -0
- package/build/build.js +2 -2
- package/build/less.js +2 -2
- package/build/prefix.js +8 -7
- package/build/release.js +7 -7
- package/build/scope.js +3 -3
- package/build/scss.js +26 -16
- package/build/util.js +11 -11
- package/dist/css/uikit-core-rtl.css +6 -2
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +6 -2
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +6 -2
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +6 -2
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +2 -2
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +18 -18
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +347 -350
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +349 -352
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +6 -6
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +76 -72
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +37 -37
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +218 -224
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +37 -37
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +265 -271
- 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 +95 -95
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +2 -2
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +459 -452
- 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 +6832 -6831
- package/dist/js/uikit.min.js +1 -1
- package/package.json +8 -7
- package/src/js/api/app.js +1 -1
- package/src/js/api/boot.js +2 -2
- package/src/js/api/component.js +1 -1
- package/src/js/api/computed.js +2 -2
- package/src/js/api/events.js +2 -2
- package/src/js/api/global.js +3 -3
- package/src/js/api/hooks.js +4 -4
- package/src/js/api/instance.js +3 -3
- package/src/js/api/log.js +1 -1
- package/src/js/api/observables.js +12 -6
- package/src/js/api/observer.js +2 -2
- package/src/js/api/options.js +2 -2
- package/src/js/api/props.js +2 -2
- package/src/js/api/state.js +2 -2
- package/src/js/components/countdown.js +1 -1
- package/src/js/components/filter.js +5 -5
- package/src/js/components/internal/lightbox-animations.js +1 -1
- package/src/js/components/internal/slider-transitioner.js +6 -6
- package/src/js/components/internal/slideshow-animations.js +1 -1
- package/src/js/components/lightbox-panel.js +10 -10
- package/src/js/components/lightbox.js +2 -2
- package/src/js/components/notification.js +4 -4
- package/src/js/components/parallax.js +5 -5
- package/src/js/components/slider-parallax.js +1 -1
- package/src/js/components/slider.js +12 -12
- package/src/js/components/slideshow.js +3 -3
- package/src/js/components/sortable.js +4 -4
- package/src/js/components/tooltip.js +6 -6
- package/src/js/components/upload.js +4 -4
- package/src/js/core/accordion.js +8 -8
- package/src/js/core/alert.js +2 -2
- package/src/js/core/cover.js +1 -1
- package/src/js/core/drop.js +12 -12
- package/src/js/core/dropnav.js +7 -7
- package/src/js/core/form-custom.js +1 -1
- package/src/js/core/grid.js +9 -9
- package/src/js/core/height-match.js +2 -2
- package/src/js/core/height-viewport.js +1 -1
- package/src/js/core/icon.js +23 -23
- package/src/js/core/img.js +2 -2
- package/src/js/core/index.js +16 -14
- package/src/js/core/leader.js +2 -2
- package/src/js/core/modal.js +7 -7
- package/src/js/core/navbar.js +4 -4
- package/src/js/core/offcanvas.js +3 -3
- package/src/js/core/overflow-auto.js +3 -3
- package/src/js/core/responsive.js +3 -3
- package/src/js/core/scrollspy-nav.js +1 -1
- package/src/js/core/scrollspy.js +1 -1
- package/src/js/core/sticky.js +13 -13
- package/src/js/core/svg.js +4 -4
- package/src/js/core/switcher.js +7 -7
- package/src/js/core/tab.js +2 -2
- package/src/js/core/toggle.js +5 -5
- package/src/js/core/video.js +1 -1
- package/src/js/mixin/animate.js +1 -1
- package/src/js/mixin/i18n.js +1 -1
- package/src/js/mixin/internal/animate-fade.js +14 -14
- package/src/js/mixin/internal/animate-slide.js +1 -1
- package/src/js/mixin/internal/scroll.js +1 -1
- package/src/js/mixin/modal.js +15 -12
- package/src/js/mixin/parallax.js +2 -2
- package/src/js/mixin/position.js +2 -2
- package/src/js/mixin/slider-drag.js +1 -1
- package/src/js/mixin/slider-nav.js +8 -14
- package/src/js/mixin/slider.js +9 -9
- package/src/js/mixin/slideshow.js +1 -1
- package/src/js/mixin/togglable.js +4 -4
- package/src/js/uikit-core.js +2 -2
- package/src/js/uikit.js +2 -2
- package/src/js/util/animation.js +8 -8
- package/src/js/util/class.js +1 -1
- package/src/js/util/dimensions.js +5 -5
- package/src/js/util/dom.js +3 -3
- package/src/js/util/event.js +3 -3
- package/src/js/util/filter.js +1 -1
- package/src/js/util/lang.js +4 -4
- package/src/js/util/observer.js +2 -2
- package/src/js/util/player.js +1 -1
- package/src/js/util/position.js +5 -5
- package/src/js/util/selector.js +1 -1
- package/src/js/util/style.js +1 -1
- package/src/js/util/svg.js +2 -2
- package/src/js/util/viewport.js +6 -6
- package/src/less/components/slider.less +8 -2
- package/src/scss/components/inverse.scss +0 -1
- package/src/scss/components/slider.scss +8 -2
- package/src/scss/mixins-theme.scss +560 -552
- package/src/scss/mixins.scss +456 -448
- package/src/scss/variables-theme.scss +2 -2
- package/src/scss/variables.scss +2 -2
- package/tests/js/index.js +7 -7
- package/build/scss/inverse.scss +0 -30
package/src/js/core/sticky.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import Class from '../mixin/class';
|
|
2
|
-
import Media from '../mixin/media';
|
|
3
|
-
import { resize, scroll, viewport } from '../api/observables';
|
|
4
1
|
import {
|
|
5
2
|
$,
|
|
3
|
+
Animation,
|
|
6
4
|
addClass,
|
|
7
5
|
after,
|
|
8
|
-
Animation,
|
|
9
6
|
before,
|
|
10
7
|
clamp,
|
|
11
8
|
css,
|
|
@@ -24,11 +21,14 @@ import {
|
|
|
24
21
|
removeClass,
|
|
25
22
|
replaceClass,
|
|
26
23
|
toFloat,
|
|
27
|
-
toggleClass,
|
|
28
24
|
toPx,
|
|
25
|
+
toggleClass,
|
|
29
26
|
trigger,
|
|
30
27
|
within,
|
|
31
28
|
} from 'uikit-util';
|
|
29
|
+
import { resize, scroll, viewport } from '../api/observables';
|
|
30
|
+
import Class from '../mixin/class';
|
|
31
|
+
import Media from '../mixin/media';
|
|
32
32
|
|
|
33
33
|
export default {
|
|
34
34
|
mixins: [Class, Media],
|
|
@@ -98,9 +98,9 @@ export default {
|
|
|
98
98
|
},
|
|
99
99
|
|
|
100
100
|
observe: [
|
|
101
|
-
resize({ target: ({ $el }) => [$el, document.scrollingElement] }),
|
|
102
101
|
viewport(),
|
|
103
|
-
scroll(),
|
|
102
|
+
scroll({ target: () => document.scrollingElement }),
|
|
103
|
+
resize({ target: ({ $el }) => [$el, document.scrollingElement] }),
|
|
104
104
|
],
|
|
105
105
|
|
|
106
106
|
events: [
|
|
@@ -145,7 +145,7 @@ export default {
|
|
|
145
145
|
this.transitionInProgress = once(
|
|
146
146
|
this.$el,
|
|
147
147
|
'transitionend transitioncancel',
|
|
148
|
-
() => (this.transitionInProgress = null)
|
|
148
|
+
() => (this.transitionInProgress = null),
|
|
149
149
|
);
|
|
150
150
|
},
|
|
151
151
|
},
|
|
@@ -206,7 +206,7 @@ export default {
|
|
|
206
206
|
parseProp(this.end, this.$el, topOffset + height, true) -
|
|
207
207
|
elHeight -
|
|
208
208
|
offset +
|
|
209
|
-
overflow
|
|
209
|
+
overflow,
|
|
210
210
|
);
|
|
211
211
|
|
|
212
212
|
sticky =
|
|
@@ -216,7 +216,7 @@ export default {
|
|
|
216
216
|
end ===
|
|
217
217
|
Math.min(
|
|
218
218
|
maxScrollHeight,
|
|
219
|
-
parseProp('!*', this.$el, 0, true) - elHeight - offset + overflow
|
|
219
|
+
parseProp('!*', this.$el, 0, true) - elHeight - offset + overflow,
|
|
220
220
|
) &&
|
|
221
221
|
css(parent(this.$el), 'overflowY') === 'visible';
|
|
222
222
|
|
|
@@ -280,12 +280,12 @@ export default {
|
|
|
280
280
|
scroll,
|
|
281
281
|
prevScroll,
|
|
282
282
|
offsetParentTop: getOffset(
|
|
283
|
-
(this.isFixed ? this.placeholder : this.$el).offsetParent
|
|
283
|
+
(this.isFixed ? this.placeholder : this.$el).offsetParent,
|
|
284
284
|
).top,
|
|
285
285
|
overflowScroll: clamp(
|
|
286
286
|
overflowScroll + clamp(scroll, start, end) - clamp(prevScroll, start, end),
|
|
287
287
|
0,
|
|
288
|
-
overflow
|
|
288
|
+
overflow,
|
|
289
289
|
),
|
|
290
290
|
};
|
|
291
291
|
},
|
|
@@ -429,7 +429,7 @@ export default {
|
|
|
429
429
|
toggleClass(
|
|
430
430
|
this.$el,
|
|
431
431
|
this.clsBelow,
|
|
432
|
-
scroll > topOffset + (sticky ? Math.min(height, elHeight) : height)
|
|
432
|
+
scroll > topOffset + (sticky ? Math.min(height, elHeight) : height),
|
|
433
433
|
);
|
|
434
434
|
addClass(this.$el, this.clsFixed);
|
|
435
435
|
},
|
package/src/js/core/svg.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import Svg from '../mixin/svg';
|
|
2
|
-
import { getMaxPathLength } from '../util/svg';
|
|
3
|
-
import { mutation } from '../api/observables';
|
|
4
1
|
import {
|
|
5
2
|
$,
|
|
6
3
|
addClass,
|
|
@@ -13,6 +10,9 @@ import {
|
|
|
13
10
|
removeAttr,
|
|
14
11
|
startsWith,
|
|
15
12
|
} from 'uikit-util';
|
|
13
|
+
import { mutation } from '../api/observables';
|
|
14
|
+
import Svg from '../mixin/svg';
|
|
15
|
+
import { getMaxPathLength } from '../util/svg';
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
18
|
mixins: [Svg],
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
async getSvg() {
|
|
64
64
|
if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
|
|
65
65
|
return new Promise((resolve) =>
|
|
66
|
-
once(this.$el, 'load', () => resolve(this.getSvg()))
|
|
66
|
+
once(this.$el, 'load', () => resolve(this.getSvg())),
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
package/src/js/core/switcher.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import Togglable from '../mixin/togglable';
|
|
2
|
-
import { keyMap } from '../util/keys';
|
|
3
|
-
import { generateId } from '../api/instance';
|
|
4
|
-
import { lazyload, swipe } from '../api/observables';
|
|
5
1
|
import {
|
|
6
2
|
$$,
|
|
7
3
|
attr,
|
|
@@ -21,6 +17,10 @@ import {
|
|
|
21
17
|
toggleClass,
|
|
22
18
|
within,
|
|
23
19
|
} from 'uikit-util';
|
|
20
|
+
import { generateId } from '../api/instance';
|
|
21
|
+
import { lazyload, swipe } from '../api/observables';
|
|
22
|
+
import Togglable from '../mixin/togglable';
|
|
23
|
+
import { keyMap } from '../util/keys';
|
|
24
24
|
|
|
25
25
|
const selDisabled = '.uk-disabled *, .uk-disabled, [disabled]';
|
|
26
26
|
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
65
65
|
|
|
66
66
|
children() {
|
|
67
67
|
return children(this.$el).filter((child) =>
|
|
68
|
-
this.toggles.some((toggle) => within(toggle, child))
|
|
68
|
+
this.toggles.some((toggle) => within(toggle, child)),
|
|
69
69
|
);
|
|
70
70
|
},
|
|
71
71
|
},
|
|
@@ -227,7 +227,7 @@ export default {
|
|
|
227
227
|
const next = getIndex(
|
|
228
228
|
!isNode(item) || includes(toggles, item) ? item : 0,
|
|
229
229
|
toggles,
|
|
230
|
-
getIndex(this.toggles[prev], toggles)
|
|
230
|
+
getIndex(this.toggles[prev], toggles),
|
|
231
231
|
);
|
|
232
232
|
const active = getIndex(toggles[next], this.toggles);
|
|
233
233
|
|
|
@@ -242,7 +242,7 @@ export default {
|
|
|
242
242
|
const animate = prev >= 0 && prev !== next;
|
|
243
243
|
this.connects.forEach(async ({ children }) => {
|
|
244
244
|
const actives = toArray(children).filter(
|
|
245
|
-
(child, i) => i !== active && hasClass(child, this.cls)
|
|
245
|
+
(child, i) => i !== active && hasClass(child, this.cls),
|
|
246
246
|
);
|
|
247
247
|
|
|
248
248
|
await this.toggleElement(actives, false, animate);
|
package/src/js/core/tab.js
CHANGED
package/src/js/core/toggle.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import Media from '../mixin/media';
|
|
2
|
-
import Togglable from '../mixin/togglable';
|
|
3
|
-
import { lazyload } from '../api/observables';
|
|
4
1
|
import {
|
|
5
2
|
attr,
|
|
6
3
|
closest,
|
|
@@ -20,6 +17,9 @@ import {
|
|
|
20
17
|
trigger,
|
|
21
18
|
within,
|
|
22
19
|
} from 'uikit-util';
|
|
20
|
+
import { lazyload } from '../api/observables';
|
|
21
|
+
import Media from '../mixin/media';
|
|
22
|
+
import Togglable from '../mixin/togglable';
|
|
23
23
|
|
|
24
24
|
const KEY_SPACE = 32;
|
|
25
25
|
|
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
pointerDown,
|
|
86
86
|
() => trigger(this.$el, 'blur'),
|
|
87
87
|
true,
|
|
88
|
-
(e) => !within(e.target, this.$el)
|
|
88
|
+
(e) => !within(e.target, this.$el),
|
|
89
89
|
);
|
|
90
90
|
|
|
91
91
|
// Prevent initial click to prevent double toggle through focus + click
|
|
@@ -222,7 +222,7 @@ export default {
|
|
|
222
222
|
if (await this.toggleElement(toggled, false)) {
|
|
223
223
|
await this.toggleElement(
|
|
224
224
|
this.target.filter((el) => !includes(toggled, el)),
|
|
225
|
-
true
|
|
225
|
+
true,
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
228
|
},
|
package/src/js/core/video.js
CHANGED
package/src/js/mixin/animate.js
CHANGED
package/src/js/mixin/i18n.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getRows } from '../../core/margin';
|
|
2
1
|
import {
|
|
3
2
|
addClass,
|
|
4
3
|
children,
|
|
@@ -12,6 +11,7 @@ import {
|
|
|
12
11
|
toNumber,
|
|
13
12
|
Transition,
|
|
14
13
|
} from 'uikit-util';
|
|
14
|
+
import { getRows } from '../../core/margin';
|
|
15
15
|
|
|
16
16
|
const clsLeave = 'uk-transition-leave';
|
|
17
17
|
const clsEnter = 'uk-transition-enter';
|
|
@@ -21,7 +21,7 @@ export default function fade(action, target, duration, stagger = 0) {
|
|
|
21
21
|
const propsIn = { opacity: 1 };
|
|
22
22
|
const propsOut = { opacity: 0 };
|
|
23
23
|
|
|
24
|
-
const wrapIndexFn = (fn) => () => index === transitionIndex(target) ? fn() : Promise.reject();
|
|
24
|
+
const wrapIndexFn = (fn) => () => (index === transitionIndex(target) ? fn() : Promise.reject());
|
|
25
25
|
|
|
26
26
|
const leaveFn = wrapIndexFn(async () => {
|
|
27
27
|
addClass(target, clsLeave);
|
|
@@ -33,12 +33,12 @@ export default function fade(action, target, duration, stagger = 0) {
|
|
|
33
33
|
setTimeout(
|
|
34
34
|
() =>
|
|
35
35
|
Transition.start(child, propsOut, duration / 2, 'ease').then(
|
|
36
|
-
resolve
|
|
36
|
+
resolve,
|
|
37
37
|
),
|
|
38
|
-
i * stagger
|
|
39
|
-
)
|
|
40
|
-
)
|
|
41
|
-
)
|
|
38
|
+
i * stagger,
|
|
39
|
+
),
|
|
40
|
+
),
|
|
41
|
+
),
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
removeClass(target, clsLeave);
|
|
@@ -76,8 +76,8 @@ export default function fade(action, target, duration, stagger = 0) {
|
|
|
76
76
|
target,
|
|
77
77
|
{ height: newHeight },
|
|
78
78
|
duration / 2 + transitionNodes.length * stagger,
|
|
79
|
-
'ease'
|
|
80
|
-
)
|
|
79
|
+
'ease',
|
|
80
|
+
),
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -112,8 +112,8 @@ function waitTransitionend(target) {
|
|
|
112
112
|
.filter(Transition.inProgress)
|
|
113
113
|
.map(
|
|
114
114
|
(el) =>
|
|
115
|
-
new Promise((resolve) => once(el, 'transitionend transitioncanceled', resolve))
|
|
116
|
-
)
|
|
115
|
+
new Promise((resolve) => once(el, 'transitionend transitioncanceled', resolve)),
|
|
116
|
+
),
|
|
117
117
|
);
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -123,10 +123,10 @@ function getTransitionNodes(target) {
|
|
|
123
123
|
nodes.concat(
|
|
124
124
|
sortBy(
|
|
125
125
|
row.filter((el) => isInView(el)),
|
|
126
|
-
'offsetLeft'
|
|
127
|
-
)
|
|
126
|
+
'offsetLeft',
|
|
127
|
+
),
|
|
128
128
|
),
|
|
129
|
-
[]
|
|
129
|
+
[],
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
|
package/src/js/mixin/modal.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import Class from './class';
|
|
2
|
-
import Container from './container';
|
|
3
|
-
import Togglable from './togglable';
|
|
4
1
|
import {
|
|
5
2
|
$,
|
|
6
3
|
addClass,
|
|
@@ -23,7 +20,10 @@ import {
|
|
|
23
20
|
toFloat,
|
|
24
21
|
within,
|
|
25
22
|
} from 'uikit-util';
|
|
23
|
+
import Class from './class';
|
|
24
|
+
import Container from './container';
|
|
26
25
|
import { preventBackgroundScroll } from './internal/scroll';
|
|
26
|
+
import Togglable from './togglable';
|
|
27
27
|
|
|
28
28
|
const active = [];
|
|
29
29
|
|
|
@@ -160,7 +160,7 @@ export default {
|
|
|
160
160
|
this.$el,
|
|
161
161
|
'hidden',
|
|
162
162
|
() => handlers.forEach((handler) => handler && handler()),
|
|
163
|
-
{ self: true }
|
|
163
|
+
{ self: true },
|
|
164
164
|
);
|
|
165
165
|
|
|
166
166
|
addClass(document.documentElement, this.clsPage);
|
|
@@ -211,7 +211,7 @@ export default {
|
|
|
211
211
|
if (this.container && parent(this.$el) !== this.container) {
|
|
212
212
|
append(this.container, this.$el);
|
|
213
213
|
return new Promise((resolve) =>
|
|
214
|
-
requestAnimationFrame(() => this.show().then(resolve))
|
|
214
|
+
requestAnimationFrame(() => this.show().then(resolve)),
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -241,14 +241,17 @@ function animate(el, show, { transitionElement, _toggle }) {
|
|
|
241
241
|
});
|
|
242
242
|
clearTimeout(timer);
|
|
243
243
|
},
|
|
244
|
-
{ self: true }
|
|
244
|
+
{ self: true },
|
|
245
245
|
);
|
|
246
246
|
|
|
247
|
-
const timer = setTimeout(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
247
|
+
const timer = setTimeout(
|
|
248
|
+
() => {
|
|
249
|
+
off();
|
|
250
|
+
resolve();
|
|
251
|
+
},
|
|
252
|
+
toMs(css(transitionElement, 'transitionDuration')),
|
|
253
|
+
);
|
|
254
|
+
}),
|
|
252
255
|
).then(() => delete el._reject);
|
|
253
256
|
}
|
|
254
257
|
|
|
@@ -282,7 +285,7 @@ function listenForBackgroundClose(modal) {
|
|
|
282
285
|
modal.hide();
|
|
283
286
|
}
|
|
284
287
|
},
|
|
285
|
-
true
|
|
288
|
+
true,
|
|
286
289
|
);
|
|
287
290
|
});
|
|
288
291
|
}
|
package/src/js/mixin/parallax.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import Media from '../mixin/media';
|
|
2
|
-
import { getMaxPathLength } from '../util/svg';
|
|
3
1
|
import {
|
|
4
2
|
clamp,
|
|
5
3
|
createEvent,
|
|
@@ -16,6 +14,8 @@ import {
|
|
|
16
14
|
trigger,
|
|
17
15
|
ucfirst,
|
|
18
16
|
} from 'uikit-util';
|
|
17
|
+
import Media from '../mixin/media';
|
|
18
|
+
import { getMaxPathLength } from '../util/svg';
|
|
19
19
|
|
|
20
20
|
const props = {
|
|
21
21
|
x: transformFn,
|
package/src/js/mixin/position.js
CHANGED
|
@@ -72,7 +72,7 @@ export default {
|
|
|
72
72
|
toPx(
|
|
73
73
|
this.offset === false ? css(element, '--uk-position-offset') : this.offset,
|
|
74
74
|
this.axis === 'x' ? 'width' : 'height',
|
|
75
|
-
element
|
|
75
|
+
element,
|
|
76
76
|
) *
|
|
77
77
|
(includes(['left', 'top'], this.dir) ? -1 : 1) *
|
|
78
78
|
(this.inset ? -1 : 1)
|
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
: toPx(
|
|
86
86
|
css(element, '--uk-position-shift-offset'),
|
|
87
87
|
this.axis === 'y' ? 'width' : 'height',
|
|
88
|
-
element
|
|
88
|
+
element,
|
|
89
89
|
) * (includes(['left', 'top'], this.align) ? 1 : -1);
|
|
90
90
|
},
|
|
91
91
|
|
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
empty,
|
|
10
10
|
isNumeric,
|
|
11
11
|
matches,
|
|
12
|
+
parent,
|
|
12
13
|
toFloat,
|
|
13
|
-
toggleClass,
|
|
14
14
|
toNumber,
|
|
15
|
+
toggleClass,
|
|
15
16
|
} from 'uikit-util';
|
|
16
|
-
import { keyMap } from '../util/keys';
|
|
17
17
|
import { generateId } from '../api/instance';
|
|
18
|
+
import { keyMap } from '../util/keys';
|
|
18
19
|
|
|
19
20
|
export default {
|
|
20
21
|
i18n: {
|
|
@@ -111,7 +112,7 @@ export default {
|
|
|
111
112
|
role: this.nav ? 'tabpanel' : 'group',
|
|
112
113
|
'aria-label': this.t('slideLabel', i + 1, this.length),
|
|
113
114
|
'aria-roledescription': this.nav ? null : 'slide',
|
|
114
|
-
})
|
|
115
|
+
}),
|
|
115
116
|
);
|
|
116
117
|
},
|
|
117
118
|
|
|
@@ -205,8 +206,7 @@ export default {
|
|
|
205
206
|
methods: {
|
|
206
207
|
updateNav() {
|
|
207
208
|
const index = this.getValidIndex();
|
|
208
|
-
|
|
209
|
-
let focusEl;
|
|
209
|
+
|
|
210
210
|
for (const el of this.navItems) {
|
|
211
211
|
const cmd = data(el, this.attrItem);
|
|
212
212
|
const button = $('a,button', el) || el;
|
|
@@ -222,24 +222,18 @@ export default {
|
|
|
222
222
|
tabindex: active ? null : -1,
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
if (active) {
|
|
226
|
-
|
|
225
|
+
if (active && button && matches(parent(el), ':focus-within')) {
|
|
226
|
+
button.focus();
|
|
227
227
|
}
|
|
228
|
-
|
|
229
|
-
focus ||= matches(button, ':focus');
|
|
230
228
|
} else {
|
|
231
229
|
toggleClass(
|
|
232
230
|
el,
|
|
233
231
|
'uk-invisible',
|
|
234
232
|
this.finite &&
|
|
235
233
|
((cmd === 'previous' && index === 0) ||
|
|
236
|
-
(cmd === 'next' && index >= this.maxIndex))
|
|
234
|
+
(cmd === 'next' && index >= this.maxIndex)),
|
|
237
235
|
);
|
|
238
236
|
}
|
|
239
|
-
|
|
240
|
-
if (focus && focusEl) {
|
|
241
|
-
focusEl.focus();
|
|
242
|
-
}
|
|
243
237
|
}
|
|
244
238
|
},
|
|
245
239
|
},
|
package/src/js/mixin/slider.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import I18n from './i18n';
|
|
2
|
-
import SliderNav from './slider-nav';
|
|
3
|
-
import SliderDrag from './slider-drag';
|
|
4
|
-
import SliderAutoplay from './slider-autoplay';
|
|
5
|
-
import { resize } from '../api/observables';
|
|
6
1
|
import {
|
|
7
2
|
$,
|
|
8
3
|
children,
|
|
@@ -14,6 +9,11 @@ import {
|
|
|
14
9
|
removeClass,
|
|
15
10
|
trigger,
|
|
16
11
|
} from 'uikit-util';
|
|
12
|
+
import { resize } from '../api/observables';
|
|
13
|
+
import I18n from './i18n';
|
|
14
|
+
import SliderAutoplay from './slider-autoplay';
|
|
15
|
+
import SliderDrag from './slider-drag';
|
|
16
|
+
import SliderNav from './slider-nav';
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
19
|
mixins: [SliderAutoplay, SliderDrag, SliderNav, I18n],
|
|
@@ -151,7 +151,7 @@ export default {
|
|
|
151
151
|
return clamp(
|
|
152
152
|
getIndex(index, this.slides, prev, this.finite),
|
|
153
153
|
0,
|
|
154
|
-
Math.max(0, this.maxIndex)
|
|
154
|
+
Math.max(0, this.maxIndex),
|
|
155
155
|
);
|
|
156
156
|
},
|
|
157
157
|
|
|
@@ -177,7 +177,7 @@ export default {
|
|
|
177
177
|
const { length } = this.stack;
|
|
178
178
|
return this._transitioner[length > 1 ? 'forward' : 'show'](
|
|
179
179
|
length > 1 ? Math.min(this.duration, 75 + 75 / (length - 1)) : this.duration,
|
|
180
|
-
this.percent
|
|
180
|
+
this.percent,
|
|
181
181
|
);
|
|
182
182
|
},
|
|
183
183
|
|
|
@@ -191,13 +191,13 @@ export default {
|
|
|
191
191
|
prev = this.prevIndex,
|
|
192
192
|
next = this.index,
|
|
193
193
|
dir = this.dir || 1,
|
|
194
|
-
options = this.transitionOptions
|
|
194
|
+
options = this.transitionOptions,
|
|
195
195
|
) {
|
|
196
196
|
return new this.Transitioner(
|
|
197
197
|
isNumber(prev) ? this.slides[prev] : prev,
|
|
198
198
|
isNumber(next) ? this.slides[next] : next,
|
|
199
199
|
dir * (isRtl ? -1 : 1),
|
|
200
|
-
options
|
|
200
|
+
options,
|
|
201
201
|
);
|
|
202
202
|
},
|
|
203
203
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { addClass, removeClass } from 'uikit-util';
|
|
1
2
|
import Animations from './internal/slideshow-animations';
|
|
2
3
|
import Transitioner from './internal/slideshow-transitioner';
|
|
3
4
|
import Slider from './slider.js';
|
|
4
|
-
import { addClass, removeClass } from 'uikit-util';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
mixins: [Slider],
|
|
@@ -90,7 +90,7 @@ export default {
|
|
|
90
90
|
return Promise.reject();
|
|
91
91
|
})
|
|
92
92
|
: done();
|
|
93
|
-
})
|
|
93
|
+
}),
|
|
94
94
|
);
|
|
95
95
|
return true;
|
|
96
96
|
} catch (e) {
|
|
@@ -143,7 +143,7 @@ function toggleInstant(el, show, { _toggle }) {
|
|
|
143
143
|
export async function toggleTransition(
|
|
144
144
|
el,
|
|
145
145
|
show,
|
|
146
|
-
{ animation, duration, velocity, transition, _toggle }
|
|
146
|
+
{ animation, duration, velocity, transition, _toggle },
|
|
147
147
|
) {
|
|
148
148
|
const [mode = 'reveal', startProp = 'top'] = animation[0]?.split('-') || [];
|
|
149
149
|
|
|
@@ -179,7 +179,7 @@ export async function toggleTransition(
|
|
|
179
179
|
'overflowX',
|
|
180
180
|
marginProp,
|
|
181
181
|
marginStartProp,
|
|
182
|
-
].map((key) => [key, el.style[key]])
|
|
182
|
+
].map((key) => [key, el.style[key]]),
|
|
183
183
|
);
|
|
184
184
|
|
|
185
185
|
const dim = dimensions(el);
|
|
@@ -257,6 +257,6 @@ function toggleAnimation(el, show, cmp) {
|
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(() =>
|
|
260
|
-
_toggle(el, false)
|
|
260
|
+
_toggle(el, false),
|
|
261
261
|
);
|
|
262
262
|
}
|
package/src/js/uikit-core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { each } from 'uikit-util';
|
|
2
2
|
import boot from './api/boot';
|
|
3
|
+
import UIkit from './api/index';
|
|
3
4
|
import * as components from './core/index';
|
|
4
|
-
import { each } from 'uikit-util';
|
|
5
5
|
|
|
6
6
|
// register components
|
|
7
7
|
each(components, (component, name) => UIkit.component(name, component));
|
package/src/js/uikit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import UIkit from './uikit-core';
|
|
2
|
-
import * as components from './components/index';
|
|
3
1
|
import { each } from 'uikit-util';
|
|
2
|
+
import * as components from './components/index';
|
|
3
|
+
import UIkit from './uikit-core';
|
|
4
4
|
|
|
5
5
|
each(components, (component, name) => UIkit.component(name, component));
|
|
6
6
|
|
package/src/js/util/animation.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { attr } from './attr';
|
|
2
|
+
import { addClass, hasClass, removeClass, removeClasses } from './class';
|
|
2
3
|
import { once, trigger } from './event';
|
|
3
|
-
import { css, propName } from './style';
|
|
4
4
|
import { startsWith, toNodes } from './lang';
|
|
5
|
-
import {
|
|
5
|
+
import { css, propName } from './style';
|
|
6
6
|
|
|
7
7
|
function transition(element, props, duration = 400, timing = 'linear') {
|
|
8
8
|
duration = Math.round(duration);
|
|
@@ -32,7 +32,7 @@ function transition(element, props, duration = 400, timing = 'linear') {
|
|
|
32
32
|
});
|
|
33
33
|
type === 'transitioncanceled' ? reject() : resolve(element);
|
|
34
34
|
},
|
|
35
|
-
{ self: true }
|
|
35
|
+
{ self: true },
|
|
36
36
|
);
|
|
37
37
|
|
|
38
38
|
addClass(element, 'uk-transition');
|
|
@@ -42,8 +42,8 @@ function transition(element, props, duration = 400, timing = 'linear') {
|
|
|
42
42
|
transitionTimingFunction: timing,
|
|
43
43
|
...props,
|
|
44
44
|
});
|
|
45
|
-
})
|
|
46
|
-
)
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -86,7 +86,7 @@ function animate(element, animation, duration = 200, origin, out) {
|
|
|
86
86
|
css(element, 'animationDuration', '');
|
|
87
87
|
removeClasses(element, `${animationPrefix}\\S*`);
|
|
88
88
|
},
|
|
89
|
-
{ self: true }
|
|
89
|
+
{ self: true },
|
|
90
90
|
);
|
|
91
91
|
|
|
92
92
|
css(element, 'animationDuration', `${duration}ms`);
|
|
@@ -96,8 +96,8 @@ function animate(element, animation, duration = 200, origin, out) {
|
|
|
96
96
|
origin && addClass(element, `uk-transform-origin-${origin}`);
|
|
97
97
|
out && addClass(element, `${animationPrefix}reverse`);
|
|
98
98
|
}
|
|
99
|
-
})
|
|
100
|
-
)
|
|
99
|
+
}),
|
|
100
|
+
),
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
|