ninegrid2 6.676.0 → 6.678.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.
@@ -121081,26 +121081,36 @@ class nxSplitter extends HTMLElement {
121081
121081
  pointerEvents: "none"
121082
121082
  });
121083
121083
 
121084
+ const parent = this.getRootNode().host || this.parentElement;
121085
+ const parentRect = parent.getBoundingClientRect();
121086
+ const left = e.clientX - parentRect.left;
121087
+ const top = e.clientY - parentRect.top;
121088
+
121084
121089
  // 방향별 위치 설정
121085
121090
  if (this.#mode === "h") {
121086
121091
  dragBar.style.top = "0";
121087
- dragBar.style.left = `${e.offsetX}px`;
121092
+ dragBar.style.left = `${left}px`;
121088
121093
  dragBar.style.width = "1px";
121089
121094
  dragBar.style.height = "100%";
121090
121095
  } else {
121091
121096
  dragBar.style.left = "0";
121092
- dragBar.style.top = `${e.offsetY}px`;
121097
+ dragBar.style.top = `${top}px`;
121093
121098
  dragBar.style.height = "1px";
121094
121099
  dragBar.style.width = "100%";
121095
121100
  }
121096
121101
 
121097
121102
  // 👇 부모 노드 기준으로 삽입
121098
- const parent = this.getRootNode().host || this.parentElement;
121099
121103
  parent.appendChild(dragBar);
121100
121104
 
