uikit 3.16.24 → 3.16.25-dev.12f581d90
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/build/build.js +2 -2
- package/build/less.js +2 -2
- package/build/prefix.js +3 -3
- package/build/release.js +7 -7
- package/build/scope.js +3 -3
- package/build/scss.js +9 -9
- package/build/util.js +11 -11
- 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 +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 +351 -350
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +353 -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 +69 -69
- 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 +222 -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 +300 -302
- 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 +453 -450
- 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 +6837 -6836
- 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 +1 -1
- 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 +3 -3
- 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 +11 -11
- 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 -9
- 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/tests/js/index.js +7 -7
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
|
|
|
@@ -7,14 +7,16 @@ import {
|
|
|
7
7
|
closest,
|
|
8
8
|
data,
|
|
9
9
|
empty,
|
|
10
|
+
isInView,
|
|
10
11
|
isNumeric,
|
|
11
12
|
matches,
|
|
13
|
+
parent,
|
|
12
14
|
toFloat,
|
|
13
|
-
toggleClass,
|
|
14
15
|
toNumber,
|
|
16
|
+
toggleClass,
|
|
15
17
|
} from 'uikit-util';
|
|
16
|
-
import { keyMap } from '../util/keys';
|
|
17
18
|
import { generateId } from '../api/instance';
|
|
19
|
+
import { keyMap } from '../util/keys';
|
|
18
20
|
|
|
19
21
|
export default {
|
|
20
22
|
i18n: {
|
|
@@ -111,7 +113,7 @@ export default {
|
|
|
111
113
|
role: this.nav ? 'tabpanel' : 'group',
|
|
112
114
|
'aria-label': this.t('slideLabel', i + 1, this.length),
|
|
113
115
|
'aria-roledescription': this.nav ? null : 'slide',
|
|
114
|
-
})
|
|
116
|
+
}),
|
|
115
117
|
);
|
|
116
118
|
},
|
|
117
119
|
|
|
@@ -205,7 +207,6 @@ export default {
|
|
|
205
207
|
methods: {
|
|
206
208
|
updateNav() {
|
|
207
209
|
const index = this.getValidIndex();
|
|
208
|
-
let focus;
|
|
209
210
|
let focusEl;
|
|
210
211
|
for (const el of this.navItems) {
|
|
211
212
|
const cmd = data(el, this.attrItem);
|
|
@@ -223,21 +224,19 @@ export default {
|
|
|
223
224
|
});
|
|
224
225
|
|
|
225
226
|
if (active) {
|
|
226
|
-
focusEl
|
|
227
|
+
focusEl ||= matches(parent(el), ':focus-within') && button;
|
|
227
228
|
}
|
|
228
|
-
|
|
229
|
-
focus ||= matches(button, ':focus');
|
|
230
229
|
} else {
|
|
231
230
|
toggleClass(
|
|
232
231
|
el,
|
|
233
232
|
'uk-invisible',
|
|
234
233
|
this.finite &&
|
|
235
234
|
((cmd === 'previous' && index === 0) ||
|
|
236
|
-
(cmd === 'next' && index >= this.maxIndex))
|
|
235
|
+
(cmd === 'next' && index >= this.maxIndex)),
|
|
237
236
|
);
|
|
238
237
|
}
|
|
239
238
|
|
|
240
|
-
if (
|
|
239
|
+
if (focusEl && isInView(focusEl)) {
|
|
241
240
|
focusEl.focus();
|
|
242
241
|
}
|
|
243
242
|
}
|
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
|
|
package/src/js/util/class.js
CHANGED
|
@@ -11,7 +11,7 @@ export function removeClass(element, ...args) {
|
|
|
11
11
|
|
|
12
12
|
export function removeClasses(element, cls) {
|
|
13
13
|
attr(element, 'class', (value) =>
|
|
14
|
-
(value || '').replace(new RegExp(`\\b${cls}\\b\\s?`, 'g'), '')
|
|
14
|
+
(value || '').replace(new RegExp(`\\b${cls}\\b\\s?`, 'g'), ''),
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { on } from './event';
|
|
2
|
-
import { css } from './style';
|
|
3
1
|
import { $, append, remove } from './dom';
|
|
2
|
+
import { on } from './event';
|
|
4
3
|
import {
|
|
5
4
|
isDocument,
|
|
6
5
|
isElement,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
toWindow,
|
|
15
14
|
ucfirst,
|
|
16
15
|
} from './lang';
|
|
16
|
+
import { css } from './style';
|
|
17
17
|
|
|
18
18
|
const dirs = {
|
|
19
19
|
width: ['left', 'right'],
|
|
@@ -137,7 +137,7 @@ function dimension(prop) {
|
|
|
137
137
|
return css(
|
|
138
138
|
element,
|
|
139
139
|
prop,
|
|
140
|
-
!value && value !== 0 ? '' : +value + boxModelAdjust(element, prop) + 'px'
|
|
140
|
+
!value && value !== 0 ? '' : +value + boxModelAdjust(element, prop) + 'px',
|
|
141
141
|
);
|
|
142
142
|
}
|
|
143
143
|
};
|
|
@@ -149,7 +149,7 @@ export function boxModelAdjust(element, prop, sizing = 'border-box') {
|
|
|
149
149
|
dirs[prop].map(ucfirst),
|
|
150
150
|
(prop) =>
|
|
151
151
|
toFloat(css(element, `padding${prop}`)) +
|
|
152
|
-
toFloat(css(element, `border${prop}Width`))
|
|
152
|
+
toFloat(css(element, `border${prop}Width`)),
|
|
153
153
|
)
|
|
154
154
|
: 0;
|
|
155
155
|
}
|
|
@@ -182,7 +182,7 @@ export function toPx(value, property = 'width', element = window, offsetDim = fa
|
|
|
182
182
|
: offsetDim
|
|
183
183
|
? element[`offset${ucfirst(property)}`]
|
|
184
184
|
: dimensions(element)[property],
|
|
185
|
-
value
|
|
185
|
+
value,
|
|
186
186
|
)
|
|
187
187
|
: value;
|
|
188
188
|
});
|
package/src/js/util/dom.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { once } from './event';
|
|
2
2
|
import { parent } from './filter';
|
|
3
|
-
import { find, findAll } from './selector';
|
|
4
3
|
import { isElement, isString, isUndefined, startsWith, toArray, toNode, toNodes } from './lang';
|
|
4
|
+
import { find, findAll } from './selector';
|
|
5
5
|
|
|
6
6
|
export function ready(fn) {
|
|
7
7
|
if (document.readyState !== 'loading') {
|
|
@@ -60,8 +60,8 @@ export function wrapInner(element, structure) {
|
|
|
60
60
|
toNodes(element).map((element) =>
|
|
61
61
|
element.hasChildNodes()
|
|
62
62
|
? wrapAll(toArray(element.childNodes), structure)
|
|
63
|
-
: append(element, structure)
|
|
64
|
-
)
|
|
63
|
+
: append(element, structure),
|
|
64
|
+
),
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
|