mp-design-system 2.0.74 → 2.0.75

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.
@@ -1124,7 +1124,16 @@
1124
1124
  const wrapper = getComputedStyle(document.documentElement).getPropertyValue("--wrapper").trim();
1125
1125
  const wrapperWidth = parseInt(wrapper);
1126
1126
  const gap = parseInt(getComputedStyle(el).getPropertyValue("--row-gap"));
1127
- const cardWidth = (wrapperWidth + "px" - (perPage - 1) * gap) / perPage;
1127
+ let cardWidth;
1128
+ if (window.innerWidth >= 1024) {
1129
+ cardWidth = (wrapperWidth - (perPage - 1) * gap) / perPage;
1130
+ } else if (window.innerWidth >= 768) {
1131
+ cardWidth = (wrapperWidth - 2 * gap) / 3;
1132
+ } else if (window.innerWidth >= 680) {
1133
+ cardWidth = (wrapperWidth - gap) / 2;
1134
+ } else {
1135
+ cardWidth = wrapperWidth;
1136
+ }
1128
1137
  el.querySelectorAll(".splide__slide").forEach((slide) => {
1129
1138
  slide.style.width = `${cardWidth}`;
1130
1139
  });
@@ -1140,6 +1149,7 @@
1140
1149
  preventClick: true,
1141
1150
  rewind,
1142
1151
  clones: 0,
1152
+ autoWidth: true,
1143
1153
  breakpoints: {
1144
1154
  768: { perPage: 3 },
1145
1155
  608: { perPage: 2 },