121101
121105
  const onMove = e => {
121102
- if (this.#mode === "h") dragBar.style.left = `${e.offsetX}px`;
121103
- else dragBar.style.top = `${e.offsetY}px`;
121106
+ const rect = parent.getBoundingClientRect();
121107
+ if (this.#mode === "h") {
121108
+ const left = e.clientX - rect.left;
121109
+ dragBar.style.left = `${left}px`;
121110
+ } else {
121111
+ const top = e.clientY - rect.top;
121112
+ dragBar.style.top = `${top}px`;
121113
+ }
121104
121114
  };
121105
121115
 
121106
121116
  const onUp = () => {
@@ -121077,26 +121077,36 @@ class nxSplitter extends HTMLElement {
121077
121077
  pointerEvents: "none"
121078
121078
  });
121079
121079
 
121080
+ const parent = this.getRootNode().host || this.parentElement;
121081
+ const parentRect = parent.getBoundingClientRect();
121082
+ const left = e.clientX - parentRect.left;
121083
+ const top = e.clientY - parentRect.top;
121084
+
121080
121085
  // 방향별 위치 설정
121081
121086
  if (this.#mode === "h") {
121082
121087
  dragBar.style.top = "0";
121083
- dragBar.style.left = `${e.offsetX}px`;
121088
+ dragBar.style.left = `${left}px`;
121084
121089
  dragBar.style.width = "1px";
121085
121090
  dragBar.style.height = "100%";
121086
121091
  } else {
121087
121092
  dragBar.style.left = "0";
121088
- dragBar.style.top = `${e.offsetY}px`;
121093
+ dragBar.style.top = `${top}px`;
121089
121094
  dragBar.style.height = "1px";
121090
121095
  dragBar.style.width = "100%";
121091
121096
  }
121092
121097
 
121093
121098
  // 👇 부모 노드 기준으로 삽입
121094
- const parent = this.getRootNode().host || this.parentElement;
121095
121099
  parent.appendChild(dragBar);
121096
121100
 
121097
121101
  const onMove = e => {
121098
- if (this.#mode === "h") dragBar.style.left = `${e.offsetX}px`;
121099
- else dragBar.style.top = `${e.offsetY}px`;
121102
+ const rect = parent.getBoundingClientRect();
121103
+ if (this.#mode === "h") {
121104
+ const left = e.clientX - rect.left;
121105
+ dragBar.style.left = `${left}px`;
121106
+ } else {
121107
+ const top = e.clientY - rect.top;
121108
+ dragBar.style.top = `${top}px`;
121109
+ }
121100
121110
  };
121101
121111
 
121102
121112
  const onUp = () => {
@@ -36,26 +36,36 @@ class nxSplitter extends HTMLElement {
36
36
  pointerEvents: "none"
37
37
  });
38
38
 
39
+ const parent = this.getRootNode().host || this.parentElement;
40
+ const parentRect = parent.getBoundingClientRect();
41
+ const left = e.clientX - parentRect.left;
42
+ const top = e.clientY - parentRect.top;
43
+
39
44
  // 방향별 위치 설정
40
45
  if (this.#mode === "h") {
41
46
  dragBar.style.top = "0";
42
- dragBar.style.left = `${e.offsetX}px`;
47
+ dragBar.style.left = `${left}px`;
43
48
  dragBar.style.width = "1px";
44
49
  dragBar.style.height = "100%";
45
50
  } else {
46
51
  dragBar.style.left = "0";
47
- dragBar.style.top = `${e.offsetY}px`;
52
+ dragBar.style.top = `${top}px`;
48
53
  dragBar.style.height = "1px";
49
54
  dragBar.style.width = "100%";
50
55
  }
51
56
 
52
57
  // 👇 부모 노드 기준으로 삽입
53
- const parent = this.getRootNode().host || this.parentElement;
54
58
  parent.appendChild(dragBar);
55
59
 
56
60
  const onMove = e => {
57
- if (this.#mode === "h") dragBar.style.left = `${e.offsetX}px`;
58
- else dragBar.style.top = `${e.offsetY}px`;
61
+ const rect = parent.getBoundingClientRect();
62
+ if (this.#mode === "h") {
63
+ const left = e.clientX - rect.left;
64
+ dragBar.style.left = `${left}px`;
65
+ } else {
66
+ const top = e.clientY - rect.top;
67
+ dragBar.style.top = `${top}px`;
68
+ }
59
69
  };
60
70
 
61
71
  const onUp = () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.676.0",
4
+ "version": "6.678.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -36,26 +36,36 @@ class nxSplitter extends HTMLElement {
36
36
  pointerEvents: "none"
37
37
  });
38
38
 
39
+ const parent = this.getRootNode().host || this.parentElement;
40
+ const parentRect = parent.getBoundingClientRect();
41
+ const left = e.clientX - parentRect.left;
42
+ const top = e.clientY - parentRect.top;
43
+
39
44
  // 방향별 위치 설정
40
45
  if (this.#mode === "h") {
41
46
  dragBar.style.top = "0";
42
- dragBar.style.left = `${e.offsetX}px`;
47
+ dragBar.style.left = `${left}px`;
43
48
  dragBar.style.width = "1px";
44
49
  dragBar.style.height = "100%";
45
50
  } else {
46
51
  dragBar.style.left = "0";
47
- dragBar.style.top = `${e.offsetY}px`;
52
+ dragBar.style.top = `${top}px`;
48
53
  dragBar.style.height = "1px";
49
54
  dragBar.style.width = "100%";
50
55
  }
51
56
 
52
57
  // 👇 부모 노드 기준으로 삽입
53
- const parent = this.getRootNode().host || this.parentElement;
54
58
  parent.appendChild(dragBar);
55
59
 
56
60
  const onMove = e => {
57
- if (this.#mode === "h") dragBar.style.left = `${e.offsetX}px`;
58
- else dragBar.style.top = `${e.offsetY}px`;
61
+ const rect = parent.getBoundingClientRect();
62
+ if (this.#mode === "h") {
63
+ const left = e.clientX - rect.left;
64
+ dragBar.style.left = `${left}px`;
65
+ } else {
66
+ const top = e.clientY - rect.top;
67
+ dragBar.style.top = `${top}px`;
68
+ }
59
69
  };
60
70
 
61
71
  const onUp = () => {