@kiva/kv-components 4.7.1 → 4.8.0
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 +11 -0
- package/dist/components/stories/KvVerticalCarousel.stories.js +1 -0
- package/dist/utils/carousels.cjs +5 -2
- package/dist/utils/carousels.js +1 -1
- package/dist/utils/{chunk-WLQNGWMC.js → chunk-WJV72VFJ.js} +5 -2
- package/dist/utils/index.cjs +5 -2
- package/dist/utils/index.js +1 -1
- package/package.json +2 -2
- package/utils/carousels.js +5 -2
- package/vue/stories/KvVerticalCarousel.stories.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [4.8.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@4.7.1...@kiva/kv-components@4.8.0) (2025-01-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* make sure autoplay stops on carousel interactions ([a973201](https://github.com/kiva/kv-ui-elements/commit/a97320125351e82ccdd946abd91507a2f619b1d3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [4.7.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@4.7.0...@kiva/kv-components@4.7.1) (2025-01-09)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -208,6 +208,7 @@ export const AutoPlayButton = () => ({
|
|
|
208
208
|
<a href="#" @click.native.prevent="$refs.sampleCarousel.toggleAutoPlay()" role="toggleAutoPlayButton">Toggle AutoPlay</a>
|
|
209
209
|
<br/>
|
|
210
210
|
<p>AutoPlay is: {{ isAutoplaying ? 'ON' : 'OFF' }}</p>
|
|
211
|
+
<a href="#" @click.native.prevent="$refs.sampleCarousel.goToSlide(0)">Go To Slide 0</a>
|
|
211
212
|
</div>
|
|
212
213
|
`,
|
|
213
214
|
});
|
package/dist/utils/carousels.cjs
CHANGED
|
@@ -84,6 +84,11 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
84
84
|
return slides.value.length - 1;
|
|
85
85
|
});
|
|
86
86
|
const goToSlide = (index) => {
|
|
87
|
+
var _a2, _b;
|
|
88
|
+
const autoplay = (_b = (_a2 = embla.value) == null ? void 0 : _a2.plugins()) == null ? void 0 : _b.autoplay;
|
|
89
|
+
if (autoplay) {
|
|
90
|
+
autoplay.stop();
|
|
91
|
+
}
|
|
87
92
|
embla.value.scrollTo(index);
|
|
88
93
|
};
|
|
89
94
|
const handleUserInteraction = async (index, interactionType) => {
|
|
@@ -180,11 +185,9 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
180
185
|
});
|
|
181
186
|
});
|
|
182
187
|
(_b = embla == null ? void 0 : embla.value) == null ? void 0 : _b.on("autoplay:play", () => {
|
|
183
|
-
console.log("autoplay:play");
|
|
184
188
|
isAutoplaying.value = true;
|
|
185
189
|
});
|
|
186
190
|
(_c = embla == null ? void 0 : embla.value) == null ? void 0 : _c.on("autoplay:stop", () => {
|
|
187
|
-
console.log("autoplay:stop");
|
|
188
191
|
isAutoplaying.value = false;
|
|
189
192
|
});
|
|
190
193
|
});
|
package/dist/utils/carousels.js
CHANGED
|
@@ -48,6 +48,11 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
48
48
|
return slides.value.length - 1;
|
|
49
49
|
});
|
|
50
50
|
const goToSlide = (index) => {
|
|
51
|
+
var _a2, _b;
|
|
52
|
+
const autoplay = (_b = (_a2 = embla.value) == null ? void 0 : _a2.plugins()) == null ? void 0 : _b.autoplay;
|
|
53
|
+
if (autoplay) {
|
|
54
|
+
autoplay.stop();
|
|
55
|
+
}
|
|
51
56
|
embla.value.scrollTo(index);
|
|
52
57
|
};
|
|
53
58
|
const handleUserInteraction = async (index, interactionType) => {
|
|
@@ -144,11 +149,9 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
144
149
|
});
|
|
145
150
|
});
|
|
146
151
|
(_b = embla == null ? void 0 : embla.value) == null ? void 0 : _b.on("autoplay:play", () => {
|
|
147
|
-
console.log("autoplay:play");
|
|
148
152
|
isAutoplaying.value = true;
|
|
149
153
|
});
|
|
150
154
|
(_c = embla == null ? void 0 : embla.value) == null ? void 0 : _c.on("autoplay:stop", () => {
|
|
151
|
-
console.log("autoplay:stop");
|
|
152
155
|
isAutoplaying.value = false;
|
|
153
156
|
});
|
|
154
157
|
});
|
package/dist/utils/index.cjs
CHANGED
|
@@ -192,6 +192,11 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
192
192
|
return slides.value.length - 1;
|
|
193
193
|
});
|
|
194
194
|
const goToSlide = (index) => {
|
|
195
|
+
var _a2, _b;
|
|
196
|
+
const autoplay = (_b = (_a2 = embla.value) == null ? void 0 : _a2.plugins()) == null ? void 0 : _b.autoplay;
|
|
197
|
+
if (autoplay) {
|
|
198
|
+
autoplay.stop();
|
|
199
|
+
}
|
|
195
200
|
embla.value.scrollTo(index);
|
|
196
201
|
};
|
|
197
202
|
const handleUserInteraction = async (index, interactionType) => {
|
|
@@ -288,11 +293,9 @@ function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
288
293
|
});
|
|
289
294
|
});
|
|
290
295
|
(_b = embla == null ? void 0 : embla.value) == null ? void 0 : _b.on("autoplay:play", () => {
|
|
291
|
-
console.log("autoplay:play");
|
|
292
296
|
isAutoplaying.value = true;
|
|
293
297
|
});
|
|
294
298
|
(_c = embla == null ? void 0 : embla.value) == null ? void 0 : _c.on("autoplay:stop", () => {
|
|
295
|
-
console.log("autoplay:stop");
|
|
296
299
|
isAutoplaying.value = false;
|
|
297
300
|
});
|
|
298
301
|
});
|
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"vue": ">=3.0.0"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "b556f273d9899af55972cc28add6c4bb536bb15e"
|
|
102
102
|
}
|
package/utils/carousels.js
CHANGED
|
@@ -57,6 +57,11 @@ export function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
57
57
|
* @public This is a public method
|
|
58
58
|
*/
|
|
59
59
|
const goToSlide = (index) => {
|
|
60
|
+
/** Stop autoplay on go to slide interaction */
|
|
61
|
+
const autoplay = embla.value?.plugins()?.autoplay;
|
|
62
|
+
if (autoplay) {
|
|
63
|
+
autoplay.stop();
|
|
64
|
+
}
|
|
60
65
|
embla.value.scrollTo(index);
|
|
61
66
|
};
|
|
62
67
|
|
|
@@ -198,7 +203,6 @@ export function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
198
203
|
});
|
|
199
204
|
|
|
200
205
|
embla?.value?.on('autoplay:play', () => {
|
|
201
|
-
console.log('autoplay:play');
|
|
202
206
|
/**
|
|
203
207
|
* Fires when autoplay starts
|
|
204
208
|
* @event autoplay-play
|
|
@@ -208,7 +212,6 @@ export function carouselUtil(props, { emit, slots }, extraEmblaOptions) {
|
|
|
208
212
|
});
|
|
209
213
|
|
|
210
214
|
embla?.value?.on('autoplay:stop', () => {
|
|
211
|
-
console.log('autoplay:stop');
|
|
212
215
|
/**
|
|
213
216
|
* Fires when autoplay starts
|
|
214
217
|
* @event autoplay-play
|
|
@@ -208,6 +208,7 @@ export const AutoPlayButton = () => ({
|
|
|
208
208
|
<a href="#" @click.native.prevent="$refs.sampleCarousel.toggleAutoPlay()" role="toggleAutoPlayButton">Toggle AutoPlay</a>
|
|
209
209
|
<br/>
|
|
210
210
|
<p>AutoPlay is: {{ isAutoplaying ? 'ON' : 'OFF' }}</p>
|
|
211
|
+
<a href="#" @click.native.prevent="$refs.sampleCarousel.goToSlide(0)">Go To Slide 0</a>
|
|
211
212
|
</div>
|
|
212
213
|
`,
|
|
213
214
|
});
|