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.
- package/dist/bundle.cjs.js +13 -26
- package/dist/bundle.esm.js +13 -26
- package/dist/nx/nxSplitter.js +13 -26
- package/package.json +1 -1
- package/src/nx/nxSplitter.js +13 -26
package/dist/bundle.cjs.js
CHANGED
|
@@ -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
|
-
|
|
121498
|
-
const
|
|
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
|
|
121501
|
-
const
|
|
121494
|
+
const newPrevSize = prevSize + dragOffset;
|
|
121495
|
+
const newNextSize = nextSize - dragOffset;
|
|
121502
121496
|
|
|
121503
|
-
|
|
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
|
|
121517
|
-
|
|
121518
|
-
|
|
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 =
|
|
121519
|
+
newSize = initialSizes[index];
|
|
121533
121520
|
}
|
|
121534
121521
|
|
|
121535
121522
|
const newFlexBasis = newSize / totalFlexSpace;
|
package/dist/bundle.esm.js
CHANGED
|
@@ -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
|
-
|
|
121494
|
-
const
|
|
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
|
|
121497
|
-
const
|
|
121490
|
+
const newPrevSize = prevSize + dragOffset;
|
|
121491
|
+
const newNextSize = nextSize - dragOffset;
|
|
121498
121492
|
|
|
121499
|
-
|
|
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
|
|
121513
|
-
|
|
121514
|
-
|
|
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 =
|
|
121515
|
+
newSize = initialSizes[index];
|
|
121529
121516
|
}
|
|
121530
121517
|
|
|
121531
121518
|
const newFlexBasis = newSize / totalFlexSpace;
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -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
|
-
|
|
131
|
-
const
|
|
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
|
|
134
|
-
const
|
|
127
|
+
const newPrevSize = prevSize + dragOffset;
|
|
128
|
+
const newNextSize = nextSize - dragOffset;
|
|
135
129
|
|
|
136
|
-
|
|
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
|
|
150
|
-
|
|
151
|
-
|
|
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 =
|
|
152
|
+
newSize = initialSizes[index];
|
|
166
153
|
}
|
|
167
154
|
|
|
168
155
|
const newFlexBasis = newSize / totalFlexSpace;
|
package/package.json
CHANGED
package/src/nx/nxSplitter.js
CHANGED
|
@@ -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
|
-
|
|
131
|
-
const
|
|
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
|
|
134
|
-
const
|
|
127
|
+
const newPrevSize = prevSize + dragOffset;
|
|
128
|
+
const newNextSize = nextSize - dragOffset;
|
|
135
129
|
|
|
136
|
-
|
|
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
|
|
150
|
-
|
|
151
|
-
|
|
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 =
|
|
152
|
+
newSize = initialSizes[index];
|
|
166
153
|
}
|
|
167
154
|
|
|
168
155
|
const newFlexBasis = newSize / totalFlexSpace;
|