ninegrid2 6.1161.0 → 6.1163.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.
@@ -121942,35 +121942,31 @@ class NxLayout2 extends HTMLElement {
121942
121942
  this.appendChild(rowWrapper);
121943
121943
  }
121944
121944
 
121945
- this.#position();
121945
+ setTimeout(() => {
121946
+ this.#position();
121947
+ }, 500);
121946
121948
  };
121947
121949
 
121948
121950
  #position = () => {
121949
121951
  const getRenderedWidthWithClone = (element) => {
121952
+ // 1. 요소의 계산된 스타일을 가져옵니다.
121950
121953
  const computedStyle = window.getComputedStyle(element);
121951
121954
 
121952
- // 커스텀 속성 값을 직접 가져옵니다. ⭐
121953
- const fontSize = computedStyle.getPropertyValue('font-size') || '16px';
121954
- const fontFamily = computedStyle.getPropertyValue('font-family') || 'sans-serif';
121955
-
121955
+ // 2. 복사본을 생성합니다.
121956
121956
  const clone = element.cloneNode(true);
121957
121957
 
121958
- for (const prop of computedStyle) {
121959
- clone.style[prop] = computedStyle.getPropertyValue(prop);
121960
- }
121961
-
121962
- console.log(fontSize);
121963
-
121964
- // ⭐ 폰트 스타일을 명시적으로 재정의합니다. ⭐
121965
- clone.style.fontSize = fontSize;
121966
- clone.style.fontFamily = fontFamily;
121958
+ // 3. 복사본에 필요한 스타일만 명시적으로 적용합니다.
121959
+ // 이렇게 하면 부모가 숨겨져 있어도 정확한 스타일을 얻을 수 있습니다.
121960
+ clone.style.fontSize = computedStyle.fontSize;
121961
+ clone.style.fontFamily = computedStyle.fontFamily;
121962
+ clone.style.fontWeight = computedStyle.fontWeight;
121967
121963
 
121968
- // 4. 복제본을 시각적으로 숨기고 레이아웃에 포함시킬 스타일을 적용합니다.
121964
+ // 4. 복제본을 화면 밖으로 이동시킬 스타일을 적용합니다.
121969
121965
  clone.style.position = 'absolute';
121970
121966
  clone.style.left = '-9999px';
121971
121967
  clone.style.visibility = 'hidden';
121972
121968
 
121973
- // 5. 복제본을 body에 임시로 추가하여 렌더링되도록 합니다.
121969
+ // 5. 복제본을 body에 임시로 추가합니다.
121974
121970
  document.body.appendChild(clone);
121975
121971
 
121976
121972
  // 6. 너비 측정
@@ -121938,35 +121938,31 @@ class NxLayout2 extends HTMLElement {
121938
121938
  this.appendChild(rowWrapper);
121939
121939
  }
121940
121940
 
121941
- this.#position();
121941
+ setTimeout(() => {
121942
+ this.#position();
121943
+ }, 500);
121942
121944
  };
121943
121945
 
121944
121946
  #position = () => {
121945
121947
  const getRenderedWidthWithClone = (element) => {
121948
+ // 1. 요소의 계산된 스타일을 가져옵니다.
121946
121949
  const computedStyle = window.getComputedStyle(element);
121947
121950
 
121948
- // 커스텀 속성 값을 직접 가져옵니다. ⭐
121949
- const fontSize = computedStyle.getPropertyValue('font-size') || '16px';
121950
- const fontFamily = computedStyle.getPropertyValue('font-family') || 'sans-serif';
121951
-
121951
+ // 2. 복사본을 생성합니다.
121952
121952
  const clone = element.cloneNode(true);
121953
121953
 
121954
- for (const prop of computedStyle) {
121955
- clone.style[prop] = computedStyle.getPropertyValue(prop);
121956
- }
121957
-
121958
- console.log(fontSize);
121959
-
121960
- // ⭐ 폰트 스타일을 명시적으로 재정의합니다. ⭐
121961
- clone.style.fontSize = fontSize;
121962
- clone.style.fontFamily = fontFamily;
121954
+ // 3. 복사본에 필요한 스타일만 명시적으로 적용합니다.
121955
+ // 이렇게 하면 부모가 숨겨져 있어도 정확한 스타일을 얻을 수 있습니다.
121956
+ clone.style.fontSize = computedStyle.fontSize;
121957
+ clone.style.fontFamily = computedStyle.fontFamily;
121958
+ clone.style.fontWeight = computedStyle.fontWeight;
121963
121959
 
121964
- // 4. 복제본을 시각적으로 숨기고 레이아웃에 포함시킬 스타일을 적용합니다.
121960
+ // 4. 복제본을 화면 밖으로 이동시킬 스타일을 적용합니다.
121965
121961
  clone.style.position = 'absolute';
121966
121962
  clone.style.left = '-9999px';
121967
121963
  clone.style.visibility = 'hidden';
121968
121964
 
121969
- // 5. 복제본을 body에 임시로 추가하여 렌더링되도록 합니다.
121965
+ // 5. 복제본을 body에 임시로 추가합니다.
121970
121966
  document.body.appendChild(clone);
121971
121967
 
121972
121968
  // 6. 너비 측정
@@ -55,35 +55,31 @@ class NxLayout2 extends HTMLElement {
55
55
  this.appendChild(rowWrapper);
56
56
  }
57
57
 
58
- this.#position();
58
+ setTimeout(() => {
59
+ this.#position();
60
+ }, 500);
59
61
  };
