ninegrid2 6.751.0 → 6.753.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.
@@ -120963,7 +120963,6 @@ class nxTab extends HTMLElement {
120963
120963
  this.shadowRoot.querySelectorAll('.tab-page:not(.active)').forEach(el => { el.classList.add('exit-right'); });
120964
120964
 
120965
120965
  const resizeObserver = new ResizeObserver(() => {
120966
- console.log("111");
120967
120966
  const activeContent = this.shadowRoot.querySelector('.tab-page.active');
120968
120967
  if (activeContent) {
120969
120968
  this.shadowRoot.querySelector('.tab-pages').style.height = `${activeContent.scrollHeight}px`;
@@ -121168,48 +121167,51 @@ class nxSplitter extends HTMLElement {
121168
121167
  };
121169
121168
 
121170
121169
  #prepareLayout = () => {
121171
- const isHorizontal = this.#mode === "h";
121172
121170
 
121171
+
121172
+
121173
+ const isHorizontal = this.#mode === "h";
121174
+ const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
121173
121175
  const prev = this.previousElementSibling;
121174
121176
  const next = this.nextElementSibling;
121175
121177
  const parent = this.parentElement;
121176
121178
  if (!prev || !next || !parent) return;
121177
121179
 
121178
- // ⛓ splitter의 실제 크기 고정 기준 (최초 생성 기준)
121179
- const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
121180
-
121181
- // 전체 부모 사이즈 측정
121182
- const parentSize = isHorizontal
121180
+ isHorizontal
121183
121181
  ? parent.getBoundingClientRect().width
121184
121182
  : parent.getBoundingClientRect().height;
121185
121183
 
121186
- // splitter 제외한 나머지 공간
121187
- const available = parentSize - splitterSize;
121188
-
121189
- // 현재 prev/next 실제 크기 기준으로 비율 역산
121184
+ // 현재 패널 크기 측정
121190
121185
  const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
121191
121186
  const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
121192
121187
  const totalPanelSize = prevSize + nextSize;
121193
121188
 
121194
- const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
121195
- const nextRatio = 1 - prevRatio;
121189
+ // 현재 비율 계산
121190
+ ///const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
121191
+ const prevRatio = totalPanelSize ? prevSize / (totalPanelSize + splitterSize) : 0.5;
121192
+
121193
+ const newPrevSize = (totalPanelSize + splitterSize) * prevRatio;
121194
+ const newNextSize = totalPanelSize - newPrevSize;
121196
121195
 
121197
- // 비율 기반으로 pixel 크기 다시 계산
121198
- const newPrevSize = available * prevRatio;
121199
- const newNextSize = available * nextRatio;
121196
+ console.log(newPrevSize, newNextSize);
121200
121197
 
121201
121198
  if (isHorizontal) {
121202
121199
  prev.style.width = `${newPrevSize}px`;
121203
- next.style.width = `${newNextSize}px`;
121204
- this.style.width = `${splitterSize}px`;
121200
+ //this.style.width = `${splitterSize}px`;
121201
+
121202
+ if (this.#isLastSplitter()) {
121203
+ next.style.width = `${newNextSize}px`;
121204
+ }
121205
121205
  } else {
121206
121206
  prev.style.height = `${newPrevSize}px`;
121207
- next.style.height = `${newNextSize}px`;
121208
- this.style.height = `${splitterSize}px`;
121207
+ //this.style.height = `${splitterSize}px`;
121208
+
121209
+ if (this.#isLastSplitter()) {
121210
+ next.style.height = `${newNextSize}px`;
121211
+ }
121209
121212
  }
121210
121213
  };
121211
121214
 
121212
-
121213
121215
  }
121214
121216
 
121215
121217
  customElements.define("nx-splitter", nxSplitter);
@@ -120959,7 +120959,6 @@ class nxTab extends HTMLElement {
120959
120959
  this.shadowRoot.querySelectorAll('.tab-page:not(.active)').forEach(el => { el.classList.add('exit-right'); });
120960
120960
 
120961
120961
  const resizeObserver = new ResizeObserver(() => {
120962
- console.log("111");
120963
120962
  const activeContent = this.shadowRoot.querySelector('.tab-page.active');
120964
120963
  if (activeContent) {
120965
120964
  this.shadowRoot.querySelector('.tab-pages').style.height = `${activeContent.scrollHeight}px`;
@@ -121164,48 +121163,51 @@ class nxSplitter extends HTMLElement {
121164
121163
  };
121165
121164
 
121166
121165
  #prepareLayout = () => {
121167
- const isHorizontal = this.#mode === "h";
121168
121166
 
121167
+
121168
+
121169
+ const isHorizontal = this.#mode === "h";
121170
+ const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
121169
121171
  const prev = this.previousElementSibling;
121170
121172
  const next = this.nextElementSibling;
121171
121173
  const parent = this.parentElement;
121172
121174
  if (!prev || !next || !parent) return;
121173
121175
 
121174
- // ⛓ splitter의 실제 크기 고정 기준 (최초 생성 기준)
121175
- const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
121176
-
121177
- // 전체 부모 사이즈 측정
121178
- const parentSize = isHorizontal
121176
+ isHorizontal
121179
121177
  ? parent.getBoundingClientRect().width
121180
121178
  : parent.getBoundingClientRect().height;
121181
121179
 
121182
- // splitter 제외한 나머지 공간
121183
- const available = parentSize - splitterSize;
121184
-
121185
- // 현재 prev/next 실제 크기 기준으로 비율 역산
121180
+ // 현재 패널 크기 측정
121186
121181
  const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
121187
121182
  const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
121188
121183
  const totalPanelSize = prevSize + nextSize;
121189
121184
 
121190
- const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
121191
- const nextRatio = 1 - prevRatio;
121185
+ // 현재 비율 계산
121186
+ ///const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
121187
+ const prevRatio = totalPanelSize ? prevSize / (totalPanelSize + splitterSize) : 0.5;
121188
+
121189
+ const newPrevSize = (totalPanelSize + splitterSize) * prevRatio;
121190
+ const newNextSize = totalPanelSize - newPrevSize;
121192
121191
 
121193
- // 비율 기반으로 pixel 크기 다시 계산
121194
- const newPrevSize = available * prevRatio;
121195
- const newNextSize = available * nextRatio;
121192
+ console.log(newPrevSize, newNextSize);
121196
121193
 
121197
121194
  if (isHorizontal) {
121198
121195
  prev.style.width = `${newPrevSize}px`;
121199
- next.style.width = `${newNextSize}px`;
121200
- this.style.width = `${splitterSize}px`;
121196
+ //this.style.width = `${splitterSize}px`;
121197
+
121198
+ if (this.#isLastSplitter()) {
121199
+ next.style.width = `${newNextSize}px`;
121200
+ }
121201
121201
  } else {
121202
121202
  prev.style.height = `${newPrevSize}px`;
121203
- next.style.height = `${newNextSize}px`;
121204
- this.style.height = `${splitterSize}px`;
121203
+ //this.style.height = `${splitterSize}px`;
121204
+
121205
+ if (this.#isLastSplitter()) {
121206
+ next.style.height = `${newNextSize}px`;
121207
+ }
121205
121208
  }
121206
121209
  };
121207
121210
 
121208
-
121209
121211
  }
121210
121212
 
121211
121213
  customElements.define("nx-splitter", nxSplitter);
@@ -180,48 +180,55 @@ class nxSplitter extends HTMLElement {
180
180
  };
181
181
 
182
182
  #prepareLayout = () => {
183
- const isHorizontal = this.#mode === "h";
184
183
 
184
+
185
+
186
+ const isHorizontal = this.#mode === "h";
187
+ const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
185
188
  const prev = this.previousElementSibling;
186
189
  const next = this.nextElementSibling;
187
190
  const parent = this.parentElement;
188
191
  if (!prev || !next || !parent) return;
189
192
 
190
- // ⛓ splitter의 실제 크기 고정 기준 (최초 생성 기준)
191
- const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
192
-
193
- // 전체 부모 사이즈 측정
194
193
  const parentSize = isHorizontal
195
194
  ? parent.getBoundingClientRect().width
196
195
  : parent.getBoundingClientRect().height;
197
196
 
198
- // splitter 제외한 나머지 공간
199
- const available = parentSize - splitterSize;
200
-
201
- // 현재 prev/next 실제 크기 기준으로 비율 역산
197
+ // 현재 패널 크기 측정
202
198
  const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
203
199
  const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
204
200
  const totalPanelSize = prevSize + nextSize;
205
201
 
206
- const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
202
+ // 현재 비율 계산
203
+ ///const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
204
+ const prevRatio = totalPanelSize ? prevSize / (totalPanelSize + splitterSize) : 0.5;
207
205
  const nextRatio = 1 - prevRatio;
208
206
 
209
- // 비율 기반으로 pixel 크기 다시 계산
210
- const newPrevSize = available * prevRatio;
211
- const newNextSize = available * nextRatio;
207
+ // 새로운 available 크기
208
+ const available = parentSize - splitterSize;
209
+
210
+ const newPrevSize = (totalPanelSize + splitterSize) * prevRatio;
211
+ const newNextSize = totalPanelSize - newPrevSize;
212
+
213
+ console.log(newPrevSize, newNextSize);
212
214
 
213
215
  if (isHorizontal) {
214
216
  prev.style.width = `${newPrevSize}px`;
215
- next.style.width = `${newNextSize}px`;
216
- this.style.width = `${splitterSize}px`;
217
+ //this.style.width = `${splitterSize}px`;
218
+
219
+ if (this.#isLastSplitter()) {
220
+ next.style.width = `${newNextSize}px`;
221
+ }
217
222
  } else {
218
223
  prev.style.height = `${newPrevSize}px`;
219
- next.style.height = `${newNextSize}px`;
220
- this.style.height = `${splitterSize}px`;
224
+ //this.style.height = `${splitterSize}px`;
225
+
226
+ if (this.#isLastSplitter()) {
227
+ next.style.height = `${newNextSize}px`;
228
+ }
221
229
  }
222
230
  };
223
231
 
224
-
225
232
  }
226
233
 
227
234
  customElements.define("nx-splitter", nxSplitter);
package/dist/nx/nxTab.js CHANGED
@@ -115,7 +115,6 @@ class nxTab extends HTMLElement {
115
115
  this.shadowRoot.querySelectorAll('.tab-page:not(.active)').forEach(el => { el.classList.add('exit-right') });
116
116
 
117
117
  const resizeObserver = new ResizeObserver(() => {
118
- console.log("111");
119
118
  const activeContent = this.shadowRoot.querySelector('.tab-page.active');
120
119
  if (activeContent) {
121
120
  this.shadowRoot.querySelector('.tab-pages').style.height = `${activeContent.scrollHeight}px`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.751.0",
4
+ "version": "6.753.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -180,48 +180,55 @@ class nxSplitter extends HTMLElement {
180
180
  };
181
181
 
182
182
  #prepareLayout = () => {
183
- const isHorizontal = this.#mode === "h";
184
183
 
184
+
185
+
186
+ const isHorizontal = this.#mode === "h";
187
+ const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
185
188
  const prev = this.previousElementSibling;
186
189
  const next = this.nextElementSibling;
187
190
  const parent = this.parentElement;
188
191
  if (!prev || !next || !parent) return;
189
192
 
190
- // ⛓ splitter의 실제 크기 고정 기준 (최초 생성 기준)
191
- const splitterSize = isHorizontal ? this.offsetWidth : this.offsetHeight;
192
-
193
- // 전체 부모 사이즈 측정
194
193
  const parentSize = isHorizontal
195
194
  ? parent.getBoundingClientRect().width
196
195
  : parent.getBoundingClientRect().height;
197
196
 
198
- // splitter 제외한 나머지 공간
199
- const available = parentSize - splitterSize;
200
-
201
- // 현재 prev/next 실제 크기 기준으로 비율 역산
197
+ // 현재 패널 크기 측정
202
198
  const prevSize = isHorizontal ? prev.offsetWidth : prev.offsetHeight;
203
199
  const nextSize = isHorizontal ? next.offsetWidth : next.offsetHeight;
204
200
  const totalPanelSize = prevSize + nextSize;
205
201
 
206
- const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
202
+ // 현재 비율 계산
203
+ ///const prevRatio = totalPanelSize ? prevSize / totalPanelSize : 0.5;
204
+ const prevRatio = totalPanelSize ? prevSize / (totalPanelSize + splitterSize) : 0.5;
207
205
  const nextRatio = 1 - prevRatio;
208
206
 
209
- // 비율 기반으로 pixel 크기 다시 계산
210
- const newPrevSize = available * prevRatio;
211
- const newNextSize = available * nextRatio;
207
+ // 새로운 available 크기
208
+ const available = parentSize - splitterSize;
209
+
210
+ const newPrevSize = (totalPanelSize + splitterSize) * prevRatio;
211
+ const newNextSize = totalPanelSize - newPrevSize;
212
+
213
+ console.log(newPrevSize, newNextSize);
212
214
 
213
215
  if (isHorizontal) {
214
216
  prev.style.width = `${newPrevSize}px`;
215
- next.style.width = `${newNextSize}px`;
216
- this.style.width = `${splitterSize}px`;
217
+ //this.style.width = `${splitterSize}px`;
218
+
219
+ if (this.#isLastSplitter()) {
220
+ next.style.width = `${newNextSize}px`;
221
+ }
217
222
  } else {
218
223
  prev.style.height = `${newPrevSize}px`;
219
- next.style.height = `${newNextSize}px`;
220
- this.style.height = `${splitterSize}px`;
224
+ //this.style.height = `${splitterSize}px`;
225
+
226
+ if (this.#isLastSplitter()) {
227
+ next.style.height = `${newNextSize}px`;
228
+ }
221
229
  }
222
230
  };
223
231
 
224
-
225
232
  }
226
233
 
227
234
  customElements.define("nx-splitter", nxSplitter);
package/src/nx/nxTab.js CHANGED
@@ -115,7 +115,6 @@ class nxTab extends HTMLElement {
115
115
  this.shadowRoot.querySelectorAll('.tab-page:not(.active)').forEach(el => { el.classList.add('exit-right') });
116
116
 
117
117
  const resizeObserver = new ResizeObserver(() => {
118
- console.log("111");
119
118
  const activeContent = this.shadowRoot.querySelector('.tab-page.active');
120
119
  if (activeContent) {
121
120
  this.shadowRoot.querySelector('.tab-pages').style.height = `${activeContent.scrollHeight}px`;