Skip to content

Commit 3d81a50

Browse files
author
m.r
committed
2.11.0
1 parent e24926a commit 3d81a50

35 files changed

+7513
-1461
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## Version 2.11.0 (2023-09-13)
4+
5+
### Bug Fixes
6+
7+
- bug related to string with special character(&,<,...)
8+
9+
### Improvement
10+
11+
- improvement in generate file
12+
13+
## Version 2.10.0 (2023-09-12)
14+
15+
### improvement
16+
17+
- Data Can Be Undefined
18+
319
## Version 2.9.0 (2023-09-10)
420

521
### New Features

README.md

Lines changed: 203 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ We have four functions that are defined with specific use cases as follows:
5858

5959
- **`sideBySideLineByLine`**: This function offers the capability to generate a single-sheet Excel file containing multiple tables side by side and line by line.
6060

61-
- **`themeBaseGenerate`**: Within this function, we utilize color palettes from **https://colorhunt.co/**. It accepts data and a theme index as inputs, then generates an Excel file with the selected theme applied.[Thems](https://mohammadrezaeicode.github.io/mr-excel-them-page/)
61+
- **`themeBaseGenerate`**: Within this function, we utilize color palettes from **https://colorhunt.co/**. It accepts data and a theme index as inputs, then generates an Excel file with the selected theme applied.[Themes](https://mohammadrezaeicode.github.io/mr-excel-them-page/)
6262

6363
## Installation
6464

@@ -3355,13 +3355,152 @@ ExcelTable.generateExcel(data);
33553355

33563356
</details>
33573357

3358+
## Image Option
3359+
3360+
After version 2.8.0, we introduced the ability to add images.
3361+
3362+
<details>
3363+
3364+
<summary>Display code</summary>
3365+
3366+
```javascript
3367+
function generateData() {
3368+
return {
3369+
data: {
3370+
creator: "mr",
3371+
sheet: [
3372+
{
3373+
images: [
3374+
{
3375+
url: "/img/ezgif.com-gif-maker.gif",
3376+
from: "H1",
3377+
type: "one",
3378+
},
3379+
{
3380+
url: "/img/uniqe.jpg",
3381+
from: "H2",
3382+
type: "one",
3383+
},
3384+
3385+
{
3386+
url: "/img/ex.PNG",
3387+
from: "H3",
3388+
type: "onde",
3389+
},
3390+
{
3391+
url: "/img/ex.PNG",
3392+
from: "H4",
3393+
type: "two",
3394+
},
3395+
{
3396+
url: "/img/ezgif.com-gif-maker.gif",
3397+
from: "E1",
3398+
to: "F10",
3399+
type: "two",
3400+
},
3401+
{
3402+
url: "/img/uniqe.jpg",
3403+
from: "H6",
3404+
type: "two",
3405+
},
3406+
],
3407+
3408+
headers: [
3409+
{
3410+
label: "Name",
3411+
text: "Name",
3412+
},
3413+
{ label: "Color", text: "Color" },
3414+
{ label: "Size", text: "Size" },
3415+
{ label: "Price", text: "Price" },
3416+
],
3417+
data: [
3418+
{
3419+
Name: "Rose",
3420+
Color: "Red",
3421+
Size: "Medium",
3422+
Price: 5.99,
3423+
},
3424+
{
3425+
Name: "Tulip",
3426+
Color: "Yellow",
3427+
Size: "Small",
3428+
Price: 2.49,
3429+
},
3430+
{
3431+
Name: "Daisy",
3432+
Color: "White",
3433+
Size: "Small",
3434+
Price: 1.99,
3435+
},
3436+
{
3437+
Name: "Sunflower",
3438+
Color: "Yellow",
3439+
Size: "Large",
3440+
Price: 4.99,
3441+
},
3442+
{
3443+
Name: "Lily",
3444+
Color: "Pink",
3445+
Size: "Medium",
3446+
Price: 3.99,
3447+
},
3448+
{
3449+
Name: "Daffodil",
3450+
Color: "Yellow",
3451+
Size: "Small",
3452+
Price: 2.49,
3453+
},
3454+
{
3455+
Name: "Orchid",
3456+
Color: "Purple",
3457+
Size: "Medium",
3458+
Price: 6.99,
3459+
},
3460+
{
3461+
Name: "Carnation",
3462+
Color: "Red",
3463+
Size: "Small",
3464+
Price: 1.99,
3465+
},
3466+
{
3467+
Name: "Hyacinth",
3468+
Color: "Blue",
3469+
Size: "Medium",
3470+
Price: 4.49,
3471+
},
3472+
{
3473+
Name: "Pansy",
3474+
Color: "Purple",
3475+
Size: "Small",
3476+
Price: 2.99,
3477+
},
3478+
],
3479+
},
3480+
],
3481+
},
3482+
};
3483+
}
3484+
const { data } = generateData();
3485+
ExcelTable.generateExcel(data);
3486+
3487+
```
3488+
3489+
</details>
33583490
<details>
33593491
<summary>result image</summary>
33603492

