ninegrid2 6.679.0 → 6.682.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.
@@ -121117,12 +121117,35 @@ class nxSplitter extends HTMLElement {
121117
121117
  };
121118
121118
 
121119
121119
 
121120
- const onUp = () => {
121120
+ const onUp = e => {
121121
121121
  window.removeEventListener("mousemove", onMove);
121122
121122
  window.removeEventListener("mouseup", onUp);
121123
121123
  dragBar.remove();
121124
+
121125
+ const parentRect = parent.getBoundingClientRect();
121126
+
121127
+ // 현재 드래그 위치 계산 (부모 기준)
121128
+ const position = (this.#mode === "h")
121129
+ ? e.clientX - parentRect.left
121130
+ : e.clientY - parentRect.top;
121131
+
121132
+ // 형제 요소들
121133
+ const prev = this.previousElementSibling;
121134
+ const next = this.nextElementSibling;
121135
+
121136
+ if (!prev || !next) return;
121137
+
121138
+ if (this.#mode === "h") {
121139
+ prev.style.width = `${position}px`;
121140
+ //next.style.width = `${parentRect.width - position - this.offsetWidth}px`;
121141
+ next.style.width = `100%`;
121142
+ } else {
121143
+ prev.style.height = `${position}px`;
121144
+ next.style.height = `${parentRect.height - position - this.offsetHeight}px`;
121145
+ }
121124
121146
  };
121125
121147
 
121148
+
121126
121149
  window.addEventListener("mousemove", onMove);
121127
121150
  window.addEventListener("mouseup", onUp);
121128
121151
  };
@@ -121113,12 +121113,35 @@ class nxSplitter extends HTMLElement {
121113
121113
  };
121114
121114
 
121115
121115
 
121116
- const onUp = () => {
121116
+ const onUp = e => {
121117
121117
  window.removeEventListener("mousemove", onMove);
121118
121118
  window.removeEventListener("mouseup", onUp);
121119
121119
  dragBar.remove();
121120
+
121121
+ const parentRect = parent.getBoundingClientRect();
121122
+
121123
+ // 현재 드래그 위치 계산 (부모 기준)
121124
+ const position = (this.#mode === "h")
121125
+ ? e.clientX - parentRect.left
121126
+ : e.clientY - parentRect.top;
121127
+
121128
+ // 형제 요소들
121129
+ const prev = this.previousElementSibling;
121130
+ const next = this.nextElementSibling;
121131
+
121132
+ if (!prev || !next) return;
121133
+
121134
+ if (this.#mode === "h") {
121135
+ prev.style.width = `${position}px`;
121136
+ //next.style.width = `${parentRect.width - position - this.offsetWidth}px`;
121137
+ next.style.width = `100%`;
121138
+ } else {
121139
+ prev.style.height = `${position}px`;
121140
+ next.style.height = `${parentRect.height - position - this.offsetHeight}px`;
121141
+ }
121120
121142
  };
121121
121143
 
121144
+
121122
121145
  window.addEventListener("mousemove", onMove);
121123
121146
  window.addEventListener("mouseup", onUp);
121124
121147
  };
@@ -72,12 +72,35 @@ class nxSplitter extends HTMLElement {
72
72
  };
73
73
 
74
74
 
75
- const onUp = () => {
75
+ const onUp = e => {
76
76
  window.removeEventListener("mousemove", onMove);
77
77
  window.removeEventListener("mouseup", onUp);
78
78
  dragBar.remove();
79
+
80
+ const parentRect = parent.getBoundingClientRect();
81
+
82
+ // 현재 드래그 위치 계산 (부모 기준)
83
+ const position = (this.#mode === "h")
84
+ ? e.clientX - parentRect.left
85
+ : e.clientY - parentRect.top;
86
+
87
+ // 형제 요소들
88
+ const prev = this.previousElementSibling;
89
+ const next = this.nextElementSibling;
90
+
91
+ if (!prev || !next) return;
92
+
93
+ if (this.#mode === "h") {
94
+ prev.style.width = `${position}px`;
95
+ //next.style.width = `${parentRect.width - position - this.offsetWidth}px`;
96
+ next.style.width = `100%`;
97
+ } else {
98
+ prev.style.height = `${position}px`;
99
+ next.style.height = `${parentRect.height - position - this.offsetHeight}px`;
100
+ }
79
101
  };
80
102
 
103
+
81
104
  window.addEventListener("mousemove", onMove);
82
105
  window.addEventListener("mouseup", onUp);
83
106
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.679.0",
4
+ "version": "6.682.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -72,12 +72,35 @@ class nxSplitter extends HTMLElement {
72
72
  };
73
73
 
74
74
 
75
- const onUp = () => {
75
+ const onUp = e => {
76
76
  window.removeEventListener("mousemove", onMove);
77
77
  window.removeEventListener("mouseup", onUp);
78
78
  dragBar.remove();
79
+
80
+ const parentRect = parent.getBoundingClientRect();
81
+
82
+ // 현재 드래그 위치 계산 (부모 기준)
83
+ const position = (this.#mode === "h")
84
+ ? e.clientX - parentRect.left
85
+ : e.clientY - parentRect.top;
86
+
87
+ // 형제 요소들
88
+ const prev = this.previousElementSibling;
89
+ const next = this.nextElementSibling;
90
+
91
+ if (!prev || !next) return;
92
+
93
+ if (this.#mode === "h") {
94
+ prev.style.width = `${position}px`;
95
+ //next.style.width = `${parentRect.width - position - this.offsetWidth}px`;
96
+ next.style.width = `100%`;
97
+ } else {
98
+ prev.style.height = `${position}px`;
99
+ next.style.height = `${parentRect.height - position - this.offsetHeight}px`;
100
+ }
79
101
  };
80
102
 
103
+
81
104
  window.addEventListener("mousemove", onMove);
82
105
  window.addEventListener("mouseup", onUp);
83
106
  };