ninegrid2 6.749.0 → 6.751.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 +18 -14
- package/dist/bundle.esm.js +18 -14
- package/dist/nx/nxSplitter.js +18 -14
- package/package.json +1 -1
- package/src/nx/nxSplitter.js +18 -14
package/dist/bundle.cjs.js
CHANGED
|
@@ -121175,37 +121175,41 @@ class nxSplitter extends HTMLElement {
|
|
|
121175
121175
|
const parent = this.parentElement;
|
|
121176
121176
|
if (!prev || !next || !parent) return;
|
|
121177
121177
|
|
|
121178
|
+
// ⛓ splitter의 실제 크기 고정 기준 (최초 생성 기준)
|
|
121179
|
+
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
121180
|
+
|
|
121181
|
+
// 전체 부모 사이즈 측정
|
|
121178
121182
|
const parentSize = isHorizontal
|
|
121179
121183
|
? parent.getBoundingClientRect().width
|
|
121180
121184
|
: parent.getBoundingClientRect().height;
|
|
121181
121185
|
|
|
121182
|
-
|
|
121183
|
-
const
|
|
121186
|
+
// splitter 제외한 나머지 공간
|
|
121187
|
+
const available = parentSize - splitterSize;
|
|
121184
121188
|
|
|
121185
|
-
//
|
|
121189
|
+
// 현재 prev/next 실제 크기 기준으로 비율 역산
|
|
121186
121190
|
const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
|
|
121187
121191
|
const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
|
|
121188
|
-
const
|
|
121192
|
+
const totalPanelSize = prevSize + nextSize;
|
|
121189
121193
|
|
|
121190
|
-
const prevRatio =
|
|
121194
|
+
const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
|
|
121191
121195
|
const nextRatio = 1 - prevRatio;
|
|
121192
121196
|
|
|
121193
|
-
|
|
121197
|
+
// 비율 기반으로 pixel 크기 다시 계산
|
|
121198
|
+
const newPrevSize = available * prevRatio;
|
|
121199
|
+
const newNextSize = available * nextRatio;
|
|
121194
121200
|
|
|
121195
|
-
// 📌 비율 기반 스타일 적용
|
|
121196
121201
|
if (isHorizontal) {
|
|
121197
|
-
prev.style.width = `${
|
|
121198
|
-
next.style.width = `${
|
|
121199
|
-
this.style.width = `${
|
|
121202
|
+
prev.style.width = `${newPrevSize}px`;
|
|
121203
|
+
next.style.width = `${newNextSize}px`;
|
|
121204
|
+
this.style.width = `${splitterSize}px`;
|
|
121200
121205
|
} else {
|
|
121201
|
-
prev.style.height = `${
|
|
121202
|
-
next.style.height = `${
|
|
121203
|
-
this.style.height = `${
|
|
121206
|
+
prev.style.height = `${newPrevSize}px`;
|
|
121207
|
+
next.style.height = `${newNextSize}px`;
|
|
121208
|
+
this.style.height = `${splitterSize}px`;
|
|
121204
121209
|
}
|
|
121205
121210
|
};
|
|
121206
121211
|
|
|
121207
121212
|
|
|
121208
|
-
|
|
121209
121213
|
}
|
|
121210
121214
|
|
|
121211
121215
|
customElements.define("nx-splitter", nxSplitter);
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121171,37 +121171,41 @@ class nxSplitter extends HTMLElement {
|
|
|
121171
121171
|
const parent = this.parentElement;
|
|
121172
121172
|
if (!prev || !next || !parent) return;
|
|
121173
121173
|
|
|
121174
|
+
// ⛓ splitter의 실제 크기 고정 기준 (최초 생성 기준)
|
|
121175
|
+
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
121176
|
+
|
|
121177
|
+
// 전체 부모 사이즈 측정
|
|
121174
121178
|
const parentSize = isHorizontal
|
|
121175
121179
|
? parent.getBoundingClientRect().width
|
|
121176
121180
|
: parent.getBoundingClientRect().height;
|
|
121177
121181
|
|
|
121178
|
-
|
|
121179
|
-
const
|
|
121182
|
+
// splitter 제외한 나머지 공간
|
|
121183
|
+
const available = parentSize - splitterSize;
|
|
121180
121184
|
|
|
121181
|
-
//
|
|
121185
|
+
// 현재 prev/next 실제 크기 기준으로 비율 역산
|
|
121182
121186
|
const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
|
|
121183
121187
|
const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
|
|
121184
|
-
const
|
|
121188
|
+
const totalPanelSize = prevSize + nextSize;
|
|
121185
121189
|
|
|
121186
|
-
const prevRatio =
|
|
121190
|
+
const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
|
|
121187
121191
|
const nextRatio = 1 - prevRatio;
|
|
121188
121192
|
|
|
121189
|
-
|
|
121193
|
+
// 비율 기반으로 pixel 크기 다시 계산
|
|
121194
|
+
const newPrevSize = available * prevRatio;
|
|
121195
|
+
const newNextSize = available * nextRatio;
|
|
121190
121196
|
|
|
121191
|
-
// 📌 비율 기반 스타일 적용
|
|
121192
121197
|
if (isHorizontal) {
|
|
121193
|
-
prev.style.width = `${
|
|
121194
|
-
next.style.width = `${
|
|
121195
|
-
this.style.width = `${
|
|
121198
|
+
prev.style.width = `${newPrevSize}px`;
|
|
121199
|
+
next.style.width = `${newNextSize}px`;
|
|
121200
|
+
this.style.width = `${splitterSize}px`;
|
|
121196
121201
|
} else {
|
|
121197
|
-
prev.style.height = `${
|
|
121198
|
-
next.style.height = `${
|
|
121199
|
-
this.style.height = `${
|
|
121202
|
+
prev.style.height = `${newPrevSize}px`;
|
|
121203
|
+
next.style.height = `${newNextSize}px`;
|
|
121204
|
+
this.style.height = `${splitterSize}px`;
|
|
121200
121205
|
}
|
|
121201
121206
|
};
|
|
121202
121207
|
|
|
121203
121208
|
|
|
121204
|
-
|
|
121205
121209
|
}
|
|
121206
121210
|
|
|
121207
121211
|
customElements.define("nx-splitter", nxSplitter);
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -187,37 +187,41 @@ class nxSplitter extends HTMLElement {
|
|
|
187
187
|
const parent = this.parentElement;
|
|
188
188
|
if (!prev || !next || !parent) return;
|
|
189
189
|
|
|
190
|
+
// ⛓ splitter의 실제 크기 고정 기준 (최초 생성 기준)
|
|
191
|
+
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
192
|
+
|
|
193
|
+
// 전체 부모 사이즈 측정
|
|
190
194
|
const parentSize = isHorizontal
|
|
191
195
|
? parent.getBoundingClientRect().width
|
|
192
196
|
: parent.getBoundingClientRect().height;
|
|
193
197
|
|
|
194
|
-
|
|
195
|
-
const
|
|
198
|
+
// splitter 제외한 나머지 공간
|
|
199
|
+
const available = parentSize - splitterSize;
|
|
196
200
|
|
|
197
|
-
//
|
|
201
|
+
// 현재 prev/next 실제 크기 기준으로 비율 역산
|
|
198
202
|
const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
|
|
199
203
|
const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
|
|
200
|
-
const
|
|
204
|
+
const totalPanelSize = prevSize + nextSize;
|
|
201
205
|
|
|
202
|
-
const prevRatio =
|
|
206
|
+
const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
|
|
203
207
|
const nextRatio = 1 - prevRatio;
|
|
204
208
|
|
|
205
|
-
|
|
209
|
+
// 비율 기반으로 pixel 크기 다시 계산
|
|
210
|
+
const newPrevSize = available * prevRatio;
|
|
211
|
+
const newNextSize = available * nextRatio;
|
|
206
212
|
|
|
207
|
-
// 📌 비율 기반 스타일 적용
|
|
208
213
|
if (isHorizontal) {
|
|
209
|
-
prev.style.width = `${
|
|
210
|
-
next.style.width = `${
|
|
211
|
-
this.style.width = `${
|
|
214
|
+
prev.style.width = `${newPrevSize}px`;
|
|
215
|
+
next.style.width = `${newNextSize}px`;
|
|
216
|
+
this.style.width = `${splitterSize}px`;
|
|
212
217
|
} else {
|
|
213
|
-
prev.style.height = `${
|
|
214
|
-
next.style.height = `${
|
|
215
|
-
this.style.height = `${
|
|
218
|
+
prev.style.height = `${newPrevSize}px`;
|
|
219
|
+
next.style.height = `${newNextSize}px`;
|
|
220
|
+
this.style.height = `${splitterSize}px`;
|
|
216
221
|
}
|
|
217
222
|
};
|
|
218
223
|
|
|
219
224
|
|
|
220
|
-
|
|
221
225
|
}
|
|
222
226
|
|
|
223
227
|
customElements.define("nx-splitter", nxSplitter);
|
package/package.json
CHANGED
package/src/nx/nxSplitter.js
CHANGED
|
@@ -187,37 +187,41 @@ class nxSplitter extends HTMLElement {
|
|
|
187
187
|
const parent = this.parentElement;
|
|
188
188
|
if (!prev || !next || !parent) return;
|
|
189
189
|
|
|
190
|
+
// ⛓ splitter의 실제 크기 고정 기준 (최초 생성 기준)
|
|
191
|
+
const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
|
|
192
|
+
|
|
193
|
+
// 전체 부모 사이즈 측정
|
|
190
194
|
const parentSize = isHorizontal
|
|
191
195
|
? parent.getBoundingClientRect().width
|
|
192
196
|
: parent.getBoundingClientRect().height;
|
|
193
197
|
|
|
194
|
-
|
|
195
|
-
const
|
|
198
|
+
// splitter 제외한 나머지 공간
|
|
199
|
+
const available = parentSize - splitterSize;
|
|
196
200
|
|
|
197
|
-
//
|
|
201
|
+
// 현재 prev/next 실제 크기 기준으로 비율 역산
|
|
198
202
|
const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
|
|
199
203
|
const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
|
|
200
|
-
const
|
|
204
|
+
const totalPanelSize = prevSize + nextSize;
|
|
201
205
|
|
|
202
|
-
const prevRatio =
|
|
206
|
+
const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
|
|
203
207
|
const nextRatio = 1 - prevRatio;
|
|
204
208
|
|
|
205
|
-
|
|
209
|
+
// 비율 기반으로 pixel 크기 다시 계산
|
|
210
|
+
const newPrevSize = available * prevRatio;
|
|
211
|
+
const newNextSize = available * nextRatio;
|
|
206
212
|
|
|
207
|
-
// 📌 비율 기반 스타일 적용
|
|
208
213
|
if (isHorizontal) {
|
|
209
|
-
prev.style.width = `${
|
|
210
|
-
next.style.width = `${
|
|
211
|
-
this.style.width = `${
|
|
214
|
+
prev.style.width = `${newPrevSize}px`;
|
|
215
|
+
next.style.width = `${newNextSize}px`;
|
|
216
|
+
this.style.width = `${splitterSize}px`;
|
|
212
217
|
} else {
|
|
213
|
-
prev.style.height = `${
|
|
214
|
-
next.style.height = `${
|
|
215
|
-
this.style.height = `${
|
|
218
|
+
prev.style.height = `${newPrevSize}px`;
|
|
219
|
+
next.style.height = `${newNextSize}px`;
|
|
220
|
+
this.style.height = `${splitterSize}px`;
|
|
216
221
|
}
|
|
217
222
|
};
|
|
218
223
|
|
|
219
224
|
|
|
220
|
-
|
|
221
225
|
}
|
|
222
226
|
|
|
223
227
|
customElements.define("nx-splitter", nxSplitter);
|