pds-dev-kit-web-test 2.5.436 → 2.5.438
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/mock_contentsCarousel.js +5 -17
- package/dist/src/sub/DynamicLayout/mock_contentsList.js +2 -2
- package/dist/src/sub/DynamicLayout/mock_slideBanner.d.ts +63 -63
- package/dist/src/sub/DynamicLayout/mock_slideBanner.js +64 -64
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +63 -192
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.d.ts +2 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.js +8 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationNextBtn.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationNextBtn.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationPrevBtn.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationPrevBtn.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.d.ts +4 -18
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.js +19 -49
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/progressConfigs.js +16 -16
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.d.ts +19 -20
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.js +131 -696
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.d.ts +25 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.js +234 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.d.ts +14 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.js +46 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/types.d.ts +36 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +38 -20
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.d.ts +6 -25
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.js +21 -51
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.d.ts +8 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.js +42 -294
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.d.ts +23 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.js +230 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/types.d.ts +12 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +69 -146
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.d.ts +2 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationPrevBtn.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationPrevBtn.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.d.ts +9 -22
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.js +25 -35
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.d.ts +4 -18
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.js +19 -49
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/progressConfigs.js +8 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.d.ts +26 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.js +235 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.d.ts +16 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.js +63 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.d.ts +22 -24
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.js +155 -925
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/types.d.ts +46 -3
- package/package.json +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.d.ts +0 -35
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.js +0 -118
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.d.ts +0 -32
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.js +0 -183
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.d.ts +0 -35
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.js +0 -118
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { INSET_POSTIION, OUTSET_POSTIION } from '../types';
|
|
3
|
+
import type { CSSProperties } from 'styled-components';
|
|
4
|
+
type ElementsProps = {
|
|
5
|
+
type: string;
|
|
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;
|
|
12
|
+
}) => {
|
|
13
|
+
layoutRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
14
|
+
positionRefs: import("react").MutableRefObject<Record<string, HTMLDivElement | null>>;
|
|
15
|
+
ccbInset: {
|
|
16
|
+
top: string;
|
|
17
|
+
right: string;
|
|
18
|
+
bottom: string;
|
|
19
|
+
left: string;
|
|
20
|
+
};
|
|
21
|
+
componentGroups: Record<string, ElementsProps[]>;
|
|
22
|
+
getPositionStyle: (position: string, ccbInset: Record<string, string>) => CSSProperties;
|
|
23
|
+
getComponentGroupLayout: (components: ElementsProps[], position: string) => CSSProperties;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,234 @@
|
|
|
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 prevBtnLocation = _a.prevBtnLocation, nextBtnLocation = _a.nextBtnLocation, progressBarLocation = _a.progressBarLocation;
|
|
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
|
+
var components = [
|
|
23
|
+
{ type: 'PREV', position: prevBtnLocation },
|
|
24
|
+
{ type: 'NEXT', position: nextBtnLocation },
|
|
25
|
+
{ type: 'PROGRESSBAR', position: progressBarLocation }
|
|
26
|
+
];
|
|
27
|
+
// 위치별로 컴포넌트 그룹화
|
|
28
|
+
var getComponentsByPosition = function () {
|
|
29
|
+
var groups = {};
|
|
30
|
+
components.forEach(function (component) {
|
|
31
|
+
if (!groups[component.position]) {
|
|
32
|
+
groups[component.position] = [];
|
|
33
|
+
}
|
|
34
|
+
groups[component.position].push(component);
|
|
35
|
+
});
|
|
36
|
+
return groups;
|
|
37
|
+
};
|
|
38
|
+
var componentGroups = getComponentsByPosition();
|
|
39
|
+
var GAP = 8;
|
|
40
|
+
// 위치가 어느 방향인지 판단
|
|
41
|
+
var getPositionDirection = function (position) {
|
|
42
|
+
var directions = {
|
|
43
|
+
OUTSET1: 'top',
|
|
44
|
+
OUTSET2: 'top',
|
|
45
|
+
OUTSET3: 'top',
|
|
46
|
+
OUTSET4: 'right',
|
|
47
|
+
OUTSET5: 'right',
|
|
48
|
+
OUTSET6: 'right',
|
|
49
|
+
OUTSET7: 'bottom',
|
|
50
|
+
OUTSET8: 'bottom',
|
|
51
|
+
OUTSET9: 'bottom',
|
|
52
|
+
OUTSET10: 'left',
|
|
53
|
+
OUTSET11: 'left',
|
|
54
|
+
OUTSET12: 'left',
|
|
55
|
+
// INSET은 CCB 내부이므로 방향 개념 없음
|
|
56
|
+
INSET1: 'none',
|
|
57
|
+
INSET2: 'none',
|
|
58
|
+
INSET3: 'none',
|
|
59
|
+
INSET4: 'none',
|
|
60
|
+
INSET5: 'none',
|
|
61
|
+
INSET6: 'none',
|
|
62
|
+
INSET7: 'none',
|
|
63
|
+
INSET8: 'none'
|
|
64
|
+
};
|
|
65
|
+
return directions[position];
|
|
66
|
+
};
|
|
67
|
+
// 위치에 따른 스타일 결정 (CCB 크기를 고려)
|
|
68
|
+
var getPositionStyle = function (position, ccbInset) {
|
|
69
|
+
var base = {
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
display: 'flex',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
justifyContent: 'center'
|
|
74
|
+
};
|
|
75
|
+
// CCB의 중앙 위치 계산
|
|
76
|
+
var ccbTop = parseFloat(ccbInset.top) || 0;
|
|
77
|
+
var ccbRight = parseFloat(ccbInset.right) || 0;
|
|
78
|
+
var ccbBottom = parseFloat(ccbInset.bottom) || 0;
|
|
79
|
+
var ccbLeft = parseFloat(ccbInset.left) || 0;
|
|
80
|
+
// CCB의 실제 크기와 중앙 위치 계산
|
|
81
|
+
var ccbWidth = layoutSize.width - ccbLeft - ccbRight;
|
|
82
|
+
var ccbHeight = layoutSize.height - ccbTop - ccbBottom;
|
|
83
|
+
var ccbCenterX = ccbLeft + ccbWidth / 2;
|
|
84
|
+
var ccbCenterY = ccbTop + ccbHeight / 2;
|
|
85
|
+
var positions = {
|
|
86
|
+
OUTSET1: { top: 0, left: ccbLeft },
|
|
87
|
+
OUTSET2: { top: 0, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
88
|
+
OUTSET3: { top: 0, right: ccbRight },
|
|
89
|
+
OUTSET4: { top: ccbTop, right: 0 },
|
|
90
|
+
OUTSET5: { top: "".concat(ccbCenterY, "px"), right: 0, transform: 'translateY(-50%)' },
|
|
91
|
+
OUTSET6: { bottom: ccbBottom, right: 0 },
|
|
92
|
+
OUTSET7: { bottom: 0, right: ccbRight },
|
|
93
|
+
OUTSET8: { bottom: 0, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
94
|
+
OUTSET9: { bottom: 0, left: ccbLeft },
|
|
95
|
+
OUTSET10: { bottom: ccbBottom, left: 0 },
|
|
96
|
+
OUTSET11: { top: "".concat(ccbCenterY, "px"), left: 0, transform: 'translateY(-50%)' },
|
|
97
|
+
OUTSET12: { top: ccbTop, left: 0 },
|
|
98
|
+
INSET1: { top: ccbTop + GAP, left: ccbLeft + GAP },
|
|
99
|
+
INSET2: { top: ccbTop + GAP, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
100
|
+
INSET3: { top: ccbTop + GAP, right: ccbRight + GAP },
|
|
101
|
+
INSET4: { top: "".concat(ccbCenterY, "px"), right: ccbRight + GAP, transform: 'translateY(-50%)' },
|
|
102
|
+
INSET5: { bottom: ccbBottom + GAP, right: ccbRight + GAP },
|
|
103
|
+
INSET6: {
|
|
104
|
+
bottom: ccbBottom + GAP,
|
|
105
|
+
left: "".concat(ccbCenterX, "px"),
|
|
106
|
+
transform: 'translateX(-50%)'
|
|
107
|
+
},
|
|
108
|
+
INSET7: { bottom: ccbBottom + GAP, left: ccbLeft + GAP },
|
|
109
|
+
INSET8: { top: "".concat(ccbCenterY, "px"), left: ccbLeft + GAP, transform: 'translateY(-50%)' }
|
|
110
|
+
};
|
|
111
|
+
return __assign(__assign({}, base), positions[position]);
|
|
112
|
+
};
|
|
113
|
+
// 컴포넌트 그룹 레이아웃
|
|
114
|
+
var getComponentGroupLayout = function (components, position) {
|
|
115
|
+
var count = components.length;
|
|
116
|
+
var horizontals = [
|
|
117
|
+
'OUTSET1',
|
|
118
|
+
'OUTSET2',
|
|
119
|
+
'OUTSET3',
|
|
120
|
+
'OUTSET7',
|
|
121
|
+
'OUTSET8',
|
|
122
|
+
'OUTSET9',
|
|
123
|
+
'INSET1',
|
|
124
|
+
'INSET2',
|
|
125
|
+
'INSET3',
|
|
126
|
+
'INSET5',
|
|
127
|
+
'INSET6',
|
|
128
|
+
'INSET7'
|
|
129
|
+
];
|
|
130
|
+
var isHorizontal = horizontals.includes(position);
|
|
131
|
+
if (count === 1) {
|
|
132
|
+
return { display: 'block' };
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
display: 'flex',
|
|
136
|
+
flexDirection: isHorizontal ? 'row' : 'column',
|
|
137
|
+
gap: '8px',
|
|
138
|
+
alignItems: 'center'
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
// ccbInset 계산
|
|
142
|
+
var ccbInset = (0, react_1.useMemo)(function () {
|
|
143
|
+
return {
|
|
144
|
+
top: groupSizes.top > 0 ? "".concat(groupSizes.top + GAP, "px") : '0',
|
|
145
|
+
right: groupSizes.right > 0 ? "".concat(groupSizes.right + GAP, "px") : '0',
|
|
146
|
+
bottom: groupSizes.bottom > 0 ? "".concat(groupSizes.bottom + GAP, "px") : '0',
|
|
147
|
+
left: groupSizes.left > 0 ? "".concat(groupSizes.left + GAP, "px") : '0'
|
|
148
|
+
};
|
|
149
|
+
}, [groupSizes]);
|
|
150
|
+
// 레이아웃 크기 측정
|
|
151
|
+
(0, react_1.useEffect)(function () {
|
|
152
|
+
var measureLayout = function () {
|
|
153
|
+
if (layoutRef.current) {
|
|
154
|
+
var _a = layoutRef.current.getBoundingClientRect(), width_1 = _a.width, height_1 = _a.height;
|
|
155
|
+
setLayoutSize(function (prevSize) {
|
|
156
|
+
if (prevSize.width !== width_1 || prevSize.height !== height_1) {
|
|
157
|
+
return { width: width_1, height: height_1 };
|
|
158
|
+
}
|
|
159
|
+
return prevSize;
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
measureLayout();
|
|
164
|
+
var resizeObserver = new ResizeObserver(measureLayout);
|
|
165
|
+
if (layoutRef.current) {
|
|
166
|
+
resizeObserver.observe(layoutRef.current);
|
|
167
|
+
}
|
|
168
|
+
return function () {
|
|
169
|
+
resizeObserver.disconnect();
|
|
170
|
+
};
|
|
171
|
+
}, []);
|
|
172
|
+
// 컴포넌트 그룹의 크기 측정
|
|
173
|
+
(0, react_1.useEffect)(function () {
|
|
174
|
+
var measureGroups = function () {
|
|
175
|
+
var newSizes = {
|
|
176
|
+
top: 0,
|
|
177
|
+
right: 0,
|
|
178
|
+
bottom: 0,
|
|
179
|
+
left: 0
|
|
180
|
+
};
|
|
181
|
+
Object.entries(positionRefs.current).forEach(function (_a) {
|
|
182
|
+
var position = _a[0], ref = _a[1];
|
|
183
|
+
if (ref && ref.offsetHeight && ref.offsetWidth) {
|
|
184
|
+
var direction = getPositionDirection(position);
|
|
185
|
+
// INSET은 CCB 크기 계산에 영향을 주지 않음
|
|
186
|
+
if (direction !== 'none') {
|
|
187
|
+
var size = direction === 'top' || direction === 'bottom' ? ref.offsetHeight : ref.offsetWidth;
|
|
188
|
+
newSizes[direction] = Math.max(newSizes[direction], size);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
// 실제로 크기가 변경되었을 때만 업데이트
|
|
193
|
+
setGroupSizes(function (prevSizes) {
|
|
194
|
+
if (prevSizes.top !== newSizes.top ||
|
|
195
|
+
prevSizes.right !== newSizes.right ||
|
|
196
|
+
prevSizes.bottom !== newSizes.bottom ||
|
|
197
|
+
prevSizes.left !== newSizes.left) {
|
|
198
|
+
return newSizes;
|
|
199
|
+
}
|
|
200
|
+
return prevSizes;
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
// 초기 측정을 위한 타이머
|
|
204
|
+
var timeoutId = setTimeout(function () {
|
|
205
|
+
measureGroups();
|
|
206
|
+
}, 0);
|
|
207
|
+
// ResizeObserver 설정
|
|
208
|
+
var resizeObserver = new ResizeObserver(function (entries) {
|
|
209
|
+
// 크기 변경이 실제로 일어났을 때만 측정
|
|
210
|
+
if (entries.length > 0) {
|
|
211
|
+
measureGroups();
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
// 현재 존재하는 ref들에 observer 연결
|
|
215
|
+
Object.values(positionRefs.current).forEach(function (ref) {
|
|
216
|
+
if (ref) {
|
|
217
|
+
resizeObserver.observe(ref);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
return function () {
|
|
221
|
+
clearTimeout(timeoutId);
|
|
222
|
+
resizeObserver.disconnect();
|
|
223
|
+
};
|
|
224
|
+
}, [componentGroups]);
|
|
225
|
+
return {
|
|
226
|
+
layoutRef: layoutRef,
|
|
227
|
+
positionRefs: positionRefs,
|
|
228
|
+
ccbInset: ccbInset,
|
|
229
|
+
componentGroups: componentGroups,
|
|
230
|
+
getPositionStyle: getPositionStyle,
|
|
231
|
+
getComponentGroupLayout: getComponentGroupLayout
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
exports.useFlexGridLayout = useFlexGridLayout;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { SwiperClass, SwiperRef } from 'swiper/react';
|
|
3
|
+
export declare function useSwiper(): {
|
|
4
|
+
swiperRef: import("react").MutableRefObject<SwiperRef | null>;
|
|
5
|
+
progressRef: import("react").MutableRefObject<number>;
|
|
6
|
+
leftTimeMsRef: import("react").MutableRefObject<number>;
|
|
7
|
+
isBeginning: boolean;
|
|
8
|
+
isEnd: boolean;
|
|
9
|
+
onSwiper: (swiper: SwiperClass) => void;
|
|
10
|
+
onSlideChangeTransitionEnd: (swiper: SwiperClass) => void;
|
|
11
|
+
onAutoplayTimeLeft: (_: SwiperClass, time: number, progress: number) => void;
|
|
12
|
+
onClickPrevBtn: () => void;
|
|
13
|
+
onClickNextBtn: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSwiper = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
function useSwiper() {
|
|
6
|
+
var _a = (0, react_1.useState)(true), isBeginning = _a[0], setIsBeginning = _a[1];
|
|
7
|
+
var _b = (0, react_1.useState)(false), isEnd = _b[0], setIsEnd = _b[1];
|
|
8
|
+
var progressRef = (0, react_1.useRef)(0);
|
|
9
|
+
var leftTimeMsRef = (0, react_1.useRef)(0);
|
|
10
|
+
var swiperRef = (0, react_1.useRef)(null);
|
|
11
|
+
var onSwiper = function (swiper) {
|
|
12
|
+
setIsBeginning(swiper.isBeginning);
|
|
13
|
+
setIsEnd(swiper.isEnd);
|
|
14
|
+
};
|
|
15
|
+
var onSlideChangeTransitionEnd = function (swiper) {
|
|
16
|
+
setIsBeginning(swiper.isBeginning);
|
|
17
|
+
setIsEnd(swiper.isEnd);
|
|
18
|
+
};
|
|
19
|
+
var onAutoplayTimeLeft = (0, react_1.useCallback)(function (_, time, progress) {
|
|
20
|
+
leftTimeMsRef.current = time;
|
|
21
|
+
progressRef.current = progress;
|
|
22
|
+
}, []);
|
|
23
|
+
var onClickPrevBtn = function () {
|
|
24
|
+
if (swiperRef.current) {
|
|
25
|
+
swiperRef.current.swiper.slidePrev();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var onClickNextBtn = function () {
|
|
29
|
+
if (swiperRef.current) {
|
|
30
|
+
swiperRef.current.swiper.slideNext();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
swiperRef: swiperRef,
|
|
35
|
+
progressRef: progressRef,
|
|
36
|
+
leftTimeMsRef: leftTimeMsRef,
|
|
37
|
+
isBeginning: isBeginning,
|
|
38
|
+
isEnd: isEnd,
|
|
39
|
+
onSwiper: onSwiper,
|
|
40
|
+
onSlideChangeTransitionEnd: onSlideChangeTransitionEnd,
|
|
41
|
+
onAutoplayTimeLeft: onAutoplayTimeLeft,
|
|
42
|
+
onClickPrevBtn: onClickPrevBtn,
|
|
43
|
+
onClickNextBtn: onClickNextBtn
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.useSwiper = useSwiper;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import type { NUMBER_INTEGER } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
2
|
+
import type { SwiperProps } from 'swiper/react';
|
|
2
3
|
export type ContentsCarouselPropsKeys = keyof CB_STYLE_PROP_CONTENTSCAROUSEL_SPECS;
|
|
4
|
+
export type OUTSET_POSTIION = 'OUTSET1' | 'OUTSET2' | 'OUTSET3' | 'OUTSET4' | 'OUTSET5' | 'OUTSET6' | 'OUTSET7' | 'OUTSET8' | 'OUTSET9' | 'OUTSET10' | 'OUTSET11' | 'OUTSET12';
|
|
5
|
+
export type INSET_POSTIION = 'INSET1' | 'INSET2' | 'INSET3' | 'INSET4' | 'INSET5' | 'INSET6' | 'INSET7' | 'INSET8';
|
|
3
6
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_STYLE_TYPE = 'DESIGN1' | 'DESIGN2';
|
|
4
7
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_ITEMSPACING_TYPE = 'WIDE' | 'NORMAL' | 'NARROW';
|
|
5
8
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_ITEMCURSOR_TYPE = 'ONCE' | 'ALL' | 'SCROLL';
|
|
6
9
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_INFINITESCROLL_TYPE = boolean;
|
|
7
10
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PREVBTNSTYLE_TYPE = 'NONE' | 'DESIGN1' | 'DESIGN2' | 'DESIGN3' | 'DESIGN4' | 'DESIGN5' | 'DESIGN6' | 'DESIGN7' | 'DESIGN8' | 'DESIGN9' | 'DESIGN10' | 'DESIGN11' | 'DESIGN12' | 'DESIGN13' | 'DESIGN14' | 'DESIGN15' | 'DESIGN16' | 'DESIGN17' | 'DESIGN18' | 'DESIGN19' | 'DESIGN20' | 'DESIGN21' | 'DESIGN22' | 'DESIGN23' | 'DESIGN24' | 'DESIGN25' | 'DESIGN26' | 'DESIGN27' | 'DESIGN28' | 'DESIGN29' | 'DESIGN30' | 'DESIGN31' | 'DESIGN32' | 'DESIGN33' | 'DESIGN34' | 'DESIGN35' | 'DESIGN36' | 'DESIGN37' | 'DESIGN38' | 'DESIGN39' | 'DESIGN40' | 'DESIGN41' | 'DESIGN42' | 'DESIGN43' | 'DESIGN44' | 'DESIGN45' | 'DESIGN46' | 'DESIGN47' | 'DESIGN48' | 'DESIGN49' | 'DESIGN50' | 'DESIGN51' | 'DESIGN52' | 'DESIGN53' | 'DESIGN54' | 'DESIGN55' | 'DESIGN56' | 'DESIGN57' | 'DESIGN58' | 'DESIGN59' | 'DESIGN60' | 'DESIGN61' | 'DESIGN62' | 'DESIGN63' | 'DESIGN64' | 'DESIGN65' | 'DESIGN66' | 'DESIGN67' | 'DESIGN68' | 'DESIGN69' | 'DESIGN70' | 'DESIGN71' | 'DESIGN72' | 'DESIGN73' | 'DESIGN74' | 'DESIGN75' | 'DESIGN76' | 'DESIGN77' | 'DESIGN78' | 'DESIGN79' | 'DESIGN80' | 'DESIGN81' | 'DESIGN82' | 'DESIGN83' | 'DESIGN84' | 'DESIGN85' | 'DESIGN86' | 'DESIGN87' | 'DESIGN88' | 'DESIGN89' | 'DESIGN90' | 'DESIGN91' | 'DESIGN92' | 'DESIGN93' | 'DESIGN94' | 'DESIGN95' | 'DESIGN96' | 'DESIGN97' | 'DESIGN98' | 'DESIGN99' | 'DESIGN100';
|
|
8
|
-
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PREVBTNLOCATION_TYPE =
|
|
11
|
+
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PREVBTNLOCATION_TYPE = OUTSET_POSTIION | INSET_POSTIION;
|
|
9
12
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PREVBTNSIZE_TYPE = 'SMALL' | 'MEDIUM' | 'LARGE';
|
|
10
13
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PREVBTNPRIMARYCOLOR = string;
|
|
11
14
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PREVBTNSECONDARYCOLOR = string;
|
|
12
15
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_NEXTBTNSTYLE_TYPE = 'NONE' | 'DESIGN1' | 'DESIGN2' | 'DESIGN3' | 'DESIGN4' | 'DESIGN5' | 'DESIGN6' | 'DESIGN7' | 'DESIGN8' | 'DESIGN9' | 'DESIGN10' | 'DESIGN11' | 'DESIGN12' | 'DESIGN13' | 'DESIGN14' | 'DESIGN15' | 'DESIGN16' | 'DESIGN17' | 'DESIGN18' | 'DESIGN19' | 'DESIGN20' | 'DESIGN21' | 'DESIGN22' | 'DESIGN23' | 'DESIGN24' | 'DESIGN25' | 'DESIGN26' | 'DESIGN27' | 'DESIGN28' | 'DESIGN29' | 'DESIGN30' | 'DESIGN31' | 'DESIGN32' | 'DESIGN33' | 'DESIGN34' | 'DESIGN35' | 'DESIGN36' | 'DESIGN37' | 'DESIGN38' | 'DESIGN39' | 'DESIGN40' | 'DESIGN41' | 'DESIGN42' | 'DESIGN43' | 'DESIGN44' | 'DESIGN45' | 'DESIGN46' | 'DESIGN47' | 'DESIGN48' | 'DESIGN49' | 'DESIGN50' | 'DESIGN51' | 'DESIGN52' | 'DESIGN53' | 'DESIGN54' | 'DESIGN55' | 'DESIGN56' | 'DESIGN57' | 'DESIGN58' | 'DESIGN59' | 'DESIGN60' | 'DESIGN61' | 'DESIGN62' | 'DESIGN63' | 'DESIGN64' | 'DESIGN65' | 'DESIGN66' | 'DESIGN67' | 'DESIGN68' | 'DESIGN69' | 'DESIGN70' | 'DESIGN71' | 'DESIGN72' | 'DESIGN73' | 'DESIGN74' | 'DESIGN75' | 'DESIGN76' | 'DESIGN77' | 'DESIGN78' | 'DESIGN79' | 'DESIGN80' | 'DESIGN81' | 'DESIGN82' | 'DESIGN83' | 'DESIGN84' | 'DESIGN85' | 'DESIGN86' | 'DESIGN87' | 'DESIGN88' | 'DESIGN89' | 'DESIGN90' | 'DESIGN91' | 'DESIGN92' | 'DESIGN93' | 'DESIGN94' | 'DESIGN95' | 'DESIGN96' | 'DESIGN97' | 'DESIGN98' | 'DESIGN99' | 'DESIGN100';
|
|
13
|
-
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_NEXTBTNLOCATION_TYPE =
|
|
16
|
+
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_NEXTBTNLOCATION_TYPE = OUTSET_POSTIION | INSET_POSTIION;
|
|
14
17
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_NEXTBTNSIZE_TYPE = 'SMALL' | 'MEDIUM' | 'LARGE';
|
|
15
18
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_NEXTBTNPRIMARYCOLOR = string;
|
|
16
19
|
export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_NEXTBTNSECONDARYCOLOR = string;
|
|
@@ -103,3 +106,34 @@ export type CB_STYLE_PROP_CONTENTSCAROUSEL_SPECS = CB_STYLE_PROP_CONTENTSCAROUSE
|
|
|
103
106
|
'CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_INFINITESCROLL:MOBILE': CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_INFINITESCROLL_TYPE;
|
|
104
107
|
'CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_INFINITESCROLL:MOBILE:HOVER': CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_INFINITESCROLL_TYPE;
|
|
105
108
|
};
|
|
109
|
+
export interface CustomNavigationProps {
|
|
110
|
+
prevBtnDisabled?: boolean;
|
|
111
|
+
prevBtnType?: CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PREVBTNSTYLE_TYPE;
|
|
112
|
+
prevBtnLocation?: OUTSET_POSTIION | INSET_POSTIION;
|
|
113
|
+
prevBtnSize?: 'SMALL' | 'MEDIUM' | 'LARGE';
|
|
114
|
+
prevBtnPrimaryColor?: string;
|
|
115
|
+
prevBtnSecondaryColor?: string;
|
|
116
|
+
nextBtnDisabled?: boolean;
|
|
117
|
+
nextBtnType?: CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_NEXTBTNSTYLE_TYPE;
|
|
118
|
+
nextBtnLocation?: OUTSET_POSTIION | INSET_POSTIION;
|
|
119
|
+
nextBtnSize?: 'SMALL' | 'MEDIUM' | 'LARGE';
|
|
120
|
+
nextBtnPrimaryColor?: string;
|
|
121
|
+
nextBtnSecondaryColor?: string;
|
|
122
|
+
onPrevBtnClick?: () => void;
|
|
123
|
+
onNextBtnClick?: () => void;
|
|
124
|
+
}
|
|
125
|
+
export interface CustomProgressbarProps {
|
|
126
|
+
type?: CB_STYLE_PROP_CONTENTSCAROUSEL_SPEC_PROGRESSBAR_TYPE;
|
|
127
|
+
size?: 'SMALL' | 'MEDIUM' | 'LARGE';
|
|
128
|
+
primaryColor?: string;
|
|
129
|
+
secondaryColor?: string;
|
|
130
|
+
}
|
|
131
|
+
export type CoreCarouselProps = {
|
|
132
|
+
scrollbar?: SwiperProps['scrollbar'];
|
|
133
|
+
slidesPerGroup?: SwiperProps['slidesPerGroup'];
|
|
134
|
+
spaceBetween?: SwiperProps['spaceBetween'];
|
|
135
|
+
freeMode?: SwiperProps['freeMode'];
|
|
136
|
+
autoplay?: SwiperProps['autoplay'];
|
|
137
|
+
useAutoplay?: boolean;
|
|
138
|
+
loop?: SwiperProps['loop'];
|
|
139
|
+
};
|
|
@@ -29,6 +29,7 @@ var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverB
|
|
|
29
29
|
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
|
+
var useFlexGridLayout_1 = require("./hooks/useFlexGridLayout");
|
|
32
33
|
function ContentsList(props) {
|
|
33
34
|
var _a, _b, _c, _d;
|
|
34
35
|
var _e = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _e.device, mode = _e.mode, queryData = _e.queryData;
|
|
@@ -98,32 +99,49 @@ function ContentsList(props) {
|
|
|
98
99
|
var listMinHeight = oneCompositionMinHeight * numberOfRows +
|
|
99
100
|
(numberOfRows - 1) * rowGap +
|
|
100
101
|
paddingTB;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
borderTopRightRadius: hoverStyle.borderTopRightRadius,
|
|
114
|
-
borderWidth: hoverStyle.borderWidth,
|
|
115
|
-
borderColor: hoverStyle.borderColor,
|
|
116
|
-
borderStyle: hoverStyle.borderStyle
|
|
117
|
-
} }, { children: (0, createCompositions_1.createCompositions)({
|
|
102
|
+
var _l = (0, useFlexGridLayout_1.useFlexGridLayout)({
|
|
103
|
+
paginationLocation: (isHovered ? paginationHoverStyle.location : paginationNormalStyle.location) || 'OUTSET1'
|
|
104
|
+
}), layoutRef = _l.layoutRef, positionRefs = _l.positionRefs, ccbInset = _l.ccbInset, componentGroups = _l.componentGroups, getPositionStyle = _l.getPositionStyle, getComponentGroupLayout = _l.getComponentGroupLayout;
|
|
105
|
+
var renderElements = function (component) {
|
|
106
|
+
switch (component.type) {
|
|
107
|
+
case 'PAGINATION':
|
|
108
|
+
return ((0, jsx_runtime_1.jsx)(CustomPagination_1.CustomPagination, { styles: isHovered ? paginationHoverStyle : paginationNormalStyle, current: currentPage, total: totalPage, onPageClick: handlePageClick }));
|
|
109
|
+
default:
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
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({ id: "contentslist-box", 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); }, "data-number-of-items": CB_CONTENT_PROP_CONTENTSLIST_SPEC_ITEMCOUNTS, "data-number-of-columns": CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS, "data-row-gap": rowGap, "data-column-gap": columnGap, "data-min-width": listMinWidth, "data-min-height": listMinHeight }, { children: (0, jsx_runtime_1.jsxs)(S_ContentsListLayout, __assign({ className: "cb-contentslist-layout-box", ref: layoutRef }, { children: [(0, jsx_runtime_1.jsx)(S_ContentsListWrapper, __assign({ className: "cb-contentslist-wrapper", ccbInset: ccbInset, contentPropCss: contentPropCss, stylePropCss: isHovered ? hoverStylePropCss : stylePropCss }, { children: (0, createCompositions_1.createCompositions)({
|
|
118
114
|
valueType: CB_CONTENT_PROP_CONTENTSLIST_SPEC_VALUETYPE,
|
|
119
115
|
queryPath: CB_CONTENT_PROP_CONTENTSLIST_SPEC_CONNECTDATA,
|
|
120
116
|
limit: CB_CONTENT_PROP_CONTENTSLIST_SPEC_ITEMCOUNTS,
|
|
121
117
|
queryData: queryData,
|
|
122
118
|
compositions: compositions
|
|
123
|
-
}).slice(startIndex, endIndex) })), (
|
|
119
|
+
}).slice(startIndex, endIndex) })), Object.entries(componentGroups).map(function (_a) {
|
|
120
|
+
var position = _a[0], groupComponents = _a[1];
|
|
121
|
+
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-contentslist-button-group", ref: function (el) {
|
|
122
|
+
if (el) {
|
|
123
|
+
positionRefs.current[position] = el;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
delete positionRefs.current[position];
|
|
127
|
+
}
|
|
128
|
+
}, style: __assign(__assign({}, getPositionStyle(position, ccbInset)), { zIndex: 3 }) }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-contentslist-button-layout-box", style: getComponentGroupLayout(groupComponents, position) }, { children: groupComponents.map(function (component) { return renderElements(component); }) })) }), position));
|
|
129
|
+
})] })) })) })));
|
|
124
130
|
}
|
|
125
|
-
var
|
|
126
|
-
var
|
|
131
|
+
var S_ContentsListLayout = 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"])));
|
|
132
|
+
var S_ContentsListWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n bottom: ", ";\n display: grid;\n left: ", ";\n position: absolute;\n right: ", ";\n top: ", ";\n\n ", ";\n ", ";\n"], ["\n bottom: ", ";\n display: grid;\n left: ", ";\n position: absolute;\n right: ", ";\n top: ", ";\n\n ", ";\n ", ";\n"])), function (_a) {
|
|
133
|
+
var ccbInset = _a.ccbInset;
|
|
134
|
+
return ccbInset.bottom;
|
|
135
|
+
}, function (_a) {
|
|
136
|
+
var ccbInset = _a.ccbInset;
|
|
137
|
+
return ccbInset.left;
|
|
138
|
+
}, function (_a) {
|
|
139
|
+
var ccbInset = _a.ccbInset;
|
|
140
|
+
return ccbInset.right;
|
|
141
|
+
}, function (_a) {
|
|
142
|
+
var ccbInset = _a.ccbInset;
|
|
143
|
+
return ccbInset.top;
|
|
144
|
+
}, function (_a) {
|
|
127
145
|
var contentPropCss = _a.contentPropCss;
|
|
128
146
|
return contentPropCss;
|
|
129
147
|
}, function (_a) {
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
current
|
|
5
|
-
total
|
|
6
|
-
|
|
7
|
-
offset?: {
|
|
8
|
-
top?: string;
|
|
9
|
-
bottom?: string;
|
|
10
|
-
left?: string;
|
|
11
|
-
right?: string;
|
|
12
|
-
translateX?: number;
|
|
13
|
-
translateY?: number;
|
|
14
|
-
transformOrigin?: string;
|
|
15
|
-
};
|
|
16
|
-
size?: number;
|
|
17
|
-
primaryColor?: string;
|
|
18
|
-
secondaryColor?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare const CustomPagination: ({ current, total, type, offset, size, primaryColor, secondaryColor, onPageClick }: CustomPaginationProps & {
|
|
2
|
+
import type { CustomPaginationProps } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
current: number;
|
|
5
|
+
total: number;
|
|
6
|
+
styles: CustomPaginationProps;
|
|
21
7
|
onPageClick: (page: number) => void;
|
|
22
|
-
}) => JSX.Element;
|
|
23
|
-
export interface FlexBoxProps {
|
|
24
|
-
direction?: 'row' | 'column';
|
|
25
|
-
justifyContent?: string;
|
|
26
|
-
alignItems?: string;
|
|
27
|
-
gap?: string;
|
|
28
8
|
}
|
|
9
|
+
export declare const CustomPagination: ({ current, total, styles, onPageClick }: Props) => JSX.Element;
|
|
29
10
|
export default CustomPagination;
|
|
@@ -14,36 +14,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
};
|
|
15
15
|
return __assign.apply(this, arguments);
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
|
|
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;
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
19
|
};
|
|
40
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
21
|
exports.CustomPagination = void 0;
|
|
42
22
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
|
-
var styled_components_1 =
|
|
23
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
44
24
|
var paginationConfigs_1 = require("./paginationConfigs");
|
|
45
25
|
var CustomPagination = function (_a) {
|
|
46
|
-
var _b = _a.current, current = _b === void 0 ? 1 : _b, _c = _a.total, total = _c === void 0 ? 1 : _c,
|
|
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;
|
|
47
27
|
var getPageGroupStart = function (page) {
|
|
48
28
|
return Math.floor((page - 1) / 5) * 5 + 1;
|
|
49
29
|
};
|
|
@@ -64,52 +44,42 @@ var CustomPagination = function (_a) {
|
|
|
64
44
|
onPageClick(pageNumber);
|
|
65
45
|
};
|
|
66
46
|
var renderPagination = function () {
|
|
67
|
-
switch (type) {
|
|
47
|
+
switch (styles.type) {
|
|
68
48
|
case 'NONE':
|
|
69
49
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
70
50
|
case 'DESIGN1':
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design1, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design1, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
72
52
|
case 'DESIGN2':
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design2, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design2, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
74
54
|
case 'DESIGN3':
|
|
75
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design3, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design3, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
76
56
|
case 'DESIGN4':
|
|
77
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design4, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design4, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
78
58
|
case 'DESIGN5':
|
|
79
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design5, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design5, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
80
60
|
case 'DESIGN6':
|
|
81
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design6, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design6, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
82
62
|
case 'DESIGN7':
|
|
83
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design7, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design7, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
84
64
|
case 'DESIGN8':
|
|
85
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design8, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design8, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
86
66
|
case 'DESIGN9':
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design9, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design9, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
88
68
|
case 'DESIGN10':
|
|
89
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design10, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design10, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
90
70
|
case 'DESIGN11':
|
|
91
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design11, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design11, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
92
72
|
case 'DESIGN12':
|
|
93
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design12, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design12, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
94
74
|
case 'DESIGN13':
|
|
95
|
-
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design13, { total: total, current: current, primaryColor: primaryColor, secondaryColor: secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
75
|
+
return ((0, jsx_runtime_1.jsx)(paginationConfigs_1.Design13, { total: total, current: current, primaryColor: styles.primaryColor, secondaryColor: styles.secondaryColor, pages: pageNumbers, onNext: handleNext, onPrevious: handlePrevious, onPageChange: handlePageClick }));
|
|
96
76
|
default:
|
|
97
77
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
98
78
|
}
|
|
99
79
|
};
|
|
100
|
-
return ((0, jsx_runtime_1.jsx)(S_Pagination, __assign({ className: "custom-pagination_".concat(current)
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(S_Pagination, __assign({ className: "custom-pagination_".concat(current) }, { children: renderPagination() })));
|
|
101
81
|
};
|
|
102
82
|
exports.CustomPagination = CustomPagination;
|
|
103
|
-
var S_Pagination = styled_components_1.default.div(
|
|
104
|
-
var $offset = _a.$offset;
|
|
105
|
-
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n "])), $offset.top !== undefined ? "top: ".concat($offset.top, ";") : '', $offset.bottom !== undefined ? "bottom: ".concat($offset.bottom, ";") : '', $offset.left !== undefined ? "left: ".concat($offset.left, ";") : '', $offset.right !== undefined ? "right: ".concat($offset.right, ";") : '');
|
|
106
|
-
}, function (_a) {
|
|
107
|
-
var _b, _c;
|
|
108
|
-
var $size = _a.$size, $offset = _a.$offset;
|
|
109
|
-
return "scale(".concat($size, ") translate(").concat((_b = $offset.translateX) !== null && _b !== void 0 ? _b : 0, "%, ").concat((_c = $offset.translateY) !== null && _c !== void 0 ? _c : 0, "%)");
|
|
110
|
-
}, function (_a) {
|
|
111
|
-
var $offset = _a.$offset;
|
|
112
|
-
return $offset.transformOrigin || 'center center';
|
|
113
|
-
});
|
|
83
|
+
var S_Pagination = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: 120px;\n padding: 5px;\n"], ["\n max-width: 120px;\n padding: 5px;\n"])));
|
|
114
84
|
exports.default = exports.CustomPagination;
|
|
115
|
-
var templateObject_1
|
|
85
|
+
var templateObject_1;
|