ninegrid2 6.1067.0 → 6.1068.0

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.
@@ -121407,7 +121407,7 @@ class nxSplitter extends HTMLElement {
121407
121407
  const isHorizontal = this.#mode === "h";
121408
121408
 
121409
121409
  // ⭐ 마우스 초기 위치 저장 ⭐
121410
- const initialMousePos = isHorizontal ? e.clientX : e.clientY;
121410
+ isHorizontal ? e.clientX : e.clientY;
121411
121411
 
121412
121412
  // 마우스 포인터와 스플리터 시작점 사이의 거리
121413
121413
  isHorizontal
@@ -121488,10 +121488,19 @@ class nxSplitter extends HTMLElement {
121488
121488
  const allChildren = Array.from(parent.children);
121489
121489
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
121490
121490
 
121491
- // ⭐⭐ 부모의 픽셀 크기 ⭐⭐
121492
- const totalContainerSize = isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height;
121491
+ // ⭐⭐ 드래그 바의 최종 위치를 기준으로 dragOffset 계산 ⭐⭐
121492
+ const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
121493
+ const initialSplitterPos = isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top;
121494
+ const dragOffset = finalDragBarPos - initialSplitterPos;
121495
+
121496
+ const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;
121497
+ const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
121498
+
121499
+ const newPrevSize = prevSize + dragOffset;
121500
+ const newNextSize = nextSize - dragOffset;
121501
+
121502
+ const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121493
121503
 
121494
- // ⭐⭐ 모든 스플리터의 총 픽셀 크기 ⭐⭐
121495
121504
  const totalSplitterSize = allChildren.reduce((sum, child) => {
121496
121505
  if (child.tagName.toLowerCase() === 'nx-splitter') {
121497
121506
  return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
@@ -121499,32 +121508,8 @@ class nxSplitter extends HTMLElement {
121499
121508
  return sum;
121500
121509
  }, 0);
121501
121510
 
121502
- // ⭐⭐ Flexbox의 'gap' 크기 계산 (하드코딩된 8px 사용) ⭐⭐
121503
- allChildren.length - 1;
121504
- const totalGapSize = 0;//gapCount * 8;
121505
-
121506
- // ⭐⭐ Flexbox 컨테이너의 '총 유효 공간' (패널들이 차지할 수 있는 공간) 계산 ⭐⭐
121507
- const totalFlexSpace = totalContainerSize - totalSplitterSize - totalGapSize;
121508
-
121509
- // ⭐⭐ 모든 패널의 초기 크기를 미리 저장 ⭐⭐
121510
- const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121511
-
121512
-
121513
- // 드래그로 인한 픽셀 변화량 계산
121514
- //const dragOffset = (isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top)) -
121515
- // (isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top);
121516
-
121517
- // ⭐ 정확한 dragOffset 계산 ⭐
121518
- const finalMousePos = isHorizontal ? e.clientX : e.clientY;
121519
- const dragOffset = finalMousePos - initialMousePos;
121520
-
121521
- const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;
121522
- const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
121523
-
121524
- const newPrevSize = prevSize + dragOffset;
121525
- const newNextSize = nextSize - dragOffset;
121526
-
121527
- console.log(prevSize, newPrevSize);
121511
+ const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
121512
+ const totalFlexSpace = totalContainerSize - totalSplitterSize;
121528
121513
 
121529
121514
  let flexSum = 0;
121530
121515
  allPanels.forEach((panel, index) => {
@@ -121537,16 +121522,12 @@ class nxSplitter extends HTMLElement {
121537
121522
  newSize = initialSizes[index];
121538
121523
  }
121539
121524
 
121540
- //console.log(newSize)
121541
-
121542
- // ⭐⭐ 새로운 FlexBasis 계산 ⭐⭐
121543
121525
  const newFlexBasis = newSize / totalFlexSpace;
121544
121526
  panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
121545
121527
  flexSum += newFlexBasis;
121546
121528
  });
121547
121529
 
121548
- // ⭐⭐ 계산된 합계를 로그로 출력하여 확인 ⭐⭐
121549
- console.log(`newTotalFlexSpace: ${totalFlexSpace}`);
121530
+ console.log(`dragOffset: ${dragOffset}`);
121550
121531
  console.log(`Calculated FlexSum: ${flexSum}`);
121551
121532
  };
121552
121533
 
@@ -121403,7 +121403,7 @@ class nxSplitter extends HTMLElement {
121403
121403
  const isHorizontal = this.#mode === "h";
121404
121404
 
121405
121405
  // ⭐ 마우스 초기 위치 저장 ⭐
121406
- const initialMousePos = isHorizontal ? e.clientX : e.clientY;
121406
+ isHorizontal ? e.clientX : e.clientY;
121407
121407
 
121408
121408
  // 마우스 포인터와 스플리터 시작점 사이의 거리
121409
121409
  isHorizontal
@@ -121484,10 +121484,19 @@ class nxSplitter extends HTMLElement {
121484
121484
  const allChildren = Array.from(parent.children);
121485
121485
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
121486
121486
 
121487
- // ⭐⭐ 부모의 픽셀 크기 ⭐⭐
121488
- const totalContainerSize = isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height;
121487
+ // ⭐⭐ 드래그 바의 최종 위치를 기준으로 dragOffset 계산 ⭐⭐
121488
+ const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
121489
+ const initialSplitterPos = isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top;
121490
+ const dragOffset = finalDragBarPos - initialSplitterPos;
121491
+
121492
+ const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;
121493
+ const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
121494
+
121495
+ const newPrevSize = prevSize + dragOffset;
121496
+ const newNextSize = nextSize - dragOffset;
121497
+
121498
+ const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121489
121499
 
121490
- // ⭐⭐ 모든 스플리터의 총 픽셀 크기 ⭐⭐
121491
121500
  const totalSplitterSize = allChildren.reduce((sum, child) => {
121492
121501
  if (child.tagName.toLowerCase() === 'nx-splitter') {
121493
121502
  return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
@@ -121495,32 +121504,8 @@ class nxSplitter extends HTMLElement {
121495
121504
  return sum;
121496
121505
  }, 0);
121497
121506
 
121498
- // ⭐⭐ Flexbox의 'gap' 크기 계산 (하드코딩된 8px 사용) ⭐⭐
121499
- allChildren.length - 1;
121500
- const totalGapSize = 0;//gapCount * 8;
121501
-
121502
- // ⭐⭐ Flexbox 컨테이너의 '총 유효 공간' (패널들이 차지할 수 있는 공간) 계산 ⭐⭐
121503
- const totalFlexSpace = totalContainerSize - totalSplitterSize - totalGapSize;
121504
-
121505
- // ⭐⭐ 모든 패널의 초기 크기를 미리 저장 ⭐⭐
121506
- const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121507
-
121508
-
121509
- // 드래그로 인한 픽셀 변화량 계산
121510
- //const dragOffset = (isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top)) -
121511
- // (isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top);
121512
-
121513
- // ⭐ 정확한 dragOffset 계산 ⭐
121514
- const finalMousePos = isHorizontal ? e.clientX : e.clientY;
121515
- const dragOffset = finalMousePos - initialMousePos;
121516
-
121517
- const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;
121518
- const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
121519
-
121520
- const newPrevSize = prevSize + dragOffset;
121521
- const newNextSize = nextSize - dragOffset;
121522
-
121523
- console.log(prevSize, newPrevSize);
121507
+ const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
121508
+ const totalFlexSpace = totalContainerSize - totalSplitterSize;
121524
121509
 
121525
121510
  let flexSum = 0;
121526
121511
  allPanels.forEach((panel, index) => {
@@ -121533,16 +121518,12 @@ class nxSplitter extends HTMLElement {
121533
121518
  newSize = initialSizes[index];
121534
121519
  }
121535
121520
 
121536
- //console.log(newSize)
121537
-
121538
- // ⭐⭐ 새로운 FlexBasis 계산 ⭐⭐
121539
121521
  const newFlexBasis = newSize / totalFlexSpace;
121540
121522
  panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
121541
121523
  flexSum += newFlexBasis;
121542
121524
  });
121543
121525
 
121544
- // ⭐⭐ 계산된 합계를 로그로 출력하여 확인 ⭐⭐
121545
- console.log(`newTotalFlexSpace: ${totalFlexSpace}`);
121526
+ console.log(`dragOffset: ${dragOffset}`);
121546
121527
  console.log(`Calculated FlexSum: ${flexSum}`);
121547
121528
  };
121548
121529
 
@@ -121,10 +121,19 @@ class nxSplitter extends HTMLElement {
121
121
  const allChildren = Array.from(parent.children);
122
122
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
123
123
 
124
- // ⭐⭐ 부모의 픽셀 크기 ⭐⭐
125
- const totalContainerSize = isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height;
124
+ // ⭐⭐ 드래그 바의 최종 위치를 기준으로 dragOffset 계산 ⭐⭐
125
+ const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
126
+ const initialSplitterPos = isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top;
127
+ const dragOffset = finalDragBarPos - initialSplitterPos;
128
+
129
+ const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;
130
+ const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
131
+
132
+ const newPrevSize = prevSize + dragOffset;
133
+ const newNextSize = nextSize - dragOffset;
134
+
135
+ const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
126
136
 
127
- // ⭐⭐ 모든 스플리터의 총 픽셀 크기 ⭐⭐
128
137
  const totalSplitterSize = allChildren.reduce((sum, child) => {
129
138
  if (child.tagName.toLowerCase() === 'nx-splitter') {
130
139
  return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
@@ -132,32 +141,8 @@ class nxSplitter extends HTMLElement {
132
141
  return sum;
133
142
  }, 0);
134
143
 
135
- // ⭐⭐ Flexbox의 'gap' 크기 계산 (하드코딩된 8px 사용) ⭐⭐
136
- const gapCount = allChildren.length - 1;
137
- const totalGapSize = 0;//gapCount * 8;
138
-
139
- // ⭐⭐ Flexbox 컨테이너의 '총 유효 공간' (패널들이 차지할 수 있는 공간) 계산 ⭐⭐
140
- const totalFlexSpace = totalContainerSize - totalSplitterSize - totalGapSize;
141
-
142
- // ⭐⭐ 모든 패널의 초기 크기를 미리 저장 ⭐⭐
143
- const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
144
-
145
-
146
- // 드래그로 인한 픽셀 변화량 계산
147
- //const dragOffset = (isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top)) -
148
- // (isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top);
149
-
150
- // ⭐ 정확한 dragOffset 계산 ⭐
151
- const finalMousePos = isHorizontal ? e.clientX : e.clientY;
152
- const dragOffset = finalMousePos - initialMousePos;
153
-
154
- const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;
155
- const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
156
-
157
- const newPrevSize = prevSize + dragOffset;
158
- const newNextSize = nextSize - dragOffset;
159
-
160
- console.log(prevSize, newPrevSize);
144
+ const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
145
+ const totalFlexSpace = totalContainerSize - totalSplitterSize;
161
146
 
162
147
  let flexSum = 0;
163
148
  allPanels.forEach((panel, index) => {
@@ -170,16 +155,12 @@ class nxSplitter extends HTMLElement {
170
155
  newSize = initialSizes[index];
171
156
  }
172
157
 
173
- //console.log(newSize)
174
-
175
- // ⭐⭐ 새로운 FlexBasis 계산 ⭐⭐
176
158
  const newFlexBasis = newSize / totalFlexSpace;
177
159
  panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
178
160
  flexSum += newFlexBasis;
179
161
  });
180
162
 
181
- // ⭐⭐ 계산된 합계를 로그로 출력하여 확인 ⭐⭐
182
- console.log(`newTotalFlexSpace: ${totalFlexSpace}`);
163
+ console.log(`dragOffset: ${dragOffset}`);
183
164
  console.log(`Calculated FlexSum: ${flexSum}`);
184
165
  };
185
166
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1067.0",
4
+ "version": "6.1068.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -121,10 +121,19 @@ class nxSplitter extends HTMLElement {
121
121
  const allChildren = Array.from(parent.children);
122
122
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
123
123
 
124
- // ⭐⭐ 부모의 픽셀 크기 ⭐⭐
125
- const totalContainerSize = isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height;
124
+ // ⭐⭐ 드래그 바의 최종 위치를 기준으로 dragOffset 계산 ⭐⭐
125
+ const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
126
+ const initialSplitterPos = isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top;
127
+ const dragOffset = finalDragBarPos - initialSplitterPos;
128
+
129
+ const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;
130
+ const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
131
+
132
+ const newPrevSize = prevSize + dragOffset;
133
+ const newNextSize = nextSize - dragOffset;
134
+
135
+ const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
126
136
 
127
- // ⭐⭐ 모든 스플리터의 총 픽셀 크기 ⭐⭐
128
137
  const totalSplitterSize = allChildren.reduce((sum, child) => {
129
138
  if (child.tagName.toLowerCase() === 'nx-splitter') {
130
139
  return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
@@ -132,32 +141,8 @@ class nxSplitter extends HTMLElement {
132
141
  return sum;
133
142
  }, 0);
134
143
 
135
- // ⭐⭐ Flexbox의 'gap' 크기 계산 (하드코딩된 8px 사용) ⭐⭐
136
- const gapCount = allChildren.length - 1;
137
- const totalGapSize = 0;//gapCount * 8;
138
-
139
- // ⭐⭐ Flexbox 컨테이너의 '총 유효 공간' (패널들이 차지할 수 있는 공간) 계산 ⭐⭐
140
- const totalFlexSpace = totalContainerSize - totalSplitterSize - totalGapSize;
141
-
142
- // ⭐⭐ 모든 패널의 초기 크기를 미리 저장 ⭐⭐
143
- const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
144
-
145
-
146
- // 드래그로 인한 픽셀 변화량 계산
147
- //const dragOffset = (isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top)) -
148
- // (isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top);
149
-
150
- // ⭐ 정확한 dragOffset 계산 ⭐
151
- const finalMousePos = isHorizontal ? e.clientX : e.clientY;
152
- const dragOffset = finalMousePos - initialMousePos;
153
-
154
- const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;
155
- const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
156
-
157
- const newPrevSize = prevSize + dragOffset;
158
- const newNextSize = nextSize - dragOffset;
159
-
160
- console.log(prevSize, newPrevSize);
144
+ const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
145
+ const totalFlexSpace = totalContainerSize - totalSplitterSize;
161
146
 
162
147
  let flexSum = 0;
163
148
  allPanels.forEach((panel, index) => {
@@ -170,16 +155,12 @@ class nxSplitter extends HTMLElement {
170
155
  newSize = initialSizes[index];
171
156
  }
172
157
 
173
- //console.log(newSize)
174
-
175
- // ⭐⭐ 새로운 FlexBasis 계산 ⭐⭐
176
158
  const newFlexBasis = newSize / totalFlexSpace;
177
159
  panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
178
160
  flexSum += newFlexBasis;
179
161
  });
180
162
 
181
- // ⭐⭐ 계산된 합계를 로그로 출력하여 확인 ⭐⭐
182
- console.log(`newTotalFlexSpace: ${totalFlexSpace}`);
163
+ console.log(`dragOffset: ${dragOffset}`);
183
164
  console.log(`Calculated FlexSum: ${flexSum}`);
184
165
  };
185
166