ninegrid2 6.1158.0 → 6.1160.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.
@@ -121947,19 +121947,24 @@ class NxLayout2 extends HTMLElement {
121947
121947
 
121948
121948
  #position = () => {
121949
121949
  const getRenderedWidthWithClone = (element) => {
121950
- // 1. 요소의 모든 계산된 스타일을 가져옵니다.
121951
121950
  const computedStyle = window.getComputedStyle(element);
121952
121951
 
121953
- // 2. 요소를 깊은 복제합니다.
121952
+ // 커스텀 속성 값을 직접 가져옵니다. ⭐
121953
+ const fontSize = computedStyle.getPropertyValue('font-size') || '16px';
121954
+ const fontFamily = computedStyle.getPropertyValue('font-family') || 'sans-serif';
121955
+
121954
121956
  const clone = element.cloneNode(true);
121955
121957
 
121956
- // 3. 복사본에 가져온 모든 스타일을 적용합니다.
121957
121958
  for (const prop of computedStyle) {
121958
-
121959
121959
  clone.style[prop] = computedStyle.getPropertyValue(prop);
121960
- console.log(prop, clone.style[prop]);
121961
121960
  }
121962
121961
 
121962
+ console.log(fontSize);
121963
+
121964
+ // ⭐ 폰트 스타일을 명시적으로 재정의합니다. ⭐
121965
+ clone.style.fontSize = fontSize;
121966
+ clone.style.fontFamily = fontFamily;
121967
+
121963
121968
  // 4. 복제본을 시각적으로 숨기고 레이아웃에 포함시킬 스타일을 적용합니다.
121964
121969
  clone.style.position = 'absolute';
121965
121970
  clone.style.left = '-9999px';
@@ -121943,19 +121943,24 @@ class NxLayout2 extends HTMLElement {
121943
121943
 
121944
121944
  #position = () => {
121945
121945
  const getRenderedWidthWithClone = (element) => {
121946
- // 1. 요소의 모든 계산된 스타일을 가져옵니다.
121947
121946
  const computedStyle = window.getComputedStyle(element);
121948
121947
 
121949
- // 2. 요소를 깊은 복제합니다.
121948
+ // 커스텀 속성 값을 직접 가져옵니다. ⭐
121949
+ const fontSize = computedStyle.getPropertyValue('font-size') || '16px';
121950
+ const fontFamily = computedStyle.getPropertyValue('font-family') || 'sans-serif';
121951
+
121950
121952
  const clone = element.cloneNode(true);
121951
121953
 
121952
- // 3. 복사본에 가져온 모든 스타일을 적용합니다.
121953
121954
  for (const prop of computedStyle) {
121954
-
121955
121955
  clone.style[prop] = computedStyle.getPropertyValue(prop);
121956
- console.log(prop, clone.style[prop]);
121957
121956
  }
121958
121957
 
121958
+ console.log(fontSize);
121959
+
121960
+ // ⭐ 폰트 스타일을 명시적으로 재정의합니다. ⭐
121961
+ clone.style.fontSize = fontSize;
121962
+ clone.style.fontFamily = fontFamily;
121963
+
121959
121964
  // 4. 복제본을 시각적으로 숨기고 레이아웃에 포함시킬 스타일을 적용합니다.
121960
121965
  clone.style.position = 'absolute';
121961
121966
  clone.style.left = '-9999px';
@@ -60,19 +60,24 @@ class NxLayout2 extends HTMLElement {
60
60
 
61
61
  #position = () => {
62
62
  const getRenderedWidthWithClone = (element) => {
63
- // 1. 요소의 모든 계산된 스타일을 가져옵니다.
64
63
  const computedStyle = window.getComputedStyle(element);
65
64
 
66
- // 2. 요소를 깊은 복제합니다.
65
+ // 커스텀 속성 값을 직접 가져옵니다. ⭐
66
+ const fontSize = computedStyle.getPropertyValue('font-size') || '16px';
67
+ const fontFamily = computedStyle.getPropertyValue('font-family') || 'sans-serif';
68
+
67
69
  const clone = element.cloneNode(true);
68
70
 
69
- // 3. 복사본에 가져온 모든 스타일을 적용합니다.
70
71
  for (const prop of computedStyle) {
71
-
72
72
  clone.style[prop] = computedStyle.getPropertyValue(prop);
73
- console.log(prop, clone.style[prop]);
74
73
  }
75
74
 
75
+ console.log(fontSize);
76
+
77
+ // ⭐ 폰트 스타일을 명시적으로 재정의합니다. ⭐
78
+ clone.style.fontSize = fontSize;
79
+ clone.style.fontFamily = fontFamily;
80
+
76
81
  // 4. 복제본을 시각적으로 숨기고 레이아웃에 포함시킬 스타일을 적용합니다.
77
82
  clone.style.position = 'absolute';
78
83
  clone.style.left = '-9999px';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1158.0",
4
+ "version": "6.1160.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -60,19 +60,24 @@ class NxLayout2 extends HTMLElement {
60
60
 
61
61
  #position = () => {
62
62
  const getRenderedWidthWithClone = (element) => {
63
- // 1. 요소의 모든 계산된 스타일을 가져옵니다.
64
63
  const computedStyle = window.getComputedStyle(element);
65
64
 
66
- // 2. 요소를 깊은 복제합니다.
65
+ // 커스텀 속성 값을 직접 가져옵니다. ⭐
66
+ const fontSize = computedStyle.getPropertyValue('font-size') || '16px';
67
+ const fontFamily = computedStyle.getPropertyValue('font-family') || 'sans-serif';
68
+
67
69
  const clone = element.cloneNode(true);
68
70
 
69
- // 3. 복사본에 가져온 모든 스타일을 적용합니다.
70
71
  for (const prop of computedStyle) {
71
-
72
72
  clone.style[prop] = computedStyle.getPropertyValue(prop);
73
- console.log(prop, clone.style[prop]);
74
73
  }
75
74
 
75
+ console.log(fontSize);
76
+
77
+ // ⭐ 폰트 스타일을 명시적으로 재정의합니다. ⭐
78
+ clone.style.fontSize = fontSize;
79
+ clone.style.fontFamily = fontFamily;
80
+
76
81
  // 4. 복제본을 시각적으로 숨기고 레이아웃에 포함시킬 스타일을 적용합니다.
77
82
  clone.style.position = 'absolute';
78
83
  clone.style.left = '-9999px';