pds-dev-kit-web-test 2.7.229 → 2.7.230
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/CompositionEditor/CompositionEditor.js +6 -5
- package/dist/src/sub/DynamicLayout/CompositionRenderer/Composition.js +17 -14
- package/dist/src/sub/DynamicLayout/CompositionRenderer/FlexGridItemForCCB.d.ts +5 -2
- package/dist/src/sub/DynamicLayout/CompositionRenderer/FlexGridItemForCCB.js +10 -11
- package/dist/src/sub/DynamicLayout/GridAutoRowEditor/GridAutoRowEditorForComposition.d.ts +9 -0
- package/dist/src/sub/DynamicLayout/GridAutoRowEditor/GridAutoRowEditorForComposition.js +250 -0
- package/dist/src/sub/DynamicLayout/GridAutoRowEditor/{GridAutoRowEditor.js → GridAutoRowEditorForDL.js} +2 -6
- 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.json +5 -3
- package/dist/src/sub/DynamicLayout/mock_componentBlocks.d.ts +16 -134
- package/dist/src/sub/DynamicLayout/mock_componentBlocks.js +91 -3
- package/dist/src/sub/DynamicLayout/mock_contentsCarousel.js +6389 -6376
- package/dist/src/sub/DynamicLayout/mock_contentsList.js +5 -3
- package/dist/src/sub/DynamicLayout/mock_slideBanner.js +6 -6
- package/dist/src/sub/DynamicLayout/mocks.js +15 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +32 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.d.ts +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +71 -38
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.js +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationNextBtn.d.ts +2 -1
- 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.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationPrevBtn.js +6 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.js +15 -12
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/elementPositions.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/elementPositions.js +243 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.js +26 -43
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.d.ts +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +45 -18
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.js +18 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/elementPositions.d.ts +4 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/elementPositions.js +108 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.js +26 -44
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/types.d.ts +1 -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 +66 -41
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.js +7 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationPrevBtn.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationPrevBtn.js +7 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.js +5 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.js +13 -11
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/elementPositions.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/elementPositions.js +243 -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 +26 -43
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +21 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +8 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +3 -1
- package/package.json +3 -2
- /package/dist/src/sub/DynamicLayout/GridAutoRowEditor/{GridAutoRowEditor.d.ts → GridAutoRowEditorForDL.d.ts} +0 -0
|
@@ -23,7 +23,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
23
23
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
24
|
var paginationConfigs_1 = require("./paginationConfigs");
|
|
25
25
|
var CustomPagination = function (_a) {
|
|
26
|
-
var _b = _a.current, current = _b === void 0 ? 1 : _b, _c = _a.total, total = _c === void 0 ? 1 : _c, styles = _a.styles, onPageClick = _a.onPageClick;
|
|
26
|
+
var _b = _a.current, current = _b === void 0 ? 1 : _b, _c = _a.total, total = _c === void 0 ? 1 : _c, styles = _a.styles, style = _a.style, onPageClick = _a.onPageClick;
|
|
27
27
|
var getPageGroupStart = function (page) {
|
|
28
28
|
return Math.floor((page - 1) / 5) * 5 + 1;
|
|
29
29
|
};
|
|
@@ -68,9 +68,9 @@ var CustomPagination = function (_a) {
|
|
|
68
68
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(S_Pagination, __assign({ className: "custom-pagination_".concat(current) }, { children: renderPagination() })));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(S_Pagination, __assign({ "data-pagination-type": styles.type, className: "custom-pagination_".concat(current) }, { children: renderPagination() })));
|
|
72
72
|
};
|
|
73
73
|
exports.CustomPagination = CustomPagination;
|
|
74
|
-
var S_Pagination = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 8px;\n"], ["\n padding: 8px;\n"])));
|
|
74
|
+
var S_Pagination = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n\n &[data-pagination-type='DESIGN1'],\n &[data-pagination-type='DESIGN2'],\n &[data-pagination-type='DESIGN3'],\n &[data-pagination-type='DESIGN4'],\n &[data-pagination-type='DESIGN5'],\n &[data-pagination-type='DESIGN6'] {\n padding: 8px 0;\n }\n"], ["\n padding: 0;\n\n &[data-pagination-type='DESIGN1'],\n &[data-pagination-type='DESIGN2'],\n &[data-pagination-type='DESIGN3'],\n &[data-pagination-type='DESIGN4'],\n &[data-pagination-type='DESIGN5'],\n &[data-pagination-type='DESIGN6'] {\n padding: 8px 0;\n }\n"])));
|
|
75
75
|
exports.default = exports.CustomPagination;
|
|
76
76
|
var templateObject_1;
|
|
@@ -8,6 +8,7 @@ type ParseContentsListStyleToCarouselCoreProps = {
|
|
|
8
8
|
};
|
|
9
9
|
type ParseContentsListContentToCarouselCoreProps = {
|
|
10
10
|
props: CB_CONTENT_PROP_CONTENTSLIST;
|
|
11
|
+
device: Device;
|
|
11
12
|
};
|
|
12
13
|
type ParseContentsListStyleToCustomPaginationProps = {
|
|
13
14
|
props: CB_STYLE_PROP_CONTENTSLIST_SPECS;
|
|
@@ -18,7 +19,7 @@ export declare function parseGridStyleProp({ props, device }: ParseContentsListS
|
|
|
18
19
|
stylePropCss: CssFragment;
|
|
19
20
|
hoverStylePropCss: CssFragment;
|
|
20
21
|
};
|
|
21
|
-
export declare function parseGridContentProp({ props }: ParseContentsListContentToCarouselCoreProps): {
|
|
22
|
+
export declare function parseGridContentProp({ props, device }: ParseContentsListContentToCarouselCoreProps): {
|
|
22
23
|
contentPropCss: CssFragment;
|
|
23
24
|
};
|
|
24
25
|
export declare function parsePaginationStyleProp({ props, device }: ParseContentsListStyleToCustomPaginationProps): {
|
|
@@ -42,10 +42,18 @@ function parseStylePropertyStyles(key, value) {
|
|
|
42
42
|
function getColumnsPropStyleValues(value, rows) {
|
|
43
43
|
return (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(", ", 1fr);\n "], ["\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(", ", 1fr);\n "])), value, rows);
|
|
44
44
|
}
|
|
45
|
-
function parseContentPropertyStyles(key, value, rows) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
function parseContentPropertyStyles(key, value, rows, device) {
|
|
46
|
+
if (device === 'DESKTOP') {
|
|
47
|
+
switch (key) {
|
|
48
|
+
case 'CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS':
|
|
49
|
+
return getColumnsPropStyleValues(value, rows);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (device === 'MOBILE') {
|
|
53
|
+
switch (key) {
|
|
54
|
+
case 'CB_CONTENT_PROP_CONTENTSLIST_SPEC_MCOLUMNS':
|
|
55
|
+
return getColumnsPropStyleValues(value, rows);
|
|
56
|
+
}
|
|
49
57
|
}
|
|
50
58
|
return undefined;
|
|
51
59
|
}
|
|
@@ -70,16 +78,19 @@ function parseGridStyleProp(_a) {
|
|
|
70
78
|
}
|
|
71
79
|
exports.parseGridStyleProp = parseGridStyleProp;
|
|
72
80
|
function parseGridContentProp(_a) {
|
|
73
|
-
var props = _a.props;
|
|
81
|
+
var props = _a.props, device = _a.device;
|
|
74
82
|
var availableSpecCodes = Object.keys(props).filter(function (key) { return !key.includes(':HOVER') && !key.includes(':MOBILE'); });
|
|
75
83
|
var displayCounts = props.CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS ||
|
|
76
84
|
props.CB_CONTENT_PROP_CONTENTSLIST_SPEC_ITEMCOUNTS ||
|
|
77
85
|
1;
|
|
78
|
-
var
|
|
86
|
+
var columnsByDevice = device === 'DESKTOP'
|
|
87
|
+
? props.CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS
|
|
88
|
+
: props.CB_CONTENT_PROP_CONTENTSLIST_SPEC_MCOLUMNS;
|
|
89
|
+
var columns = Math.min(columnsByDevice, displayCounts);
|
|
79
90
|
var rows = Math.ceil(displayCounts / columns);
|
|
80
91
|
return availableSpecCodes.reduce(function (acc, currentKey) {
|
|
81
92
|
var value = props[currentKey];
|
|
82
|
-
var styles = parseContentPropertyStyles(currentKey, value, rows);
|
|
93
|
+
var styles = parseContentPropertyStyles(currentKey, value, rows, device);
|
|
83
94
|
return {
|
|
84
95
|
contentPropCss: (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n ", "\n "], ["\n ", "\n ", "\n "])), acc.contentPropCss, styles)
|
|
85
96
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ContentsListElementsProps } from '../ContentsList';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
export declare function getPosition(position: string, designType: string, size: string, elementType: ContentsListElementsProps['type'] | 'GROUP'): CSSProperties;
|
|
4
|
+
export declare const POS_INSET: Record<string, CSSProperties>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POS_INSET = exports.getPosition = void 0;
|
|
4
|
+
var GAP = 8;
|
|
5
|
+
function getPosition(position, designType, size, elementType) {
|
|
6
|
+
if (position.startsWith('OUTSET')) {
|
|
7
|
+
if (elementType === 'GROUP') {
|
|
8
|
+
return POS_OUTSET_GROUP[position];
|
|
9
|
+
}
|
|
10
|
+
var val = POS_OUTSET_PAGINATION[position];
|
|
11
|
+
return val;
|
|
12
|
+
}
|
|
13
|
+
if (elementType === 'GROUP') {
|
|
14
|
+
return exports.POS_INSET[position];
|
|
15
|
+
}
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
exports.getPosition = getPosition;
|
|
19
|
+
exports.POS_INSET = {
|
|
20
|
+
INSET1: { top: GAP, left: GAP },
|
|
21
|
+
INSET2: { top: GAP, left: '50%', transform: 'translateX(-50%)' },
|
|
22
|
+
INSET3: { top: GAP, right: GAP },
|
|
23
|
+
INSET4: { top: '50%', right: GAP, transform: 'translateY(-50%)' },
|
|
24
|
+
INSET5: { bottom: GAP, right: GAP },
|
|
25
|
+
INSET6: { bottom: GAP, left: '50%', transform: 'translateX(-50%)' },
|
|
26
|
+
INSET7: { left: GAP, bottom: GAP },
|
|
27
|
+
INSET8: { top: '50%', left: GAP, transform: 'translateY(-50%)' }
|
|
28
|
+
};
|
|
29
|
+
var POS_OUTSET_PAGINATION = {
|
|
30
|
+
OUTSET1: { bottom: 15 },
|
|
31
|
+
OUTSET2: { bottom: 15 },
|
|
32
|
+
OUTSET3: { bottom: 15 },
|
|
33
|
+
OUTSET4: { left: 15 },
|
|
34
|
+
OUTSET5: { left: 15 },
|
|
35
|
+
OUTSET6: { left: 15 },
|
|
36
|
+
OUTSET7: { top: 15 },
|
|
37
|
+
OUTSET8: { top: 15 },
|
|
38
|
+
OUTSET9: { top: 15 },
|
|
39
|
+
OUTSET10: { right: 15 },
|
|
40
|
+
OUTSET11: { right: 15 },
|
|
41
|
+
OUTSET12: { right: 15 }
|
|
42
|
+
};
|
|
43
|
+
var POS_OUTSET_GROUP = {
|
|
44
|
+
OUTSET1: {
|
|
45
|
+
top: 0,
|
|
46
|
+
height: 0
|
|
47
|
+
},
|
|
48
|
+
OUTSET2: {
|
|
49
|
+
bottom: '100%',
|
|
50
|
+
height: 0,
|
|
51
|
+
left: '50%',
|
|
52
|
+
transform: 'translateX(-50%)'
|
|
53
|
+
},
|
|
54
|
+
OUTSET3: {
|
|
55
|
+
bottom: '100%',
|
|
56
|
+
height: 0,
|
|
57
|
+
right: 0,
|
|
58
|
+
justifyContent: 'flex-start'
|
|
59
|
+
},
|
|
60
|
+
OUTSET4: {
|
|
61
|
+
top: 0,
|
|
62
|
+
width: 0,
|
|
63
|
+
right: 0
|
|
64
|
+
},
|
|
65
|
+
OUTSET5: {
|
|
66
|
+
top: '50%',
|
|
67
|
+
width: 0,
|
|
68
|
+
right: 0,
|
|
69
|
+
transform: 'translateY(-50%)'
|
|
70
|
+
},
|
|
71
|
+
OUTSET6: {
|
|
72
|
+
bottom: 0,
|
|
73
|
+
width: 0,
|
|
74
|
+
right: 0
|
|
75
|
+
},
|
|
76
|
+
OUTSET7: {
|
|
77
|
+
bottom: 0,
|
|
78
|
+
height: 0,
|
|
79
|
+
right: 0
|
|
80
|
+
},
|
|
81
|
+
OUTSET8: {
|
|
82
|
+
bottom: 0,
|
|
83
|
+
height: 0,
|
|
84
|
+
left: '50%',
|
|
85
|
+
transform: 'translateX(-50%)'
|
|
86
|
+
},
|
|
87
|
+
OUTSET9: {
|
|
88
|
+
bottom: 0,
|
|
89
|
+
height: 0,
|
|
90
|
+
left: 0
|
|
91
|
+
},
|
|
92
|
+
OUTSET10: {
|
|
93
|
+
bottom: 0,
|
|
94
|
+
width: 0,
|
|
95
|
+
left: 0
|
|
96
|
+
},
|
|
97
|
+
OUTSET11: {
|
|
98
|
+
top: '50%',
|
|
99
|
+
width: 0,
|
|
100
|
+
left: 0,
|
|
101
|
+
transform: 'translateY(-50%)'
|
|
102
|
+
},
|
|
103
|
+
OUTSET12: {
|
|
104
|
+
top: 0,
|
|
105
|
+
width: 0,
|
|
106
|
+
left: 0
|
|
107
|
+
}
|
|
108
|
+
};
|
|
@@ -13,6 +13,6 @@ export declare const useFlexGridLayout: ({ components }: {
|
|
|
13
13
|
left: string;
|
|
14
14
|
};
|
|
15
15
|
componentGroups: Record<string, ContentsListElementsProps[]>;
|
|
16
|
-
getPositionStyle: (position: string, ccbInset: Record<string, string
|
|
16
|
+
getPositionStyle: (position: string, ccbInset: Record<string, string>, designType: string, size: 'LARGE' | 'MEDIUM' | 'SMALL' | 'GROUP', elementType: string) => CSSProperties;
|
|
17
17
|
getComponentGroupLayout: (components: ContentsListElementsProps[], position: string) => CSSProperties;
|
|
18
18
|
};
|
|
@@ -13,6 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.useFlexGridLayout = void 0;
|
|
15
15
|
var react_1 = require("react");
|
|
16
|
+
var elementPositions_1 = require("./elementPositions");
|
|
16
17
|
var useFlexGridLayout = function (_a) {
|
|
17
18
|
var components = _a.components;
|
|
18
19
|
var _b = (0, react_1.useState)({ top: 0, right: 0, bottom: 0, left: 0 }), groupSizes = _b[0], setGroupSizes = _b[1];
|
|
@@ -59,51 +60,33 @@ var useFlexGridLayout = function (_a) {
|
|
|
59
60
|
};
|
|
60
61
|
return directions[position];
|
|
61
62
|
};
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
var getPositionStyle = function (position, ccbInset, designType, size, elementType) {
|
|
64
|
+
var EAST = ['OUTSET4', 'OUTSET5', 'OUTSET6'];
|
|
65
|
+
var WEST = ['OUTSET10', 'OUTSET11', 'OUTSET12'];
|
|
66
|
+
var SOUTH = ['OUTSET7', 'OUTSET8', 'OUTSET9'];
|
|
67
|
+
var NORTH = ['OUTSET1', 'OUTSET2', 'OUTSET3'];
|
|
68
|
+
var isEAST = EAST.includes(position);
|
|
69
|
+
var isWEST = WEST.includes(position);
|
|
70
|
+
var isSOUTH = SOUTH.includes(position);
|
|
71
|
+
var isNORTH = NORTH.includes(position);
|
|
64
72
|
var base = {
|
|
65
|
-
position: '
|
|
73
|
+
position: 'relative',
|
|
66
74
|
display: 'flex',
|
|
67
|
-
alignItems: 'center',
|
|
68
|
-
justifyContent: 'center'
|
|
75
|
+
alignItems: isSOUTH ? 'flex-start' : isNORTH ? 'flex-end' : 'center',
|
|
76
|
+
justifyContent: isEAST ? 'flex-start' : isWEST ? 'flex-end' : 'center'
|
|
69
77
|
};
|
|
70
|
-
// CCB의 중앙 위치 계산
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// CCB의 실제 크기와 중앙 위치 계산
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
OUTSET2: { top: -50, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
83
|
-
OUTSET3: { top: -50, right: ccbRight },
|
|
84
|
-
OUTSET4: { top: ccbTop, right: -50 },
|
|
85
|
-
OUTSET5: { top: "".concat(ccbCenterY, "px"), right: -50, transform: 'translateY(-50%)' },
|
|
86
|
-
OUTSET6: { bottom: ccbBottom, right: -50 },
|
|
87
|
-
OUTSET7: { bottom: -50, right: ccbRight },
|
|
88
|
-
OUTSET8: { bottom: -50, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
89
|
-
OUTSET9: { bottom: -50, left: ccbLeft },
|
|
90
|
-
OUTSET10: { bottom: ccbBottom, left: -50 },
|
|
91
|
-
OUTSET11: { top: "".concat(ccbCenterY, "px"), left: -50, transform: 'translateY(-50%)' },
|
|
92
|
-
OUTSET12: { top: ccbTop, left: -50 },
|
|
93
|
-
INSET1: { top: ccbTop + GAP, left: ccbLeft + GAP },
|
|
94
|
-
INSET2: { top: ccbTop + GAP, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
95
|
-
INSET3: { top: ccbTop + GAP, right: ccbRight + GAP },
|
|
96
|
-
INSET4: { top: "".concat(ccbCenterY, "px"), right: ccbRight + GAP, transform: 'translateY(-50%)' },
|
|
97
|
-
INSET5: { bottom: ccbBottom + GAP, right: ccbRight + GAP },
|
|
98
|
-
INSET6: {
|
|
99
|
-
bottom: ccbBottom + GAP,
|
|
100
|
-
left: "".concat(ccbCenterX, "px"),
|
|
101
|
-
transform: 'translateX(-50%)'
|
|
102
|
-
},
|
|
103
|
-
INSET7: { bottom: ccbBottom + GAP, left: ccbLeft + GAP },
|
|
104
|
-
INSET8: { top: "".concat(ccbCenterY, "px"), left: ccbLeft + GAP, transform: 'translateY(-50%)' }
|
|
105
|
-
};
|
|
106
|
-
return __assign(__assign({}, base), positions[position]);
|
|
78
|
+
// // CCB의 중앙 위치 계산
|
|
79
|
+
// const ccbTop = parseFloat(ccbInset.top) || 0;
|
|
80
|
+
// const ccbRight = parseFloat(ccbInset.right) || 0;
|
|
81
|
+
// const ccbBottom = parseFloat(ccbInset.bottom) || 0;
|
|
82
|
+
// const ccbLeft = parseFloat(ccbInset.left) || 0;
|
|
83
|
+
// // CCB의 실제 크기와 중앙 위치 계산
|
|
84
|
+
// const ccbWidth = layoutSize.width - ccbLeft - ccbRight;
|
|
85
|
+
// const ccbHeight = layoutSize.height - ccbTop - ccbBottom;
|
|
86
|
+
// const ccbCenterX = ccbLeft + ccbWidth / 2;
|
|
87
|
+
// const ccbCenterY = ccbTop + ccbHeight / 2;
|
|
88
|
+
var pos = (0, elementPositions_1.getPosition)(position, designType, size, elementType);
|
|
89
|
+
return __assign(__assign({}, base), pos);
|
|
107
90
|
};
|
|
108
91
|
// 컴포넌트 그룹 레이아웃
|
|
109
92
|
var getComponentGroupLayout = function (components, position) {
|
|
@@ -129,8 +112,7 @@ var useFlexGridLayout = function (_a) {
|
|
|
129
112
|
return {
|
|
130
113
|
display: 'flex',
|
|
131
114
|
flexDirection: isHorizontal ? 'row' : 'column',
|
|
132
|
-
gap: '8px'
|
|
133
|
-
alignItems: 'center'
|
|
115
|
+
gap: '8px'
|
|
134
116
|
};
|
|
135
117
|
};
|
|
136
118
|
// ccbInset 계산
|
|
@@ -7,7 +7,7 @@ export type CB_STYLE_PROP_CONTENTSLIST_SPEC_ITEMSPACING_TYPE = 'WIDE' | 'NORMAL'
|
|
|
7
7
|
export type CB_STYLE_PROP_CONTENTSLIST_SPEC_ITEMLINEHEIGHT_TYPE = NUMBER_INTEGER | null;
|
|
8
8
|
export type CB_STYLE_PROP_CONTENTSLIST_SPEC_ITEMHEIGHTFITCONTENT_TYPE = boolean | null;
|
|
9
9
|
export type CB_STYLE_PROP_CONTENTSLIST_SPEC_INFINITESCROLL_TYPE = boolean | null;
|
|
10
|
-
export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSTYLE_TYPE = 'NONE' | 'DESIGN1' | 'DESIGN2' | 'DESIGN3' | 'DESIGN4' | 'DESIGN5' | 'DESIGN6' | 'DESIGN7' | 'DESIGN8' | 'DESIGN9' | 'DESIGN10' | 'DESIGN11' | 'DESIGN12' | 'DESIGN13' | 'DESIGN14' | 'DESIGN15' | 'DESIGN16' | 'DESIGN17'
|
|
10
|
+
export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSTYLE_TYPE = 'NONE' | 'DESIGN1' | 'DESIGN2' | 'DESIGN3' | 'DESIGN4' | 'DESIGN5' | 'DESIGN6' | 'DESIGN7' | 'DESIGN8' | 'DESIGN9' | 'DESIGN10' | 'DESIGN11' | 'DESIGN12' | 'DESIGN13' | 'DESIGN14' | 'DESIGN15' | 'DESIGN16' | 'DESIGN17';
|
|
11
11
|
export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONLOCATION_TYPE = OUTSET_POSTIION | INSET_POSTIION;
|
|
12
12
|
export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSIZE_TYPE = 'SMALL' | 'MEDIUM' | 'LARGE' | null;
|
|
13
13
|
export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONPRIMARYCOLOR = string;
|
|
@@ -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;
|
|
@@ -29,6 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
31
|
var react_1 = require("react");
|
|
32
|
+
var react_i18next_1 = require("react-i18next");
|
|
32
33
|
var CustomSectionBackgroundMedia_1 = require("../../../../../../../DynamicLayout/components/Section/components/CustomSectionBackgroundMedia");
|
|
33
34
|
var createCompositions_1 = require("../../../../../../../DynamicLayout/CompositionRenderer/createCompositions");
|
|
34
35
|
var dynamicLayoutContext_1 = require("../../../../../../../DynamicLayout/dynamicLayoutContext");
|
|
@@ -42,12 +43,15 @@ var CustomNavigationNextBtn_1 = require("./components/CustomNavigationNextBtn");
|
|
|
42
43
|
var CustomNavigationPrevBtn_1 = require("./components/CustomNavigationPrevBtn");
|
|
43
44
|
var CustomPagination_1 = require("./components/CustomPagination");
|
|
44
45
|
var CustomProgressbar_1 = require("./components/CustomProgressbar");
|
|
46
|
+
require("./hooks/elementPositions");
|
|
45
47
|
var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
|
|
46
48
|
var useSwiper_1 = require("./hooks/useSwiper");
|
|
47
49
|
var SlideBannerCore_1 = __importDefault(require("./SlideBannerCore"));
|
|
48
50
|
var slideBannerUtils_1 = require("./slideBannerUtils");
|
|
49
|
-
var createComponent = function (type, getDesignType, getLocation) {
|
|
50
|
-
|
|
51
|
+
var createComponent = function (type, getDesignType, getLocation, designType, size) {
|
|
52
|
+
if (size === void 0) { size = 'MEDIUM'; }
|
|
53
|
+
return function (normalStyle, hoverStyle, isHovered, size) {
|
|
54
|
+
if (size === void 0) { size = 'MEDIUM'; }
|
|
51
55
|
var normalDesign = getDesignType(normalStyle);
|
|
52
56
|
var hoverDesign = getDesignType(hoverStyle);
|
|
53
57
|
if (isHovered && hoverDesign === 'NONE')
|
|
@@ -56,34 +60,40 @@ var createComponent = function (type, getDesignType, getLocation) {
|
|
|
56
60
|
return undefined;
|
|
57
61
|
return {
|
|
58
62
|
type: type,
|
|
59
|
-
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle)
|
|
63
|
+
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle),
|
|
64
|
+
designType: designType,
|
|
65
|
+
size: size
|
|
60
66
|
};
|
|
61
67
|
};
|
|
62
68
|
};
|
|
63
69
|
function SlideBanner(props) {
|
|
64
|
-
var _a
|
|
65
|
-
var
|
|
70
|
+
var _a;
|
|
71
|
+
var _b = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _b.device, mode = _b.mode, queryData = _b.queryData;
|
|
72
|
+
var index = props.index, _c = props.CB_CONTENT_PROP_SLIDEBANNER, CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS, CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE, CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA, CB_CONTENT_PROP_SLIDEBANNER_SPEC_MANUALITEMS = _c.CB_CONTENT_PROP_SLIDEBANNER_SPEC_MANUALITEMS, CB_STYLE_PROP_SLIDEBANNERDESIGN = props.CB_STYLE_PROP_SLIDEBANNERDESIGN, CB_STYLE_PROP_SLIDEBANNERPAGINATION = props.CB_STYLE_PROP_SLIDEBANNERPAGINATION, CB_STYLE_PROP_SLIDEBANNERBUTTON = props.CB_STYLE_PROP_SLIDEBANNERBUTTON, CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD = props.CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD, CB_STYLE_PROP_SLIDEBANNERPROGRESSBAR = props.CB_STYLE_PROP_SLIDEBANNERPROGRESSBAR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, CB_STYLE_PROP_BGMEDIA = props.CB_STYLE_PROP_BGMEDIA, CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE = props.CB_EFFECT_PROP_SLIDEBANNER.CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE;
|
|
66
73
|
var compositions = props.compositions;
|
|
67
74
|
var CB_STYLE_PROP_SLIDEBANNER = __assign(__assign(__assign(__assign(__assign({}, CB_STYLE_PROP_SLIDEBANNERDESIGN), CB_STYLE_PROP_SLIDEBANNERPAGINATION), CB_STYLE_PROP_SLIDEBANNERBUTTON), CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD), CB_STYLE_PROP_SLIDEBANNERPROGRESSBAR);
|
|
68
|
-
var
|
|
69
|
-
|
|
75
|
+
var autoPlayEnabled = device === 'DESKTOP'
|
|
76
|
+
? CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD.CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE
|
|
77
|
+
: (_a = CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD['CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE:MOBILE']) !== null && _a !== void 0 ? _a : CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD.CB_STYLE_PROP_SLIDEBANNERPLAYBACKMETHOD_SPEC_AUTOPLAYUSE;
|
|
78
|
+
var _d = (0, util_1.parseProperties)(props, device), style = _d.style, hoverStyle = _d.hoverStyle, layout = _d.layout, overlayStyle = _d.overlayStyle, effect = _d.effect;
|
|
79
|
+
var _e = (0, slideBannerUtils_1.parseSlideBannerStyleToSlideBannerCoreProp)({
|
|
70
80
|
props: CB_STYLE_PROP_SLIDEBANNER,
|
|
71
81
|
device: device
|
|
72
|
-
}), slideBannerNormalStyle =
|
|
73
|
-
var
|
|
82
|
+
}), slideBannerNormalStyle = _e.normalStyle, slideBannerHoverStyle = _e.hoverStyle;
|
|
83
|
+
var _f = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomPaginationProp)({
|
|
74
84
|
props: CB_STYLE_PROP_SLIDEBANNER,
|
|
75
85
|
device: device
|
|
76
|
-
}), customPaginationNormalStyle =
|
|
77
|
-
var
|
|
86
|
+
}), customPaginationNormalStyle = _f.normalStyle, customPaginationHoverStyle = _f.hoverStyle;
|
|
87
|
+
var _g = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomNavigationProp)({
|
|
78
88
|
props: CB_STYLE_PROP_SLIDEBANNER,
|
|
79
89
|
device: device
|
|
80
|
-
}), customNavigationNormalStyle =
|
|
81
|
-
var
|
|
90
|
+
}), customNavigationNormalStyle = _g.normalStyle, customNavigationHoverStyle = _g.hoverStyle;
|
|
91
|
+
var _h = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomProgressbarProp)({
|
|
82
92
|
props: CB_STYLE_PROP_SLIDEBANNER,
|
|
83
93
|
device: device
|
|
84
|
-
}), customProgressbarNormalStyle =
|
|
85
|
-
var
|
|
86
|
-
var
|
|
94
|
+
}), customProgressbarNormalStyle = _h.normalStyle, customProgressbarHoverStyle = _h.hoverStyle;
|
|
95
|
+
var _j = (0, useSwiper_1.useSwiper)(), swiperRef = _j.swiperRef, progressRef = _j.progressRef, leftTimeMsRef = _j.leftTimeMsRef, currentSlide = _j.currentSlide, isBeginning = _j.isBeginning, isEnd = _j.isEnd, onSwiper = _j.onSwiper, onSlideChangeTransitionEnd = _j.onSlideChangeTransitionEnd, onAutoplayTimeLeft = _j.onAutoplayTimeLeft, onClickBullet = _j.onClickBullet, onClickPrevBtn = _j.onClickPrevBtn, onClickNextBtn = _j.onClickNextBtn;
|
|
96
|
+
var _k = (0, react_1.useState)(false), isHovered = _k[0], setIsHovered = _k[1];
|
|
87
97
|
var loop = isHovered ? slideBannerNormalStyle.loop : slideBannerHoverStyle.loop;
|
|
88
98
|
// NOTE: edit모드에서는 그리드의 이벤트만 작동하도록 CB의 포인터 이벤트는 막습니다.
|
|
89
99
|
var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
|
|
@@ -99,35 +109,27 @@ function SlideBanner(props) {
|
|
|
99
109
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
100
110
|
var hasEffect = !isNoneEffectType;
|
|
101
111
|
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'; });
|
|
112
|
+
var createPrevButton = createComponent('PREV', function (style) { return style.prevBtnType || 'NONE'; }, function (style) { return style.prevBtnLocation || 'OUTSET1'; }, customNavigationNormalStyle.prevBtnType || 'NONE', customNavigationNormalStyle.prevBtnSize || 'MEDIUM');
|
|
113
|
+
var createNextButton = createComponent('NEXT', function (style) { return style.nextBtnType || 'NONE'; }, function (style) { return style.nextBtnLocation || 'OUTSET1'; }, customNavigationNormalStyle.nextBtnType || 'NONE', customNavigationNormalStyle.nextBtnSize || 'MEDIUM');
|
|
114
|
+
var createPagination = createComponent('PAGINATION', function (style) { return style.type || 'NONE'; }, function (style) { return style.location || 'OUTSET1'; }, customPaginationNormalStyle.type || 'NONE', customPaginationNormalStyle.size || 'MEDIUM');
|
|
105
115
|
var components = [
|
|
106
116
|
createPrevButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
107
117
|
createNextButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
108
118
|
createPagination(customPaginationNormalStyle, customPaginationHoverStyle, isHovered),
|
|
109
119
|
{ type: 'PROGRESSBAR', position: 'INSET5' }
|
|
110
120
|
].filter(function (component) { return component !== undefined; });
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
componentGroups = _k.componentGroups, getPositionStyle = _k.getPositionStyle, getComponentGroupLayout = _k.getComponentGroupLayout;
|
|
114
|
-
var ccbInset = {
|
|
115
|
-
top: '0px',
|
|
116
|
-
right: '0px',
|
|
117
|
-
bottom: '0px',
|
|
118
|
-
left: '0px'
|
|
119
|
-
};
|
|
120
|
-
var renderElements = function (component) {
|
|
121
|
+
var _l = (0, useFlexGridLayout_1.useFlexGridLayout)({ components: components }), layoutRef = _l.layoutRef, positionRefs = _l.positionRefs, ccbInset = _l.ccbInset, componentGroups = _l.componentGroups, getPositionStyle = _l.getPositionStyle, getComponentGroupLayout = _l.getComponentGroupLayout;
|
|
122
|
+
var renderElements = function (component, positionStyle) {
|
|
121
123
|
var _a;
|
|
122
124
|
switch (component.type) {
|
|
123
125
|
case 'PREV':
|
|
124
|
-
return ((0, jsx_runtime_1.jsx)(CustomNavigationPrevBtn_1.CustomNavigationPrevBtn, { isDisabled: loop ? false : isBeginning, styles: customNavigationNormalStyle, hoverStyles: customNavigationHoverStyle, onClick: onClickPrevBtn }));
|
|
126
|
+
return ((0, jsx_runtime_1.jsx)(CustomNavigationPrevBtn_1.CustomNavigationPrevBtn, { isDisabled: loop ? false : isBeginning, styles: customNavigationNormalStyle, hoverStyles: customNavigationHoverStyle, onClick: onClickPrevBtn, style: positionStyle }));
|
|
125
127
|
case 'NEXT':
|
|
126
|
-
return ((0, jsx_runtime_1.jsx)(CustomNavigationNextBtn_1.CustomNavigationNextBtn, { isDisabled: loop ? false : isEnd, styles: customNavigationNormalStyle, hoverStyles: customNavigationHoverStyle, onClick: onClickNextBtn }));
|
|
128
|
+
return ((0, jsx_runtime_1.jsx)(CustomNavigationNextBtn_1.CustomNavigationNextBtn, { isDisabled: loop ? false : isEnd, styles: customNavigationNormalStyle, hoverStyles: customNavigationHoverStyle, onClick: onClickNextBtn, style: positionStyle }));
|
|
127
129
|
case 'PAGINATION':
|
|
128
|
-
return ((0, jsx_runtime_1.jsx)(CustomPagination_1.CustomPagination, { styles: isHovered ? customPaginationHoverStyle : customPaginationNormalStyle, current: currentSlide, isPrevBtnDisabled: loop ? false : isBeginning, isNextBtnDisabled: loop ? false : isEnd, total: ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slides.length) || 0, onBulletClick: onClickBullet, onPrevBtnClick: onClickPrevBtn, onNextBtnClick: onClickNextBtn }));
|
|
130
|
+
return ((0, jsx_runtime_1.jsx)(CustomPagination_1.CustomPagination, { styles: isHovered ? customPaginationHoverStyle : customPaginationNormalStyle, current: currentSlide, isPrevBtnDisabled: loop ? false : isBeginning, isNextBtnDisabled: loop ? false : isEnd, total: ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slides.length) || 0, onBulletClick: onClickBullet, onPrevBtnClick: onClickPrevBtn, onNextBtnClick: onClickNextBtn, style: positionStyle }));
|
|
129
131
|
case 'PROGRESSBAR':
|
|
130
|
-
return ((0, jsx_runtime_1.jsx)(CustomProgressbar_1.CustomProgressbar, { progressRef: progressRef, leftTimeMsRef: leftTimeMsRef, styles: isHovered ? customProgressbarHoverStyle : customProgressbarNormalStyle }));
|
|
132
|
+
return ((0, jsx_runtime_1.jsx)(CustomProgressbar_1.CustomProgressbar, { slidesLength: orderedCompositions.length, progressRef: progressRef, leftTimeMsRef: leftTimeMsRef, styles: isHovered ? customProgressbarHoverStyle : customProgressbarNormalStyle }));
|
|
131
133
|
default:
|
|
132
134
|
return null;
|
|
133
135
|
}
|
|
@@ -150,17 +152,40 @@ function SlideBanner(props) {
|
|
|
150
152
|
else {
|
|
151
153
|
delete positionRefs.current[position];
|
|
152
154
|
}
|
|
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) {
|
|
154
|
-
|
|
155
|
+
}, style: __assign(__assign({}, getPositionStyle(position, ccbInset, 'GROUP', 'GROUP', 'GROUP')), { zIndex: 3, position: 'absolute' }) }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-slidebanner-button-layout-box", style: getComponentGroupLayout(groupComponents, position) }, { children: groupComponents.map(function (component) {
|
|
156
|
+
return renderElements(component, getPositionStyle(position, ccbInset, component.designType, component.size, component.type));
|
|
157
|
+
}) })) }), position));
|
|
158
|
+
}), (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 }), orderedCompositions.length > 0 ? ((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
|
|
159
|
+
? slideBannerHoverStyle === null || slideBannerHoverStyle === void 0 ? void 0 : slideBannerHoverStyle.customStyle
|
|
160
|
+
: 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.toLowerCase() }, { children: (0, createCompositions_1.createCompositions)({
|
|
155
161
|
valueType: CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE,
|
|
156
162
|
queryPath: CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA,
|
|
157
163
|
limit: CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS,
|
|
158
164
|
queryData: queryData,
|
|
159
165
|
compositions: orderedCompositions
|
|
160
|
-
}) }), CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE
|
|
166
|
+
}) }), CB_EFFECT_PROP_SLIDEBANNER_SPEC_TRANSITIONTYPE +
|
|
167
|
+
autoPlayEnabled +
|
|
168
|
+
orderedCompositions.length) })) }))) : ((0, jsx_runtime_1.jsx)(EmptyString, {}))] })) }))] }));
|
|
169
|
+
}
|
|
170
|
+
function EmptyString() {
|
|
171
|
+
var t = (0, react_i18next_1.useTranslation)('translation').t;
|
|
172
|
+
return (0, jsx_runtime_1.jsx)(S_EmptyLayer, { children: t('str_9806') });
|
|
161
173
|
}
|
|
162
|
-
var
|
|
163
|
-
var
|
|
174
|
+
var S_EmptyLayer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: rgba(0, 0, 0, 0.6);\n color: white;\n display: flex;\n font-size: ", ";\n font-weight: ", ";\n justify-content: center;\n line-height: ", ";\n margin: auto;\n padding: ", ";\n text-align: center;\n width: 100%;\n word-break: keep-all;\n"], ["\n background-color: rgba(0, 0, 0, 0.6);\n color: white;\n display: flex;\n font-size: ", ";\n font-weight: ", ";\n justify-content: center;\n line-height: ", ";\n margin: auto;\n padding: ", ";\n text-align: center;\n width: 100%;\n word-break: keep-all;\n"])), function (_a) {
|
|
175
|
+
var theme = _a.theme;
|
|
176
|
+
return theme.desktopFontSize.body2;
|
|
177
|
+
}, function (_a) {
|
|
178
|
+
var theme = _a.theme;
|
|
179
|
+
return theme.fontWeight.bold;
|
|
180
|
+
}, function (_a) {
|
|
181
|
+
var theme = _a.theme;
|
|
182
|
+
return theme.desktopLineHeight.body2;
|
|
183
|
+
}, function (_a) {
|
|
184
|
+
var theme = _a.theme;
|
|
185
|
+
return theme.spacing.spacingE;
|
|
186
|
+
});
|
|
187
|
+
var S_Overlay = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: inherit;\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n"], ["\n border-radius: inherit;\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n"])));
|
|
188
|
+
var S_CustomBackgroundWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n border-radius: inherit;\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -2;\n"], ["\n align-items: center;\n border-radius: inherit;\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -2;\n"])));
|
|
164
189
|
function getIsBgMedia(isMobile, specs) {
|
|
165
190
|
if (!specs) {
|
|
166
191
|
return false;
|
|
@@ -181,8 +206,8 @@ function getMediaType(isMobile, specs) {
|
|
|
181
206
|
}
|
|
182
207
|
return specs.CB_STYLE_PROP_BGMEDIA_SPEC_TYPE;
|
|
183
208
|
}
|
|
184
|
-
var S_SwiperLayout = styled_components_1.default.div(
|
|
185
|
-
var S_SwiperWrapper = styled_components_1.default.div(
|
|
209
|
+
var S_SwiperLayout = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100%;\n margin: 0 auto;\n position: relative;\n width: 100%;\n"], ["\n height: 100%;\n margin: 0 auto;\n position: relative;\n width: 100%;\n"])));
|
|
210
|
+
var S_SwiperWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n bottom: ", ";\n left: ", ";\n position: absolute;\n right: ", ";\n top: ", ";\n ", ";\n"], ["\n bottom: ", ";\n left: ", ";\n position: absolute;\n right: ", ";\n top: ", ";\n ", ";\n"])), function (_a) {
|
|
186
211
|
var ccbInset = _a.ccbInset;
|
|
187
212
|
return ccbInset.bottom;
|
|
188
213
|
}, function (_a) {
|
|
@@ -199,4 +224,4 @@ var S_SwiperWrapper = styled_components_1.default.div(templateObject_4 || (templ
|
|
|
199
224
|
return customStyle;
|
|
200
225
|
});
|
|
201
226
|
exports.default = SlideBanner;
|
|
202
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
227
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -4,9 +4,10 @@ export interface CustomNavigationNextBtnProps {
|
|
|
4
4
|
isDisabled: boolean;
|
|
5
5
|
styles: CustomNavigationProps;
|
|
6
6
|
hoverStyles?: CustomNavigationProps;
|
|
7
|
+
style?: React.CSSProperties;
|
|
7
8
|
onClick?: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const CustomNavigationNextBtn: ({ isDisabled, styles, hoverStyles, onClick }: CustomNavigationNextBtnProps) => JSX.Element;
|
|
10
|
+
export declare const CustomNavigationNextBtn: ({ isDisabled, styles, hoverStyles, style, onClick }: CustomNavigationNextBtnProps) => JSX.Element;
|
|
10
11
|
export interface FlexBoxProps {
|
|
11
12
|
direction?: 'row' | 'column';
|
|
12
13
|
justifyContent?: string;
|
|
@@ -44,24 +44,24 @@ var IconButton_1 = require("../../../../../../../../DynamicLayout/components/pds
|
|
|
44
44
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
45
45
|
var navigationConfigs_1 = require("./navigationConfigs");
|
|
46
46
|
var CustomNavigationNextBtn = function (_a) {
|
|
47
|
-
var isDisabled = _a.isDisabled, styles = _a.styles, hoverStyles = _a.hoverStyles, onClick = _a.onClick;
|
|
47
|
+
var isDisabled = _a.isDisabled, styles = _a.styles, hoverStyles = _a.hoverStyles, style = _a.style, onClick = _a.onClick;
|
|
48
48
|
var nextButton = styles.nextBtnType === 'NONE'
|
|
49
49
|
? undefined
|
|
50
50
|
: navigationConfigs_1.nextButtonMappedIcons[styles.nextBtnType || 'DESIGN1'];
|
|
51
|
-
var buttonSize =
|
|
51
|
+
var buttonSize = 48;
|
|
52
52
|
var iconSize = 24;
|
|
53
53
|
if (styles.nextBtnSize === 'SMALL') {
|
|
54
|
-
buttonSize =
|
|
55
|
-
iconSize =
|
|
54
|
+
buttonSize = 40;
|
|
55
|
+
iconSize = 20;
|
|
56
56
|
}
|
|
57
57
|
if (styles.nextBtnSize === 'LARGE') {
|
|
58
|
-
buttonSize =
|
|
58
|
+
buttonSize = 80;
|
|
59
59
|
iconSize = 48;
|
|
60
60
|
}
|
|
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 }) }))) }));
|
|
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, style: style }, { 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 }) }))) }));
|
|
62
62
|
};
|
|
63
63
|
exports.CustomNavigationNextBtn = CustomNavigationNextBtn;
|
|
64
|
-
var S_NextButton = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n cursor: pointer;\n\n ", ";\n"], ["\n cursor: pointer;\n\n ", ";\n"])), function (_a) {
|
|
64
|
+
var S_NextButton = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n cursor: pointer;\n position: relative;\n\n ", ";\n"], ["\n cursor: pointer;\n position: relative;\n\n ", ";\n"])), function (_a) {
|
|
65
65
|
var disabled = _a.disabled;
|
|
66
66
|
return disabled && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: auto;\n opacity: 0.35;\n pointer-events: none;\n "], ["\n cursor: auto;\n opacity: 0.35;\n pointer-events: none;\n "])));
|
|
67
67
|
});
|
|
@@ -4,9 +4,10 @@ export interface CustomNavigationPrevBtnProps {
|
|
|
4
4
|
isDisabled: boolean;
|
|
5
5
|
styles: CustomNavigationProps;
|
|
6
6
|
hoverStyles?: CustomNavigationProps;
|
|
7
|
+
style?: React.CSSProperties;
|
|
7
8
|
onClick?: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const CustomNavigationPrevBtn: ({ isDisabled, styles, hoverStyles, onClick }: CustomNavigationPrevBtnProps) => JSX.Element;
|
|
10
|
+
export declare const CustomNavigationPrevBtn: ({ isDisabled, styles, hoverStyles, style, onClick }: CustomNavigationPrevBtnProps) => JSX.Element;
|
|
10
11
|
export interface FlexBoxProps {
|
|
11
12
|
direction?: 'row' | 'column';
|
|
12
13
|
justifyContent?: string;
|