pds-dev-kit-web-test 2.5.452 → 2.5.454
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/Composition.js +1 -0
- package/dist/src/sub/DynamicLayout/mock_componentBlocks.d.ts +776 -0
- package/dist/src/sub/DynamicLayout/mock_componentBlocks.js +4236 -0
- package/dist/src/sub/DynamicLayout/mock_contentsCarousel.js +617 -630
- package/dist/src/sub/DynamicLayout/mock_contentsList.js +3 -3
- package/dist/src/sub/DynamicLayout/mock_slideBanner.js +6 -6
- package/dist/src/sub/DynamicLayout/mocks.js +10 -8482
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +22 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.d.ts +5 -12
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.js +1 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +19 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.js +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.d.ts +5 -10
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.js +1 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +24 -11
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.d.ts +5 -13
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.js +1 -7
- package/package.json +1 -1
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { INSET_POSTIION, OUTSET_POSTIION } from './types';
|
|
2
3
|
import type { CB_CONTENTSCAROUSEL } from '../../../../../../../DynamicLayout/sections/CustomSection/types';
|
|
3
4
|
import type { CB_CONTENTSCAROUSEL_PROPERTIES_TYPE, IndexForIntersection } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
4
5
|
type Props = CB_CONTENTSCAROUSEL_PROPERTIES_TYPE & IndexForIntersection & {
|
|
5
6
|
compositions: CB_CONTENTSCAROUSEL['compositions'];
|
|
6
7
|
};
|
|
8
|
+
type ComponentType = 'PREV' | 'NEXT' | 'PROGRESSBAR';
|
|
9
|
+
export type ContentsCarouselElementsProps = {
|
|
10
|
+
type: ComponentType;
|
|
11
|
+
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
12
|
+
};
|
|
7
13
|
declare function ContentsCarousel(props: Props): JSX.Element;
|
|
8
14
|
export default ContentsCarousel;
|
|
@@ -34,6 +34,20 @@ var ContentsCarouselCore_1 = __importDefault(require("./ContentsCarouselCore"));
|
|
|
34
34
|
var contentsCarouselUtils_1 = require("./contentsCarouselUtils");
|
|
35
35
|
var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
|
|
36
36
|
var useSwiper_1 = require("./hooks/useSwiper");
|
|
37
|
+
var createComponent = function (type, getDesignType, getLocation) {
|
|
38
|
+
return function (normalStyle, hoverStyle, isHovered) {
|
|
39
|
+
var normalDesign = getDesignType(normalStyle);
|
|
40
|
+
var hoverDesign = getDesignType(hoverStyle);
|
|
41
|
+
if (isHovered && hoverDesign === 'NONE')
|
|
42
|
+
return undefined;
|
|
43
|
+
if (normalDesign === 'NONE')
|
|
44
|
+
return undefined;
|
|
45
|
+
return {
|
|
46
|
+
type: type,
|
|
47
|
+
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle)
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
37
51
|
function ContentsCarousel(props) {
|
|
38
52
|
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode, queryData = _a.queryData;
|
|
39
53
|
var compositions = props.compositions, index = props.index, _b = props.CB_CONTENT_PROP_CONTENTSCAROUSEL, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS = _b.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS, 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, CB_STYLE_PROP_CONTENTSCAROUSEL = props.CB_STYLE_PROP_CONTENTSCAROUSEL, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
@@ -68,15 +82,14 @@ function ContentsCarousel(props) {
|
|
|
68
82
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
69
83
|
var hasEffect = !isNoneEffectType;
|
|
70
84
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}), layoutRef = _j.layoutRef, positionRefs = _j.positionRefs, ccbInset = _j.ccbInset, componentGroups = _j.componentGroups, getPositionStyle = _j.getPositionStyle, getComponentGroupLayout = _j.getComponentGroupLayout;
|
|
85
|
+
var createPrevButton = createComponent('PREV', function (style) { return style.prevBtnType || 'NONE'; }, function (style) { return style.prevBtnLocation || 'OUTSET1'; });
|
|
86
|
+
var createNextButton = createComponent('NEXT', function (style) { return style.nextBtnType || 'NONE'; }, function (style) { return style.nextBtnLocation || 'OUTSET1'; });
|
|
87
|
+
var components = [
|
|
88
|
+
createPrevButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
89
|
+
createNextButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
90
|
+
{ type: 'PROGRESSBAR', position: 'INSET5' }
|
|
91
|
+
].filter(function (component) { return component !== undefined; });
|
|
92
|
+
var _j = (0, useFlexGridLayout_1.useFlexGridLayout)({ components: components }), layoutRef = _j.layoutRef, positionRefs = _j.positionRefs, ccbInset = _j.ccbInset, componentGroups = _j.componentGroups, getPositionStyle = _j.getPositionStyle, getComponentGroupLayout = _j.getComponentGroupLayout;
|
|
80
93
|
var renderElements = function (component) {
|
|
81
94
|
switch (component.type) {
|
|
82
95
|
case 'PREV':
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { ContentsCarouselElementsProps } from '../ContentsCarousel';
|
|
3
3
|
import type { CSSProperties } from 'styled-components';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
7
|
-
};
|
|
8
|
-
export declare const useFlexGridLayout: ({ prevBtnLocation, nextBtnLocation, progressBarLocation }: {
|
|
9
|
-
prevBtnLocation: OUTSET_POSTIION | INSET_POSTIION;
|
|
10
|
-
nextBtnLocation: OUTSET_POSTIION | INSET_POSTIION;
|
|
11
|
-
progressBarLocation: OUTSET_POSTIION | INSET_POSTIION;
|
|
4
|
+
export declare const useFlexGridLayout: ({ components }: {
|
|
5
|
+
components: ContentsCarouselElementsProps[];
|
|
12
6
|
}) => {
|
|
13
7
|
layoutRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
14
8
|
positionRefs: import("react").MutableRefObject<Record<string, HTMLDivElement | null>>;
|
|
@@ -18,8 +12,7 @@ export declare const useFlexGridLayout: ({ prevBtnLocation, nextBtnLocation, pro
|
|
|
18
12
|
bottom: string;
|
|
19
13
|
left: string;
|
|
20
14
|
};
|
|
21
|
-
componentGroups: Record<string,
|
|
15
|
+
componentGroups: Record<string, ContentsCarouselElementsProps[]>;
|
|
22
16
|
getPositionStyle: (position: string, ccbInset: Record<string, string>) => CSSProperties;
|
|
23
|
-
getComponentGroupLayout: (components:
|
|
17
|
+
getComponentGroupLayout: (components: ContentsCarouselElementsProps[], position: string) => CSSProperties;
|
|
24
18
|
};
|
|
25
|
-
export {};
|
|
@@ -14,16 +14,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.useFlexGridLayout = void 0;
|
|
15
15
|
var react_1 = require("react");
|
|
16
16
|
var useFlexGridLayout = function (_a) {
|
|
17
|
-
var
|
|
17
|
+
var components = _a.components;
|
|
18
18
|
var _b = (0, react_1.useState)({ top: 0, right: 0, bottom: 0, left: 0 }), groupSizes = _b[0], setGroupSizes = _b[1];
|
|
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
|
-
var components = [
|
|
23
|
-
{ type: 'PREV', position: prevBtnLocation },
|
|
24
|
-
{ type: 'NEXT', position: nextBtnLocation },
|
|
25
|
-
{ type: 'PROGRESSBAR', position: progressBarLocation }
|
|
26
|
-
];
|
|
27
22
|
// 위치별로 컴포넌트 그룹화
|
|
28
23
|
var getComponentsByPosition = function () {
|
|
29
24
|
var groups = {};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { OUTSET_POSTIION, INSET_POSTIION } from './types';
|
|
2
3
|
import type { CB_LIST } from '../../../../../../../DynamicLayout/sections/CustomSection/types';
|
|
3
4
|
import type { CB_LIST_PROPERTIES_TYPE, IndexForIntersection } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
4
5
|
type Props = CB_LIST_PROPERTIES_TYPE & IndexForIntersection & {
|
|
5
6
|
compositions: CB_LIST['compositions'];
|
|
6
7
|
};
|
|
8
|
+
type ComponentType = 'PAGINATION';
|
|
9
|
+
export type ContentsListElementsProps = {
|
|
10
|
+
type: ComponentType;
|
|
11
|
+
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
12
|
+
};
|
|
7
13
|
declare function ContentsList(props: Props): JSX.Element;
|
|
8
14
|
export default ContentsList;
|
|
@@ -30,6 +30,20 @@ var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
|
|
|
30
30
|
var CustomPagination_1 = require("./components/CustomPagination");
|
|
31
31
|
var contentsListUtils_1 = require("./contentsListUtils");
|
|
32
32
|
var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
|
|
33
|
+
var createComponent = function (type, getDesignType, getLocation) {
|
|
34
|
+
return function (normalStyle, hoverStyle, isHovered) {
|
|
35
|
+
var normalDesign = getDesignType(normalStyle);
|
|
36
|
+
var hoverDesign = getDesignType(hoverStyle);
|
|
37
|
+
if (isHovered && hoverDesign === 'NONE')
|
|
38
|
+
return undefined;
|
|
39
|
+
if (normalDesign === 'NONE')
|
|
40
|
+
return undefined;
|
|
41
|
+
return {
|
|
42
|
+
type: type,
|
|
43
|
+
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle)
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
33
47
|
function ContentsList(props) {
|
|
34
48
|
var _a, _b, _c, _d;
|
|
35
49
|
var _e = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _e.device, mode = _e.mode, queryData = _e.queryData;
|
|
@@ -99,9 +113,11 @@ function ContentsList(props) {
|
|
|
99
113
|
var listMinHeight = oneCompositionMinHeight * numberOfRows +
|
|
100
114
|
(numberOfRows - 1) * rowGap +
|
|
101
115
|
paddingTB;
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
var createPagination = createComponent('PAGINATION', function (style) { return style.type || 'NONE'; }, function (style) { return style.location || 'OUTSET1'; });
|
|
117
|
+
var components = [
|
|
118
|
+
createPagination(paginationNormalStyle, paginationHoverStyle, isHovered)
|
|
119
|
+
].filter(function (component) { return component !== undefined; });
|
|
120
|
+
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;
|
|
105
121
|
var renderElements = function (component) {
|
|
106
122
|
switch (component.type) {
|
|
107
123
|
case 'PAGINATION':
|
|
@@ -30,6 +30,7 @@ var CustomPagination = function (_a) {
|
|
|
30
30
|
var groupStart = getPageGroupStart(current);
|
|
31
31
|
var groupEnd = Math.min(groupStart + 4, total);
|
|
32
32
|
var pageNumbers = Array.from({ length: groupEnd - groupStart + 1 }, function (_, index) { return groupStart + index; });
|
|
33
|
+
console.log('pageNumber >> ', pageNumbers);
|
|
33
34
|
var handlePrevious = function () {
|
|
34
35
|
if (current > 1) {
|
|
35
36
|
onPageClick(current - 1);
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { ContentsListElementsProps } from '../ContentsList';
|
|
3
3
|
import type { CSSProperties } from 'styled-components';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
7
|
-
};
|
|
8
|
-
export declare const useFlexGridLayout: ({ paginationLocation }: {
|
|
9
|
-
paginationLocation: OUTSET_POSTIION | INSET_POSTIION;
|
|
4
|
+
export declare const useFlexGridLayout: ({ components }: {
|
|
5
|
+
components: ContentsListElementsProps[];
|
|
10
6
|
}) => {
|
|
11
7
|
layoutRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
12
8
|
positionRefs: import("react").MutableRefObject<Record<string, HTMLDivElement | null>>;
|
|
@@ -16,8 +12,7 @@ export declare const useFlexGridLayout: ({ paginationLocation }: {
|
|
|
16
12
|
bottom: string;
|
|
17
13
|
left: string;
|
|
18
14
|
};
|
|
19
|
-
componentGroups: Record<string,
|
|
15
|
+
componentGroups: Record<string, ContentsListElementsProps[]>;
|
|
20
16
|
getPositionStyle: (position: string, ccbInset: Record<string, string>) => CSSProperties;
|
|
21
|
-
getComponentGroupLayout: (components:
|
|
17
|
+
getComponentGroupLayout: (components: ContentsListElementsProps[], position: string) => CSSProperties;
|
|
22
18
|
};
|
|
23
|
-
export {};
|
|
@@ -14,12 +14,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.useFlexGridLayout = void 0;
|
|
15
15
|
var react_1 = require("react");
|
|
16
16
|
var useFlexGridLayout = function (_a) {
|
|
17
|
-
var
|
|
17
|
+
var components = _a.components;
|
|
18
18
|
var _b = (0, react_1.useState)({ top: 0, right: 0, bottom: 0, left: 0 }), groupSizes = _b[0], setGroupSizes = _b[1];
|
|
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
|
-
var components = [{ type: 'PAGINATION', position: paginationLocation }];
|
|
23
22
|
// 위치별로 컴포넌트 그룹화
|
|
24
23
|
var getComponentsByPosition = function () {
|
|
25
24
|
var groups = {};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { INSET_POSTIION, OUTSET_POSTIION } from './types';
|
|
2
3
|
import type { CB_SLIDEBANNER } from '../../../../../../../DynamicLayout/sections/CustomSection/types';
|
|
3
4
|
import type { CB_SLIDEBANNER_PROPERTIES_TYPE, IndexForIntersection } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
4
5
|
type Props = CB_SLIDEBANNER_PROPERTIES_TYPE & IndexForIntersection & {
|
|
5
6
|
compositions: CB_SLIDEBANNER['compositions'];
|
|
6
7
|
};
|
|
8
|
+
type ComponentType = 'PREV' | 'NEXT' | 'PAGINATION' | 'PROGRESSBAR';
|
|
9
|
+
export type SlideBannerElementsProps = {
|
|
10
|
+
type: ComponentType;
|
|
11
|
+
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
12
|
+
};
|
|
7
13
|
declare function SlideBanner(props: Props): JSX.Element;
|
|
8
14
|
export default SlideBanner;
|
|
@@ -35,6 +35,20 @@ var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
|
|
|
35
35
|
var useSwiper_1 = require("./hooks/useSwiper");
|
|
36
36
|
var SlideBannerCore_1 = __importDefault(require("./SlideBannerCore"));
|
|
37
37
|
var slideBannerUtils_1 = require("./slideBannerUtils");
|
|
38
|
+
var createComponent = function (type, getDesignType, getLocation) {
|
|
39
|
+
return function (normalStyle, hoverStyle, isHovered) {
|
|
40
|
+
var normalDesign = getDesignType(normalStyle);
|
|
41
|
+
var hoverDesign = getDesignType(hoverStyle);
|
|
42
|
+
if (isHovered && hoverDesign === 'NONE')
|
|
43
|
+
return undefined;
|
|
44
|
+
if (normalDesign === 'NONE')
|
|
45
|
+
return undefined;
|
|
46
|
+
return {
|
|
47
|
+
type: type,
|
|
48
|
+
position: isHovered ? getLocation(hoverStyle) : getLocation(normalStyle)
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
38
52
|
function SlideBanner(props) {
|
|
39
53
|
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode, queryData = _a.queryData;
|
|
40
54
|
var index = props.index, _b = props.CB_CONTENT_PROP_SLIDEBANNER, CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS = _b.CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS, 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, CB_STYLE_PROP_SLIDEBANNER = props.CB_STYLE_PROP_SLIDEBANNER, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
@@ -73,17 +87,16 @@ function SlideBanner(props) {
|
|
|
73
87
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
74
88
|
var hasEffect = !isNoneEffectType;
|
|
75
89
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}), layoutRef = _k.layoutRef, positionRefs = _k.positionRefs, ccbInset = _k.ccbInset, componentGroups = _k.componentGroups, getPositionStyle = _k.getPositionStyle, getComponentGroupLayout = _k.getComponentGroupLayout;
|
|
90
|
+
var createPrevButton = createComponent('PREV', function (style) { return style.prevBtnType || 'NONE'; }, function (style) { return style.prevBtnLocation || 'OUTSET1'; });
|
|
91
|
+
var createNextButton = createComponent('NEXT', function (style) { return style.nextBtnType || 'NONE'; }, function (style) { return style.nextBtnLocation || 'OUTSET1'; });
|
|
92
|
+
var createPagination = createComponent('PAGINATION', function (style) { return style.type || 'NONE'; }, function (style) { return style.location || 'OUTSET1'; });
|
|
93
|
+
var components = [
|
|
94
|
+
createPrevButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
95
|
+
createNextButton(customNavigationNormalStyle, customNavigationHoverStyle, isHovered),
|
|
96
|
+
createPagination(customPaginationNormalStyle, customPaginationHoverStyle, isHovered),
|
|
97
|
+
{ type: 'PROGRESSBAR', position: 'INSET5' }
|
|
98
|
+
].filter(function (component) { return component !== undefined; });
|
|
99
|
+
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;
|
|
87
100
|
var renderElements = function (component) {
|
|
88
101
|
var _a;
|
|
89
102
|
switch (component.type) {
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { SlideBannerElementsProps } from '../SlideBanner';
|
|
3
3
|
import type { CSSProperties } from 'styled-components';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
position: OUTSET_POSTIION | INSET_POSTIION;
|
|
7
|
-
};
|
|
8
|
-
export declare const useFlexGridLayout: ({ prevBtnLocation, nextBtnLocation, paginationLocation, progressBarLocation }: {
|
|
9
|
-
prevBtnLocation: OUTSET_POSTIION | INSET_POSTIION;
|
|
10
|
-
nextBtnLocation: OUTSET_POSTIION | INSET_POSTIION;
|
|
11
|
-
paginationLocation: OUTSET_POSTIION | INSET_POSTIION;
|
|
12
|
-
progressBarLocation: OUTSET_POSTIION | INSET_POSTIION;
|
|
4
|
+
export declare const useFlexGridLayout: ({ components }: {
|
|
5
|
+
components: SlideBannerElementsProps[];
|
|
13
6
|
}) => {
|
|
14
7
|
layoutRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
15
8
|
positionRefs: import("react").MutableRefObject<Record<string, HTMLDivElement | null>>;
|
|
@@ -19,8 +12,7 @@ export declare const useFlexGridLayout: ({ prevBtnLocation, nextBtnLocation, pag
|
|
|
19
12
|
bottom: string;
|
|
20
13
|
left: string;
|
|
21
14
|
};
|
|
22
|
-
componentGroups: Record<string,
|
|
15
|
+
componentGroups: Record<string, SlideBannerElementsProps[]>;
|
|
23
16
|
getPositionStyle: (position: string, ccbInset: Record<string, string>) => CSSProperties;
|
|
24
|
-
getComponentGroupLayout: (components:
|
|
17
|
+
getComponentGroupLayout: (components: SlideBannerElementsProps[], position: string) => CSSProperties;
|
|
25
18
|
};
|
|
26
|
-
export {};
|
|
@@ -14,17 +14,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.useFlexGridLayout = void 0;
|
|
15
15
|
var react_1 = require("react");
|
|
16
16
|
var useFlexGridLayout = function (_a) {
|
|
17
|
-
var
|
|
17
|
+
var components = _a.components;
|
|
18
18
|
var _b = (0, react_1.useState)({ top: 0, right: 0, bottom: 0, left: 0 }), groupSizes = _b[0], setGroupSizes = _b[1];
|
|
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
|
-
var components = [
|
|
23
|
-
{ type: 'PREV', position: prevBtnLocation },
|
|
24
|
-
{ type: 'NEXT', position: nextBtnLocation },
|
|
25
|
-
{ type: 'PAGINATION', position: paginationLocation },
|
|
26
|
-
{ type: 'PROGRESSBAR', position: progressBarLocation }
|
|
27
|
-
];
|
|
28
22
|
// 위치별로 컴포넌트 그룹화
|
|
29
23
|
var getComponentsByPosition = function () {
|
|
30
24
|
var groups = {};
|