pds-dev-kit-web-test 2.7.97 → 2.7.98
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.
@@ -265,7 +265,7 @@ var GridAutoRowEditor = (0, react_1.forwardRef)(function CustomSection(props, re
|
|
265
265
|
backgroundColor: '#e8e1e189',
|
266
266
|
border: '1px solid #6b666688'
|
267
267
|
}, "data-row": rIdx + 1, "data-col": cIdx + 1 }, "bg-grid-item-".concat(rIdx + 1, "-").concat(cIdx + 1))); }) }), "bg-grid-row-".concat(rIdx + 1)));
|
268
|
-
}), pedigree.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(groupUtils_1.default, { block: child, layoutItems: layouts[device === 'DESKTOP' ? 'lg' : 'sm'], cbs: props.componentBlocks }, child.blockId)); })] })) })) })) }) })) }));
|
268
|
+
}), pedigree.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(groupUtils_1.default, { block: child, rowHeight: rowHeight, layoutItems: layouts[device === 'DESKTOP' ? 'lg' : 'sm'], cbs: props.componentBlocks }, child.blockId)); })] })) })) })) }) })) }));
|
269
269
|
});
|
270
270
|
function GroupBlockRender(_a) {
|
271
271
|
var block = _a.block, layouts = _a.layouts, pedigree = _a.pedigree, isEditing = _a.isEditing, isPinned = _a.isPinned, componentBlocks = _a.componentBlocks, onTogglePinned = _a.onTogglePinned, onDoubleClick = _a.onDoubleClick, onDoubleClickOutside = _a.onDoubleClickOutside;
|
@@ -3,10 +3,11 @@ import type { ComponentBlock } from '../sections/CustomSection/types';
|
|
3
3
|
import type { LayoutItem } from 'publ-echo/dist/lib';
|
4
4
|
import type { Block } from 'publ-echo/dist/lib/GridLayoutEditor/group';
|
5
5
|
export declare function findAllChildrenCbIds(block: Block, targetGroupId: string): number[];
|
6
|
-
export default function RenderPedigreeRecursively({ block, layoutItems, cbs, parentGroupArea }: {
|
6
|
+
export default function RenderPedigreeRecursively({ block, layoutItems, cbs, parentGroupArea, rowHeight }: {
|
7
7
|
block: Block;
|
8
8
|
layoutItems: LayoutItem[];
|
9
9
|
cbs: ComponentBlock[];
|
10
|
+
rowHeight: number;
|
10
11
|
parentGroupArea?: {
|
11
12
|
rowStart: number;
|
12
13
|
colStart: number;
|
@@ -54,7 +54,7 @@ function findAllChildrenCbIds(block, targetGroupId) {
|
|
54
54
|
}
|
55
55
|
exports.findAllChildrenCbIds = findAllChildrenCbIds;
|
56
56
|
function RenderPedigreeRecursively(_a) {
|
57
|
-
var block = _a.block, layoutItems = _a.layoutItems, cbs = _a.cbs, parentGroupArea = _a.parentGroupArea;
|
57
|
+
var block = _a.block, layoutItems = _a.layoutItems, cbs = _a.cbs, parentGroupArea = _a.parentGroupArea, rowHeight = _a.rowHeight;
|
58
58
|
var type = block.type;
|
59
59
|
if (type === 'GROUP_BLOCK') {
|
60
60
|
var childrenIds = findAllChildrenCbIds(block, block.blockId).map(function (i) { return i.toString(); });
|
@@ -68,7 +68,7 @@ function RenderPedigreeRecursively(_a) {
|
|
68
68
|
cols: bounding.w,
|
69
69
|
rows: bounding.h
|
70
70
|
});
|
71
|
-
return ((0, jsx_runtime_1.jsxs)(
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(S_GroupItem, __assign({ cols: bounding.w, sectionRow: bounding.h, rowHeight: rowHeight, selectedRows: [], style: {
|
72
72
|
gridArea: gridAreaObjToString(gridArea_1),
|
73
73
|
border: '1px solid red',
|
74
74
|
display: 'grid'
|
@@ -83,7 +83,7 @@ function RenderPedigreeRecursively(_a) {
|
|
83
83
|
fontSize: '12px',
|
84
84
|
zIndex: 1,
|
85
85
|
pointerEvents: 'none'
|
86
|
-
} }, { children: block.blockId })), block.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(RenderPedigreeRecursively, { block: child, layoutItems: layoutItems, cbs: cbs, parentGroupArea: gridArea_1 }, child.blockId)); })] })));
|
86
|
+
} }, { children: block.blockId })), block.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(RenderPedigreeRecursively, { rowHeight: rowHeight, block: child, layoutItems: layoutItems, cbs: cbs, parentGroupArea: gridArea_1 }, child.blockId)); })] })));
|
87
87
|
}
|
88
88
|
// default: TYPE === 'COMPONENT_BLOCK'
|
89
89
|
var cb = cbs.find(function (c) { return c.blockId === block.blockId; });
|
@@ -145,12 +145,24 @@ function parseGridArea(gridArea) {
|
|
145
145
|
function calculateRelativeGridArea(componentArea, parentArea) {
|
146
146
|
return {
|
147
147
|
// 컴포넌트의 시작 위치에서 부모의 시작 위치를 빼서 상대적 위치 계산
|
148
|
-
rowStart: componentArea.rowStart - parentArea.rowStart,
|
149
|
-
colStart: componentArea.colStart - parentArea.colStart,
|
148
|
+
rowStart: componentArea.rowStart - parentArea.rowStart + 1,
|
149
|
+
colStart: componentArea.colStart - parentArea.colStart + 1,
|
150
150
|
// 상대적 끝 위치도 같은 방식으로 계산
|
151
|
-
rowEnd: componentArea.rowEnd - parentArea.rowStart,
|
152
|
-
colEnd: componentArea.colEnd - parentArea.colStart
|
151
|
+
rowEnd: componentArea.rowEnd - parentArea.rowStart + 1,
|
152
|
+
colEnd: componentArea.colEnd - parentArea.colStart + 1
|
153
153
|
};
|
154
154
|
}
|
155
155
|
var S_GridItem = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n position: relative;\n width: 100%;\n"], ["\n height: 100%;\n position: relative;\n width: 100%;\n"])));
|
156
|
-
var
|
156
|
+
var S_GroupItem = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n gap: 10px;\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: ", "; /* \uBC30\uC5F4\uC744 \uACF5\uBC31\uC73C\uB85C \uAD6C\uBD84\uB41C \uBB38\uC790\uC5F4\uB85C \uD569\uCE69\uB2C8\uB2E4. */\n"], ["\n gap: 10px;\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: ", "; /* \uBC30\uC5F4\uC744 \uACF5\uBC31\uC73C\uB85C \uAD6C\uBD84\uB41C \uBB38\uC790\uC5F4\uB85C \uD569\uCE69\uB2C8\uB2E4. */\n"])), function (props) { return props.cols; }, function (props) {
|
157
|
+
// // 전체 행 개수만큼 배열을 생성하여 각 행의 CSS 값을 정의합니다.
|
158
|
+
return Array.from({ length: props.sectionRow })
|
159
|
+
.map(function (_, index) {
|
160
|
+
// props로 받은 selectedRows 배열에 현재 행(index)이 포함되어 있는지 확인합니다.
|
161
|
+
return props.selectedRows.includes(index)
|
162
|
+
? "minmax(".concat(props.rowHeight, "px, auto)") // 포함되어 있다면 minmax 사용
|
163
|
+
: "".concat(props.rowHeight, "px");
|
164
|
+
} // 포함되어 있지 않다면 고정 높이 사용
|
165
|
+
)
|
166
|
+
.join(' ');
|
167
|
+
});
|
168
|
+
var templateObject_1, templateObject_2;
|