Skip to content

Commit

Permalink
V 5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
m.r committed Feb 8, 2024
1 parent c607f40 commit b04f0ce
Show file tree
Hide file tree
Showing 13 changed files with 1,684 additions and 1,300 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Version 5.2.0 (2024-02-08)

### New Features

- `generateCSV` & `generateText` functions create files in different formats, namely .csv and .txt

## Version 5.1.1 (2024-01-31)

### Bug Fixes
Expand Down
153 changes: 153 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ MR-Excel is a JavaScript library designed for reading and writing Excel files. T
- [**`How to use themeBaseGenerate`**](#theme-base-generate-usage)
- [**`extractExcelData`**](#extract-excel-data)
- [**`How to use extractExcelData`**](#extract-excel-data-usage)
- [**`🆕 generateCSV && generateText`**](#generate-csv-txt)
- [**`🆕 How to use generateCSV && generateText`**](#generate-csv-txt-usage)
- [**`interface`**](#interface)
- [**`Migrate Version`**](#migrate)
- [**`Migrating from 4 to 5`**](#migrating-4)
Expand Down Expand Up @@ -81,6 +83,10 @@ We have four functions that are defined with specific use cases as follows:

- **`extractExcelData`**: We provide 'extract-excel-data-usage,' which takes the URL of an Excel file that needs to be read, retrieves and reads the data, and returns an object containing the sheets as the result.

<a id="generate-csv-txt"></a>

- **`🆕 generateCSV && generateText`**:The generateCSV function produces a .csv file based on the excelTable output, while the generateText function generates a .txt file. This function includes a boolean property; if set to true, the generated files will be compressed into a zip file. It is important to note that .csv and .txt files do not support styles, formulas, and other similar features.

<a id="installation"></a>

## Installation [⬆️](#table-of-contents)
Expand Down Expand Up @@ -446,12 +452,153 @@ ExcelTable.convertTableToExcel("#table", null, true, rowF, colF)

</details>

<a id="extract-excel-data-usage"></a>

### How to use extractExcelData

```javascript
ExcelTable.extractExcelData(your excel url);
```

<a id="generate-csv-txt-usage"></a>

### 🆕 How to use generateCSV && generateText

<details>

<summary>Display Code</summary>

```javascript
const data = {
sheet: [
{
headers: [
{
label: "test",
text: "Test",
},
{
label: "_id",
text: "ID",
formula: {
type: "MAX",
styleId: "formulaStyle",
},
},
],
data: [
{
_id: 0.3,
test: "test1",
},
{
_id: 2,
test: "test2",
},
{
_id: 3,
test: "test3",
},
{
_id: 4,
test: "test4",
},
{
_id: 5,
test: "test5",
},
{
_id: 6,
test: "test6",
},
{
_id: 7,
test: "test7",
},
{
_id: 8,
test: "test8",
},
{
_id: 9,
test: "test9",
},
{
_id: 10,
test: "test10",
},
{
_id: 11,
test: "test11",
},
],
},
{
headers: [
{
label: "test",
text: "Test",
},
{
label: "_id",
text: "ID",
},
],
data: [
{
_id: 1,
test: "test1",
},
{
_id: 2,
test: "test2",
},
{
_id: 3,
test: "test3",
},
{
_id: 4,
test: "test4",
},
{
_id: 5,
test: "test5",
},
{
_id: 6,
test: "test6",
},
{
_id: 7,
test: "test7",
},
{
_id: 8,
test: "test8",
},
{
_id: 9,
test: "test9",
},
{
_id: 10,
test: "test10",
},
{
_id: 11,
test: "test11",
},
],
},
],
};
ExcelTable.generateCSV(data, true);
ExcelTable.generateText(data, true);
```

</details>

<a id="side-by-side-line-by-line-usage"></a>

### How to use sideBySideLineByLine
Expand Down Expand Up @@ -8321,6 +8468,12 @@ To migrate from Version 2 to Version 3, you need to follow the steps below:

## Release Notes [⬆️](#table-of-contents)

## Version 5.2.0 (2024-02-08)

### New Features

- `generateCSV` & `generateText` functions create files in different formats, namely `.csv` and `.txt`

### Version 5.1.0 (2024-01-31)

#### New Features
Expand Down
6 changes: 3 additions & 3 deletions change-log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Version 5.1.1 (2024-01-31)
## Version 5.2.0 (2024-02-08)

### Bug Fixes
### New Features

- Fixed README.md
- `generateCSV` & `generateText` functions create files in different formats, namely .csv and .txt
4 changes: 4 additions & 0 deletions dist/excel-table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,14 @@ declare interface FormulaSetting {

declare type FormulaType = "AVERAGE" | "SUM" | "COUNT" | "MAX" | "MIN";

export declare function generateCSV(excelTable: ExcelTable, asZip?: boolean): string[] | "done" | undefined;

export declare const generateExcel: typeof generateExcel_2;

declare function generateExcel_2(data: ExcelTable, styleKey?: string): Promise<string | number[] | Blob | Buffer | undefined>;

export declare function generateText(excelTable: ExcelTable, asZip?: boolean): string[] | "done" | undefined;

declare interface Header {
label: string;
text: string;
Expand Down
Loading

0 comments on commit b04f0ce

Please sign in to comment.