ninegrid2 6.841.0 → 6.843.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.
@@ -121210,19 +121210,26 @@ class nxSplitter extends HTMLElement {
121210
121210
  let el = parent;
121211
121211
  let totalPadding = 0;
121212
121212
 
121213
- while (el && el instanceof Element) {
121214
- console.log(el);
121215
- const style = getComputedStyle(el);
121216
- totalPadding += parseFloat(style.paddingLeft) || 0;
121217
- el = el.offsetParent;
121213
+ while (el) {
121214
+ if (el instanceof Element) {
121215
+ const style = getComputedStyle(el);
121216
+ totalPadding += parseFloat(style.paddingLeft) || 0;
121217
+ el = el.offsetParent; // 일반 DOM에서는 작동
121218
+ } else if (el instanceof ShadowRoot) {
121219
+ // Shadow DOM이면 host를 기준으로 탐색 계속
121220
+ el = el.host?.offsetParent;
121221
+ } else {
121222
+ break;
121223
+ }
121218
121224
  }
121219
121225
 
121226
+
121220
121227
  console.log(totalPadding, e.clientX, parentRect.left);
121221
121228
 
121222
121229
  const left = e.clientX - parentRect.left + totalPadding;
121223
121230
  const top = e.clientY - parentRect.top + paddingTop;
121224
121231
 
121225
- console.log("3------", left, top);
121232
+ console.log("4.------", left, top);
121226
121233
 
121227
121234
  // 방향별 위치 설정
121228
121235
  if (this.#mode === "h") {
@@ -121206,19 +121206,26 @@ class nxSplitter extends HTMLElement {
121206
121206
  let el = parent;
121207
121207
  let totalPadding = 0;
121208
121208
 
121209
- while (el && el instanceof Element) {
121210
- console.log(el);
121211
- const style = getComputedStyle(el);
121212
- totalPadding += parseFloat(style.paddingLeft) || 0;
121213
- el = el.offsetParent;
121209
+ while (el) {
121210
+ if (el instanceof Element) {
121211
+ const style = getComputedStyle(el);
121212
+ totalPadding += parseFloat(style.paddingLeft) || 0;
121213
+ el = el.offsetParent; // 일반 DOM에서는 작동
121214
+ } else if (el instanceof ShadowRoot) {
121215
+ // Shadow DOM이면 host를 기준으로 탐색 계속
121216
+ el = el.host?.offsetParent;
121217
+ } else {
121218
+ break;
121219
+ }
121214
121220
  }
121215
121221
 
121222
+
121216
121223
  console.log(totalPadding, e.clientX, parentRect.left);
121217
121224
 
121218
121225
  const left = e.clientX - parentRect.left + totalPadding;
121219
121226
  const top = e.clientY - parentRect.top + paddingTop;
121220
121227
 
121221
- console.log("3------", left, top);
121228
+ console.log("4.------", left, top);
121222
121229
 
121223
121230
  // 방향별 위치 설정
121224
121231
  if (this.#mode === "h") {
@@ -65,19 +65,26 @@ class nxSplitter extends HTMLElement {
65
65
  let el = parent;
66
66
  let totalPadding = 0;
67
67
 
68
- while (el && el instanceof Element) {
69
- console.log(el);
70
- const style = getComputedStyle(el);
71
- totalPadding += parseFloat(style.paddingLeft) || 0;
72
- el = el.offsetParent;
68
+ while (el) {
69
+ if (el instanceof Element) {
70
+ const style = getComputedStyle(el);
71
+ totalPadding += parseFloat(style.paddingLeft) || 0;
72
+ el = el.offsetParent; // 일반 DOM에서는 작동
73
+ } else if (el instanceof ShadowRoot) {
74
+ // Shadow DOM이면 host를 기준으로 탐색 계속
75
+ el = el.host?.offsetParent;
76
+ } else {
77
+ break;
78
+ }
73
79
  }
74
80
 
81
+
75
82
  console.log(totalPadding, e.clientX, parentRect.left);
76
83
 
77
84
  const left = e.clientX - parentRect.left + totalPadding;
78
85
  const top = e.clientY - parentRect.top + paddingTop;
79
86
 
80
- console.log("3------", left, top);
87
+ console.log("4.------", left, top);
81
88
 
82
89
  // 방향별 위치 설정
83
90
  if (this.#mode === "h") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.841.0",
4
+ "version": "6.843.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -65,19 +65,26 @@ class nxSplitter extends HTMLElement {
65
65
  let el = parent;
66
66
  let totalPadding = 0;
67
67
 
68
- while (el && el instanceof Element) {
69
- console.log(el);
70
- const style = getComputedStyle(el);
71
- totalPadding += parseFloat(style.paddingLeft) || 0;
72
- el = el.offsetParent;
68
+ while (el) {
69
+ if (el instanceof Element) {
70
+ const style = getComputedStyle(el);
71
+ totalPadding += parseFloat(style.paddingLeft) || 0;
72
+ el = el.offsetParent; // 일반 DOM에서는 작동
73
+ } else if (el instanceof ShadowRoot) {
74
+ // Shadow DOM이면 host를 기준으로 탐색 계속
75
+ el = el.host?.offsetParent;
76
+ } else {
77
+ break;
78
+ }
73
79
  }
74
80
 
81
+
75
82
  console.log(totalPadding, e.clientX, parentRect.left);
76
83
 
77
84
  const left = e.clientX - parentRect.left + totalPadding;
78
85
  const top = e.clientY - parentRect.top + paddingTop;
79
86
 
80
- console.log("3------", left, top);
87
+ console.log("4.------", left, top);
81
88
 
82
89
  // 방향별 위치 설정
83
90
  if (this.#mode === "h") {