3361-
![ex](https://github.com/mohammadrezaeicode/mr-excel-page-repo/blob/main/public/img/ex9.PNG?raw=true)
3493+
![ex](https://github.com/mohammadrezaeicode/mr-excel-page-repo/blob/main/public/img/ex17.PNG?raw=true)
3494+
3495+
</details>
3496+
<details>
3497+
<summary>result image</summary>
3498+
3499+
![ex](https://github.com/mohammadrezaeicode/mr-excel-page-repo/blob/main/public/img/ex17.PNG?raw=true)
33623500

33633501
</details>
33643502

3503+
33653504
## API
33663505

33673506
In the API section, you will discover various options and configurations that you can utilize within the library.
@@ -3373,6 +3512,31 @@ In the API section, you will discover various options and configurations that yo
33733512
export type ProtectionOption = {
33743513
[key in ProtectionOptionKey]: "0" | "1" | 0 | 1;
33753514
};
3515+
export interface ImageTypes {
3516+
url: string;
3517+
from: string;
3518+
to?: string;
3519+
type?: "one" | "two";
3520+
extent?: {
3521+
cx: number;
3522+
cy: number;
3523+
};
3524+
margin?: {
3525+
all?: number;
3526+
right?: number;
3527+
left?: number;
3528+
bottom?: number;
3529+
top?: number;
3530+
};
3531+
}
3532+
export interface SideBySide {
3533+
sheetName?: string;
3534+
spaceX?: number;
3535+
spaceY?: number;
3536+
headers: { label: string; text: string }[];
3537+
data: Data[];
3538+
headerIndex?: number;
3539+
}
33763540
export type ProtectionOptionKey =
33773541
| "sheet"
33783542
| "formatCells"
@@ -3481,6 +3645,15 @@ export interface MergeRowConditionMap {
34813645
start: number;
34823646
};
34833647
}
3648+
export type MultiStyleConditinFunction = (
3649+
data: Header | string | number | undefined,
3650+
object: null | Data,
3651+
headerKey: string,
3652+
rowIndex: number,
3653+
colIndex: number,
3654+
fromHeader: boolean
3655+
) => MultiStyleValue | null;
3656+
34843657
export type CommentConditionFunction = (
34853658
data: Header | string | number | undefined,
34863659
object: null | Data,
@@ -3518,8 +3691,11 @@ export interface Title {
35183691
multiStyleValue?: MultiStyleValue;
35193692
comment?: Comment | string;
35203693
}
3521-
export interface Sheet {
3694+
export interface SheetOption {
35223695
withoutHeader?: boolean;
3696+
multiStyleConditin?: MultiStyleConditinFunction;
3697+
useSplitBaseOnMatch?: boolean;
3698+
images?: ImageTypes[];
35233699
formula?: Formula;
35243700
name?: string;
35253701
title?: Title;
@@ -3537,6 +3713,8 @@ export interface Sheet {
35373713
headerRowOption?: any;
35383714
protectionOption?: ProtectionOption;
35393715
headerHeight?: number;
3716+
}
3717+
export interface Sheet extends SheetOption {
35403718
headers: Header[];
35413719
data: Data[];
35423720
}
@@ -3603,8 +3781,10 @@ export interface FormulaSetting {
36033781
export interface Formula {
36043782
[insertCell: string]: FormulaSetting;
36053783
}
3606-
3607-
export interface ExcelTable {
3784+
export interface Theme extends ExcelTableOption {
3785+
sheet: SheetOption[];
3786+
}
3787+
export interface ExcelTableOption {
36083788
notSave?: boolean;
36093789
creator?: string;
36103790
backend?: boolean;
@@ -3617,6 +3797,8 @@ export interface ExcelTable {
36173797
createType?: string;
36183798
mapSheetDataOption?: any;
36193799
styles?: Styles;
3800+
}
3801+
export interface ExcelTable extends ExcelTableOption{
36203802
sheet: Sheet[];
36213803
}
36223804
```
@@ -3777,6 +3959,22 @@ These alignment options empower you to customize the appearance of cell content
37773959

37783960
## Release Notes
37793961

3962+
### Version 2.11.0 (2023-09-13)
3963+
3964+
#### Bug Fixes
3965+
3966+
- bug related to string with special character(&<,...)
3967+
3968+
#### Improvement
3969+
3970+
- improvement in generate file
3971+
3972+
### Version 2.10.0 (2023-09-12)
3973+
3974+
#### improvement
3975+
3976+
- Data Can Be Undefined
3977+
37803978
### Version 2.9.0 (2023-09-10)
37813979

37823980
#### New Features

0 commit comments

Comments
 (0)