pds-dev-kit-web-test 2.5.470 → 2.5.480

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.
Files changed (73) hide show
  1. package/dist/src/sub/DynamicLayout/CompositionEditor/CompositionEditor.d.ts +2 -1
  2. package/dist/src/sub/DynamicLayout/CompositionEditor/CompositionEditor.js +49 -49
  3. package/dist/src/sub/DynamicLayout/DynamicLayout.d.ts +1 -1
  4. package/dist/src/sub/DynamicLayout/DynamicLayout.js +3 -2
  5. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js +24 -2
  6. package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.js +3 -1
  7. package/dist/src/sub/DynamicLayout/mock_componentBlocks.d.ts +776 -0
  8. package/dist/src/sub/DynamicLayout/mock_componentBlocks.js +4236 -0
  9. package/dist/src/sub/DynamicLayout/mock_composition.js +6 -5
  10. package/dist/src/sub/DynamicLayout/mock_contentsCarousel.js +5 -17
  11. package/dist/src/sub/DynamicLayout/mock_contentsList.js +2 -2
  12. package/dist/src/sub/DynamicLayout/mock_slideBanner.d.ts +63 -63
  13. package/dist/src/sub/DynamicLayout/mock_slideBanner.js +65 -65
  14. package/dist/src/sub/DynamicLayout/mocks.js +13 -8477
  15. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +3 -3
  16. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.d.ts +6 -0
  17. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +76 -192
  18. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.d.ts +2 -7
  19. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.js +8 -6
  20. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationNextBtn.d.ts +15 -0
  21. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationNextBtn.js +69 -0
  22. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationPrevBtn.d.ts +15 -0
  23. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationPrevBtn.js +69 -0
  24. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.d.ts +4 -18
  25. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.js +19 -49
  26. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/progressConfigs.js +16 -16
  27. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.d.ts +19 -20
  28. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.js +131 -696
  29. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.d.ts +18 -0
  30. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.js +229 -0
  31. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.d.ts +14 -0
  32. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.js +46 -0
  33. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/types.d.ts +36 -2
  34. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.d.ts +6 -0
  35. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +54 -20
  36. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.d.ts +6 -25
  37. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.js +21 -51
  38. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.d.ts +8 -9
  39. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.js +42 -294
  40. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.d.ts +18 -0
  41. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.js +229 -0
  42. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/types.d.ts +12 -1
  43. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.d.ts +6 -0
  44. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +82 -146
  45. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.d.ts +2 -5
  46. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.js +2 -2
  47. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.d.ts +15 -0
  48. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.js +69 -0
  49. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationPrevBtn.d.ts +15 -0
  50. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationPrevBtn.js +69 -0
  51. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.d.ts +9 -22
  52. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.js +25 -35
  53. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.d.ts +4 -18
  54. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.js +19 -49
  55. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/progressConfigs.js +8 -8
  56. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.d.ts +18 -0
  57. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.js +229 -0
  58. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.d.ts +16 -0
  59. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.js +63 -0
  60. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.d.ts +22 -24
  61. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.js +155 -925
  62. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/types.d.ts +46 -3
  63. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.d.ts +6 -1
  64. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +10 -5
  65. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +1 -0
  66. package/dist/src/sub/DynamicLayout/types.d.ts +17 -3
  67. package/package.json +2 -2
  68. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.d.ts +0 -35
  69. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.js +0 -118
  70. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.d.ts +0 -32
  71. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.js +0 -183
  72. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.d.ts +0 -35
  73. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.js +0 -118
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.useFlexGridLayout = void 0;
15
+ var react_1 = require("react");
16
+ var useFlexGridLayout = function (_a) {
17
+ var components = _a.components;
18
+ var _b = (0, react_1.useState)({ top: 0, right: 0, bottom: 0, left: 0 }), groupSizes = _b[0], setGroupSizes = _b[1];
19
+ var _c = (0, react_1.useState)({ width: 0, height: 0 }), layoutSize = _c[0], setLayoutSize = _c[1];
20
+ var layoutRef = (0, react_1.useRef)(null);
21
+ var positionRefs = (0, react_1.useRef)({});
22
+ // 위치별로 컴포넌트 그룹화
23
+ var getComponentsByPosition = function () {
24
+ var groups = {};
25
+ components.forEach(function (component) {
26
+ if (!groups[component.position]) {
27
+ groups[component.position] = [];
28
+ }
29
+ groups[component.position].push(component);
30
+ });
31
+ return groups;
32
+ };
33
+ var componentGroups = getComponentsByPosition();
34
+ var GAP = 8;
35
+ // 위치가 어느 방향인지 판단
36
+ var getPositionDirection = function (position) {
37
+ var directions = {
38
+ OUTSET1: 'top',
39
+ OUTSET2: 'top',
40
+ OUTSET3: 'top',
41
+ OUTSET4: 'right',
42
+ OUTSET5: 'right',
43
+ OUTSET6: 'right',
44
+ OUTSET7: 'bottom',
45
+ OUTSET8: 'bottom',
46
+ OUTSET9: 'bottom',
47
+ OUTSET10: 'left',
48
+ OUTSET11: 'left',
49
+ OUTSET12: 'left',
50
+ // INSET은 CCB 내부이므로 방향 개념 없음
51
+ INSET1: 'none',
52
+ INSET2: 'none',
53
+ INSET3: 'none',
54
+ INSET4: 'none',
55
+ INSET5: 'none',
56
+ INSET6: 'none',
57
+ INSET7: 'none',
58
+ INSET8: 'none'
59
+ };
60
+ return directions[position];
61
+ };
62
+ // 위치에 따른 스타일 결정 (CCB 크기를 고려)
63
+ var getPositionStyle = function (position, ccbInset) {
64
+ var base = {
65
+ position: 'absolute',
66
+ display: 'flex',
67
+ alignItems: 'center',
68
+ justifyContent: 'center'
69
+ };
70
+ // CCB의 중앙 위치 계산
71
+ var ccbTop = parseFloat(ccbInset.top) || 0;
72
+ var ccbRight = parseFloat(ccbInset.right) || 0;
73
+ var ccbBottom = parseFloat(ccbInset.bottom) || 0;
74
+ var ccbLeft = parseFloat(ccbInset.left) || 0;
75
+ // CCB의 실제 크기와 중앙 위치 계산
76
+ var ccbWidth = layoutSize.width - ccbLeft - ccbRight;
77
+ var ccbHeight = layoutSize.height - ccbTop - ccbBottom;
78
+ var ccbCenterX = ccbLeft + ccbWidth / 2;
79
+ var ccbCenterY = ccbTop + ccbHeight / 2;
80
+ var positions = {
81
+ OUTSET1: { top: 0, left: ccbLeft },
82
+ OUTSET2: { top: 0, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
83
+ OUTSET3: { top: 0, right: ccbRight },
84
+ OUTSET4: { top: ccbTop, right: 0 },
85
+ OUTSET5: { top: "".concat(ccbCenterY, "px"), right: 0, transform: 'translateY(-50%)' },
86
+ OUTSET6: { bottom: ccbBottom, right: 0 },
87
+ OUTSET7: { bottom: 0, right: ccbRight },
88
+ OUTSET8: { bottom: 0, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
89
+ OUTSET9: { bottom: 0, left: ccbLeft },
90
+ OUTSET10: { bottom: ccbBottom, left: 0 },
91
+ OUTSET11: { top: "".concat(ccbCenterY, "px"), left: 0, transform: 'translateY(-50%)' },
92
+ OUTSET12: { top: ccbTop, left: 0 },
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]);
107
+ };
108
+ // 컴포넌트 그룹 레이아웃
109
+ var getComponentGroupLayout = function (components, position) {
110
+ var count = components.length;
111
+ var horizontals = [
112
+ 'OUTSET1',
113
+ 'OUTSET2',
114
+ 'OUTSET3',
115
+ 'OUTSET7',
116
+ 'OUTSET8',
117
+ 'OUTSET9',
118
+ 'INSET1',
119
+ 'INSET2',
120
+ 'INSET3',
121
+ 'INSET5',
122
+ 'INSET6',
123
+ 'INSET7'
124
+ ];
125
+ var isHorizontal = horizontals.includes(position);
126
+ if (count === 1) {
127
+ return { display: 'block' };
128
+ }
129
+ return {
130
+ display: 'flex',
131
+ flexDirection: isHorizontal ? 'row' : 'column',
132
+ gap: '8px',
133
+ alignItems: 'center'
134
+ };
135
+ };
136
+ // ccbInset 계산
137
+ var ccbInset = (0, react_1.useMemo)(function () {
138
+ return {
139
+ top: groupSizes.top > 0 ? "".concat(groupSizes.top + GAP, "px") : '0',
140
+ right: groupSizes.right > 0 ? "".concat(groupSizes.right + GAP, "px") : '0',
141
+ bottom: groupSizes.bottom > 0 ? "".concat(groupSizes.bottom + GAP, "px") : '0',
142
+ left: groupSizes.left > 0 ? "".concat(groupSizes.left + GAP, "px") : '0'
143
+ };
144
+ }, [groupSizes]);
145
+ // 레이아웃 크기 측정
146
+ (0, react_1.useEffect)(function () {
147
+ var measureLayout = function () {
148
+ if (layoutRef.current) {
149
+ var _a = layoutRef.current.getBoundingClientRect(), width_1 = _a.width, height_1 = _a.height;
150
+ setLayoutSize(function (prevSize) {
151
+ if (prevSize.width !== width_1 || prevSize.height !== height_1) {
152
+ return { width: width_1, height: height_1 };
153
+ }
154
+ return prevSize;
155
+ });
156
+ }
157
+ };
158
+ measureLayout();
159
+ var resizeObserver = new ResizeObserver(measureLayout);
160
+ if (layoutRef.current) {
161
+ resizeObserver.observe(layoutRef.current);
162
+ }
163
+ return function () {
164
+ resizeObserver.disconnect();
165
+ };
166
+ }, []);
167
+ // 컴포넌트 그룹의 크기 측정
168
+ (0, react_1.useEffect)(function () {
169
+ var measureGroups = function () {
170
+ var newSizes = {
171
+ top: 0,
172
+ right: 0,
173
+ bottom: 0,
174
+ left: 0
175
+ };
176
+ Object.entries(positionRefs.current).forEach(function (_a) {
177
+ var position = _a[0], ref = _a[1];
178
+ if (ref && ref.offsetHeight && ref.offsetWidth) {
179
+ var direction = getPositionDirection(position);
180
+ // INSET은 CCB 크기 계산에 영향을 주지 않음
181
+ if (direction !== 'none') {
182
+ var size = direction === 'top' || direction === 'bottom' ? ref.offsetHeight : ref.offsetWidth;
183
+ newSizes[direction] = Math.max(newSizes[direction], size);
184
+ }
185
+ }
186
+ });
187
+ // 실제로 크기가 변경되었을 때만 업데이트
188
+ setGroupSizes(function (prevSizes) {
189
+ if (prevSizes.top !== newSizes.top ||
190
+ prevSizes.right !== newSizes.right ||
191
+ prevSizes.bottom !== newSizes.bottom ||
192
+ prevSizes.left !== newSizes.left) {
193
+ return newSizes;
194
+ }
195
+ return prevSizes;
196
+ });
197
+ };
198
+ // 초기 측정을 위한 타이머
199
+ var timeoutId = setTimeout(function () {
200
+ measureGroups();
201
+ }, 0);
202
+ // ResizeObserver 설정
203
+ var resizeObserver = new ResizeObserver(function (entries) {
204
+ // 크기 변경이 실제로 일어났을 때만 측정
205
+ if (entries.length > 0) {
206
+ measureGroups();
207
+ }
208
+ });
209
+ // 현재 존재하는 ref들에 observer 연결
210
+ Object.values(positionRefs.current).forEach(function (ref) {
211
+ if (ref) {
212
+ resizeObserver.observe(ref);
213
+ }
214
+ });
215
+ return function () {
216
+ clearTimeout(timeoutId);
217
+ resizeObserver.disconnect();
218
+ };
219
+ }, [componentGroups]);
220
+ return {
221
+ layoutRef: layoutRef,
222
+ positionRefs: positionRefs,
223
+ ccbInset: ccbInset,
224
+ componentGroups: componentGroups,
225
+ getPositionStyle: getPositionStyle,
226
+ getComponentGroupLayout: getComponentGroupLayout
227
+ };
228
+ };
229
+ exports.useFlexGridLayout = useFlexGridLayout;
@@ -1,12 +1,14 @@
1
1
  import type { NUMBER_INTEGER } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
2
2
  export type ContentsListPropsKeys = keyof CB_STYLE_PROP_CONTENTSLIST_SPECS;
3
+ export type OUTSET_POSTIION = 'OUTSET1' | 'OUTSET2' | 'OUTSET3' | 'OUTSET4' | 'OUTSET5' | 'OUTSET6' | 'OUTSET7' | 'OUTSET8' | 'OUTSET9' | 'OUTSET10' | 'OUTSET11' | 'OUTSET12';
4
+ export type INSET_POSTIION = 'INSET1' | 'INSET2' | 'INSET3' | 'INSET4' | 'INSET5' | 'INSET6' | 'INSET7' | 'INSET8';
3
5
  export type CB_STYLE_PROP_CONTENTSLIST_SPEC_STYLE_TYPE = 'DESIGN1' | 'DESIGN2' | null;
4
6
  export type CB_STYLE_PROP_CONTENTSLIST_SPEC_ITEMSPACING_TYPE = 'WIDE' | 'NORMAL' | 'NARROW' | null;
5
7
  export type CB_STYLE_PROP_CONTENTSLIST_SPEC_ITEMLINEHEIGHT_TYPE = NUMBER_INTEGER | null;
6
8
  export type CB_STYLE_PROP_CONTENTSLIST_SPEC_ITEMHEIGHTFITCONTENT_TYPE = boolean | null;
7
9
  export type CB_STYLE_PROP_CONTENTSLIST_SPEC_INFINITESCROLL_TYPE = boolean | null;
8
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' | null;
9
- export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONLOCATION_TYPE = 'OUTSET1' | 'OUTSET2' | 'OUTSET3' | 'OUTSET4' | 'OUTSET5' | 'OUTSET6' | 'OUTSET7' | 'OUTSET8' | 'OUTSET9' | 'OUTSET10' | 'OUTSET11' | 'OUTSET12' | 'INSET1' | 'INSET2' | 'INSET3' | 'INSET4' | 'INSET5' | 'INSET6' | 'INSET7' | 'INSET8' | null;
11
+ export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONLOCATION_TYPE = OUTSET_POSTIION | INSET_POSTIION;
10
12
  export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSIZE_TYPE = 'SMALL' | 'MEDIUM' | 'LARGE' | null;
11
13
  export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONPRIMARYCOLOR = string;
12
14
  export type CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSECONDARYCOLOR = string;
@@ -54,3 +56,12 @@ export type CB_STYLE_PROP_CONTENTSLIST_SPECS = CB_STYLE_PROP_CONTENTSLIST_SPECS_
54
56
  'CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSECONDARYCOLOR:MOBILE': CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSECONDARYCOLOR;
55
57
  'CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSECONDARYCOLOR:MOBILE:HOVER': CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSECONDARYCOLOR;
56
58
  };
