pds-dev-kit-web-test 2.7.252 → 2.7.254
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/sub/DynamicLayout/CompositionRenderer/Composition.js +2 -2
- package/dist/src/sub/DynamicLayout/CompositionRenderer/FlexGridItemForCCB.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/CompositionRenderer/FlexGridItemForCCB.js +9 -11
- package/dist/src/sub/DynamicLayout/mock_contentsList.js +4 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +6 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.js +18 -7
- package/package.json +1 -1
|
@@ -225,7 +225,7 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
225
225
|
// fontSize: `${baseFontSize}px`
|
|
226
226
|
} }, { children: (_e = props.componentBlocks) === null || _e === void 0 ? void 0 : _e.map(function (cb, index) {
|
|
227
227
|
var _a;
|
|
228
|
-
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItemForCCB_1.default, { cb: cb, index: index, device: device, rowHeight: rowHeight, zIndex: (_a = zOrders === null || zOrders === void 0 ? void 0 : zOrders[device === 'DESKTOP' ? 'desktop' : 'mobile'][cb.id]) !== null && _a !== void 0 ? _a : 0 }) }, cb.id));
|
|
228
|
+
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItemForCCB_1.default, { cb: cb, index: index, device: device, rowHeight: rowHeight, zIndex: (_a = zOrders === null || zOrders === void 0 ? void 0 : zOrders[device === 'DESKTOP' ? 'desktop' : 'mobile'][cb.id]) !== null && _a !== void 0 ? _a : 0, maxCols: cols }) }, cb.id));
|
|
229
229
|
}) })) })) })) })) })) }));
|
|
230
230
|
});
|
|
231
231
|
var MOCK_BORDER = {
|
|
@@ -285,7 +285,7 @@ var MOCK_SHADOW = {
|
|
|
285
285
|
'CB_STYLE_PROP_SHADOW_SPEC_Y:MOBILE': null,
|
|
286
286
|
'CB_STYLE_PROP_SHADOW_SPEC_Y:MOBILE:HOVER': null
|
|
287
287
|
};
|
|
288
|
-
var GridContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid; /* Space between grid items */\n gap: 10px;\n
|
|
288
|
+
var GridContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(\n ", ",\n minmax(", ", auto)\n );\n height: 100%;\n padding: 10px 10px;\n width: 100%;\n\n * {\n box-sizing: border-box;\n }\n"], ["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(\n ", ",\n minmax(", ", auto)\n );\n height: 100%;\n padding: 10px 10px;\n width: 100%;\n\n * {\n box-sizing: border-box;\n }\n"])), function (props) { return props.cols; }, function (props) { return props.sectionRow; }, function (props) { return "".concat(props.rowHeight, "px"); });
|
|
289
289
|
var S_COMPOSITIONWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
290
290
|
exports.default = react_1.default.memo(Composition);
|
|
291
291
|
function getDefensiveFontSize(device, width) {
|
|
@@ -7,8 +7,8 @@ type Props = {
|
|
|
7
7
|
device: Device;
|
|
8
8
|
rowHeight: number;
|
|
9
9
|
zIndex: number;
|
|
10
|
-
|
|
10
|
+
maxCols: number;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
};
|
|
13
|
-
declare function FlexGridItem({ cb, index, device, rowHeight, zIndex,
|
|
13
|
+
declare function FlexGridItem({ cb, index, device, rowHeight, zIndex, style, maxCols }: Props): JSX.Element;
|
|
14
14
|
export default FlexGridItem;
|
|
@@ -19,20 +19,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
|
-
|
|
22
|
+
require("react");
|
|
23
23
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
24
|
var ComponentBlockMatcher_1 = __importDefault(require("./ComponentBlockMatcher"));
|
|
25
25
|
var gap = 10;
|
|
26
26
|
function FlexGridItem(_a) {
|
|
27
|
-
var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight, zIndex = _a.zIndex,
|
|
27
|
+
var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight, zIndex = _a.zIndex, style = _a.style, maxCols = _a.maxCols;
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
29
|
var defaultHeight = getMaxHeight(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device, rowHeight);
|
|
30
|
-
var gridArea = getGridAreaFromCB(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device);
|
|
31
|
-
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(GridItem, __assign({ style: __assign({ zIndex: zIndex, gridArea: gridArea, position: 'relative', maxHeight: isPinned ? defaultHeight : 'none' }, style) }, { children: [showPinned && ((0, jsx_runtime_1.jsx)(S_Pinned, { children: isPinned ? ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: function () { return setIsPinned(false); } }, { children: "H\uACE0\uC815\uB428 \uD83D\uDCCC" }))) : ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: function () { return setIsPinned(true); } }, { children: "H\uB298\uC5B4\uB0A8 \uD83E\uDEB1" }))) })), (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index })] })));
|
|
30
|
+
var gridArea = getGridAreaFromCB(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device, maxCols);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(GridItem, __assign({ style: __assign({ zIndex: zIndex, gridArea: gridArea, position: 'relative', maxHeight: 'none' }, style) }, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index }) })));
|
|
33
32
|
}
|
|
34
|
-
var
|
|
35
|
-
var GridItem = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: auto;\n word-break: break-word;\n"], ["\n height: auto;\n word-break: break-word;\n"])));
|
|
33
|
+
var GridItem = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: auto;\n word-break: break-word;\n"], ["\n height: auto;\n word-break: break-word;\n"])));
|
|
36
34
|
function getMaxHeight(props, device, rowHeight) {
|
|
37
35
|
if (device === 'DESKTOP') {
|
|
38
36
|
var CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS;
|
|
@@ -44,7 +42,7 @@ function getMaxHeight(props, device, rowHeight) {
|
|
|
44
42
|
var height = rowsMobile * rowHeight + (rowsMobile - 1) * gap;
|
|
45
43
|
return height;
|
|
46
44
|
}
|
|
47
|
-
function getGridAreaFromCB(props, device) {
|
|
45
|
+
function getGridAreaFromCB(props, device, maxCols) {
|
|
48
46
|
var CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX, CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY, cols = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS, rows = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS;
|
|
49
47
|
if (device === 'DESKTOP') {
|
|
50
48
|
var colStart_1 = CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX + 1;
|
|
@@ -52,7 +50,7 @@ function getGridAreaFromCB(props, device) {
|
|
|
52
50
|
var rowEnd_1 = rows + rowStart_1;
|
|
53
51
|
var colEnd_1 = cols + colStart_1;
|
|
54
52
|
// <grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end>;
|
|
55
|
-
return "".concat(rowStart_1, " / ").concat(colStart_1, " / ").concat(rowEnd_1, " / ").concat(colEnd_1);
|
|
53
|
+
return "".concat(rowStart_1, " / ").concat(colStart_1, " / ").concat(rowEnd_1, " / ").concat(Math.min(colEnd_1, maxCols));
|
|
56
54
|
}
|
|
57
55
|
var startXMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX:MOBILE'];
|
|
58
56
|
var startYMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE'];
|
|
@@ -62,7 +60,7 @@ function getGridAreaFromCB(props, device) {
|
|
|
62
60
|
var rowStart = startYMobile + 1;
|
|
63
61
|
var rowEnd = rowsMobile + rowStart;
|
|
64
62
|
var colEnd = colsMobile + colStart;
|
|
65
|
-
return "".concat(rowStart, " / ").concat(colStart, " / ").concat(rowEnd, " / ").concat(colEnd);
|
|
63
|
+
return "".concat(rowStart, " / ").concat(colStart, " / ").concat(rowEnd, " / ").concat(Math.min(colEnd, maxCols));
|
|
66
64
|
}
|
|
67
65
|
exports.default = FlexGridItem;
|
|
68
|
-
var templateObject_1
|
|
66
|
+
var templateObject_1;
|
|
@@ -3261,7 +3261,7 @@ exports.SAMPLE_LIST_CB = {
|
|
|
3261
3261
|
},
|
|
3262
3262
|
CB_PLACEMENT_PROP_PLACEMENT: {
|
|
3263
3263
|
CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS: 2,
|
|
3264
|
-
'CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE':
|
|
3264
|
+
'CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE': 12,
|
|
3265
3265
|
CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS: 2,
|
|
3266
3266
|
'CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE': 5,
|
|
3267
3267
|
CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX: 0,
|
|
@@ -5325,12 +5325,14 @@ exports.SAMPLE_LIST_CB = {
|
|
|
5325
5325
|
currentVersion: '2025-01-10',
|
|
5326
5326
|
data: {
|
|
5327
5327
|
CB_CONTENT_PROP_CONTENTSLIST: {
|
|
5328
|
-
CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS:
|
|
5328
|
+
CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS: 2,
|
|
5329
|
+
CB_CONTENT_PROP_CONTENTSLIST_SPEC_MCOLUMNS: 1,
|
|
5329
5330
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_CONNECTDATA: 'NONE',
|
|
5330
5331
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DATAFILTER: 'NONE',
|
|
5331
5332
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DATAOFFSET: 0,
|
|
5332
5333
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DATASORTING: 'PAPPQUERY_SORTING_ITEM_TITLE_ASC',
|
|
5333
5334
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS: 1,
|
|
5335
|
+
CB_CONTENT_PROP_CONTENTSLIST_SPEC_MDISPLAYCOUNTS: 1,
|
|
5334
5336
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_EDITCOMMONITEM: null,
|
|
5335
5337
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_ITEMCOUNTS: 1,
|
|
5336
5338
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_MANUALITEMS: [
|
|
@@ -69,6 +69,10 @@ function ContentsList(props) {
|
|
|
69
69
|
var _j = (0, react_1.useState)(1), currentPage = _j[0], setCurrentPage = _j[1];
|
|
70
70
|
var parsedQueryPath = removeFirstSegment(CB_CONTENT_PROP_CONTENTSLIST_SPEC_CONNECTDATA);
|
|
71
71
|
var queryDataValue = queryData === null || queryData === void 0 ? void 0 : queryData[parsedQueryPath];
|
|
72
|
+
// list의 minheight / minwidth를 계산
|
|
73
|
+
var numberOfColumns = device === 'DESKTOP'
|
|
74
|
+
? CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS
|
|
75
|
+
: CB_CONTENT_PROP_CONTENTSLIST_SPEC_MCOLUMNS;
|
|
72
76
|
var displayCounts = device === 'DESKTOP'
|
|
73
77
|
? CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS
|
|
74
78
|
: CB_CONTENT_PROP_CONTENTSLIST_SPEC_MDISPLAYCOUNTS !== null && CB_CONTENT_PROP_CONTENTSLIST_SPEC_MDISPLAYCOUNTS !== void 0 ? CB_CONTENT_PROP_CONTENTSLIST_SPEC_MDISPLAYCOUNTS : CB_CONTENT_PROP_CONTENTSLIST_SPEC_MANUALITEMS.length;
|
|
@@ -78,7 +82,8 @@ function ContentsList(props) {
|
|
|
78
82
|
var CB_STYLE_PROP_CONTENTSLIST = __assign(__assign({}, CB_STYLE_PROP_CONTENTSLISTDESIGN), CB_STYLE_PROP_CONTENTSLISTPAGINATION);
|
|
79
83
|
var _k = (0, util_1.parseProperties)(props, device), style = _k.style, hoverStyle = _k.hoverStyle, layout = _k.layout, effect = _k.effect, overlayStyle = _k.overlayStyle;
|
|
80
84
|
var contentPropCss = (0, contentsListUtils_1.parseGridContentProp)({
|
|
81
|
-
props: CB_CONTENT_PROP_CONTENTSLIST
|
|
85
|
+
props: CB_CONTENT_PROP_CONTENTSLIST,
|
|
86
|
+
device: device
|
|
82
87
|
}).contentPropCss;
|
|
83
88
|
var _l = (0, contentsListUtils_1.parseGridStyleProp)({
|
|
84
89
|
props: CB_STYLE_PROP_CONTENTSLIST,
|
|
@@ -106,13 +111,8 @@ function ContentsList(props) {
|
|
|
106
111
|
var handlePageClick = function (page) {
|
|
107
112
|
setCurrentPage(page);
|
|
108
113
|
};
|
|
109
|
-
// CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS ?? CB_CONTENT_PROP_CONTENTSLIST_SPEC_ITEMCOUNTS;
|
|
110
114
|
var startIndex = (currentPage - 1) * displayCounts;
|
|
111
115
|
var endIndex = startIndex + (displayCounts - 1);
|
|
112
|
-
// list의 minheight / minwidth를 계산
|
|
113
|
-
var numberOfColumns = device === 'DESKTOP'
|
|
114
|
-
? CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS
|
|
115
|
-
: CB_CONTENT_PROP_CONTENTSLIST_SPEC_MCOLUMNS;
|
|
116
116
|
// NOTE: edit환경에서 hover가 작동하지 않아서 제외함 필요시 추가..
|
|
117
117
|
var columnGapEnum = device === 'DESKTOP'
|
|
118
118
|
? CB_STYLE_PROP_CONTENTSLIST.CB_STYLE_PROP_CONTENTSLISTDESIGN_SPEC_ITEMSPACING
|
|
@@ -8,6 +8,7 @@ type ParseContentsListStyleToCarouselCoreProps = {
|
|
|
8
8
|
};
|
|
9
9
|
type ParseContentsListContentToCarouselCoreProps = {
|
|
10
10
|
props: CB_CONTENT_PROP_CONTENTSLIST;
|
|
11
|
+
device: Device;
|
|
11
12
|
};
|
|
12
13
|
type ParseContentsListStyleToCustomPaginationProps = {
|
|
13
14
|
props: CB_STYLE_PROP_CONTENTSLIST_SPECS;
|
|
@@ -18,7 +19,7 @@ export declare function parseGridStyleProp({ props, device }: ParseContentsListS
|
|
|
18
19
|
stylePropCss: CssFragment;
|
|
19
20
|
hoverStylePropCss: CssFragment;
|
|
20
21
|
};
|
|
21
|
-
export declare function parseGridContentProp({ props }: ParseContentsListContentToCarouselCoreProps): {
|
|
22
|
+
export declare function parseGridContentProp({ props, device }: ParseContentsListContentToCarouselCoreProps): {
|
|
22
23
|
contentPropCss: CssFragment;
|
|
23
24
|
};
|
|
24
25
|
export declare function parsePaginationStyleProp({ props, device }: ParseContentsListStyleToCustomPaginationProps): {
|
|
@@ -42,10 +42,18 @@ function parseStylePropertyStyles(key, value) {
|
|
|
42
42
|
function getColumnsPropStyleValues(value, rows) {
|
|
43
43
|
return (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(", ", 1fr);\n "], ["\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(", ", 1fr);\n "])), value, rows);
|
|
44
44
|
}
|
|
45
|
-
function parseContentPropertyStyles(key, value, rows) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
function parseContentPropertyStyles(key, value, rows, device) {
|
|
46
|
+
if (device === 'DESKTOP') {
|
|
47
|
+
switch (key) {
|
|
48
|
+
case 'CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS':
|
|
49
|
+
return getColumnsPropStyleValues(value, rows);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (device === 'MOBILE') {
|
|
53
|
+
switch (key) {
|
|
54
|
+
case 'CB_CONTENT_PROP_CONTENTSLIST_SPEC_MCOLUMNS':
|
|
55
|
+
return getColumnsPropStyleValues(value, rows);
|
|
56
|
+
}
|
|
49
57
|
}
|
|
50
58
|
return undefined;
|
|
51
59
|
}
|
|
@@ -70,16 +78,19 @@ function parseGridStyleProp(_a) {
|
|
|
70
78
|
}
|
|
71
79
|
exports.parseGridStyleProp = parseGridStyleProp;
|
|
72
80
|
function parseGridContentProp(_a) {
|
|
73
|
-
var props = _a.props;
|
|
81
|
+
var props = _a.props, device = _a.device;
|
|
74
82
|
var availableSpecCodes = Object.keys(props).filter(function (key) { return !key.includes(':HOVER') && !key.includes(':MOBILE'); });
|
|
75
83
|
var displayCounts = props.CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS ||
|
|
76
84
|
props.CB_CONTENT_PROP_CONTENTSLIST_SPEC_ITEMCOUNTS ||
|
|
77
85
|
1;
|
|
78
|
-
var
|
|
86
|
+
var columnsByDevice = device === 'DESKTOP'
|
|
87
|
+
? props.CB_CONTENT_PROP_CONTENTSLIST_SPEC_COLUMNS
|
|
88
|
+
: props.CB_CONTENT_PROP_CONTENTSLIST_SPEC_MCOLUMNS;
|
|
89
|
+
var columns = Math.min(columnsByDevice, displayCounts);
|
|
79
90
|
var rows = Math.ceil(displayCounts / columns);
|
|
80
91
|
return availableSpecCodes.reduce(function (acc, currentKey) {
|
|
81
92
|
var value = props[currentKey];
|
|
82
|
-
var styles = parseContentPropertyStyles(currentKey, value, rows);
|
|
93
|
+
var styles = parseContentPropertyStyles(currentKey, value, rows, device);
|
|
83
94
|
return {
|
|
84
95
|
contentPropCss: (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n ", "\n "], ["\n ", "\n ", "\n "])), acc.contentPropCss, styles)
|
|
85
96
|
};
|