ninegrid2 6.684.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.
- package/dist/bundle.cjs.js +41 -1
- package/dist/bundle.esm.js +41 -1
- package/dist/nx/nxSplitter.js +41 -1
- package/package.json +1 -1
- package/src/nx/nxSplitter.js +41 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -121182,7 +121182,47 @@ class nxSplitter extends HTMLElement {
|
|
|
121182
121182
|
console.log(el);
|
|
121183
121183
|
el.addEventListener("mousedown", e => this.#startDrag(e));
|
|
121184
121184
|
});
|
|
121185
|
-
|
|
121185
|
+
|
|
121186
|
+
this.#prepareLayout();
|
|
121187
|
+
};
|
|
121188
|
+
|
|
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
|
+
|
|
121199
|
+
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
121200
|
+
const prev = this.previousElementSibling;
|
|
121201
|
+
const next = this.nextElementSibling;
|
|
121202
|
+
const parent = this.parentElement;
|
|
121203
|
+
|
|
121204
|
+
if (!prev || !next || !parent) return;
|
|
121205
|
+
|
|
121206
|
+
const parentRect = parent.getBoundingClientRect();
|
|
121207
|
+
const total = this.#mode === "h" ? parentRect.width : parentRect.height;
|
|
121208
|
+
const available = total - splitterSize;
|
|
121209
|
+
const eachSize = available / 2;
|
|
121210
|
+
|
|
121211
|
+
if (this.#mode === "h") {
|
|
121212
|
+
prev.style.width = `${eachSize}px`;
|
|
121213
|
+
|
|
121214
|
+
// ✔ 정확하게 마지막 splitter일 때만 next 조정
|
|
121215
|
+
if (isLastSplitter()) {
|
|
121216
|
+
next.style.width = `${eachSize}px`;
|
|
121217
|
+
}
|
|
121218
|
+
} else {
|
|
121219
|
+
prev.style.height = `${eachSize}px`;
|
|
121220
|
+
|
|
121221
|
+
if (isLastSplitter()) {
|
|
121222
|
+
next.style.height = `${eachSize}px`;
|
|
121223
|
+
}
|
|
121224
|
+
}
|
|
121225
|
+
};
|
|
121186
121226
|
}
|
|
121187
121227
|
|
|
121188
121228
|
customElements.define("nx-splitter", nxSplitter);
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121178,7 +121178,47 @@ class nxSplitter extends HTMLElement {
|
|
|
121178
121178
|
console.log(el);
|
|
121179
121179
|
el.addEventListener("mousedown", e => this.#startDrag(e));
|
|
121180
121180
|
});
|
|
121181
|
-
|
|
121181
|
+
|
|
121182
|
+
this.#prepareLayout();
|
|
121183
|
+
};
|
|
121184
|
+
|
|
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
|
+
|
|
121195
|
+
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
121196
|
+
const prev = this.previousElementSibling;
|
|
121197
|
+
const next = this.nextElementSibling;
|
|
121198
|
+
const parent = this.parentElement;
|
|
121199
|
+
|
|
121200
|
+
if (!prev || !next || !parent) return;
|
|
121201
|
+
|
|
121202
|
+
const parentRect = parent.getBoundingClientRect();
|
|
121203
|
+
const total = this.#mode === "h" ? parentRect.width : parentRect.height;
|
|
121204
|
+
const available = total - splitterSize;
|
|
121205
|
+
const eachSize = available / 2;
|
|
121206
|
+
|
|
121207
|
+
if (this.#mode === "h") {
|
|
121208
|
+
prev.style.width = `${eachSize}px`;
|
|
121209
|
+
|
|
121210
|
+
// ✔ 정확하게 마지막 splitter일 때만 next 조정
|
|
121211
|
+
if (isLastSplitter()) {
|
|
121212
|
+
next.style.width = `${eachSize}px`;
|
|
121213
|
+
}
|
|
121214
|
+
} else {
|
|
121215
|
+
prev.style.height = `${eachSize}px`;
|
|
121216
|
+
|
|
121217
|
+
if (isLastSplitter()) {
|
|
121218
|
+
next.style.height = `${eachSize}px`;
|
|
121219
|
+
}
|
|
121220
|
+
}
|
|
121221
|
+
};
|
|
121182
121222
|
}
|
|
121183
121223
|
|
|
121184
121224
|
customElements.define("nx-splitter", nxSplitter);
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -137,7 +137,47 @@ class nxSplitter extends HTMLElement {
|
|
|
137
137
|
console.log(el);
|
|
138
138
|
el.addEventListener("mousedown", e => this.#startDrag(e));
|
|
139
139
|
});
|
|
140
|
-
|
|
140
|
+
|
|
141
|
+
this.#prepareLayout();
|
|
142
|
+
};
|
|
143
|
+
|
|
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
|
+
|
|
154
|
+
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
155
|
+
const prev = this.previousElementSibling;
|
|
156
|
+
const next = this.nextElementSibling;
|
|
157
|
+
const parent = this.parentElement;
|
|
158
|
+
|
|
159
|
+
if (!prev || !next || !parent) return;
|
|
160
|
+
|
|
161
|
+
const parentRect = parent.getBoundingClientRect();
|
|
162
|
+
const total = this.#mode === "h" ? parentRect.width : parentRect.height;
|
|
163
|
+
const available = total - splitterSize;
|
|
164
|
+
const eachSize = available / 2;
|
|
165
|
+
|
|
166
|
+
if (this.#mode === "h") {
|
|
167
|
+
prev.style.width = `${eachSize}px`;
|
|
168
|
+
|
|
169
|
+
// ✔ 정확하게 마지막 splitter일 때만 next 조정
|
|
170
|
+
if (isLastSplitter()) {
|
|
171
|
+
next.style.width = `${eachSize}px`;
|
|
172
|
+
}
|
|
173
|
+
} else {
|
|
174
|
+
prev.style.height = `${eachSize}px`;
|
|
175
|
+
|
|
176
|
+
if (isLastSplitter()) {
|
|
177
|
+
next.style.height = `${eachSize}px`;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
141
181
|
}
|
|
142
182
|
|
|
143
183
|
customElements.define("nx-splitter", nxSplitter);
|
package/package.json
CHANGED
package/src/nx/nxSplitter.js
CHANGED
|
@@ -137,7 +137,47 @@ class nxSplitter extends HTMLElement {
|
|
|
137
137
|
console.log(el);
|
|
138
138
|
el.addEventListener("mousedown", e => this.#startDrag(e));
|
|
139
139
|
});
|
|
140
|
-
|
|
140
|
+
|
|
141
|
+
this.#prepareLayout();
|
|
142
|
+
};
|
|
143
|
+
|
|
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
|
+
|
|
154
|
+
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
155
|
+
const prev = this.previousElementSibling;
|
|
156
|
+
const next = this.nextElementSibling;
|
|
157
|
+
const parent = this.parentElement;
|
|
158
|
+
|
|
159
|
+
if (!prev || !next || !parent) return;
|
|
160
|
+
|
|
161
|
+
const parentRect = parent.getBoundingClientRect();
|
|
162
|
+
const total = this.#mode === "h" ? parentRect.width : parentRect.height;
|
|
163
|
+
const available = total - splitterSize;
|
|
164
|
+
const eachSize = available / 2;
|
|
165
|
+
|
|
166
|
+
if (this.#mode === "h") {
|
|
167
|
+
prev.style.width = `${eachSize}px`;
|
|
168
|
+
|
|
169
|
+
// ✔ 정확하게 마지막 splitter일 때만 next 조정
|
|
170
|
+
if (isLastSplitter()) {
|
|
171
|
+
next.style.width = `${eachSize}px`;
|
|
172
|
+
}
|
|
173
|
+
} else {
|
|
174
|
+
prev.style.height = `${eachSize}px`;
|
|
175
|
+
|
|
176
|
+
if (isLastSplitter()) {
|
|
177
|
+
next.style.height = `${eachSize}px`;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
141
181
|
}
|
|
142
182
|
|
|
143
183
|
customElements.define("nx-splitter", nxSplitter);
|