polarvo-layout 1.0.62 → 1.0.64

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polarvo-layout",
3
- "version": "1.0.62",
3
+ "version": "1.0.64",
4
4
  "type": "module",
5
5
  "author": "unigence <unigencelab@gmail.com>",
6
6
  "repository": {
@@ -43,8 +43,9 @@
43
43
  :rootId="item.id"
44
44
  :ref="setRef"
45
45
  v-bind="item"
46
+ :isHovable="isHovable"
46
47
  class="hover:opacity-80"
47
- :class="activeEditMode ? `pointer-events-auto ` : `pointer-events-none`"
48
+ :class="activeEditMode || isHovable ? `pointer-events-auto ` : `pointer-events-none`"
48
49
  @set:defaultStyle="setDefaultStyle"
49
50
  />
50
51
  </div>
@@ -59,6 +60,7 @@ const props = defineProps({
59
60
  item: { type: Object, required: true },
60
61
  polarvo: { type: Object, required: true },
61
62
  sectionKey: { type: String, required: true },
63
+ isHovable: { type: Boolean, required: true },
62
64
  });
63
65
 
64
66
  const { activeId, handles, activeElement } = toRefs(props.polarvo.freeDrop.state);
@@ -6,6 +6,7 @@
6
6
  :item="item"
7
7
  :polarvo="props.polarvo"
8
8
  :sectionKey="props.sectionKey"
9
+ :isHovable="isHovable(item)"
9
10
  ></FreeItem>
10
11
 
11
12
  <!-- 오버레이 -->
@@ -68,6 +69,11 @@ const filteredElements = computed(() => {
68
69
  const selectedElement = inject('selectedElement');
69
70
  const activeEditMode = inject('activeEditMode');
70
71
 
72
+ const isHovable = (item) => {
73
+ if (!item || props.preview) return true;
74
+ return activeElement.value?.id === item.id && ['chart'].includes(item.type);
75
+ };
76
+
71
77
  let _isElementSwitching = false;
72
78
  import { omit, cloneDeep } from 'lodash-es';
73
79
 
@@ -79,6 +85,7 @@ watch(
79
85
  if (newId && activeElement.value?.section !== props.sectionKey) return;
80
86
 
81
87
  if (!newId) {
88
+ console.l;
82
89
  setActiveDesign(null);
83
90
  setActiveMenu(null);
84
91
  }
@@ -113,6 +120,8 @@ watch(
113
120
  (newDesign, oldDesign) => {
114
121
  if (newDesign != null || oldDesign == null) return; // null → null이 아닌 값으로 닫히는(값이 있다가 null 되는) 경우만
115
122
  if (activeElement.value?.section !== props.sectionKey) return;
123
+ // selectedElement가 아직 activeElement로 갱신되기 전(요소 전환 레이스)이면 저장하지 않음
124
+ if (selectedElement.value?.id !== activeElement.value?.id) return;
116
125
 
117
126
  if (activeElement.value?.id && !activeElement.value.id.includes('inputForm')) {
118
127
  updateActiveElement(activeElement.value.id, selectedElementForWatch.value, true);
@@ -41,11 +41,11 @@
41
41
  :rootId="item.id"
42
42
  :ref="setRef"
43
43
  v-bind="item"
44
+ :isHovable="isHovable"
44
45
  class="hover:opacity-80"
45
- :class="activeEditMode ? `pointer-events-auto ` : `pointer-events-none`"
46
- @set:defaultStyle="setDefaultStyle"
46
+ :class="activeEditMode || isHovable ? `pointer-events-auto ` : `pointer-events-none`"
47
+ @set:defaultStyle="setDefaultStyle"
47
48
  />
48
-
49
49
  <!-- 오버레이 -->
50
50
  <div v-if="activeEditMode && item.id !== activeId" class="absolute inset-0 bg-black opacity-50 z-30"></div>
51
51
  </template>
@@ -69,6 +69,7 @@ const props = defineProps({
69
69
  item: { type: Object, required: true },
70
70
  polarvo: { type: Object, required: true },
71
71
  sectionKey: { type: String, required: true },
72
+ isHovable: { type: Boolean, required: true },
72
73
  });
73
74
 
74
75
  const { activeId } = toRefs(props.polarvo.gridDrop.state);
@@ -6,6 +6,7 @@
6
6
  :item="item"
7
7
  :polarvo="props.polarvo"
8
8
  :sectionKey="props.sectionKey"
9
+ :isHovable="isHovable(item)"
9
10
  ></GridItem>
10
11
 
11
12
  <!-- 행 크기 조절 -->
@@ -107,6 +108,11 @@ const { activeDesign } = toRefs(props.polarvo.display.state);
107
108
  const selectedElement = inject('selectedElement');
108
109
  const activeEditMode = inject('activeEditMode');
109
110
 
111
+ const isHovable = (item) => {
112
+ if (!item || props.preview) return true;
113
+ return activeElement.value?.id === item.id && ['chart'].includes(item.type);
114
+ };
115
+
110
116
  import { omit, cloneDeep, debounce } from 'lodash-es';
111
117
 
112
118
  const gridColumns = ref(3); // 동적으로 계산
@@ -371,6 +377,8 @@ watch(
371
377
  (newDesign, oldDesign) => {
372
378
  if (newDesign != null || oldDesign == null) return; // null → null이 아닌 값으로 닫히는(값이 있다가 null 되는) 경우만
373
379
  if (activeElement.value?.section !== props.sectionKey) return;
380
+ // selectedElement가 아직 activeElement로 갱신되기 전(요소 전환 레이스)이면 저장하지 않음
381
+ if (selectedElement.value?.id !== activeElement.value?.id) return;
374
382
 
375
383
  if (activeElement.value?.id && !activeElement.value.id.includes('inputForm')) {
376
384
  updateActiveElement(activeElement.value.id, selectedElementForWatch.value, true);
@@ -61,7 +61,8 @@ class DisplayEngine {
61
61
  this.displaySize = { ...$screenConfig.displaySize };
62
62
  });
63
63
 
64
- this._subscribe('freeDrop:setActiveElement', () => {
64
+ this._subscribe('freeDrop:setActiveElement', ({ action }) => {
65
+ if (action === 'update') return;
65
66
  this.setActiveMenu(null);
66
67
  this.setActiveDesign(null);
67
68
  });
@@ -446,13 +446,14 @@ class FreeDropEngine {
446
446
  */
447
447
  setActiveElement(element, action = null) {
448
448
  // 이미 활성화된 요소를 다시 활성화하려는 경우 무시 (단, 속성이 갱신된 경우는 제외)
449
- if (action !== 'update' && element && this._activeElement?.id === element?.id) return;
449
+ if (element && this._activeElement?.id === element?.id) return;
450
450
 
451
451
  this._activeElement = element;
452
452
  this._alreadyExist = action === 'add' ? false : true;
453
453
  // this._elementsUpdate = true;
454
454
 
455
455
  this.eventBus.emit('freeDrop:setActiveElement', {
456
+ action: action,
456
457
  $alreadyExist: this._alreadyExist,
457
458
  activeElement: this._activeElement,
458
459
  timestamp: Date.now(),
@@ -223,7 +223,7 @@ class GridDropEngine {
223
223
  */
224
224
  setActiveElement(element, action = null) {
225
225
  // 이미 활성화된 요소를 다시 활성화하려는 경우 무시 (단, 속성이 갱신된 경우는 제외)
226
- if (action !== 'update' && element && this._activeElement?.id === element?.id) return;
226
+ if (element && this._activeElement?.id === element?.id) return;
227
227
 
228
228
  this._activeElement = element;
229
229
  this._elementsUpdate = true;