ninegrid2 6.1045.0 → 6.1046.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.
@@ -121444,12 +121444,12 @@ class nxSplitter extends HTMLElement {
121444
121444
  if (isHorizontal) {
121445
121445
  dragBar.style.top = "0";
121446
121446
  dragBar.style.left = `${e.clientX - dragBarOffsetParentRect.left}px`;
121447
- dragBar.style.width = `1px`; // ⭐ 1px로 변경
121447
+ dragBar.style.width = "1px"; // ⭐ 1px로 변경
121448
121448
  dragBar.style.height = "100%";
121449
121449
  } else {
121450
121450
  dragBar.style.left = "0";
121451
121451
  dragBar.style.top = `${e.clientY - dragBarOffsetParentRect.top}px`;
121452
- dragBar.style.height = `1px`; // ⭐ 1px로 변경
121452
+ dragBar.style.height = "1px"; // ⭐ 1px로 변경
121453
121453
  dragBar.style.width = "100%";
121454
121454
  }
121455
121455
 
@@ -121486,13 +121486,17 @@ class nxSplitter extends HTMLElement {
121486
121486
  ? parseFloat(dragBar.style.left)
121487
121487
  : parseFloat(dragBar.style.top);
121488
121488
 
121489
- // 패널의 최종 크기 계산
121489
+ // 패널의 최종 크기 계산 (클릭 오프셋 고려)
121490
121490
  const newPrevSize = finalDragBarPosInParent - (isHorizontal
121491
121491
  ? prevRect.left - dragBarOffsetParentRect.left
121492
121492
  : prevRect.top - dragBarOffsetParentRect.top
121493
121493
  ) + clickOffset;
121494
121494
 
121495
- const newNextSize = (isHorizontal ? nextRect.right : nextRect.bottom) - (isHorizontal ? dragBarOffsetParentRect.left : dragBarOffsetParentRect.top) - (newPrevSize + splitterRect.width);
121495
+ // ⭐⭐⭐ 세로 모드(v) 대한 newNextSize 계산 로직 수정 ⭐⭐⭐
121496
+ const newNextSize = (isHorizontal
121497
+ ? nextRect.right - dragBarOffsetParentRect.left
121498
+ : nextRect.bottom - dragBarOffsetParentRect.top
121499
+ ) - finalDragBarPosInParent - (isHorizontal ? splitterRect.width : splitterRect.height);
121496
121500
 
121497
121501
  const totalPanelSize = allPanels.reduce((sum, el) => {
121498
121502
  const size = isHorizontal ? el.getBoundingClientRect().width : el.getBoundingClientRect().height;
@@ -121440,12 +121440,12 @@ class nxSplitter extends HTMLElement {
121440
121440
  if (isHorizontal) {
121441
121441
  dragBar.style.top = "0";
121442
121442
  dragBar.style.left = `${e.clientX - dragBarOffsetParentRect.left}px`;
121443
- dragBar.style.width = `1px`; // ⭐ 1px로 변경
121443
+ dragBar.style.width = "1px"; // ⭐ 1px로 변경
121444
121444
  dragBar.style.height = "100%";
121445
121445
  } else {
121446
121446
  dragBar.style.left = "0";
121447
121447
  dragBar.style.top = `${e.clientY - dragBarOffsetParentRect.top}px`;
121448
- dragBar.style.height = `1px`; // ⭐ 1px로 변경
121448
+ dragBar.style.height = "1px"; // ⭐ 1px로 변경
121449
121449
  dragBar.style.width = "100%";
121450
121450
  }
121451
121451
 
@@ -121482,13 +121482,17 @@ class nxSplitter extends HTMLElement {
121482
121482
  ? parseFloat(dragBar.style.left)
121483
121483
  : parseFloat(dragBar.style.top);
121484
121484
 
121485
- // 패널의 최종 크기 계산
121485
+ // 패널의 최종 크기 계산 (클릭 오프셋 고려)
121486
121486
  const newPrevSize = finalDragBarPosInParent - (isHorizontal
121487
121487
  ? prevRect.left - dragBarOffsetParentRect.left
121488
121488
  : prevRect.top - dragBarOffsetParentRect.top
121489
121489
  ) + clickOffset;
121490
121490
 
121491
- const newNextSize = (isHorizontal ? nextRect.right : nextRect.bottom) - (isHorizontal ? dragBarOffsetParentRect.left : dragBarOffsetParentRect.top) - (newPrevSize + splitterRect.width);
121491
+ // ⭐⭐⭐ 세로 모드(v) 대한 newNextSize 계산 로직 수정 ⭐⭐⭐
121492
+ const newNextSize = (isHorizontal
121493
+ ? nextRect.right - dragBarOffsetParentRect.left
121494
+ : nextRect.bottom - dragBarOffsetParentRect.top
121495
+ ) - finalDragBarPosInParent - (isHorizontal ? splitterRect.width : splitterRect.height);
121492
121496
 
121493
121497
  const totalPanelSize = allPanels.reduce((sum, el) => {
121494
121498
  const size = isHorizontal ? el.getBoundingClientRect().width : el.getBoundingClientRect().height;
@@ -77,12 +77,12 @@ class nxSplitter extends HTMLElement {
77
77
  if (isHorizontal) {
78
78
  dragBar.style.top = "0";
79
79
  dragBar.style.left = `${e.clientX - dragBarOffsetParentRect.left}px`;
80
- dragBar.style.width = `1px`; // ⭐ 1px로 변경
80
+ dragBar.style.width = "1px"; // ⭐ 1px로 변경
81
81
  dragBar.style.height = "100%";
82
82
  } else {
83
83
  dragBar.style.left = "0";
84
84
  dragBar.style.top = `${e.clientY - dragBarOffsetParentRect.top}px`;
85
- dragBar.style.height = `1px`; // ⭐ 1px로 변경
85
+ dragBar.style.height = "1px"; // ⭐ 1px로 변경
86
86
  dragBar.style.width = "100%";
87
87
  }
88
88
 
@@ -119,13 +119,17 @@ class nxSplitter extends HTMLElement {
119
119
  ? parseFloat(dragBar.style.left)
120
120
  : parseFloat(dragBar.style.top);
121
121
 
122
- // 패널의 최종 크기 계산
122
+ // 패널의 최종 크기 계산 (클릭 오프셋 고려)
123
123
  const newPrevSize = finalDragBarPosInParent - (isHorizontal
124
124
  ? prevRect.left - dragBarOffsetParentRect.left
125
125
  : prevRect.top - dragBarOffsetParentRect.top
126
126
  ) + clickOffset;
127
127
 
128
- const newNextSize = (isHorizontal ? nextRect.right : nextRect.bottom) - (isHorizontal ? dragBarOffsetParentRect.left : dragBarOffsetParentRect.top) - (newPrevSize + splitterRect.width);
128
+ // ⭐⭐⭐ 세로 모드(v) 대한 newNextSize 계산 로직 수정 ⭐⭐⭐
129
+ const newNextSize = (isHorizontal
130
+ ? nextRect.right - dragBarOffsetParentRect.left
131
+ : nextRect.bottom - dragBarOffsetParentRect.top
132
+ ) - finalDragBarPosInParent - (isHorizontal ? splitterRect.width : splitterRect.height);
129
133
 
130
134
  const totalPanelSize = allPanels.reduce((sum, el) => {
131
135
  const size = isHorizontal ? el.getBoundingClientRect().width : el.getBoundingClientRect().height;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1045.0",
4
+ "version": "6.1046.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -77,12 +77,12 @@ class nxSplitter extends HTMLElement {
77
77
  if (isHorizontal) {
78
78
  dragBar.style.top = "0";
79
79
  dragBar.style.left = `${e.clientX - dragBarOffsetParentRect.left}px`;
80
- dragBar.style.width = `1px`; // ⭐ 1px로 변경
80
+ dragBar.style.width = "1px"; // ⭐ 1px로 변경
81
81
  dragBar.style.height = "100%";
82
82
  } else {
83
83
  dragBar.style.left = "0";
84
84
  dragBar.style.top = `${e.clientY - dragBarOffsetParentRect.top}px`;
85
- dragBar.style.height = `1px`; // ⭐ 1px로 변경
85
+ dragBar.style.height = "1px"; // ⭐ 1px로 변경
86
86
  dragBar.style.width = "100%";
87
87
  }
88
88
 
@@ -119,13 +119,17 @@ class nxSplitter extends HTMLElement {
119
119
  ? parseFloat(dragBar.style.left)
120
120
  : parseFloat(dragBar.style.top);
121
121
 
122
- // 패널의 최종 크기 계산
122
+ // 패널의 최종 크기 계산 (클릭 오프셋 고려)
123
123
  const newPrevSize = finalDragBarPosInParent - (isHorizontal
124
124
  ? prevRect.left - dragBarOffsetParentRect.left
125
125
  : prevRect.top - dragBarOffsetParentRect.top
126
126
  ) + clickOffset;
127
127
 
128
- const newNextSize = (isHorizontal ? nextRect.right : nextRect.bottom) - (isHorizontal ? dragBarOffsetParentRect.left : dragBarOffsetParentRect.top) - (newPrevSize + splitterRect.width);
128
+ // ⭐⭐⭐ 세로 모드(v) 대한 newNextSize 계산 로직 수정 ⭐⭐⭐
129
+ const newNextSize = (isHorizontal
130
+ ? nextRect.right - dragBarOffsetParentRect.left
131
+ : nextRect.bottom - dragBarOffsetParentRect.top
132
+ ) - finalDragBarPosInParent - (isHorizontal ? splitterRect.width : splitterRect.height);
129
133
 
130
134
  const totalPanelSize = allPanels.reduce((sum, el) => {
131
135
  const size = isHorizontal ? el.getBoundingClientRect().width : el.getBoundingClientRect().height;