ninegrid2 6.1150.0 → 6.1152.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.
@@ -121946,10 +121946,31 @@ class NxLayout2 extends HTMLElement {
121946
121946
  };
121947
121947
 
121948
121948
  #position = () => {
121949
- console.log(this.querySelectorAll(".row"));
121949
+ const allLabels = [];
121950
+
121951
+ // 1. 모든 .row에서 .label 요소를 찾아서 위치(인덱스)별로 그룹화
121950
121952
  this.querySelectorAll(".row").forEach((el) => {
121951
- const label = el.querySelector(".label");
121952
- label.style.width = "100px";
121953
+ const labelsInRow = el.querySelectorAll(".label");
121954
+ labelsInRow.forEach((label, index) => {
121955
+ if (!allLabels[index]) {
121956
+ allLabels[index] = [];
121957
+ }
121958
+ allLabels[index].push(label);
121959
+ });
121960
+ });
121961
+
121962
+ // 2. 각 그룹(위치)별로 최대 너비 계산 및 적용
121963
+ allLabels.forEach((labelGroup) => {
121964
+ // 그룹이 비어있지 않은지 확인
121965
+ if (labelGroup && labelGroup.length > 0) {
121966
+ // 3. 그룹 내 모든 라벨의 너비 중 가장 큰 값(최대값) 찾기
121967
+ const maxWidth = Math.max(...labelGroup.map(label => label.getBoundingClientRect().width));
121968
+
121969
+ // 4. 계산된 최대 너비를 동일 그룹의 모든 라벨에 적용
121970
+ labelGroup.forEach(label => {
121971
+ label.style.width = `${maxWidth}px`;
121972
+ });
121973
+ }
121953
121974
  });
121954
121975
  };
121955
121976
  }
@@ -121942,10 +121942,31 @@ class NxLayout2 extends HTMLElement {
121942
121942
  };
121943
121943
 
121944
121944
  #position = () => {
121945
- console.log(this.querySelectorAll(".row"));
121945
+ const allLabels = [];
121946
+
121947
+ // 1. 모든 .row에서 .label 요소를 찾아서 위치(인덱스)별로 그룹화
121946
121948
  this.querySelectorAll(".row").forEach((el) => {
121947
- const label = el.querySelector(".label");
121948
- label.style.width = "100px";
121949
+ const labelsInRow = el.querySelectorAll(".label");
121950
+ labelsInRow.forEach((label, index) => {
121951
+ if (!allLabels[index]) {
121952
+ allLabels[index] = [];
121953
+ }
121954
+ allLabels[index].push(label);
121955
+ });
121956
+ });
121957
+
121958
+ // 2. 각 그룹(위치)별로 최대 너비 계산 및 적용
121959
+ allLabels.forEach((labelGroup) => {
121960
+ // 그룹이 비어있지 않은지 확인
121961
+ if (labelGroup && labelGroup.length > 0) {
121962
+ // 3. 그룹 내 모든 라벨의 너비 중 가장 큰 값(최대값) 찾기
121963
+ const maxWidth = Math.max(...labelGroup.map(label => label.getBoundingClientRect().width));
121964
+
121965
+ // 4. 계산된 최대 너비를 동일 그룹의 모든 라벨에 적용
121966
+ labelGroup.forEach(label => {
121967
+ label.style.width = `${maxWidth}px`;
121968
+ });
121969
+ }
121949
121970
  });
121950
121971
  };
121951
121972
  }
@@ -59,11 +59,32 @@ class NxLayout2 extends HTMLElement {
59
59
  };
60
60
 
61
61
  #position = () => {
62
- console.log(this.querySelectorAll(".row"));
62
+ const allLabels = [];
63
+
64
+ // 1. 모든 .row에서 .label 요소를 찾아서 위치(인덱스)별로 그룹화
63
65
  this.querySelectorAll(".row").forEach((el) => {
64
- const label = el.querySelector(".label");
65
- label.style.width = "100px";
66
- })
66
+ const labelsInRow = el.querySelectorAll(".label");
67
+ labelsInRow.forEach((label, index) => {
68
+ if (!allLabels[index]) {
69
+ allLabels[index] = [];
70
+ }
71
+ allLabels[index].push(label);
72
+ });
73
+ });
74
+
75
+ // 2. 각 그룹(위치)별로 최대 너비 계산 및 적용
76
+ allLabels.forEach((labelGroup) => {
77
+ // 그룹이 비어있지 않은지 확인
78
+ if (labelGroup && labelGroup.length > 0) {
79
+ // 3. 그룹 내 모든 라벨의 너비 중 가장 큰 값(최대값) 찾기
80
+ const maxWidth = Math.max(...labelGroup.map(label => label.getBoundingClientRect().width));
81
+
82
+ // 4. 계산된 최대 너비를 동일 그룹의 모든 라벨에 적용
83
+ labelGroup.forEach(label => {
84
+ label.style.width = `${maxWidth}px`;
85
+ });
86
+ }
87
+ });
67
88
  };
68
89
  }
69
90
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1150.0",
4
+ "version": "6.1152.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -59,11 +59,32 @@ class NxLayout2 extends HTMLElement {
59
59
  };
60
60
 
61
61
  #position = () => {
62
- console.log(this.querySelectorAll(".row"));
62
+ const allLabels = [];
63
+
64
+ // 1. 모든 .row에서 .label 요소를 찾아서 위치(인덱스)별로 그룹화
63
65
  this.querySelectorAll(".row").forEach((el) => {
64
- const label = el.querySelector(".label");
65
- label.style.width = "100px";
66
- })
66
+ const labelsInRow = el.querySelectorAll(".label");
67
+ labelsInRow.forEach((label, index) => {
68
+ if (!allLabels[index]) {
69
+ allLabels[index] = [];
70
+ }
71
+ allLabels[index].push(label);
72
+ });
73
+ });
74
+
75
+ // 2. 각 그룹(위치)별로 최대 너비 계산 및 적용
76
+ allLabels.forEach((labelGroup) => {
77
+ // 그룹이 비어있지 않은지 확인
78
+ if (labelGroup && labelGroup.length > 0) {
79
+ // 3. 그룹 내 모든 라벨의 너비 중 가장 큰 값(최대값) 찾기
80
+ const maxWidth = Math.max(...labelGroup.map(label => label.getBoundingClientRect().width));
81
+
82
+ // 4. 계산된 최대 너비를 동일 그룹의 모든 라벨에 적용
83
+ labelGroup.forEach(label => {
84
+ label.style.width = `${maxWidth}px`;
85
+ });
86
+ }
87
+ });
67
88
  };
68
89
  }
69
90