@dcodegroup-au/page-builder 0.7.7 → 0.7.8
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/page-builder.css +50 -34
- package/dist/page-builder.es.js +50 -31
- package/dist/page-builder.umd.js +50 -31
- package/package.json +1 -1
- package/src/components/presenters/components/CarouselPresenter.vue +33 -9
- package/src/components/presenters/components/HeaderPresenter.vue +1 -1
- package/src/components/presenters/modules/CollectionCarousel.vue +2 -2
package/dist/page-builder.css
CHANGED
|
@@ -700,6 +700,9 @@ select {
|
|
|
700
700
|
.pointer-events-none {
|
|
701
701
|
pointer-events: none;
|
|
702
702
|
}
|
|
703
|
+
.pointer-events-auto {
|
|
704
|
+
pointer-events: auto;
|
|
705
|
+
}
|
|
703
706
|
.fixed {
|
|
704
707
|
position: fixed;
|
|
705
708
|
}
|
|
@@ -742,9 +745,6 @@ select {
|
|
|
742
745
|
.right-2 {
|
|
743
746
|
right: 0.5rem;
|
|
744
747
|
}
|
|
745
|
-
.right-4 {
|
|
746
|
-
right: 1rem;
|
|
747
|
-
}
|
|
748
748
|
.right-\[-17px\] {
|
|
749
749
|
right: -17px;
|
|
750
750
|
}
|
|
@@ -760,9 +760,6 @@ select {
|
|
|
760
760
|
.top-6 {
|
|
761
761
|
top: 1.5rem;
|
|
762
762
|
}
|
|
763
|
-
.top-\[-65px\] {
|
|
764
|
-
top: -65px;
|
|
765
|
-
}
|
|
766
763
|
.top-\[100\%\] {
|
|
767
764
|
top: 100%;
|
|
768
765
|
}
|
|
@@ -855,9 +852,6 @@ select {
|
|
|
855
852
|
.mb-8 {
|
|
856
853
|
margin-bottom: 2rem;
|
|
857
854
|
}
|
|
858
|
-
.mb-\[40px\] {
|
|
859
|
-
margin-bottom: 40px;
|
|
860
|
-
}
|
|
861
855
|
.mb-\[48px\] {
|
|
862
856
|
margin-bottom: 48px;
|
|
863
857
|
}
|
|
@@ -1447,18 +1441,12 @@ select {
|
|
|
1447
1441
|
.rounded-br-\[24px\] {
|
|
1448
1442
|
border-bottom-right-radius: 24px;
|
|
1449
1443
|
}
|
|
1450
|
-
.rounded-br-\[48px\] {
|
|
1451
|
-
border-bottom-right-radius: 48px;
|
|
1452
|
-
}
|
|
1453
1444
|
.rounded-tl-3xl {
|
|
1454
1445
|
border-top-left-radius: 1.5rem;
|
|
1455
1446
|
}
|
|
1456
1447
|
.rounded-tl-\[24px\] {
|
|
1457
1448
|
border-top-left-radius: 24px;
|
|
1458
1449
|
}
|
|
1459
|
-
.rounded-tl-\[48px\] {
|
|
1460
|
-
border-top-left-radius: 48px;
|
|
1461
|
-
}
|
|
1462
1450
|
.rounded-tr-\[0px\] {
|
|
1463
1451
|
border-top-right-radius: 0px;
|
|
1464
1452
|
}
|
|
@@ -2102,6 +2090,9 @@ select {
|
|
|
2102
2090
|
.\!no-underline {
|
|
2103
2091
|
text-decoration-line: none !important;
|
|
2104
2092
|
}
|
|
2093
|
+
.opacity-100 {
|
|
2094
|
+
opacity: 1;
|
|
2095
|
+
}
|
|
2105
2096
|
.opacity-50 {
|
|
2106
2097
|
opacity: 0.5;
|
|
2107
2098
|
}
|
|
@@ -2901,10 +2892,6 @@ select {
|
|
|
2901
2892
|
text-decoration-line: underline;
|
|
2902
2893
|
}
|
|
2903
2894
|
|
|
2904
|
-
.hover\:opacity-100:hover {
|
|
2905
|
-
opacity: 1;
|
|
2906
|
-
}
|
|
2907
|
-
|
|
2908
2895
|
.hover\:opacity-60:hover {
|
|
2909
2896
|
opacity: 0.6;
|
|
2910
2897
|
}
|
|
@@ -3010,11 +2997,6 @@ select {
|
|
|
3010
2997
|
|
|
3011
2998
|
@media not all and (min-width: 768px) {
|
|
3012
2999
|
|
|
3013
|
-
.max-md\:mx-\[30px\] {
|
|
3014
|
-
margin-left: 30px;
|
|
3015
|
-
margin-right: 30px;
|
|
3016
|
-
}
|
|
3017
|
-
|
|
3018
3000
|
.max-md\:w-full {
|
|
3019
3001
|
width: 100%;
|
|
3020
3002
|
}
|
|
@@ -3039,6 +3021,10 @@ select {
|
|
|
3039
3021
|
|
|
3040
3022
|
@media not all and (min-width: 640px) {
|
|
3041
3023
|
|
|
3024
|
+
.max-sm\:bottom-0 {
|
|
3025
|
+
bottom: 0px;
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3042
3028
|
.max-sm\:hidden {
|
|
3043
3029
|
display: none;
|
|
3044
3030
|
}
|
|
@@ -3084,6 +3070,10 @@ select {
|
|
|
3084
3070
|
|
|
3085
3071
|
@media (min-width: 640px) {
|
|
3086
3072
|
|
|
3073
|
+
.sm\:top-\[-65px\] {
|
|
3074
|
+
top: -65px;
|
|
3075
|
+
}
|
|
3076
|
+
|
|
3087
3077
|
.sm\:mb-2 {
|
|
3088
3078
|
margin-bottom: 0.5rem;
|
|
3089
3079
|
}
|
|
@@ -3123,6 +3113,10 @@ select {
|
|
|
3123
3113
|
grid-template-columns: auto 240px;
|
|
3124
3114
|
}
|
|
3125
3115
|
|
|
3116
|
+
.sm\:justify-center {
|
|
3117
|
+
justify-content: center;
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3126
3120
|
.sm\:border-l-4 {
|
|
3127
3121
|
border-left-width: 4px;
|
|
3128
3122
|
}
|
|
@@ -3131,11 +3125,6 @@ select {
|
|
|
3131
3125
|
padding: 0px;
|
|
3132
3126
|
}
|
|
3133
3127
|
|
|
3134
|
-
.sm\:px-0 {
|
|
3135
|
-
padding-left: 0px;
|
|
3136
|
-
padding-right: 0px;
|
|
3137
|
-
}
|
|
3138
|
-
|
|
3139
3128
|
.sm\:px-4 {
|
|
3140
3129
|
padding-left: 1rem;
|
|
3141
3130
|
padding-right: 1rem;
|
|
@@ -3150,6 +3139,10 @@ select {
|
|
|
3150
3139
|
padding-left: 1rem;
|
|
3151
3140
|
}
|
|
3152
3141
|
|
|
3142
|
+
.sm\:pr-28 {
|
|
3143
|
+
padding-right: 7rem;
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3153
3146
|
.sm\:pt-10 {
|
|
3154
3147
|
padding-top: 2.5rem;
|
|
3155
3148
|
}
|
|
@@ -3172,6 +3165,10 @@ select {
|
|
|
3172
3165
|
|
|
3173
3166
|
@media (min-width: 768px) {
|
|
3174
3167
|
|
|
3168
|
+
.md\:-right-28 {
|
|
3169
|
+
right: -7rem;
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3175
3172
|
.md\:right-\[120px\] {
|
|
3176
3173
|
right: 120px;
|
|
3177
3174
|
}
|
|
@@ -3278,6 +3275,10 @@ select {
|
|
|
3278
3275
|
padding-left: 1.5rem;
|
|
3279
3276
|
}
|
|
3280
3277
|
|
|
3278
|
+
.md\:pr-0 {
|
|
3279
|
+
padding-right: 0px;
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3281
3282
|
.md\:pt-12 {
|
|
3282
3283
|
padding-top: 3rem;
|
|
3283
3284
|
}
|
|
@@ -3312,10 +3313,18 @@ select {
|
|
|
3312
3313
|
|
|
3313
3314
|
@media (min-width: 1024px) {
|
|
3314
3315
|
|
|
3316
|
+
.lg\:right-4 {
|
|
3317
|
+
right: 1rem;
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3315
3320
|
.lg\:-mt-12 {
|
|
3316
3321
|
margin-top: -3rem;
|
|
3317
3322
|
}
|
|
3318
3323
|
|
|
3324
|
+
.lg\:mb-10 {
|
|
3325
|
+
margin-bottom: 2.5rem;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3319
3328
|
.lg\:mt-\[218px\] {
|
|
3320
3329
|
margin-top: 218px;
|
|
3321
3330
|
}
|
|
@@ -3422,6 +3431,14 @@ select {
|
|
|
3422
3431
|
border-bottom-left-radius: 48px;
|
|
3423
3432
|
}
|
|
3424
3433
|
|
|
3434
|
+
.lg\:rounded-br-\[48px\] {
|
|
3435
|
+
border-bottom-right-radius: 48px;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
.lg\:rounded-tl-\[48px\] {
|
|
3439
|
+
border-top-left-radius: 48px;
|
|
3440
|
+
}
|
|
3441
|
+
|
|
3425
3442
|
.lg\:p-16 {
|
|
3426
3443
|
padding: 4rem;
|
|
3427
3444
|
}
|
|
@@ -3452,6 +3469,10 @@ select {
|
|
|
3452
3469
|
padding-right: 4rem;
|
|
3453
3470
|
}
|
|
3454
3471
|
|
|
3472
|
+
.lg\:pt-10 {
|
|
3473
|
+
padding-top: 2.5rem;
|
|
3474
|
+
}
|
|
3475
|
+
|
|
3455
3476
|
.lg\:pt-\[164px\] {
|
|
3456
3477
|
padding-top: 164px;
|
|
3457
3478
|
}
|
|
@@ -3519,11 +3540,6 @@ select {
|
|
|
3519
3540
|
|
|
3520
3541
|
@media (min-width: 1440px) {
|
|
3521
3542
|
|
|
3522
|
-
.\31xl\:mx-0 {
|
|
3523
|
-
margin-left: 0px;
|
|
3524
|
-
margin-right: 0px;
|
|
3525
|
-
}
|
|
3526
|
-
|
|
3527
3543
|
.\31xl\:max-w-\[1872px\] {
|
|
3528
3544
|
max-width: 1872px;
|
|
3529
3545
|
}
|
package/dist/page-builder.es.js
CHANGED
|
@@ -46573,17 +46573,17 @@ function getScaleMultipliers(transformElements) {
|
|
|
46573
46573
|
});
|
|
46574
46574
|
return { widthMultiplier, heightMultiplier };
|
|
46575
46575
|
}
|
|
46576
|
-
function getSnapAlignOffsetByItemsToShow(align,
|
|
46576
|
+
function getSnapAlignOffsetByItemsToShow(align, itemsToShow) {
|
|
46577
46577
|
switch (align) {
|
|
46578
46578
|
case "start":
|
|
46579
46579
|
return 0;
|
|
46580
46580
|
case "center":
|
|
46581
46581
|
case "center-odd":
|
|
46582
|
-
return (
|
|
46582
|
+
return (itemsToShow - 1) / 2;
|
|
46583
46583
|
case "center-even":
|
|
46584
|
-
return (
|
|
46584
|
+
return (itemsToShow - 2) / 2;
|
|
46585
46585
|
case "end":
|
|
46586
|
-
return
|
|
46586
|
+
return itemsToShow - 1;
|
|
46587
46587
|
default:
|
|
46588
46588
|
return 0;
|
|
46589
46589
|
}
|
|
@@ -46603,9 +46603,9 @@ function getSnapAlignOffsetBySlideAndViewport(align, slideSize, viewportSize) {
|
|
|
46603
46603
|
return 0;
|
|
46604
46604
|
}
|
|
46605
46605
|
}
|
|
46606
|
-
function getSnapAlignOffset({ slideSize, viewportSize, align, itemsToShow
|
|
46607
|
-
if (
|
|
46608
|
-
return getSnapAlignOffsetByItemsToShow(align,
|
|
46606
|
+
function getSnapAlignOffset({ slideSize, viewportSize, align, itemsToShow }) {
|
|
46607
|
+
if (itemsToShow !== void 0) {
|
|
46608
|
+
return getSnapAlignOffsetByItemsToShow(align, itemsToShow);
|
|
46609
46609
|
}
|
|
46610
46610
|
if (slideSize !== void 0 && viewportSize !== void 0) {
|
|
46611
46611
|
return getSnapAlignOffsetBySlideAndViewport(align, slideSize, viewportSize);
|
|
@@ -47031,9 +47031,9 @@ const Carousel = defineComponent({
|
|
|
47031
47031
|
if (isAuto.value) {
|
|
47032
47032
|
slideSize.value = calculateAverage(slidesRect.value.map((slide) => slide[dimension.value]));
|
|
47033
47033
|
} else {
|
|
47034
|
-
const
|
|
47035
|
-
const totalGap = (
|
|
47036
|
-
slideSize.value = (viewportRect.value[dimension.value] - totalGap) /
|
|
47034
|
+
const itemsToShow = Number(config2.itemsToShow);
|
|
47035
|
+
const totalGap = (itemsToShow - 1) * config2.gap;
|
|
47036
|
+
slideSize.value = (viewportRect.value[dimension.value] - totalGap) / itemsToShow;
|
|
47037
47037
|
}
|
|
47038
47038
|
}
|
|
47039
47039
|
function updateSlidesData() {
|
|
@@ -47315,8 +47315,8 @@ const Carousel = defineComponent({
|
|
|
47315
47315
|
if (isAuto.value) {
|
|
47316
47316
|
return { before: slides.length, after: slides.length };
|
|
47317
47317
|
}
|
|
47318
|
-
const
|
|
47319
|
-
const slidesToClone = Math.ceil(
|
|
47318
|
+
const itemsToShow = Number(config2.itemsToShow);
|
|
47319
|
+
const slidesToClone = Math.ceil(itemsToShow + (config2.itemsToScroll - 1));
|
|
47320
47320
|
const before = slidesToClone - activeSlideIndex.value;
|
|
47321
47321
|
const after = slidesToClone - (slidesCount.value - (activeSlideIndex.value + 1));
|
|
47322
47322
|
return {
|
|
@@ -47678,14 +47678,14 @@ defineComponent({
|
|
|
47678
47678
|
},
|
|
47679
47679
|
setup(props) {
|
|
47680
47680
|
let carousel = inject(injectCarousel, null);
|
|
47681
|
-
const
|
|
47681
|
+
const itemsToShow = computed(() => carousel.config.itemsToShow);
|
|
47682
47682
|
const offset = computed(() => getSnapAlignOffset({
|
|
47683
47683
|
align: carousel.config.snapAlign,
|
|
47684
|
-
itemsToShow:
|
|
47684
|
+
itemsToShow: itemsToShow.value
|
|
47685
47685
|
}));
|
|
47686
|
-
const isPaginated = computed(() => props.paginateByItemsToShow &&
|
|
47687
|
-
const currentPage = computed(() => Math.ceil((carousel.activeSlide - offset.value) /
|
|
47688
|
-
const pageCount = computed(() => Math.ceil(carousel.slidesCount /
|
|
47686
|
+
const isPaginated = computed(() => props.paginateByItemsToShow && itemsToShow.value > 1);
|
|
47687
|
+
const currentPage = computed(() => Math.ceil((carousel.activeSlide - offset.value) / itemsToShow.value));
|
|
47688
|
+
const pageCount = computed(() => Math.ceil(carousel.slidesCount / itemsToShow.value));
|
|
47689
47689
|
const isActive = (slide) => mapNumberToRange(isPaginated.value ? {
|
|
47690
47690
|
val: currentPage.value,
|
|
47691
47691
|
max: pageCount.value - 1,
|
|
@@ -47774,8 +47774,8 @@ const Slide = defineComponent({
|
|
|
47774
47774
|
if (carousel.config.itemsToShow === "auto") {
|
|
47775
47775
|
return;
|
|
47776
47776
|
}
|
|
47777
|
-
const
|
|
47778
|
-
const dimension = carousel.config.gap > 0 &&
|
|
47777
|
+
const itemsToShow = carousel.config.itemsToShow;
|
|
47778
|
+
const dimension = carousel.config.gap > 0 && itemsToShow > 1 ? `calc(${100 / itemsToShow}% - ${carousel.config.gap * (itemsToShow - 1) / itemsToShow}px)` : `${100 / itemsToShow}%`;
|
|
47779
47779
|
return carousel.isVertical ? { height: dimension } : { width: dimension };
|
|
47780
47780
|
});
|
|
47781
47781
|
carousel.slideRegistry.registerSlide(instance, props.index);
|
|
@@ -48014,7 +48014,7 @@ const _sfc_main$p = {
|
|
|
48014
48014
|
return (_ctx, _cache) => {
|
|
48015
48015
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
48016
48016
|
return openBlock(), createElementBlock("div", {
|
|
48017
|
-
class: normalizeClass(["flex flex-col gap-4
|
|
48017
|
+
class: normalizeClass(["flex flex-col gap-4", { "items-center": (_a = component.value) == null ? void 0 : _a.center }])
|
|
48018
48018
|
}, [
|
|
48019
48019
|
((_b = component.value) == null ? void 0 : _b.title) ? (openBlock(), createElementBlock("p", {
|
|
48020
48020
|
key: 0,
|
|
@@ -48454,13 +48454,12 @@ const _hoisted_10$a = {
|
|
|
48454
48454
|
const _hoisted_11$9 = ["innerHTML"];
|
|
48455
48455
|
const _hoisted_12$7 = { class: "border-t border-gray-200 mt-4 pt-[17px] flex justify-between items-center" };
|
|
48456
48456
|
const _hoisted_13$7 = ["href"];
|
|
48457
|
-
const _hoisted_14$6 = { class: "absolute top-[-65px] right-4 flex gap-4" };
|
|
48457
|
+
const _hoisted_14$6 = { class: "absolute max-sm:bottom-0 sm:top-[-65px] right-0 md:-right-28 lg:right-4 flex gap-4" };
|
|
48458
48458
|
const _hoisted_15$4 = {
|
|
48459
48459
|
key: 0,
|
|
48460
|
-
class: "flex justify-center mb-
|
|
48460
|
+
class: "flex sm:justify-center mb-6 lg:mb-10"
|
|
48461
48461
|
};
|
|
48462
48462
|
const _hoisted_16$2 = ["href", "target"];
|
|
48463
|
-
const itemsToShow = 4;
|
|
48464
48463
|
const _sfc_main$j = {
|
|
48465
48464
|
__name: "CarouselPresenter",
|
|
48466
48465
|
props: {
|
|
@@ -48478,20 +48477,30 @@ const _sfc_main$j = {
|
|
|
48478
48477
|
const VCarouselPrimaryButton = inject("VCarouselPrimaryButton", _sfc_main$k);
|
|
48479
48478
|
const props = __props;
|
|
48480
48479
|
const currentSlide = ref(0);
|
|
48480
|
+
const itemsToShow = ref(4);
|
|
48481
48481
|
const slides = [...((_a = props.component.content) == null ? void 0 : _a.items) || []];
|
|
48482
48482
|
const windowWidth = ref(480);
|
|
48483
|
+
const slideWidth = ref(480);
|
|
48483
48484
|
onMounted(() => {
|
|
48484
48485
|
windowWidth.value = window.innerWidth;
|
|
48486
|
+
adjustSlides();
|
|
48485
48487
|
window.addEventListener("resize", updateWidth);
|
|
48486
48488
|
});
|
|
48487
48489
|
onUnmounted(() => {
|
|
48488
48490
|
window.removeEventListener("resize", updateWidth);
|
|
48489
48491
|
});
|
|
48492
|
+
const activeRightButton = computed(() => {
|
|
48493
|
+
return currentSlide.value <= slides.length - itemsToShow.value;
|
|
48494
|
+
});
|
|
48495
|
+
const activeLeftButton = computed(() => {
|
|
48496
|
+
return currentSlide.value !== 0;
|
|
48497
|
+
});
|
|
48490
48498
|
const updateWidth = () => {
|
|
48491
48499
|
windowWidth.value = window.innerWidth;
|
|
48500
|
+
adjustSlides();
|
|
48492
48501
|
};
|
|
48493
48502
|
const nextSlide = () => {
|
|
48494
|
-
if (currentSlide.value <= slides.length - itemsToShow) {
|
|
48503
|
+
if (currentSlide.value <= slides.length - itemsToShow.value) {
|
|
48495
48504
|
currentSlide.value++;
|
|
48496
48505
|
}
|
|
48497
48506
|
};
|
|
@@ -48500,12 +48509,22 @@ const _sfc_main$j = {
|
|
|
48500
48509
|
currentSlide.value--;
|
|
48501
48510
|
}
|
|
48502
48511
|
};
|
|
48512
|
+
const adjustSlides = () => {
|
|
48513
|
+
if (windowWidth.value < 512) {
|
|
48514
|
+
itemsToShow.value = 2;
|
|
48515
|
+
slideWidth.value = windowWidth.value - 32;
|
|
48516
|
+
} else if (windowWidth.value < 1120) {
|
|
48517
|
+
itemsToShow.value = 2;
|
|
48518
|
+
} else if (windowWidth.value < 1630) {
|
|
48519
|
+
itemsToShow.value = 3;
|
|
48520
|
+
}
|
|
48521
|
+
};
|
|
48503
48522
|
return (_ctx, _cache) => {
|
|
48504
48523
|
var _a2;
|
|
48505
48524
|
return openBlock(), createElementBlock("div", _hoisted_1$y, [
|
|
48506
48525
|
createElementVNode("div", {
|
|
48507
48526
|
class: "slider-wrapper flex transition-transform duration-500 gap-0 mb-6",
|
|
48508
|
-
style: normalizeStyle({ transform: `translateX(-${currentSlide.value * ((windowWidth.value >=
|
|
48527
|
+
style: normalizeStyle({ transform: `translateX(-${currentSlide.value * ((windowWidth.value >= slideWidth.value ? slideWidth.value : windowWidth.value) + 24)}px)` })
|
|
48509
48528
|
}, [
|
|
48510
48529
|
(openBlock(), createElementBlock(Fragment, null, renderList(slides, (slide, index) => {
|
|
48511
48530
|
return createElementVNode("div", {
|
|
@@ -48575,16 +48594,16 @@ const _sfc_main$j = {
|
|
|
48575
48594
|
createElementVNode("div", _hoisted_14$6, [
|
|
48576
48595
|
createElementVNode("button", {
|
|
48577
48596
|
onClick: prevSlide,
|
|
48578
|
-
class: "p-2.5 bg-white text-navy-800 rounded-full
|
|
48597
|
+
class: normalizeClass(["p-2.5 bg-white text-navy-800 rounded-full opacity-100", { "opacity-50 pointer-events-none": !activeLeftButton.value }])
|
|
48579
48598
|
}, [
|
|
48580
48599
|
createVNode(unref(ChevronLeft), { class: "w-6 h-6" })
|
|
48581
|
-
]),
|
|
48600
|
+
], 2),
|
|
48582
48601
|
createElementVNode("button", {
|
|
48583
48602
|
onClick: nextSlide,
|
|
48584
|
-
class: "p-2.5 bg-white text-navy-800 rounded-full
|
|
48603
|
+
class: normalizeClass(["p-2.5 bg-white text-navy-800 rounded-full opacity-100", { "opacity-50 pointer-events-auto": !activeRightButton.value }])
|
|
48585
48604
|
}, [
|
|
48586
48605
|
createVNode(unref(ChevronRight), { class: "w-6 h-6" })
|
|
48587
|
-
])
|
|
48606
|
+
], 2)
|
|
48588
48607
|
]),
|
|
48589
48608
|
((_a2 = __props.component) == null ? void 0 : _a2.button) ? (openBlock(), createElementBlock("div", _hoisted_15$4, [
|
|
48590
48609
|
createElementVNode("a", {
|
|
@@ -48601,7 +48620,7 @@ const _sfc_main$j = {
|
|
|
48601
48620
|
}
|
|
48602
48621
|
};
|
|
48603
48622
|
const _hoisted_1$x = { class: "pb-container" };
|
|
48604
|
-
const _hoisted_2$g = { class: "
|
|
48623
|
+
const _hoisted_2$g = { class: "rounded-3xl lg:rounded-[48px] pt-6 lg:pt-10 sm:pr-28 md:pr-0" };
|
|
48605
48624
|
const _sfc_main$i = {
|
|
48606
48625
|
__name: "CollectionCarousel",
|
|
48607
48626
|
props: {
|
|
@@ -48622,7 +48641,7 @@ const _sfc_main$i = {
|
|
|
48622
48641
|
return (_ctx, _cache) => {
|
|
48623
48642
|
var _a, _b, _c, _d;
|
|
48624
48643
|
return openBlock(), createElementBlock("div", {
|
|
48625
|
-
class: normalizeClass(["overflow-hidden", { "rounded-br-[48px] rounded-tl-[48px] bg-aqua-100": (_a = section.value) == null ? void 0 : _a.has_background }])
|
|
48644
|
+
class: normalizeClass(["overflow-hidden", { "rounded-br-3xl lg:rounded-br-[48px] rounded-tl-3xl lg:rounded-tl-[48px] bg-aqua-100": (_a = section.value) == null ? void 0 : _a.has_background }])
|
|
48626
48645
|
}, [
|
|
48627
48646
|
createElementVNode("div", _hoisted_1$x, [
|
|
48628
48647
|
createElementVNode("div", _hoisted_2$g, [
|
package/dist/page-builder.umd.js
CHANGED
|
@@ -46576,17 +46576,17 @@ ${escapeText(this.code(index, length))}
|
|
|
46576
46576
|
});
|
|
46577
46577
|
return { widthMultiplier, heightMultiplier };
|
|
46578
46578
|
}
|
|
46579
|
-
function getSnapAlignOffsetByItemsToShow(align,
|
|
46579
|
+
function getSnapAlignOffsetByItemsToShow(align, itemsToShow) {
|
|
46580
46580
|
switch (align) {
|
|
46581
46581
|
case "start":
|
|
46582
46582
|
return 0;
|
|
46583
46583
|
case "center":
|
|
46584
46584
|
case "center-odd":
|
|
46585
|
-
return (
|
|
46585
|
+
return (itemsToShow - 1) / 2;
|
|
46586
46586
|
case "center-even":
|
|
46587
|
-
return (
|
|
46587
|
+
return (itemsToShow - 2) / 2;
|
|
46588
46588
|
case "end":
|
|
46589
|
-
return
|
|
46589
|
+
return itemsToShow - 1;
|
|
46590
46590
|
default:
|
|
46591
46591
|
return 0;
|
|
46592
46592
|
}
|
|
@@ -46606,9 +46606,9 @@ ${escapeText(this.code(index, length))}
|
|
|
46606
46606
|
return 0;
|
|
46607
46607
|
}
|
|
46608
46608
|
}
|
|
46609
|
-
function getSnapAlignOffset({ slideSize, viewportSize, align, itemsToShow
|
|
46610
|
-
if (
|
|
46611
|
-
return getSnapAlignOffsetByItemsToShow(align,
|
|
46609
|
+
function getSnapAlignOffset({ slideSize, viewportSize, align, itemsToShow }) {
|
|
46610
|
+
if (itemsToShow !== void 0) {
|
|
46611
|
+
return getSnapAlignOffsetByItemsToShow(align, itemsToShow);
|
|
46612
46612
|
}
|
|
46613
46613
|
if (slideSize !== void 0 && viewportSize !== void 0) {
|
|
46614
46614
|
return getSnapAlignOffsetBySlideAndViewport(align, slideSize, viewportSize);
|
|
@@ -47034,9 +47034,9 @@ ${escapeText(this.code(index, length))}
|
|
|
47034
47034
|
if (isAuto.value) {
|
|
47035
47035
|
slideSize.value = calculateAverage(slidesRect.value.map((slide) => slide[dimension.value]));
|
|
47036
47036
|
} else {
|
|
47037
|
-
const
|
|
47038
|
-
const totalGap = (
|
|
47039
|
-
slideSize.value = (viewportRect.value[dimension.value] - totalGap) /
|
|
47037
|
+
const itemsToShow = Number(config2.itemsToShow);
|
|
47038
|
+
const totalGap = (itemsToShow - 1) * config2.gap;
|
|
47039
|
+
slideSize.value = (viewportRect.value[dimension.value] - totalGap) / itemsToShow;
|
|
47040
47040
|
}
|
|
47041
47041
|
}
|
|
47042
47042
|
function updateSlidesData() {
|
|
@@ -47318,8 +47318,8 @@ ${escapeText(this.code(index, length))}
|
|
|
47318
47318
|
if (isAuto.value) {
|
|
47319
47319
|
return { before: slides.length, after: slides.length };
|
|
47320
47320
|
}
|
|
47321
|
-
const
|
|
47322
|
-
const slidesToClone = Math.ceil(
|
|
47321
|
+
const itemsToShow = Number(config2.itemsToShow);
|
|
47322
|
+
const slidesToClone = Math.ceil(itemsToShow + (config2.itemsToScroll - 1));
|
|
47323
47323
|
const before = slidesToClone - activeSlideIndex.value;
|
|
47324
47324
|
const after = slidesToClone - (slidesCount.value - (activeSlideIndex.value + 1));
|
|
47325
47325
|
return {
|
|
@@ -47681,14 +47681,14 @@ ${escapeText(this.code(index, length))}
|
|
|
47681
47681
|
},
|
|
47682
47682
|
setup(props) {
|
|
47683
47683
|
let carousel = vue.inject(injectCarousel, null);
|
|
47684
|
-
const
|
|
47684
|
+
const itemsToShow = vue.computed(() => carousel.config.itemsToShow);
|
|
47685
47685
|
const offset = vue.computed(() => getSnapAlignOffset({
|
|
47686
47686
|
align: carousel.config.snapAlign,
|
|
47687
|
-
itemsToShow:
|
|
47687
|
+
itemsToShow: itemsToShow.value
|
|
47688
47688
|
}));
|
|
47689
|
-
const isPaginated = vue.computed(() => props.paginateByItemsToShow &&
|
|
47690
|
-
const currentPage = vue.computed(() => Math.ceil((carousel.activeSlide - offset.value) /
|
|
47691
|
-
const pageCount = vue.computed(() => Math.ceil(carousel.slidesCount /
|
|
47689
|
+
const isPaginated = vue.computed(() => props.paginateByItemsToShow && itemsToShow.value > 1);
|
|
47690
|
+
const currentPage = vue.computed(() => Math.ceil((carousel.activeSlide - offset.value) / itemsToShow.value));
|
|
47691
|
+
const pageCount = vue.computed(() => Math.ceil(carousel.slidesCount / itemsToShow.value));
|
|
47692
47692
|
const isActive = (slide) => mapNumberToRange(isPaginated.value ? {
|
|
47693
47693
|
val: currentPage.value,
|
|
47694
47694
|
max: pageCount.value - 1,
|
|
@@ -47777,8 +47777,8 @@ ${escapeText(this.code(index, length))}
|
|
|
47777
47777
|
if (carousel.config.itemsToShow === "auto") {
|
|
47778
47778
|
return;
|
|
47779
47779
|
}
|
|
47780
|
-
const
|
|
47781
|
-
const dimension = carousel.config.gap > 0 &&
|
|
47780
|
+
const itemsToShow = carousel.config.itemsToShow;
|
|
47781
|
+
const dimension = carousel.config.gap > 0 && itemsToShow > 1 ? `calc(${100 / itemsToShow}% - ${carousel.config.gap * (itemsToShow - 1) / itemsToShow}px)` : `${100 / itemsToShow}%`;
|
|
47782
47782
|
return carousel.isVertical ? { height: dimension } : { width: dimension };
|
|
47783
47783
|
});
|
|
47784
47784
|
carousel.slideRegistry.registerSlide(instance, props.index);
|
|
@@ -48017,7 +48017,7 @@ ${escapeText(this.code(index, length))}
|
|
|
48017
48017
|
return (_ctx, _cache) => {
|
|
48018
48018
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
48019
48019
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
48020
|
-
class: vue.normalizeClass(["flex flex-col gap-4
|
|
48020
|
+
class: vue.normalizeClass(["flex flex-col gap-4", { "items-center": (_a = component.value) == null ? void 0 : _a.center }])
|
|
48021
48021
|
}, [
|
|
48022
48022
|
((_b = component.value) == null ? void 0 : _b.title) ? (vue.openBlock(), vue.createElementBlock("p", {
|
|
48023
48023
|
key: 0,
|
|
@@ -48457,13 +48457,12 @@ ${escapeText(this.code(index, length))}
|
|
|
48457
48457
|
const _hoisted_11$9 = ["innerHTML"];
|
|
48458
48458
|
const _hoisted_12$7 = { class: "border-t border-gray-200 mt-4 pt-[17px] flex justify-between items-center" };
|
|
48459
48459
|
const _hoisted_13$7 = ["href"];
|
|
48460
|
-
const _hoisted_14$6 = { class: "absolute top-[-65px] right-4 flex gap-4" };
|
|
48460
|
+
const _hoisted_14$6 = { class: "absolute max-sm:bottom-0 sm:top-[-65px] right-0 md:-right-28 lg:right-4 flex gap-4" };
|
|
48461
48461
|
const _hoisted_15$4 = {
|
|
48462
48462
|
key: 0,
|
|
48463
|
-
class: "flex justify-center mb-
|
|
48463
|
+
class: "flex sm:justify-center mb-6 lg:mb-10"
|
|
48464
48464
|
};
|
|
48465
48465
|
const _hoisted_16$2 = ["href", "target"];
|
|
48466
|
-
const itemsToShow = 4;
|
|
48467
48466
|
const _sfc_main$j = {
|
|
48468
48467
|
__name: "CarouselPresenter",
|
|
48469
48468
|
props: {
|
|
@@ -48481,20 +48480,30 @@ ${escapeText(this.code(index, length))}
|
|
|
48481
48480
|
const VCarouselPrimaryButton = vue.inject("VCarouselPrimaryButton", _sfc_main$k);
|
|
48482
48481
|
const props = __props;
|
|
48483
48482
|
const currentSlide = vue.ref(0);
|
|
48483
|
+
const itemsToShow = vue.ref(4);
|
|
48484
48484
|
const slides = [...((_a = props.component.content) == null ? void 0 : _a.items) || []];
|
|
48485
48485
|
const windowWidth = vue.ref(480);
|
|
48486
|
+
const slideWidth = vue.ref(480);
|
|
48486
48487
|
vue.onMounted(() => {
|
|
48487
48488
|
windowWidth.value = window.innerWidth;
|
|
48489
|
+
adjustSlides();
|
|
48488
48490
|
window.addEventListener("resize", updateWidth);
|
|
48489
48491
|
});
|
|
48490
48492
|
vue.onUnmounted(() => {
|
|
48491
48493
|
window.removeEventListener("resize", updateWidth);
|
|
48492
48494
|
});
|
|
48495
|
+
const activeRightButton = vue.computed(() => {
|
|
48496
|
+
return currentSlide.value <= slides.length - itemsToShow.value;
|
|
48497
|
+
});
|
|
48498
|
+
const activeLeftButton = vue.computed(() => {
|
|
48499
|
+
return currentSlide.value !== 0;
|
|
48500
|
+
});
|
|
48493
48501
|
const updateWidth = () => {
|
|
48494
48502
|
windowWidth.value = window.innerWidth;
|
|
48503
|
+
adjustSlides();
|
|
48495
48504
|
};
|
|
48496
48505
|
const nextSlide = () => {
|
|
48497
|
-
if (currentSlide.value <= slides.length - itemsToShow) {
|
|
48506
|
+
if (currentSlide.value <= slides.length - itemsToShow.value) {
|
|
48498
48507
|
currentSlide.value++;
|
|
48499
48508
|
}
|
|
48500
48509
|
};
|
|
@@ -48503,12 +48512,22 @@ ${escapeText(this.code(index, length))}
|
|
|
48503
48512
|
currentSlide.value--;
|
|
48504
48513
|
}
|
|
48505
48514
|
};
|
|
48515
|
+
const adjustSlides = () => {
|
|
48516
|
+
if (windowWidth.value < 512) {
|
|
48517
|
+
itemsToShow.value = 2;
|
|
48518
|
+
slideWidth.value = windowWidth.value - 32;
|
|
48519
|
+
} else if (windowWidth.value < 1120) {
|
|
48520
|
+
itemsToShow.value = 2;
|
|
48521
|
+
} else if (windowWidth.value < 1630) {
|
|
48522
|
+
itemsToShow.value = 3;
|
|
48523
|
+
}
|
|
48524
|
+
};
|
|
48506
48525
|
return (_ctx, _cache) => {
|
|
48507
48526
|
var _a2;
|
|
48508
48527
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$y, [
|
|
48509
48528
|
vue.createElementVNode("div", {
|
|
48510
48529
|
class: "slider-wrapper flex transition-transform duration-500 gap-0 mb-6",
|
|
48511
|
-
style: vue.normalizeStyle({ transform: `translateX(-${currentSlide.value * ((windowWidth.value >=
|
|
48530
|
+
style: vue.normalizeStyle({ transform: `translateX(-${currentSlide.value * ((windowWidth.value >= slideWidth.value ? slideWidth.value : windowWidth.value) + 24)}px)` })
|
|
48512
48531
|
}, [
|
|
48513
48532
|
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(slides, (slide, index) => {
|
|
48514
48533
|
return vue.createElementVNode("div", {
|
|
@@ -48578,16 +48597,16 @@ ${escapeText(this.code(index, length))}
|
|
|
48578
48597
|
vue.createElementVNode("div", _hoisted_14$6, [
|
|
48579
48598
|
vue.createElementVNode("button", {
|
|
48580
48599
|
onClick: prevSlide,
|
|
48581
|
-
class: "p-2.5 bg-white text-navy-800 rounded-full
|
|
48600
|
+
class: vue.normalizeClass(["p-2.5 bg-white text-navy-800 rounded-full opacity-100", { "opacity-50 pointer-events-none": !activeLeftButton.value }])
|
|
48582
48601
|
}, [
|
|
48583
48602
|
vue.createVNode(vue.unref(ChevronLeft), { class: "w-6 h-6" })
|
|
48584
|
-
]),
|
|
48603
|
+
], 2),
|
|
48585
48604
|
vue.createElementVNode("button", {
|
|
48586
48605
|
onClick: nextSlide,
|
|
48587
|
-
class: "p-2.5 bg-white text-navy-800 rounded-full
|
|
48606
|
+
class: vue.normalizeClass(["p-2.5 bg-white text-navy-800 rounded-full opacity-100", { "opacity-50 pointer-events-auto": !activeRightButton.value }])
|
|
48588
48607
|
}, [
|
|
48589
48608
|
vue.createVNode(vue.unref(ChevronRight), { class: "w-6 h-6" })
|
|
48590
|
-
])
|
|
48609
|
+
], 2)
|
|
48591
48610
|
]),
|
|
48592
48611
|
((_a2 = __props.component) == null ? void 0 : _a2.button) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15$4, [
|
|
48593
48612
|
vue.createElementVNode("a", {
|
|
@@ -48604,7 +48623,7 @@ ${escapeText(this.code(index, length))}
|
|
|
48604
48623
|
}
|
|
48605
48624
|
};
|
|
48606
48625
|
const _hoisted_1$x = { class: "pb-container" };
|
|
48607
|
-
const _hoisted_2$g = { class: "
|
|
48626
|
+
const _hoisted_2$g = { class: "rounded-3xl lg:rounded-[48px] pt-6 lg:pt-10 sm:pr-28 md:pr-0" };
|
|
48608
48627
|
const _sfc_main$i = {
|
|
48609
48628
|
__name: "CollectionCarousel",
|
|
48610
48629
|
props: {
|
|
@@ -48625,7 +48644,7 @@ ${escapeText(this.code(index, length))}
|
|
|
48625
48644
|
return (_ctx, _cache) => {
|
|
48626
48645
|
var _a, _b, _c, _d;
|
|
48627
48646
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
48628
|
-
class: vue.normalizeClass(["overflow-hidden", { "rounded-br-[48px] rounded-tl-[48px] bg-aqua-100": (_a = section.value) == null ? void 0 : _a.has_background }])
|
|
48647
|
+
class: vue.normalizeClass(["overflow-hidden", { "rounded-br-3xl lg:rounded-br-[48px] rounded-tl-3xl lg:rounded-tl-[48px] bg-aqua-100": (_a = section.value) == null ? void 0 : _a.has_background }])
|
|
48629
48648
|
}, [
|
|
48630
48649
|
vue.createElementVNode("div", _hoisted_1$x, [
|
|
48631
48650
|
vue.createElementVNode("div", _hoisted_2$g, [
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!-- Slider Wrapper -->
|
|
4
4
|
<div
|
|
5
5
|
class="slider-wrapper flex transition-transform duration-500 gap-0 mb-6"
|
|
6
|
-
:style="{ transform: `translateX(-${currentSlide * ((windowWidth >=
|
|
6
|
+
:style="{ transform: `translateX(-${currentSlide * ((windowWidth >= slideWidth ? slideWidth : windowWidth) + 24)}px)` }"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
v-for="(slide, index) in slides"
|
|
@@ -64,21 +64,23 @@
|
|
|
64
64
|
</div>
|
|
65
65
|
|
|
66
66
|
<!-- Control Buttons -->
|
|
67
|
-
<div class="absolute top-[-65px] right-4 flex gap-4">
|
|
67
|
+
<div class="absolute max-sm:bottom-0 sm:top-[-65px] right-0 md:-right-28 lg:right-4 flex gap-4">
|
|
68
68
|
<button
|
|
69
69
|
@click="prevSlide"
|
|
70
|
-
class="p-2.5 bg-white text-navy-800 rounded-full
|
|
70
|
+
class="p-2.5 bg-white text-navy-800 rounded-full opacity-100"
|
|
71
|
+
:class="{'opacity-50 pointer-events-none': !activeLeftButton}"
|
|
71
72
|
>
|
|
72
73
|
<ChevronLeft class="w-6 h-6" />
|
|
73
74
|
</button>
|
|
74
75
|
<button
|
|
75
76
|
@click="nextSlide"
|
|
76
|
-
class="p-2.5 bg-white text-navy-800 rounded-full
|
|
77
|
+
class="p-2.5 bg-white text-navy-800 rounded-full opacity-100"
|
|
78
|
+
:class="{'opacity-50 pointer-events-auto': !activeRightButton}"
|
|
77
79
|
>
|
|
78
80
|
<ChevronRight class="w-6 h-6" />
|
|
79
81
|
</button>
|
|
80
82
|
</div>
|
|
81
|
-
<div v-if="component?.button" class="flex justify-center mb-
|
|
83
|
+
<div v-if="component?.button" class="flex sm:justify-center mb-6 lg:mb-10">
|
|
82
84
|
<a
|
|
83
85
|
class="border-brand-300 hover:border-brand-700 border text-brand-700 h-[44px] rounded-full px-[14px] py-[10px] inline-flex gap-1.5 items-center font-semibold text-base"
|
|
84
86
|
:href="formatUrl(component.button.url)"
|
|
@@ -91,7 +93,7 @@
|
|
|
91
93
|
</template>
|
|
92
94
|
|
|
93
95
|
<script setup>
|
|
94
|
-
import { ref, inject, onMounted, onUnmounted } from 'vue'
|
|
96
|
+
import { ref, inject, onMounted, onUnmounted, computed } from 'vue';
|
|
95
97
|
import Clock from "@/assets/img/icons/clock.svg";
|
|
96
98
|
import ChevronRight from "@/assets/img/icons/chevron-right.svg";
|
|
97
99
|
import ChevronLeft from "@/assets/img/icons/chevron-left.svg";
|
|
@@ -115,12 +117,14 @@ const props = defineProps({
|
|
|
115
117
|
});
|
|
116
118
|
|
|
117
119
|
const currentSlide = ref(0); // Start at 0
|
|
118
|
-
const itemsToShow = 4; // Number of items to show at a time
|
|
120
|
+
const itemsToShow = ref(4); // Number of items to show at a time
|
|
119
121
|
const slides = [...props.component.content?.items || []];
|
|
120
122
|
const windowWidth = ref(480)
|
|
123
|
+
const slideWidth = ref(480)
|
|
121
124
|
|
|
122
125
|
onMounted(() => {
|
|
123
126
|
windowWidth.value = window.innerWidth
|
|
127
|
+
adjustSlides();
|
|
124
128
|
window.addEventListener('resize', updateWidth)
|
|
125
129
|
})
|
|
126
130
|
|
|
@@ -128,13 +132,22 @@ onUnmounted(() => {
|
|
|
128
132
|
window.removeEventListener('resize', updateWidth)
|
|
129
133
|
})
|
|
130
134
|
|
|
135
|
+
const activeRightButton = computed(() => {
|
|
136
|
+
return currentSlide.value <= slides.length - itemsToShow.value;
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
const activeLeftButton = computed(() => {
|
|
140
|
+
return currentSlide.value !== 0;
|
|
141
|
+
})
|
|
142
|
+
|
|
131
143
|
const updateWidth = () => {
|
|
132
|
-
windowWidth.value = window.innerWidth
|
|
144
|
+
windowWidth.value = window.innerWidth;
|
|
145
|
+
adjustSlides();
|
|
133
146
|
}
|
|
134
147
|
|
|
135
148
|
// Navigate to the next slide
|
|
136
149
|
const nextSlide = () => {
|
|
137
|
-
if (currentSlide.value <= slides.length - itemsToShow) {
|
|
150
|
+
if (currentSlide.value <= slides.length - itemsToShow.value) {
|
|
138
151
|
currentSlide.value++;
|
|
139
152
|
}
|
|
140
153
|
};
|
|
@@ -145,6 +158,17 @@ const prevSlide = () => {
|
|
|
145
158
|
currentSlide.value--;
|
|
146
159
|
}
|
|
147
160
|
};
|
|
161
|
+
|
|
162
|
+
const adjustSlides = () => {
|
|
163
|
+
if (windowWidth.value < 512) {
|
|
164
|
+
itemsToShow.value = 2;
|
|
165
|
+
slideWidth.value = windowWidth.value - 32;
|
|
166
|
+
} else if (windowWidth.value < 1120) {
|
|
167
|
+
itemsToShow.value = 2;
|
|
168
|
+
} else if (windowWidth.value < 1630) {
|
|
169
|
+
itemsToShow.value = 3;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
148
172
|
</script>
|
|
149
173
|
<style>
|
|
150
174
|
.multiline-ellipsis {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex flex-col gap-4
|
|
2
|
+
<div class="flex flex-col gap-4" :class="{'items-center': component?.center}">
|
|
3
3
|
<p
|
|
4
4
|
v-if="component?.title"
|
|
5
5
|
class="text-2xl sm:text-3xl lg:text-4xl font-semibold text-white"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="overflow-hidden" :class="{'rounded-br-[48px] rounded-tl-[48px] bg-aqua-100': section?.has_background}">
|
|
2
|
+
<div class="overflow-hidden" :class="{'rounded-br-3xl lg:rounded-br-[48px] rounded-tl-3xl lg:rounded-tl-[48px] bg-aqua-100': section?.has_background}">
|
|
3
3
|
<div class="pb-container">
|
|
4
|
-
<div class="
|
|
4
|
+
<div class="rounded-3xl lg:rounded-[48px] pt-6 lg:pt-10 sm:pr-28 md:pr-0">
|
|
5
5
|
<VHeaderPresenter :component="headerComponent" />
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|