@node-projects/web-component-designer 0.0.249 → 0.0.251
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/elements/helper/GridHelper.js +8 -8
- package/dist/elements/services/dragDropService/DragDropService.d.ts +2 -0
- package/dist/elements/services/dragDropService/DragDropService.js +7 -1
- package/dist/elements/widgets/designerView/extensions/grid/DisplayGridExtension.js +6 -4
- package/package.json +1 -1
|
@@ -73,8 +73,8 @@ export function CalculateGridInformation(designItem) {
|
|
|
73
73
|
yOffset += gp;
|
|
74
74
|
}
|
|
75
75
|
const retVal = { cells: [], gaps: [] };
|
|
76
|
-
for (let
|
|
77
|
-
const r = rows[
|
|
76
|
+
for (let rowIdx = 0; rowIdx < rows.length; rowIdx++) {
|
|
77
|
+
const r = rows[rowIdx];
|
|
78
78
|
let areas = null;
|
|
79
79
|
if (gridA && gridA[rw + 1]) {
|
|
80
80
|
areas = gridA[rw + 1].split(' ');
|
|
@@ -84,15 +84,15 @@ export function CalculateGridInformation(designItem) {
|
|
|
84
84
|
const currY = Number.parseFloat(r.replace('px', ''));
|
|
85
85
|
let cellList = [];
|
|
86
86
|
retVal.cells.push(cellList);
|
|
87
|
-
for (let
|
|
88
|
-
const c = columns[
|
|
89
|
-
if (
|
|
90
|
-
retVal.gaps.push({ x: x + xOffset + paddingLeft, y: y + yOffset + paddingTop, width: xGap, height: currY, column:
|
|
87
|
+
for (let colIdx = 0; colIdx < columns.length; colIdx++) {
|
|
88
|
+
const c = columns[colIdx];
|
|
89
|
+
if (colIdx > 0) {
|
|
90
|
+
retVal.gaps.push({ x: x + xOffset + paddingLeft, y: y + yOffset + paddingTop, width: xGap, height: currY, column: colIdx, row: rowIdx, type: 'v' });
|
|
91
91
|
x += xGap;
|
|
92
92
|
}
|
|
93
93
|
const currX = Number.parseFloat(c.replace('px', ''));
|
|
94
|
-
if (
|
|
95
|
-
retVal.gaps.push({ x: x + xOffset + paddingLeft, y: y + yOffset - yGap + paddingTop, width: currX, height: yGap, column:
|
|
94
|
+
if (rowIdx > 0) {
|
|
95
|
+
retVal.gaps.push({ x: x + xOffset + paddingLeft, y: y + yOffset - yGap + paddingTop, width: currX, height: yGap, column: colIdx, row: rowIdx, type: 'h' });
|
|
96
96
|
}
|
|
97
97
|
let name = null;
|
|
98
98
|
if (areas && areas[cl]) {
|
|
@@ -4,6 +4,8 @@ import { IDesignItem } from "../../item/IDesignItem.js";
|
|
|
4
4
|
import { IPlacementService } from "../placementService/IPlacementService.js";
|
|
5
5
|
export declare class DragDropService implements IDragDropService {
|
|
6
6
|
private _dragOverExtensionItem;
|
|
7
|
+
private _oldX;
|
|
8
|
+
private _oldY;
|
|
7
9
|
dragEnter(designerCanvas: IDesignerCanvas, event: DragEvent): void;
|
|
8
10
|
dragLeave(designerCanvas: IDesignerCanvas, event: DragEvent): void;
|
|
9
11
|
dragOver(designerCanvas: IDesignerCanvas, event: DragEvent): void;
|
|
@@ -4,6 +4,8 @@ import { ExtensionType } from "../../widgets/designerView/extensions/ExtensionTy
|
|
|
4
4
|
import { dragDropFormatNameElementDefinition } from "../../../Constants.js";
|
|
5
5
|
export class DragDropService {
|
|
6
6
|
_dragOverExtensionItem;
|
|
7
|
+
_oldX;
|
|
8
|
+
_oldY;
|
|
7
9
|
dragEnter(designerCanvas, event) {
|
|
8
10
|
}
|
|
9
11
|
dragLeave(designerCanvas, event) {
|
|
@@ -20,7 +22,11 @@ export class DragDropService {
|
|
|
20
22
|
this._dragOverExtensionItem = newContainer;
|
|
21
23
|
}
|
|
22
24
|
else {
|
|
23
|
-
|
|
25
|
+
if (event.x != this._oldX && event.y != this._oldY) {
|
|
26
|
+
this._oldX = event.x;
|
|
27
|
+
this._oldY = event.y;
|
|
28
|
+
designerCanvas.extensionManager.refreshExtension(newContainer, ExtensionType.ContainerExternalDragOver, event);
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
async drop(designerCanvas, event) {
|
|
@@ -18,10 +18,12 @@ export class DisplayGridExtension extends AbstractExtension {
|
|
|
18
18
|
refresh(event) {
|
|
19
19
|
this.gridInformation = CalculateGridInformation(this.extendedItem);
|
|
20
20
|
let cells = this.gridInformation.cells;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
if (!this._group) {
|
|
22
|
+
this._group = this._drawGroup(null, this._group, OverlayLayer.Background);
|
|
23
|
+
this._group.style.transform = getElementCombinedTransform(this.extendedItem.element).toString();
|
|
24
|
+
this._group.style.transformOrigin = '0 0';
|
|
25
|
+
this._group.style.transformBox = 'fill-box';
|
|
26
|
+
}
|
|
25
27
|
if (cells[0][0] && !isNaN(cells[0][0].height) && !isNaN(cells[0][0].width)) {
|
|
26
28
|
if (this.gridInformation.cells.length != this._cells.length || this.gridInformation.cells[0].length != this._cells[0].length)
|
|
27
29
|
this._initSVGArrays();
|