pds-dev-kit-web-test 2.5.351 → 2.5.353
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/src/sub/DynamicLayout/CompositionRenderer/createCompositions.js +1 -1
- package/dist/src/sub/DynamicLayout/mock_composition.js +1 -1
- package/dist/src/sub/DynamicLayout/mock_contentsCarousel.js +1 -1
- package/dist/src/sub/DynamicLayout/mock_contentsList.js +1 -1
- package/dist/src/sub/DynamicLayout/mock_slideBanner.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +18 -18
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.d.ts +5 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.js +25 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +18 -18
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.d.ts +5 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.js +25 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.js +1 -1
- package/package.json +1 -1
@@ -30,7 +30,7 @@ exports.sampleMockComposition1 = {
|
|
30
30
|
CB_CONTENT_PROP_TEXT_SPEC_TEXT: 'New Text',
|
31
31
|
CB_CONTENT_PROP_TEXT_SPEC_TEXTMOBILEALTERNATIVE: null,
|
32
32
|
CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE: 'DATA',
|
33
|
-
|
33
|
+
CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA: 'itemDesc'
|
34
34
|
},
|
35
35
|
CB_CONTENT_PROP_VISIBILITY: {
|
36
36
|
CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP: true,
|
@@ -102,7 +102,7 @@ exports.SAMPLE_CONTENTSCAROUSEL_CB = {
|
|
102
102
|
},
|
103
103
|
CB_CONTENT_PROP_CONTENTSCAROUSEL: {
|
104
104
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE: 'DATA',
|
105
|
-
|
105
|
+
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA: 'C00007/PAPPQUERY_C00007_VOD_CLASS_TOTAL',
|
106
106
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATASORTING: '최신순',
|
107
107
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_OFFSET: 1,
|
108
108
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS: [],
|
@@ -62,7 +62,7 @@ exports.SAMPLE_LIST_CB = {
|
|
62
62
|
},
|
63
63
|
CB_CONTENT_PROP_CONTENTSLIST: {
|
64
64
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_VALUETYPE: 'DATA',
|
65
|
-
CB_CONTENT_PROP_CONTENTSLIST_SPEC_CONNECTDATA: '
|
65
|
+
CB_CONTENT_PROP_CONTENTSLIST_SPEC_CONNECTDATA: 'C00007/PAPPQUERY_C00007_VOD_CLASS_TOTAL',
|
66
66
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DATASORTING: '최신순',
|
67
67
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DATAFILTER: 'NONE',
|
68
68
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_OFFSET: 0,
|
@@ -94,7 +94,7 @@ exports.SAMPLE_SLIDEBANNER_CB = {
|
|
94
94
|
},
|
95
95
|
CB_CONTENT_PROP_SLIDEBANNER: {
|
96
96
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE: 'DATA',
|
97
|
-
|
97
|
+
CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA: 'C00007/PAPPQUERY_C00007_VOD_CLASS_TOTAL',
|
98
98
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_DATASORTING: '최신순',
|
99
99
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_OFFSET: 1,
|
100
100
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_MENUALITEMS: [],
|
@@ -39,7 +39,7 @@ function ContentsCarousel(props) {
|
|
39
39
|
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode, queryData = _a.queryData;
|
40
40
|
var index = props.index,
|
41
41
|
// // CONTENT : 캐로셀
|
42
|
-
_b = props.CB_CONTENT_PROP_CONTENTSCAROUSEL, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS = _b.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE = _b.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE,
|
42
|
+
_b = props.CB_CONTENT_PROP_CONTENTSCAROUSEL, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS = _b.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE = _b.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA = _b.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA,
|
43
43
|
// STYLE: 캐로셀
|
44
44
|
CB_STYLE_PROP_CONTENTSCAROUSEL = props.CB_STYLE_PROP_CONTENTSCAROUSEL,
|
45
45
|
// STYLE: 그림자
|
@@ -52,27 +52,27 @@ function ContentsCarousel(props) {
|
|
52
52
|
var _e = (0, react_1.useState)(0), totalPages = _e[0], setTotalPages = _e[1];
|
53
53
|
var _f = (0, react_1.useState)(true), isBeginning = _f[0], setIsBeginning = _f[1];
|
54
54
|
var _g = (0, react_1.useState)(false), isEnd = _g[0], setIsEnd = _g[1];
|
55
|
-
var
|
56
|
-
var
|
55
|
+
var progressRef = (0, react_1.useRef)(0);
|
56
|
+
var leftTimeMsRef = (0, react_1.useRef)(0);
|
57
57
|
var swiperRef = (0, react_1.useRef)(null);
|
58
|
-
var
|
58
|
+
var _h = (0, contentsCarouselUtils_1.parseCarouselStyleToCarouselCoreProp)({
|
59
59
|
props: CB_STYLE_PROP_CONTENTSCAROUSEL,
|
60
60
|
contentsPropsPartials: { CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS: CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS },
|
61
61
|
device: device
|
62
|
-
}), contentsCarouselNormalStyle =
|
63
|
-
var
|
62
|
+
}), contentsCarouselNormalStyle = _h.normalStyle, contentsCarouselHoverStyle = _h.hoverStyle;
|
63
|
+
var _j = (0, contentsCarouselUtils_1.parseCarouselStyleToCustomPaginationProp)({
|
64
64
|
props: CB_STYLE_PROP_CONTENTSCAROUSEL,
|
65
65
|
device: device
|
66
|
-
}), customPaginationNormalStyle =
|
67
|
-
var
|
66
|
+
}), customPaginationNormalStyle = _j.normalStyle, customPaginationHoverStyle = _j.hoverStyle;
|
67
|
+
var _k = (0, contentsCarouselUtils_1.parseCarouselStyleToCustomNavigationProp)({
|
68
68
|
props: CB_STYLE_PROP_CONTENTSCAROUSEL,
|
69
69
|
device: device
|
70
|
-
}), customNavigationNormalStyle =
|
71
|
-
var
|
70
|
+
}), customNavigationNormalStyle = _k.normalStyle, customNavigationHoverStyle = _k.hoverStyle;
|
71
|
+
var _l = (0, contentsCarouselUtils_1.parseCarouselStyleToCustomProgressbarProp)({
|
72
72
|
props: CB_STYLE_PROP_CONTENTSCAROUSEL,
|
73
73
|
device: device
|
74
|
-
}), customProgressbarNormalStyle =
|
75
|
-
var
|
74
|
+
}), customProgressbarNormalStyle = _l.normalStyle, customProgressbarHoverStyle = _l.hoverStyle;
|
75
|
+
var _m = (0, util_1.parseProperties)(props, device), style = _m.style, hoverStyle = _m.hoverStyle, layout = _m.layout, effect = _m.effect;
|
76
76
|
// NOTE: edit모드에서는 그리드의 이벤트만 작동하도록 CB의 포인터 이벤트는 막습니다.
|
77
77
|
var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
|
78
78
|
// NOTE: EFFECT와 관련된 함수들입니다.
|
@@ -107,10 +107,10 @@ function ContentsCarousel(props) {
|
|
107
107
|
setIsEnd(swiper.isEnd);
|
108
108
|
setCurrentSlide(swiper.activeIndex + 1);
|
109
109
|
};
|
110
|
-
var handleAutoplayTimeLeft = function (swiper, time, progress) {
|
111
|
-
|
112
|
-
|
113
|
-
};
|
110
|
+
var handleAutoplayTimeLeft = (0, react_1.useCallback)(function (swiper, time, progress) {
|
111
|
+
leftTimeMsRef.current = time;
|
112
|
+
progressRef.current = progress;
|
113
|
+
}, []);
|
114
114
|
var handleBulletClick = function (index) {
|
115
115
|
if (swiperRef.current) {
|
116
116
|
var targetIndex = (swiperRef.current.swiper.params.slidesPerGroup || 1) * index;
|
@@ -139,7 +139,7 @@ function ContentsCarousel(props) {
|
|
139
139
|
? contentsCarouselHoverStyle.useAutoplay
|
140
140
|
: contentsCarouselNormalStyle.useAutoplay, loop: isHovered ? contentsCarouselHoverStyle.loop : contentsCarouselNormalStyle.loop }, { children: (0, createCompositions_1.createCompositions)({
|
141
141
|
valueType: CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE,
|
142
|
-
queryPath:
|
142
|
+
queryPath: CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA,
|
143
143
|
queryData: queryData,
|
144
144
|
compositions: compositions
|
145
145
|
}) })), (0, jsx_runtime_1.jsx)(CustomPagination_1.CustomPagination, { type: isHovered ? customPaginationHoverStyle.type : customPaginationNormalStyle.type, offset: isHovered ? customPaginationHoverStyle.offset : customPaginationNormalStyle.offset, current: currentSlide, total: totalPages, size: isHovered ? customPaginationHoverStyle.size : customPaginationNormalStyle.size, onBulletClick: handleBulletClick }), (0, jsx_runtime_1.jsx)(CustomNavigation_1.CustomNavigation, { prevBtnDisabled: isBeginning, prevBtnType: isHovered
|
@@ -154,7 +154,7 @@ function ContentsCarousel(props) {
|
|
154
154
|
? customNavigationHoverStyle.nextBtnOffset
|
155
155
|
: customNavigationNormalStyle.nextBtnOffset, nextBtnSize: isHovered
|
156
156
|
? customNavigationHoverStyle.nextBtnSize
|
157
|
-
: customNavigationNormalStyle.nextBtnSize, onNextBtnClick: handleNextBtnClick }), (0, jsx_runtime_1.jsx)(CustomProgressbar_1.CustomProgressbar, {
|
157
|
+
: customNavigationNormalStyle.nextBtnSize, onNextBtnClick: handleNextBtnClick }), (0, jsx_runtime_1.jsx)(CustomProgressbar_1.CustomProgressbar, { progressRef: progressRef, leftTimeMsRef: leftTimeMsRef, type: isHovered ? customProgressbarHoverStyle.type : customProgressbarNormalStyle.type, size: isHovered ? customProgressbarHoverStyle.size : customProgressbarNormalStyle.size, offset: isHovered ? customProgressbarHoverStyle.offset : customProgressbarNormalStyle.offset })] })) })) })));
|
158
158
|
}
|
159
159
|
var S_SwiperWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n ", "\n"], ["\n height: 100%;\n width: 100%;\n ", "\n"])), function (_a) {
|
160
160
|
var customStyle = _a.customStyle;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PROGRESSBAR_TYPE } from '../types';
|
3
3
|
export interface CustomProgressbarProps {
|
4
|
-
progress?: number;
|
5
|
-
leftTime?: number;
|
6
4
|
type?: CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PROGRESSBAR_TYPE;
|
7
5
|
offset?: {
|
8
6
|
top?: string;
|
@@ -15,5 +13,9 @@ export interface CustomProgressbarProps {
|
|
15
13
|
};
|
16
14
|
size?: number;
|
17
15
|
}
|
18
|
-
|
16
|
+
type Props = {
|
17
|
+
progressRef: React.RefObject<number>;
|
18
|
+
leftTimeMsRef: React.RefObject<number>;
|
19
|
+
} & CustomProgressbarProps;
|
20
|
+
export declare const CustomProgressbar: ({ progressRef, leftTimeMsRef, type, offset, size }: Props) => JSX.Element;
|
19
21
|
export default CustomProgressbar;
|
@@ -40,18 +40,39 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
41
41
|
exports.CustomProgressbar = void 0;
|
42
42
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
43
|
+
var react_1 = require("react");
|
43
44
|
var styled_components_1 = __importStar(require("styled-components"));
|
44
45
|
var CustomProgressbar = function (_a) {
|
45
|
-
var _b = _a.
|
46
|
-
|
47
|
-
|
46
|
+
var progressRef = _a.progressRef, leftTimeMsRef = _a.leftTimeMsRef, _b = _a.type, type = _b === void 0 ? 'NONE' : _b, _c = _a.offset, offset = _c === void 0 ? { top: '0' } : _c, _d = _a.size, size = _d === void 0 ? 1 : _d;
|
47
|
+
var _e = (0, react_1.useState)(0), leftTimeSec = _e[0], setLeftTimeSec = _e[1];
|
48
|
+
var _f = (0, react_1.useState)(0), progress = _f[0], setProgress = _f[1];
|
49
|
+
// 초 단위 렌더
|
50
|
+
(0, react_1.useEffect)(function () {
|
51
|
+
var id = setInterval(function () {
|
52
|
+
var _a;
|
53
|
+
var sec = Math.ceil(((_a = leftTimeMsRef.current) !== null && _a !== void 0 ? _a : 0) / 1000);
|
54
|
+
setLeftTimeSec(sec);
|
55
|
+
}, 1000);
|
56
|
+
return function () { return clearInterval(id); };
|
57
|
+
}, [leftTimeMsRef]);
|
58
|
+
// 실시간 progress 반영
|
59
|
+
(0, react_1.useEffect)(function () {
|
60
|
+
var animationId;
|
61
|
+
var updateProgress = function () {
|
62
|
+
var _a;
|
63
|
+
setProgress((_a = progressRef.current) !== null && _a !== void 0 ? _a : 0);
|
64
|
+
animationId = requestAnimationFrame(updateProgress);
|
65
|
+
};
|
66
|
+
animationId = requestAnimationFrame(updateProgress);
|
67
|
+
return function () { return cancelAnimationFrame(animationId); };
|
68
|
+
}, [progressRef]);
|
48
69
|
return ((0, jsx_runtime_1.jsx)(S_Progress, __assign({ className: "autoplay-progress", "$offset": offset, "$size": size }, { children: (function () {
|
49
70
|
switch (type) {
|
50
71
|
case 'NONE':
|
51
72
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
52
73
|
case 'DESIGN1':
|
53
74
|
case 'DESIGN2':
|
54
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("svg", __assign({ viewBox: "0 0 48 48", style: { '--progress': 1 - progress } }, { children: (0, jsx_runtime_1.jsx)("circle", { cx: "24", cy: "24", r: "20" }) })), (0, jsx_runtime_1.jsx)("span", { children: "".concat(Math.ceil(
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("svg", __assign({ viewBox: "0 0 48 48", style: { '--progress': 1 - progress } }, { children: (0, jsx_runtime_1.jsx)("circle", { cx: "24", cy: "24", r: "20" }) })), (0, jsx_runtime_1.jsx)("span", { children: "".concat(Math.ceil(leftTimeSec), "s") })] }));
|
55
76
|
default:
|
56
77
|
return (0, jsx_runtime_1.jsx)("div", { children: "Default Design" });
|
57
78
|
}
|
@@ -36,7 +36,7 @@ function SlideBanner(props) {
|
|
36
36
|
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode, queryData = _a.queryData;
|
37
37
|
var index = props.index,
|
38
38
|
// CONTENT : 슬라이드배너
|
39
|
-
_b = props.CB_CONTENT_PROP_SLIDEBANNER, CB_CONTENT_PROP_SLIDEBANNER_SPEC_DISPLAYCOUNTS = _b.CB_CONTENT_PROP_SLIDEBANNER_SPEC_DISPLAYCOUNTS, CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE = _b.CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE,
|
39
|
+
_b = props.CB_CONTENT_PROP_SLIDEBANNER, CB_CONTENT_PROP_SLIDEBANNER_SPEC_DISPLAYCOUNTS = _b.CB_CONTENT_PROP_SLIDEBANNER_SPEC_DISPLAYCOUNTS, CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE = _b.CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE, CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA = _b.CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA,
|
40
40
|
// STYLE: 슬라이드배너
|
41
41
|
CB_STYLE_PROP_SLIDEBANNER = props.CB_STYLE_PROP_SLIDEBANNER,
|
42
42
|
// STYLE: 그림자
|
@@ -49,26 +49,26 @@ function SlideBanner(props) {
|
|
49
49
|
var _e = (0, react_1.useState)(0), totalPages = _e[0], setTotalPages = _e[1];
|
50
50
|
var _f = (0, react_1.useState)(true), isBeginning = _f[0], setIsBeginning = _f[1];
|
51
51
|
var _g = (0, react_1.useState)(false), isEnd = _g[0], setIsEnd = _g[1];
|
52
|
-
var
|
53
|
-
var
|
52
|
+
var progressRef = (0, react_1.useRef)(0);
|
53
|
+
var leftTimeMsRef = (0, react_1.useRef)(0);
|
54
54
|
var swiperRef = (0, react_1.useRef)(null);
|
55
|
-
var
|
55
|
+
var _h = (0, slideBannerUtils_1.parseSlideBannerStyleToSlideBannerCoreProp)({
|
56
56
|
props: CB_STYLE_PROP_SLIDEBANNER,
|
57
57
|
device: device
|
58
|
-
}), slideBannerNormalStyle =
|
59
|
-
var
|
58
|
+
}), slideBannerNormalStyle = _h.normalStyle, slideBannerHoverStyle = _h.hoverStyle;
|
59
|
+
var _j = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomPaginationProp)({
|
60
60
|
props: CB_STYLE_PROP_SLIDEBANNER,
|
61
61
|
device: device
|
62
|
-
}), customPaginationNormalStyle =
|
63
|
-
var
|
62
|
+
}), customPaginationNormalStyle = _j.normalStyle, customPaginationHoverStyle = _j.hoverStyle;
|
63
|
+
var _k = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomNavigationProp)({
|
64
64
|
props: CB_STYLE_PROP_SLIDEBANNER,
|
65
65
|
device: device
|
66
|
-
}), customNavigationNormalStyle =
|
67
|
-
var
|
66
|
+
}), customNavigationNormalStyle = _k.normalStyle, customNavigationHoverStyle = _k.hoverStyle;
|
67
|
+
var _l = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomProgressbarProp)({
|
68
68
|
props: CB_STYLE_PROP_SLIDEBANNER,
|
69
69
|
device: device
|
70
|
-
}), customProgressbarNormalStyle =
|
71
|
-
var
|
70
|
+
}), customProgressbarNormalStyle = _l.normalStyle, customProgressbarHoverStyle = _l.hoverStyle;
|
71
|
+
var _m = (0, util_1.parseProperties)(props, device), style = _m.style, hoverStyle = _m.hoverStyle, layout = _m.layout, effect = _m.effect;
|
72
72
|
// NOTE: edit모드에서는 그리드의 이벤트만 작동하도록 CB의 포인터 이벤트는 막습니다.
|
73
73
|
var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
|
74
74
|
// NOTE: EFFECT와 관련된 함수들입니다.
|
@@ -103,10 +103,10 @@ function SlideBanner(props) {
|
|
103
103
|
setIsEnd(swiper.isEnd);
|
104
104
|
setCurrentSlide(swiper.activeIndex + 1);
|
105
105
|
};
|
106
|
-
var handleAutoplayTimeLeft = function (swiper, time, progress) {
|
107
|
-
|
108
|
-
|
109
|
-
};
|
106
|
+
var handleAutoplayTimeLeft = (0, react_1.useCallback)(function (swiper, time, progress) {
|
107
|
+
leftTimeMsRef.current = time;
|
108
|
+
progressRef.current = progress;
|
109
|
+
}, []);
|
110
110
|
var handleBulletClick = function (index) {
|
111
111
|
if (swiperRef.current) {
|
112
112
|
var targetIndex = (swiperRef.current.swiper.params.slidesPerGroup || 1) * index;
|
@@ -125,7 +125,7 @@ function SlideBanner(props) {
|
|
125
125
|
};
|
126
126
|
return ((0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, style), layout), effectCssProperties), editModeStyle), { position: 'relative', overflow: 'hidden' }), hoverStyle: __assign(__assign({}, hoverStyle), { position: 'relative', overflow: 'hidden' }), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: (0, jsx_runtime_1.jsxs)(S_SwiperWrapper, __assign({ customStyle: isHovered ? slideBannerHoverStyle === null || slideBannerHoverStyle === void 0 ? void 0 : slideBannerHoverStyle.customStyle : slideBannerNormalStyle === null || slideBannerNormalStyle === void 0 ? void 0 : slideBannerNormalStyle.customStyle }, { children: [(0, jsx_runtime_1.jsx)(SlideBannerCore_1.default, __assign({ ref: swiperRef, onSwiper: handleSwiper, onSlideChange: handleSlideChange, onAutoplayTimeLeft: handleAutoplayTimeLeft, slidesPerView: CB_CONTENT_PROP_SLIDEBANNER_SPEC_DISPLAYCOUNTS, scrollbar: isHovered ? slideBannerHoverStyle.scrollbar : slideBannerNormalStyle.scrollbar, freeMode: isHovered ? slideBannerHoverStyle.freeMode : slideBannerNormalStyle.freeMode, autoplay: isHovered ? slideBannerHoverStyle.autoplay : slideBannerNormalStyle.autoplay, useAutoplay: isHovered ? slideBannerHoverStyle.useAutoplay : slideBannerNormalStyle.useAutoplay, loop: isHovered ? slideBannerHoverStyle.loop : slideBannerNormalStyle.loop }, { children: (0, createCompositions_1.createCompositions)({
|
127
127
|
valueType: CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE,
|
128
|
-
queryPath:
|
128
|
+
queryPath: CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA,
|
129
129
|
queryData: queryData,
|
130
130
|
compositions: compositions
|
131
131
|
}) })), (0, jsx_runtime_1.jsx)(CustomPagination_1.CustomPagination, { type: isHovered ? customPaginationHoverStyle.type : customPaginationNormalStyle.type, offset: isHovered ? customPaginationHoverStyle.offset : customPaginationNormalStyle.offset, current: currentSlide, total: totalPages, size: isHovered ? customPaginationHoverStyle.size : customPaginationNormalStyle.size, onBulletClick: handleBulletClick }), (0, jsx_runtime_1.jsx)(CustomNavigation_1.CustomNavigation, { prevBtnDisabled: isBeginning, prevBtnType: isHovered
|
@@ -140,7 +140,7 @@ function SlideBanner(props) {
|
|
140
140
|
? customNavigationHoverStyle.nextBtnOffset
|
141
141
|
: customNavigationNormalStyle.nextBtnOffset, nextBtnSize: isHovered
|
142
142
|
? customNavigationHoverStyle.nextBtnSize
|
143
|
-
: customNavigationNormalStyle.nextBtnSize, onNextBtnClick: handleNextBtnClick }), (0, jsx_runtime_1.jsx)(CustomProgressbar_1.CustomProgressbar, {
|
143
|
+
: customNavigationNormalStyle.nextBtnSize, onNextBtnClick: handleNextBtnClick }), (0, jsx_runtime_1.jsx)(CustomProgressbar_1.CustomProgressbar, { progressRef: progressRef, leftTimeMsRef: leftTimeMsRef, type: isHovered ? customProgressbarHoverStyle.type : customProgressbarNormalStyle.type, size: isHovered ? customProgressbarHoverStyle.size : customProgressbarNormalStyle.size, offset: isHovered ? customProgressbarHoverStyle.offset : customProgressbarNormalStyle.offset })] })) })) })));
|
144
144
|
}
|
145
145
|
var S_SwiperWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n ", "\n"], ["\n height: 100%;\n width: 100%;\n ", "\n"])), function (_a) {
|
146
146
|
var customStyle = _a.customStyle;
|
@@ -9,7 +9,7 @@ export interface SlideBannerCoreProps extends SwiperProps {
|
|
9
9
|
autoplay?: SwiperProps['autoplay'];
|
10
10
|
useAutoplay?: boolean;
|
11
11
|
loop?: SwiperProps['loop'];
|
12
|
-
children?: React.ReactNode[];
|
12
|
+
children?: React.ReactNode[] | JSX.Element;
|
13
13
|
}
|
14
14
|
declare const SlideBannerCore: import("react").ForwardRefExoticComponent<SlideBannerCoreProps & import("react").RefAttributes<SwiperRef>>;
|
15
15
|
export default SlideBannerCore;
|
@@ -33,7 +33,7 @@ var SlideBannerCore = (0, react_1.forwardRef)(function (_a, ref) {
|
|
33
33
|
return ((0, jsx_runtime_1.jsx)(react_2.Swiper, __assign({ ref: ref, style: {
|
34
34
|
width: '100%',
|
35
35
|
height: '100%'
|
36
|
-
}, modules: [swiper_1.Pagination, swiper_1.Navigation, swiper_1.Scrollbar, swiper_1.FreeMode, swiper_1.Autoplay], slidesPerView: slidesPerView, scrollbar: scrollbar, freeMode: freeMode, autoplay: useAutoplay ? autoplay : false, loop: loop }, props, { children:
|
36
|
+
}, modules: [swiper_1.Pagination, swiper_1.Navigation, swiper_1.Scrollbar, swiper_1.FreeMode, swiper_1.Autoplay], slidesPerView: slidesPerView, scrollbar: scrollbar, freeMode: freeMode, autoplay: useAutoplay ? autoplay : false, loop: loop }, props, { children: Array.isArray(children) ? (children.map(function (slide, index) { return (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: slide }, index); })) : ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: children })) })));
|
37
37
|
});
|
38
38
|
SlideBannerCore.displayName = 'SlideBannerCore';
|
39
39
|
exports.default = SlideBannerCore;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { CB_STYLE_PROP_SLIDEBANNER_SPEC_PROGRESSBAR_TYPE } from '../types';
|
3
3
|
export interface CustomProgressbarProps {
|
4
|
-
progress?: number;
|
5
|
-
leftTime?: number;
|
6
4
|
type?: CB_STYLE_PROP_SLIDEBANNER_SPEC_PROGRESSBAR_TYPE;
|
7
5
|
offset?: {
|
8
6
|
top?: string;
|
@@ -15,5 +13,9 @@ export interface CustomProgressbarProps {
|
|
15
13
|
};
|
16
14
|
size?: number;
|
17
15
|
}
|
18
|
-
|
16
|
+
type Props = {
|
17
|
+
progressRef: React.RefObject<number>;
|
18
|
+
leftTimeMsRef: React.RefObject<number>;
|
19
|
+
} & CustomProgressbarProps;
|
20
|
+
export declare const CustomProgressbar: ({ progressRef, leftTimeMsRef, type, offset, size }: Props) => JSX.Element;
|
19
21
|
export default CustomProgressbar;
|
@@ -40,18 +40,39 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
41
41
|
exports.CustomProgressbar = void 0;
|
42
42
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
43
|
+
var react_1 = require("react");
|
43
44
|
var styled_components_1 = __importStar(require("styled-components"));
|
44
45
|
var CustomProgressbar = function (_a) {
|
45
|
-
var _b = _a.
|
46
|
-
|
47
|
-
|
46
|
+
var progressRef = _a.progressRef, leftTimeMsRef = _a.leftTimeMsRef, _b = _a.type, type = _b === void 0 ? 'NONE' : _b, _c = _a.offset, offset = _c === void 0 ? { top: '0' } : _c, _d = _a.size, size = _d === void 0 ? 1 : _d;
|
47
|
+
var _e = (0, react_1.useState)(0), leftTimeSec = _e[0], setLeftTimeSec = _e[1];
|
48
|
+
var _f = (0, react_1.useState)(0), progress = _f[0], setProgress = _f[1];
|
49
|
+
// 초 단위 렌더
|
50
|
+
(0, react_1.useEffect)(function () {
|
51
|
+
var id = setInterval(function () {
|
52
|
+
var _a;
|
53
|
+
var sec = Math.ceil(((_a = leftTimeMsRef.current) !== null && _a !== void 0 ? _a : 0) / 1000);
|
54
|
+
setLeftTimeSec(sec);
|
55
|
+
}, 1000);
|
56
|
+
return function () { return clearInterval(id); };
|
57
|
+
}, [leftTimeMsRef]);
|
58
|
+
// 실시간 progress 반영
|
59
|
+
(0, react_1.useEffect)(function () {
|
60
|
+
var animationId;
|
61
|
+
var updateProgress = function () {
|
62
|
+
var _a;
|
63
|
+
setProgress((_a = progressRef.current) !== null && _a !== void 0 ? _a : 0);
|
64
|
+
animationId = requestAnimationFrame(updateProgress);
|
65
|
+
};
|
66
|
+
animationId = requestAnimationFrame(updateProgress);
|
67
|
+
return function () { return cancelAnimationFrame(animationId); };
|
68
|
+
}, [progressRef]);
|
48
69
|
return ((0, jsx_runtime_1.jsx)(S_Progress, __assign({ className: "autoplay-progress", "$offset": offset, "$size": size }, { children: (function () {
|
49
70
|
switch (type) {
|
50
71
|
case 'NONE':
|
51
72
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
52
73
|
case 'DESIGN1':
|
53
74
|
case 'DESIGN2':
|
54
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("svg", __assign({ viewBox: "0 0 48 48", style: { '--progress': 1 - progress } }, { children: (0, jsx_runtime_1.jsx)("circle", { cx: "24", cy: "24", r: "20" }) })), (0, jsx_runtime_1.jsx)("span", { children: "".concat(Math.ceil(
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("svg", __assign({ viewBox: "0 0 48 48", style: { '--progress': 1 - progress } }, { children: (0, jsx_runtime_1.jsx)("circle", { cx: "24", cy: "24", r: "20" }) })), (0, jsx_runtime_1.jsx)("span", { children: "".concat(Math.ceil(leftTimeSec), "s") })] }));
|
55
76
|
default:
|
56
77
|
return (0, jsx_runtime_1.jsx)("div", { children: "Default Design" });
|
57
78
|
}
|
@@ -31,7 +31,7 @@ var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
|
|
31
31
|
function Text(props) {
|
32
32
|
var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
33
33
|
var queryContext = (0, compositionQueryContext_1.useCCBQueryPath)();
|
34
|
-
var index = props.index, _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE, CB_CONTENT_PROP_CLINK_SPEC_CONNECTDATA = _b.CB_CONTENT_PROP_CLINK_SPEC_CONNECTDATA, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, _c = props.CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE = _c.CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE,
|
34
|
+
var index = props.index, _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE, CB_CONTENT_PROP_CLINK_SPEC_CONNECTDATA = _b.CB_CONTENT_PROP_CLINK_SPEC_CONNECTDATA, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, _c = props.CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE = _c.CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE, CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA = _c.CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA;
|
35
35
|
var cLinkValue = function () {
|
36
36
|
if (CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE === 'DATA') {
|
37
37
|
if (!(queryContext === null || queryContext === void 0 ? void 0 : queryContext.queryData)) {
|
@@ -72,7 +72,7 @@ function Text(props) {
|
|
72
72
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
73
73
|
var textValue = function () {
|
74
74
|
if (CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE === 'DATA' && (queryContext === null || queryContext === void 0 ? void 0 : queryContext.queryData)) {
|
75
|
-
return queryContext.queryData[
|
75
|
+
return queryContext.queryData[CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA];
|
76
76
|
}
|
77
77
|
if (device === 'MOBILE' &&
|
78
78
|
mode !== 'EDIT' &&
|
@@ -8,7 +8,7 @@ export type CB_CONTENT_PROP_TEXT = {
|
|
8
8
|
CB_CONTENT_PROP_TEXT_SPEC_TEXT: STRING_PLAIN;
|
9
9
|
CB_CONTENT_PROP_TEXT_SPEC_TEXTMOBILEALTERNATIVE: STRING_PLAIN;
|
10
10
|
CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE: VALUE_TYPE;
|
11
|
-
|
11
|
+
CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA: STRING_PLAIN;
|
12
12
|
};
|
13
13
|
export type CB_CONTENT_PROP_CLINK = {
|
14
14
|
CB_CONTENT_PROP_CLINK_SPEC_TYPE: 'INTERNAL' | 'EXTERNAL' | 'DISABLED';
|
@@ -31,7 +31,7 @@ export type CB_CONTENT_PROP_CODEBLOCK = {
|
|
31
31
|
};
|
32
32
|
export type CB_CONTENT_PROP_CONTENTSCAROUSEL = {
|
33
33
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE: VALUE_TYPE;
|
34
|
-
|
34
|
+
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA: STRING_PLAIN;
|
35
35
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATASORTING: STRING_PLAIN;
|
36
36
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_OFFSET: NUMBER_INTEGER;
|
37
37
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS: MockComposition[];
|
@@ -40,7 +40,7 @@ export type CB_CONTENT_PROP_CONTENTSCAROUSEL = {
|
|
40
40
|
};
|
41
41
|
export type CB_CONTENT_PROP_SLIDEBANNER = {
|
42
42
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE: VALUE_TYPE;
|
43
|
-
|
43
|
+
CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA: STRING_PLAIN;
|
44
44
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_DATASORTING: STRING_PLAIN;
|
45
45
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_OFFSET: NUMBER_INTEGER;
|
46
46
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_MENUALITEMS: MockComposition[];
|