ninegrid2 6.720.0 → 6.722.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.
@@ -121136,6 +121136,8 @@ class nxSplitter extends HTMLElement {
121136
121136
 
121137
121137
  window.removeEventListener("mousemove", onMove);
121138
121138
  window.removeEventListener("mouseup", onUp);
121139
+ dragBar.remove();
121140
+
121139
121141
 
121140
121142
  // 기준: prev + next 너비 합계
121141
121143
  const totalSize = this.#mode === "h"
@@ -121143,19 +121145,17 @@ class nxSplitter extends HTMLElement {
121143
121145
  : prev.offsetHeight + next.offsetHeight;
121144
121146
 
121145
121147
  // prev 기준 상대 거리 (드래그 거리)
121146
-
121147
- const dragRect = dragBar.getBoundingClientRect();
121148
121148
  let delta = this.#mode === "h"
121149
121149
  ? e.clientX - prev.getBoundingClientRect().left
121150
121150
  : e.clientY - prev.getBoundingClientRect().top;
121151
121151
 
121152
- const min = 0;
121153
- const max = totalSize - 0;
121152
+ const min = 1;
121153
+ const max = totalSize - 1;
121154
121154
  delta = Math.max(min, Math.min(delta, max));
121155
121155
 
121156
- console.log(delta, dragRect);
121157
121156
 
121158
- //const prev1 = prev.style.flex;
121157
+ const prev1 = prev.style.flex;
121158
+ const prev2 = next.style.flex;
121159
121159
  prev.style.flex = "none";
121160
121160
  next.style.flex = "none";
121161
121161
 
@@ -121168,8 +121168,10 @@ class nxSplitter extends HTMLElement {
121168
121168
  next.style.height = `${totalSize - delta}px`;
121169
121169
  }
121170
121170
 
121171
+ prev.style.flex = prev1;
121172
+ next.style.flex = prev2;
121173
+
121171
121174
 
121172
- dragBar.remove();
121173
121175
  };
121174
121176
 
121175
121177
  window.addEventListener("mousemove", onMove);
@@ -121132,6 +121132,8 @@ class nxSplitter extends HTMLElement {
121132
121132
 
121133
121133
  window.removeEventListener("mousemove", onMove);
121134
121134
  window.removeEventListener("mouseup", onUp);
121135
+ dragBar.remove();
121136
+
121135
121137
 
121136
121138
  // 기준: prev + next 너비 합계
121137
121139
  const totalSize = this.#mode === "h"
@@ -121139,19 +121141,17 @@ class nxSplitter extends HTMLElement {
121139
121141
  : prev.offsetHeight + next.offsetHeight;
121140
121142
 
121141
121143
  // prev 기준 상대 거리 (드래그 거리)
121142
-
121143
- const dragRect = dragBar.getBoundingClientRect();
121144
121144
  let delta = this.#mode === "h"
121145
121145
  ? e.clientX - prev.getBoundingClientRect().left
121146
121146
  : e.clientY - prev.getBoundingClientRect().top;
121147
121147
 
121148
- const min = 0;
121149
- const max = totalSize - 0;
121148
+ const min = 1;
121149
+ const max = totalSize - 1;
121150
121150
  delta = Math.max(min, Math.min(delta, max));
121151
121151
 
121152
- console.log(delta, dragRect);
121153
121152
 
121154
- //const prev1 = prev.style.flex;
121153
+ const prev1 = prev.style.flex;
121154
+ const prev2 = next.style.flex;
121155
121155
  prev.style.flex = "none";
121156
121156
  next.style.flex = "none";
121157
121157
 
@@ -121164,8 +121164,10 @@ class nxSplitter extends HTMLElement {
121164
121164
  next.style.height = `${totalSize - delta}px`;
121165
121165
  }
121166
121166
 
121167
+ prev.style.flex = prev1;
121168
+ next.style.flex = prev2;
121169
+
121167
121170
 
121168
- dragBar.remove();
121169
121171
  };
121170
121172
 
121171
121173
  window.addEventListener("mousemove", onMove);
@@ -91,6 +91,8 @@ class nxSplitter extends HTMLElement {
91
91
 
92
92
  window.removeEventListener("mousemove", onMove);
93
93
  window.removeEventListener("mouseup", onUp);
94
+ dragBar.remove();
95
+
94
96
 
95
97
  // 기준: prev + next 너비 합계
96
98
  const totalSize = this.#mode === "h"
@@ -98,19 +100,17 @@ class nxSplitter extends HTMLElement {
98
100
  : prev.offsetHeight + next.offsetHeight;
99
101
 
100
102
  // prev 기준 상대 거리 (드래그 거리)
101
-
102
- const dragRect = dragBar.getBoundingClientRect();
103
103
  let delta = this.#mode === "h"
104
104
  ? e.clientX - prev.getBoundingClientRect().left
105
105
  : e.clientY - prev.getBoundingClientRect().top;
106
106
 
107
- const min = 0;
108
- const max = totalSize - 0;
107
+ const min = 1;
108
+ const max = totalSize - 1;
109
109
  delta = Math.max(min, Math.min(delta, max));
110
110
 
111
- console.log(delta, dragRect);
112
111
 
113
- //const prev1 = prev.style.flex;
112
+ const prev1 = prev.style.flex;
113
+ const prev2 = next.style.flex;
114
114
  prev.style.flex = "none";
115
115
  next.style.flex = "none";
116
116
 
@@ -123,8 +123,10 @@ class nxSplitter extends HTMLElement {
123
123
  next.style.height = `${totalSize - delta}px`;
124
124
  }
125
125
 
126
+ prev.style.flex = prev1;
127
+ next.style.flex = prev2;
128
+
126
129
 
127
- dragBar.remove();
128
130
  };
129
131
 
130
132
  window.addEventListener("mousemove", onMove);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.720.0",
4
+ "version": "6.722.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -91,6 +91,8 @@ class nxSplitter extends HTMLElement {
91
91
 
92
92
  window.removeEventListener("mousemove", onMove);
93
93
  window.removeEventListener("mouseup", onUp);
94
+ dragBar.remove();
95
+
94
96
 
95
97
  // 기준: prev + next 너비 합계
96
98
  const totalSize = this.#mode === "h"
@@ -98,19 +100,17 @@ class nxSplitter extends HTMLElement {
98
100
  : prev.offsetHeight + next.offsetHeight;
99
101
 
100
102
  // prev 기준 상대 거리 (드래그 거리)
101
-
102
- const dragRect = dragBar.getBoundingClientRect();
103
103
  let delta = this.#mode === "h"
104
104
  ? e.clientX - prev.getBoundingClientRect().left
105
105
  : e.clientY - prev.getBoundingClientRect().top;
106
106
 
107
- const min = 0;
108
- const max = totalSize - 0;
107
+ const min = 1;
108
+ const max = totalSize - 1;
109
109
  delta = Math.max(min, Math.min(delta, max));
110
110
 
111
- console.log(delta, dragRect);
112
111
 
113
- //const prev1 = prev.style.flex;
112
+ const prev1 = prev.style.flex;
113
+ const prev2 = next.style.flex;
114
114
  prev.style.flex = "none";
115
115
  next.style.flex = "none";
116
116
 
@@ -123,8 +123,10 @@ class nxSplitter extends HTMLElement {
123
123
  next.style.height = `${totalSize - delta}px`;
124
124
  }
125
125
 
126
+ prev.style.flex = prev1;
127
+ next.style.flex = prev2;
128
+
126
129
 
127
- dragBar.remove();
128
130
  };
129
131
 
130
132
  window.addEventListener("mousemove", onMove);