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.
Files changed (144) hide show
  1. package/.eslintrc.json +0 -9
  2. package/.prettierrc.json +3 -4
  3. package/CHANGELOG.md +6 -0
  4. package/build/build.js +2 -2
  5. package/build/less.js +2 -2
  6. package/build/prefix.js +8 -7
  7. package/build/release.js +7 -7
  8. package/build/scope.js +3 -3
  9. package/build/scss.js +26 -16
  10. package/build/util.js +11 -11
  11. package/dist/css/uikit-core-rtl.css +6 -2
  12. package/dist/css/uikit-core-rtl.min.css +1 -1
  13. package/dist/css/uikit-core.css +6 -2
  14. package/dist/css/uikit-core.min.css +1 -1
  15. package/dist/css/uikit-rtl.css +6 -2
  16. package/dist/css/uikit-rtl.min.css +1 -1
  17. package/dist/css/uikit.css +6 -2
  18. package/dist/css/uikit.min.css +1 -1
  19. package/dist/js/components/countdown.js +2 -2
  20. package/dist/js/components/countdown.min.js +1 -1
  21. package/dist/js/components/filter.js +18 -18
  22. package/dist/js/components/filter.min.js +1 -1
  23. package/dist/js/components/lightbox-panel.js +347 -350
  24. package/dist/js/components/lightbox-panel.min.js +1 -1
  25. package/dist/js/components/lightbox.js +349 -352
  26. package/dist/js/components/lightbox.min.js +1 -1
  27. package/dist/js/components/notification.js +6 -6
  28. package/dist/js/components/notification.min.js +1 -1
  29. package/dist/js/components/parallax.js +76 -72
  30. package/dist/js/components/parallax.min.js +1 -1
  31. package/dist/js/components/slider-parallax.js +37 -37
  32. package/dist/js/components/slider-parallax.min.js +1 -1
  33. package/dist/js/components/slider.js +218 -224
  34. package/dist/js/components/slider.min.js +1 -1
  35. package/dist/js/components/slideshow-parallax.js +37 -37
  36. package/dist/js/components/slideshow-parallax.min.js +1 -1
  37. package/dist/js/components/slideshow.js +265 -271
  38. package/dist/js/components/slideshow.min.js +1 -1
  39. package/dist/js/components/sortable.js +2 -2
  40. package/dist/js/components/sortable.min.js +1 -1
  41. package/dist/js/components/tooltip.js +95 -95
  42. package/dist/js/components/tooltip.min.js +1 -1
  43. package/dist/js/components/upload.js +2 -2
  44. package/dist/js/components/upload.min.js +1 -1
  45. package/dist/js/uikit-core.js +459 -452
  46. package/dist/js/uikit-core.min.js +1 -1
  47. package/dist/js/uikit-icons.js +1 -1
  48. package/dist/js/uikit-icons.min.js +1 -1
  49. package/dist/js/uikit.js +6832 -6831
  50. package/dist/js/uikit.min.js +1 -1
  51. package/package.json +8 -7
  52. package/src/js/api/app.js +1 -1
  53. package/src/js/api/boot.js +2 -2
  54. package/src/js/api/component.js +1 -1
  55. package/src/js/api/computed.js +2 -2
  56. package/src/js/api/events.js +2 -2
  57. package/src/js/api/global.js +3 -3
  58. package/src/js/api/hooks.js +4 -4
  59. package/src/js/api/instance.js +3 -3
  60. package/src/js/api/log.js +1 -1
  61. package/src/js/api/observables.js +12 -6
  62. package/src/js/api/observer.js +2 -2
  63. package/src/js/api/options.js +2 -2
  64. package/src/js/api/props.js +2 -2
  65. package/src/js/api/state.js +2 -2
  66. package/src/js/components/countdown.js +1 -1
  67. package/src/js/components/filter.js +5 -5
  68. package/src/js/components/internal/lightbox-animations.js +1 -1
  69. package/src/js/components/internal/slider-transitioner.js +6 -6
  70. package/src/js/components/internal/slideshow-animations.js +1 -1
  71. package/src/js/components/lightbox-panel.js +10 -10
  72. package/src/js/components/lightbox.js +2 -2
  73. package/src/js/components/notification.js +4 -4
  74. package/src/js/components/parallax.js +5 -5
  75. package/src/js/components/slider-parallax.js +1 -1
  76. package/src/js/components/slider.js +12 -12
  77. package/src/js/components/slideshow.js +3 -3
  78. package/src/js/components/sortable.js +4 -4
  79. package/src/js/components/tooltip.js +6 -6
  80. package/src/js/components/upload.js +4 -4
  81. package/src/js/core/accordion.js +8 -8
  82. package/src/js/core/alert.js +2 -2
  83. package/src/js/core/cover.js +1 -1
  84. package/src/js/core/drop.js +12 -12
  85. package/src/js/core/dropnav.js +7 -7
  86. package/src/js/core/form-custom.js +1 -1
  87. package/src/js/core/grid.js +9 -9
  88. package/src/js/core/height-match.js +2 -2
  89. package/src/js/core/height-viewport.js +1 -1
  90. package/src/js/core/icon.js +23 -23
  91. package/src/js/core/img.js +2 -2
  92. package/src/js/core/index.js +16 -14
  93. package/src/js/core/leader.js +2 -2
  94. package/src/js/core/modal.js +7 -7
  95. package/src/js/core/navbar.js +4 -4
  96. package/src/js/core/offcanvas.js +3 -3
  97. package/src/js/core/overflow-auto.js +3 -3
  98. package/src/js/core/responsive.js +3 -3
  99. package/src/js/core/scrollspy-nav.js +1 -1
  100. package/src/js/core/scrollspy.js +1 -1
  101. package/src/js/core/sticky.js +13 -13
  102. package/src/js/core/svg.js +4 -4
  103. package/src/js/core/switcher.js +7 -7
  104. package/src/js/core/tab.js +2 -2
  105. package/src/js/core/toggle.js +5 -5
  106. package/src/js/core/video.js +1 -1
  107. package/src/js/mixin/animate.js +1 -1
  108. package/src/js/mixin/i18n.js +1 -1
  109. package/src/js/mixin/internal/animate-fade.js +14 -14
  110. package/src/js/mixin/internal/animate-slide.js +1 -1
  111. package/src/js/mixin/internal/scroll.js +1 -1
  112. package/src/js/mixin/modal.js +15 -12
  113. package/src/js/mixin/parallax.js +2 -2
  114. package/src/js/mixin/position.js +2 -2
  115. package/src/js/mixin/slider-drag.js +1 -1
  116. package/src/js/mixin/slider-nav.js +8 -14
  117. package/src/js/mixin/slider.js +9 -9
  118. package/src/js/mixin/slideshow.js +1 -1
  119. package/src/js/mixin/togglable.js +4 -4
  120. package/src/js/uikit-core.js +2 -2
  121. package/src/js/uikit.js +2 -2
  122. package/src/js/util/animation.js +8 -8
  123. package/src/js/util/class.js +1 -1
  124. package/src/js/util/dimensions.js +5 -5
  125. package/src/js/util/dom.js +3 -3
  126. package/src/js/util/event.js +3 -3
  127. package/src/js/util/filter.js +1 -1
  128. package/src/js/util/lang.js +4 -4
  129. package/src/js/util/observer.js +2 -2
  130. package/src/js/util/player.js +1 -1
  131. package/src/js/util/position.js +5 -5
  132. package/src/js/util/selector.js +1 -1
  133. package/src/js/util/style.js +1 -1
  134. package/src/js/util/svg.js +2 -2
  135. package/src/js/util/viewport.js +6 -6
  136. package/src/less/components/slider.less +8 -2
  137. package/src/scss/components/inverse.scss +0 -1
  138. package/src/scss/components/slider.scss +8 -2
  139. package/src/scss/mixins-theme.scss +560 -552
  140. package/src/scss/mixins.scss +456 -448
  141. package/src/scss/variables-theme.scss +2 -2
  142. package/src/scss/variables.scss +2 -2
  143. package/tests/js/index.js +7 -7
  144. package/build/scss/inverse.scss +0 -30
