ninegrid2 6.1084.0 → 6.1086.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 +21 -2
- package/dist/bundle.esm.js +21 -2
- package/dist/nx/nxSplitter.js +21 -2
- package/package.json +1 -1
- package/src/nx/nxSplitter.js +21 -2
package/dist/bundle.cjs.js
CHANGED
|
@@ -121485,14 +121485,33 @@ 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
|
+
// ⭐⭐ gap 크기 계산 ⭐⭐
|
|
121489
|
+
const style = window.getComputedStyle(parent);
|
|
121490
|
+
const gapValue = isHorizontal ? style.getPropertyValue('column-gap') : style.getPropertyValue('row-gap');
|
|
121491
|
+
const gapSize = parseFloat(gapValue) || 0;
|
|
121492
|
+
const gapCount = allChildren.length > 1 ? allChildren.length - 1 : 0;
|
|
121493
|
+
const totalGapSize = gapCount * gapSize;
|
|
121494
|
+
|
|
121495
|
+
console.log(totalGapSize);
|
|
121496
|
+
|
|
121488
121497
|
const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
|
|
121489
121498
|
const dragOffset = finalDragBarPos - initialSplitterPosInParent;
|
|
121490
121499
|
|
|
121491
121500
|
const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;// - clickOffset;
|
|
121492
121501
|
const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
|
|
121493
121502
|
|
|
121494
|
-
|
|
121495
|
-
|
|
121503
|
+
let newPrevSize = prevSize + dragOffset;
|
|
121504
|
+
let newNextSize = nextSize - dragOffset;
|
|
121505
|
+
|
|
121506
|
+
// 패널 크기가 음수가 되지 않도록 제한하고, 다른 패널에 차이를 보정
|
|
121507
|
+
if (newPrevSize < 0) {
|
|
121508
|
+
newNextSize += newPrevSize;
|
|
121509
|
+
newPrevSize = 0;
|
|
121510
|
+
}
|
|
121511
|
+
if (newNextSize < 0) {
|
|
121512
|
+
newPrevSize += newNextSize;
|
|
121513
|
+
newNextSize = 0;
|
|
121514
|
+
}
|
|
121496
121515
|
|
|
121497
121516
|
console.log(prevSize, nextSize, newPrevSize, newNextSize);
|
|
121498
121517
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121481,14 +121481,33 @@ 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
|
+
// ⭐⭐ gap 크기 계산 ⭐⭐
|
|
121485
|
+
const style = window.getComputedStyle(parent);
|
|
121486
|
+
const gapValue = isHorizontal ? style.getPropertyValue('column-gap') : style.getPropertyValue('row-gap');
|
|
121487
|
+
const gapSize = parseFloat(gapValue) || 0;
|
|
121488
|
+
const gapCount = allChildren.length > 1 ? allChildren.length - 1 : 0;
|
|
121489
|
+
const totalGapSize = gapCount * gapSize;
|
|
121490
|
+
|
|
121491
|
+
console.log(totalGapSize);
|
|
121492
|
+
|
|
121484
121493
|
const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
|
|
121485
121494
|
const dragOffset = finalDragBarPos - initialSplitterPosInParent;
|
|
121486
121495
|
|
|
121487
121496
|
const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;// - clickOffset;
|
|
121488
121497
|
const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
|
|
121489
121498
|
|
|
121490
|
-
|
|
121491
|
-
|
|
121499
|
+
let newPrevSize = prevSize + dragOffset;
|
|
121500
|
+
let newNextSize = nextSize - dragOffset;
|
|
121501
|
+
|
|
121502
|
+
// 패널 크기가 음수가 되지 않도록 제한하고, 다른 패널에 차이를 보정
|
|
121503
|
+
if (newPrevSize < 0) {
|
|
121504
|
+
newNextSize += newPrevSize;
|
|
121505
|
+
newPrevSize = 0;
|
|
121506
|
+
}
|
|
121507
|
+
if (newNextSize < 0) {
|
|
121508
|
+
newPrevSize += newNextSize;
|
|
121509
|
+
newNextSize = 0;
|
|
121510
|
+
}
|
|
121492
121511
|
|
|
121493
121512
|
console.log(prevSize, nextSize, newPrevSize, newNextSize);
|
|
121494
121513
|
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -118,14 +118,33 @@ 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
|
+
// ⭐⭐ gap 크기 계산 ⭐⭐
|
|
122
|
+
const style = window.getComputedStyle(parent);
|
|
123
|
+
const gapValue = isHorizontal ? style.getPropertyValue('column-gap') : style.getPropertyValue('row-gap');
|
|
124
|
+
const gapSize = parseFloat(gapValue) || 0;
|
|
125
|
+
const gapCount = allChildren.length > 1 ? allChildren.length - 1 : 0;
|
|
126
|
+
const totalGapSize = gapCount * gapSize;
|
|
127
|
+
|
|
128
|
+
console.log(totalGapSize);
|
|
129
|
+
|
|
121
130
|
const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
|
|
122
131
|
const dragOffset = finalDragBarPos - initialSplitterPosInParent;
|
|
123
132
|
|
|
124
133
|
const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;// - clickOffset;
|
|
125
134
|
const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
|
|
126
135
|
|
|
127
|
-
|
|
128
|
-
|
|
136
|
+
let newPrevSize = prevSize + dragOffset;
|
|
137
|
+
let newNextSize = nextSize - dragOffset;
|
|
138
|
+
|
|
139
|
+
// 패널 크기가 음수가 되지 않도록 제한하고, 다른 패널에 차이를 보정
|
|
140
|
+
if (newPrevSize < 0) {
|
|
141
|
+
newNextSize += newPrevSize;
|
|
142
|
+
newPrevSize = 0;
|
|
143
|
+
}
|
|
144
|
+
if (newNextSize < 0) {
|
|
145
|
+
newPrevSize += newNextSize;
|
|
146
|
+
newNextSize = 0;
|
|
147
|
+
}
|
|
129
148
|
|
|
130
149
|
console.log(prevSize, nextSize, newPrevSize, newNextSize);
|
|
131
150
|
|
package/package.json
CHANGED
package/src/nx/nxSplitter.js
CHANGED
|
@@ -118,14 +118,33 @@ 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
|
+
// ⭐⭐ gap 크기 계산 ⭐⭐
|
|
122
|
+
const style = window.getComputedStyle(parent);
|
|
123
|
+
const gapValue = isHorizontal ? style.getPropertyValue('column-gap') : style.getPropertyValue('row-gap');
|
|
124
|
+
const gapSize = parseFloat(gapValue) || 0;
|
|
125
|
+
const gapCount = allChildren.length > 1 ? allChildren.length - 1 : 0;
|
|
126
|
+
const totalGapSize = gapCount * gapSize;
|
|
127
|
+
|
|
128
|
+
console.log(totalGapSize);
|
|
129
|
+
|
|
121
130
|
const finalDragBarPos = isHorizontal ? parseFloat(dragBar.style.left) : parseFloat(dragBar.style.top);
|
|
122
131
|
const dragOffset = finalDragBarPos - initialSplitterPosInParent;
|
|
123
132
|
|
|
124
133
|
const prevSize = isHorizontal ? prev.getBoundingClientRect().width : prev.getBoundingClientRect().height;// - clickOffset;
|
|
125
134
|
const nextSize = isHorizontal ? next.getBoundingClientRect().width : next.getBoundingClientRect().height;
|
|
126
135
|
|
|
127
|
-
|
|
128
|
-
|
|
136
|
+
let newPrevSize = prevSize + dragOffset;
|
|
137
|
+
let newNextSize = nextSize - dragOffset;
|
|
138
|
+
|
|
139
|
+
// 패널 크기가 음수가 되지 않도록 제한하고, 다른 패널에 차이를 보정
|
|
140
|
+
if (newPrevSize < 0) {
|
|
141
|
+
newNextSize += newPrevSize;
|
|
142
|
+
newPrevSize = 0;
|
|
143
|
+
}
|
|
144
|
+
if (newNextSize < 0) {
|
|
145
|
+
newPrevSize += newNextSize;
|
|
146
|
+
newNextSize = 0;
|
|
147
|
+
}
|
|
129
148
|
|
|
130
149
|
console.log(prevSize, nextSize, newPrevSize, newNextSize);
|
|
131
150
|
|