ninegrid2 6.758.0 → 6.760.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.
@@ -121191,12 +121191,15 @@ class nxSplitter extends HTMLElement {
121191
121191
  if (!prev || !next || !parent) return;
121192
121192
 
121193
121193
  const currentTotal = this.#getSiblingSizeSum();
121194
- console.log(currentTotal);
121194
+
121195
121195
 
121196
121196
  const parentSize = isHorizontal
121197
121197
  ? parent.getBoundingClientRect().width
121198
121198
  : parent.getBoundingClientRect().height;
121199
121199
 
121200
+
121201
+ console.log(currentTotal, parentSize);
121202
+
121200
121203
  // 현재 패널 크기 측정
121201
121204
  const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
121202
121205
  const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
@@ -121205,7 +121208,7 @@ class nxSplitter extends HTMLElement {
121205
121208
  // 현재 비율 계산
121206
121209
  const prevRatio = currentTotal ? prevSize / currentTotal : 0.5;
121207
121210
 
121208
- const newPrevSize = parentSize * prevRatio;
121211
+ const newPrevSize = parentSize * prevSize / currentTotal;
121209
121212
  const newNextSize = (prevSize + nextSize) - newPrevSize;
121210
121213
 
121211
121214
 
@@ -121187,12 +121187,15 @@ class nxSplitter extends HTMLElement {
121187
121187
  if (!prev || !next || !parent) return;
121188
121188
 
121189
121189
  const currentTotal = this.#getSiblingSizeSum();
121190
- console.log(currentTotal);
121190
+
121191
121191
 
121192
121192
  const parentSize = isHorizontal
121193
121193
  ? parent.getBoundingClientRect().width
121194
121194
  : parent.getBoundingClientRect().height;
121195
121195
 
121196
+
121197
+ console.log(currentTotal, parentSize);
121198
+
121196
121199
  // 현재 패널 크기 측정
121197
121200
  const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
121198
121201
  const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
@@ -121201,7 +121204,7 @@ class nxSplitter extends HTMLElement {
121201
121204
  // 현재 비율 계산
121202
121205
  const prevRatio = currentTotal ? prevSize / currentTotal : 0.5;
121203
121206
 
121204
- const newPrevSize = parentSize * prevRatio;
121207
+ const newPrevSize = parentSize * prevSize / currentTotal;
121205
121208
  const newNextSize = (prevSize + nextSize) - newPrevSize;
121206
121209
 
121207
121210
 
@@ -204,12 +204,15 @@ class nxSplitter extends HTMLElement {
204
204
  if (!prev || !next || !parent) return;
205
205
 
206
206
  const currentTotal = this.#getSiblingSizeSum();
207
- console.log(currentTotal);
207
+
208
208
 
209
209
  const parentSize = isHorizontal
210
210
  ? parent.getBoundingClientRect().width
211
211
  : parent.getBoundingClientRect().height;
212
212
 
213
+
214
+ console.log(currentTotal, parentSize);
215
+
213
216
  // 현재 패널 크기 측정
214
217
  const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
215
218
  const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
@@ -220,10 +223,11 @@ class nxSplitter extends HTMLElement {
220
223
  //const prevRatio = parentSize ? prevSize / parentSize : 0.5;
221
224
  //const nextRatio = 1 - prevRatio;
222
225
 
226
+ // currentTotal : parentSize = prevSize : x
223
227
  // 새로운 available 크기
224
228
  const available = parentSize - splitterSize;
225
229
 
226
- const newPrevSize = parentSize * prevRatio;
230
+ const newPrevSize = parentSize * prevSize / currentTotal;
227
231
  const newNextSize = (prevSize + nextSize) - newPrevSize;
228
232
 
229
233
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.758.0",
4
+ "version": "6.760.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -204,12 +204,15 @@ class nxSplitter extends HTMLElement {
204
204
  if (!prev || !next || !parent) return;
205
205
 
206
206
  const currentTotal = this.#getSiblingSizeSum();
207
- console.log(currentTotal);
207
+
208
208
 
209
209
  const parentSize = isHorizontal
210
210
  ? parent.getBoundingClientRect().width
211
211
  : parent.getBoundingClientRect().height;
212
212
 
213
+
214
+ console.log(currentTotal, parentSize);
215
+
213
216
  // 현재 패널 크기 측정
214
217
  const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
215
218
  const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
@@ -220,10 +223,11 @@ class nxSplitter extends HTMLElement {
220
223
  //const prevRatio = parentSize ? prevSize / parentSize : 0.5;
221
224
  //const nextRatio = 1 - prevRatio;
222
225
 
226
+ // currentTotal : parentSize = prevSize : x
223
227
  // 새로운 available 크기
224
228
  const available = parentSize - splitterSize;
225
229
 
226
- const newPrevSize = parentSize * prevRatio;
230
+ const newPrevSize = parentSize * prevSize / currentTotal;
227
231
  const newNextSize = (prevSize + nextSize) - newPrevSize;
228
232
 
229
233