aq-fe-framework 0.1.693 → 0.1.694
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/{chunk-AEZIAU63.mjs → chunk-2B2FKBKX.mjs} +21 -0
- package/dist/{chunk-O4ZAYHJQ.mjs → chunk-4EU4RM5T.mjs} +1093 -955
- package/dist/components/index.d.mts +3 -3
- package/dist/components/index.mjs +3 -3
- package/dist/const/index.mjs +1 -1
- package/dist/core/index.mjs +3 -3
- package/dist/coreService/index.mjs +3 -3
- package/dist/interfaces/index.d.mts +1 -0
- package/dist/modules-features/index.mjs +3 -3
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +3 -1
- package/dist/{utils_excel-BYB9qbHd.d.mts → utils_excel-DGgLE7He.d.mts} +9 -1
- package/package.json +1 -1
- package/dist/{chunk-REMYBOSK.mjs → chunk-IUTUR43V.mjs} +1 -1
|
@@ -220,6 +220,26 @@ async function utils_excel_parseToJson(file, titleIndex, dataStartIndex) {
|
|
|
220
220
|
headers
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
+
function utils_excel_handleExport(data, exportConfig, fileName) {
|
|
224
|
+
const processedData = data.map((row) => {
|
|
225
|
+
const newRow = {};
|
|
226
|
+
exportConfig.fields.forEach(({ fieldName, formatFunction }) => {
|
|
227
|
+
const value = row[fieldName];
|
|
228
|
+
newRow[fieldName] = formatFunction ? formatFunction(value, row) : value;
|
|
229
|
+
});
|
|
230
|
+
return newRow;
|
|
231
|
+
});
|
|
232
|
+
const headers = {};
|
|
233
|
+
exportConfig.fields.forEach(({ fieldName, header }) => {
|
|
234
|
+
headers[fieldName] = header;
|
|
235
|
+
});
|
|
236
|
+
const worksheet = XLSX.utils.json_to_sheet(processedData);
|
|
237
|
+
const headerRow = exportConfig.fields.map(({ fieldName }) => headers[fieldName]);
|
|
238
|
+
XLSX.utils.sheet_add_aoa(worksheet, [headerRow], { origin: "A1" });
|
|
239
|
+
const workbook = XLSX.utils.book_new();
|
|
240
|
+
XLSX.utils.book_append_sheet(workbook, worksheet, "Exported Data");
|
|
241
|
+
XLSX.writeFile(workbook, `${fileName}.xlsx`);
|
|
242
|
+
}
|
|
223
243
|
|
|
224
244
|
// src/utils/utils_field.ts
|
|
225
245
|
function utils_field_extractAQBaseField(values) {
|
|
@@ -477,6 +497,7 @@ export {
|
|
|
477
497
|
utils_excel_exportExcel,
|
|
478
498
|
utils_excel_download,
|
|
479
499
|
utils_excel_parseToJson,
|
|
500
|
+
utils_excel_handleExport,
|
|
480
501
|
utils_field_extractAQBaseField,
|
|
481
502
|
utils_file_fileToAQDocumentType,
|
|
482
503
|
utils_file_AQDocumentTypeToFile,
|