ninegrid2 6.691.0 β†’ 6.693.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.
@@ -121126,7 +121126,6 @@ class nxSplitter extends HTMLElement {
121126
121126
  }
121127
121127
  };
121128
121128
 
121129
-
121130
121129
  const onUp = (e) => {
121131
121130
  window.removeEventListener("mousemove", onMove);
121132
121131
  window.removeEventListener("mouseup", onUp);
@@ -121141,18 +121140,19 @@ class nxSplitter extends HTMLElement {
121141
121140
 
121142
121141
  const prevRect = prev.getBoundingClientRect();
121143
121142
 
121144
- // πŸ“Œ λ“œλž˜κ·Έ μœ„μΉ˜μ—μ„œ prev μ‹œμž‘ μœ„μΉ˜λ₯Ό λΊ€ μƒλŒ€ μœ„μΉ˜ (prev κΈ°μ€€)
121145
- const position = this.#mode === "h"
121143
+ // βœ… μƒλŒ€ μœ„μΉ˜ 계산: prev κΈ°μ€€μœΌλ‘œ μ–Όλ§ˆλ‚˜ μ›€μ§μ˜€λŠ”μ§€
121144
+ const delta = this.#mode === "h"
121146
121145
  ? e.clientX - prevRect.left
121147
121146
  : e.clientY - prevRect.top;
121148
121147
 
121149
- // prev μ‹œμž‘ μœ„μΉ˜ κΈ°μ€€μœΌλ‘œ μƒλŒ€ 크기 μ„€μ •
121150
121148
  if (this.#mode === "h") {
121151
- prev.style.width = `${position}px`;
121152
- next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - position - splitterSize}px`;
121149
+ prev.style.width = `${delta}px`;
121150
+
121151
+ // next λ„ˆλΉ„λŠ” 전체 - prev의 offset - delta - splitter
121152
+ next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - delta - splitterSize}px`;
121153
121153
  } else {
121154
- prev.style.height = `${position}px`;
121155
- next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - position - splitterSize}px`;
121154
+ prev.style.height = `${delta}px`;
121155
+ next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - delta - splitterSize}px`;
121156
121156
  }
121157
121157
  };
121158
121158
 
@@ -121122,7 +121122,6 @@ class nxSplitter extends HTMLElement {
121122
121122
  }
121123
121123
  };
121124
121124
 
121125
-
121126
121125
  const onUp = (e) => {
121127
121126
  window.removeEventListener("mousemove", onMove);
121128
121127
  window.removeEventListener("mouseup", onUp);
@@ -121137,18 +121136,19 @@ class nxSplitter extends HTMLElement {
121137
121136
 
121138
121137
  const prevRect = prev.getBoundingClientRect();
121139
121138
 
121140
- // πŸ“Œ λ“œλž˜κ·Έ μœ„μΉ˜μ—μ„œ prev μ‹œμž‘ μœ„μΉ˜λ₯Ό λΊ€ μƒλŒ€ μœ„μΉ˜ (prev κΈ°μ€€)
121141
- const position = this.#mode === "h"
121139
+ // βœ… μƒλŒ€ μœ„μΉ˜ 계산: prev κΈ°μ€€μœΌλ‘œ μ–Όλ§ˆλ‚˜ μ›€μ§μ˜€λŠ”μ§€
121140
+ const delta = this.#mode === "h"
121142
121141
  ? e.clientX - prevRect.left
121143
121142
  : e.clientY - prevRect.top;
121144
121143
 
121145
- // prev μ‹œμž‘ μœ„μΉ˜ κΈ°μ€€μœΌλ‘œ μƒλŒ€ 크기 μ„€μ •
121146
121144
  if (this.#mode === "h") {
121147
- prev.style.width = `${position}px`;
121148
- next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - position - splitterSize}px`;
121145
+ prev.style.width = `${delta}px`;
121146
+
121147
+ // next λ„ˆλΉ„λŠ” 전체 - prev의 offset - delta - splitter
121148
+ next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - delta - splitterSize}px`;
121149
121149
  } else {
121150
- prev.style.height = `${position}px`;
121151
- next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - position - splitterSize}px`;
121150
+ prev.style.height = `${delta}px`;
121151
+ next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - delta - splitterSize}px`;
121152
121152
  }
