@kiva/kv-components 3.5.0 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/package.json +2 -2
- package/vue/KvCarousel.vue +7 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.5.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.5.1...@kiva/kv-components@3.5.2) (2022-09-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **KvCarousel:** slidesToScroll should not be 0 MARS-248 ([c2fc929](https://github.com/kiva/kv-ui-elements/commit/c2fc929fbdcf87a061b71fff14b91ab8064fc130))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [3.5.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.5.0...@kiva/kv-components@3.5.1) (2022-09-13)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **KvCarousel:** incorrect slide marked as current ([f496e7c](https://github.com/kiva/kv-ui-elements/commit/f496e7c0a8fdebd1f6e003f4c79b57a5926b0c4a))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [3.5.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.4.0...@kiva/kv-components@3.5.0) (2022-09-07)
|
|
7
29
|
|
|
8
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"optional": true
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "0c86a3bf05ab8d27e7d48d7c6f9e67e559dc0155"
|
|
72
72
|
}
|
package/vue/KvCarousel.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section
|
|
3
3
|
ref="rootEl"
|
|
4
|
-
class="tw-overflow-hidden tw-w-full"
|
|
4
|
+
class="kv-carousel tw-overflow-hidden tw-w-full"
|
|
5
5
|
aria-label="carousel"
|
|
6
6
|
>
|
|
7
7
|
<!-- Carousel Content -->
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
class="tw-flex-none tw-relative"
|
|
16
16
|
role="group"
|
|
17
17
|
:aria-label="`slide ${index + 1} of ${componentSlotKeys.length}`"
|
|
18
|
-
:aria-current="
|
|
19
|
-
:aria-hidden="isAriaHidden(index)"
|
|
18
|
+
:aria-current="currentIndex === index ? 'true' : 'false'"
|
|
19
|
+
:aria-hidden="isAriaHidden(index)? 'true' : 'false'"
|
|
20
20
|
:tab-index="isAriaHidden(index) ? '-1' : false"
|
|
21
21
|
:class="{ 'tw-w-full': !multipleSlidesVisible || slideMaxWidth }"
|
|
22
22
|
:style="slideMaxWidth ? `max-width:${slideMaxWidth}` :''"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<!-- Carousel Controls -->
|
|
30
30
|
<div
|
|
31
31
|
v-if="slideIndicatorCount > 1"
|
|
32
|
-
class="tw-flex
|
|
32
|
+
class="kv-carousel__controls tw-flex
|
|
33
33
|
tw-justify-between md:tw-justify-center tw-items-center
|
|
34
34
|
tw-mt-4 tw-w-full"
|
|
35
35
|
>
|
|
@@ -239,14 +239,12 @@ export default {
|
|
|
239
239
|
* If the slide is not completely in view in the carousel
|
|
240
240
|
* it should be aria-hidden
|
|
241
241
|
*
|
|
242
|
-
* @param {Number} index The current index of the slide
|
|
242
|
+
* @param {Number} index The current index of the slide
|
|
243
243
|
* @returns {Boolean}
|
|
244
244
|
*/
|
|
245
245
|
const isAriaHidden = (index) => {
|
|
246
|
-
// Index starts at 1
|
|
247
|
-
// Embla starts at 0
|
|
248
246
|
if (embla.value) {
|
|
249
|
-
return !embla.value.slidesInView(true).includes(index
|
|
247
|
+
return !embla.value.slidesInView(true).includes(index);
|
|
250
248
|
}
|
|
251
249
|
return false;
|
|
252
250
|
};
|
|
@@ -267,7 +265,7 @@ export default {
|
|
|
267
265
|
'resize',
|
|
268
266
|
throttle(() => {
|
|
269
267
|
embla.value.reInit({
|
|
270
|
-
slidesToScroll: embla.value.slidesInView(true).length,
|
|
268
|
+
slidesToScroll: embla.value.slidesInView(true).length || 'auto',
|
|
271
269
|
inViewThreshold: 0.9,
|
|
272
270
|
});
|
|
273
271
|
slides.value = embla.value.slideNodes();
|