ninegrid2 6.747.0 → 6.749.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 +11 -11
- package/dist/bundle.esm.js +11 -11
- package/dist/nx/nxSplitter.js +11 -11
- package/package.json +1 -1
- package/src/nx/nxSplitter.js +11 -11
package/dist/bundle.cjs.js
CHANGED
|
@@ -121170,30 +121170,29 @@ class nxSplitter extends HTMLElement {
|
|
|
121170
121170
|
#prepareLayout = () => {
|
|
121171
121171
|
const isHorizontal = this.#mode === "h";
|
|
121172
121172
|
|
|
121173
|
-
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
121174
121173
|
const prev = this.previousElementSibling;
|
|
121175
121174
|
const next = this.nextElementSibling;
|
|
121176
121175
|
const parent = this.parentElement;
|
|
121177
|
-
|
|
121178
121176
|
if (!prev || !next || !parent) return;
|
|
121179
121177
|
|
|
121180
|
-
const
|
|
121181
|
-
|
|
121178
|
+
const parentSize = isHorizontal
|
|
121179
|
+
? parent.getBoundingClientRect().width
|
|
121180
|
+
: parent.getBoundingClientRect().height;
|
|
121182
121181
|
|
|
121183
|
-
|
|
121182
|
+
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
121183
|
+
const splitterRatio = splitterSize / parentSize;
|
|
121184
|
+
|
|
121185
|
+
// 💡 prev/next 크기도 현재 값 기준으로 비율 계산
|
|
121184
121186
|
const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
|
|
121185
121187
|
const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
|
|
121188
|
+
const panelSum = prevSize + nextSize;
|
|
121186
121189
|
|
|
121187
|
-
const
|
|
121188
|
-
|
|
121189
|
-
// ➤ 현재 비율 계산
|
|
121190
|
-
const prevRatio = totalPanelSize > 0 ? prevSize / totalPanelSize : 0.5;
|
|
121190
|
+
const prevRatio = panelSum > 0 ? prevSize / panelSum : 0.5;
|
|
121191
121191
|
const nextRatio = 1 - prevRatio;
|
|
121192
|
-
const splitterRatio = splitterSize / totalSize;
|
|
121193
121192
|
|
|
121194
121193
|
const availableRatio = 1 - splitterRatio;
|
|
121195
121194
|
|
|
121196
|
-
//
|
|
121195
|
+
// 📌 비율 기반 스타일 적용
|
|
121197
121196
|
if (isHorizontal) {
|
|
121198
121197
|
prev.style.width = `${availableRatio * prevRatio * 100}%`;
|
|
121199
121198
|
next.style.width = `${availableRatio * nextRatio * 100}%`;
|
|
@@ -121206,6 +121205,7 @@ class nxSplitter extends HTMLElement {
|
|
|
121206
121205
|
};
|
|
121207
121206
|
|
|
121208
121207
|
|
|
121208
|
+
|
|
121209
121209
|
}
|
|
121210
121210
|
|
|
121211
121211
|
customElements.define("nx-splitter", nxSplitter);
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121166,30 +121166,29 @@ class nxSplitter extends HTMLElement {
|
|
|
121166
121166
|
#prepareLayout = () => {
|
|
121167
121167
|
const isHorizontal = this.#mode === "h";
|
|
121168
121168
|
|
|
121169
|
-
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
121170
121169
|
const prev = this.previousElementSibling;
|
|
121171
121170
|
const next = this.nextElementSibling;
|
|
121172
121171
|
const parent = this.parentElement;
|
|
121173
|
-
|
|
121174
121172
|
if (!prev || !next || !parent) return;
|
|
121175
121173
|
|
|
121176
|
-
const
|
|
121177
|
-
|
|
121174
|
+
const parentSize = isHorizontal
|
|
121175
|
+
? parent.getBoundingClientRect().width
|
|
121176
|
+
: parent.getBoundingClientRect().height;
|
|
121178
121177
|
|
|
121179
|
-
|
|
121178
|
+
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
121179
|
+
const splitterRatio = splitterSize / parentSize;
|
|
121180
|
+
|
|
121181
|
+
// 💡 prev/next 크기도 현재 값 기준으로 비율 계산
|
|
121180
121182
|
const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
|
|
121181
121183
|
const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
|
|
121184
|
+
const panelSum = prevSize + nextSize;
|
|
121182
121185
|
|
|
121183
|
-
const
|
|
121184
|
-
|
|
121185
|
-
// ➤ 현재 비율 계산
|
|
121186
|
-
const prevRatio = totalPanelSize > 0 ? prevSize / totalPanelSize : 0.5;
|
|
121186
|
+
const prevRatio = panelSum > 0 ? prevSize / panelSum : 0.5;
|
|
121187
121187
|
const nextRatio = 1 - prevRatio;
|
|
121188
|
-
const splitterRatio = splitterSize / totalSize;
|
|
121189
121188
|
|
|
121190
121189
|
const availableRatio = 1 - splitterRatio;
|
|
121191
121190
|
|
|
121192
|
-
//
|
|
121191
|
+
// 📌 비율 기반 스타일 적용
|
|
121193
121192
|
if (isHorizontal) {
|
|
121194
121193
|
prev.style.width = `${availableRatio * prevRatio * 100}%`;
|
|
121195
121194
|
next.style.width = `${availableRatio * nextRatio * 100}%`;
|
|
@@ -121202,6 +121201,7 @@ class nxSplitter extends HTMLElement {
|
|
|
121202
121201
|
};
|
|
121203
121202
|
|
|
121204
121203
|
|
|
121204
|
+
|
|
121205
121205
|
}
|
|
121206
121206
|
|
|
121207
121207
|
customElements.define("nx-splitter", nxSplitter);
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -182,30 +182,29 @@ class nxSplitter extends HTMLElement {
|
|
|
182
182
|
#prepareLayout = () => {
|
|
183
183
|
const isHorizontal = this.#mode === "h";
|
|
184
184
|
|
|
185
|
-
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
186
185
|
const prev = this.previousElementSibling;
|
|
187
186
|
const next = this.nextElementSibling;
|
|
188
187
|
const parent = this.parentElement;
|
|
189
|
-
|
|
190
188
|
if (!prev || !next || !parent) return;
|
|
191
189
|
|
|
192
|
-
const
|
|
193
|
-
|
|
190
|
+
const parentSize = isHorizontal
|
|
191
|
+
? parent.getBoundingClientRect().width
|
|
192
|
+
: parent.getBoundingClientRect().height;
|
|
194
193
|
|
|
195
|
-
|
|
194
|
+
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
195
|
+
const splitterRatio = splitterSize / parentSize;
|
|
196
|
+
|
|
197
|
+
// 💡 prev/next 크기도 현재 값 기준으로 비율 계산
|
|
196
198
|
const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
|
|
197
199
|
const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
|
|
200
|
+
const panelSum = prevSize + nextSize;
|
|
198
201
|
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
// ➤ 현재 비율 계산
|
|
202
|
-
const prevRatio = totalPanelSize > 0 ? prevSize / totalPanelSize : 0.5;
|
|
202
|
+
const prevRatio = panelSum > 0 ? prevSize / panelSum : 0.5;
|
|
203
203
|
const nextRatio = 1 - prevRatio;
|
|
204
|
-
const splitterRatio = splitterSize / totalSize;
|
|
205
204
|
|
|
206
205
|
const availableRatio = 1 - splitterRatio;
|
|
207
206
|
|
|
208
|
-
//
|
|
207
|
+
// 📌 비율 기반 스타일 적용
|
|
209
208
|
if (isHorizontal) {
|
|
210
209
|
prev.style.width = `${availableRatio * prevRatio * 100}%`;
|
|
211
210
|
next.style.width = `${availableRatio * nextRatio * 100}%`;
|
|
@@ -218,6 +217,7 @@ class nxSplitter extends HTMLElement {
|
|
|
218
217
|
};
|
|
219
218
|
|
|
220
219
|
|
|
220
|
+
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
customElements.define("nx-splitter", nxSplitter);
|
package/package.json
CHANGED
package/src/nx/nxSplitter.js
CHANGED
|
@@ -182,30 +182,29 @@ class nxSplitter extends HTMLElement {
|
|
|
182
182
|
#prepareLayout = () => {
|
|
183
183
|
const isHorizontal = this.#mode === "h";
|
|
184
184
|
|
|
185
|
-
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
186
185
|
const prev = this.previousElementSibling;
|
|
187
186
|
const next = this.nextElementSibling;
|
|
188
187
|
const parent = this.parentElement;
|
|
189
|
-
|
|
190
188
|
if (!prev || !next || !parent) return;
|
|
191
189
|
|
|
192
|
-
const
|
|
193
|
-
|
|
190
|
+
const parentSize = isHorizontal
|
|
191
|
+
? parent.getBoundingClientRect().width
|
|
192
|
+
: parent.getBoundingClientRect().height;
|
|
194
193
|
|
|
195
|
-
|
|
194
|
+
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
195
|
+
const splitterRatio = splitterSize / parentSize;
|
|
196
|
+
|
|
197
|
+
// 💡 prev/next 크기도 현재 값 기준으로 비율 계산
|
|
196
198
|
const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
|
|
197
199
|
const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
|
|
200
|
+
const panelSum = prevSize + nextSize;
|
|
198
201
|
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
// ➤ 현재 비율 계산
|
|
202
|
-
const prevRatio = totalPanelSize > 0 ? prevSize / totalPanelSize : 0.5;
|
|
202
|
+
const prevRatio = panelSum > 0 ? prevSize / panelSum : 0.5;
|
|
203
203
|
const nextRatio = 1 - prevRatio;
|
|
204
|
-
const splitterRatio = splitterSize / totalSize;
|
|
205
204
|
|
|
206
205
|
const availableRatio = 1 - splitterRatio;
|
|
207
206
|
|
|
208
|
-
//
|
|
207
|
+
// 📌 비율 기반 스타일 적용
|
|
209
208
|
if (isHorizontal) {
|
|
210
209
|
prev.style.width = `${availableRatio * prevRatio * 100}%`;
|
|
211
210
|
next.style.width = `${availableRatio * nextRatio * 100}%`;
|
|
@@ -218,6 +217,7 @@ class nxSplitter extends HTMLElement {
|
|
|
218
217
|
};
|
|
219
218
|
|
|
220
219
|
|
|
220
|
+
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
customElements.define("nx-splitter", nxSplitter);
|