-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) SJT-130 Replace the clock in and clock out module with the dow…
…nload button on payment point (feat) SJT-130 Replace the clock in and clock out module with the download button on payment point
- Loading branch information
Showing
7 changed files
with
100 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@ehospital/esm-billing-app", | ||
"version": "1.2.4", | ||
"version": "1.2.7", | ||
"description": "Billing frontend module for use in O3", | ||
"browser": "dist/ehospital-esm-billing-app.js", | ||
"main": "src/index.ts", | ||
|
@@ -121,5 +121,5 @@ | |
"*.{js,jsx,ts,tsx}": "eslint --cache --fix" | ||
}, | ||
"packageManager": "[email protected]", | ||
"gitHead": "caab2f747b2171410773637bb6fe0a1923dab97e" | ||
"gitHead": "6ad984b7558d3bdc3e49f86b446cfd050bc1ef4f" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as XLSX from 'xlsx'; | ||
|
||
interface ExcelExportOptions { | ||
fileName?: string; | ||
sheetName?: string; | ||
compression?: boolean; | ||
} | ||
|
||
/** | ||
* Generic function to export any data to Excel | ||
* @param data - Array of objects to export | ||
* @param options - Export configuration options | ||
*/ | ||
export async function exportToExcel<T>(data: Array<T>, options: ExcelExportOptions = {}): Promise<void> { | ||
const { fileName = 'Export', sheetName = 'Sheet1', compression = true } = options; | ||
|
||
try { | ||
// Convert data to worksheet | ||
const worksheet = XLSX.utils.json_to_sheet(data); | ||
|
||
// Create workbook and append worksheet | ||
const workbook = XLSX.utils.book_new(); | ||
XLSX.utils.book_append_sheet(workbook, worksheet, sheetName); | ||
|
||
// Write file | ||
XLSX.writeFile(workbook, `${fileName}.xlsx`, { compression }); | ||
} catch (error) { | ||
console.error('Error exporting to Excel:', error); | ||
throw new Error('Failed to export data to Excel'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters