pds-dev-kit-web-test 2.7.348 → 2.7.351

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.
@@ -93,7 +93,12 @@ function ContentsCarousel(props) {
93
93
  }), customProgressbarNormalStyle = _h.normalStyle, customProgressbarHoverStyle = _h.hoverStyle;
94
94
  var _j = (0, useSwiper_1.useSwiper)(), swiperRef = _j.swiperRef, progressRef = _j.progressRef, leftTimeMsRef = _j.leftTimeMsRef, isBeginning = _j.isBeginning, isEnd = _j.isEnd, onSwiper = _j.onSwiper, onSlideChangeTransitionEnd = _j.onSlideChangeTransitionEnd, onAutoplayTimeLeft = _j.onAutoplayTimeLeft, onClickPrevBtn = _j.onClickPrevBtn, onClickNextBtn = _j.onClickNextBtn;
95
95
  var _k = (0, react_1.useState)(false), isHovered = _k[0], setIsHovered = _k[1];
96
- var loop = isHovered ? contentsCarouselHoverStyle.loop : contentsCarouselNormalStyle.loop;
96
+ var orderedCompositions = __spreadArray([], CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS, true).filter(function (item) { return compositions.find(function (comp) { return comp.ccbManualItemUuid === item.uuid; }); })
97
+ .sort(function (a, b) { return a.order - b.order; })
98
+ .map(function (item) {
99
+ return compositions.find(function (comp) { return comp.ccbManualItemUuid === item.uuid; });
100
+ });
101
+ var loop = contentsCarouselNormalStyle.loop && orderedCompositions.length >= displayCounts;
97
102
  // NOTE: edit모드에서는 그리드의 이벤트만 작동하도록 CB의 포인터 이벤트는 막습니다.
98
103
  var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
99
104
  // NOTE: EFFECT와 관련된 함수들입니다.
