ninegrid2 6.1054.0 → 6.1055.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.
@@ -121484,7 +121484,24 @@ class nxSplitter extends HTMLElement {
121484
121484
 
121485
121485
  const allChildren = Array.from(parent.children);
121486
121486
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
121487
- const allSplitters = allChildren.filter(el => el.tagName.toLowerCase() === 'nx-splitter');
121487
+
121488
+ // ⭐⭐ 부모의 총 픽셀 크기 ⭐⭐
121489
+ const totalContainerSize = isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height;
121490
+
121491
+ // ⭐⭐ 모든 스플리터의 총 픽셀 크기 ⭐⭐
121492
+ const totalSplitterSize = allChildren.reduce((sum, child) => {
121493
+ if (child.tagName.toLowerCase() === 'nx-splitter') {
121494
+ return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
121495
+ }
121496
+ return sum;
121497
+ }, 0);
121498
+
121499
+ // ⭐⭐ Flexbox의 'gap' 크기 계산 (하드코딩된 8px 사용) ⭐⭐
121500
+ const gapCount = allChildren.length - 1;
121501
+ const totalGapSize = gapCount * 8;
121502
+
121503
+ // ⭐⭐ Flexbox 컨테이너의 '총 유효 공간' (패널들이 차지할 수 있는 공간) 계산 ⭐⭐
121504
+ const totalFlexSpace = totalContainerSize - totalSplitterSize - totalGapSize;
121488
121505
 
121489
121506
  // 드래그로 인한 픽셀 변화량 계산
121490
121507
  const dragOffset = (isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top)) -
