ninegrid2 6.678.0 → 6.679.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.
@@ -121104,15 +121104,19 @@ class nxSplitter extends HTMLElement {
121104
121104
 
121105
121105
  const onMove = e => {
121106
121106
  const rect = parent.getBoundingClientRect();
121107
+
121107
121108
  if (this.#mode === "h") {
121108
- const left = e.clientX - rect.left;
121109
+ let left = e.clientX - rect.left;
121110
+ left = Math.max(0, Math.min(left, rect.width)); // 0 ~ width 범위 제한
121109
121111
  dragBar.style.left = `${left}px`;
121110
121112
  } else {
121111
- const top = e.clientY - rect.top;
121113
+ let top = e.clientY - rect.top;
121114
+ top = Math.max(0, Math.min(top, rect.height)); // 0 ~ height 범위 제한
121112
121115
  dragBar.style.top = `${top}px`;
121113
121116
  }
121114
121117
  };
121115
121118
 
121119
+
121116
121120
  const onUp = () => {
121117
121121
  window.removeEventListener("mousemove", onMove);
121118
121122
  window.removeEventListener("mouseup", onUp);
@@ -121100,15 +121100,19 @@ class nxSplitter extends HTMLElement {
121100
121100
 
121101
121101
  const onMove = e => {
121102
121102
  const rect = parent.getBoundingClientRect();
121103
+
121103
121104
  if (this.#mode === "h") {
121104
- const left = e.clientX - rect.left;
121105
+ let left = e.clientX - rect.left;
121106
+ left = Math.max(0, Math.min(left, rect.width)); // 0 ~ width 범위 제한
121105
121107
  dragBar.style.left = `${left}px`;
121106
121108
  } else {
121107
- const top = e.clientY - rect.top;
121109
+ let top = e.clientY - rect.top;
121110
+ top = Math.max(0, Math.min(top, rect.height)); // 0 ~ height 범위 제한
121108
121111
  dragBar.style.top = `${top}px`;
121109
121112
  }
121110
121113
  };
121111
121114
 
121115
+
121112
121116
  const onUp = () => {
121113
121117
  window.removeEventListener("mousemove", onMove);
121114
121118
  window.removeEventListener("mouseup", onUp);
@@ -59,15 +59,19 @@ class nxSplitter extends HTMLElement {
59
59
 
60
60
  const onMove = e => {
61
61
  const rect = parent.getBoundingClientRect();
62
+
62
63
  if (this.#mode === "h") {
63
- const left = e.clientX - rect.left;
64
+ let left = e.clientX - rect.left;
65
+ left = Math.max(0, Math.min(left, rect.width)); // 0 ~ width 범위 제한
64
66
  dragBar.style.left = `${left}px`;
65
67
  } else {
66
- const top = e.clientY - rect.top;
68
+ let top = e.clientY - rect.top;
69
+ top = Math.max(0, Math.min(top, rect.height)); // 0 ~ height 범위 제한
67
70
  dragBar.style.top = `${top}px`;
68
71
  }
69
72
  };
70
73
 
74
+
71
75
  const onUp = () => {
72
76
  window.removeEventListener("mousemove", onMove);
73
77
  window.removeEventListener("mouseup", onUp);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.678.0",
4
+ "version": "6.679.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -59,15 +59,19 @@ class nxSplitter extends HTMLElement {
59
59
 
60
60
  const onMove = e => {
61
61
  const rect = parent.getBoundingClientRect();
62
+
62
63
  if (this.#mode === "h") {
63
- const left = e.clientX - rect.left;
64
+ let left = e.clientX - rect.left;
65
+ left = Math.max(0, Math.min(left, rect.width)); // 0 ~ width 범위 제한
64
66
  dragBar.style.left = `${left}px`;
65
67
  } else {
66
- const top = e.clientY - rect.top;
68
+ let top = e.clientY - rect.top;
69
+ top = Math.max(0, Math.min(top, rect.height)); // 0 ~ height 범위 제한
67
70
  dragBar.style.top = `${top}px`;
68
71
  }
69
72
  };
70
73
 
74
+
71
75
  const onUp = () => {
72
76
  window.removeEventListener("mousemove", onMove);
73
77
  window.removeEventListener("mouseup", onUp);