59
+ export interface CustomPaginationProps {
60
+ current?: number;
61
+ total?: number;
62
+ type?: CB_STYLE_PROP_CONTENTSLIST_SPEC_PAGINATIONSTYLE_TYPE;
63
+ location?: OUTSET_POSTIION | INSET_POSTIION;
64
+ size?: 'SMALL' | 'MEDIUM' | 'LARGE';
65
+ primaryColor?: string;
66
+ secondaryColor?: string;
67
+ }
@@ -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;
@@ -14,29 +14,6 @@ var __assign = (this && this.__assign) || function () {
14
14
  };
15
15
  return __assign.apply(this, arguments);
16
16
  };
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
- __setModuleDefault(result, mod);
38
- return result;
39
- };
40
17
  var __importDefault = (this && this.__importDefault) || function (mod) {
41
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
42
19
  };
@@ -47,51 +24,54 @@ var createCompositions_1 = require("../../../../../../../DynamicLayout/Compositi
47
24
  var dynamicLayoutContext_1 = require("../../../../../../../DynamicLayout/dynamicLayoutContext");
48
25
  var hooks_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/hooks");
49
26
  var util_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util");
50
- var styled_components_1 = __importStar(require("styled-components"));
27
+ var styled_components_1 = __importDefault(require("styled-components"));
51
28
  var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
52
29
  var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
53
- var CustomNavigation_1 = require("./components/CustomNavigation");
30
+ var CustomNavigationNextBtn_1 = require("./components/CustomNavigationNextBtn");
31
+ var CustomNavigationPrevBtn_1 = require("./components/CustomNavigationPrevBtn");
54
32
  var CustomPagination_1 = require("./components/CustomPagination");
55
33
  var CustomProgressbar_1 = require("./components/CustomProgressbar");
34
+ var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
35
+ var useSwiper_1 = require("./hooks/useSwiper");
56
36
  var SlideBannerCore_1 = __importDefault(require("./SlideBannerCore"));
57
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
+ };
58
52
  function SlideBanner(props) {
59
- var _a;
60
- var _b = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _b.device, mode = _b.mode, queryData = _b.queryData;
61
- var index = props.index,
62
- // CONTENT : 슬라이드배너
63
- _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,
64
- // STYLE: 슬라이드배너
65
- CB_STYLE_PROP_SLIDEBANNER = props.CB_STYLE_PROP_SLIDEBANNER,
66
- // STYLE: 그림자
67
- CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW,
68
- // EFFECT: 진입
69
- CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
53
+ var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode, queryData = _a.queryData;
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;
70
55
  var compositions = props.compositions;
71
- var _d = (0, react_1.useState)(false), isHovered = _d[0], setIsHovered = _d[1];
72
- var _e = (0, react_1.useState)(1), currentSlide = _e[0], setCurrentSlide = _e[1];
73
- var _f = (0, react_1.useState)(true), isBeginning = _f[0], setIsBeginning = _f[1];
74
- var _g = (0, react_1.useState)(false), isEnd = _g[0], setIsEnd = _g[1];
75
- var progressRef = (0, react_1.useRef)(0);
76
- var leftTimeMsRef = (0, react_1.useRef)(0);
77
- var swiperRef = (0, react_1.useRef)(null);
78
- var _h = (0, slideBannerUtils_1.parseSlideBannerStyleToSlideBannerCoreProp)({
56
+ var _c = (0, util_1.parseProperties)(props, device), style = _c.style, hoverStyle = _c.hoverStyle, layout = _c.layout, effect = _c.effect;
57
+ var _d = (0, slideBannerUtils_1.parseSlideBannerStyleToSlideBannerCoreProp)({
79
58
  props: CB_STYLE_PROP_SLIDEBANNER,
80
59
  device: device
81
- }), slideBannerNormalStyle = _h.normalStyle, slideBannerHoverStyle = _h.hoverStyle;
82
- var _j = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomPaginationProp)({
60
+ }), slideBannerNormalStyle = _d.normalStyle, slideBannerHoverStyle = _d.hoverStyle;
61
+ var _e = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomPaginationProp)({
83
62
  props: CB_STYLE_PROP_SLIDEBANNER,
84
63
  device: device
85
- }), customPaginationNormalStyle = _j.normalStyle, customPaginationHoverStyle = _j.hoverStyle;
86
- var _k = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomNavigationProp)({
64
+ }), customPaginationNormalStyle = _e.normalStyle, customPaginationHoverStyle = _e.hoverStyle;
65
+ var _f = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomNavigationProp)({
87
66
  props: CB_STYLE_PROP_SLIDEBANNER,
88
67
  device: device
89
- }), customNavigationNormalStyle = _k.normalStyle, customNavigationHoverStyle = _k.hoverStyle;
90
- var _l = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomProgressbarProp)({
68
+ }), customNavigationNormalStyle = _f.normalStyle, customNavigationHoverStyle = _f.hoverStyle;
69
+ var _g = (0, slideBannerUtils_1.parseSlideBannerStyleToCustomProgressbarProp)({
91
70
  props: CB_STYLE_PROP_SLIDEBANNER,
92
71
  device: device
93
- }), customProgressbarNormalStyle = _l.normalStyle, customProgressbarHoverStyle = _l.hoverStyle;
94
- var _m = (0, util_1.parseProperties)(props, device), style = _m.style, hoverStyle = _m.hoverStyle, layout = _m.layout, effect = _m.effect;
72
+ }), customProgressbarNormalStyle = _g.normalStyle, customProgressbarHoverStyle = _g.hoverStyle;
73
+ var _h = (0, useSwiper_1.useSwiper)(), swiperRef = _h.swiperRef, progressRef = _h.progressRef, leftTimeMsRef = _h.leftTimeMsRef, currentSlide = _h.currentSlide, isBeginning = _h.isBeginning, isEnd = _h.isEnd, onSwiper = _h.onSwiper, onSlideChangeTransitionEnd = _h.onSlideChangeTransitionEnd, onAutoplayTimeLeft = _h.onAutoplayTimeLeft, onClickBullet = _h.onClickBullet, onClickPrevBtn = _h.onClickPrevBtn, onClickNextBtn = _h.onClickNextBtn;
74
+ var _j = (0, react_1.useState)(false), isHovered = _j[0], setIsHovered = _j[1];
95
75
  var loop = isHovered ? slideBannerNormalStyle.loop : slideBannerHoverStyle.loop;