@@ -150,16 +155,10 @@ function ContentsCarousel(props) {
150
155
  var isMobile = device === 'MOBILE';
151
156
  var isBgMedia = getIsBgMedia(isMobile, CB_STYLE_PROP_BGMEDIA);
152
157
  var mediaType = getMediaType(isMobile, CB_STYLE_PROP_BGMEDIA);
153
- var orderedCompositions = __spreadArray([], CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS, true).filter(function (item) { return compositions.find(function (comp) { return comp.ccbManualItemUuid === item.uuid; }); })
154
- .sort(function (a, b) { return a.order - b.order; })
155
- .map(function (item) {
156
- return compositions.find(function (comp) { return comp.ccbManualItemUuid === item.uuid; });
157
- });
158
158
  var isEditModeAndHidden = style.visibility === 'hidden' && mode === 'EDIT';
159
159
  if (mode === 'EDIT') {
160
160
  style.visibility = 'visible';
161
161
  }
162
- console.log('contentsCarouselStyle', contentsCarouselNormalStyle);
163
162
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), Object.entries(componentGroups).map(function (_a) {
164
163
  var position = _a[0], groupComponents = _a[1];
165
164
  return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-contentscarousel-button-group ccb-elements ".concat(position), ref: function (el) {
@@ -180,7 +179,7 @@ function ContentsCarousel(props) {
180
179
  display: layout.display,
181
180
  flexDirection: layout.flexDirection,
182
181
  justifyContent: layout.justifyContent
183
- } }, { children: (0, jsx_runtime_1.jsx)(ContentsCarouselCore_1.default, __assign({ ref: swiperRef, className: "cb-contentscarousel", allowTouchMove: mode !== 'EDIT' ? true : false, onSwiper: onSwiper, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onAutoplayTimeLeft: onAutoplayTimeLeft, slidesPerView: displayCounts, styles: isHovered ? contentsCarouselHoverStyle : contentsCarouselNormalStyle, effect: CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE === null || CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE === void 0 ? void 0 : CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE.toLowerCase() }, { children: (0, createCompositions_1.createCompositions)({
182
+ } }, { children: (0, jsx_runtime_1.jsx)(ContentsCarouselCore_1.default, __assign({ ref: swiperRef, className: "cb-contentscarousel", allowTouchMove: mode !== 'EDIT' ? true : false, onSwiper: onSwiper, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onAutoplayTimeLeft: onAutoplayTimeLeft, slidesPerView: displayCounts, styles: isHovered ? contentsCarouselHoverStyle : contentsCarouselNormalStyle, effect: CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE === null || CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE === void 0 ? void 0 : CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE.toLowerCase(), loop: loop, displayCounts: displayCounts }, { children: (0, createCompositions_1.createCompositions)({
184
183
  valueType: CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE,
185
184
  queryPath: CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA,
186
185
  limit: displayCounts,
@@ -5,6 +5,7 @@ import type { SwiperProps, SwiperRef } from 'swiper/react/swiper-react.js';
5
5
  export interface ContentsCarouselCoreProps extends SwiperProps {
6
6
  styles: CoreCarouselProps;
7
7
  slidesPerView?: SwiperProps['slidesPerView'];
8
+ displayCounts: number;
8
9
  children?: React.ReactNode[] | JSX.Element;
9
10
  }
10
11
  declare const ContentsCarouselCore: import("react").ForwardRefExoticComponent<ContentsCarouselCoreProps & import("react").RefAttributes<SwiperRef>>;
@@ -41,7 +41,7 @@ require("swiper/modules/navigation/navigation.min.css");
41
41
  var react_2 = require("swiper/react");
42
42
  var StyledSwiper_1 = __importDefault(require("../../../StyledSwiper/StyledSwiper"));
43
43
  var ContentsCarouselCore = (0, react_1.forwardRef)(function (_a, ref) {
44
- var styles = _a.styles, slidesPerView = _a.slidesPerView, children = _a.children, allowTouchMove = _a.allowTouchMove, props = __rest(_a, ["styles", "slidesPerView", "children", "allowTouchMove"]);
44
+ var styles = _a.styles, slidesPerView = _a.slidesPerView, children = _a.children, allowTouchMove = _a.allowTouchMove, displayCounts = _a.displayCounts, loop = _a.loop, props = __rest(_a, ["styles", "slidesPerView", "children", "allowTouchMove", "displayCounts", "loop"]);
45
45
  var childrenArray = (0, react_1.useMemo)(function () {
46
46
  return Array.isArray(children) ? children : [children];
47
47
  }, [children]);
@@ -49,10 +49,12 @@ var ContentsCarouselCore = (0, react_1.forwardRef)(function (_a, ref) {
49
49
  var originalChildren = (0, react_1.useMemo)(function () {
50
50
  return Array.isArray(children) ? children : [children];
51
51
  }, [children]);
52
+ var finalSlidesPerView = props.effect === 'cards' ? 1 : slidesPerView;
53
+ var useAutoplay = !!styles.useAutoplay && childrenArray.length > 1;
52
54
  // 2. (수정) 루프와 slidesPerView 문제를 해결하기 위한 배열
53
55
  var loopedChildren = (0, react_1.useMemo)(function () {
54
56
  // 루프가 아니거나, slidesPerView가 1이하이면 원본 반환
55
- if (!styles.loop || typeof slidesPerView !== 'number' || slidesPerView <= 1) {
57
+ if (!loop || typeof slidesPerView !== 'number' || slidesPerView <= 1) {
56
58
  return originalChildren;
57
59
  }
58
60
  // 3. (핵심) 루프가 필요한데 슬라이드 수가 (slidesPerView * 2)보다 적은 경우
@@ -63,9 +65,7 @@ var ContentsCarouselCore = (0, react_1.forwardRef)(function (_a, ref) {
63
65
  }
64
66
  // 슬라이드 수가 충분하면 원본 반환
65
67
  return originalChildren;
66
- }, [originalChildren, styles.loop, slidesPerView]);
67
- var finalSlidesPerView = props.effect === 'cards' ? 1 : slidesPerView;
68
- var useAutoplay = !!styles.useAutoplay && childrenArray.length > 1;
68
+ }, [originalChildren, loop, slidesPerView]);
69
69
  // const slidesWithEmpty = useMemo(() => {
70
70
  // const childrenArray = Array.isArray(children) ? children : [children];
71
71
  // if (
@@ -97,9 +97,7 @@ var ContentsCarouselCore = (0, react_1.forwardRef)(function (_a, ref) {
97
97
  swiper_1.EffectCards,
98
98
  swiper_1.EffectCoverflow,
99
99
  swiper_1.EffectFlip
100
- ], slidesPerView: finalSlidesPerView, scrollbar: styles.scrollbar, slidesPerGroup: styles.slidesPerGroup, spaceBetween: styles.spaceBetween, freeMode: styles.freeMode, autoplay: useAutoplay ? styles.autoplay : false, loop: styles.loop, allowTouchMove: allowTouchMove,
101
- // cnrk
102
- observer: true, observeParents: true }, props, { children: loopedChildren.map(function (slide, index) { return ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, __assign({ style: { pointerEvents: allowTouchMove ? 'auto' : 'none' } }, { children: slide || (0, jsx_runtime_1.jsx)("div", { className: "swiper-slide-empty" }) }), index)); }) })) })));
100
+ ], allowSlideNext: allowTouchMove, allowSlidePrev: allowTouchMove, slidesPerView: finalSlidesPerView, scrollbar: styles.scrollbar, slidesPerGroup: styles.slidesPerGroup, spaceBetween: styles.spaceBetween, freeMode: styles.freeMode, autoplay: useAutoplay ? styles.autoplay : false, loop: loop, allowTouchMove: allowTouchMove, observer: true, observeParents: true }, props, { children: loopedChildren.map(function (slide, index) { return ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, __assign({ style: { pointerEvents: allowTouchMove ? 'auto' : 'none' } }, { children: slide || (0, jsx_runtime_1.jsx)("div", { className: "swiper-slide-empty" }) }), index)); }) })) })));
103
101
  });
104
102
  ContentsCarouselCore.displayName = 'ContentsCarouselCore';
105
103
  exports.default = ContentsCarouselCore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.7.348",
3
+ "version": "2.7.351",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",