pds-dev-kit-web-test 0.2.1 → 0.2.2

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.
@@ -11,6 +11,7 @@ interface Carousel {
11
11
  mode?: 'normal' | 'loop' | 'autoplay';
12
12
  autoplayDelay?: number;
13
13
  buttonSpacing?: string;
14
+ allowTouchMove?: boolean;
14
15
  }
15
- declare function Carousel({ children, spaceBetween, slidesPerView, slidesPerGroup, breakpoints, mode, autoplayDelay, buttonSpacing }: Carousel): JSX.Element;
16
+ declare function Carousel({ children, spaceBetween, slidesPerView, slidesPerGroup, breakpoints, mode, autoplayDelay, buttonSpacing, allowTouchMove }: Carousel): JSX.Element;
16
17
  export default Carousel;
@@ -45,12 +45,12 @@ var styled_components_1 = __importDefault(require("styled-components"));
45
45
  var pdsOriginal_1 = require("../../pdsOriginal");
46
46
  var swiper_style_1 = __importDefault(require("./swiper.style"));
47
47
  function Carousel(_a) {
48
- var children = _a.children, spaceBetween = _a.spaceBetween, slidesPerView = _a.slidesPerView, slidesPerGroup = _a.slidesPerGroup, breakpoints = _a.breakpoints, _b = _a.mode, mode = _b === void 0 ? 'normal' : _b, _c = _a.autoplayDelay, autoplayDelay = _c === void 0 ? 3 : _c, buttonSpacing = _a.buttonSpacing;
48
+ var children = _a.children, spaceBetween = _a.spaceBetween, slidesPerView = _a.slidesPerView, slidesPerGroup = _a.slidesPerGroup, breakpoints = _a.breakpoints, _b = _a.mode, mode = _b === void 0 ? 'normal' : _b, _c = _a.autoplayDelay, autoplayDelay = _c === void 0 ? 3 : _c, buttonSpacing = _a.buttonSpacing, _d = _a.allowTouchMove, allowTouchMove = _d === void 0 ? true : _d;
49
49
  var swiperRef = (0, react_1.useRef)(null);
50
- var _d = (0, react_1.useState)(true), isBeginning = _d[0], setIsBeginning = _d[1];
51
- var _e = (0, react_1.useState)(true), isEnd = _e[0], setIsEnd = _e[1];
52
- var _f = (0, react_1.useState)(true), isLocked = _f[0], setIsLocked = _f[1];
53
- var _g = (0, react_1.useState)(mode), targetMode = _g[0], setTargetMode = _g[1];
50
+ var _e = (0, react_1.useState)(true), isBeginning = _e[0], setIsBeginning = _e[1];
51
+ var _f = (0, react_1.useState)(true), isEnd = _f[0], setIsEnd = _f[1];
52
+ var _g = (0, react_1.useState)(true), isLocked = _g[0], setIsLocked = _g[1];
53
+ var _h = (0, react_1.useState)(mode), targetMode = _h[0], setTargetMode = _h[1];
54
54
  /**
55
55
  * @when : 캐러셀이 처음 화면에 렌더링될 때
56
56
  * @expected
@@ -66,7 +66,7 @@ function Carousel(_a) {
66
66
  }
67
67
  setTargetMode(mode);
68
68
  }, [slidesPerView, mode, children]);
69
- return ((0, jsx_runtime_1.jsxs)(S_Carousel, { children: [(0, jsx_runtime_1.jsx)(S_SwiperStyleWrapper, { children: (0, jsx_runtime_1.jsx)(react_2.Swiper, __assign({ modules: [swiper_1.Navigation, swiper_1.Autoplay], centerInsufficientSlides: true, spaceBetween: spaceBetween, slidesPerView: slidesPerView, slidesPerGroup: slidesPerGroup, breakpoints: breakpoints, loop: targetMode === 'loop' || targetMode === 'autoplay', autoplay: targetMode === 'autoplay'
69
+ return ((0, jsx_runtime_1.jsxs)(S_Carousel, { children: [(0, jsx_runtime_1.jsx)(S_SwiperStyleWrapper, { children: (0, jsx_runtime_1.jsx)(react_2.Swiper, __assign({ allowTouchMove: allowTouchMove, modules: [swiper_1.Navigation, swiper_1.Autoplay], centerInsufficientSlides: true, spaceBetween: spaceBetween, slidesPerView: slidesPerView, slidesPerGroup: slidesPerGroup, breakpoints: breakpoints, loop: targetMode === 'loop' || targetMode === 'autoplay', autoplay: targetMode === 'autoplay'
70
70
  ? { delay: autoplayDelay * 1000, disableOnInteraction: false }
71
71
  : undefined, onSwiper: function (swiper) {
72
72
  swiperRef.current = swiper;
@@ -20,6 +20,9 @@ export declare const customsectionMock: ({
20
20
  endAt?: undefined;
21
21
  accordionItems?: undefined;
22
22
  openedItemId?: undefined;
23
+ carouselSettings?: undefined;
24
+ contentsCarouselItems?: undefined;
25
+ imgCarouselItems?: undefined;
23
26
  };
24
27
  };
25
28
  };
@@ -54,6 +57,9 @@ export declare const customsectionMock: ({
54
57
  endAt?: undefined;
55
58
  accordionItems?: undefined;
56
59
  openedItemId?: undefined;
60
+ carouselSettings?: undefined;
61
+ contentsCarouselItems?: undefined;
62
+ imgCarouselItems?: undefined;
57
63
  };
58
64
  };
59
65
  };
@@ -84,6 +90,9 @@ export declare const customsectionMock: ({
84
90
  endAt?: undefined;
85
91
  accordionItems?: undefined;
86
92
  openedItemId?: undefined;
93
+ carouselSettings?: undefined;
94
+ contentsCarouselItems?: undefined;
95
+ imgCarouselItems?: undefined;
87
96
  };
88
97
  };
89
98
  };
@@ -114,6 +123,9 @@ export declare const customsectionMock: ({
114
123
  endAt?: undefined;
115
124
  accordionItems?: undefined;
116
125
  openedItemId?: undefined;
126
+ carouselSettings?: undefined;
127
+ contentsCarouselItems?: undefined;
128
+ imgCarouselItems?: undefined;
117
129
  };
118
130
  };
119
131
  };
@@ -144,6 +156,9 @@ export declare const customsectionMock: ({
144
156
  endAt?: undefined;
145
157
  accordionItems?: undefined;
146
158
  openedItemId?: undefined;
159
+ carouselSettings?: undefined;
160
+ contentsCarouselItems?: undefined;
161
+ imgCarouselItems?: undefined;
147
162
  };
148
163
  };
149
164
  };
@@ -174,6 +189,9 @@ export declare const customsectionMock: ({
174
189
  accountId?: undefined;
175
190
  accordionItems?: undefined;
176
191
  openedItemId?: undefined;
192
+ carouselSettings?: undefined;
193
+ contentsCarouselItems?: undefined;
194
+ imgCarouselItems?: undefined;
177
195
  };
178
196
  };
179
197
  };
@@ -207,6 +225,104 @@ export declare const customsectionMock: ({
207
225
  accountId?: undefined;
208
226
  startAt?: undefined;
209
227
  endAt?: undefined;
228
+ carouselSettings?: undefined;
229
+ contentsCarouselItems?: undefined;
230
+ imgCarouselItems?: undefined;
231
+ };
232
+ };
233
+ };
234
+ style: {
235
+ backgroundColor: string;
236
+ };
237
+ layout: {};
238
+ hoverStyle?: undefined;
239
+ } | {
240
+ type: string;
241
+ gridItemData: {
242
+ x: number;
243
+ y: number;
244
+ w: number;
245
+ h: number;
246
+ i: string;
247
+ };
248
+ content: {
249
+ data: {
250
+ type: string;
251
+ value: {
252
+ carouselSettings: {
253
+ mode: string;
254
+ carouselAutoplayTime: number;
255
+ spaceBetween: number;
256
+ slidesPerView: number;
257
+ sliderPerGroup: number;
258
+ buttonSpacing: string;
259
+ effect?: undefined;
260
+ };
261
+ contentsCarouselItems: {
262
+ title: string;
263
+ description: string;
264
+ imageSrc: string;
265
+ linkSrc: string;
266
+ linkType: string;
267
+ buttonLabel: string;
268
+ id: string;
269
+ }[];
270
+ text?: undefined;
271
+ size?: undefined;
272
+ src?: undefined;
273
+ alt?: undefined;
274
+ accountId?: undefined;
275
+ startAt?: undefined;
276
+ endAt?: undefined;
277
+ accordionItems?: undefined;
278
+ openedItemId?: undefined;
279
+ imgCarouselItems?: undefined;
280
+ };
281
+ };
282
+ };
283
+ style: {
284
+ backgroundColor: string;
285
+ };
286
+ layout: {};
287
+ hoverStyle?: undefined;
288
+ } | {
289
+ type: string;
290
+ gridItemData: {
291
+ x: number;
292
+ y: number;
293
+ w: number;
294
+ h: number;
295
+ i: string;
296
+ };
297
+ content: {
298
+ data: {
299
+ type: string;
300
+ value: {
301
+ carouselSettings: {
302
+ mode: string;
303
+ carouselAutoplayTime: number;
304
+ spaceBetween: number;
305
+ slidesPerView: number;
306
+ sliderPerGroup: number;
307
+ effect: string;
308
+ buttonSpacing?: undefined;
309
+ };
310
+ imgCarouselItems: {
311
+ title: string;
312
+ description: string;
313
+ imageSrc: string;
314
+ id: string;
315
+ }[];
316
+ text?: undefined;
317
+ size?: undefined;
318
+ src?: undefined;
319
+ alt?: undefined;
320
+ accountId?: undefined;
321
+ startAt?: undefined;
322
+ endAt?: undefined;
323
+ accordionItems?: undefined;
324
+ openedItemId?: undefined;
325
+ contentsCarouselItems?: undefined;
210
326
  };
211
327
  };
212
328
  };
@@ -194,5 +194,135 @@ exports.customsectionMock = [
194
194
  // alignItems: 'center'
195
195
  },
196
196
  layout: {}
197
+ },
198
+ {
199
+ type: 'CONTENTS_CAROUSEL',
200
+ gridItemData: {
201
+ x: 5,
202
+ y: 5,
203
+ w: 10,
204
+ h: 10,
205
+ i: '9'
206
+ },
207
+ content: {
208
+ data: {
209
+ type: 'CONTENTS_CAROUSEL',
210
+ value: {
211
+ carouselSettings: {
212
+ mode: 'normal',
213
+ carouselAutoplayTime: 1,
214
+ spaceBetween: 10,
215
+ slidesPerView: 3,
216
+ sliderPerGroup: 1,
217
+ buttonSpacing: '10px'
218
+ },
219
+ contentsCarouselItems: [
220
+ {
221
+ title: 'im 1 carousel item',
222
+ description: 'im 1 carousel item',
223
+ imageSrc: 'https://cdn.dev.publishingkit.net/d474e86e-9df7-44dd-999e-0bc2a7c9b267.jpg',
224
+ linkSrc: 'im 1 carousel item',
225
+ linkType: 'NONE',
226
+ buttonLabel: 'im 1 carousel item',
227
+ id: '1'
228
+ },
229
+ {
230
+ title: 'im 2 carousel item',
231
+ description: 'im 2 carousel item',
232
+ imageSrc: 'https://cdn.dev.publishingkit.net/5cbc7c88-9566-4ce1-9dc8-0845259aa6a1.jpg',
233
+ linkSrc: 'im 2 carousel item',
234
+ linkType: 'NONE',
235
+ buttonLabel: 'im 2 carousel item',
236
+ id: '2'
237
+ },
238
+ {
239
+ title: 'im 3 carousel item',
240
+ description: 'im 3 carousel item',
241
+ imageSrc: 'https://cdn.dev.publishingkit.net/172b5a98-fd4b-4b2e-bdca-928d182c1548.jpg',
242
+ linkSrc: 'im 3 carousel item',
243
+ linkType: 'NONE',
244
+ buttonLabel: 'im 3 carousel item',
245
+ id: '3'
246
+ },
247
+ {
248
+ title: 'im 4 carousel item',
249
+ description: 'im 4 carousel item',
250
+ imageSrc: 'https://cdn.dev.publishingkit.net/30ddd804-841a-416f-88a6-fbcb84924036.jpg',
251
+ linkSrc: 'im 4 carousel item',
252
+ linkType: 'NONE',
253
+ buttonLabel: 'im 4 carousel item',
254
+ id: '4'
255
+ }
256
+ ]
257
+ }
258
+ }
259
+ },
260
+ style: {
261
+ backgroundColor: 'white'
262
+ // display: 'flex',
263
+ // flexDirection: 'column',
264
+ // justifyContent: 'center',
265
+ // alignItems: 'center'
266
+ },
267
+ layout: {}
268
+ },
269
+ {
270
+ type: 'IMAGE_CAROUSEL',
271
+ gridItemData: {
272
+ x: 5,
273
+ y: 5,
274
+ w: 10,
275
+ h: 10,
276
+ i: '10'
277
+ },
278
+ content: {
279
+ data: {
280
+ type: 'IMAGE_CAROUSEL',
281
+ value: {
282
+ carouselSettings: {
283
+ mode: 'normal',
284
+ carouselAutoplayTime: 1,
285
+ spaceBetween: 10,
286
+ slidesPerView: 1,
287
+ sliderPerGroup: 1,
288
+ effect: 'fade'
289
+ },
290
+ imgCarouselItems: [
291
+ {
292
+ title: 'im 1 carousel item',
293
+ description: 'im 1 carousel item',
294
+ imageSrc: 'https://cdn.dev.publishingkit.net/d474e86e-9df7-44dd-999e-0bc2a7c9b267.jpg',
295
+ id: '1'
296
+ },
297
+ {
298
+ title: 'im 2 carousel item',
299
+ description: 'im 2 carousel item',
300
+ imageSrc: 'https://cdn.dev.publishingkit.net/5cbc7c88-9566-4ce1-9dc8-0845259aa6a1.jpg',
301
+ id: '2'
302
+ },
303
+ {
304
+ title: 'im 3 carousel item',
305
+ description: 'im 3 carousel item',
306
+ imageSrc: 'https://cdn.dev.publishingkit.net/172b5a98-fd4b-4b2e-bdca-928d182c1548.jpg',
307
+ id: '3'
308
+ },
309
+ {
310
+ title: 'im 4 carousel item',
311
+ description: 'im 4 carousel item',
312
+ imageSrc: 'https://cdn.dev.publishingkit.net/30ddd804-841a-416f-88a6-fbcb84924036.jpg',
313
+ id: '4'
314
+ }
315
+ ]
316
+ }
317
+ }
318
+ },
319
+ style: {
320
+ backgroundColor: 'white'
321
+ // display: 'flex',
322
+ // flexDirection: 'column',
323
+ // justifyContent: 'center',
324
+ // alignItems: 'center'
325
+ },
326
+ layout: {}
197
327
  }
198
328
  ];
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var jsx_runtime_1 = require("react/jsx-runtime");
7
7
  var blocks_1 = require("./blocks");
8
8
  var Button_1 = __importDefault(require("./blocks/Button"));
9
+ var ContentsCarousel_1 = __importDefault(require("./blocks/ContentsCarousel/ContentsCarousel"));
10
+ var ImageCarousel_1 = __importDefault(require("./blocks/ImageCarousel/ImageCarousel"));
9
11
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
12
  function BlockMatcher(_a) {
11
13
  var type = _a.type, content = _a.content, style = _a.style, layout = _a.layout, hoverStyle = _a.hoverStyle;
@@ -63,6 +65,19 @@ function BlockMatcher(_a) {
63
65
  }
64
66
  return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
65
67
  }
68
+ case 'CONTENTS_CAROUSEL': {
69
+ if ('contentsCarouselItems' in value && 'carouselSettings' in value) {
70
+ return ((0, jsx_runtime_1.jsx)(ContentsCarousel_1.default, { contentsCarouselItems: value.contentsCarouselItems, carouselSettings: value.carouselSettings,
71
+ // openedItemId={value.openedItemId}
72
+ style: style }, void 0));
73
+ }
74
+ return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
75
+ }
76
+ case 'IMAGE_CAROUSEL': {
77
+ if ('imgCarouselItems' in value && 'carouselSettings' in value) {
78
+ return ((0, jsx_runtime_1.jsx)(ImageCarousel_1.default, { imgStyle: { objectFit: 'fill' }, imgCarouselItems: value.imgCarouselItems, carouselSettings: value.carouselSettings, style: {} }, void 0));
79
+ }
80
+ }
66
81
  // eslint-disable-next-line no-fallthrough
67
82
  default:
68
83
  return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ imgSrc: string;
4
+ title: string;
5
+ description: string;
6
+ isImgOverlay: boolean;
7
+ };
8
+ declare function CardItem({ imgSrc, title, description, isImgOverlay }: Props): JSX.Element;
9
+ export default CardItem;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ require("react");
23
+ var reactstrap_1 = require("reactstrap");
24
+ var styled_components_1 = __importDefault(require("styled-components"));
25
+ function CardItem(_a) {
26
+ var imgSrc = _a.imgSrc, title = _a.title, description = _a.description, isImgOverlay = _a.isImgOverlay;
27
+ if (isImgOverlay) {
28
+ (0, jsx_runtime_1.jsxs)(reactstrap_1.Card, { children: [(0, jsx_runtime_1.jsx)(reactstrap_1.CardImg, { src: imgSrc, width: "100%" }, void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardImgOverlay, { children: (0, jsx_runtime_1.jsxs)(reactstrap_1.CardBody, { children: [(0, jsx_runtime_1.jsx)(reactstrap_1.CardTitle, __assign({ tag: "h5" }, { children: title }), void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardSubtitle, __assign({ className: "mb-2 text-muted", tag: "h6" }, { children: description }), void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardText, { children: "\uCD94\uAC00\uB85C \uCE74\uB4DC \uD14D\uC2A4\uD2B8\uB97C \uB123\uB294 \uACF3" }, void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.Button, { children: "Button" }, void 0)] }, void 0) }, void 0)] }, void 0);
29
+ }
30
+ return ((0, jsx_runtime_1.jsxs)(reactstrap_1.Card, __assign({ style: { height: '100%' } }, { children: [(0, jsx_runtime_1.jsx)(S_CardImgBox, { children: (0, jsx_runtime_1.jsx)(reactstrap_1.CardImg, { src: imgSrc, width: "100%", top: true, style: { aspectRatio: '16/9' } }, void 0) }, void 0), (0, jsx_runtime_1.jsxs)(reactstrap_1.CardBody, __assign({ style: { flex: '1 1 auto' } }, { children: [(0, jsx_runtime_1.jsx)(reactstrap_1.CardTitle, __assign({ tag: "h5" }, { children: title }), void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardSubtitle, __assign({ className: "mb-2 text-muted", tag: "h6" }, { children: description }), void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardText, { children: "\uCD94\uAC00\uB85C \uCE74\uB4DC \uD14D\uC2A4\uD2B8\uB97C \uB123\uB294 \uACF3" }, void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.Button, { children: "Button" }, void 0)] }), void 0)] }), void 0));
31
+ }
32
+ var S_CardImgBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 50%;\n max-height: 50%;\n"], ["\n height: 50%;\n max-height: 50%;\n"])));
33
+ exports.default = CardItem;
34
+ var templateObject_1;
@@ -0,0 +1,28 @@
1
+ import type { TypeOfItemLinkType } from '../../../../../../DynamicLayout/types';
2
+ import type React from 'react';
3
+ export declare type ContentsCarouselItem = {
4
+ title: string;
5
+ description: string;
6
+ imageSrc: string;
7
+ linkSrc: string;
8
+ linkType: TypeOfItemLinkType;
9
+ buttonLabel: string;
10
+ id: string;
11
+ };
12
+ export declare type EffectTypes = 'none' | 'fade';
13
+ export declare type CarouselSettings = {
14
+ mode: 'normal' | 'loop' | 'autoplay';
15
+ carouselAutoplayTime: number;
16
+ spaceBetween: number;
17
+ slidesPerView: number;
18
+ sliderPerGroup: number;
19
+ buttonSpacing: string;
20
+ effect: EffectTypes;
21
+ };
22
+ export declare type ContentsCarouselProps = {
23
+ contentsCarouselItems: ContentsCarouselItem[];
24
+ carouselSettings: CarouselSettings;
25
+ style: React.CSSProperties;
26
+ };
27
+ declare function ContentsCarousel({ contentsCarouselItems, style, carouselSettings }: ContentsCarouselProps): JSX.Element;
28
+ export default ContentsCarousel;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var desktop_1 = require("../../../../../../DynamicLayout/components/desktop");
23
+ var styled_components_1 = __importDefault(require("styled-components"));
24
+ var CardItem_1 = __importDefault(require("./CardItem"));
25
+ function ContentsCarousel(_a) {
26
+ var contentsCarouselItems = _a.contentsCarouselItems, style = _a.style, carouselSettings = _a.carouselSettings;
27
+ var mode = carouselSettings.mode, carouselAutoplayTime = carouselSettings.carouselAutoplayTime, spaceBetween = carouselSettings.spaceBetween, slidesPerView = carouselSettings.slidesPerView, sliderPerGroup = carouselSettings.sliderPerGroup, buttonSpacing = carouselSettings.buttonSpacing;
28
+ return ((0, jsx_runtime_1.jsx)(S_CarouselBox, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(desktop_1.Carousel, __assign({ spaceBetween: spaceBetween, slidesPerView: slidesPerView, slidesPerGroup: sliderPerGroup,
29
+ // NOTE: when edit mode
30
+ allowTouchMove: false,
31
+ // breakpoints={{
32
+ // 1301: {
33
+ // slidesPerView: 4
34
+ // },
35
+ // 1601: {
36
+ // slidesPerView: 5
37
+ // }
38
+ // }}
39
+ mode: mode, autoplayDelay: carouselAutoplayTime, buttonSpacing: buttonSpacing }, { children: contentsCarouselItems.map(function (item) {
40
+ var itemTitle = item.title, itemDescription = item.description, itemImageSrc = item.imageSrc,
41
+ // linkSrc: itemLinkSrc,
42
+ // linkType: itemLinkType,
43
+ // buttonLabel: itemButtonLabel,
44
+ id = item.id;
45
+ return ((0, jsx_runtime_1.jsx)(CardItem_1.default, { imgSrc: itemImageSrc, title: itemTitle, description: itemDescription, isImgOverlay: false }, id));
46
+ }) }), void 0) }), void 0));
47
+ }
48
+ var S_CarouselBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n /* NOTE: \uBCC0\uACBD\uD544\uC694 */\n height: 100%;\n max-height: 100%;\n\n /* & > div {\n height: 100%;\n & > div {\n height: 100%;\n & > .swiper {\n height: 100%;\n }\n }\n } */\n /* margin: ", " 0; */\n"], ["\n /* NOTE: \uBCC0\uACBD\uD544\uC694 */\n height: 100%;\n max-height: 100%;\n\n /* & > div {\n height: 100%;\n & > div {\n height: 100%;\n & > .swiper {\n height: 100%;\n }\n }\n } */\n /* margin: ", " 0; */\n"])), function (_a) {
49
+ var theme = _a.theme;
50
+ return theme.spacing.spacingH;
51
+ });
52
+ exports.default = ContentsCarousel;
53
+ var templateObject_1;
@@ -0,0 +1,16 @@
1
+ import type { CarouselSettings } from '../ContentsCarousel/ContentsCarousel';
2
+ import type React from 'react';
3
+ export declare type ImgCarouselItem = {
4
+ title: string;
5
+ description: string;
6
+ imageSrc: string;
7
+ id: string;
8
+ };
9
+ export declare type ImgCarouselProps = {
10
+ imgCarouselItems: ImgCarouselItem[];
11
+ carouselSettings: CarouselSettings;
12
+ style: React.CSSProperties;
13
+ imgStyle: React.CSSProperties;
14
+ };
15
+ declare function ImageCarousel({ imgStyle, imgCarouselItems, carouselSettings, style }: ImgCarouselProps): JSX.Element;
16
+ export default ImageCarousel;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var reactstrap_1 = require("reactstrap");
23
+ var swiper_1 = require("swiper");
24
+ var react_1 = require("swiper/react");
25
+ var swiper_style_1 = __importDefault(require("../../../../../../DynamicLayout/components/desktop/common/swiper.style"));
26
+ var styled_components_1 = __importDefault(require("styled-components"));
27
+ function ImageCarousel(_a) {
28
+ var imgStyle = _a.imgStyle, imgCarouselItems = _a.imgCarouselItems, carouselSettings = _a.carouselSettings, style = _a.style;
29
+ return ((0, jsx_runtime_1.jsx)(S_SwiperStyleWrapper, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({ spaceBetween: carouselSettings.spaceBetween, effect: carouselSettings.effect === 'none' ? undefined : carouselSettings.effect, navigation: true, pagination: {
30
+ clickable: true
31
+ },
32
+ // NOTE: when edit mode
33
+ allowTouchMove: false, modules: [swiper_1.EffectFade, swiper_1.Navigation, reactstrap_1.Pagination], className: "mySwiper" }, { children: imgCarouselItems.map(function (item) { return ((0, jsx_runtime_1.jsxs)(react_1.SwiperSlide, { children: [(0, jsx_runtime_1.jsx)(S_Img, { style: imgStyle, src: item.imageSrc }, void 0), (0, jsx_runtime_1.jsxs)(S_Overlay, { children: [(0, jsx_runtime_1.jsx)(S_Title, { children: item.title }, void 0), (0, jsx_runtime_1.jsx)(S_Desc, { children: item.description }, void 0)] }, void 0)] }, item.id)); }) }), void 0) }), void 0));
34
+ }
35
+ var S_Overlay = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n bottom: 20px;\n left: 20px;\n position: absolute;\n"], ["\n bottom: 20px;\n left: 20px;\n position: absolute;\n"])));
36
+ var S_Title = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: white;\n font-size: 20px;\n margin-bottom: 8px;\n"], ["\n color: white;\n font-size: 20px;\n margin-bottom: 8px;\n"])));
37
+ var S_Desc = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: #d2d2d2;\n font-size: 16px;\n"], ["\n color: #d2d2d2;\n font-size: 16px;\n"])));
38
+ var S_Img = styled_components_1.default.img(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100%;\n object-position: 50% 50%;\n width: 100%;\n"], ["\n height: 100%;\n object-position: 50% 50%;\n width: 100%;\n"])));
39
+ var S_SwiperStyleWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n /** NOTE: Swiper\uAC00 \uC81C\uACF5\uD558\uB294 css \uD30C\uC77C\uC744 webpack \uC774\uC288\uB85C import\uD558\uC9C0 \uBABB\uD574\uC11C \uC784\uC2DC\uB85C \uB9CC\uB4E0 css wrapper\uC785\uB2C8\uB2E4.\n * \uCC28\uD6C4 Webpack 5\uB85C \uB9C8\uC774\uADF8\uB808\uC774\uC158 \uB418\uB294 \uACBD\uC6B0 swiper \uD648\uD398\uC774\uC9C0\uC5D0\uC11C \uCD94\uCC9C\uD558\uB294 \uC0AC\uC6A9\uBC95\uC73C\uB85C \uC218\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.\n */\n\n ", "\n height: 100%;\n\n .swiper {\n height: 100%;\n }\n\n * {\n pointer-events: 'none';\n }\n"], ["\n /** NOTE: Swiper\uAC00 \uC81C\uACF5\uD558\uB294 css \uD30C\uC77C\uC744 webpack \uC774\uC288\uB85C import\uD558\uC9C0 \uBABB\uD574\uC11C \uC784\uC2DC\uB85C \uB9CC\uB4E0 css wrapper\uC785\uB2C8\uB2E4.\n * \uCC28\uD6C4 Webpack 5\uB85C \uB9C8\uC774\uADF8\uB808\uC774\uC158 \uB418\uB294 \uACBD\uC6B0 swiper \uD648\uD398\uC774\uC9C0\uC5D0\uC11C \uCD94\uCC9C\uD558\uB294 \uC0AC\uC6A9\uBC95\uC73C\uB85C \uC218\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.\n */\n\n ", "\n height: 100%;\n\n .swiper {\n height: 100%;\n }\n\n * {\n pointer-events: 'none';\n }\n"])), swiper_style_1.default);
40
+ exports.default = ImageCarousel;
41
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -1,4 +1,6 @@
1
1
  import type { AccordionItem } from './BlockMatcher/blocks/Accordion';
2
+ import type { CarouselSettings, ContentsCarouselItem } from './BlockMatcher/blocks/ContentsCarousel/ContentsCarousel';
3
+ import type { ImgCarouselItem } from './BlockMatcher/blocks/ImageCarousel/ImageCarousel';
2
4
  import type React from 'react';
3
5
  export declare const ComponentNames: {
4
6
  TEXT: string;
@@ -10,6 +12,8 @@ export declare const ComponentNames: {
10
12
  TWITTER: string;
11
13
  INSTAGRAM: string;
12
14
  ACCORDION: string;
15
+ CONTENTS_CAROUSEL: string;
16
+ IMAGE_CAROUSEL: string;
13
17
  };
14
18
  export declare type BlockComponents = typeof ComponentNames;
15
19
  export declare type BlockNames = keyof BlockComponents;
@@ -71,7 +75,21 @@ export declare type AccordionComponentDataType = {
71
75
  openedItemId?: string;
72
76
  };
73
77
  };
74
- export declare type ComponentDataPairType = TextComponentDataType | ImageComponentDataType | TwitterComponentDataType | RichTextComponentDataType | ButtonComponentDataType | DividerComponentDataType | YoutubeComponentDataType | AccordionComponentDataType;
78
+ export declare type ContentsCarouselDataType = {
79
+ type: BlockComponents['ACCORDION'];
80
+ value: {
81
+ contentsCarouselItems: ContentsCarouselItem[];
82
+ carouselSettings: CarouselSettings;
83
+ };
84
+ };
85
+ export declare type ImgCarouselDataType = {
86
+ type: BlockComponents['IMAGE_CAROUSEL'];
87
+ value: {
88
+ imgCarouselItems: ImgCarouselItem[];
89
+ carouselSettings: CarouselSettings;
90
+ };
91
+ };
92
+ export declare type ComponentDataPairType = TextComponentDataType | ImageComponentDataType | TwitterComponentDataType | RichTextComponentDataType | ButtonComponentDataType | DividerComponentDataType | YoutubeComponentDataType | AccordionComponentDataType | ContentsCarouselDataType | ImgCarouselDataType;
75
93
  export declare type ContentType = {
76
94
  data: ComponentDataPairType;
77
95
  link?: LinkContentType;
@@ -10,5 +10,7 @@ exports.ComponentNames = {
10
10
  YOUTUBE: 'YOUTUBE',
11
11
  TWITTER: 'TWITTER',
12
12
  INSTAGRAM: 'INSTAGRAM',
13
- ACCORDION: 'ACCORDION'
13
+ ACCORDION: 'ACCORDION',
14
+ CONTENTS_CAROUSEL: 'CONTENTS_CAROUSEL',
15
+ IMAGE_CAROUSEL: 'IMAGE_CAROUSEL'
14
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -27,6 +27,7 @@
27
27
  "react-i18next": "^11.12.0",
28
28
  "react-router-dom": "^5.2.0",
29
29
  "react-scripts": "4.0.3",
30
+ "reactstrap": "^9.2.0",
30
31
  "smoothscroll-polyfill": "^0.4.4",
31
32
  "styled-components": "^5.2.1",
32
33
  "swiper": "^8.4.5",
package/release-note.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # pds-dev-kit-web-test Release Notes
2
- ## [v0.2.1]
2
+ ## [v0.2.2]
3
3
  ## 기준 pds-dev-kit-web 버전 @2.0.14
4
4
  ### sub
5
5
  * DynamicLayout - custom section
6
- * Accordion 컴포넌트 블럭 추가
6
+ * ImageCarousel 추가
7
+ * ContentsCarousel 추가