publ-echo-test 0.0.387 โ 0.0.388
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.
|
@@ -12,7 +12,8 @@ type PlaceholderProps = {
|
|
|
12
12
|
totalCols: number;
|
|
13
13
|
activeRows: number[];
|
|
14
14
|
activeBlock?: ComponentBlock | GroupBlock | null;
|
|
15
|
+
layout: LayoutItem[];
|
|
15
16
|
};
|
|
16
17
|
export declare function GridBackgroundPlaceholder({ device, margin, rowHeight, colWidth, backgroundWidth, backgroundHeight, activeDrag, selectedBlockId, activeRows, totalCols, // ๐ก ์๋ก ๋ฐ์ totalCols ์ฌ์ฉ
|
|
17
|
-
activeBlock, }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
activeBlock, layout, }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getLayoutItem } from "./utils/renderHelpers";
|
|
2
3
|
export function GridBackgroundPlaceholder(_a) {
|
|
3
4
|
// ํ์ฑํ๋ ํ(row) ์ธ๋ฑ์ค ๋ฐฐ์ด
|
|
4
5
|
// const activeRows = Array.from(
|
|
@@ -8,7 +9,7 @@ export function GridBackgroundPlaceholder(_a) {
|
|
|
8
9
|
var device = _a.device, margin = _a.margin,
|
|
9
10
|
// width, // ๐จ ์ ๊ฑฐ
|
|
10
11
|
rowHeight = _a.rowHeight, colWidth = _a.colWidth, backgroundWidth = _a.backgroundWidth, backgroundHeight = _a.backgroundHeight, activeDrag = _a.activeDrag, selectedBlockId = _a.selectedBlockId, activeRows = _a.activeRows, totalCols = _a.totalCols, // ๐ก ์๋ก ๋ฐ์ totalCols ์ฌ์ฉ
|
|
11
|
-
activeBlock = _a.activeBlock;
|
|
12
|
+
activeBlock = _a.activeBlock, layout = _a.layout;
|
|
12
13
|
// ๐จ activeCols๋ totalCols prop์ผ๋ก ๋ฐ์์ ์ฌ์ฉ
|
|
13
14
|
// const activeCols = Array.from({ length: 24 }, (_, i) => 0 + i);
|
|
14
15
|
var activeCols = Array.from({ length: totalCols }, function (_, i) { return 0 + i; });
|
|
@@ -21,8 +22,10 @@ export function GridBackgroundPlaceholder(_a) {
|
|
|
21
22
|
var isHeightVariable = device === "DESKTOP"
|
|
22
23
|
? !!(activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.isHeightVariableDesktop)
|
|
23
24
|
: !!(activeBlock === null || activeBlock === void 0 ? void 0 : activeBlock.isHeightVariableMobile);
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
// const showActiveRows = !!activeDrag.heightFitContent || isHeightVariable;
|
|
26
|
+
var showActiveRows = activeBlock && activeBlock.type === "GROUP_BLOCK"
|
|
27
|
+
? getShowActiveRows(activeBlock, layout)
|
|
28
|
+
: !!activeDrag.heightFitContent || isHeightVariable;
|
|
26
29
|
return (_jsx("div", { className: "grid-placeholder", style: {
|
|
27
30
|
marginTop: margin[1] + "px",
|
|
28
31
|
marginBottom: margin[1] + "px",
|
|
@@ -41,3 +44,19 @@ export function GridBackgroundPlaceholder(_a) {
|
|
|
41
44
|
}), _jsx("foreignObject", { x: gridContentWidth + textPadding, y: y_top, width: colWidth, height: rowHeight, style: { overflow: "visible" }, children: _jsx("div", { className: "grid-indicator-text" }) })] }, "active-row-".concat(row)));
|
|
42
45
|
})] }) }));
|
|
43
46
|
}
|
|
47
|
+
function getShowActiveRows(block, layout) {
|
|
48
|
+
if (block.type === "GROUP_BLOCK") {
|
|
49
|
+
var hasFitContentCB = block.children.some(function (child) {
|
|
50
|
+
if (child.type === "COMPONENT_BLOCK") {
|
|
51
|
+
var item = getLayoutItem(layout, child.componentBlockId.toString());
|
|
52
|
+
return (item === null || item === void 0 ? void 0 : item.heightFitContent) || false;
|
|
53
|
+
}
|
|
54
|
+
if (child.type === "GROUP_BLOCK") {
|
|
55
|
+
return getShowActiveRows(child, layout);
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
});
|
|
59
|
+
return hasFitContentCB;
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
@@ -786,6 +786,6 @@ var ReactGridLayout = function (_a) {
|
|
|
786
786
|
: activeRows;
|
|
787
787
|
return (_jsxs("div", { ref: innerRef, className: mergedClassName, style: mergedStyle, onDrop: isDroppable ? onDropHandler : noop, onDragLeave: isDroppable ? onDragLeaveHandler : noop, onDragEnter: isDroppable ? onDragEnterHandler : noop, onDragOver: isDroppable ? onDragOverHandler : noop, "data-grid-row-height": rowHeight, "data-grid-cols": cols, "data-section-id": sectionId, children: [currentGroupBlocks.map(function (each) { return processGroup(each); }), React.Children.map(children, function (child) { return processGridItem(child); }), placeholder(), activeDrag && _jsx("div", { className: "grid-guide-line-center" }), activeDragItemOrSelectedItem && (_jsx(GridBackgroundPlaceholder, { device: device, backgroundWidth: getBackgroundWidth(), backgroundHeight: getBackgroundHeight(), margin: margin,
|
|
788
788
|
// width={width}
|
|
789
|
-
rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, activeBlock: activeBlock, selectedBlockId: selectedBlockId, totalCols: cols }))] }));
|
|
789
|
+
rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, activeBlock: activeBlock, selectedBlockId: selectedBlockId, totalCols: cols, layout: layout }))] }));
|
|
790
790
|
};
|
|
791
791
|
export default ReactGridLayout;
|