60
62
 
61
63
  #position = () => {
62
64
  const getRenderedWidthWithClone = (element) => {
65
+ // 1. 요소의 계산된 스타일을 가져옵니다.
63
66
  const computedStyle = window.getComputedStyle(element);
64
67
 
65
- // 커스텀 속성 값을 직접 가져옵니다. ⭐
66
- const fontSize = computedStyle.getPropertyValue('font-size') || '16px';
67
- const fontFamily = computedStyle.getPropertyValue('font-family') || 'sans-serif';
68
-
68
+ // 2. 복사본을 생성합니다.
69
69
  const clone = element.cloneNode(true);
70
70
 
71
- for (const prop of computedStyle) {
72
- clone.style[prop] = computedStyle.getPropertyValue(prop);
73
- }
74
-
75
- console.log(fontSize);
76
-
77
- // ⭐ 폰트 스타일을 명시적으로 재정의합니다. ⭐
78
- clone.style.fontSize = fontSize;
79
- clone.style.fontFamily = fontFamily;
71
+ // 3. 복사본에 필요한 스타일만 명시적으로 적용합니다.
72
+ // 이렇게 하면 부모가 숨겨져 있어도 정확한 스타일을 얻을 수 있습니다.
73
+ clone.style.fontSize = computedStyle.fontSize;
74
+ clone.style.fontFamily = computedStyle.fontFamily;
75
+ clone.style.fontWeight = computedStyle.fontWeight;
80
76
 
81
- // 4. 복제본을 시각적으로 숨기고 레이아웃에 포함시킬 스타일을 적용합니다.
77
+ // 4. 복제본을 화면 밖으로 이동시킬 스타일을 적용합니다.
82
78
  clone.style.position = 'absolute';
83
79
  clone.style.left = '-9999px';
84
80
  clone.style.visibility = 'hidden';
85
81
 
86
- // 5. 복제본을 body에 임시로 추가하여 렌더링되도록 합니다.
82
+ // 5. 복제본을 body에 임시로 추가합니다.
87
83
  document.body.appendChild(clone);
88
84
 
89
85
  // 6. 너비 측정
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1161.0",
4
+ "version": "6.1163.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -55,35 +55,31 @@ class NxLayout2 extends HTMLElement {
55
55
  this.appendChild(rowWrapper);
56
56
  }
57
57
 
58
- this.#position();
58
+ setTimeout(() => {
59
+ this.#position();
60
+ }, 500);
59
61
  };
60
62
 
61
63
  #position = () => {
62
64
  const getRenderedWidthWithClone = (element) => {
65
+ // 1. 요소의 계산된 스타일을 가져옵니다.
63
66
  const computedStyle = window.getComputedStyle(element);
64
67
 
65
- // 커스텀 속성 값을 직접 가져옵니다. ⭐
66
- const fontSize = computedStyle.getPropertyValue('font-size') || '16px';
67
- const fontFamily = computedStyle.getPropertyValue('font-family') || 'sans-serif';
68
-
68
+ // 2. 복사본을 생성합니다.
69
69
  const clone = element.cloneNode(true);
70
70
 
71
- for (const prop of computedStyle) {
72
- clone.style[prop] = computedStyle.getPropertyValue(prop);
73
- }
74
-
75
- console.log(fontSize);
76
-
77
- // ⭐ 폰트 스타일을 명시적으로 재정의합니다. ⭐
78
- clone.style.fontSize = fontSize;
79
- clone.style.fontFamily = fontFamily;
71
+ // 3. 복사본에 필요한 스타일만 명시적으로 적용합니다.
72
+ // 이렇게 하면 부모가 숨겨져 있어도 정확한 스타일을 얻을 수 있습니다.
73
+ clone.style.fontSize = computedStyle.fontSize;
74
+ clone.style.fontFamily = computedStyle.fontFamily;
75
+ clone.style.fontWeight = computedStyle.fontWeight;
80
76
 
81
- // 4. 복제본을 시각적으로 숨기고 레이아웃에 포함시킬 스타일을 적용합니다.
77
+ // 4. 복제본을 화면 밖으로 이동시킬 스타일을 적용합니다.
82
78
  clone.style.position = 'absolute';
83
79
  clone.style.left = '-9999px';
84
80
  clone.style.visibility = 'hidden';
85
81
 
86
- // 5. 복제본을 body에 임시로 추가하여 렌더링되도록 합니다.
82
+ // 5. 복제본을 body에 임시로 추가합니다.
87
83
  document.body.appendChild(clone);
88
84
 
89
85
  // 6. 너비 측정