uikit 3.25.17-dev.80dfe87 → 3.25.17-dev.8c70e44

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 (200) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/build/prefix.js +1 -1
  3. package/build/publishDev.js +1 -1
  4. package/build/release.js +2 -2
  5. package/build/scope.js +1 -1
  6. package/build/scss.js +1 -1
  7. package/dist/css/uikit-core-rtl.css +892 -802
  8. package/dist/css/uikit-core-rtl.min.css +1 -1
  9. package/dist/css/uikit-core.css +892 -802
  10. package/dist/css/uikit-core.min.css +1 -1
  11. package/dist/css/uikit-rtl.css +893 -803
  12. package/dist/css/uikit-rtl.min.css +1 -1
  13. package/dist/css/uikit.css +893 -803
  14. package/dist/css/uikit.min.css +1 -1
  15. package/dist/js/components/countdown.js +1 -1
  16. package/dist/js/components/countdown.min.js +1 -1
  17. package/dist/js/components/filter.js +1 -1
  18. package/dist/js/components/filter.min.js +1 -1
  19. package/dist/js/components/lightbox-panel.js +133 -132
  20. package/dist/js/components/lightbox-panel.min.js +1 -1
  21. package/dist/js/components/lightbox.js +134 -133
  22. package/dist/js/components/lightbox.min.js +1 -1
  23. package/dist/js/components/marquee.js +179 -0
  24. package/dist/js/components/marquee.min.js +1 -0
  25. package/dist/js/components/notification.js +1 -1
  26. package/dist/js/components/notification.min.js +1 -1
  27. package/dist/js/components/parallax.js +8 -12
  28. package/dist/js/components/parallax.min.js +1 -1
  29. package/dist/js/components/slider-parallax.js +8 -12
  30. package/dist/js/components/slider-parallax.min.js +1 -1
  31. package/dist/js/components/slider.js +41 -25
  32. package/dist/js/components/slider.min.js +1 -1
  33. package/dist/js/components/slideshow-parallax.js +8 -12
  34. package/dist/js/components/slideshow-parallax.min.js +1 -1
  35. package/dist/js/components/slideshow.js +71 -102
  36. package/dist/js/components/slideshow.min.js +1 -1
  37. package/dist/js/components/sortable.js +1 -1
  38. package/dist/js/components/sortable.min.js +1 -1
  39. package/dist/js/components/tooltip.js +19 -19
  40. package/dist/js/components/tooltip.min.js +1 -1
  41. package/dist/js/components/upload.js +1 -1
  42. package/dist/js/components/upload.min.js +1 -1
  43. package/dist/js/uikit-core.js +754 -262
  44. package/dist/js/uikit-core.min.js +1 -1
  45. package/dist/js/uikit-icons.js +1 -1
  46. package/dist/js/uikit-icons.min.js +1 -1
  47. package/dist/js/uikit.js +629 -374
  48. package/dist/js/uikit.min.js +1 -1
  49. package/package.json +2 -2
  50. package/src/js/api/component.js +2 -3
  51. package/src/js/api/observables.js +2 -4
  52. package/src/js/api/options.js +6 -3
  53. package/src/js/api/props.js +1 -4
  54. package/src/js/api/state.js +7 -8
  55. package/src/js/components/index.js +1 -0
  56. package/src/js/components/internal/lightbox-animations.js +7 -26
  57. package/src/js/components/internal/slideshow-animations.js +15 -62
  58. package/src/js/components/lightbox-panel.js +121 -96
  59. package/src/js/components/lightbox.js +5 -8
  60. package/src/js/components/marquee.js +123 -0
  61. package/src/js/components/tooltip.js +4 -2
  62. package/src/js/core/accordion.js +78 -29
  63. package/src/js/core/drop.js +5 -4
  64. package/src/js/core/dropnav.js +3 -3
  65. package/src/js/core/grid.js +5 -19
  66. package/src/js/core/height-match.js +1 -2
  67. package/src/js/core/margin.js +3 -0
  68. package/src/js/core/overflow-fade.js +5 -5
  69. package/src/js/core/sticky.js +1 -1
  70. package/src/js/core/switcher.js +24 -44
  71. package/src/js/core/video.js +172 -15
  72. package/src/js/mixin/connect.js +57 -0
  73. package/src/js/mixin/internal/slideshow-animations.js +5 -13
  74. package/src/js/mixin/internal/slideshow-transitioner.js +2 -2
  75. package/src/js/mixin/modal.js +4 -3
  76. package/src/js/mixin/parallax.js +1 -4
  77. package/src/js/mixin/position.js +1 -1
  78. package/src/js/mixin/scroll-driven.js +57 -0
  79. package/src/js/mixin/slider-nav.js +1 -1
  80. package/src/js/mixin/slider-parallax.js +9 -38
  81. package/src/js/mixin/togglable.js +13 -14
  82. package/src/js/util/attr.js +7 -7
  83. package/src/js/util/class.js +1 -1
  84. package/src/js/util/dom.js +3 -4
  85. package/src/js/util/lang.js +1 -1
  86. package/src/js/util/player.js +4 -4
  87. package/src/js/util/style.js +10 -15
  88. package/src/js/util/viewport.js +22 -25
  89. package/src/less/components/_import.less +6 -1
  90. package/src/less/components/base.less +1 -1
  91. package/src/less/components/button.less +1 -1
  92. package/src/less/components/dropcap.less +71 -0
  93. package/src/less/components/floating-shadow.less +65 -0
  94. package/src/less/components/form.less +5 -5
  95. package/src/less/components/grid.less +57 -64
  96. package/src/less/components/logo.less +94 -0
  97. package/src/less/components/margin.less +81 -81
  98. package/src/less/components/marquee.less +133 -0
  99. package/src/less/components/nav.less +1 -1
  100. package/src/less/components/padding.less +9 -9
  101. package/src/less/components/utility.less +0 -157
  102. package/src/less/theme/_import.less +5 -1
  103. package/src/less/theme/dropcap.less +29 -0
  104. package/src/less/theme/floating-shadow.less +20 -0
  105. package/src/less/theme/logo.less +29 -0
  106. package/src/less/theme/marquee.less +14 -0
  107. package/src/less/theme/utility.less +0 -32
  108. package/src/scss/components/_import.scss +6 -1
  109. package/src/scss/components/base.scss +1 -1
  110. package/src/scss/components/button.scss +1 -1
  111. package/src/scss/components/dropcap.scss +63 -0
  112. package/src/scss/components/floating-shadow.scss +62 -0
  113. package/src/scss/components/form.scss +5 -5
  114. package/src/scss/components/grid.scss +57 -64
  115. package/src/scss/components/logo.scss +75 -0
  116. package/src/scss/components/margin.scss +81 -81
  117. package/src/scss/components/marquee.scss +136 -0
  118. package/src/scss/components/nav.scss +1 -1
  119. package/src/scss/components/padding.scss +9 -9
  120. package/src/scss/components/utility.scss +0 -128
  121. package/src/scss/mixins-theme.scss +41 -32
  122. package/src/scss/mixins.scss +38 -29
  123. package/src/scss/variables-theme.scss +14 -9
  124. package/src/scss/variables.scss +14 -9
  125. package/tests/accordion.html +77 -10
  126. package/tests/alert.html +1 -1
  127. package/tests/align.html +5 -5
  128. package/tests/animation.html +4 -4
  129. package/tests/article.html +7 -7
  130. package/tests/background.html +2 -2
  131. package/tests/badge.html +1 -1
  132. package/tests/base.html +2 -2
  133. package/tests/button.html +1 -1
  134. package/tests/card.html +15 -15
  135. package/tests/close.html +2 -2
  136. package/tests/comment.html +9 -9
  137. package/tests/container.html +2 -2
  138. package/tests/countdown.html +21 -21
  139. package/tests/cover.html +3 -3
  140. package/tests/description-list.html +1 -1
  141. package/tests/divider.html +3 -3
  142. package/tests/dotnav.html +1 -1
  143. package/tests/drop.html +7 -7
  144. package/tests/dropbar.html +5 -5
  145. package/tests/dropcap.html +26 -0
  146. package/tests/dropdown.html +1 -1
  147. package/tests/dropnav.html +18 -18
  148. package/tests/filter.html +3 -3
  149. package/tests/floating-shadow.html +44 -0
  150. package/tests/form.html +14 -14
  151. package/tests/grid.html +41 -47
  152. package/tests/heading.html +2 -2
  153. package/tests/height-viewport.html +4 -4
  154. package/tests/height.html +5 -5
  155. package/tests/icon.html +8 -8
  156. package/tests/image.html +6 -6
  157. package/tests/index.html +13 -13
  158. package/tests/js/index.js +1 -1
  159. package/tests/leader.html +5 -5
  160. package/tests/lightbox.html +6 -6
  161. package/tests/link.html +1 -1
  162. package/tests/list.html +4 -4
  163. package/tests/logo.html +84 -0
  164. package/tests/margin.html +7 -7
  165. package/tests/marker.html +3 -3
  166. package/tests/marquee.html +617 -0
  167. package/tests/modal.html +3 -3
  168. package/tests/nav.html +5 -5
  169. package/tests/navbar.html +27 -27
  170. package/tests/notification.html +2 -2
  171. package/tests/offcanvas.html +12 -12
  172. package/tests/overlay.html +3 -3
  173. package/tests/padding.html +1 -1
  174. package/tests/pagination.html +3 -3
  175. package/tests/parallax.html +1 -1
  176. package/tests/position.html +6 -6
  177. package/tests/scrollspy.html +12 -12
  178. package/tests/search.html +5 -5
  179. package/tests/section.html +17 -17
  180. package/tests/slidenav.html +3 -3
  181. package/tests/slider.html +5 -5
  182. package/tests/slideshow.html +3 -3
  183. package/tests/sortable.html +15 -15
  184. package/tests/sticky-navbar.html +4 -4
  185. package/tests/sticky-parallax.html +3 -3
  186. package/tests/sticky.html +3 -3
  187. package/tests/svg.html +3 -2
  188. package/tests/switcher.html +6 -6
  189. package/tests/tab.html +4 -4
  190. package/tests/text.html +3 -3
  191. package/tests/tile.html +4 -4
  192. package/tests/toggle.html +1 -1
  193. package/tests/tooltip.html +3 -3
  194. package/tests/totop.html +2 -2
  195. package/tests/transition.html +1 -1
  196. package/tests/upload.html +5 -5
  197. package/tests/utility.html +16 -116
  198. package/tests/video.html +224 -24
  199. package/tests/visibility.html +4 -4
  200. package/tests/width.html +12 -12