@@ -121496,22 +121513,8 @@ class nxSplitter extends HTMLElement {
121496
121513
  const newPrevSize = prevSize + dragOffset;
121497
121514
  const newNextSize = nextSize - dragOffset;
121498
121515
 
121499
- // 모든 패널의 총 픽셀 크기 합계 계산
121500
- allPanels.reduce((sum, panel) => {
121501
- return sum + (isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121502
- }, 0);
121503
-
121504
- // 전체 스플리터의 총 픽셀 크기 합계 계산
121505
- const totalSplitterSize = allSplitters.reduce((sum, splitter) => {
121506
- return sum + (isHorizontal ? splitter.getBoundingClientRect().width : splitter.getBoundingClientRect().height);
121507
- }, 0);
121508
-
121509
- // Flexbox 컨테이너의 전체 유효 공간 계산
121510
- const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
121511
- const totalFlexSpace = totalContainerSize - totalSplitterSize;
121512
-
121513
121516
  let flexSum = 0;
121514
- allPanels.forEach((panel, index) => {
121517
+ allPanels.forEach(panel => {
121515
121518
  let newSize;
121516
121519
  if (panel === prev) {
121517
121520
  newSize = newPrevSize;
@@ -121521,12 +121524,13 @@ class nxSplitter extends HTMLElement {
121521
121524
  newSize = isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height;
121522
121525
  }
121523
121526
 
121524
- // 새로운 FlexBasis 계산
121527
+ // ⭐⭐ 새로운 FlexBasis 계산 ⭐⭐
121525
121528
  const newFlexBasis = newSize / totalFlexSpace;
121526
121529
  panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
121527
121530
  flexSum += newFlexBasis;
121528
121531
  });
121529
121532
 
121533
+ // ⭐⭐ 계산된 합계를 로그로 출력하여 확인 ⭐⭐
121530
121534
  console.log(`newTotalFlexSpace: ${totalFlexSpace}`);
121531
121535
  console.log(`Calculated FlexSum: ${flexSum}`);
121532
121536
  };
@@ -121480,7 +121480,24 @@ class nxSplitter extends HTMLElement {
121480
121480
 
121481
121481
  const allChildren = Array.from(parent.children);
121482
121482
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
121483
- const allSplitters = allChildren.filter(el => el.tagName.toLowerCase() === 'nx-splitter');
121483
+
121484
+ // ⭐⭐ 부모의 총 픽셀 크기 ⭐⭐
121485
+ const totalContainerSize = isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height;
121486
+
121487
+ // ⭐⭐ 모든 스플리터의 총 픽셀 크기 ⭐⭐
121488
+ const totalSplitterSize = allChildren.reduce((sum, child) => {
121489
+ if (child.tagName.toLowerCase() === 'nx-splitter') {
121490
+ return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
121491
+ }
121492
+ return sum;
121493
+ }, 0);
121494
+
121495
+ // ⭐⭐ Flexbox의 'gap' 크기 계산 (하드코딩된 8px 사용) ⭐⭐
121496
+ const gapCount = allChildren.length - 1;
121497
+ const totalGapSize = gapCount * 8;
121498
+
121499
+ // ⭐⭐ Flexbox 컨테이너의 '총 유효 공간' (패널들이 차지할 수 있는 공간) 계산 ⭐⭐
121500
+ const totalFlexSpace = totalContainerSize - totalSplitterSize - totalGapSize;
121484
121501
 
121485
121502
  // 드래그로 인한 픽셀 변화량 계산
121486
121503
  const dragOffset = (isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top)) -
@@ -121492,22 +121509,8 @@ class nxSplitter extends HTMLElement {
121492
121509
  const newPrevSize = prevSize + dragOffset;
121493
121510
  const newNextSize = nextSize - dragOffset;
121494
121511
 
121495
- // 모든 패널의 총 픽셀 크기 합계 계산
121496
- allPanels.reduce((sum, panel) => {
121497
- return sum + (isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121498
- }, 0);
121499
-
121500
- // 전체 스플리터의 총 픽셀 크기 합계 계산
121501
- const totalSplitterSize = allSplitters.reduce((sum, splitter) => {
121502
- return sum + (isHorizontal ? splitter.getBoundingClientRect().width : splitter.getBoundingClientRect().height);
121503
- }, 0);
121504
-
121505
- // Flexbox 컨테이너의 전체 유효 공간 계산
121506
- const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
121507
- const totalFlexSpace = totalContainerSize - totalSplitterSize;
121508
-
121509
121512
  let flexSum = 0;
121510
- allPanels.forEach((panel, index) => {
121513
+ allPanels.forEach(panel => {
121511
121514
  let newSize;
121512
121515
  if (panel === prev) {
121513
121516
  newSize = newPrevSize;
@@ -121517,12 +121520,13 @@ class nxSplitter extends HTMLElement {
121517
121520
  newSize = isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height;
121518
121521
  }
121519
121522
 
121520
- // 새로운 FlexBasis 계산
121523
+ // ⭐⭐ 새로운 FlexBasis 계산 ⭐⭐
121521
121524
  const newFlexBasis = newSize / totalFlexSpace;
121522
121525
  panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
121523
121526
  flexSum += newFlexBasis;
121524
121527
  });
121525
121528
 
121529
+ // ⭐⭐ 계산된 합계를 로그로 출력하여 확인 ⭐⭐
121526
121530
  console.log(`newTotalFlexSpace: ${totalFlexSpace}`);
121527
121531
  console.log(`Calculated FlexSum: ${flexSum}`);
121528
121532
  };
@@ -117,7 +117,24 @@ class nxSplitter extends HTMLElement {
117
117
 
118
118
  const allChildren = Array.from(parent.children);
119
119
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
120
- const allSplitters = allChildren.filter(el => el.tagName.toLowerCase() === 'nx-splitter');
120
+
121
+ // ⭐⭐ 부모의 총 픽셀 크기 ⭐⭐
122
+ const totalContainerSize = isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height;
123
+
124
+ // ⭐⭐ 모든 스플리터의 총 픽셀 크기 ⭐⭐
125
+ const totalSplitterSize = allChildren.reduce((sum, child) => {
126
+ if (child.tagName.toLowerCase() === 'nx-splitter') {
127
+ return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
128
+ }
129
+ return sum;
130
+ }, 0);
131
+
132
+ // ⭐⭐ Flexbox의 'gap' 크기 계산 (하드코딩된 8px 사용) ⭐⭐
133
+ const gapCount = allChildren.length - 1;
134
+ const totalGapSize = gapCount * 8;
135
+
136
+ // ⭐⭐ Flexbox 컨테이너의 '총 유효 공간' (패널들이 차지할 수 있는 공간) 계산 ⭐⭐
137
+ const totalFlexSpace = totalContainerSize - totalSplitterSize - totalGapSize;
121
138
 
122
139
  // 드래그로 인한 픽셀 변화량 계산
123
140
  const dragOffset = (isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top)) -
@@ -129,22 +146,8 @@ class nxSplitter extends HTMLElement {
129
146
  const newPrevSize = prevSize + dragOffset;
130
147
  const newNextSize = nextSize - dragOffset;
131
148
 
132
- // 모든 패널의 총 픽셀 크기 합계 계산
133
- const totalPanelSize = allPanels.reduce((sum, panel) => {
134
- return sum + (isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
135
- }, 0);
136
-
137
- // 전체 스플리터의 총 픽셀 크기 합계 계산
138
- const totalSplitterSize = allSplitters.reduce((sum, splitter) => {
139
- return sum + (isHorizontal ? splitter.getBoundingClientRect().width : splitter.getBoundingClientRect().height);
140
- }, 0);
141
-
142
- // Flexbox 컨테이너의 전체 유효 공간 계산
143
- const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
144
- const totalFlexSpace = totalContainerSize - totalSplitterSize;
145
-
146
149
  let flexSum = 0;
147
- allPanels.forEach((panel, index) => {
150
+ allPanels.forEach(panel => {
148
151
  let newSize;
149
152
  if (panel === prev) {
150
153
  newSize = newPrevSize;
@@ -154,12 +157,13 @@ class nxSplitter extends HTMLElement {
154
157
  newSize = isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height;
155
158
  }
156
159
 
157
- // 새로운 FlexBasis 계산
160
+ // ⭐⭐ 새로운 FlexBasis 계산 ⭐⭐
158
161
  const newFlexBasis = newSize / totalFlexSpace;
159
162
  panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
160
163
  flexSum += newFlexBasis;
161
164
  });
162
165
 
166
+ // ⭐⭐ 계산된 합계를 로그로 출력하여 확인 ⭐⭐
163
167
  console.log(`newTotalFlexSpace: ${totalFlexSpace}`);
164
168
  console.log(`Calculated FlexSum: ${flexSum}`);
165
169
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1054.0",
4
+ "version": "6.1055.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -117,7 +117,24 @@ class nxSplitter extends HTMLElement {
117
117
 
118
118
  const allChildren = Array.from(parent.children);
119
119
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
120
- const allSplitters = allChildren.filter(el => el.tagName.toLowerCase() === 'nx-splitter');
120
+
121
+ // ⭐⭐ 부모의 총 픽셀 크기 ⭐⭐
122
+ const totalContainerSize = isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height;
123
+
124
+ // ⭐⭐ 모든 스플리터의 총 픽셀 크기 ⭐⭐
125
+ const totalSplitterSize = allChildren.reduce((sum, child) => {
126
+ if (child.tagName.toLowerCase() === 'nx-splitter') {
127
+ return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
128
+ }
129
+ return sum;
130
+ }, 0);
131
+
132
+ // ⭐⭐ Flexbox의 'gap' 크기 계산 (하드코딩된 8px 사용) ⭐⭐
133
+ const gapCount = allChildren.length - 1;
134
+ const totalGapSize = gapCount * 8;
135
+
136
+ // ⭐⭐ Flexbox 컨테이너의 '총 유효 공간' (패널들이 차지할 수 있는 공간) 계산 ⭐⭐
137
+ const totalFlexSpace = totalContainerSize - totalSplitterSize - totalGapSize;
121
138
 
122
139
  // 드래그로 인한 픽셀 변화량 계산
123
140
  const dragOffset = (isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top)) -
@@ -129,22 +146,8 @@ class nxSplitter extends HTMLElement {
129
146
  const newPrevSize = prevSize + dragOffset;
130
147
  const newNextSize = nextSize - dragOffset;
131
148
 
132
- // 모든 패널의 총 픽셀 크기 합계 계산
133
- const totalPanelSize = allPanels.reduce((sum, panel) => {
134
- return sum + (isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
135
- }, 0);
136
-
137
- // 전체 스플리터의 총 픽셀 크기 합계 계산
138
- const totalSplitterSize = allSplitters.reduce((sum, splitter) => {
139
- return sum + (isHorizontal ? splitter.getBoundingClientRect().width : splitter.getBoundingClientRect().height);
140
- }, 0);
141
-
142
- // Flexbox 컨테이너의 전체 유효 공간 계산
143
- const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
144
- const totalFlexSpace = totalContainerSize - totalSplitterSize;
145
-
146
149
  let flexSum = 0;
147
- allPanels.forEach((panel, index) => {
150
+ allPanels.forEach(panel => {
148
151
  let newSize;
149
152
  if (panel === prev) {
150
153
  newSize = newPrevSize;
@@ -154,12 +157,13 @@ class nxSplitter extends HTMLElement {
154
157
  newSize = isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height;
155
158
  }
156
159
 
157
- // 새로운 FlexBasis 계산
160
+ // ⭐⭐ 새로운 FlexBasis 계산 ⭐⭐
158
161
  const newFlexBasis = newSize / totalFlexSpace;
159
162
  panel.style.flex = `${newFlexBasis} ${newFlexBasis} 0`;
160
163
  flexSum += newFlexBasis;
161
164
  });
162
165
 
166
+ // ⭐⭐ 계산된 합계를 로그로 출력하여 확인 ⭐⭐
163
167
  console.log(`newTotalFlexSpace: ${totalFlexSpace}`);
164
168
  console.log(`Calculated FlexSum: ${flexSum}`);
165
169
  };