96
76
  // NOTE: edit모드에서는 그리드의 이벤트만 작동하도록 CB의 포인터 이벤트는 막습니다.
97
77
  var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
@@ -107,109 +87,65 @@ function SlideBanner(props) {
107
87
  : CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
108
88
  var hasEffect = !isNoneEffectType;
109
89
  var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
110
- (0, react_1.useEffect)(function () {
111
- var _a, _b, _c;
112
- (_b = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.update();
113
- (_c = swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper.update();
114
- }, [isHovered]);
115
- var handleSwiper = function (swiper) {
116
- setIsBeginning(swiper.isBeginning);
117
- setIsEnd(swiper.isEnd);
118
- };
119
- var handleSlideChangeTransitionEnd = function (swiper) {
120
- var isLoop = swiper.params.loop || false;
121
- setIsBeginning(swiper.isBeginning);
122
- setIsEnd(swiper.isEnd);
123
- if (isLoop) {
124
- // loop 모드에서는 realIndex가 실제 슬라이드 인덱스
125
- setCurrentSlide(swiper.realIndex + 1);
126
- }
127
- else {
128
- // loop 꺼져있을 때는 activeIndex 사용
129
- setCurrentSlide(swiper.activeIndex + 1);
130
- }
131
- };
132
- var handleAutoplayTimeLeft = (0, react_1.useCallback)(function (_, time, progress) {
133
- leftTimeMsRef.current = time;
134
- progressRef.current = progress;
135
- }, []);
136
- var handleBulletClick = function (index) {
137
- if (swiperRef.current) {
138
- swiperRef.current.swiper.slideTo(index);
139
- }
140
- };
141
- var handlePrevBtnClick = function () {
142
- if (swiperRef.current) {
143
- swiperRef.current.swiper.slidePrev();
144
- }
145
- };
146
- var handleNextBtnClick = function () {
147
- if (swiperRef.current) {
148
- swiperRef.current.swiper.slideNext();
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;
100
+ var renderElements = function (component) {
101
+ var _a;
102
+ switch (component.type) {
103
+ case 'PREV':
104
+ return ((0, jsx_runtime_1.jsx)(CustomNavigationPrevBtn_1.CustomNavigationPrevBtn, { isDisabled: loop ? false : isBeginning, styles: isHovered ? customNavigationHoverStyle : customNavigationNormalStyle, onClick: onClickPrevBtn }));
105
+ case 'NEXT':
106
+ return ((0, jsx_runtime_1.jsx)(CustomNavigationNextBtn_1.CustomNavigationNextBtn, { isDisabled: loop ? false : isEnd, styles: isHovered ? customNavigationHoverStyle : customNavigationNormalStyle, onClick: onClickNextBtn }));
107
+ case 'PAGINATION':
108
+ 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 }));
109
+ case 'PROGRESSBAR':
110
+ return ((0, jsx_runtime_1.jsx)(CustomProgressbar_1.CustomProgressbar, { progressRef: progressRef, leftTimeMsRef: leftTimeMsRef, styles: isHovered ? customProgressbarHoverStyle : customProgressbarNormalStyle }));
111
+ default:
112
+ return null;
149
113
  }
150
114
  };
151
- return ((0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, style), layout), effectCssProperties), editModeStyle), { borderBottomLeftRadius: style.borderBottomLeftRadius, borderBottomRightRadius: style.borderBottomRightRadius, borderTopLeftRadius: style.borderTopLeftRadius, borderTopRightRadius: style.borderTopRightRadius, borderWidth: undefined, borderColor: undefined, borderStyle: undefined }), hoverStyle: __assign(__assign({}, hoverStyle), { borderBottomLeftRadius: hoverStyle.borderBottomLeftRadius, borderBottomRightRadius: hoverStyle.borderBottomRightRadius, borderTopLeftRadius: hoverStyle.borderTopLeftRadius, borderTopRightRadius: hoverStyle.borderTopRightRadius, borderWidth: undefined, borderColor: undefined, borderStyle: undefined }), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: (0, jsx_runtime_1.jsxs)(S_SwiperWrapper, __assign({ customStyle: isHovered ? slideBannerHoverStyle === null || slideBannerHoverStyle === void 0 ? void 0 : slideBannerHoverStyle.customStyle : slideBannerNormalStyle === null || slideBannerNormalStyle === void 0 ? void 0 : slideBannerNormalStyle.customStyle }, { children: [(0, jsx_runtime_1.jsx)(S_SwiperLayout, __assign({ borderStyle: {
152
- borderBottomLeftRadius: style.borderBottomLeftRadius,
153
- borderBottomRightRadius: style.borderBottomRightRadius,
154
- borderTopLeftRadius: style.borderTopLeftRadius,
155
- borderTopRightRadius: style.borderTopRightRadius,
156
- borderWidth: style.borderWidth,
157
- borderColor: style.borderColor,
158
- borderStyle: style.borderStyle
159
- }, hoverBorderStyle: {
160
- borderBottomLeftRadius: hoverStyle.borderBottomLeftRadius,
161
- borderBottomRightRadius: hoverStyle.borderBottomRightRadius,
162
- borderTopLeftRadius: hoverStyle.borderTopLeftRadius,
163
- borderTopRightRadius: hoverStyle.borderTopRightRadius,
164
- borderWidth: hoverStyle.borderWidth,
165
- borderColor: hoverStyle.borderColor,
166
- borderStyle: hoverStyle.borderStyle
167
- } }, { children: (0, jsx_runtime_1.jsx)(SlideBannerCore_1.default, __assign({ ref: swiperRef, onSwiper: handleSwiper, onSlideChangeTransitionEnd: handleSlideChangeTransitionEnd, onAutoplayTimeLeft: handleAutoplayTimeLeft, slidesPerView: 1, scrollbar: isHovered ? slideBannerHoverStyle.scrollbar : slideBannerNormalStyle.scrollbar, freeMode: isHovered ? slideBannerHoverStyle.freeMode : slideBannerNormalStyle.freeMode, autoplay: isHovered ? slideBannerHoverStyle.autoplay : slideBannerNormalStyle.autoplay, useAutoplay: isHovered ? slideBannerHoverStyle.useAutoplay : slideBannerNormalStyle.useAutoplay, loop: isHovered ? slideBannerHoverStyle.loop : slideBannerNormalStyle.loop }, { children: (0, createCompositions_1.createCompositions)({
115
+ return ((0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, style), layout), effectCssProperties), editModeStyle), { 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.jsxs)(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 }, { children: (0, createCompositions_1.createCompositions)({
168
116
  valueType: CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE,
169
117
  queryPath: CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA,
170
118
  limit: CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS,
171
119
  queryData: queryData,
172
120
  compositions: compositions
173
- }) })) })), (0, jsx_runtime_1.jsx)(CustomPagination_1.CustomPagination, { type: isHovered ? customPaginationHoverStyle.type : customPaginationNormalStyle.type, offset: isHovered ? customPaginationHoverStyle.offset : customPaginationNormalStyle.offset, primaryColor: isHovered
174
- ? customPaginationHoverStyle.primaryColor
175
- : customPaginationNormalStyle.primaryColor, secondaryColor: isHovered
176
- ? customPaginationHoverStyle.secondaryColor
177
- : customPaginationNormalStyle.secondaryColor, current: currentSlide, prevBtnDisabled: loop ? false : isBeginning, nextBtnDisabled: loop ? false : isEnd, total: (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slides.length, size: isHovered ? customPaginationHoverStyle.size : customPaginationNormalStyle.size, onBulletClick: handleBulletClick, onPrevBtnClick: handlePrevBtnClick, onNextBtnClick: handleNextBtnClick }), (0, jsx_runtime_1.jsx)(CustomNavigation_1.CustomNavigation, { prevBtnDisabled: isBeginning, prevBtnType: isHovered
178
- ? customNavigationHoverStyle.prevBtnType
179
- : customNavigationNormalStyle.prevBtnType, prevBtnOffset: isHovered
180
- ? customNavigationHoverStyle.prevBtnOffset
181
- : customNavigationNormalStyle.prevBtnOffset, prevBtnSize: isHovered
182
- ? customNavigationHoverStyle.prevBtnSize
183
- : customNavigationNormalStyle.prevBtnSize, prevBtnPrimaryColor: isHovered
184
- ? customNavigationHoverStyle.prevBtnPrimaryColor
185
- : customNavigationNormalStyle.prevBtnPrimaryColor, prevBtnSecondaryColor: isHovered
186
- ? customNavigationHoverStyle.prevBtnSecondaryColor
187
- : customNavigationNormalStyle.prevBtnSecondaryColor, onPrevBtnClick: handlePrevBtnClick, nextBtnDisabled: isEnd, nextBtnType: isHovered
188
- ? customNavigationHoverStyle.nextBtnType
189
- : customNavigationNormalStyle.nextBtnType, nextBtnOffset: isHovered
190
- ? customNavigationHoverStyle.nextBtnOffset
191
- : customNavigationNormalStyle.nextBtnOffset, nextBtnSize: isHovered
192
- ? customNavigationHoverStyle.nextBtnSize
193
- : customNavigationNormalStyle.nextBtnSize, nextBtnPrimaryColor: isHovered
194
- ? customNavigationHoverStyle.nextBtnPrimaryColor
195
- : customNavigationNormalStyle.nextBtnPrimaryColor, nextBtnSecondaryColor: isHovered
196
- ? customNavigationHoverStyle.nextBtnSecondaryColor
197
- : customNavigationNormalStyle.nextBtnSecondaryColor, onNextBtnClick: handleNextBtnClick }), (0, jsx_runtime_1.jsx)(CustomProgressbar_1.CustomProgressbar, { progressRef: progressRef, leftTimeMsRef: leftTimeMsRef, type: isHovered ? customProgressbarHoverStyle.type : customProgressbarNormalStyle.type, size: isHovered ? customProgressbarHoverStyle.size : customProgressbarNormalStyle.size, offset: isHovered ? customProgressbarHoverStyle.offset : customProgressbarNormalStyle.offset, primaryColor: isHovered
198
- ? customProgressbarHoverStyle.primaryColor
199
- : customProgressbarNormalStyle.primaryColor, secondaryColor: isHovered
200
- ? customProgressbarHoverStyle.secondaryColor
201
- : customProgressbarNormalStyle.secondaryColor })] })) })) })));
121
+ }) })) })), Object.entries(componentGroups).map(function (_a) {
122
+ var position = _a[0], groupComponents = _a[1];
123
+ return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-slidebanner-button-group", ref: function (el) {
124
+ if (el) {
125
+ positionRefs.current[position] = el;
126
+ }
127
+ else {
128
+ delete positionRefs.current[position];
129
+ }
130
+ }, 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));
131
+ })] })) })) })));
202
132
  }
