polarvo-layout 1.0.32 → 1.0.34
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 +1 -1
- package/src/components/Layout/FreeLayout.vue +2 -1
- package/src/components/SideBar/ElementSideBar.vue +9 -8
- package/src/core/engines/DisplayEngine.js +5 -0
- package/src/core/engines/FreeDropEngine.js +1 -0
- package/src/core/managers/EngineManager.js +2 -2
- package/src/library/FreeDropLibrary.js +2 -2
- package/src/library/GridDropLibrary.js +2 -2
package/package.json
CHANGED
|
@@ -57,7 +57,7 @@ const props = defineProps({
|
|
|
57
57
|
},
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
const { setActiveDesign } = props.polarvo.display;
|
|
60
|
+
const { setActiveDesign, setActiveMenu } = props.polarvo.display;
|
|
61
61
|
const { updateActiveElement } = props.polarvo.layout;
|
|
62
62
|
const { elements, guides, activeElement } = toRefs(props.polarvo.freeDrop.state);
|
|
63
63
|
const filteredElements = computed(() => {
|
|
@@ -75,6 +75,7 @@ watch(
|
|
|
75
75
|
if (newId === oldId) return;
|
|
76
76
|
if (!newId) {
|
|
77
77
|
setActiveDesign(null);
|
|
78
|
+
setActiveMenu(null);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
_isElementSwitching = true;
|
|
@@ -41,14 +41,15 @@ const imageModules = import.meta.glob('@/assets/el_img/*.{png,gif}', { eager: tr
|
|
|
41
41
|
|
|
42
42
|
function getPropsDefaults(props) {
|
|
43
43
|
if (!props) return {};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return [key,
|
|
50
|
-
}
|
|
51
|
-
|
|
44
|
+
|
|
45
|
+
return Object.fromEntries(Object.entries(props).map(([key, prop]) => {
|
|
46
|
+
if (['size'].includes(key)) return null;
|
|
47
|
+
|
|
48
|
+
if (prop.default !== undefined) {
|
|
49
|
+
return [key, typeof prop.default === 'function' ? prop.default() : prop.default];
|
|
50
|
+
}
|
|
51
|
+
return null; // 기본값이 없는 경우 null 반환
|
|
52
|
+
}).filter(entry => entry !== null));
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
async function getElements() {
|
|
@@ -61,6 +61,11 @@ class DisplayEngine {
|
|
|
61
61
|
this.displaySize = { ...$screenConfig.displaySize };
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
+
this._subscribe('freeDrop:setActiveElement', () => {
|
|
65
|
+
this.setActiveMenu(null);
|
|
66
|
+
this.setActiveDesign(null);
|
|
67
|
+
})
|
|
68
|
+
|
|
64
69
|
this._subscribe('freeDrop:startDrag', () => {
|
|
65
70
|
this.setActiveMenu(null);
|
|
66
71
|
this.setActiveDesign(null);
|
|
@@ -910,7 +910,7 @@ class EngineManager {
|
|
|
910
910
|
// getGuides: () => freeDropEngine.guides,
|
|
911
911
|
setActiveElement: (element, type) => freeDropEngine.setActiveElement(element, type),
|
|
912
912
|
|
|
913
|
-
addElement: (event,
|
|
913
|
+
addElement: (event, item) => freeDropEngine.addElement(event, item),
|
|
914
914
|
toggleLock: () => freeDropEngine.toggleLock(),
|
|
915
915
|
handleMouseDown: (event, id) => freeDropEngine.handleMouseDown(event, id),
|
|
916
916
|
startResize: (event, direction) => freeDropEngine.startResize(event, direction),
|
|
@@ -924,7 +924,7 @@ class EngineManager {
|
|
|
924
924
|
setActiveElement: (element, type) => gridDropEngine.setActiveElement(element, type),
|
|
925
925
|
detectHoverCell: (cell) => gridDropEngine.detectHoverCell(cell),
|
|
926
926
|
|
|
927
|
-
addElement: (
|
|
927
|
+
addElement: (item) => gridDropEngine.addElement(item),
|
|
928
928
|
toggleLock: () => gridDropEngine.toggleLock(),
|
|
929
929
|
startDrag: (event, id) => gridDropEngine.startDrag(event, id),
|
|
930
930
|
handleMouseDown: (event, id) => gridDropEngine.handleMouseDown(event, id),
|
|
@@ -150,9 +150,9 @@ function useFreeDrop(api) {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
const addElement = (event,
|
|
153
|
+
const addElement = (event, item) => {
|
|
154
154
|
try {
|
|
155
|
-
api.freeDrop.addElement(event,
|
|
155
|
+
api.freeDrop.addElement(event, item);
|
|
156
156
|
} catch (error) {
|
|
157
157
|
console.warn('[FreeDropLibrary] addElement 실행 중 오류 발생:', error);
|
|
158
158
|
}
|
|
@@ -133,9 +133,9 @@ function useGridDrop(api) {
|
|
|
133
133
|
// }
|
|
134
134
|
// };
|
|
135
135
|
|
|
136
|
-
const addElement = (
|
|
136
|
+
const addElement = (item) => {
|
|
137
137
|
try {
|
|
138
|
-
api.gridDrop.addElement(
|
|
138
|
+
api.gridDrop.addElement(item);
|
|
139
139
|
} catch (error) {
|
|
140
140
|
console.warn('[GridDropLibrary] addElement 호출 중 오류 발생:', error);
|
|
141
141
|
}
|