ninegrid2 6.717.0 → 6.718.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.
@@ -121145,9 +121145,13 @@ class nxSplitter extends HTMLElement {
121145
121145
  // prev 기준 상대 거리 (드래그 거리)
121146
121146
 
121147
121147
  const dragRect = dragBar.getBoundingClientRect();
121148
- const delta = this.#mode === "h"
121149
- ? dragRect.left - prev.offsetLeft
121150
- : dragRect.top - prev.offsetTop;
121148
+ let delta = this.#mode === "h"
121149
+ ? e.clientX - prev.getBoundingClientRect().left
121150
+ : e.clientY - prev.getBoundingClientRect().top;
121151
+
121152
+ const min = 50;
121153
+ const max = totalSize - 50;
121154
+ delta = Math.max(min, Math.min(delta, max));
121151
121155
 
121152
121156
  console.log(delta, dragRect);
121153
121157
 
@@ -121141,9 +121141,13 @@ class nxSplitter extends HTMLElement {
121141
121141
  // prev 기준 상대 거리 (드래그 거리)
121142
121142
 
121143
121143
  const dragRect = dragBar.getBoundingClientRect();
121144
- const delta = this.#mode === "h"
121145
- ? dragRect.left - prev.offsetLeft
121146
- : dragRect.top - prev.offsetTop;
121144
+ let delta = this.#mode === "h"
121145
+ ? e.clientX - prev.getBoundingClientRect().left
121146
+ : e.clientY - prev.getBoundingClientRect().top;
121147
+
121148
+ const min = 50;
121149
+ const max = totalSize - 50;
121150
+ delta = Math.max(min, Math.min(delta, max));
121147
121151
 
121148
121152
  console.log(delta, dragRect);
121149
121153
 
@@ -100,9 +100,13 @@ class nxSplitter extends HTMLElement {
100
100
  // prev 기준 상대 거리 (드래그 거리)
101
101
 
102
102
  const dragRect = dragBar.getBoundingClientRect();
103
- const delta = this.#mode === "h"
104
- ? dragRect.left - prev.offsetLeft
105
- : dragRect.top - prev.offsetTop;
103
+ let delta = this.#mode === "h"
104
+ ? e.clientX - prev.getBoundingClientRect().left
105
+ : e.clientY - prev.getBoundingClientRect().top;
106
+
107
+ const min = 50;
108
+ const max = totalSize - 50;
109
+ delta = Math.max(min, Math.min(delta, max));
106
110
 
107
111
  console.log(delta, dragRect);
108
112
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.717.0",
4
+ "version": "6.718.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -100,9 +100,13 @@ class nxSplitter extends HTMLElement {
100
100
  // prev 기준 상대 거리 (드래그 거리)
101
101
 
102
102
  const dragRect = dragBar.getBoundingClientRect();
103
- const delta = this.#mode === "h"
104
- ? dragRect.left - prev.offsetLeft
105
- : dragRect.top - prev.offsetTop;
103
+ let delta = this.#mode === "h"
104
+ ? e.clientX - prev.getBoundingClientRect().left
105
+ : e.clientY - prev.getBoundingClientRect().top;
106
+
107
+ const min = 50;
108
+ const max = totalSize - 50;
109
+ delta = Math.max(min, Math.min(delta, max));
106
110
 
107
111
  console.log(delta, dragRect);
108
112