203
- var S_SwiperWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n ", "\n"], ["\n height: 100%;\n width: 100%;\n ", "\n"])), function (_a) {
133
+ var S_SwiperLayout = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __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"])));
134
+ var S_SwiperWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __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) {
135
+ var ccbInset = _a.ccbInset;
136
+ return ccbInset.bottom;
137
+ }, function (_a) {
138
+ var ccbInset = _a.ccbInset;
139
+ return ccbInset.left;
140
+ }, function (_a) {
141
+ var ccbInset = _a.ccbInset;
142
+ return ccbInset.right;
143
+ }, function (_a) {
144
+ var ccbInset = _a.ccbInset;
145
+ return ccbInset.top;
146
+ }, function (_a) {
204
147
  var customStyle = _a.customStyle;
205
148
  return customStyle;
206
149
  });
207
- var S_SwiperLayout = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n ", ";\n"], ["\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n ", ";\n"])), function (_a) {
208
- var hoverBorderStyle = _a.hoverBorderStyle;
209
- return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, hoverBorderStyle), { boxShadow: '' }));
210
- }, function (_a) {
211
- var borderStyle = _a.borderStyle;
212
- return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, borderStyle), { boxShadow: '' }));
213
- });
214
150
  exports.default = SlideBanner;
215
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
151
+ var templateObject_1, templateObject_2;
@@ -1,14 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import 'swiper/modules/navigation/navigation.min.css';
3
3
  import 'swiper/swiper-bundle.css';
