@node-projects/web-component-designer 0.0.58 → 0.0.59
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/CssCombiner.js +1 -1
- package/dist/elements/services/placementService/GridPlacementService.js +25 -5
- package/dist/elements/widgets/designerView/extensions/ResizeExtension.js +4 -1
- package/dist/elements/widgets/propertyGrid/PropertyGridWithHeader.js +3 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CalculateGridInformation } from '../../helper/GridHelper.js';
|
|
2
2
|
import { pointInRect } from '../../helper/Helper.js';
|
|
3
|
+
import { DefaultPlacementService } from './DefaultPlacementService';
|
|
3
4
|
export class GridPlacementService {
|
|
4
5
|
enterContainer(container, items) {
|
|
5
6
|
for (let i of items) {
|
|
@@ -35,7 +36,8 @@ export class GridPlacementService {
|
|
|
35
36
|
return container.element.getBoundingClientRect();
|
|
36
37
|
}
|
|
37
38
|
placePoint(event, placementView, container, startPoint, offsetInControl, newPoint, items) {
|
|
38
|
-
|
|
39
|
+
const defaultPlacementService = container.serviceContainer.getLastServiceWhere('containerService', x => x instanceof DefaultPlacementService);
|
|
40
|
+
return defaultPlacementService.placePoint(event, placementView, container, startPoint, offsetInControl, newPoint, items);
|
|
39
41
|
}
|
|
40
42
|
place(event, placementView, container, startPoint, offsetInControl, newPoint, items) {
|
|
41
43
|
const gridInformation = CalculateGridInformation(container);
|
|
@@ -49,14 +51,23 @@ export class GridPlacementService {
|
|
|
49
51
|
column = 0;
|
|
50
52
|
for (let cell of cellRow) {
|
|
51
53
|
if (pointInRect(pos, cell)) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
if (cell.name) {
|
|
55
|
+
items[0].element.style.gridColumn = '';
|
|
56
|
+
items[0].element.style.gridRow = '';
|
|
57
|
+
items[0].element.style.gridArea = cell.name;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
items[0].element.style.gridArea = '';
|
|
61
|
+
items[0].element.style.gridColumn = column + 1;
|
|
62
|
+
items[0].element.style.gridRow = row + 1;
|
|
63
|
+
}
|
|
54
64
|
}
|
|
55
65
|
column++;
|
|
56
66
|
}
|
|
57
67
|
row++;
|
|
58
68
|
}
|
|
59
69
|
}
|
|
70
|
+
placementView.extensionManager.refreshAllExtensions([container]);
|
|
60
71
|
}
|
|
61
72
|
finishPlace(event, placementView, container, startPoint, offsetInControl, newPoint, items) {
|
|
62
73
|
const gridInformation = CalculateGridInformation(container);
|
|
@@ -68,12 +79,21 @@ export class GridPlacementService {
|
|
|
68
79
|
column = 0;
|
|
69
80
|
for (let cell of cellRow) {
|
|
70
81
|
if (pointInRect(pos, cell)) {
|
|
71
|
-
|
|
72
|
-
|
|
82
|
+
if (cell.name) {
|
|
83
|
+
items[0].removeStyle('grid-column');
|
|
84
|
+
items[0].removeStyle('grid-row');
|
|
85
|
+
items[0].setStyle('grid-area', cell.name);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
items[0].removeStyle('grid-area');
|
|
89
|
+
items[0].setStyle('grid-column', column + 1);
|
|
90
|
+
items[0].setStyle('grid-row', row + 1);
|
|
91
|
+
}
|
|
73
92
|
}
|
|
74
93
|
column++;
|
|
75
94
|
}
|
|
76
95
|
row++;
|
|
77
96
|
}
|
|
97
|
+
placementView.extensionManager.refreshAllExtensions([container]);
|
|
78
98
|
}
|
|
79
99
|
}
|
|
@@ -115,7 +115,10 @@ export class ResizeExtension extends AbstractExtension {
|
|
|
115
115
|
break;
|
|
116
116
|
//for other resize modes we need a replacement
|
|
117
117
|
}
|
|
118
|
-
this.
|
|
118
|
+
const resizedElements = [this.extendedItem, this.extendedItem.parent];
|
|
119
|
+
if (this.resizeAllSelected)
|
|
120
|
+
resizedElements.push(...this.designerCanvas.instanceServiceContainer.selectionService.selectedElements);
|
|
121
|
+
this.extensionManager.refreshExtensions(resizedElements);
|
|
119
122
|
}
|
|
120
123
|
break;
|
|
121
124
|
case EventNames.PointerUp:
|