pds-dev-kit-web-test 2.7.229 → 2.7.233
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/components/pdsOriginal/desktop/IconButton/IconButton.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/components/pdsOriginal/desktop/IconButton/IconButton.js +11 -8
- package/dist/src/sub/DynamicLayout/components/pdsOriginal/hybrid/Icon/Icon.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/mock_slideBanner.js +2 -2
- package/dist/src/sub/DynamicLayout/mocks.d.ts +3596 -1
- package/dist/src/sub/DynamicLayout/mocks.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +11 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationNextBtn.js +6 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationPrevBtn.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +5 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.js +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.d.ts +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +19 -16
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.js +5 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/elementPositions.d.ts +4 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/elementPositions.js +596 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.js +6 -3
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MOCK_SECTIONS = void 0;
|
|
4
4
|
require("./mock_contentsCarousel");
|
|
5
|
-
|
|
6
|
-
require("./mock_slideBanner");
|
|
5
|
+
require("./mock_contentsList");
|
|
6
|
+
var mock_slideBanner_1 = require("./mock_slideBanner");
|
|
7
7
|
exports.MOCK_SECTIONS = [
|
|
8
8
|
{
|
|
9
9
|
administrativeTitle: 'Daily Pages',
|
|
@@ -12,8 +12,8 @@ exports.MOCK_SECTIONS = [
|
|
|
12
12
|
// MOCK_VIDEO_CB,
|
|
13
13
|
// MOCK_VIDEO_CB_2,
|
|
14
14
|
// SAMPLE_CONTENTSCAROUSEL_CB,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
mock_slideBanner_1.SAMPLE_SLIDEBANNER_CB
|
|
16
|
+
// SAMPLE_LIST_CB
|
|
17
17
|
// ...MOCK_COMPONENT_BLOCKS
|
|
18
18
|
],
|
|
19
19
|
display: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { INSET_POSTIION, OUTSET_POSTIION } from './types';
|
|
2
|
+
import type { CB_STYLE_PROP_CONTENTSCAROUSELBUTTON_SPEC_PREVBTNSTYLE_TYPE, INSET_POSTIION, OUTSET_POSTIION } from './types';
|
|
3
3
|
import type { CB_CONTENTSCAROUSEL } from '../../../../../../../DynamicLayout/sections/CustomSection/types';
|
|
4
4
|
import type { CB_CONTENTSCAROUSEL_PROPERTIES_TYPE, IndexForIntersection } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
5
5
|
type Props = CB_CONTENTSCAROUSEL_PROPERTIES_TYPE & IndexForIntersection & {
|
|
@@ -9,6 +9,7 @@ type ComponentType = 'PREV' | 'NEXT' | 'PROGRESSBAR';
|
|
|
9
9
|
export type ContentsCarouselElementsProps = {
|
|
10
10
|
type: ComponentType;
|
|
11
11
|
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
12
|
+
designType: CB_STYLE_PROP_CONTENTSCAROUSELBUTTON_SPEC_PREVBTNSTYLE_TYPE;
|
|
12
13
|
};
|
|
13
14
|
declare function ContentsCarousel(props: Props): JSX.Element;
|
|
14
15
|
export default ContentsCarousel;
|
|
@@ -45,7 +45,8 @@ var ContentsCarouselCore_1 = __importDefault(require("./ContentsCarouselCore"));
|
|
|
45
45
|
var contentsCarouselUtils_1 = require("./contentsCarouselUtils");
|
|
46
46
|
var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
|
|
47
47
|
var useSwiper_1 = require("./hooks/useSwiper");
|
|
48
|
-
var createComponent = function (type, getDesignType, getLocation) {
|
|
48
|
+
var createComponent = function (type, getDesignType, getLocation, designType) {
|
|
49
|
+
if (designType === void 0) { designType = 'NONE'; }
|
|
49
50
|
return function (normalStyle, hoverStyle, isHovered) {
|
|
50
51
|
var normalDesign = getDesignType(normalStyle);
|
|
51
52
|
var hoverDesign = getDesignType(hoverStyle);
|
|
@@ -55,7 +56,8 @@ var createComponent = function (type, getDesignType, getLocation) {
|
|
|
55
56
|
return undefined;
|
|
56
57
|
return {
|
|
57
58
|
type: type,
|
|
58
|
-
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle)
|
|
59
|
+
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle),
|
|
60
|
+
designType: designType
|
|
59
61
|
};
|
|
60
62
|
};
|
|
61
63
|
};
|
|
@@ -96,12 +98,16 @@ function ContentsCarousel(props) {
|
|
|
96
98
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
97
99
|
var hasEffect = !isNoneEffectType;
|
|
98
100
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
99
|
-
var createPrevButton = createComponent('PREV', function (style) { return style.prevBtnType || 'NONE'; }, function (style) { return style.prevBtnLocation || 'OUTSET1'; });
|
|
100
|
-
var createNextButton = createComponent('NEXT', function (style) { return style.nextBtnType || 'NONE'; }, function (style) { return style.nextBtnLocation || 'OUTSET1'; });
|
|
101
|
+
var createPrevButton = createComponent('PREV', function (style) { return style.prevBtnType || 'NONE'; }, function (style) { return style.prevBtnLocation || 'OUTSET1'; }, customNavigationNormalStyle.prevBtnType || 'NONE');
|
|
102
|
+
var createNextButton = createComponent('NEXT', function (style) { return style.nextBtnType || 'NONE'; }, function (style) { return style.nextBtnLocation || 'OUTSET1'; }, customNavigationNormalStyle.nextBtnType || 'NONE');
|
|
101
103
|
var components = [
|
|
102
104
|
createPrevButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
103
105
|
createNextButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
104
|
-
{
|
|
106
|
+
{
|
|
107
|
+
type: 'PROGRESSBAR',
|
|
108
|
+
position: 'INSET5',
|
|
109
|
+
designType: customProgressbarNormalStyle.type || 'NONE'
|
|
110
|
+
}
|
|
105
111
|
].filter(function (component) { return component !== undefined; });
|
|
106
112
|
var _k = (0, useFlexGridLayout_1.useFlexGridLayout)({ components: components }), layoutRef = _k.layoutRef, positionRefs = _k.positionRefs,
|
|
107
113
|
// ccbInset,
|
|
@@ -50,13 +50,13 @@ var CustomNavigationNextBtn = function (_a) {
|
|
|
50
50
|
: navigationConfigs_1.nextButtonMappedIcons[styles.nextBtnType || 'DESIGN1'];
|
|
51
51
|
var buttonSize = 'large';
|
|
52
52
|
var iconSize = 24;
|
|
53
|
-
if (styles.
|
|
54
|
-
buttonSize =
|
|
55
|
-
iconSize =
|
|
53
|
+
if (styles.prevBtnSize === 'SMALL') {
|
|
54
|
+
buttonSize = 40;
|
|
55
|
+
iconSize = 20;
|
|
56
56
|
}
|
|
57
|
-
if (styles.
|
|
58
|
-
buttonSize =
|
|
59
|
-
iconSize =
|
|
57
|
+
if (styles.prevBtnSize === 'LARGE') {
|
|
58
|
+
buttonSize = 72;
|
|
59
|
+
iconSize = 40;
|
|
60
60
|
}
|
|
61
61
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nextButton && ((0, jsx_runtime_1.jsx)(S_NextButton, __assign({ className: "cb-contentscarousel-next-button", disabled: isDisabled, "$size": styles.nextBtnSize }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { fillType: "fill", baseSize: buttonSize, iconSize: iconSize, shapeType: nextButton.shapeType, borderColorKey: nextButton.borderColorKey, overrideBaseColorHex: styles.nextBtnPrimaryColor, overrideBaseColorHexHover: hoverStyles.nextBtnPrimaryColor, iconName: nextButton.iconName, iconFillType: "line", iconColorKey: nextButton.iconColorKey || 'ui_cpnt_icon_sys_black', overrideIconColorHex: styles.nextBtnSecondaryColor, overrideIconColorHexHover: hoverStyles.nextBtnSecondaryColor, shadow: nextButton.shadow, useDefaultActiveStyle: false, useDefaultHoverStyle: false, onClick: onClick }) }))) }));
|
|
62
62
|
};
|
|
@@ -51,12 +51,12 @@ var CustomNavigationPrevBtn = function (_a) {
|
|
|
51
51
|
var buttonSize = 'large';
|
|
52
52
|
var iconSize = 24;
|
|
53
53
|
if (styles.prevBtnSize === 'SMALL') {
|
|
54
|
-
buttonSize =
|
|
55
|
-
iconSize =
|
|
54
|
+
buttonSize = 40;
|
|
55
|
+
iconSize = 20;
|
|
56
56
|
}
|
|
57
57
|
if (styles.prevBtnSize === 'LARGE') {
|
|
58
|
-
buttonSize =
|
|
59
|
-
iconSize =
|
|
58
|
+
buttonSize = 72;
|
|
59
|
+
iconSize = 40;
|
|
60
60
|
}
|
|
61
61
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: prevButton && ((0, jsx_runtime_1.jsx)(S_PrevButton, __assign({ className: "cb-contentscarousel-prev-button", disabled: isDisabled, "$size": styles.prevBtnSize }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { fillType: "fill", baseSize: buttonSize, iconSize: iconSize, shapeType: prevButton.shapeType, borderColorKey: prevButton.borderColorKey, iconName: prevButton.iconName, iconFillType: "line", iconColorKey: prevButton.iconColorKey || 'ui_cpnt_icon_sys_black', overrideBaseColorHex: styles.prevBtnPrimaryColor, overrideBaseColorHexHover: hoverStyles === null || hoverStyles === void 0 ? void 0 : hoverStyles.prevBtnPrimaryColor, overrideIconColorHex: styles.prevBtnSecondaryColor, overrideIconColorHexHover: hoverStyles === null || hoverStyles === void 0 ? void 0 : hoverStyles.prevBtnSecondaryColor, shadow: prevButton.shadow, onClick: onClick, useDefaultActiveStyle: false, useDefaultHoverStyle: false }) }))) }));
|
|
62
62
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { OUTSET_POSTIION, INSET_POSTIION } from './types';
|
|
2
|
+
import type { OUTSET_POSTIION, INSET_POSTIION, CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSTYLE_TYPE } from './types';
|
|
3
3
|
import type { CB_LIST } from '../../../../../../../DynamicLayout/sections/CustomSection/types';
|
|
4
4
|
import type { CB_LIST_PROPERTIES_TYPE, IndexForIntersection } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
5
5
|
type Props = CB_LIST_PROPERTIES_TYPE & IndexForIntersection & {
|
|
@@ -9,6 +9,7 @@ type ComponentType = 'PAGINATION';
|
|
|
9
9
|
export type ContentsListElementsProps = {
|
|
10
10
|
type: ComponentType;
|
|
11
11
|
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
12
|
+
designType: CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSTYLE_TYPE;
|
|
12
13
|
};
|
|
13
14
|
declare function ContentsList(props: Props): JSX.Element;
|
|
14
15
|
export default ContentsList;
|
|
@@ -42,7 +42,7 @@ var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
|
|
|
42
42
|
var CustomPagination_1 = require("./components/CustomPagination");
|
|
43
43
|
var contentsListUtils_1 = require("./contentsListUtils");
|
|
44
44
|
var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
|
|
45
|
-
var createComponent = function (type, getDesignType, getLocation) {
|
|
45
|
+
var createComponent = function (type, getDesignType, getLocation, designType) {
|
|
46
46
|
return function (normalStyle, hoverStyle, isHovered) {
|
|
47
47
|
var normalDesign = getDesignType(normalStyle);
|
|
48
48
|
var hoverDesign = getDesignType(hoverStyle);
|
|
@@ -52,7 +52,8 @@ var createComponent = function (type, getDesignType, getLocation) {
|
|
|
52
52
|
return undefined;
|
|
53
53
|
return {
|
|
54
54
|
type: type,
|
|
55
|
-
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle)
|
|
55
|
+
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle),
|
|
56
|
+
designType: designType
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
59
|
};
|
|
@@ -130,7 +131,7 @@ function ContentsList(props) {
|
|
|
130
131
|
var listMinHeight = oneCompositionMinHeight * numberOfRows +
|
|
131
132
|
(numberOfRows - 1) * rowGap +
|
|
132
133
|
paddingTB;
|
|
133
|
-
var createPagination = createComponent('PAGINATION', function (style) { return style.type || 'NONE'; }, function (style) { return style.location || 'OUTSET1'; });
|
|
134
|
+
var createPagination = createComponent('PAGINATION', function (style) { return style.type || 'NONE'; }, function (style) { return style.location || 'OUTSET1'; }, paginationNormalStyle.type || 'NONE');
|
|
134
135
|
var components = [
|
|
135
136
|
createPagination(paginationNormalStyle, paginationHoverStyle, isHovered)
|
|
136
137
|
].filter(function (component) { return component !== undefined; });
|
|
@@ -169,7 +170,7 @@ function ContentsList(props) {
|
|
|
169
170
|
else {
|
|
170
171
|
delete positionRefs.current[position];
|
|
171
172
|
}
|
|
172
|
-
}, style: __assign(__assign({}, getPositionStyle(position, ccbInset)), { zIndex: 3 }) }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-contentslist-button-layout-box", style: getComponentGroupLayout(groupComponents, position) }, { children: groupComponents.map(function (component) { return renderElements(component); }) })) }), position));
|
|
173
|
+
}, style: __assign(__assign({}, getPositionStyle(position, ccbInset, groupComponents[0].designType)), { zIndex: 3 }) }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-contentslist-button-layout-box", style: getComponentGroupLayout(groupComponents, position) }, { children: groupComponents.map(function (component) { return renderElements(component); }) })) }), position));
|
|
173
174
|
}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsxs)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ id: "contentslist-box", className: "cb-layout-box ccb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, style), layout), effectCssProperties), editModeStyle), { overflow: 'hidden' }), hoverStyle: __assign(__assign({}, hoverStyle), { overflow: 'hidden' }), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, "data-number-of-items": CB_CONTENT_PROP_CONTENTSLIST_SPEC_MANUALITEMS.length, "data-number-of-columns": Math.min(CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS, CB_CONTENT_PROP_CONTENTSLIST_SPEC_MANUALITEMS.length), "data-row-gap": rowGap, "data-column-gap": columnGap, "data-cols": Math.min(CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS, CB_CONTENT_PROP_CONTENTSLIST_SPEC_MANUALITEMS.length), "data-min-width": listMinWidth, "data-min-height": listMinHeight, "data-inset-top": parseFloat(ccbInset.top), "data-inset-bottom": parseFloat(ccbInset.bottom) }, { children: [(0, jsx_runtime_1.jsx)(S_CustomBackgroundWrapper, __assign({ ref: backgroundRef, style: __assign(__assign({}, effect), { background: style.background }) }, { children: isBgMedia && CB_STYLE_PROP_BGMEDIA && ((0, jsx_runtime_1.jsx)(CustomSectionBackgroundMedia_1.CustomSectionBackgroundMedia, { specs: CB_STYLE_PROP_BGMEDIA, componentStyle: style, playerId: index, mediaType: mediaType || 'NONE', device: isMobile ? 'MOBILE' : 'DESKTOP', backgroundRef: backgroundRef })) })), (0, jsx_runtime_1.jsx)(S_Overlay, { style: overlayStyle }), (0, jsx_runtime_1.jsx)(S_ContentsListLayout, __assign({ className: "cb-contentslist-layout-box", ref: layoutRef, style: {
|
|
174
175
|
display: layout.display,
|
|
175
176
|
flexDirection: layout.flexDirection,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ContentsListElementsProps } from '../ContentsList';
|
|
3
|
+
import type { CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSTYLE_TYPE } from '../types';
|
|
3
4
|
import type { CSSProperties } from 'styled-components';
|
|
4
5
|
export declare const useFlexGridLayout: ({ components }: {
|
|
5
6
|
components: ContentsListElementsProps[];
|
|
@@ -13,6 +14,6 @@ export declare const useFlexGridLayout: ({ components }: {
|
|
|
13
14
|
left: string;
|
|
14
15
|
};
|
|
15
16
|
componentGroups: Record<string, ContentsListElementsProps[]>;
|
|
16
|
-
getPositionStyle: (position: string, ccbInset: Record<string, string
|
|
17
|
+
getPositionStyle: (position: string, ccbInset: Record<string, string>, designType: CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSTYLE_TYPE) => CSSProperties;
|
|
17
18
|
getComponentGroupLayout: (components: ContentsListElementsProps[], position: string) => CSSProperties;
|
|
18
19
|
};
|
|
@@ -19,6 +19,7 @@ var useFlexGridLayout = function (_a) {
|
|
|
19
19
|
var _c = (0, react_1.useState)({ width: 0, height: 0 }), layoutSize = _c[0], setLayoutSize = _c[1];
|
|
20
20
|
var layoutRef = (0, react_1.useRef)(null);
|
|
21
21
|
var positionRefs = (0, react_1.useRef)({});
|
|
22
|
+
console.log('useFlexGridLayout components:', components);
|
|
22
23
|
// 위치별로 컴포넌트 그룹화
|
|
23
24
|
var getComponentsByPosition = function () {
|
|
24
25
|
var groups = {};
|
|
@@ -60,7 +61,7 @@ var useFlexGridLayout = function (_a) {
|
|
|
60
61
|
return directions[position];
|
|
61
62
|
};
|
|
62
63
|
// 위치에 따른 스타일 결정 (CCB 크기를 고려)
|
|
63
|
-
var getPositionStyle = function (position, ccbInset) {
|
|
64
|
+
var getPositionStyle = function (position, ccbInset, designType) {
|
|
64
65
|
var base = {
|
|
65
66
|
position: 'absolute',
|
|
66
67
|
display: 'flex',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { INSET_POSTIION, OUTSET_POSTIION } from './types';
|
|
2
|
+
import type { CB_STYLE_PROP_SLIDEBANNER_SPEC_PREVBTNSTYLE_TYPE, INSET_POSTIION, OUTSET_POSTIION } from './types';
|
|
3
3
|
import type { CB_SLIDEBANNER } from '../../../../../../../DynamicLayout/sections/CustomSection/types';
|
|
4
4
|
import type { CB_SLIDEBANNER_PROPERTIES_TYPE, IndexForIntersection } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
5
5
|
type Props = CB_SLIDEBANNER_PROPERTIES_TYPE & IndexForIntersection & {
|
|
@@ -9,6 +9,8 @@ type ComponentType = 'PREV' | 'NEXT' | 'PAGINATION' | 'PROGRESSBAR';
|
|
|
9
9
|
export type SlideBannerElementsProps = {
|
|
10
10
|
type: ComponentType;
|
|
11
11
|
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
12
|
+
designType: CB_STYLE_PROP_SLIDEBANNER_SPEC_PREVBTNSTYLE_TYPE;
|
|
13
|
+
size: 'LARGE' | 'MEDIUM' | 'SMALL';
|
|
12
14
|
};
|
|
13
15
|
declare function SlideBanner(props: Props): JSX.Element;
|
|
14
16
|
export default SlideBanner;
|
|
@@ -46,8 +46,10 @@ var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
|
|
|
46
46
|
var useSwiper_1 = require("./hooks/useSwiper");
|
|
47
47
|
var SlideBannerCore_1 = __importDefault(require("./SlideBannerCore"));
|
|
48
48
|
var slideBannerUtils_1 = require("./slideBannerUtils");
|
|
49
|
-
var createComponent = function (type, getDesignType, getLocation) {
|
|
50
|
-
|
|
49
|
+
var createComponent = function (type, getDesignType, getLocation, designType, size) {
|
|
50
|
+
if (size === void 0) { size = 'MEDIUM'; }
|
|
51
|
+
return function (normalStyle, hoverStyle, isHovered, size) {
|
|
52
|
+
if (size === void 0) { size = 'MEDIUM'; }
|
|
51
53
|
var normalDesign = getDesignType(normalStyle);
|
|
52
54
|
var hoverDesign = getDesignType(hoverStyle);
|
|
53
55
|
if (isHovered && hoverDesign === 'NONE')
|
|
@@ -56,7 +58,9 @@ var createComponent = function (type, getDesignType, getLocation) {
|
|
|
56
58
|
return undefined;
|
|
57
59
|
return {
|
|
58
60
|
type: type,
|
|
59
|
-
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle)
|
|
61
|
+
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle),
|
|
62
|
+
designType: designType,
|
|
63
|
+
size: size
|
|
60
64
|
};
|
|
61
65
|
};
|
|
62
66
|
};
|
|
@@ -99,24 +103,22 @@ function SlideBanner(props) {
|
|
|
99
103
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
100
104
|
var hasEffect = !isNoneEffectType;
|
|
101
105
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
102
|
-
var createPrevButton = createComponent('PREV', function (style) { return style.prevBtnType || 'NONE'; }, function (style) { return style.prevBtnLocation || 'OUTSET1'; });
|
|
103
|
-
var createNextButton = createComponent('NEXT', function (style) { return style.nextBtnType || 'NONE'; }, function (style) { return style.nextBtnLocation || 'OUTSET1'; });
|
|
104
|
-
var createPagination = createComponent('PAGINATION', function (style) { return style.type || 'NONE'; }, function (style) { return style.location || 'OUTSET1'; });
|
|
106
|
+
var createPrevButton = createComponent('PREV', function (style) { return style.prevBtnType || 'NONE'; }, function (style) { return style.prevBtnLocation || 'OUTSET1'; }, customNavigationNormalStyle.prevBtnType || 'NONE', customNavigationNormalStyle.prevBtnSize || 'MEDIUM');
|
|
107
|
+
var createNextButton = createComponent('NEXT', function (style) { return style.nextBtnType || 'NONE'; }, function (style) { return style.nextBtnLocation || 'OUTSET1'; }, customNavigationNormalStyle.nextBtnType || 'NONE', customNavigationNormalStyle.nextBtnSize || 'MEDIUM');
|
|
108
|
+
var createPagination = createComponent('PAGINATION', function (style) { return style.type || 'NONE'; }, function (style) { return style.location || 'OUTSET1'; }, customPaginationNormalStyle.type || 'NONE', customPaginationNormalStyle.size || 'MEDIUM');
|
|
105
109
|
var components = [
|
|
106
110
|
createPrevButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
107
111
|
createNextButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
108
112
|
createPagination(customPaginationNormalStyle, customPaginationHoverStyle, isHovered),
|
|
109
113
|
{ type: 'PROGRESSBAR', position: 'INSET5' }
|
|
110
114
|
].filter(function (component) { return component !== undefined; });
|
|
111
|
-
var _k = (0, useFlexGridLayout_1.useFlexGridLayout)({ components: components }), layoutRef = _k.layoutRef, positionRefs = _k.positionRefs,
|
|
112
|
-
// ccbInset
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
left: '0px'
|
|
119
|
-
};
|
|
115
|
+
var _k = (0, useFlexGridLayout_1.useFlexGridLayout)({ components: components }), layoutRef = _k.layoutRef, positionRefs = _k.positionRefs, ccbInset = _k.ccbInset, componentGroups = _k.componentGroups, getPositionStyle = _k.getPositionStyle, getComponentGroupLayout = _k.getComponentGroupLayout;
|
|
116
|
+
// const ccbInset = {
|
|
117
|
+
// top: '0px',
|
|
118
|
+
// right: '0px',
|
|
119
|
+
// bottom: '0px',
|
|
120
|
+
// left: '0px'
|
|
121
|
+
// };
|
|
120
122
|
var renderElements = function (component) {
|
|
121
123
|
var _a;
|
|
122
124
|
switch (component.type) {
|
|
@@ -141,6 +143,7 @@ function SlideBanner(props) {
|
|
|
141
143
|
.map(function (item) {
|
|
142
144
|
return compositions.find(function (comp) { return comp.ccbManualItemUuid === item.uuid; });
|
|
143
145
|
});
|
|
146
|
+
console.log('entries', Object.entries(componentGroups));
|
|
144
147
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [Object.entries(componentGroups).map(function (_a) {
|
|
145
148
|
var position = _a[0], groupComponents = _a[1];
|
|
146
149
|
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-slidebanner-button-group ccb-elements", ref: function (el) {
|
|
@@ -150,7 +153,7 @@ function SlideBanner(props) {
|
|
|
150
153
|
else {
|
|
151
154
|
delete positionRefs.current[position];
|
|
152
155
|
}
|
|
153
|
-
}, style: __assign(__assign({}, getPositionStyle(position, ccbInset)), { zIndex: 3 }) }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-slidebanner-button-layout-box", style: getComponentGroupLayout(groupComponents, position) }, { children: groupComponents.map(function (component) { return renderElements(component); }) })) }), position));
|
|
156
|
+
}, style: __assign(__assign({}, getPositionStyle(position, ccbInset, groupComponents[0].designType, groupComponents[0].size)), { zIndex: 3 }) }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-slidebanner-button-layout-box", style: getComponentGroupLayout(groupComponents, position) }, { children: groupComponents.map(function (component) { return renderElements(component); }) })) }), position));
|
|
154
157
|
}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsxs)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box ccb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, style), layout), effectCssProperties), editModeStyle), { overflow: 'hidden' }), hoverStyle: __assign(__assign({}, hoverStyle), { overflow: 'hidden' }), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: [(0, jsx_runtime_1.jsx)(S_CustomBackgroundWrapper, __assign({ ref: backgroundRef, style: __assign(__assign({}, effect), { background: style.background }) }, { children: isBgMedia && CB_STYLE_PROP_BGMEDIA && ((0, jsx_runtime_1.jsx)(CustomSectionBackgroundMedia_1.CustomSectionBackgroundMedia, { specs: CB_STYLE_PROP_BGMEDIA, componentStyle: style, playerId: index, mediaType: mediaType || 'NONE', device: isMobile ? 'MOBILE' : 'DESKTOP', backgroundRef: backgroundRef })) })), (0, jsx_runtime_1.jsx)(S_Overlay, { style: overlayStyle }), (0, jsx_runtime_1.jsx)(S_SwiperLayout, __assign({ className: "cb-slidebanner-layout-box", ref: layoutRef }, { children: (0, jsx_runtime_1.jsx)(S_SwiperWrapper, __assign({ className: "cb-slidebanner-wrapper", ccbInset: ccbInset, 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, className: "cb-slidebanner", onSwiper: onSwiper, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onAutoplayTimeLeft: onAutoplayTimeLeft, slidesPerView: 1, styles: isHovered ? slideBannerHoverStyle : slideBannerNormalStyle, effect: CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE === null || CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE === void 0 ? void 0 : CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE.toLowerCase() }, { children: (0, createCompositions_1.createCompositions)({
|
|
155
158
|
valueType: CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE,
|
|
156
159
|
queryPath: CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA,
|
|
@@ -48,14 +48,14 @@ var CustomNavigationNextBtn = function (_a) {
|
|
|
48
48
|
var nextButton = styles.nextBtnType === 'NONE'
|
|
49
49
|
? undefined
|
|
50
50
|
: navigationConfigs_1.nextButtonMappedIcons[styles.nextBtnType || 'DESIGN1'];
|
|
51
|
-
var buttonSize =
|
|
52
|
-
var iconSize =
|
|
51
|
+
var buttonSize = 48;
|
|
52
|
+
var iconSize = 20;
|
|
53
53
|
if (styles.nextBtnSize === 'SMALL') {
|
|
54
|
-
buttonSize =
|
|
55
|
-
iconSize =
|
|
54
|
+
buttonSize = 40;
|
|
55
|
+
iconSize = 24;
|
|
56
56
|
}
|
|
57
57
|
if (styles.nextBtnSize === 'LARGE') {
|
|
58
|
-
buttonSize =
|
|
58
|
+
buttonSize = 80;
|
|
59
59
|
iconSize = 48;
|
|
60
60
|
}
|
|
61
61
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nextButton && ((0, jsx_runtime_1.jsx)(S_NextButton, __assign({ className: "cb-slidebanner-next-button", disabled: isDisabled, "$size": styles.nextBtnSize }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { fillType: "fill", baseSize: buttonSize, iconSize: iconSize, shapeType: nextButton.shapeType, borderColorKey: nextButton.borderColorKey, overrideBaseColorHex: styles.nextBtnPrimaryColor, overrideBaseColorHexHover: hoverStyles === null || hoverStyles === void 0 ? void 0 : hoverStyles.nextBtnPrimaryColor, iconName: nextButton.iconName, iconFillType: "line", iconColorKey: nextButton.iconColorKey || 'ui_cpnt_icon_sys_black', overrideIconColorHex: styles.nextBtnSecondaryColor, overrideIconColorHexHover: hoverStyles === null || hoverStyles === void 0 ? void 0 : hoverStyles.nextBtnSecondaryColor, shadow: nextButton.shadow, useDefaultActiveStyle: false, useDefaultHoverStyle: false, onClick: onClick }) }))) }));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CSSProperties } from 'styled-components';
|
|
2
|
+
export declare function getPosition(position: string, designType: string, size: string): CSSProperties;
|
|
3
|
+
export declare const POS_OUTSET: Record<string, Record<string, Record<string, CSSProperties>>>;
|
|
4
|
+
export declare const POS_INSET: Record<string, Record<string, CSSProperties>>;
|