@@ -6,6 +6,7 @@ import {
6
6
  css,
7
7
  dimensions,
8
8
  filter,
9
+ findIndex,
9
10
  getIndex,
10
11
  hasClass,
11
12
  includes,
@@ -22,15 +23,14 @@ import {
22
23
  import { generateId } from '../api/instance';
23
24
  import { lazyload } from '../api/observables';
24
25
  import Class from '../mixin/class';
26
+ import Connect from '../mixin/connect';
25
27
  import { maybeDefaultPreventClick } from '../mixin/event';
26
- import Togglable from '../mixin/togglable';
27
28
  import { keyMap } from '../util/keys';
28
29
 
29
30
  export default {
30
- mixins: [Class, Togglable],
31
+ mixins: [Class, Connect],
31
32
 
32
33
  props: {
33
- animation: Boolean,
34
34
  targets: String,
35
35
  active: null,
36
36
  collapsible: Boolean,
@@ -38,18 +38,25 @@ export default {
38
38
  toggle: String,
39
39
  content: String,
40
40
  offset: Number,
41
+ switcherConnect: String,
41
42
  },
42
43
 
43
44
  data: {
44
45
  targets: '> *',
45
46
  active: false,
46
- animation: true,
47
+ animation: [true],
47
48
  collapsible: true,
48
49
  multiple: false,
49
50
  clsOpen: 'uk-open',
51
+ cls: 'uk-active',
50
52
  toggle: '.uk-accordion-title',
51
53
  content: '.uk-accordion-content',
52
54
  offset: 0,
55
+ switcherConnect: '',
56
+ },
57
+
58
+ beforeConnect() {
59
+ this.connect = this.$props.connect = this.switcherConnect;
53
60
  },
54
61
 
55
62
  computed: {
@@ -79,6 +86,13 @@ export default {
79
86
  }
80
87
  },
81
88
 
89
+ connectChildren() {
90
+ this.showConnects(
91
+ findIndex(this.items, (el) => hasClass(el, this.clsOpen)),
92
+ false,
93
+ );
94
+ },
95
+
82
96
  toggles() {
83
97
  this.$emit();
84
98
  },
@@ -146,51 +160,86 @@ export default {
146
160
  }
147
161
 
148
162
  toggle.id = generateId(this, toggle);
149
- content.id = generateId(this, content);
150
163
 
151
164
  const active = includes(activeItems, this.items[index]);
165
+
166
+ attr(content, {
167
+ id: generateId(this, content),
168
+ role: 'region',
169
+ 'aria-labelledby': toggle.id,
170
+ });
171
+ if (isTag(content, 'ul')) {
172
+ attr(children(content), 'role', 'presentation');
173
+ }
174
+
175
+ const controls = [content.id];
176
+ for (const { children } of this.connects) {
177
+ const item = children[index];
178
+
179
+ if (!item) {
180
+ continue;
181
+ }
182
+
183
+ attr(item, {
184
+ id: generateId(this, item),
185
+ role: 'tabpanel',
186
+ 'aria-labelledby': toggle.id,
187
+ });
188
+ controls.push(item.id);
189
+ }
190
+
152
191
  attr(toggle, {
153
192
  role: isTag(toggle, 'a') ? 'button' : null,
154
- 'aria-controls': content.id,
193
+ 'aria-controls': controls.join(' '),
155
194
  'aria-expanded': active,
156
195
  'aria-disabled': !this.collapsible && activeItems.length < 2 && active,
157
196
  });
158
-
159
- attr(content, { role: 'region', 'aria-labelledby': toggle.id });
160
- if (isTag(content, 'ul')) {
161
- attr(children(content), 'role', 'presentation');
162
- }
163
197
  }
164
198
  },
165
199
 
166
200
  methods: {
167
- toggle(item, animate) {
168
- item = this.items[getIndex(item, this.items)];
201
+ async toggle(item, animate) {
202
+ animate = animate !== false;
203
+
204
+ const next = getIndex(item, this.items);
205
+
206
+ item = this.items[next];
169
207
  let items = [item];
170
208
  const activeItems = filter(this.items, `.${this.clsOpen}`);
209
+ const isActive = includes(activeItems, item);
171
210
 
172
- if (!this.multiple && !includes(activeItems, items[0])) {
173
- items = items.concat(activeItems);
211
+ if (isActive && !this.collapsible && activeItems.length < 2) {
212
+ return;
174
213
  }
175
214
 
176
- if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {
177
- items = [];
215
+ if (!isActive && !this.multiple) {
216
+ items.push(...activeItems);
178
217
  }
179
218
 
180
- return Promise.all(
181
- items.map((el) =>
182
- this.toggleElement(el, !includes(activeItems, el), (el, show) => {
183
- toggleClass(el, this.clsOpen, show);
219
+ const toggle = (el) =>
220
+ this.toggleElement(el, !includes(activeItems, el), (el, show) => {
221
+ toggleClass(el, this.clsOpen, show);
184
222
 
185
- if (animate === false || !this.animation) {
186
- hide($(this.content, el), !show);
187
- return;
188
- }
223
+ if (!animate || !this.hasAnimation) {
224
+ hide($(this.content, el), !show);
225
+ return;
226
+ }
189
227
 
190
- return transition(el, show, this);
191
- }),
192
- ),
193
- );
228
+ return transition(el, show, this);
229
+ });
230
+
231
+ const hideIndex = () => {
232
+ const index = findIndex(children(this.connects[0]), (el) => hasClass(el, this.cls));
233
+
234
+ return index === next
235
+ ? findIndex(this.items, (i) => i !== item && includes(activeItems, i))
236
+ : index;
237
+ };
238
+
239
+ return Promise.all([
240
+ ...items.map(toggle),
241
+ this.showConnects(isActive ? hideIndex() : next, animate),
242
+ ]);
194
243
  },
195
244
  },
196
245
  };
@@ -392,6 +392,7 @@ export default {
392
392
  this.$el.hidden = true;
393
393
 
394
394
  const viewports = this.target.map((target) => getViewport(this.$el, target));
395
+ const boundaryOffsets = this.boundary.map((el) => offset(el));
395
396
  const viewportOffset = this.getViewportOffset(this.$el);
396
397
 
397
398
  const dirs = [
@@ -403,7 +404,7 @@ export default {
403
404
  if (this.axis !== axis && includes([axis, true], this.stretch)) {
404
405
  css(this.$el, {
405
406
  [prop]: Math.min(
406
- offset(this.boundary[i])[prop],
407
+ boundaryOffsets[i][prop],
407
408
  viewports[i][prop] - 2 * viewportOffset,
408
409
  ),
409
410
  [`overflow-${axis}`]: 'auto',
@@ -436,11 +437,11 @@ export default {
436
437
  (targetOffset[start] > elOffset[start]
437
438
  ? targetOffset[this.inset ? end : start] -
438
439
  Math.max(
439
- offset(this.boundary[i])[start],
440
+ boundaryOffsets[i][start],
440
441
  viewports[i][start] + viewportOffset,
441
442
  )
442
443
  : Math.min(
443
- offset(this.boundary[i])[end],
444
+ boundaryOffsets[i][end],
444
445
  viewports[i][end] - viewportOffset,
445
446
  ) - targetOffset[this.inset ? start : end]) - positionOffset,
446
447
  [`overflow-${axis}`]: 'auto',
@@ -476,7 +477,7 @@ function listenForResize(drop) {
476
477
  observeViewportResize(update),
477
478
  observeResize(overflowParents(drop.$el).concat(drop.target), update),
478
479
  ];
479
- return () => off.map((observer) => observer.disconnect());
480
+ return () => off.forEach((observer) => observer.disconnect());
480
481
  }
481
482
 
482
483
  function listenForScroll(drop, fn = () => drop.$emit()) {
@@ -286,9 +286,9 @@ export default {
286
286
  const drop = this.getDropdown(target);
287
287
  const adjustHeight = () => {
288
288
  const maxBottom = Math.max(
289
- ...parents(target, `.${this.clsDrop}`)
290
- .concat(target)
291
- .map((el) => offset(el).bottom),
289
+ ...[...parents(target, `.${this.clsDrop}`), target].map(
290
+ (el) => offset(el).bottom,
291
+ ),
292
292
  );
293
293
 
294
294
  offset(this.dropbar, {
@@ -1,14 +1,4 @@
1
- import {
2
- addClass,
3
- css,
4
- hasClass,
5
- isRtl,
6
- scrolledOver,
7
- sumBy,
8
- toFloat,
9
- toggleClass,
10
- toPx,
11
- } from 'uikit-util';
1
+ import { addClass, css, isRtl, scrolledOver, sumBy, toFloat, toggleClass, toPx } from 'uikit-util';
12
2
  import { scroll } from '../api/observables';
13
3
  import Class from '../mixin/class';
14
4
  import Margin from './margin';
@@ -29,7 +19,8 @@ export default {
29
19
  },
30
20
 
31
21
  data: {
32
- margin: 'uk-grid-margin',
22
+ margin: '',
23
+ firstRow: 'uk-first-row',
33
24
  clsStack: 'uk-grid-stack',
34
25
  masonry: false,
35
26
  parallax: 0,
@@ -56,7 +47,7 @@ export default {
56
47
  {
57
48
  read(data) {
58
49
  const { rows } = data;
59
- let { masonry, parallax, parallaxJustify, margin } = this;
50
+ let { masonry, parallax, parallaxJustify } = this;
60
51
 
61
52
  parallax = Math.max(0, toPx(parallax));
62
53
 
@@ -71,7 +62,7 @@ export default {
71
62
  return (data.translates = data.scrollColumns = false);
72
63
  }
73
64
 
74
- let gutter = getGutter(rows, margin);
65
+ let gutter = toFloat(css(this.$el, 'row-gap'));
75
66
 
76
67
  let columns;
77
68
  let translates;
@@ -185,11 +176,6 @@ function applyMasonry(rows, gutter, next) {
185
176
  return [columns, translates];
186
177
  }
187
178
 
188
- function getGutter(rows, cls) {
189
- const node = rows.flat().find((el) => hasClass(el, cls));
190
- return toFloat(node ? css(node, 'marginTop') : css(rows[0][0], 'paddingLeft'));
191
- }
192
-
193
179
  function transpose(rows) {
194
180
  const columns = [];
195
181
  for (const row of rows) {
@@ -20,8 +20,7 @@ export default {
20
20
  },
21
21
 
22
22
  observe: resize({
23
- target: ({ $el, elements }) =>
24
- elements.reduce((elements, el) => elements.concat(el, ...el.children), [$el]),
23
+ target: ({ $el, elements }) => [$el, ...elements.flatMap((el) => [el, ...el.children])],
25
24
  }),
26
25
 
27
26
  events: {
@@ -4,11 +4,13 @@ import { mutation, resize } from '../api/observables';
4
4
  export default {
5
5
  props: {
6
6
  margin: String,
7
+ firstRow: Boolean,
7
8
  firstColumn: Boolean,
8
9
  },
9
10
 
10
11
  data: {
11
12
  margin: 'uk-margin-small-top',
13
+ firstRow: false,
12
14
  firstColumn: 'uk-first-column',
13
15
  },
14
16
 
@@ -52,6 +54,7 @@ export default {
52
54
  for (const row of rows) {
53
55
  for (const el of row) {
54
56
  toggleClass(el, this.margin, rows[0] !== row);
57
+ toggleClass(el, this.firstRow, rows[0] === row);
55
58
  toggleClass(el, this.firstColumn, row[isRtl ? row.length - 1 : 0] === el);
56
59
  }
57
60
  }
@@ -55,11 +55,11 @@ export default {
55
55
 
56
56
  update: {
57
57
  read() {
58
- const overflow = [];
59
- for (const prop of ['Width', 'Height']) {
60
- overflow.push(this.$el[`scroll${prop}`] - this.$el[`client${prop}`]);
61
- }
62
- return { overflow };
58
+ return {
59
+ overflow: ['Width', 'Height'].map(
60
+ (prop) => this.$el[`scroll${prop}`] - this.$el[`client${prop}`],
61
+ ),
62
+ };
63
63
  },
64
64
 
65
65
  write({ overflow }) {
@@ -464,7 +464,7 @@ function parseProp(value, el, propOffset, padding) {
464
464
  return 0;
465
465
  }
466
466
 
467
- if (isNumeric(value) || (isString(value) && value.match(/^-?\d/))) {
467
+ if (isNumeric(value) || (isString(value) && /^-?\d/.test(value))) {
468
468
  return propOffset + toPx(value, 'height', el, true);
469
469
  } else {
470
470
  const refElement = value === true ? getVisibleParent(el) : query(value, el);
@@ -9,27 +9,24 @@ import {
9
9
  getIndex,
10
10
  hasClass,
11
11
  isNumeric,
12
- isTag,
13
12
  matches,
14
13
  queryAll,
15
- toArray,
16
14
  toggleClass,
17
15
  } from 'uikit-util';
18
16
  import { generateId } from '../api/instance';
19
- import { lazyload, swipe } from '../api/observables';
17
+ import { swipe } from '../api/observables';
18
+ import Connect from '../mixin/connect';
20
19
  import { maybeDefaultPreventClick } from '../mixin/event';
21
- import Togglable from '../mixin/togglable';
22
20
  import { keyMap } from '../util/keys';
23
21
 
24
22
  const selDisabled = '.uk-disabled *, .uk-disabled, [disabled]';
25
23
 
26
24
  export default {
27
- mixins: [Togglable],
25
+ mixins: [Connect],
28
26
 
29
27
  args: 'connect',
30
28
 
31
29
  props: {
32
- connect: String,
33
30
  toggle: String,
34
31
  itemNav: String,
35
32
  active: Number,
@@ -42,7 +39,6 @@ export default {
42
39
  toggle: '> * > :first-child',
43
40
  itemNav: false,
44
41
  active: 0,
45
- cls: 'uk-active',
46
42
  attrItem: 'uk-switcher-item',
47
43
  selVertical: '.uk-nav',
48
44
  followFocus: false,
@@ -50,15 +46,6 @@ export default {
50
46
  },
51
47
 
52
48
  computed: {
53
- connects: {
54
- get: ({ connect }, $el) => queryAll(connect, $el),
55
- observe: ({ connect }) => connect,
56
- },
57
-
58
- connectChildren() {
59
- return this.connects.map((el) => children(el)).flat();
60
- },
61
-
62
49
  toggles: ({ toggle }, $el) => $$(toggle, $el),
63
50
 
64
51
  children(_, $el) {
@@ -95,10 +82,7 @@ export default {
95
82
  this.$el.role = 'tablist';
96
83
  },
97
84
 
98
- observe: [
99
- lazyload({ targets: ({ connectChildren }) => connectChildren }),
100
- swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping }),
101
- ],
85
+ observe: swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping }),
102
86
 
103
87
  events: [
104
88
  {
@@ -180,28 +164,33 @@ export default {
180
164
  ],
181
165
 
182
166
  update() {
183
- for (const el of this.connects) {
184
- if (isTag(el, 'ul')) {
185
- el.role = 'presentation';
186
- }
187
- }
188
167
  attr(children(this.$el), 'role', 'presentation');
189
168
 
190
169
  for (const index in this.toggles) {
191
170
  const toggle = this.toggles[index];
192
- const item = this.connects[0]?.children[index];
171
+ toggle.id = generateId(this, toggle);
193
172
 
194
- toggle.role = 'tab';
173
+ const controls = [];
195
174
 
196
- if (!item) {
197
- continue;
198
- }
175
+ for (const { children } of this.connects) {
176
+ const item = children[index];
199
177
 
200
- toggle.id = generateId(this, toggle);
201
- item.id = generateId(this, item);
178
+ if (!item) {
179
+ continue;
180
+ }
181
+
182
+ attr(item, {
183
+ id: generateId(this, item),
184
+ role: 'tabpanel',
185
+ 'aria-labelledby': toggle.id,
186
+ });
187
+ controls.push(item.id);
188
+ }
202
189
 
203
- toggle.ariaControls = item.id;
204
- attr(item, { role: 'tabpanel', 'aria-labelledby': toggle.id });
190
+ attr(toggle, {
191
+ role: 'tab',
192
+ 'aria-controls': controls.join(' '),
193
+ });
205
194
  }
206
195
  attr(this.$el, 'aria-orientation', matches(this.$el, this.selVertical) ? 'vertical' : null);
207
196
  },
@@ -240,16 +229,7 @@ export default {
240
229
  });
241
230
  });
242
231
 
243
- const animate = prev >= 0 && prev !== next;
244
- this.connects.forEach(async ({ children }) => {
245
- const actives = toArray(children).filter(
246
- (child, i) => i !== next && hasClass(child, this.cls),
247
- );
248
-
249
- if (await this.toggleElement(actives, false, animate)) {
250
- await this.toggleElement(children[next], true, animate);
251
- }
252
- });
232
+ return this.showConnects(next, prev >= 0);
253
233
  },
254
234
  },
255
235
  };