4
+ import type { CoreSlideBannerProps } from './types';
4
5
  import type { SwiperProps, SwiperRef } from 'swiper/react/swiper-react.js';
5
6
  export interface SlideBannerCoreProps extends SwiperProps {
6
- scrollbar?: SwiperProps['scrollbar'];
7
+ styles: CoreSlideBannerProps;
7
8
  slidesPerView?: SwiperProps['slidesPerView'];
8
- freeMode?: SwiperProps['freeMode'];
9
- autoplay?: SwiperProps['autoplay'];
10
- useAutoplay?: boolean;
11
- loop?: SwiperProps['loop'];
12
9
  children?: React.ReactNode[] | JSX.Element;
13
10
  }
14
11
  declare const SlideBannerCore: import("react").ForwardRefExoticComponent<SlideBannerCoreProps & import("react").RefAttributes<SwiperRef>>;
@@ -29,11 +29,11 @@ require("swiper/modules/navigation/navigation.min.css");
29
29
  var react_2 = require("swiper/react");
30
30
  require("swiper/swiper-bundle.css");
31
31
  var SlideBannerCore = (0, react_1.forwardRef)(function (_a, ref) {
32
- var scrollbar = _a.scrollbar, slidesPerView = _a.slidesPerView, freeMode = _a.freeMode, autoplay = _a.autoplay, useAutoplay = _a.useAutoplay, loop = _a.loop, children = _a.children, props = __rest(_a, ["scrollbar", "slidesPerView", "freeMode", "autoplay", "useAutoplay", "loop", "children"]);
32
+ var styles = _a.styles, slidesPerView = _a.slidesPerView, children = _a.children, props = __rest(_a, ["styles", "slidesPerView", "children"]);
33
33
  return ((0, jsx_runtime_1.jsx)(react_2.Swiper, __assign({ ref: ref, style: {
34
34
  width: '100%',
35
35
  height: '100%'
36
- }, modules: [swiper_1.Pagination, swiper_1.Navigation, swiper_1.Scrollbar, swiper_1.FreeMode, swiper_1.Autoplay], slidesPerView: slidesPerView, scrollbar: scrollbar, freeMode: freeMode, autoplay: useAutoplay ? autoplay : false, loop: loop }, props, { children: Array.isArray(children) ? (children.map(function (slide, index) { return (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: slide }, index); })) : ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: children })) })));
36
+ }, modules: [swiper_1.Pagination, swiper_1.Navigation, swiper_1.Scrollbar, swiper_1.FreeMode, swiper_1.Autoplay], slidesPerView: slidesPerView, scrollbar: styles.scrollbar, freeMode: styles.freeMode, autoplay: styles.useAutoplay ? styles.autoplay : false, loop: styles.loop }, props, { children: Array.isArray(children) ? (children.map(function (slide, index) { return (0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: slide }, index); })) : ((0, jsx_runtime_1.jsx)(react_2.SwiperSlide, { children: children })) })));
37
37
  });
38
38
  SlideBannerCore.displayName = 'SlideBannerCore';
39
39
  exports.default = SlideBannerCore;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { CustomNavigationProps } from '../types';
3
+ export interface CustomNavigationNextBtnProps {
4
+ isDisabled: boolean;
5
+ styles: CustomNavigationProps;
6
+ onClick?: () => void;
7
+ }
8
+ export declare const CustomNavigationNextBtn: ({ isDisabled, styles, onClick }: CustomNavigationNextBtnProps) => JSX.Element;
9
+ export interface FlexBoxProps {
10
+ direction?: 'row' | 'column';
11
+ justifyContent?: string;
12
+ alignItems?: string;
13
+ gap?: string;
14
+ }
15
+ export default CustomNavigationNextBtn;