@mcurros2/microm 1.1.120-0 → 1.1.122-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/index.js CHANGED
@@ -2977,11 +2977,53 @@ function $5be4b35862a9dc4d$export$a04f965200623e61(data, notExportableColumns, s
2977
2977
  const workbook = new (0, ($parcel$interopDefault($b4te3$exceljs))).Workbook();
2978
2978
  data.forEach((result, index)=>{
2979
2979
  const worksheet = workbook.addWorksheet(sheetNames ? sheetNames[index] : `Data ${index + 1}`);
2980
- const columns = result.Header.map((header, index)=>(notExportableColumns === null || notExportableColumns === void 0 ? void 0 : notExportableColumns.includes(index)) ? null : {
2980
+ const exportableColumnsConfig = [];
2981
+ result.Header.forEach((header, colIndex)=>{
2982
+ if (notExportableColumns === null || notExportableColumns === void 0 ? void 0 : notExportableColumns.includes(colIndex)) exportableColumnsConfig.push({
2981
2983
  header: header,
2982
- key: header
2983
- }).filter((column)=>column !== null);
2984
- worksheet.columns = columns;
2984
+ key: header,
2985
+ originalIndex: colIndex
2986
+ });
2987
+ });
2988
+ worksheet.columns = exportableColumnsConfig.map((col)=>({
2989
+ header: col.header,
2990
+ key: col.key
2991
+ }));
2992
+ exportableColumnsConfig.forEach((colInfo)=>{
2993
+ const originalColIndex = colInfo.originalIndex;
2994
+ const columnType = result.typeInfo[originalColIndex];
2995
+ const column = worksheet.getColumn(colInfo.key);
2996
+ if (column) switch(columnType){
2997
+ case "tinyint":
2998
+ case "smallint":
2999
+ case "int":
3000
+ case "bigint":
3001
+ column.numFmt = "0";
3002
+ break;
3003
+ case "float":
3004
+ case "decimal":
3005
+ case "real":
3006
+ column.numFmt = "#,##0.00";
3007
+ break;
3008
+ case "money":
3009
+ column.numFmt = "$#,##0.00";
3010
+ break;
3011
+ case "bit":
3012
+ column.numFmt = "0";
3013
+ break;
3014
+ case "date":
3015
+ column.numFmt = "yyyy-mm-dd";
3016
+ break;
3017
+ case "datetime":
3018
+ case "datetime2":
3019
+ case "smalldatetime":
3020
+ column.numFmt = "yyyy-mm-dd hh:mm:ss";
3021
+ break;
3022
+ case "time":
3023
+ column.numFmt = "hh:mm:ss";
3024
+ break;
3025
+ }
3026
+ });
2985
3027
  result.records.forEach((row)=>{
2986
3028
  const filteredRow = row.filter((_, index)=>!(notExportableColumns === null || notExportableColumns === void 0 ? void 0 : notExportableColumns.includes(index)));
2987
3029
  worksheet.addRow(filteredRow);
@@ -33560,7 +33602,7 @@ function $42d3a2ac8447d6e0$export$f77741f33c48605(props, stateProps) {
33560
33602
  setSearchText
33561
33603
  ]);
33562
33604
  const handleModalSaved = (0, $b4te3$react.useCallback)((new_status)=>$42d3a2ac8447d6e0$var$__awaiter(this, void 0, void 0, function*() {
33563
- if (!new_status.error && !new_status.loading && new_status.data && !handleAlwaysRefreshOnClose) internalRefresh();
33605
+ if (!new_status.error && !new_status.loading && new_status.data && !allwaysRefreshOnEntityClose) internalRefresh();
33564
33606
  if (onModalSaved) yield onModalSaved(new_status);
33565
33607
  }), [
33566
33608
  internalRefresh,