ninegrid2 6.1081.0 → 6.1084.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.
@@ -121485,37 +121485,24 @@ class nxSplitter extends HTMLElement {
121485
121485
  const allChildren = Array.from(parent.children);
121486
121486
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
121487
121487
 
121488
- // 모든 패널의 초기 크기를 미리 저장
121489
- const initialPanelSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121490
-
121491
- // 스플리터의 초기 위치 (부모 기준)
121492
- const initialSplitterPos = isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top;
121493
-
121494
- // 드래그 바의 최종 위치 (부모 기준)
121495
121488
  const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
121489
+ const dragOffset = finalDragBarPos - initialSplitterPosInParent;
121496
121490
 
121497
- // 정확한 dragOffset 계산: 최종 위치와 초기 위치의 차이
121498
- const dragOffset = finalDragBarPos - initialSplitterPos;
121491
+ const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;// - clickOffset;
121492
+ const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
121499
121493
 
121500
- const prevSize = initialPanelSizes[allPanels.indexOf(prev)];
121501
- const nextSize = initialPanelSizes[allPanels.indexOf(next)];
121494
+ const newPrevSize = prevSize + dragOffset;
121495
+ const newNextSize = nextSize - dragOffset;
121502
121496
 
121503
- let newPrevSize = prevSize + dragOffset;
121504
- let newNextSize = nextSize - dragOffset;
121497
+ console.log(prevSize, nextSize, newPrevSize, newNextSize);
121505
121498
 
121506
- // 패널 크기가 음수가 되지 않도록 제한하고, 다른 패널에 차이를 보정
121507
- if (newPrevSize < 0) {
121508
- newNextSize += newPrevSize;
121509
- newPrevSize = 0;
121510
- }
121511
- if (newNextSize < 0) {
121512
- newPrevSize += newNextSize;
121513
- newNextSize = 0;
121514
- }
121499
+ const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121515
121500
 
121516
- const allSplitters = allChildren.filter(el => el.tagName.toLowerCase() === 'nx-splitter');
121517
- const totalSplitterSize = allSplitters.reduce((sum, splitter) => {
121518
- return sum + (isHorizontal ? splitter.getBoundingClientRect().width : splitter.getBoundingClientRect().height);
121501
+ const totalSplitterSize = allChildren.reduce((sum, child) => {
121502
+ if (child.tagName.toLowerCase() === 'nx-splitter') {
121503
+ return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
121504
+ }
121505
+ return sum;
121519
121506
  }, 0);
121520
121507
 
121521
121508
  const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
@@ -121529,7 +121516,7 @@ class nxSplitter extends HTMLElement {
121529
121516
  } else if (panel === next) {
121530
121517
  newSize = newNextSize;
121531
121518
  } else {
121532
- newSize = initialPanelSizes[index];
121519
+ newSize = initialSizes[index];
121533
121520
  }
121534
121521
 
121535
121522
  const newFlexBasis = newSize / totalFlexSpace;
@@ -121481,37 +121481,24 @@ class nxSplitter extends HTMLElement {
121481
121481
  const allChildren = Array.from(parent.children);
121482
121482
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
121483
121483
 
121484
- // 모든 패널의 초기 크기를 미리 저장
121485
- const initialPanelSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121486
-
121487
- // 스플리터의 초기 위치 (부모 기준)
121488
- const initialSplitterPos = isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top;
121489
-
121490
- // 드래그 바의 최종 위치 (부모 기준)
121491
121484
  const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
121485
+ const dragOffset = finalDragBarPos - initialSplitterPosInParent;
121492
121486
 
121493
- // 정확한 dragOffset 계산: 최종 위치와 초기 위치의 차이
121494
- const dragOffset = finalDragBarPos - initialSplitterPos;
121487
+ const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;// - clickOffset;
121488
+ const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
121495
121489
 
121496
- const prevSize = initialPanelSizes[allPanels.indexOf(prev)];
121497
- const nextSize = initialPanelSizes[allPanels.indexOf(next)];
121490
+ const newPrevSize = prevSize + dragOffset;
121491
+ const newNextSize = nextSize - dragOffset;
121498
121492
 
121499
- let newPrevSize = prevSize + dragOffset;
121500
- let newNextSize = nextSize - dragOffset;
121493
+ console.log(prevSize, nextSize, newPrevSize, newNextSize);
121501
121494
 
121502
- // 패널 크기가 음수가 되지 않도록 제한하고, 다른 패널에 차이를 보정
121503
- if (newPrevSize < 0) {
121504
- newNextSize += newPrevSize;
121505
- newPrevSize = 0;
121506
- }
121507
- if (newNextSize < 0) {
121508
- newPrevSize += newNextSize;
121509
- newNextSize = 0;
121510
- }
121495
+ const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
121511
121496
 
121512
- const allSplitters = allChildren.filter(el => el.tagName.toLowerCase() === 'nx-splitter');
121513
- const totalSplitterSize = allSplitters.reduce((sum, splitter) => {
121514
- return sum + (isHorizontal ? splitter.getBoundingClientRect().width : splitter.getBoundingClientRect().height);
121497
+ const totalSplitterSize = allChildren.reduce((sum, child) => {
121498
+ if (child.tagName.toLowerCase() === 'nx-splitter') {
121499
+ return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
121500
+ }
121501
+ return sum;
121515
121502
  }, 0);
121516
121503
 
121517
121504
  const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
@@ -121525,7 +121512,7 @@ class nxSplitter extends HTMLElement {
121525
121512
  } else if (panel === next) {
121526
121513
  newSize = newNextSize;
121527
121514
  } else {
121528
- newSize = initialPanelSizes[index];
121515
+ newSize = initialSizes[index];
121529
121516
  }
121530
121517
 
121531
121518
  const newFlexBasis = newSize / totalFlexSpace;
@@ -118,37 +118,24 @@ class nxSplitter extends HTMLElement {
118
118
  const allChildren = Array.from(parent.children);
119
119
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
120
120
 
121
- // 모든 패널의 초기 크기를 미리 저장
122
- const initialPanelSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
123
-
124
- // 스플리터의 초기 위치 (부모 기준)
125
- const initialSplitterPos = isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top;
126
-
127
- // 드래그 바의 최종 위치 (부모 기준)
128
121
  const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
122
+ const dragOffset = finalDragBarPos - initialSplitterPosInParent;
129
123
 
130
- // 정확한 dragOffset 계산: 최종 위치와 초기 위치의 차이
131
- const dragOffset = finalDragBarPos - initialSplitterPos;
124
+ const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;// - clickOffset;
125
+ const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
132
126
 
133
- const prevSize = initialPanelSizes[allPanels.indexOf(prev)];
134
- const nextSize = initialPanelSizes[allPanels.indexOf(next)];
127
+ const newPrevSize = prevSize + dragOffset;
128
+ const newNextSize = nextSize - dragOffset;
135
129
 
136
- let newPrevSize = prevSize + dragOffset;
137
- let newNextSize = nextSize - dragOffset;
130
+ console.log(prevSize, nextSize, newPrevSize, newNextSize);
138
131
 
139
- // 패널 크기가 음수가 되지 않도록 제한하고, 다른 패널에 차이를 보정
140
- if (newPrevSize < 0) {
141
- newNextSize += newPrevSize;
142
- newPrevSize = 0;
143
- }
144
- if (newNextSize < 0) {
145
- newPrevSize += newNextSize;
146
- newNextSize = 0;
147
- }
132
+ const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
148
133
 
149
- const allSplitters = allChildren.filter(el => el.tagName.toLowerCase() === 'nx-splitter');
150
- const totalSplitterSize = allSplitters.reduce((sum, splitter) => {
151
- return sum + (isHorizontal ? splitter.getBoundingClientRect().width : splitter.getBoundingClientRect().height);
134
+ const totalSplitterSize = allChildren.reduce((sum, child) => {
135
+ if (child.tagName.toLowerCase() === 'nx-splitter') {
136
+ return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
137
+ }
138
+ return sum;
152
139
  }, 0);
153
140
 
154
141
  const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
@@ -162,7 +149,7 @@ class nxSplitter extends HTMLElement {
162
149
  } else if (panel === next) {
163
150
  newSize = newNextSize;
164
151
  } else {
165
- newSize = initialPanelSizes[index];
152
+ newSize = initialSizes[index];
166
153
  }
167
154
 
168
155
  const newFlexBasis = newSize / totalFlexSpace;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1081.0",
4
+ "version": "6.1084.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -118,37 +118,24 @@ class nxSplitter extends HTMLElement {
118
118
  const allChildren = Array.from(parent.children);
119
119
  const allPanels = allChildren.filter(el => el.tagName.toLowerCase() !== 'nx-splitter');
120
120
 
121
- // 모든 패널의 초기 크기를 미리 저장
122
- const initialPanelSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
123
-
124
- // 스플리터의 초기 위치 (부모 기준)
125
- const initialSplitterPos = isHorizontal ? this.getBoundingClientRect().left - parent.getBoundingClientRect().left : this.getBoundingClientRect().top - parent.getBoundingClientRect().top;
126
-
127
- // 드래그 바의 최종 위치 (부모 기준)
128
121
  const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
122
+ const dragOffset = finalDragBarPos - initialSplitterPosInParent;
129
123
 
130
- // 정확한 dragOffset 계산: 최종 위치와 초기 위치의 차이
131
- const dragOffset = finalDragBarPos - initialSplitterPos;
124
+ const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;// - clickOffset;
125
+ const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
132
126
 
133
- const prevSize = initialPanelSizes[allPanels.indexOf(prev)];
134
- const nextSize = initialPanelSizes[allPanels.indexOf(next)];
127
+ const newPrevSize = prevSize + dragOffset;
128
+ const newNextSize = nextSize - dragOffset;
135
129
 
136
- let newPrevSize = prevSize + dragOffset;
137
- let newNextSize = nextSize - dragOffset;
130
+ console.log(prevSize, nextSize, newPrevSize, newNextSize);
138
131
 
139
- // 패널 크기가 음수가 되지 않도록 제한하고, 다른 패널에 차이를 보정
140
- if (newPrevSize < 0) {
141
- newNextSize += newPrevSize;
142
- newPrevSize = 0;
143
- }
144
- if (newNextSize < 0) {
145
- newPrevSize += newNextSize;
146
- newNextSize = 0;
147
- }
132
+ const initialSizes = allPanels.map(panel => isHorizontal ? panel.getBoundingClientRect().width : panel.getBoundingClientRect().height);
148
133
 
149
- const allSplitters = allChildren.filter(el => el.tagName.toLowerCase() === 'nx-splitter');
150
- const totalSplitterSize = allSplitters.reduce((sum, splitter) => {
151
- return sum + (isHorizontal ? splitter.getBoundingClientRect().width : splitter.getBoundingClientRect().height);
134
+ const totalSplitterSize = allChildren.reduce((sum, child) => {
135
+ if (child.tagName.toLowerCase() === 'nx-splitter') {
136
+ return sum + (isHorizontal ? child.getBoundingClientRect().width : child.getBoundingClientRect().height);
137
+ }
138
+ return sum;
152
139
  }, 0);
153
140
 
154
141
  const totalContainerSize = (isHorizontal ? parent.getBoundingClientRect().width : parent.getBoundingClientRect().height);
@@ -162,7 +149,7 @@ class nxSplitter extends HTMLElement {
162
149
  } else if (panel === next) {
163
150
  newSize = newNextSize;
164
151
  } else {
165
- newSize = initialPanelSizes[index];
152
+ newSize = initialSizes[index];
166
153
  }
167
154
 
168
155
  const newFlexBasis = newSize / totalFlexSpace;