121153
121153
  };
121154
121154
 
@@ -82,7 +82,7 @@ class nxSplitter extends HTMLElement {
82
82
  };
83
83
 
84
84
 
85
- const onUp = (e) => {
85
+ const onUp1 = (e) => {
86
86
  window.removeEventListener("mousemove", onMove);
87
87
  window.removeEventListener("mouseup", onUp);
88
88
  dragBar.remove();
@@ -111,6 +111,36 @@ class nxSplitter extends HTMLElement {
111
111
  }
112
112
  };
113
113
 
114
+ const onUp = (e) => {
115
+ window.removeEventListener("mousemove", onMove);
116
+ window.removeEventListener("mouseup", onUp);
117
+ dragBar.remove();
118
+
119
+ const parentRect = parent.getBoundingClientRect();
120
+ const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
121
+
122
+ const prev = this.previousElementSibling;
123
+ const next = this.nextElementSibling;
124
+ if (!prev || !next) return;
125
+
126
+ const prevRect = prev.getBoundingClientRect();
127
+
128
+ // βœ… μƒλŒ€ μœ„μΉ˜ 계산: prev κΈ°μ€€μœΌλ‘œ μ–Όλ§ˆλ‚˜ μ›€μ§μ˜€λŠ”μ§€
129
+ const delta = this.#mode === "h"
130
+ ? e.clientX - prevRect.left
131
+ : e.clientY - prevRect.top;
132
+
133
+ if (this.#mode === "h") {
134
+ prev.style.width = `${delta}px`;
135
+
136
+ // next λ„ˆλΉ„λŠ” 전체 - prev의 offset - delta - splitter
137
+ next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - delta - splitterSize}px`;
138
+ } else {
139
+ prev.style.height = `${delta}px`;
140
+ next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - delta - splitterSize}px`;
141
+ }
142
+ };
143
+
114
144
 
115
145
 
116
146
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.691.0",
4
+ "version": "6.693.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -82,7 +82,7 @@ class nxSplitter extends HTMLElement {
82
82
  };
83
83
 
84
84
 
85
- const onUp = (e) => {
85
+ const onUp1 = (e) => {
86
86
  window.removeEventListener("mousemove", onMove);
87
87
  window.removeEventListener("mouseup", onUp);
88
88
  dragBar.remove();
@@ -111,6 +111,36 @@ class nxSplitter extends HTMLElement {
111
111
  }
112
112
  };
113
113
 
114
+ const onUp = (e) => {
115
+ window.removeEventListener("mousemove", onMove);
116
+ window.removeEventListener("mouseup", onUp);
117
+ dragBar.remove();
118
+
119
+ const parentRect = parent.getBoundingClientRect();
120
+ const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
121
+
122
+ const prev = this.previousElementSibling;
123
+ const next = this.nextElementSibling;
124
+ if (!prev || !next) return;
125
+
126
+ const prevRect = prev.getBoundingClientRect();
127
+
128
+ // βœ… μƒλŒ€ μœ„μΉ˜ 계산: prev κΈ°μ€€μœΌλ‘œ μ–Όλ§ˆλ‚˜ μ›€μ§μ˜€λŠ”μ§€
129
+ const delta = this.#mode === "h"
130
+ ? e.clientX - prevRect.left
131
+ : e.clientY - prevRect.top;
132
+
133
+ if (this.#mode === "h") {
134
+ prev.style.width = `${delta}px`;
135
+
136
+ // next λ„ˆλΉ„λŠ” 전체 - prev의 offset - delta - splitter
137
+ next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - delta - splitterSize}px`;
138
+ } else {
139
+ prev.style.height = `${delta}px`;
140
+ next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - delta - splitterSize}px`;
141
+ }
142
+ };
143
+
114
144
 
115
145
 
116
146