ninegrid2 6.688.0 β†’ 6.691.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.
@@ -121134,26 +121134,31 @@ class nxSplitter extends HTMLElement {
121134
121134
 
121135
121135
  const parentRect = parent.getBoundingClientRect();
121136
121136
  const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
121137
- const position = this.#mode === "h"
121138
- ? e.clientX - parentRect.left
121139
- : e.clientY - parentRect.top;
121140
121137
 
121141
121138
  const prev = this.previousElementSibling;
121142
121139
  const next = this.nextElementSibling;
121143
121140
  if (!prev || !next) return;
121144
121141
 
121145
- // πŸ“Œ λ¦¬μ‚¬μ΄μ¦ˆ 적용: μ‚¬μš©μž μ˜λ„μ— 따라 prev, next λͺ¨λ‘ μ—…λ°μ΄νŠΈ
121142
+ const prevRect = prev.getBoundingClientRect();
121143
+
121144
+ // πŸ“Œ λ“œλž˜κ·Έ μœ„μΉ˜μ—μ„œ prev μ‹œμž‘ μœ„μΉ˜λ₯Ό λΊ€ μƒλŒ€ μœ„μΉ˜ (prev κΈ°μ€€)
121145
+ const position = this.#mode === "h"
121146
+ ? e.clientX - prevRect.left
121147
+ : e.clientY - prevRect.top;
121148
+
121149
+ // prev μ‹œμž‘ μœ„μΉ˜ κΈ°μ€€μœΌλ‘œ μƒλŒ€ 크기 μ„€μ •
121146
121150
  if (this.#mode === "h") {
121147
121151
  prev.style.width = `${position}px`;
121148
- next.style.width = `${parentRect.width - position - splitterSize}px`;
121152
+ next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - position - splitterSize}px`;
121149
121153
  } else {
121150
121154
  prev.style.height = `${position}px`;
121151
- next.style.height = `${parentRect.height - position - splitterSize}px`;
121155
+ next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - position - splitterSize}px`;
121152
121156
  }
121153
121157
  };
121154
121158
 
121155
121159
 
121156
121160
 
121161
+
121157
121162
  window.addEventListener("mousemove", onMove);
121158
121163
  window.addEventListener("mouseup", onUp);
121159
121164
  };
@@ -121130,26 +121130,31 @@ class nxSplitter extends HTMLElement {
121130
121130
 
121131
121131
  const parentRect = parent.getBoundingClientRect();
121132
121132
  const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
121133
- const position = this.#mode === "h"
121134
- ? e.clientX - parentRect.left
121135
- : e.clientY - parentRect.top;
121136
121133
 
121137
121134
  const prev = this.previousElementSibling;
121138
121135
  const next = this.nextElementSibling;
121139
121136
  if (!prev || !next) return;
121140
121137
 
121141
- // πŸ“Œ λ¦¬μ‚¬μ΄μ¦ˆ 적용: μ‚¬μš©μž μ˜λ„μ— 따라 prev, next λͺ¨λ‘ μ—…λ°μ΄νŠΈ
121138
+ const prevRect = prev.getBoundingClientRect();
121139
+
121140
+ // πŸ“Œ λ“œλž˜κ·Έ μœ„μΉ˜μ—μ„œ prev μ‹œμž‘ μœ„μΉ˜λ₯Ό λΊ€ μƒλŒ€ μœ„μΉ˜ (prev κΈ°μ€€)
121141
+ const position = this.#mode === "h"
121142
+ ? e.clientX - prevRect.left
121143
+ : e.clientY - prevRect.top;
121144
+
121145
+ // prev μ‹œμž‘ μœ„μΉ˜ κΈ°μ€€μœΌλ‘œ μƒλŒ€ 크기 μ„€μ •
121142
121146
  if (this.#mode === "h") {
121143
121147
  prev.style.width = `${position}px`;
121144
- next.style.width = `${parentRect.width - position - splitterSize}px`;
121148
+ next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - position - splitterSize}px`;
121145
121149
  } else {
121146
121150
  prev.style.height = `${position}px`;
121147
- next.style.height = `${parentRect.height - position - splitterSize}px`;
121151
+ next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - position - splitterSize}px`;
121148
121152
  }
121149
121153
  };
121150
121154
 
121151
121155
 
121152
121156
 
