@bagelink/vue 0.0.827 → 0.0.833
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/components/Carousel.vue.d.ts +27 -4
- package/dist/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/Pill.vue.d.ts +6 -6
- package/dist/components/Pill.vue.d.ts.map +1 -1
- package/dist/index.cjs +108 -144
- package/dist/index.mjs +108 -144
- package/dist/style.css +28 -28
- package/package.json +3 -3
- package/src/components/Carousel.vue +105 -142
- package/src/components/Pill.vue +4 -4
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
declare function next(): void;
|
|
2
|
-
declare function prev(): void;
|
|
3
1
|
declare function __VLS_template(): {
|
|
4
2
|
slots: {
|
|
5
3
|
default?(_: {}): any;
|
|
6
4
|
prev?(_: {
|
|
7
|
-
prev: typeof prev;
|
|
8
5
|
index: import('@vue-macros/reactivity-transform/macros.js').ReactiveVariable<number>;
|
|
9
6
|
}): any;
|
|
10
7
|
next?(_: {
|
|
11
|
-
next: typeof next;
|
|
12
8
|
index: import('@vue-macros/reactivity-transform/macros.js').ReactiveVariable<number>;
|
|
13
9
|
}): any;
|
|
14
10
|
};
|
|
@@ -39,6 +35,18 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
39
35
|
type: NumberConstructor;
|
|
40
36
|
default: number;
|
|
41
37
|
};
|
|
38
|
+
rtl: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
autoplay: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: boolean;
|
|
45
|
+
};
|
|
46
|
+
autoPlaySpeed: {
|
|
47
|
+
type: NumberConstructor;
|
|
48
|
+
default: number;
|
|
49
|
+
};
|
|
42
50
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
43
51
|
"update:index": (...args: any[]) => void;
|
|
44
52
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -62,14 +70,29 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
62
70
|
type: NumberConstructor;
|
|
63
71
|
default: number;
|
|
64
72
|
};
|
|
73
|
+
rtl: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
77
|
+
autoplay: {
|
|
78
|
+
type: BooleanConstructor;
|
|
79
|
+
default: boolean;
|
|
80
|
+
};
|
|
81
|
+
autoPlaySpeed: {
|
|
82
|
+
type: NumberConstructor;
|
|
83
|
+
default: number;
|
|
84
|
+
};
|
|
65
85
|
}>> & Readonly<{
|
|
66
86
|
"onUpdate:index"?: ((...args: any[]) => any) | undefined;
|
|
67
87
|
}>, {
|
|
88
|
+
autoplay: boolean;
|
|
68
89
|
index: number;
|
|
69
90
|
autoHeight: boolean;
|
|
70
91
|
allowScroll: boolean;
|
|
71
92
|
freeDrag: boolean;
|
|
72
93
|
items: number;
|
|
94
|
+
rtl: boolean;
|
|
95
|
+
autoPlaySpeed: number;
|
|
73
96
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
74
97
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
75
98
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AAubA,iBAAS,cAAc;;yBAsEM,GAAG;;;YACN,GAAG;;;YACH,GAAG;;;;;WAUf,OAAO,IAA6B;EAEjD;AA6BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAgBnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -15,7 +15,7 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
|
15
15
|
declare const __VLS_component: import('vue').DefineComponent<{
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
icon?: MaterialIcons;
|
|
18
|
-
iconEnd
|
|
18
|
+
iconEnd?: MaterialIcons;
|
|
19
19
|
color?: ThemeType;
|
|
20
20
|
theme?: ThemeType;
|
|
21
21
|
flat?: boolean;
|
|
@@ -24,12 +24,12 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
|
24
24
|
loading?: boolean;
|
|
25
25
|
value?: string;
|
|
26
26
|
round?: boolean;
|
|
27
|
-
btn
|
|
28
|
-
btnEnd
|
|
27
|
+
btn?: BtnProp;
|
|
28
|
+
btnEnd?: BtnProp;
|
|
29
29
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
30
30
|
disabled?: boolean;
|
|
31
31
|
icon?: MaterialIcons;
|
|
32
|
-
iconEnd
|
|
32
|
+
iconEnd?: MaterialIcons;
|
|
33
33
|
color?: ThemeType;
|
|
34
34
|
theme?: ThemeType;
|
|
35
35
|
flat?: boolean;
|
|
@@ -38,8 +38,8 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
|
38
38
|
loading?: boolean;
|
|
39
39
|
value?: string;
|
|
40
40
|
round?: boolean;
|
|
41
|
-
btn
|
|
42
|
-
btnEnd
|
|
41
|
+
btn?: BtnProp;
|
|
42
|
+
btnEnd?: BtnProp;
|
|
43
43
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
44
44
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
45
45
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pill.vue.d.ts","sourceRoot":"","sources":["../../src/components/Pill.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pill.vue.d.ts","sourceRoot":"","sources":["../../src/components/Pill.vue"],"names":[],"mappings":"AAiLA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAM7D,UAAU,OAAO;IAChB,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACb;AAsED,iBAAS,cAAc;;yBA8GO,GAAG;;;WASnB,OAAO,IAA6B;EAEjD;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;eA1MT,OAAO;WACX,aAAa;cACV,aAAa;YACf,SAAS;YACT,SAAS;WACV,OAAO;aACL,OAAO;cACN,OAAO;cACP,OAAO;YACT,MAAM;YACN,OAAO;UACT,OAAO;aACJ,OAAO;;eAZL,OAAO;WACX,aAAa;cACV,aAAa;YACf,SAAS;YACT,SAAS;WACV,OAAO;aACL,OAAO;cACN,OAAO;cACP,OAAO;YACT,MAAM;YACN,OAAO;UACT,OAAO;aACJ,OAAO;iGAoMf,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -56,7 +56,7 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
|
|
|
56
56
|
});
|
|
57
57
|
const _hoisted_1$M = ["aria-expanded", "aria-controls"];
|
|
58
58
|
const _hoisted_2$w = { class: "accordion-label" };
|
|
59
|
-
const _hoisted_3$
|
|
59
|
+
const _hoisted_3$n = ["id", "aria-hidden"];
|
|
60
60
|
const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
|
|
61
61
|
__name: "AccordionItem",
|
|
62
62
|
props: {
|
|
@@ -143,7 +143,7 @@ const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
|
|
|
143
143
|
"aria-hidden": vue.unref(isOpen) ? "false" : "true"
|
|
144
144
|
}, [
|
|
145
145
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
146
|
-
], 8, _hoisted_3$
|
|
146
|
+
], 8, _hoisted_3$n)) : vue.createCommentVNode("", true)
|
|
147
147
|
]),
|
|
148
148
|
_: 3
|
|
149
149
|
})
|
|
@@ -556,34 +556,23 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
558
|
});
|
|
559
|
-
const _hoisted_1$F =
|
|
559
|
+
const _hoisted_1$F = ["dir"];
|
|
560
|
+
const _hoisted_2$s = {
|
|
560
561
|
key: 0,
|
|
561
562
|
class: "blocker"
|
|
562
563
|
};
|
|
563
|
-
const
|
|
564
|
+
const _hoisted_3$m = { class: "Handlers" };
|
|
564
565
|
const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
565
566
|
__name: "Carousel",
|
|
566
567
|
props: {
|
|
567
|
-
autoHeight: {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
},
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
}
|
|
575
|
-
freeDrag: {
|
|
576
|
-
type: Boolean,
|
|
577
|
-
default: true
|
|
578
|
-
},
|
|
579
|
-
items: {
|
|
580
|
-
type: Number,
|
|
581
|
-
default: 4
|
|
582
|
-
},
|
|
583
|
-
index: {
|
|
584
|
-
type: Number,
|
|
585
|
-
default: 0
|
|
586
|
-
}
|
|
568
|
+
autoHeight: { type: Boolean, default: false },
|
|
569
|
+
allowScroll: { type: Boolean, default: true },
|
|
570
|
+
freeDrag: { type: Boolean, default: true },
|
|
571
|
+
items: { type: Number, default: 4 },
|
|
572
|
+
index: { type: Number, default: 0 },
|
|
573
|
+
rtl: { type: Boolean, default: false },
|
|
574
|
+
autoplay: { type: Boolean, default: false },
|
|
575
|
+
autoPlaySpeed: { type: Number, default: 4e3 }
|
|
587
576
|
},
|
|
588
577
|
emits: ["update:index"],
|
|
589
578
|
setup(__props, { emit: __emit }) {
|
|
@@ -591,187 +580,162 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
|
591
580
|
const emit2 = __emit;
|
|
592
581
|
const bglSlider = vue.ref();
|
|
593
582
|
let itemCount = vue.ref(props2.items);
|
|
594
|
-
let activeSlideIndex = vue.ref(
|
|
583
|
+
let activeSlideIndex = vue.ref(props2.index);
|
|
595
584
|
let isDragging = vue.ref(false);
|
|
596
|
-
let startX = vue.ref(0);
|
|
597
|
-
let scrollLeft = vue.ref(0);
|
|
598
585
|
let isPressed = vue.ref(false);
|
|
586
|
+
let startX = vue.ref(0);
|
|
587
|
+
let scrollStart = vue.ref(0);
|
|
588
|
+
let yHeight = vue.ref("auto");
|
|
589
|
+
let timeout;
|
|
590
|
+
let autoPlayInterval;
|
|
591
|
+
function preventDefaultClick(e) {
|
|
592
|
+
e.preventDefault();
|
|
593
|
+
}
|
|
599
594
|
function disableDrag() {
|
|
600
595
|
var _a2, _b;
|
|
601
|
-
(_a2 = bglSlider.value) == null ? void 0 : _a2.querySelectorAll("img").forEach((
|
|
602
|
-
|
|
596
|
+
(_a2 = bglSlider.value) == null ? void 0 : _a2.querySelectorAll("img").forEach((img) => {
|
|
597
|
+
img.setAttribute("draggable", "false");
|
|
598
|
+
});
|
|
599
|
+
Array.from(((_b = bglSlider.value) == null ? void 0 : _b.children) || []).forEach((child) => {
|
|
600
|
+
child.setAttribute("draggable", "false");
|
|
601
|
+
child.addEventListener("click", preventDefaultClick);
|
|
603
602
|
});
|
|
604
|
-
for (const e of ((_b = bglSlider.value) == null ? void 0 : _b.children) || []) {
|
|
605
|
-
e.setAttribute("draggable", "false");
|
|
606
|
-
e.addEventListener("click", (e22) => e22.preventDefault());
|
|
607
|
-
}
|
|
608
603
|
}
|
|
609
|
-
|
|
610
|
-
function evalHeight() {
|
|
604
|
+
function updateHeight() {
|
|
611
605
|
if (!props2.autoHeight || !bglSlider.value) return;
|
|
612
|
-
const
|
|
613
|
-
const
|
|
614
|
-
yHeight.value = `${
|
|
606
|
+
const children2 = Array.from(bglSlider.value.children[activeSlideIndex.value].children);
|
|
607
|
+
const totalHeight = children2.reduce((sum, el) => sum + el.clientHeight, 0);
|
|
608
|
+
yHeight.value = `${totalHeight}px`;
|
|
615
609
|
}
|
|
616
|
-
function
|
|
617
|
-
if (!bglSlider.value) return;
|
|
618
|
-
if (isPressed.value) return;
|
|
610
|
+
function easeScroll(target, duration = 500) {
|
|
611
|
+
if (!bglSlider.value || isPressed.value) return;
|
|
619
612
|
const start2 = bglSlider.value.scrollLeft;
|
|
620
613
|
const change = target - start2;
|
|
621
614
|
const startTime = performance.now();
|
|
622
|
-
function
|
|
615
|
+
function animate(currentTime) {
|
|
623
616
|
if (!bglSlider.value) return;
|
|
624
617
|
const timeElapsed = currentTime - startTime;
|
|
625
618
|
const progress = Math.min(timeElapsed / duration, 1);
|
|
626
619
|
bglSlider.value.scrollLeft = start2 + change * easeInOutQuad(progress);
|
|
627
|
-
if (progress < 1)
|
|
628
|
-
requestAnimationFrame(animateScroll);
|
|
629
|
-
}
|
|
620
|
+
if (progress < 1) requestAnimationFrame(animate);
|
|
630
621
|
}
|
|
631
622
|
function easeInOutQuad(t) {
|
|
632
623
|
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
633
624
|
}
|
|
634
|
-
requestAnimationFrame(
|
|
625
|
+
requestAnimationFrame(animate);
|
|
635
626
|
}
|
|
636
627
|
function goToSlide(index2) {
|
|
637
|
-
if (!bglSlider.value || index2 < 0 || index2
|
|
638
|
-
const
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
let duration = 700;
|
|
642
|
-
if (screenWidth < 600) {
|
|
643
|
-
duration = 400;
|
|
644
|
-
} else if (screenWidth < 991) {
|
|
645
|
-
duration = 500;
|
|
646
|
-
}
|
|
647
|
-
scrollEase(scrollX, duration);
|
|
628
|
+
if (!bglSlider.value || index2 < 0 || index2 >= bglSlider.value.children.length) return;
|
|
629
|
+
const offset2 = bglSlider.value.offsetWidth * index2 * (props2.rtl ? -1 : 1);
|
|
630
|
+
const duration = window.innerWidth < 600 ? 400 : window.innerWidth < 991 ? 500 : 700;
|
|
631
|
+
easeScroll(offset2, duration);
|
|
648
632
|
activeSlideIndex.value = index2;
|
|
649
|
-
|
|
633
|
+
updateHeight();
|
|
650
634
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
if (props2.index === activeSlideIndex.value) return;
|
|
656
|
-
emit2("update:index", activeSlideIndex.value);
|
|
657
|
-
}
|
|
658
|
-
);
|
|
659
|
-
function goToSlideScrollEnd() {
|
|
635
|
+
function handleSlideChange() {
|
|
636
|
+
if (props2.index !== activeSlideIndex.value) emit2("update:index", activeSlideIndex.value);
|
|
637
|
+
}
|
|
638
|
+
function handleResize() {
|
|
660
639
|
if (!bglSlider.value) return;
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
if (isDragForward) activeSlideIndex.value = Math.ceil(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
664
|
-
else activeSlideIndex.value = Math.floor(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
665
|
-
} else {
|
|
666
|
-
activeSlideIndex.value = Math.round(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
667
|
-
}
|
|
668
|
-
startX.value = 0;
|
|
669
|
-
const nextSlide = Math.round(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
670
|
-
goToSlide(nextSlide);
|
|
640
|
+
itemCount.value = window.innerWidth < 600 ? 1 : window.innerWidth < 991 ? Math.min(props2.items, 2) : Math.min(props2.items, 3);
|
|
641
|
+
goToSlide(activeSlideIndex.value);
|
|
671
642
|
}
|
|
672
|
-
|
|
673
|
-
|
|
643
|
+
function onScrollEnd() {
|
|
644
|
+
if (!props2.freeDrag && !props2.allowScroll || !bglSlider.value) return;
|
|
645
|
+
if (autoPlayInterval) clearInterval(autoPlayInterval);
|
|
674
646
|
if (timeout) clearTimeout(timeout);
|
|
675
|
-
timeout = setTimeout(
|
|
647
|
+
timeout = setTimeout(() => {
|
|
648
|
+
finalizeScroll();
|
|
649
|
+
}, 400);
|
|
676
650
|
}
|
|
677
|
-
function
|
|
678
|
-
isPressed.value = false;
|
|
679
|
-
document.removeEventListener("mousemove", move);
|
|
680
|
-
document.removeEventListener("mouseup", stopDragging);
|
|
681
|
-
document.removeEventListener("dragend", stopDragging);
|
|
682
|
-
setTimeout(() => isDragging.value = false, 100);
|
|
683
|
-
}
|
|
684
|
-
function move(e) {
|
|
651
|
+
function finalizeScroll() {
|
|
685
652
|
if (!bglSlider.value) return;
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
const scroll = x2 - startX.value;
|
|
691
|
-
bglSlider.value.scrollLeft = scrollLeft.value - scroll;
|
|
653
|
+
if (props2.autoplay) autoPlayInterval = setInterval(next, props2.autoPlaySpeed);
|
|
654
|
+
scrollStart.value = props2.rtl ? -bglSlider.value.scrollLeft : bglSlider.value.scrollLeft;
|
|
655
|
+
activeSlideIndex.value = Math.round(scrollStart.value / bglSlider.value.offsetWidth);
|
|
656
|
+
goToSlide(activeSlideIndex.value);
|
|
692
657
|
}
|
|
693
|
-
function
|
|
658
|
+
function startDrag(e) {
|
|
694
659
|
if (e.button !== 0 || !props2.freeDrag || !bglSlider.value) return;
|
|
660
|
+
if (autoPlayInterval) clearInterval(autoPlayInterval);
|
|
695
661
|
startX.value = e.pageX - bglSlider.value.offsetLeft;
|
|
696
|
-
|
|
662
|
+
scrollStart.value = bglSlider.value.scrollLeft;
|
|
697
663
|
isPressed.value = true;
|
|
698
|
-
document.addEventListener("mousemove",
|
|
699
|
-
document.addEventListener("mouseup",
|
|
664
|
+
document.addEventListener("mousemove", onDrag);
|
|
665
|
+
document.addEventListener("mouseup", endDrag);
|
|
666
|
+
}
|
|
667
|
+
function onDrag(e) {
|
|
668
|
+
if (!bglSlider.value) return;
|
|
669
|
+
const x2 = e.pageX - bglSlider.value.offsetLeft;
|
|
670
|
+
const distance = x2 - startX.value;
|
|
671
|
+
if (Math.abs(distance) > 20) isDragging.value = true;
|
|
672
|
+
if (isDragging.value) bglSlider.value.scrollLeft = scrollStart.value - distance;
|
|
673
|
+
}
|
|
674
|
+
function endDrag() {
|
|
675
|
+
isPressed.value = false;
|
|
676
|
+
document.removeEventListener("mousemove", onDrag);
|
|
677
|
+
document.removeEventListener("mouseup", endDrag);
|
|
678
|
+
setTimeout(() => isDragging.value = false, 100);
|
|
700
679
|
}
|
|
701
680
|
function next() {
|
|
702
681
|
if (!bglSlider.value) return;
|
|
703
682
|
const slideCount = bglSlider.value.children.length;
|
|
704
|
-
|
|
705
|
-
if (isLastSlide) goToSlide(0);
|
|
706
|
-
else goToSlide(activeSlideIndex.value + 1);
|
|
683
|
+
goToSlide((activeSlideIndex.value + 1) % slideCount);
|
|
707
684
|
}
|
|
708
685
|
function prev() {
|
|
709
686
|
if (!bglSlider.value) return;
|
|
710
687
|
const slideCount = bglSlider.value.children.length;
|
|
711
|
-
|
|
712
|
-
else goToSlide(activeSlideIndex.value - 1);
|
|
713
|
-
}
|
|
714
|
-
function evalWidth() {
|
|
715
|
-
if (!bglSlider.value) return;
|
|
716
|
-
if (window.innerWidth < 600) itemCount.value = 1;
|
|
717
|
-
else if (window.innerWidth < 991) itemCount.value = Math.min(props2.items, 2);
|
|
718
|
-
else if (window.innerWidth < 1280) itemCount.value = Math.min(props2.items, 3);
|
|
719
|
-
else itemCount.value = props2.items;
|
|
720
|
-
console.log(itemCount.value, window.innerWidth);
|
|
721
|
-
goToSlide(activeSlideIndex.value);
|
|
688
|
+
goToSlide((activeSlideIndex.value - 1 + slideCount) % slideCount);
|
|
722
689
|
}
|
|
723
690
|
vue.onMounted(() => {
|
|
724
|
-
window.addEventListener("resize",
|
|
725
|
-
evalHeight();
|
|
726
|
-
evalWidth();
|
|
691
|
+
window.addEventListener("resize", handleResize);
|
|
727
692
|
disableDrag();
|
|
693
|
+
updateHeight();
|
|
694
|
+
handleResize();
|
|
695
|
+
if (props2.autoplay) {
|
|
696
|
+
autoPlayInterval = setInterval(next, props2.autoPlaySpeed);
|
|
697
|
+
}
|
|
728
698
|
});
|
|
699
|
+
function clearAutoplay() {
|
|
700
|
+
if (autoPlayInterval) clearInterval(autoPlayInterval);
|
|
701
|
+
}
|
|
729
702
|
vue.onUnmounted(() => {
|
|
730
|
-
window.removeEventListener("resize",
|
|
703
|
+
window.removeEventListener("resize", handleResize);
|
|
731
704
|
});
|
|
705
|
+
vue.watch(() => props2.index, goToSlide);
|
|
706
|
+
vue.watch(() => activeSlideIndex.value, handleSlideChange);
|
|
732
707
|
return (_ctx, _cache) => {
|
|
733
708
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
734
709
|
class: vue.normalizeClass(["BglCarousel", { autoHeight: __props.autoHeight }]),
|
|
735
|
-
style: vue.normalizeStyle({ height: vue.unref(yHeight) })
|
|
710
|
+
style: vue.normalizeStyle({ height: vue.unref(yHeight) }),
|
|
711
|
+
dir: __props.rtl ? "rtl" : "ltr"
|
|
736
712
|
}, [
|
|
737
713
|
vue.createElementVNode("div", {
|
|
738
714
|
ref_key: "bglSlider",
|
|
739
715
|
ref: bglSlider,
|
|
740
|
-
class: vue.normalizeClass([{
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
}, "bgl-slider"]),
|
|
747
|
-
style: vue.normalizeStyle({
|
|
748
|
-
"--item-count": vue.unref(itemCount)
|
|
749
|
-
}),
|
|
750
|
-
onScroll: scrollEnd,
|
|
751
|
-
onMousedown: startDragging
|
|
716
|
+
class: vue.normalizeClass(["bgl-slider", { dragging: vue.unref(isDragging), clicking: vue.unref(isPressed), allowScroll: __props.allowScroll, odd: vue.unref(itemCount) % 2 !== 0, [`slides-${vue.unref(itemCount)}`]: vue.unref(itemCount) === 1 }]),
|
|
717
|
+
style: vue.normalizeStyle({ "--item-count": vue.unref(itemCount) }),
|
|
718
|
+
onScroll: onScrollEnd,
|
|
719
|
+
onMousedown: startDrag,
|
|
720
|
+
onMouseover: clearAutoplay,
|
|
721
|
+
onFocusin: clearAutoplay
|
|
752
722
|
}, [
|
|
753
|
-
vue.unref(isDragging) ? (vue.openBlock(), vue.createElementBlock("div",
|
|
723
|
+
vue.unref(isDragging) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$s)) : vue.createCommentVNode("", true),
|
|
754
724
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
755
725
|
], 38),
|
|
756
|
-
vue.createElementVNode("div",
|
|
726
|
+
vue.createElementVNode("div", _hoisted_3$m, [
|
|
757
727
|
vue.createElementVNode("span", { onClick: prev }, [
|
|
758
|
-
vue.renderSlot(_ctx.$slots, "prev", {
|
|
759
|
-
prev,
|
|
760
|
-
index: vue.unref(activeSlideIndex)
|
|
761
|
-
}, void 0, true)
|
|
728
|
+
vue.renderSlot(_ctx.$slots, "prev", { index: vue.unref(activeSlideIndex) }, void 0, true)
|
|
762
729
|
]),
|
|
763
730
|
vue.createElementVNode("span", { onClick: next }, [
|
|
764
|
-
vue.renderSlot(_ctx.$slots, "next", {
|
|
765
|
-
next,
|
|
766
|
-
index: vue.unref(activeSlideIndex)
|
|
767
|
-
}, void 0, true)
|
|
731
|
+
vue.renderSlot(_ctx.$slots, "next", { index: vue.unref(activeSlideIndex) }, void 0, true)
|
|
768
732
|
])
|
|
769
733
|
])
|
|
770
|
-
],
|
|
734
|
+
], 14, _hoisted_1$F);
|
|
771
735
|
};
|
|
772
736
|
}
|
|
773
737
|
});
|
|
774
|
-
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-
|
|
738
|
+
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-3f8e6ea0"]]);
|
|
775
739
|
function _isPlaceholder(a2) {
|
|
776
740
|
return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
|
|
777
741
|
}
|
|
@@ -53655,8 +53619,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53655
53619
|
},
|
|
53656
53620
|
setup(__props) {
|
|
53657
53621
|
vue.useCssVars((_ctx) => ({
|
|
53658
|
-
"
|
|
53659
|
-
"
|
|
53622
|
+
"559533ce": computedBackgroundColor.value,
|
|
53623
|
+
"4621e5ae": cumputedTextColor.value
|
|
53660
53624
|
}));
|
|
53661
53625
|
const props2 = __props;
|
|
53662
53626
|
const slots = vue.useSlots();
|
|
@@ -53747,7 +53711,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53747
53711
|
};
|
|
53748
53712
|
}
|
|
53749
53713
|
});
|
|
53750
|
-
const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
53714
|
+
const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-4c9e6928"]]);
|
|
53751
53715
|
const _sfc_main$5 = {};
|
|
53752
53716
|
function _sfc_render$1(_ctx, _cache) {
|
|
53753
53717
|
const _component_router_view = vue.resolveComponent("router-view");
|