pds-dev-kit-web-test 2.7.252 → 2.7.253
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_contentsList.js +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +9 -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
|
@@ -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,16 +69,24 @@ 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;
|
|
75
79
|
var totalPage = Math.ceil((CB_CONTENT_PROP_CONTENTSLIST_SPEC_VALUETYPE === 'DATA' && queryDataValue
|
|
76
80
|
? queryDataValue === null || queryDataValue === void 0 ? void 0 : queryDataValue.length
|
|
77
81
|
: CB_CONTENT_PROP_CONTENTSLIST_SPEC_MANUALITEMS.length) / displayCounts);
|
|
82
|
+
console.log('columns', numberOfColumns);
|
|
83
|
+
console.log('displayCounts', displayCounts);
|
|
84
|
+
console.log('totalPage', totalPage);
|
|
78
85
|
var CB_STYLE_PROP_CONTENTSLIST = __assign(__assign({}, CB_STYLE_PROP_CONTENTSLISTDESIGN), CB_STYLE_PROP_CONTENTSLISTPAGINATION);
|
|
79
86
|
var _k = (0, util_1.parseProperties)(props, device), style = _k.style, hoverStyle = _k.hoverStyle, layout = _k.layout, effect = _k.effect, overlayStyle = _k.overlayStyle;
|
|
80
87
|
var contentPropCss = (0, contentsListUtils_1.parseGridContentProp)({
|
|
81
|
-
props: CB_CONTENT_PROP_CONTENTSLIST
|
|
88
|
+
props: CB_CONTENT_PROP_CONTENTSLIST,
|
|
89
|
+
device: device
|
|
82
90
|
}).contentPropCss;
|
|
83
91
|
var _l = (0, contentsListUtils_1.parseGridStyleProp)({
|
|
84
92
|
props: CB_STYLE_PROP_CONTENTSLIST,
|
|
@@ -106,13 +114,8 @@ function ContentsList(props) {
|
|
|
106
114
|
var handlePageClick = function (page) {
|
|
107
115
|
setCurrentPage(page);
|
|
108
116
|
};
|
|
109
|
-
// CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS ?? CB_CONTENT_PROP_CONTENTSLIST_SPEC_ITEMCOUNTS;
|
|
110
117
|
var startIndex = (currentPage - 1) * displayCounts;
|
|
111
118
|
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
119
|
// NOTE: edit환경에서 hover가 작동하지 않아서 제외함 필요시 추가..
|
|
117
120
|
var columnGapEnum = device === 'DESKTOP'
|
|
118
121
|
? 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
|
};
|