@rchemist/listgrid 0.2.14 → 0.2.15
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.
|
@@ -64,10 +64,22 @@ export const ExcelDownload = async (props) => {
|
|
|
64
64
|
}),
|
|
65
65
|
];
|
|
66
66
|
let ws = XLSX.utils.aoa_to_sheet(aoaData);
|
|
67
|
+
const wb = XLSX.utils.book_new();
|
|
68
|
+
// 만약 skipHeader 가 false 라면 맨 처음 행을 제거한다.
|
|
69
|
+
if (!skipHeader) {
|
|
70
|
+
// 워크시트 데이터를 JSON으로 변환
|
|
71
|
+
const jsonData = XLSX.utils.sheet_to_json(ws, { header: 1 }); // header: 1 -> 배열 형태
|
|
72
|
+
// jsonData.shift(); // 첫 번째 행 제거
|
|
73
|
+
// jsonData로 새로운 워크시트 생성
|
|
74
|
+
ws = XLSX.utils.aoa_to_sheet(jsonData);
|
|
75
|
+
}
|
|
76
|
+
// 첫 두 행 스타일 적용
|
|
77
|
+
const range = XLSX.utils.decode_range(ws['!ref'] || 'A1');
|
|
67
78
|
// 필드 정보를 이용해 셀 타입 및 서식 지정
|
|
79
|
+
// 워크시트 재생성(sheet_to_json -> aoa_to_sheet) 이후에 적용해야
|
|
80
|
+
// cell.t / cell.z 가 보존된다. 재생성 이전에 적용하면 라운드트립 과정에서 손실됨.
|
|
68
81
|
if (props.fields && props.fields.length > 0) {
|
|
69
82
|
const fieldMap = new Map(props.fields.map((f) => [f.getName(), f]));
|
|
70
|
-
const range = XLSX.utils.decode_range(ws['!ref'] || 'A1');
|
|
71
83
|
for (let R = 1; R <= range.e.r; ++R) {
|
|
72
84
|
// 헤더 이후 데이터 행부터
|
|
73
85
|
for (let C = 0; C <= range.e.c; ++C) {
|
|
@@ -94,17 +106,6 @@ export const ExcelDownload = async (props) => {
|
|
|
94
106
|
}
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
|
-
const wb = XLSX.utils.book_new();
|
|
98
|
-
// 만약 skipHeader 가 false 라면 맨 처음 행을 제거한다.
|
|
99
|
-
if (!skipHeader) {
|
|
100
|
-
// 워크시트 데이터를 JSON으로 변환
|
|
101
|
-
const jsonData = XLSX.utils.sheet_to_json(ws, { header: 1 }); // header: 1 -> 배열 형태
|
|
102
|
-
// jsonData.shift(); // 첫 번째 행 제거
|
|
103
|
-
// jsonData로 새로운 워크시트 생성
|
|
104
|
-
ws = XLSX.utils.aoa_to_sheet(jsonData);
|
|
105
|
-
}
|
|
106
|
-
// 첫 두 행 스타일 적용
|
|
107
|
-
const range = XLSX.utils.decode_range(ws['!ref'] || 'A1');
|
|
108
109
|
if (!skipHeader) {
|
|
109
110
|
for (let C = range.s.c; C <= range.e.c; C++) {
|
|
110
111
|
const cell_address = XLSX.utils.encode_cell({ r: 0, c: C });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rchemist/listgrid",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Framework-free React CRUD UI engine — primitive-based design system, data-attr theming, and a full list/form renderer for RCM-framework-style entity backends.",
|
|
6
6
|
"keywords": [
|