publ-echo-test 0.0.365 β 0.0.366
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LayoutItem } from "./types";
|
|
2
2
|
type PlaceholderProps = {
|
|
3
|
+
device: "DESKTOP" | "MOBILE";
|
|
3
4
|
margin: [number, number];
|
|
4
5
|
rowHeight: number;
|
|
5
6
|
colWidth: number;
|
|
@@ -10,5 +11,5 @@ type PlaceholderProps = {
|
|
|
10
11
|
totalCols: number;
|
|
11
12
|
activeRows: number[];
|
|
12
13
|
};
|
|
13
|
-
export declare function GridBackgroundPlaceholder({ margin, rowHeight, colWidth, backgroundWidth, backgroundHeight, activeDrag, selectedBlockId, activeRows, totalCols, }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function GridBackgroundPlaceholder({ device, margin, rowHeight, colWidth, backgroundWidth, backgroundHeight, activeDrag, selectedBlockId, activeRows, totalCols, }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -5,7 +5,7 @@ export function GridBackgroundPlaceholder(_a) {
|
|
|
5
5
|
// { length: activeDrag.h },
|
|
6
6
|
// (_, i) => activeDrag.y + i
|
|
7
7
|
// );
|
|
8
|
-
var margin = _a.margin,
|
|
8
|
+
var device = _a.device, margin = _a.margin,
|
|
9
9
|
// width, // π¨ μ κ±°
|
|
10
10
|
rowHeight = _a.rowHeight, colWidth = _a.colWidth, backgroundWidth = _a.backgroundWidth, backgroundHeight = _a.backgroundHeight, activeDrag = _a.activeDrag, selectedBlockId = _a.selectedBlockId, activeRows = _a.activeRows, totalCols = _a.totalCols;
|
|
11
11
|
// π¨ activeColsλ totalCols propμΌλ‘ λ°μμ μ¬μ©
|
|
@@ -17,9 +17,10 @@ export function GridBackgroundPlaceholder(_a) {
|
|
|
17
17
|
// ν¨ν΄μ colWidth + margin[0] λ¨μλ‘ λ°λ³΅λλ―λ‘, λ§μ§λ§ μ΄μμλ margin[0]μ΄ νμ μμ΅λλ€.
|
|
18
18
|
// λλ, λ§μ§λ§ μμμλ margin[0]μ΄ μλ€κ³ κ°μ νκ³ κ³μ°ν©λλ€.
|
|
19
19
|
var gridContentWidth = totalCols * (colWidth + margin[0]) - margin[0];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
var isHeightVariable = device === "DESKTOP"
|
|
21
|
+
? !!activeDrag.isHeightVariableDesktop
|
|
22
|
+
: !!activeDrag.isHeightVariableMobile;
|
|
23
|
+
var showActiveRows = !!activeDrag.heightFitContent || isHeightVariable;
|
|
23
24
|
return (_jsx("div", { className: "grid-placeholder", style: {
|
|
24
25
|
marginTop: margin[1] + "px",
|
|
25
26
|
marginBottom: margin[1] + "px",
|
|
@@ -219,17 +219,7 @@ var ReactGridLayout = function (_a) {
|
|
|
219
219
|
}
|
|
220
220
|
var xgap = x - oldDragItem.x;
|
|
221
221
|
var ygap = y - oldDragItem.y;
|
|
222
|
-
var placeholder = {
|
|
223
|
-
w: l.w,
|
|
224
|
-
h: l.h,
|
|
225
|
-
x: l.x,
|
|
226
|
-
y: l.y,
|
|
227
|
-
z: l.z,
|
|
228
|
-
placeholder: true,
|
|
229
|
-
i: i,
|
|
230
|
-
heightFitContent: l.heightFitContent,
|
|
231
|
-
isHeightVariable: l.isHeightVariable,
|
|
232
|
-
};
|
|
222
|
+
var placeholder = __assign(__assign({}, l), { w: l.w, h: l.h, x: l.x, y: l.y, z: l.z, placeholder: true, i: i, heightFitContent: l.heightFitContent });
|
|
233
223
|
var isUserAction = true;
|
|
234
224
|
var newLayout = isGroup
|
|
235
225
|
? layout
|
|
@@ -431,17 +421,7 @@ var ReactGridLayout = function (_a) {
|
|
|
431
421
|
}), newLayout = _b[0], l = _b[1];
|
|
432
422
|
if (!l)
|
|
433
423
|
return;
|
|
434
|
-
var placeholder = {
|
|
435
|
-
w: l.w,
|
|
436
|
-
h: l.h,
|
|
437
|
-
x: l.x,
|
|
438
|
-
y: l.y,
|
|
439
|
-
z: l.z,
|
|
440
|
-
static: true,
|
|
441
|
-
i: i,
|
|
442
|
-
heightFitContent: l.heightFitContent,
|
|
443
|
-
isHeightVariable: l.isHeightVariable,
|
|
444
|
-
};
|
|
424
|
+
var placeholder = __assign(__assign({}, l), { w: l.w, h: l.h, x: l.x, y: l.y, z: l.z, static: true, i: i, heightFitContent: l.heightFitContent });
|
|
445
425
|
props.onResize &&
|
|
446
426
|
props.onResize({
|
|
447
427
|
layout: newLayout,
|
|
@@ -791,11 +771,7 @@ var ReactGridLayout = function (_a) {
|
|
|
791
771
|
var activeRowsFiltered = shouldShowAllHeightVariableRows
|
|
792
772
|
? heightVariableRows
|
|
793
773
|
: activeRows;
|
|
794
|
-
|
|
795
|
-
console.log("activeDrag", activeDrag);
|
|
796
|
-
console.log("shouldShowAllHeightVariableRows", shouldShowAllHeightVariableRows);
|
|
797
|
-
console.log("heightVariableRows", heightVariableRows);
|
|
798
|
-
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, { backgroundWidth: getBackgroundWidth(), backgroundHeight: getBackgroundHeight(), margin: margin,
|
|
774
|
+
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,
|
|
799
775
|
// width={width}
|
|
800
776
|
rowHeight: rowHeight, activeRows: activeRowsFiltered !== null && activeRowsFiltered !== void 0 ? activeRowsFiltered : [], colWidth: colWidth, activeDrag: activeDragItemOrSelectedItem, selectedBlockId: selectedBlockId, totalCols: cols }))] }));
|
|
801
777
|
};
|
|
@@ -22,7 +22,8 @@ export type LayoutItem = {
|
|
|
22
22
|
isBounded?: boolean;
|
|
23
23
|
groupLayouts?: LayoutItem[];
|
|
24
24
|
autoResize?: boolean;
|
|
25
|
-
|
|
25
|
+
isHeightVariableDesktop?: boolean;
|
|
26
|
+
isHeightVariableMobile?: boolean;
|
|
26
27
|
heightFitContent?: boolean;
|
|
27
28
|
};
|
|
28
29
|
export type Layout = LayoutItem[];
|