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.
- package/dist/bundle.cjs.js +12 -16
- package/dist/bundle.esm.js +12 -16
- package/dist/nx/nxLayout2.js +12 -16
- package/package.json +1 -1
- package/src/nx/nxLayout2.js +12 -16
package/dist/bundle.cjs.js
CHANGED
|
@@ -121942,35 +121942,31 @@ class NxLayout2 extends HTMLElement {
|
|
|
121942
121942
|
this.appendChild(rowWrapper);
|
|
121943
121943
|
}
|
|
121944
121944
|
|
|
121945
|
-
|
|
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
|
-
|
|
121959
|
-
|
|
121960
|
-
|
|
121961
|
-
|
|
121962
|
-
|
|
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. 너비 측정
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121938,35 +121938,31 @@ class NxLayout2 extends HTMLElement {
|
|
|
121938
121938
|
this.appendChild(rowWrapper);
|
|
121939
121939
|
}
|
|
121940
121940
|
|
|
121941
|
-
|
|
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
|
-
|
|
121955
|
-
|
|
121956
|
-
|
|
121957
|
-
|
|
121958
|
-
|
|
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. 너비 측정
|
package/dist/nx/nxLayout2.js
CHANGED
|
@@ -55,35 +55,31 @@ class NxLayout2 extends HTMLElement {
|
|
|
55
55
|
this.appendChild(rowWrapper);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
package/src/nx/nxLayout2.js
CHANGED
|
@@ -55,35 +55,31 @@ class NxLayout2 extends HTMLElement {
|
|
|
55
55
|
this.appendChild(rowWrapper);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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. 너비 측정
|