bootstrap-vue-next 0.44.6 → 0.44.7
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/dist/{BCarousel-Be7z13f9.js → BCarousel-BgT74ryc.js} +87 -87
- package/dist/BCarousel-BgT74ryc.js.map +1 -0
- package/dist/{BCarousel-D81alfFC.mjs → BCarousel-D9Yei1Q4.mjs} +88 -88
- package/dist/BCarousel-D9Yei1Q4.mjs.map +1 -0
- package/dist/bootstrap-vue-next.mjs +1 -1
- package/dist/bootstrap-vue-next.umd.js +1 -1
- package/dist/components/BCarousel/BCarousel.vue.d.mts +4 -4
- package/dist/components/BCarousel/BCarousel.vue.d.ts +4 -4
- package/dist/src/components/BCarousel/index.mjs +1 -1
- package/dist/src/components/BCarousel/index.umd.js +1 -1
- package/dist/src/components/index.mjs +1 -1
- package/dist/src/components/index.umd.js +1 -1
- package/package.json +1 -1
- package/dist/BCarousel-Be7z13f9.js.map +0 -1
- package/dist/BCarousel-D81alfFC.mjs.map +0 -1
|
@@ -111,13 +111,12 @@ var BCarousel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
111
111
|
const intervalNumber = require_dist.useToNumber(() => slideInterval.value ?? props.interval);
|
|
112
112
|
const isTransitioning = (0, vue.ref)(false);
|
|
113
113
|
const rideStarted = (0, vue.ref)(false);
|
|
114
|
-
const direction = (0, vue.ref)(
|
|
114
|
+
const direction = (0, vue.ref)("start");
|
|
115
115
|
const relatedTarget = (0, vue.useTemplateRef)("_relatedTarget");
|
|
116
116
|
const element = (0, vue.useTemplateRef)("_element");
|
|
117
|
-
|
|
117
|
+
let previousModelValue = modelValue.value;
|
|
118
|
+
let isInternalChange = false;
|
|
118
119
|
const isHovering = require_dist.useElementHover(element);
|
|
119
|
-
const enterClasses = (0, vue.computed)(() => `carousel-item carousel-item-${!direction.value ? "next" : "prev"} carousel-item-${!direction.value ? "start" : "end"}`);
|
|
120
|
-
const leaveClasses = (0, vue.computed)(() => `carousel-item active carousel-item-${direction.value ? "start" : "end"}`);
|
|
121
120
|
const { pause, resume } = require_dist.useIntervalFn(() => {
|
|
122
121
|
if (props.rideReverse) {
|
|
123
122
|
prev();
|
|
@@ -132,55 +131,57 @@ var BCarousel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
132
131
|
componentId: computedId.value,
|
|
133
132
|
cancelable: false,
|
|
134
133
|
target: element.value,
|
|
135
|
-
direction: direction.value ? "right" : "left",
|
|
136
|
-
from: previousModelValue
|
|
134
|
+
direction: direction.value === "start" ? "right" : "left",
|
|
135
|
+
from: previousModelValue,
|
|
137
136
|
to: modelValue.value,
|
|
138
137
|
relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null
|
|
139
138
|
});
|
|
140
|
-
|
|
139
|
+
(0, vue.watch)(modelValue, (newValue, oldValue) => {
|
|
140
|
+
if (!isInternalChange) {
|
|
141
|
+
const lastIndex = slides.value.length - 1;
|
|
142
|
+
const wrappedForward = oldValue === lastIndex && newValue === 0;
|
|
143
|
+
const wrappedBackward = oldValue === 0 && newValue === lastIndex;
|
|
144
|
+
if (wrappedForward) direction.value = "start";
|
|
145
|
+
else if (wrappedBackward) direction.value = "end";
|
|
146
|
+
else direction.value = newValue > oldValue ? "start" : "end";
|
|
147
|
+
}
|
|
148
|
+
isInternalChange = false;
|
|
149
|
+
isTransitioning.value = true;
|
|
150
|
+
});
|
|
151
|
+
const slideTo = (value) => {
|
|
141
152
|
if (isTransitioning.value === true) return;
|
|
142
153
|
if (props.ride === true) rideStarted.value = true;
|
|
143
154
|
if (isRiding.value === true) resume();
|
|
144
|
-
|
|
145
|
-
if (
|
|
155
|
+
let nextValue = value;
|
|
156
|
+
if (nextValue >= slides.value.length) {
|
|
146
157
|
if (props.noWrap) return;
|
|
147
|
-
|
|
148
|
-
return;
|
|
158
|
+
nextValue = 0;
|
|
149
159
|
}
|
|
150
|
-
if (
|
|
160
|
+
if (nextValue < 0) {
|
|
151
161
|
if (props.noWrap) return;
|
|
152
|
-
|
|
153
|
-
return;
|
|
162
|
+
nextValue = slides.value.length - 1;
|
|
154
163
|
}
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
if (nextValue === modelValue.value) return;
|
|
165
|
+
direction.value = value > modelValue.value ? "start" : "end";
|
|
166
|
+
isInternalChange = true;
|
|
167
|
+
isTransitioning.value = true;
|
|
168
|
+
previousModelValue = modelValue.value;
|
|
169
|
+
modelValue.value = nextValue;
|
|
157
170
|
};
|
|
158
171
|
const prev = () => {
|
|
159
|
-
|
|
172
|
+
slideTo(modelValue.value - 1);
|
|
160
173
|
};
|
|
161
174
|
const next = () => {
|
|
162
|
-
|
|
163
|
-
};
|
|
164
|
-
const onKeydown = (fn) => {
|
|
165
|
-
if (props.keyboard === false) return;
|
|
166
|
-
fn();
|
|
167
|
-
};
|
|
168
|
-
const onMouseEnter = () => {
|
|
169
|
-
if (props.noHoverPause) return;
|
|
170
|
-
pause();
|
|
171
|
-
};
|
|
172
|
-
const onMouseLeave = () => {
|
|
173
|
-
if (!isRiding.value) return;
|
|
174
|
-
resume();
|
|
175
|
+
slideTo(modelValue.value + 1);
|
|
175
176
|
};
|
|
176
177
|
const { lengthX } = require_dist.useSwipe(element, {
|
|
177
178
|
passive: true,
|
|
178
179
|
onSwipeStart() {
|
|
179
|
-
if (props.noTouch
|
|
180
|
+
if (props.noTouch) return;
|
|
180
181
|
pause();
|
|
181
182
|
},
|
|
182
183
|
onSwipeEnd() {
|
|
183
|
-
if (props.noTouch
|
|
184
|
+
if (props.noTouch) return;
|
|
184
185
|
const resumeRiding = () => {
|
|
185
186
|
if (isRiding.value === false) return;
|
|
186
187
|
resume();
|
|
@@ -196,25 +197,35 @@ var BCarousel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
199
|
});
|
|
199
|
-
const
|
|
200
|
-
emit("
|
|
201
|
-
|
|
200
|
+
const onClickPrev = (event) => {
|
|
201
|
+
emit("prev-click", event);
|
|
202
|
+
if (event.defaultPrevented) return;
|
|
203
|
+
prev();
|
|
202
204
|
};
|
|
203
|
-
const
|
|
204
|
-
emit("
|
|
205
|
-
|
|
205
|
+
const onClickNext = (event) => {
|
|
206
|
+
emit("next-click", event);
|
|
207
|
+
if (event.defaultPrevented) return;
|
|
208
|
+
next();
|
|
206
209
|
};
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
210
|
+
const onMouseEnter = () => {
|
|
211
|
+
if (props.noHoverPause) return;
|
|
212
|
+
pause();
|
|
209
213
|
};
|
|
210
|
-
const
|
|
211
|
-
|
|
214
|
+
const onMouseLeave = () => {
|
|
215
|
+
if (!isRiding.value) return;
|
|
216
|
+
resume();
|
|
212
217
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
(0, vue.watch)(isHovering, (newValue) => {
|
|
219
|
+
if (newValue) {
|
|
220
|
+
onMouseEnter();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
onMouseLeave();
|
|
224
|
+
});
|
|
225
|
+
require_dist.onKeyStroke(["ArrowLeft", "ArrowRight"], (event) => {
|
|
226
|
+
if (!props.keyboard) return;
|
|
227
|
+
if (event.key === "ArrowLeft") prev();
|
|
228
|
+
else next();
|
|
218
229
|
}, {
|
|
219
230
|
target: element,
|
|
220
231
|
passive: true
|
|
@@ -222,28 +233,35 @@ var BCarousel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
222
233
|
(0, vue.watch)(() => props.ride, () => {
|
|
223
234
|
rideStarted.value = false;
|
|
224
235
|
});
|
|
225
|
-
(0, vue.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
236
|
+
const enterDirectionClass = (0, vue.computed)(() => `carousel-item-${direction.value === "start" ? "next" : "prev"}`);
|
|
237
|
+
const orderDirectionClass = (0, vue.computed)(() => `carousel-item-${direction.value}`);
|
|
238
|
+
const transitionGroupProps = (0, vue.computed)(() => ({
|
|
239
|
+
enterFromClass: `carousel-item ${enterDirectionClass.value}`,
|
|
240
|
+
enterActiveClass: `carousel-item ${enterDirectionClass.value}`,
|
|
241
|
+
enterToClass: `carousel-item ${enterDirectionClass.value} ${orderDirectionClass.value}`,
|
|
242
|
+
leaveFromClass: "carousel-item active",
|
|
243
|
+
leaveActiveClass: "carousel-item active",
|
|
244
|
+
leaveToClass: `carousel-item active ${orderDirectionClass.value}`,
|
|
245
|
+
onBeforeLeave: () => {
|
|
246
|
+
emit("slide", buildBvCarouselEvent("slide"));
|
|
247
|
+
},
|
|
248
|
+
onAfterLeave: () => {
|
|
249
|
+
emit("slid", buildBvCarouselEvent("slid"));
|
|
250
|
+
isTransitioning.value = false;
|
|
251
|
+
},
|
|
252
|
+
onAfterEnter: (el) => {
|
|
253
|
+
if (modelValue.value !== 0) el.classList.add("carousel-item");
|
|
254
|
+
},
|
|
255
|
+
onEnter: (el) => {
|
|
256
|
+
slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null;
|
|
229
257
|
}
|
|
230
|
-
|
|
231
|
-
});
|
|
232
|
-
const onClickPrev = (event) => {
|
|
233
|
-
emit("prev-click", event);
|
|
234
|
-
if (event.defaultPrevented) return;
|
|
235
|
-
prev();
|
|
236
|
-
};
|
|
237
|
-
const onClickNext = (event) => {
|
|
238
|
-
emit("next-click", event);
|
|
239
|
-
if (event.defaultPrevented) return;
|
|
240
|
-
next();
|
|
241
|
-
};
|
|
258
|
+
}));
|
|
242
259
|
__expose({
|
|
243
|
-
|
|
260
|
+
resume,
|
|
244
261
|
pause,
|
|
262
|
+
next,
|
|
245
263
|
prev,
|
|
246
|
-
|
|
264
|
+
slideTo
|
|
247
265
|
});
|
|
248
266
|
(0, vue.provide)(require_keys.carouselInjectionKey, {
|
|
249
267
|
background: (0, vue.toRef)(() => props.background),
|
|
@@ -271,21 +289,10 @@ var BCarousel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
271
289
|
"aria-label": `${(0, vue.unref)(props).indicatorsButtonLabel} ${i}`,
|
|
272
290
|
"aria-controls": (0, vue.unref)(buttonOwnership),
|
|
273
291
|
"aria-describedby": slideValues.value?.[i]?._id,
|
|
274
|
-
onClick: ($event) =>
|
|
292
|
+
onClick: ($event) => slideTo(i)
|
|
275
293
|
}, null, 10, _hoisted_3);
|
|
276
294
|
}), 128))], 8, _hoisted_2)) : (0, vue.createCommentVNode)("", true),
|
|
277
|
-
(0, vue.createElementVNode)("div", _hoisted_4, [(0, vue.createVNode)(vue.TransitionGroup, {
|
|
278
|
-
"enter-from-class": enterClasses.value,
|
|
279
|
-
"enter-active-class": enterClasses.value,
|
|
280
|
-
"enter-to-class": enterClasses.value,
|
|
281
|
-
"leave-from-class": leaveClasses.value,
|
|
282
|
-
"leave-active-class": leaveClasses.value,
|
|
283
|
-
"leave-to-class": leaveClasses.value,
|
|
284
|
-
onBeforeLeave,
|
|
285
|
-
onAfterLeave,
|
|
286
|
-
onAfterEnter,
|
|
287
|
-
onEnter
|
|
288
|
-
}, {
|
|
295
|
+
(0, vue.createElementVNode)("div", _hoisted_4, [(0, vue.createVNode)(vue.TransitionGroup, (0, vue.normalizeProps)((0, vue.guardReactiveProps)(transitionGroupProps.value)), {
|
|
289
296
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(slides.value, (slide, i) => {
|
|
290
297
|
return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(slide), {
|
|
291
298
|
key: i,
|
|
@@ -296,14 +303,7 @@ var BCarousel_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
296
303
|
}, null, 8, ["class", "style"])), [[vue.vShow, i === modelValue.value]]);
|
|
297
304
|
}), 128))]),
|
|
298
305
|
_: 1
|
|
299
|
-
},
|
|
300
|
-
"enter-from-class",
|
|
301
|
-
"enter-active-class",
|
|
302
|
-
"enter-to-class",
|
|
303
|
-
"leave-from-class",
|
|
304
|
-
"leave-active-class",
|
|
305
|
-
"leave-to-class"
|
|
306
|
-
])], 512),
|
|
306
|
+
}, 16)], 512),
|
|
307
307
|
(0, vue.unref)(props).controls ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createElementVNode)("button", {
|
|
308
308
|
class: "carousel-control-prev",
|
|
309
309
|
type: "button",
|
|
@@ -424,4 +424,4 @@ Object.defineProperty(exports, "BCarousel_default", {
|
|
|
424
424
|
}
|
|
425
425
|
});
|
|
426
426
|
|
|
427
|
-
//# sourceMappingURL=BCarousel-
|
|
427
|
+
//# sourceMappingURL=BCarousel-BgT74ryc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BCarousel-BgT74ryc.js","names":[],"sources":["../src/utils/getSlotElements.ts","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarouselSlide.vue","../src/components/BCarousel/BCarouselSlide.vue"],"sourcesContent":["import type {Slot, VNode} from 'vue'\n\nexport const getSlotElements = (slot: Slot | undefined, filterBy: string): VNode[] =>\n (slot?.() ?? [])\n .reduce((arr: VNode[], slot: VNode) => {\n if (typeof slot.type === 'symbol') {\n arr = arr.concat(slot.children as unknown as VNode)\n } else {\n arr.push(slot)\n }\n return arr\n }, [])\n .filter((child) => (child.type as {__name: string} | undefined)?.__name === filterBy)\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"slideTo(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup v-bind=\"transitionGroupProps\">\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselProps, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref<'start' | 'end'>('start')\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\n\nlet previousModelValue = modelValue.value\nlet isInternalChange = false\n\nconst isHovering = useElementHover(element)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value === 'start' ? 'right' : 'left',\n from: previousModelValue,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nwatch(modelValue, (newValue, oldValue) => {\n if (!isInternalChange) {\n // External v-model change: determine direction from the new/old values\n const lastIndex = slides.value.length - 1\n const wrappedForward = oldValue === lastIndex && newValue === 0\n const wrappedBackward = oldValue === 0 && newValue === lastIndex\n if (wrappedForward) {\n direction.value = 'start'\n } else if (wrappedBackward) {\n direction.value = 'end'\n } else {\n direction.value = newValue > oldValue ? 'start' : 'end'\n }\n }\n isInternalChange = false\n // If one ever thinks to change the transitions dependence on modelValue and thinks it is appropriate to remove this isTransitioning line, be careful\n // This directly effects how transitions are applied. The watch is for if you have an external change to modelValue, and doesn't directly call slideTo\n isTransitioning.value = true\n})\nconst slideTo = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n let nextValue = value\n if (nextValue >= slides.value.length) {\n if (props.noWrap) return\n nextValue = 0\n }\n if (nextValue < 0) {\n if (props.noWrap) return\n nextValue = slides.value.length - 1\n }\n if (nextValue === modelValue.value) return\n // Set direction based on the original requested value (before wrapping) so that\n // next() always animates forward and prev() always animates backward, regardless\n // of how many slides there are. This fixes the 2-slide case where wrap-detection\n // heuristics in the watcher would otherwise produce the wrong direction.\n // Note: `value` is the raw index passed by the caller (e.g. modelValue+1 for next()),\n // while `nextValue` is the resolved/wrapped index that becomes the new modelValue.\n direction.value = value > modelValue.value ? 'start' : 'end'\n // Mark as internal so the modelValue watcher skips its direction heuristics.\n // A race condition here is not possible because the isTransitioning guard above\n // ensures slideTo cannot be called again until the current transition completes.\n isInternalChange = true\n isTransitioning.value = true\n previousModelValue = modelValue.value\n modelValue.value = nextValue\n}\n\nconst prev = (): void => {\n slideTo(modelValue.value - 1)\n}\nconst next = (): void => {\n slideTo(modelValue.value + 1)\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\nonKeyStroke(\n ['ArrowLeft', 'ArrowRight'],\n (event) => {\n if (!props.keyboard) return\n if (event.key === 'ArrowLeft') {\n prev()\n } else {\n next()\n }\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nconst enterDirectionClass = computed(\n () => `carousel-item-${direction.value === 'start' ? 'next' : 'prev'}`\n)\nconst orderDirectionClass = computed(() => `carousel-item-${direction.value}`)\nconst transitionGroupProps = computed(() => ({\n enterFromClass: `carousel-item ${enterDirectionClass.value}`,\n enterActiveClass: `carousel-item ${enterDirectionClass.value}`,\n enterToClass: `carousel-item ${enterDirectionClass.value} ${orderDirectionClass.value}`,\n leaveFromClass: 'carousel-item active',\n leaveActiveClass: 'carousel-item active',\n leaveToClass: `carousel-item active ${orderDirectionClass.value}`,\n onBeforeLeave: () => {\n emit('slide', buildBvCarouselEvent('slide'))\n },\n onAfterLeave: () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n },\n // carousel-item class is removed from the slide during the transition,\n // as is included within enter classes.\n // The first slide recovers carousel-item class,\n onAfterEnter: (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n },\n onEnter: (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n },\n}))\n\ndefineExpose({\n resume,\n pause,\n next,\n prev,\n slideTo,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"slideTo(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup v-bind=\"transitionGroupProps\">\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselProps, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref<'start' | 'end'>('start')\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\n\nlet previousModelValue = modelValue.value\nlet isInternalChange = false\n\nconst isHovering = useElementHover(element)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value === 'start' ? 'right' : 'left',\n from: previousModelValue,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nwatch(modelValue, (newValue, oldValue) => {\n if (!isInternalChange) {\n // External v-model change: determine direction from the new/old values\n const lastIndex = slides.value.length - 1\n const wrappedForward = oldValue === lastIndex && newValue === 0\n const wrappedBackward = oldValue === 0 && newValue === lastIndex\n if (wrappedForward) {\n direction.value = 'start'\n } else if (wrappedBackward) {\n direction.value = 'end'\n } else {\n direction.value = newValue > oldValue ? 'start' : 'end'\n }\n }\n isInternalChange = false\n // If one ever thinks to change the transitions dependence on modelValue and thinks it is appropriate to remove this isTransitioning line, be careful\n // This directly effects how transitions are applied. The watch is for if you have an external change to modelValue, and doesn't directly call slideTo\n isTransitioning.value = true\n})\nconst slideTo = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n let nextValue = value\n if (nextValue >= slides.value.length) {\n if (props.noWrap) return\n nextValue = 0\n }\n if (nextValue < 0) {\n if (props.noWrap) return\n nextValue = slides.value.length - 1\n }\n if (nextValue === modelValue.value) return\n // Set direction based on the original requested value (before wrapping) so that\n // next() always animates forward and prev() always animates backward, regardless\n // of how many slides there are. This fixes the 2-slide case where wrap-detection\n // heuristics in the watcher would otherwise produce the wrong direction.\n // Note: `value` is the raw index passed by the caller (e.g. modelValue+1 for next()),\n // while `nextValue` is the resolved/wrapped index that becomes the new modelValue.\n direction.value = value > modelValue.value ? 'start' : 'end'\n // Mark as internal so the modelValue watcher skips its direction heuristics.\n // A race condition here is not possible because the isTransitioning guard above\n // ensures slideTo cannot be called again until the current transition completes.\n isInternalChange = true\n isTransitioning.value = true\n previousModelValue = modelValue.value\n modelValue.value = nextValue\n}\n\nconst prev = (): void => {\n slideTo(modelValue.value - 1)\n}\nconst next = (): void => {\n slideTo(modelValue.value + 1)\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\nonKeyStroke(\n ['ArrowLeft', 'ArrowRight'],\n (event) => {\n if (!props.keyboard) return\n if (event.key === 'ArrowLeft') {\n prev()\n } else {\n next()\n }\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nconst enterDirectionClass = computed(\n () => `carousel-item-${direction.value === 'start' ? 'next' : 'prev'}`\n)\nconst orderDirectionClass = computed(() => `carousel-item-${direction.value}`)\nconst transitionGroupProps = computed(() => ({\n enterFromClass: `carousel-item ${enterDirectionClass.value}`,\n enterActiveClass: `carousel-item ${enterDirectionClass.value}`,\n enterToClass: `carousel-item ${enterDirectionClass.value} ${orderDirectionClass.value}`,\n leaveFromClass: 'carousel-item active',\n leaveActiveClass: 'carousel-item active',\n leaveToClass: `carousel-item active ${orderDirectionClass.value}`,\n onBeforeLeave: () => {\n emit('slide', buildBvCarouselEvent('slide'))\n },\n onAfterLeave: () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n },\n // carousel-item class is removed from the slide during the transition,\n // as is included within enter classes.\n // The first slide recovers carousel-item class,\n onAfterEnter: (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n },\n onEnter: (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n },\n}))\n\ndefineExpose({\n resume,\n pause,\n next,\n prev,\n slideTo,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleU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GAAA,EAAA;sCAGpB,EAAA,GAAA,IAAA,YAAA,KAAA,QAAA,QAAA,EAAA,QAAA,EAAA,GAAA,IAAA,oBADwB,QAAA,OAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAApB,MAAK,CAAC,KAAI,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;yBAGf,KAAA,QAAA,UAAA"}
|
|
@@ -5,7 +5,7 @@ import { t as useDefaults } from "./useDefaults-BKgBaqOV.mjs";
|
|
|
5
5
|
import { t as useId$1 } from "./useId-BKZFSYm8.mjs";
|
|
6
6
|
import { t as BvCarouselEvent } from "./classes-B0E5Y78Y.mjs";
|
|
7
7
|
import { t as BImg_default } from "./BImg-BQqZfIM9.mjs";
|
|
8
|
-
import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, mergeModels, normalizeClass, normalizeStyle, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRef, unref, useModel, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
|
|
8
|
+
import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, mergeModels, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRef, unref, useModel, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
|
|
9
9
|
//#region src/utils/getSlotElements.ts
|
|
10
10
|
var getSlotElements = (slot, filterBy) => (slot?.() ?? []).reduce((arr, slot) => {
|
|
11
11
|
if (typeof slot.type === "symbol") arr = arr.concat(slot.children);
|
|
@@ -110,13 +110,12 @@ var BCarousel_default = /* @__PURE__ */ defineComponent({
|
|
|
110
110
|
const intervalNumber = useToNumber(() => slideInterval.value ?? props.interval);
|
|
111
111
|
const isTransitioning = ref(false);
|
|
112
112
|
const rideStarted = ref(false);
|
|
113
|
-
const direction = ref(
|
|
113
|
+
const direction = ref("start");
|
|
114
114
|
const relatedTarget = useTemplateRef("_relatedTarget");
|
|
115
115
|
const element = useTemplateRef("_element");
|
|
116
|
-
|
|
116
|
+
let previousModelValue = modelValue.value;
|
|
117
|
+
let isInternalChange = false;
|
|
117
118
|
const isHovering = useElementHover(element);
|
|
118
|
-
const enterClasses = computed(() => `carousel-item carousel-item-${!direction.value ? "next" : "prev"} carousel-item-${!direction.value ? "start" : "end"}`);
|
|
119
|
-
const leaveClasses = computed(() => `carousel-item active carousel-item-${direction.value ? "start" : "end"}`);
|
|
120
119
|
const { pause, resume } = useIntervalFn(() => {
|
|
121
120
|
if (props.rideReverse) {
|
|
122
121
|
prev();
|
|
@@ -131,55 +130,57 @@ var BCarousel_default = /* @__PURE__ */ defineComponent({
|
|
|
131
130
|
componentId: computedId.value,
|
|
132
131
|
cancelable: false,
|
|
133
132
|
target: element.value,
|
|
134
|
-
direction: direction.value ? "right" : "left",
|
|
135
|
-
from: previousModelValue
|
|
133
|
+
direction: direction.value === "start" ? "right" : "left",
|
|
134
|
+
from: previousModelValue,
|
|
136
135
|
to: modelValue.value,
|
|
137
136
|
relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null
|
|
138
137
|
});
|
|
139
|
-
|
|
138
|
+
watch(modelValue, (newValue, oldValue) => {
|
|
139
|
+
if (!isInternalChange) {
|
|
140
|
+
const lastIndex = slides.value.length - 1;
|
|
141
|
+
const wrappedForward = oldValue === lastIndex && newValue === 0;
|
|
142
|
+
const wrappedBackward = oldValue === 0 && newValue === lastIndex;
|
|
143
|
+
if (wrappedForward) direction.value = "start";
|
|
144
|
+
else if (wrappedBackward) direction.value = "end";
|
|
145
|
+
else direction.value = newValue > oldValue ? "start" : "end";
|
|
146
|
+
}
|
|
147
|
+
isInternalChange = false;
|
|
148
|
+
isTransitioning.value = true;
|
|
149
|
+
});
|
|
150
|
+
const slideTo = (value) => {
|
|
140
151
|
if (isTransitioning.value === true) return;
|
|
141
152
|
if (props.ride === true) rideStarted.value = true;
|
|
142
153
|
if (isRiding.value === true) resume();
|
|
143
|
-
|
|
144
|
-
if (
|
|
154
|
+
let nextValue = value;
|
|
155
|
+
if (nextValue >= slides.value.length) {
|
|
145
156
|
if (props.noWrap) return;
|
|
146
|
-
|
|
147
|
-
return;
|
|
157
|
+
nextValue = 0;
|
|
148
158
|
}
|
|
149
|
-
if (
|
|
159
|
+
if (nextValue < 0) {
|
|
150
160
|
if (props.noWrap) return;
|
|
151
|
-
|
|
152
|
-
return;
|
|
161
|
+
nextValue = slides.value.length - 1;
|
|
153
162
|
}
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
if (nextValue === modelValue.value) return;
|
|
164
|
+
direction.value = value > modelValue.value ? "start" : "end";
|
|
165
|
+
isInternalChange = true;
|
|
166
|
+
isTransitioning.value = true;
|
|
167
|
+
previousModelValue = modelValue.value;
|
|
168
|
+
modelValue.value = nextValue;
|
|
156
169
|
};
|
|
157
170
|
const prev = () => {
|
|
158
|
-
|
|
171
|
+
slideTo(modelValue.value - 1);
|
|
159
172
|
};
|
|
160
173
|
const next = () => {
|
|
161
|
-
|
|
162
|
-
};
|
|
163
|
-
const onKeydown = (fn) => {
|
|
164
|
-
if (props.keyboard === false) return;
|
|
165
|
-
fn();
|
|
166
|
-
};
|
|
167
|
-
const onMouseEnter = () => {
|
|
168
|
-
if (props.noHoverPause) return;
|
|
169
|
-
pause();
|
|
170
|
-
};
|
|
171
|
-
const onMouseLeave = () => {
|
|
172
|
-
if (!isRiding.value) return;
|
|
173
|
-
resume();
|
|
174
|
+
slideTo(modelValue.value + 1);
|
|
174
175
|
};
|
|
175
176
|
const { lengthX } = useSwipe(element, {
|
|
176
177
|
passive: true,
|
|
177
178
|
onSwipeStart() {
|
|
178
|
-
if (props.noTouch
|
|
179
|
+
if (props.noTouch) return;
|
|
179
180
|
pause();
|
|
180
181
|
},
|
|
181
182
|
onSwipeEnd() {
|
|
182
|
-
if (props.noTouch
|
|
183
|
+
if (props.noTouch) return;
|
|
183
184
|
const resumeRiding = () => {
|
|
184
185
|
if (isRiding.value === false) return;
|
|
185
186
|
resume();
|
|
@@ -195,25 +196,35 @@ var BCarousel_default = /* @__PURE__ */ defineComponent({
|
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
});
|
|
198
|
-
const
|
|
199
|
-
emit("
|
|
200
|
-
|
|
199
|
+
const onClickPrev = (event) => {
|
|
200
|
+
emit("prev-click", event);
|
|
201
|
+
if (event.defaultPrevented) return;
|
|
202
|
+
prev();
|
|
201
203
|
};
|
|
202
|
-
const
|
|
203
|
-
emit("
|
|
204
|
-
|
|
204
|
+
const onClickNext = (event) => {
|
|
205
|
+
emit("next-click", event);
|
|
206
|
+
if (event.defaultPrevented) return;
|
|
207
|
+
next();
|
|
205
208
|
};
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
209
|
+
const onMouseEnter = () => {
|
|
210
|
+
if (props.noHoverPause) return;
|
|
211
|
+
pause();
|
|
208
212
|
};
|
|
209
|
-
const
|
|
210
|
-
|
|
213
|
+
const onMouseLeave = () => {
|
|
214
|
+
if (!isRiding.value) return;
|
|
215
|
+
resume();
|
|
211
216
|
};
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
watch(isHovering, (newValue) => {
|
|
218
|
+
if (newValue) {
|
|
219
|
+
onMouseEnter();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
onMouseLeave();
|
|
223
|
+
});
|
|
224
|
+
onKeyStroke(["ArrowLeft", "ArrowRight"], (event) => {
|
|
225
|
+
if (!props.keyboard) return;
|
|
226
|
+
if (event.key === "ArrowLeft") prev();
|
|
227
|
+
else next();
|
|
217
228
|
}, {
|
|
218
229
|
target: element,
|
|
219
230
|
passive: true
|
|
@@ -221,28 +232,35 @@ var BCarousel_default = /* @__PURE__ */ defineComponent({
|
|
|
221
232
|
watch(() => props.ride, () => {
|
|
222
233
|
rideStarted.value = false;
|
|
223
234
|
});
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
235
|
+
const enterDirectionClass = computed(() => `carousel-item-${direction.value === "start" ? "next" : "prev"}`);
|
|
236
|
+
const orderDirectionClass = computed(() => `carousel-item-${direction.value}`);
|
|
237
|
+
const transitionGroupProps = computed(() => ({
|
|
238
|
+
enterFromClass: `carousel-item ${enterDirectionClass.value}`,
|
|
239
|
+
enterActiveClass: `carousel-item ${enterDirectionClass.value}`,
|
|
240
|
+
enterToClass: `carousel-item ${enterDirectionClass.value} ${orderDirectionClass.value}`,
|
|
241
|
+
leaveFromClass: "carousel-item active",
|
|
242
|
+
leaveActiveClass: "carousel-item active",
|
|
243
|
+
leaveToClass: `carousel-item active ${orderDirectionClass.value}`,
|
|
244
|
+
onBeforeLeave: () => {
|
|
245
|
+
emit("slide", buildBvCarouselEvent("slide"));
|
|
246
|
+
},
|
|
247
|
+
onAfterLeave: () => {
|
|
248
|
+
emit("slid", buildBvCarouselEvent("slid"));
|
|
249
|
+
isTransitioning.value = false;
|
|
250
|
+
},
|
|
251
|
+
onAfterEnter: (el) => {
|
|
252
|
+
if (modelValue.value !== 0) el.classList.add("carousel-item");
|
|
253
|
+
},
|
|
254
|
+
onEnter: (el) => {
|
|
255
|
+
slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null;
|
|
228
256
|
}
|
|
229
|
-
|
|
230
|
-
});
|
|
231
|
-
const onClickPrev = (event) => {
|
|
232
|
-
emit("prev-click", event);
|
|
233
|
-
if (event.defaultPrevented) return;
|
|
234
|
-
prev();
|
|
235
|
-
};
|
|
236
|
-
const onClickNext = (event) => {
|
|
237
|
-
emit("next-click", event);
|
|
238
|
-
if (event.defaultPrevented) return;
|
|
239
|
-
next();
|
|
240
|
-
};
|
|
257
|
+
}));
|
|
241
258
|
__expose({
|
|
242
|
-
|
|
259
|
+
resume,
|
|
243
260
|
pause,
|
|
261
|
+
next,
|
|
244
262
|
prev,
|
|
245
|
-
|
|
263
|
+
slideTo
|
|
246
264
|
});
|
|
247
265
|
provide(carouselInjectionKey, {
|
|
248
266
|
background: toRef(() => props.background),
|
|
@@ -270,21 +288,10 @@ var BCarousel_default = /* @__PURE__ */ defineComponent({
|
|
|
270
288
|
"aria-label": `${unref(props).indicatorsButtonLabel} ${i}`,
|
|
271
289
|
"aria-controls": unref(buttonOwnership),
|
|
272
290
|
"aria-describedby": slideValues.value?.[i]?._id,
|
|
273
|
-
onClick: ($event) =>
|
|
291
|
+
onClick: ($event) => slideTo(i)
|
|
274
292
|
}, null, 10, _hoisted_3);
|
|
275
293
|
}), 128))], 8, _hoisted_2)) : createCommentVNode("", true),
|
|
276
|
-
createElementVNode("div", _hoisted_4, [createVNode(TransitionGroup, {
|
|
277
|
-
"enter-from-class": enterClasses.value,
|
|
278
|
-
"enter-active-class": enterClasses.value,
|
|
279
|
-
"enter-to-class": enterClasses.value,
|
|
280
|
-
"leave-from-class": leaveClasses.value,
|
|
281
|
-
"leave-active-class": leaveClasses.value,
|
|
282
|
-
"leave-to-class": leaveClasses.value,
|
|
283
|
-
onBeforeLeave,
|
|
284
|
-
onAfterLeave,
|
|
285
|
-
onAfterEnter,
|
|
286
|
-
onEnter
|
|
287
|
-
}, {
|
|
294
|
+
createElementVNode("div", _hoisted_4, [createVNode(TransitionGroup, normalizeProps(guardReactiveProps(transitionGroupProps.value)), {
|
|
288
295
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(slides.value, (slide, i) => {
|
|
289
296
|
return withDirectives((openBlock(), createBlock(resolveDynamicComponent(slide), {
|
|
290
297
|
key: i,
|
|
@@ -295,14 +302,7 @@ var BCarousel_default = /* @__PURE__ */ defineComponent({
|
|
|
295
302
|
}, null, 8, ["class", "style"])), [[vShow, i === modelValue.value]]);
|
|
296
303
|
}), 128))]),
|
|
297
304
|
_: 1
|
|
298
|
-
},
|
|
299
|
-
"enter-from-class",
|
|
300
|
-
"enter-active-class",
|
|
301
|
-
"enter-to-class",
|
|
302
|
-
"leave-from-class",
|
|
303
|
-
"leave-active-class",
|
|
304
|
-
"leave-to-class"
|
|
305
|
-
])], 512),
|
|
305
|
+
}, 16)], 512),
|
|
306
306
|
unref(props).controls ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("button", {
|
|
307
307
|
class: "carousel-control-prev",
|
|
308
308
|
type: "button",
|
|
@@ -412,4 +412,4 @@ var BCarouselSlide_default = /* @__PURE__ */ defineComponent({
|
|
|
412
412
|
//#endregion
|
|
413
413
|
export { BCarousel_default as n, BCarouselSlide_default as t };
|
|
414
414
|
|
|
415
|
-
//# sourceMappingURL=BCarousel-
|
|
415
|
+
//# sourceMappingURL=BCarousel-D9Yei1Q4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BCarousel-D9Yei1Q4.mjs","names":[],"sources":["../src/utils/getSlotElements.ts","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarouselSlide.vue","../src/components/BCarousel/BCarouselSlide.vue"],"sourcesContent":["import type {Slot, VNode} from 'vue'\n\nexport const getSlotElements = (slot: Slot | undefined, filterBy: string): VNode[] =>\n (slot?.() ?? [])\n .reduce((arr: VNode[], slot: VNode) => {\n if (typeof slot.type === 'symbol') {\n arr = arr.concat(slot.children as unknown as VNode)\n } else {\n arr.push(slot)\n }\n return arr\n }, [])\n .filter((child) => (child.type as {__name: string} | undefined)?.__name === filterBy)\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"slideTo(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup v-bind=\"transitionGroupProps\">\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselProps, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref<'start' | 'end'>('start')\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\n\nlet previousModelValue = modelValue.value\nlet isInternalChange = false\n\nconst isHovering = useElementHover(element)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value === 'start' ? 'right' : 'left',\n from: previousModelValue,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nwatch(modelValue, (newValue, oldValue) => {\n if (!isInternalChange) {\n // External v-model change: determine direction from the new/old values\n const lastIndex = slides.value.length - 1\n const wrappedForward = oldValue === lastIndex && newValue === 0\n const wrappedBackward = oldValue === 0 && newValue === lastIndex\n if (wrappedForward) {\n direction.value = 'start'\n } else if (wrappedBackward) {\n direction.value = 'end'\n } else {\n direction.value = newValue > oldValue ? 'start' : 'end'\n }\n }\n isInternalChange = false\n // If one ever thinks to change the transitions dependence on modelValue and thinks it is appropriate to remove this isTransitioning line, be careful\n // This directly effects how transitions are applied. The watch is for if you have an external change to modelValue, and doesn't directly call slideTo\n isTransitioning.value = true\n})\nconst slideTo = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n let nextValue = value\n if (nextValue >= slides.value.length) {\n if (props.noWrap) return\n nextValue = 0\n }\n if (nextValue < 0) {\n if (props.noWrap) return\n nextValue = slides.value.length - 1\n }\n if (nextValue === modelValue.value) return\n // Set direction based on the original requested value (before wrapping) so that\n // next() always animates forward and prev() always animates backward, regardless\n // of how many slides there are. This fixes the 2-slide case where wrap-detection\n // heuristics in the watcher would otherwise produce the wrong direction.\n // Note: `value` is the raw index passed by the caller (e.g. modelValue+1 for next()),\n // while `nextValue` is the resolved/wrapped index that becomes the new modelValue.\n direction.value = value > modelValue.value ? 'start' : 'end'\n // Mark as internal so the modelValue watcher skips its direction heuristics.\n // A race condition here is not possible because the isTransitioning guard above\n // ensures slideTo cannot be called again until the current transition completes.\n isInternalChange = true\n isTransitioning.value = true\n previousModelValue = modelValue.value\n modelValue.value = nextValue\n}\n\nconst prev = (): void => {\n slideTo(modelValue.value - 1)\n}\nconst next = (): void => {\n slideTo(modelValue.value + 1)\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\nonKeyStroke(\n ['ArrowLeft', 'ArrowRight'],\n (event) => {\n if (!props.keyboard) return\n if (event.key === 'ArrowLeft') {\n prev()\n } else {\n next()\n }\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nconst enterDirectionClass = computed(\n () => `carousel-item-${direction.value === 'start' ? 'next' : 'prev'}`\n)\nconst orderDirectionClass = computed(() => `carousel-item-${direction.value}`)\nconst transitionGroupProps = computed(() => ({\n enterFromClass: `carousel-item ${enterDirectionClass.value}`,\n enterActiveClass: `carousel-item ${enterDirectionClass.value}`,\n enterToClass: `carousel-item ${enterDirectionClass.value} ${orderDirectionClass.value}`,\n leaveFromClass: 'carousel-item active',\n leaveActiveClass: 'carousel-item active',\n leaveToClass: `carousel-item active ${orderDirectionClass.value}`,\n onBeforeLeave: () => {\n emit('slide', buildBvCarouselEvent('slide'))\n },\n onAfterLeave: () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n },\n // carousel-item class is removed from the slide during the transition,\n // as is included within enter classes.\n // The first slide recovers carousel-item class,\n onAfterEnter: (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n },\n onEnter: (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n },\n}))\n\ndefineExpose({\n resume,\n pause,\n next,\n prev,\n slideTo,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"slideTo(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup v-bind=\"transitionGroupProps\">\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselProps, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref<'start' | 'end'>('start')\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\n\nlet previousModelValue = modelValue.value\nlet isInternalChange = false\n\nconst isHovering = useElementHover(element)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value === 'start' ? 'right' : 'left',\n from: previousModelValue,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nwatch(modelValue, (newValue, oldValue) => {\n if (!isInternalChange) {\n // External v-model change: determine direction from the new/old values\n const lastIndex = slides.value.length - 1\n const wrappedForward = oldValue === lastIndex && newValue === 0\n const wrappedBackward = oldValue === 0 && newValue === lastIndex\n if (wrappedForward) {\n direction.value = 'start'\n } else if (wrappedBackward) {\n direction.value = 'end'\n } else {\n direction.value = newValue > oldValue ? 'start' : 'end'\n }\n }\n isInternalChange = false\n // If one ever thinks to change the transitions dependence on modelValue and thinks it is appropriate to remove this isTransitioning line, be careful\n // This directly effects how transitions are applied. The watch is for if you have an external change to modelValue, and doesn't directly call slideTo\n isTransitioning.value = true\n})\nconst slideTo = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n let nextValue = value\n if (nextValue >= slides.value.length) {\n if (props.noWrap) return\n nextValue = 0\n }\n if (nextValue < 0) {\n if (props.noWrap) return\n nextValue = slides.value.length - 1\n }\n if (nextValue === modelValue.value) return\n // Set direction based on the original requested value (before wrapping) so that\n // next() always animates forward and prev() always animates backward, regardless\n // of how many slides there are. This fixes the 2-slide case where wrap-detection\n // heuristics in the watcher would otherwise produce the wrong direction.\n // Note: `value` is the raw index passed by the caller (e.g. modelValue+1 for next()),\n // while `nextValue` is the resolved/wrapped index that becomes the new modelValue.\n direction.value = value > modelValue.value ? 'start' : 'end'\n // Mark as internal so the modelValue watcher skips its direction heuristics.\n // A race condition here is not possible because the isTransitioning guard above\n // ensures slideTo cannot be called again until the current transition completes.\n isInternalChange = true\n isTransitioning.value = true\n previousModelValue = modelValue.value\n modelValue.value = nextValue\n}\n\nconst prev = (): void => {\n slideTo(modelValue.value - 1)\n}\nconst next = (): void => {\n slideTo(modelValue.value + 1)\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\nonKeyStroke(\n ['ArrowLeft', 'ArrowRight'],\n (event) => {\n if (!props.keyboard) return\n if (event.key === 'ArrowLeft') {\n prev()\n } else {\n next()\n }\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nconst enterDirectionClass = computed(\n () => `carousel-item-${direction.value === 'start' ? 'next' : 'prev'}`\n)\nconst orderDirectionClass = computed(() => `carousel-item-${direction.value}`)\nconst transitionGroupProps = computed(() => ({\n enterFromClass: `carousel-item ${enterDirectionClass.value}`,\n enterActiveClass: `carousel-item ${enterDirectionClass.value}`,\n enterToClass: `carousel-item ${enterDirectionClass.value} ${orderDirectionClass.value}`,\n leaveFromClass: 'carousel-item active',\n leaveActiveClass: 'carousel-item active',\n leaveToClass: `carousel-item active ${orderDirectionClass.value}`,\n onBeforeLeave: () => {\n emit('slide', buildBvCarouselEvent('slide'))\n },\n onAfterLeave: () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n },\n // carousel-item class is removed from the slide during the transition,\n // as is included within enter classes.\n // The first slide recovers carousel-item class,\n onAfterEnter: (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n },\n onEnter: (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n },\n}))\n\ndefineExpose({\n resume,\n pause,\n next,\n prev,\n slideTo,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n"],"mappings":";;;;;;;;;AAEA,IAAa,mBAAmB,MAAwB,cACrD,QAAQ,IAAI,EAAE,EACZ,QAAQ,KAAc,SAAgB;AACrC,KAAI,OAAO,KAAK,SAAS,SACvB,OAAM,IAAI,OAAO,KAAK,SAA6B;KAEnD,KAAI,KAAK,KAAK;AAEhB,QAAO;GACN,EAAE,CAAC,CACL,QAAQ,UAAW,MAAM,MAAuC,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EC6EzF,MAAM,QAAQ,YAtBC,SAsBmB,YAAW;EAC7C,MAAM,OAAO;EACb,MAAM,QAAQ,UAAA;EAEd,MAAM,aAAa,cAAY,MAAM,IAAI,WAAU;EACnD,MAAM,kBAAkB,QAAM,KAAA,GAAW,4BAA2B;EAEpE,MAAM,aAAa,SAA6D,SAAA,aAAa;EAE7F,MAAM,cAAc,eAAsD,eAAc;EAExF,MAAM,uBAAuB,kBAAkB,MAAM,eAAc;EACnE,MAAM,gBAAgB,IAAsB,KAAI;AAChD,kBAAgB;AACd,iBAAc,QACZ,YAAY,OAAO,MAAM,SAAS,KAAK,IAAI,MAAM,YAAY,OAAO,EAAE,aAAa;IACtF;EACD,MAAM,iBAAiB,kBAAkB,cAAc,SAAS,MAAM,SAAQ;EAE9E,MAAM,kBAAkB,IAAI,MAAK;EACjC,MAAM,cAAc,IAAI,MAAK;EAC7B,MAAM,YAAY,IAAqB,QAAO;EAC9C,MAAM,gBAAgB,eAAe,iBAAgB;EACrD,MAAM,UAAU,eAAe,WAAU;EAEzC,IAAI,qBAAqB,WAAW;EACpC,IAAI,mBAAmB;EAEvB,MAAM,aAAa,gBAAgB,QAAO;EAE1C,MAAM,EAAC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,QAAO,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;KAGW,QAAA,SAAA,WAAA,EAArC,YAIY,wBAJI,MAAA,MAAK,CAAC,QAAO,EAAA,EAAA,KAAA,GAAA,EAAA;6BAGpB,CAFP,WAEO,KAAA,QAAA,QAAA,EAAA,QAAA,CADL,mBAA6B,QAAA,MAAA,gBAApB,MAAA,MAAK,CAAC,KAAI,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;KAGvB,WAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -32,7 +32,7 @@ import { n as BButtonGroup_default, t as BButtonToolbar_default } from "./BButto
|
|
|
32
32
|
import { t as BImg_default } from "./BImg-BQqZfIM9.mjs";
|
|
33
33
|
import { a as BCardTitle_default, i as BCardSubtitle_default, n as BCardFooter_default, o as BCardHeader_default, r as BCardBody_default, s as BCardImg_default, t as BCard_default } from "./BCard-C1G8PO5k.mjs";
|
|
34
34
|
import { n as BCardGroup_default, t as BCardText_default } from "./BCard-CJ822HyH.mjs";
|
|
35
|
-
import { n as BCarousel_default, t as BCarouselSlide_default } from "./BCarousel-
|
|
35
|
+
import { n as BCarousel_default, t as BCarouselSlide_default } from "./BCarousel-D9Yei1Q4.mjs";
|
|
36
36
|
import { t as BCol_default } from "./BCol-C4v-TOX6.mjs";
|
|
37
37
|
import { t as BContainer_default } from "./BContainer-DjIGH6-y.mjs";
|
|
38
38
|
import { t as BRow_default } from "./BRow-BCEK3fe6.mjs";
|
|
@@ -33,7 +33,7 @@ const require_BButton$1 = require("./BButton-kykTWnBy.js");
|
|
|
33
33
|
const require_BImg = require("./BImg-Dyy0N-WQ.js");
|
|
34
34
|
const require_BCard = require("./BCard-CgbTFn3S.js");
|
|
35
35
|
const require_BCard$1 = require("./BCard-CSyEHz8Z.js");
|
|
36
|
-
const require_BCarousel = require("./BCarousel-
|
|
36
|
+
const require_BCarousel = require("./BCarousel-BgT74ryc.js");
|
|
37
37
|
const require_BCol = require("./BCol-0tZmpOme.js");
|
|
38
38
|
const require_BContainer = require("./BContainer-BZUI2qQv.js");
|
|
39
39
|
const require_BRow = require("./BRow-tqMEhkZS.js");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BvCarouselEvent } from '../../utils';
|
|
2
|
-
import { BCarouselProps } from '../../types/ComponentProps';
|
|
3
2
|
import { Numberish } from '../../types/CommonTypes';
|
|
4
|
-
import { BCarouselSlots } from '../../types';
|
|
3
|
+
import { BCarouselProps, BCarouselSlots } from '../../types';
|
|
5
4
|
type __VLS_Props = Omit<BCarouselProps, 'modelValue'>;
|
|
6
5
|
type __VLS_PublicProps = {
|
|
7
6
|
modelValue?: Exclude<BCarouselProps['modelValue'], undefined>;
|
|
@@ -18,10 +17,11 @@ declare function __VLS_template(): {
|
|
|
18
17
|
};
|
|
19
18
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
19
|
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
21
|
-
|
|
20
|
+
resume: import('../../../node_modules/@vueuse/shared').Fn;
|
|
22
21
|
pause: import('../../../node_modules/@vueuse/shared').Fn;
|
|
22
|
+
next: () => void;
|
|
23
23
|
prev: () => void;
|
|
24
|
-
|
|
24
|
+
slideTo: (value: number) => void;
|
|
25
25
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
26
|
"update:modelValue": (value: number) => any;
|
|
27
27
|
slide: (value: BvCarouselEvent) => any;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BvCarouselEvent } from '../../utils';
|
|
2
|
-
import { BCarouselProps } from '../../types/ComponentProps';
|
|
3
2
|
import { Numberish } from '../../types/CommonTypes';
|
|
4
|
-
import { BCarouselSlots } from '../../types';
|
|
3
|
+
import { BCarouselProps, BCarouselSlots } from '../../types';
|
|
5
4
|
type __VLS_Props = Omit<BCarouselProps, 'modelValue'>;
|
|
6
5
|
type __VLS_PublicProps = {
|
|
7
6
|
modelValue?: Exclude<BCarouselProps['modelValue'], undefined>;
|
|
@@ -18,10 +17,11 @@ declare function __VLS_template(): {
|
|
|
18
17
|
};
|
|
19
18
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
19
|
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
21
|
-
|
|
20
|
+
resume: import('../../../node_modules/@vueuse/shared').Fn;
|
|
22
21
|
pause: import('../../../node_modules/@vueuse/shared').Fn;
|
|
22
|
+
next: () => void;
|
|
23
23
|
prev: () => void;
|
|
24
|
-
|
|
24
|
+
slideTo: (value: number) => void;
|
|
25
25
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
26
|
"update:modelValue": (value: number) => any;
|
|
27
27
|
slide: (value: BvCarouselEvent) => any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as BCarousel_default, t as BCarouselSlide_default } from "../../../BCarousel-
|
|
1
|
+
import { n as BCarousel_default, t as BCarouselSlide_default } from "../../../BCarousel-D9Yei1Q4.mjs";
|
|
2
2
|
export { BCarousel_default as BCarousel, BCarouselSlide_default as BCarouselSlide };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_BCarousel = require("../../../BCarousel-
|
|
2
|
+
const require_BCarousel = require("../../../BCarousel-BgT74ryc.js");
|
|
3
3
|
exports.BCarousel = require_BCarousel.BCarousel_default;
|
|
4
4
|
exports.BCarouselSlide = require_BCarousel.BCarouselSlide_default;
|
|
@@ -25,7 +25,7 @@ import { n as BButtonGroup_default, t as BButtonToolbar_default } from "../../BB
|
|
|
25
25
|
import { t as BImg_default } from "../../BImg-BQqZfIM9.mjs";
|
|
26
26
|
import { a as BCardTitle_default, i as BCardSubtitle_default, n as BCardFooter_default, o as BCardHeader_default, r as BCardBody_default, s as BCardImg_default, t as BCard_default } from "../../BCard-C1G8PO5k.mjs";
|
|
27
27
|
import { n as BCardGroup_default, t as BCardText_default } from "../../BCard-CJ822HyH.mjs";
|
|
28
|
-
import { n as BCarousel_default, t as BCarouselSlide_default } from "../../BCarousel-
|
|
28
|
+
import { n as BCarousel_default, t as BCarouselSlide_default } from "../../BCarousel-D9Yei1Q4.mjs";
|
|
29
29
|
import "./BCollapse/index.mjs";
|
|
30
30
|
import { t as BCol_default } from "../../BCol-C4v-TOX6.mjs";
|
|
31
31
|
import { t as BContainer_default } from "../../BContainer-DjIGH6-y.mjs";
|
|
@@ -26,7 +26,7 @@ const require_BButton$1 = require("../../BButton-kykTWnBy.js");
|
|
|
26
26
|
const require_BImg = require("../../BImg-Dyy0N-WQ.js");
|
|
27
27
|
const require_BCard = require("../../BCard-CgbTFn3S.js");
|
|
28
28
|
const require_BCard$1 = require("../../BCard-CSyEHz8Z.js");
|
|
29
|
-
const require_BCarousel = require("../../BCarousel-
|
|
29
|
+
const require_BCarousel = require("../../BCarousel-BgT74ryc.js");
|
|
30
30
|
require("./BCollapse/index.umd.js");
|
|
31
31
|
const require_BCol = require("../../BCol-0tZmpOme.js");
|
|
32
32
|
const require_BContainer = require("../../BContainer-BZUI2qQv.js");
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "bootstrap-vue-next",
|
|
3
3
|
"displayName": "BootstrapVueNext",
|
|
4
4
|
"description": "Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development",
|
|
5
|
-
"version": "0.44.
|
|
5
|
+
"version": "0.44.7",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "./dist/bootstrap-vue-next.umd.js",
|
|
8
8
|
"module": "./dist/bootstrap-vue-next.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BCarousel-Be7z13f9.js","names":[],"sources":["../src/utils/getSlotElements.ts","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarouselSlide.vue","../src/components/BCarousel/BCarouselSlide.vue"],"sourcesContent":["import type {Slot, VNode} from 'vue'\n\nexport const getSlotElements = (slot: Slot | undefined, filterBy: string): VNode[] =>\n (slot?.() ?? [])\n .reduce((arr: VNode[], slot: VNode) => {\n if (typeof slot.type === 'symbol') {\n arr = arr.concat(slot.children as unknown as VNode)\n } else {\n arr.push(slot)\n }\n return arr\n }, [])\n .filter((child) => (child.type as {__name: string} | undefined)?.__name === filterBy)\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"goToValue(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup\n :enter-from-class=\"enterClasses\"\n :enter-active-class=\"enterClasses\"\n :enter-to-class=\"enterClasses\"\n :leave-from-class=\"leaveClasses\"\n :leave-active-class=\"leaveClasses\"\n :leave-to-class=\"leaveClasses\"\n @before-leave=\"onBeforeLeave\"\n @after-leave=\"onAfterLeave\"\n @after-enter=\"onAfterEnter\"\n @enter=\"onEnter\"\n >\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselProps} from '../../types/ComponentProps'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref(true)\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\nconst previousModelValue = ref(modelValue.value)\n\nconst isHovering = useElementHover(element)\n\n// Class carousel-item is a static property\n// If you make it static, the direction can be reversed -- properly (atm it does the carousel-item-${} logic backwards for entering, a weird hack)\n// So all that would be great. However, when you do this, it will break the transition flow. Something about it breaks and I'm not sure why!\n// Try it by removing carousel-item from below and making `!direction.value` => `direction.value` for enter\n// Then reviewing the behavior\nconst enterClasses = computed(\n () =>\n `carousel-item carousel-item-${!direction.value ? 'next' : 'prev'} carousel-item-${\n !direction.value ? 'start' : 'end'\n }`\n)\nconst leaveClasses = computed(\n () => `carousel-item active carousel-item-${direction.value ? 'start' : 'end'}`\n)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value ? 'right' : 'left',\n from: previousModelValue.value,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nconst goToValue = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n direction.value = value < modelValue.value ? false : true\n if (value >= slides.value.length) {\n if (props.noWrap) return\n modelValue.value = 0\n return\n }\n if (value < 0) {\n if (props.noWrap) return\n modelValue.value = slides.value.length - 1\n return\n }\n previousModelValue.value = modelValue.value\n modelValue.value = value\n}\n\nconst prev = (): void => {\n goToValue(modelValue.value - 1)\n}\nconst next = (): void => {\n goToValue(modelValue.value + 1)\n}\n\nconst onKeydown = (fn: () => void) => {\n if (props.keyboard === false) return\n fn()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch === true) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch === true) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onBeforeLeave = () => {\n emit('slide', buildBvCarouselEvent('slide'))\n isTransitioning.value = true\n}\nconst onAfterLeave = () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n}\n// carousel-item class is removed from the slide during the transition,\n// as is included within enter classes.\n// The first slide recovers carousel-item class,\nconst onAfterEnter = (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n}\nconst onEnter = (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n}\n\nonKeyStroke(\n 'ArrowLeft',\n () => {\n onKeydown(prev)\n },\n {target: element}\n)\nonKeyStroke(\n 'ArrowRight',\n () => {\n onKeydown(next)\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\ndefineExpose({\n next,\n pause,\n prev,\n resume,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"goToValue(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup\n :enter-from-class=\"enterClasses\"\n :enter-active-class=\"enterClasses\"\n :enter-to-class=\"enterClasses\"\n :leave-from-class=\"leaveClasses\"\n :leave-active-class=\"leaveClasses\"\n :leave-to-class=\"leaveClasses\"\n @before-leave=\"onBeforeLeave\"\n @after-leave=\"onAfterLeave\"\n @after-enter=\"onAfterEnter\"\n @enter=\"onEnter\"\n >\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselProps} from '../../types/ComponentProps'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref(true)\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\nconst previousModelValue = ref(modelValue.value)\n\nconst isHovering = useElementHover(element)\n\n// Class carousel-item is a static property\n// If you make it static, the direction can be reversed -- properly (atm it does the carousel-item-${} logic backwards for entering, a weird hack)\n// So all that would be great. However, when you do this, it will break the transition flow. Something about it breaks and I'm not sure why!\n// Try it by removing carousel-item from below and making `!direction.value` => `direction.value` for enter\n// Then reviewing the behavior\nconst enterClasses = computed(\n () =>\n `carousel-item carousel-item-${!direction.value ? 'next' : 'prev'} carousel-item-${\n !direction.value ? 'start' : 'end'\n }`\n)\nconst leaveClasses = computed(\n () => `carousel-item active carousel-item-${direction.value ? 'start' : 'end'}`\n)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value ? 'right' : 'left',\n from: previousModelValue.value,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nconst goToValue = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n direction.value = value < modelValue.value ? false : true\n if (value >= slides.value.length) {\n if (props.noWrap) return\n modelValue.value = 0\n return\n }\n if (value < 0) {\n if (props.noWrap) return\n modelValue.value = slides.value.length - 1\n return\n }\n previousModelValue.value = modelValue.value\n modelValue.value = value\n}\n\nconst prev = (): void => {\n goToValue(modelValue.value - 1)\n}\nconst next = (): void => {\n goToValue(modelValue.value + 1)\n}\n\nconst onKeydown = (fn: () => void) => {\n if (props.keyboard === false) return\n fn()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch === true) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch === true) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onBeforeLeave = () => {\n emit('slide', buildBvCarouselEvent('slide'))\n isTransitioning.value = true\n}\nconst onAfterLeave = () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n}\n// carousel-item class is removed from the slide during the transition,\n// as is included within enter classes.\n// The first slide recovers carousel-item class,\nconst onAfterEnter = (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n}\nconst onEnter = (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n}\n\nonKeyStroke(\n 'ArrowLeft',\n () => {\n onKeydown(prev)\n },\n {target: element}\n)\nonKeyStroke(\n 'ArrowRight',\n () => {\n onKeydown(next)\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\ndefineExpose({\n next,\n pause,\n prev,\n resume,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n"],"mappings":";;;;;;;;;;AAEA,IAAa,mBAAmB,MAAwB,cACrD,QAAQ,IAAI,EAAE,EACZ,QAAQ,KAAc,SAAgB;AACrC,KAAI,OAAO,KAAK,SAAS,SACvB,OAAM,IAAI,OAAO,KAAK,SAA6B;KAEnD,KAAI,KAAK,KAAK;AAEhB,QAAO;GACN,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A,GAAA,IAAA,OADD,MAAK,CAAC,WAAU,EAAA;;IAErB,QAAA,GAAA,IAAA,gBAAK,CAAC,oBACE,uBAAA,MAAsB,CAAA;;oCAMlB;KAJ4B,WAAA,UAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,0BAAA,GAAA,IAAA,OAAxB,MAAK,CAAC,WAAU,EAAA,EAAA,KAAA,GAAA,EAAA;sCAGvB,EAAA,GAAA,IAAA,YAAA,KAAA,QAAA,WAAA,EAAA,QAAA,EAAA,GAAA,IAAA,oBAD2B,QAAA,OAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAAvB,MAAK,CAAC,QAAO,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;KAGW,QAAA,UAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,0BAAA,GAAA,IAAA,OAArB,MAAK,CAAC,QAAO,EAAA,EAAA,KAAA,GAAA,EAAA;sCAGpB,EAAA,GAAA,IAAA,YAAA,KAAA,QAAA,QAAA,EAAA,QAAA,EAAA,GAAA,IAAA,oBADwB,QAAA,OAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAApB,MAAK,CAAC,KAAI,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;yBAGf,KAAA,QAAA,UAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BCarousel-D81alfFC.mjs","names":[],"sources":["../src/utils/getSlotElements.ts","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarouselSlide.vue","../src/components/BCarousel/BCarouselSlide.vue"],"sourcesContent":["import type {Slot, VNode} from 'vue'\n\nexport const getSlotElements = (slot: Slot | undefined, filterBy: string): VNode[] =>\n (slot?.() ?? [])\n .reduce((arr: VNode[], slot: VNode) => {\n if (typeof slot.type === 'symbol') {\n arr = arr.concat(slot.children as unknown as VNode)\n } else {\n arr.push(slot)\n }\n return arr\n }, [])\n .filter((child) => (child.type as {__name: string} | undefined)?.__name === filterBy)\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"goToValue(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup\n :enter-from-class=\"enterClasses\"\n :enter-active-class=\"enterClasses\"\n :enter-to-class=\"enterClasses\"\n :leave-from-class=\"leaveClasses\"\n :leave-active-class=\"leaveClasses\"\n :leave-to-class=\"leaveClasses\"\n @before-leave=\"onBeforeLeave\"\n @after-leave=\"onAfterLeave\"\n @after-enter=\"onAfterEnter\"\n @enter=\"onEnter\"\n >\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselProps} from '../../types/ComponentProps'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref(true)\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\nconst previousModelValue = ref(modelValue.value)\n\nconst isHovering = useElementHover(element)\n\n// Class carousel-item is a static property\n// If you make it static, the direction can be reversed -- properly (atm it does the carousel-item-${} logic backwards for entering, a weird hack)\n// So all that would be great. However, when you do this, it will break the transition flow. Something about it breaks and I'm not sure why!\n// Try it by removing carousel-item from below and making `!direction.value` => `direction.value` for enter\n// Then reviewing the behavior\nconst enterClasses = computed(\n () =>\n `carousel-item carousel-item-${!direction.value ? 'next' : 'prev'} carousel-item-${\n !direction.value ? 'start' : 'end'\n }`\n)\nconst leaveClasses = computed(\n () => `carousel-item active carousel-item-${direction.value ? 'start' : 'end'}`\n)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value ? 'right' : 'left',\n from: previousModelValue.value,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nconst goToValue = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n direction.value = value < modelValue.value ? false : true\n if (value >= slides.value.length) {\n if (props.noWrap) return\n modelValue.value = 0\n return\n }\n if (value < 0) {\n if (props.noWrap) return\n modelValue.value = slides.value.length - 1\n return\n }\n previousModelValue.value = modelValue.value\n modelValue.value = value\n}\n\nconst prev = (): void => {\n goToValue(modelValue.value - 1)\n}\nconst next = (): void => {\n goToValue(modelValue.value + 1)\n}\n\nconst onKeydown = (fn: () => void) => {\n if (props.keyboard === false) return\n fn()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch === true) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch === true) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onBeforeLeave = () => {\n emit('slide', buildBvCarouselEvent('slide'))\n isTransitioning.value = true\n}\nconst onAfterLeave = () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n}\n// carousel-item class is removed from the slide during the transition,\n// as is included within enter classes.\n// The first slide recovers carousel-item class,\nconst onAfterEnter = (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n}\nconst onEnter = (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n}\n\nonKeyStroke(\n 'ArrowLeft',\n () => {\n onKeydown(prev)\n },\n {target: element}\n)\nonKeyStroke(\n 'ArrowRight',\n () => {\n onKeydown(next)\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\ndefineExpose({\n next,\n pause,\n prev,\n resume,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"goToValue(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup\n :enter-from-class=\"enterClasses\"\n :enter-active-class=\"enterClasses\"\n :enter-to-class=\"enterClasses\"\n :leave-from-class=\"leaveClasses\"\n :leave-active-class=\"leaveClasses\"\n :leave-to-class=\"leaveClasses\"\n @before-leave=\"onBeforeLeave\"\n @after-leave=\"onAfterLeave\"\n @after-enter=\"onAfterEnter\"\n @enter=\"onEnter\"\n >\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselProps} from '../../types/ComponentProps'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref(true)\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\nconst previousModelValue = ref(modelValue.value)\n\nconst isHovering = useElementHover(element)\n\n// Class carousel-item is a static property\n// If you make it static, the direction can be reversed -- properly (atm it does the carousel-item-${} logic backwards for entering, a weird hack)\n// So all that would be great. However, when you do this, it will break the transition flow. Something about it breaks and I'm not sure why!\n// Try it by removing carousel-item from below and making `!direction.value` => `direction.value` for enter\n// Then reviewing the behavior\nconst enterClasses = computed(\n () =>\n `carousel-item carousel-item-${!direction.value ? 'next' : 'prev'} carousel-item-${\n !direction.value ? 'start' : 'end'\n }`\n)\nconst leaveClasses = computed(\n () => `carousel-item active carousel-item-${direction.value ? 'start' : 'end'}`\n)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value ? 'right' : 'left',\n from: previousModelValue.value,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nconst goToValue = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n direction.value = value < modelValue.value ? false : true\n if (value >= slides.value.length) {\n if (props.noWrap) return\n modelValue.value = 0\n return\n }\n if (value < 0) {\n if (props.noWrap) return\n modelValue.value = slides.value.length - 1\n return\n }\n previousModelValue.value = modelValue.value\n modelValue.value = value\n}\n\nconst prev = (): void => {\n goToValue(modelValue.value - 1)\n}\nconst next = (): void => {\n goToValue(modelValue.value + 1)\n}\n\nconst onKeydown = (fn: () => void) => {\n if (props.keyboard === false) return\n fn()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch === true) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch === true) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onBeforeLeave = () => {\n emit('slide', buildBvCarouselEvent('slide'))\n isTransitioning.value = true\n}\nconst onAfterLeave = () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n}\n// carousel-item class is removed from the slide during the transition,\n// as is included within enter classes.\n// The first slide recovers carousel-item class,\nconst onAfterEnter = (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n}\nconst onEnter = (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n}\n\nonKeyStroke(\n 'ArrowLeft',\n () => {\n onKeydown(prev)\n },\n {target: element}\n)\nonKeyStroke(\n 'ArrowRight',\n () => {\n onKeydown(next)\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\ndefineExpose({\n next,\n pause,\n prev,\n resume,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n"],"mappings":";;;;;;;;;AAEA,IAAa,mBAAmB,MAAwB,cACrD,QAAQ,IAAI,EAAE,EACZ,QAAQ,KAAc,SAAgB;AACrC,KAAI,OAAO,KAAK,SAAS,SACvB,OAAM,IAAI,OAAO,KAAK,SAA6B;KAEnD,KAAI,KAAK,KAAK;AAEhB,QAAO;GACN,EAAE,CAAC,CACL,QAAQ,UAAW,MAAM,MAAuC,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECyFzF,MAAM,QAAQ,YAtBC,SAsBmB,YAAW;EAC7C,MAAM,OAAO;EACb,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