ninegrid2 6.685.0 → 6.686.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.
@@ -121187,6 +121187,15 @@ class nxSplitter extends HTMLElement {
121187
121187
  };
121188
121188
 
121189
121189
  #prepareLayout = () => {
121190
+ const isLastSplitter = () => {
121191
+ const parent = this.parentElement;
121192
+ if (!parent) return false;
121193
+
121194
+ const allSplitters = [...parent.querySelectorAll("nx-splitter")];
121195
+ return allSplitters.at(-1) === this;
121196
+ };
121197
+
121198
+
121190
121199
  const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
121191
121200
  const prev = this.previousElementSibling;
121192
121201
  const next = this.nextElementSibling;
@@ -121203,13 +121212,13 @@ class nxSplitter extends HTMLElement {
121203
121212
  prev.style.width = `${eachSize}px`;
121204
121213
 
121205
121214
  // ✔ 정확하게 마지막 splitter일 때만 next 조정
121206
- if (this.#isLastSplitter()) {
121215
+ if (isLastSplitter()) {
121207
121216
  next.style.width = `${eachSize}px`;
121208
121217
  }
121209
121218
  } else {
121210
121219
  prev.style.height = `${eachSize}px`;
121211
121220
 
121212
- if (this.#isLastSplitter()) {
121221
+ if (isLastSplitter()) {
121213
121222
  next.style.height = `${eachSize}px`;
121214
121223
  }
121215
121224
  }
@@ -121183,6 +121183,15 @@ class nxSplitter extends HTMLElement {
121183
121183
  };
121184
121184
 
121185
121185
  #prepareLayout = () => {
121186
+ const isLastSplitter = () => {
121187
+ const parent = this.parentElement;
121188
+ if (!parent) return false;
121189
+
121190
+ const allSplitters = [...parent.querySelectorAll("nx-splitter")];
121191
+ return allSplitters.at(-1) === this;
121192
+ };
121193
+
121194
+
121186
121195
  const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
121187
121196
  const prev = this.previousElementSibling;
121188
121197
  const next = this.nextElementSibling;
@@ -121199,13 +121208,13 @@ class nxSplitter extends HTMLElement {
121199
121208
  prev.style.width = `${eachSize}px`;
121200
121209
 
121201
121210
  // ✔ 정확하게 마지막 splitter일 때만 next 조정
121202
- if (this.#isLastSplitter()) {
121211
+ if (isLastSplitter()) {
121203
121212
  next.style.width = `${eachSize}px`;
121204
121213
  }
121205
121214
  } else {
121206
121215
  prev.style.height = `${eachSize}px`;
121207
121216
 
121208
- if (this.#isLastSplitter()) {
121217
+ if (isLastSplitter()) {
121209
121218
  next.style.height = `${eachSize}px`;
121210
121219
  }
121211
121220
  }
@@ -142,6 +142,15 @@ class nxSplitter extends HTMLElement {
142
142
  };
143
143
 
144
144
  #prepareLayout = () => {
145
+ const isLastSplitter = () => {
146
+ const parent = this.parentElement;
147
+ if (!parent) return false;
148
+
149
+ const allSplitters = [...parent.querySelectorAll("nx-splitter")];
150
+ return allSplitters.at(-1) === this;
151
+ };
152
+
153
+
145
154
  const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
146
155
  const prev = this.previousElementSibling;
147
156
  const next = this.nextElementSibling;
@@ -158,13 +167,13 @@ class nxSplitter extends HTMLElement {
158
167
  prev.style.width = `${eachSize}px`;
159
168
 
160
169
  // ✔ 정확하게 마지막 splitter일 때만 next 조정
161
- if (this.#isLastSplitter()) {
170
+ if (isLastSplitter()) {
162
171
  next.style.width = `${eachSize}px`;
163
172
  }
164
173
  } else {
165
174
  prev.style.height = `${eachSize}px`;
166
175
 
167
- if (this.#isLastSplitter()) {
176
+ if (isLastSplitter()) {
168
177
  next.style.height = `${eachSize}px`;
169
178
  }
170
179
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.685.0",
4
+ "version": "6.686.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -142,6 +142,15 @@ class nxSplitter extends HTMLElement {
142
142
  };
143
143
 
144
144
  #prepareLayout = () => {
145
+ const isLastSplitter = () => {
146
+ const parent = this.parentElement;
147
+ if (!parent) return false;
148
+
149
+ const allSplitters = [...parent.querySelectorAll("nx-splitter")];
150
+ return allSplitters.at(-1) === this;
151
+ };
152
+
153
+
145
154
  const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
146
155
  const prev = this.previousElementSibling;
147
156
  const next = this.nextElementSibling;
@@ -158,13 +167,13 @@ class nxSplitter extends HTMLElement {
158
167
  prev.style.width = `${eachSize}px`;
159
168
 
160
169
  // ✔ 정확하게 마지막 splitter일 때만 next 조정
161
- if (this.#isLastSplitter()) {
170
+ if (isLastSplitter()) {
162
171
  next.style.width = `${eachSize}px`;
163
172
  }
164
173
  } else {
165
174
  prev.style.height = `${eachSize}px`;
166
175
 
167
- if (this.#isLastSplitter()) {
176
+ if (isLastSplitter()) {
168
177
  next.style.height = `${eachSize}px`;
169
178
  }
170
179
  }