@@ -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
  },
@@ -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
 
@@ -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);
@@ -1,6 +1,6 @@
1
- import Switcher from './switcher';
2
- import Class from '../mixin/class';
3
1
  import { hasClass } from 'uikit-util';
2
+ import Class from '../mixin/class';
3
+ import Switcher from './switcher';
4
4
 
5
5
  export default {
6
6
  mixins: [Class],
@@ -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
  },
@@ -1,5 +1,5 @@
1
- import { intersection, resize } from '../api/observables';
2
1
  import { hasAttr, isInView, isTag, isVideo, isVisible, mute, pause, play } from 'uikit-util';
2
+ import { intersection, resize } from '../api/observables';
3
3
 
4
4
  export default {
5
5
  args: 'autoplay',
@@ -1,6 +1,6 @@
1
+ import { noop } from 'uikit-util';
1
2
  import fade from './internal/animate-fade';
2
3
  import slide from './internal/animate-slide';
3
- import { noop } from 'uikit-util';
4
4
 
5
5
  export default {
6
6
  props: {
@@ -13,7 +13,7 @@ export default {
13
13
  return (
14
14
  (this.i18n?.[key] || this.$options.i18n?.[key])?.replace(
15
15
  /%s/g,
16
- () => params[i++] || ''
16
+ () => params[i++] || '',
17
17
  ) || ''
18
18
  );
19
19
  },
@@ -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
 
@@ -96,7 +96,7 @@ function getTransitionProps(target, nodes, currentProps) {
96
96
  ? getPositionWithMargin(el)
97
97
  : { opacity: 0 }
98
98
  : { opacity: isVisible(el) ? 1 : 0 }
99
- : false
99
+ : false,
100
100
  );
101
101
 
102
102
  const propsFrom = propsTo.map((props, i) => {
@@ -17,7 +17,7 @@ export function preventBackgroundScroll(el) {
17
17
  e.preventDefault();
18
18
  }
19
19
  },
20
- { passive: false }
20
+ { passive: false },
21
21
  );
22
22
 
23
23
  if (prevented) {
@@ -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
- off();
249
- resolve();
250
- }, toMs(css(transitionElement, 'transitionDuration')));
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
  }
@@ -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,
@@ -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
 
@@ -212,7 +212,7 @@ export default {
212
212
  (this.dir > 0 && !dirChange) || (this.dir < 0 && dirChange)
213
213
  ? 'next'
214
214
  : 'previous',
215
- true
215
+ true,
216
216
  );
217
217
  }
218
218
  }
@@ -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
- let focus;
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
- focusEl = button;
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
  },
@@ -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
  }
@@ -1,7 +1,7 @@
1
- import UIkit from './api/index';
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
 
@@ -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 { addClass, hasClass, removeClass, removeClasses } from './class';
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