121157
+
121153
121158
  window.addEventListener("mousemove", onMove);
121154
121159
  window.addEventListener("mouseup", onUp);
121155
121160
  };
@@ -89,26 +89,31 @@ class nxSplitter extends HTMLElement {
89
89
 
90
90
  const parentRect = parent.getBoundingClientRect();
91
91
  const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
92
- const position = this.#mode === "h"
93
- ? e.clientX - parentRect.left
94
- : e.clientY - parentRect.top;
95
92
 
96
93
  const prev = this.previousElementSibling;
97
94
  const next = this.nextElementSibling;
98
95
  if (!prev || !next) return;
99
96
 
100
- // πŸ“Œ λ¦¬μ‚¬μ΄μ¦ˆ 적용: μ‚¬μš©μž μ˜λ„μ— 따라 prev, next λͺ¨λ‘ μ—…λ°μ΄νŠΈ
97
+ const prevRect = prev.getBoundingClientRect();
98
+
99
+ // πŸ“Œ λ“œλž˜κ·Έ μœ„μΉ˜μ—μ„œ prev μ‹œμž‘ μœ„μΉ˜λ₯Ό λΊ€ μƒλŒ€ μœ„μΉ˜ (prev κΈ°μ€€)
100
+ const position = this.#mode === "h"
101
+ ? e.clientX - prevRect.left
102
+ : e.clientY - prevRect.top;
103
+
104
+ // prev μ‹œμž‘ μœ„μΉ˜ κΈ°μ€€μœΌλ‘œ μƒλŒ€ 크기 μ„€μ •
101
105
  if (this.#mode === "h") {
102
106
  prev.style.width = `${position}px`;
103
- next.style.width = `${parentRect.width - position - splitterSize}px`;
107
+ next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - position - splitterSize}px`;
104
108
  } else {
105
109
  prev.style.height = `${position}px`;
106
- next.style.height = `${parentRect.height - position - splitterSize}px`;
110
+ next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - position - splitterSize}px`;
107
111
  }
108
112
  };
109
113
 
110
114
 
111
115
 
116
+
112
117
  window.addEventListener("mousemove", onMove);
113
118
  window.addEventListener("mouseup", onUp);
114
119
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.688.0",
4
+ "version": "6.691.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -89,26 +89,31 @@ class nxSplitter extends HTMLElement {
89
89
 
90
90
  const parentRect = parent.getBoundingClientRect();
91
91
  const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
92
- const position = this.#mode === "h"
93
- ? e.clientX - parentRect.left
94
- : e.clientY - parentRect.top;
95
92
 
96
93
  const prev = this.previousElementSibling;
97
94
  const next = this.nextElementSibling;
98
95
  if (!prev || !next) return;
99
96
 
100
- // πŸ“Œ λ¦¬μ‚¬μ΄μ¦ˆ 적용: μ‚¬μš©μž μ˜λ„μ— 따라 prev, next λͺ¨λ‘ μ—…λ°μ΄νŠΈ
97
+ const prevRect = prev.getBoundingClientRect();
98
+
99
+ // πŸ“Œ λ“œλž˜κ·Έ μœ„μΉ˜μ—μ„œ prev μ‹œμž‘ μœ„μΉ˜λ₯Ό λΊ€ μƒλŒ€ μœ„μΉ˜ (prev κΈ°μ€€)
100
+ const position = this.#mode === "h"
101
+ ? e.clientX - prevRect.left
102
+ : e.clientY - prevRect.top;
103
+
104
+ // prev μ‹œμž‘ μœ„μΉ˜ κΈ°μ€€μœΌλ‘œ μƒλŒ€ 크기 μ„€μ •
101
105
  if (this.#mode === "h") {
102
106
  prev.style.width = `${position}px`;
103
- next.style.width = `${parentRect.width - position - splitterSize}px`;
107
+ next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - position - splitterSize}px`;
104
108
  } else {
105
109
  prev.style.height = `${position}px`;
106
- next.style.height = `${parentRect.height - position - splitterSize}px`;
110
+ next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - position - splitterSize}px`;
107
111
  }
108
112
  };
109
113
 
110
114
 
111
115
 
116
+
112
117
  window.addEventListener("mousemove", onMove);
113
118
  window.addEventListener("mouseup", onUp);
114
119
  };