polarvo-layout 1.0.42 → 1.0.44
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:id="item.id"
|
|
4
4
|
class="absolute user-select-none"
|
|
5
5
|
:style="itemStyle"
|
|
6
|
-
:class="{ 'z-50': item.id === activeId, 'bg-white border-2 border-blue-400': item.id === activeId }"
|
|
6
|
+
:class="{ 'z-50': item.id === activeId, 'bg-white border-2 border-blue-400': item.id === activeId, 'bg-white': item.type === 'chart' }"
|
|
7
7
|
@mousedown.stop="activeEditMode ? null : handleMouseDown($event, item.id)"
|
|
8
8
|
>
|
|
9
9
|
<!-- 크기-->
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
/>
|
|
47
47
|
|
|
48
48
|
<!-- 오버레이 -->
|
|
49
|
-
<div v-if="activeEditMode && item.id !== activeId" class="absolute inset-0 bg-black opacity-50"></div>
|
|
49
|
+
<div v-if="activeEditMode && item.id !== activeId" class="absolute inset-0 bg-black opacity-50 z-30"></div>
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<template v-else>
|
|
@@ -139,7 +139,6 @@ class FreeDropEngine {
|
|
|
139
139
|
timestamp: Date.now(),
|
|
140
140
|
});
|
|
141
141
|
|
|
142
|
-
|
|
143
142
|
this._gridNumber = snapShot.layout.gridNumber || null;
|
|
144
143
|
this._gridSize = snapShot.display.displaySize?.gridSize || null;
|
|
145
144
|
}
|
|
@@ -366,7 +365,7 @@ class FreeDropEngine {
|
|
|
366
365
|
*/
|
|
367
366
|
addElement(event, item) {
|
|
368
367
|
if (this._activeMode !== 'free') return;
|
|
369
|
-
const elName = item.elName;
|
|
368
|
+
const elName = item.elName;
|
|
370
369
|
|
|
371
370
|
this._startPos = { x: event.clientX, y: event.clientY };
|
|
372
371
|
|
|
@@ -379,7 +378,7 @@ class FreeDropEngine {
|
|
|
379
378
|
size: elementSource[elName] || { w: 100, h: 100 },
|
|
380
379
|
section: this._activeSection,
|
|
381
380
|
isLocked: false,
|
|
382
|
-
...item.propDefaults || {}, // 아이템의 기본 props 설정
|
|
381
|
+
...(item.propDefaults || {}), // 아이템의 기본 props 설정
|
|
383
382
|
};
|
|
384
383
|
|
|
385
384
|
this.setActiveElement(element, 'add');
|
|
@@ -701,12 +700,12 @@ class FreeDropEngine {
|
|
|
701
700
|
// 1) 기존 배치요소인 경우
|
|
702
701
|
if (this._alreadyExist) {
|
|
703
702
|
// 충돌 시 기존 위치로 복귀
|
|
704
|
-
if (this._detectElementCollision()) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
} else {
|
|
703
|
+
// if (this._detectElementCollision()) {
|
|
704
|
+
// alert('아이템이 겹칩니다. 다른 위치로 드래그해주세요.');
|
|
705
|
+
// this._activeElement.position.x = this._startPos.x;
|
|
706
|
+
// this._activeElement.position.y = this._startPos.y;
|
|
707
|
+
// this._resetDrag(true);
|
|
708
|
+
// } else {
|
|
710
709
|
// 로컬에서 position, size 업데이트
|
|
711
710
|
this.eventBus.emit('freeDrop:requestUpdateLocalBounds', {
|
|
712
711
|
elementId: this._activeElement.id,
|
|
@@ -716,23 +715,23 @@ class FreeDropEngine {
|
|
|
716
715
|
timestamp: Date.now(),
|
|
717
716
|
});
|
|
718
717
|
this._resetDrag(true, true);
|
|
719
|
-
}
|
|
718
|
+
// }
|
|
720
719
|
|
|
721
720
|
return;
|
|
722
721
|
}
|
|
723
722
|
// 2) 신규 아이템인 경우
|
|
724
723
|
else {
|
|
725
724
|
// 충돌 시 추가 취소 (로컬에만 반영됨)
|
|
726
|
-
if (this._detectElementCollision()) {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
} else {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}
|
|
725
|
+
// if (this._detectElementCollision()) {
|
|
726
|
+
// alert('겹치는 위치에 배치할 수 없습니다.');
|
|
727
|
+
// this.setActiveElement(null, 'add');
|
|
728
|
+
// } else {
|
|
729
|
+
this.guides = { x: null, y: null, w: null, h: null };
|
|
730
|
+
this.eventBus.emit('freeDrop:requestAddElement', {
|
|
731
|
+
element: this._activeElement,
|
|
732
|
+
timestamp: Date.now(),
|
|
733
|
+
});
|
|
734
|
+
// }
|
|
736
735
|
this._resetDrag();
|
|
737
736
|
return;
|
|
738
737
|
}
|
|
@@ -804,14 +803,14 @@ class FreeDropEngine {
|
|
|
804
803
|
/** [내부함수] 리사이징 종료 */
|
|
805
804
|
_stopResize = () => {
|
|
806
805
|
// 충돌 시 기존 위치로 복귀
|
|
807
|
-
if (this._detectElementCollision()) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
} else {
|
|
806
|
+
// if (this._detectElementCollision()) {
|
|
807
|
+
// alert('아이템이 겹칩니다. 사이즈 조정이 취소되었습니다.');
|
|
808
|
+
// this._activeElement.position = this._startPos;
|
|
809
|
+
// this._activeElement.size = this._startSize;
|
|
810
|
+
// this._resetResize();
|
|
811
|
+
// } else {
|
|
813
812
|
this._resetResize(true);
|
|
814
|
-
}
|
|
813
|
+
// }
|
|
815
814
|
|
|
816
815
|
return;
|
|
817
816
|
};
|