diff --git a/rollup.config.js b/rollup.config.js
index cb15992..2ae2f72 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -39,7 +39,7 @@ export default {
// If we're building for production (npm run build
// instead of npm run dev), minify
- production && terser()
+ //production && terser()
],
watch: {
clearScreen: false
diff --git a/scripts/App.svelte b/scripts/App.svelte
index 7529402..ac998f7 100644
--- a/scripts/App.svelte
+++ b/scripts/App.svelte
@@ -1,5 +1,5 @@
Import fichier .ods et .xslx
+
+ Résultat
+ {#await tableObjectSheets}
+ (fichier en cours d'analyse)
+ {:then tableObjectSheets}
+ {#each [...tableObjectSheets] as [sheetName, data]}
+
+ {sheetName} ({data.length} lignes)
+
+
+
+ {#each Object.keys(data[0]) as column}
+ | {column} |
+ {/each}
+
+
+
+ {#each data as row}
+
+ {#each Object.keys(data[0]) as column}
+ {row[column]} |
+ {/each}
+
+ {/each}
+
+
+
+
+ {/each}
+ {/await}
+
+
+
diff --git a/scripts/front-end.js b/scripts/front-end.js
index a60da5c..d19ce7e 100644
--- a/scripts/front-end.js
+++ b/scripts/front-end.js
@@ -2,7 +2,5 @@ import App from './App.svelte';
const app = new App({
target: document.querySelector('.svelte-main'),
- props: {
- name: 'from Svelte'
- }
+ props: {}
});
diff --git a/scripts/getTableRawContentFromFile.js b/scripts/getTableRawContentFromFile.js
index b74cdad..4b93a7d 100644
--- a/scripts/getTableRawContentFromFile.js
+++ b/scripts/getTableRawContentFromFile.js
@@ -15,7 +15,7 @@ function parseXML(str){
/**
* @typedef TableCellRawContent
- * @prop {string} value
+ * @prop {string | null | undefined} value
* @prop {'float' | 'percentage' | 'currency' | 'date' | 'time' | 'boolean' | 'string' | 'b' | 'd' | 'e' | 'inlineStr' | 'n' | 's' | 'str'} type
*
*/
@@ -24,39 +24,6 @@ const ODS_TYPE = "application/vnd.oasis.opendocument.spreadsheet";
const XLSX_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
-/**
- * Converts a cell value to the appropriate JavaScript type based on its cell type.
- * @param {string} value - The value of the cell.
- * @param {TableCellRawContent['type']} cellType - The type of the cell.
- * @returns {any} The converted value.
- */
-function convertCellValue(value, cellType) {
- if(value === ''){
- return ''
- }
-
- switch (cellType) {
- case 'float':
- case 'percentage':
- case 'currency':
- case 'n': // number
- return parseFloat(value);
- case 'date':
- case 'd': // date
- return new Date(value);
- case 'boolean':
- case 'b': // boolean
- return value === '1' || value === 'true';
- case 's': // shared string
- case 'inlineStr': // inline string
- case 'string':
- case 'e': // error
- case 'time':
- default:
- return value;
- }
-}
-
/**
* Extracts raw table content from an ODS file.
* @param {File} file - The ODS file.
@@ -66,7 +33,6 @@ function convertCellValue(value, cellType) {
*/
async function getTableRawContentFromODSFile(file, unzip, parseXML) {
const zip = await unzip(file);
- console.log('zip', zip)
const entries = zip.entries;
// Extract the content.xml file which contains the spreadsheet data
@@ -179,7 +145,7 @@ async function getTableRawContentFromXSLXFile(file, unzip, parseXML) {
* @param {File} file
* @returns {Promise