Skip to content

Commit 6a94e09

Browse files
author
m.r
committed
2.9.0
1 parent 21ae2e5 commit 6a94e09

38 files changed

+45098
-788
lines changed

CHANGELOG.md

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

3+
## Version 2.9.0 (2023-09-10)
4+
5+
### New Features
6+
7+
- Generate excel base on Theme
8+
9+
## Version 2.8.0 (2023-09-08)
10+
11+
### New Features
12+
13+
- ability for add image to excel
14+
315
## Version 2.7.0 (2023-09-02)
416

517
### New Features

README.md

Lines changed: 281 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
<summary>images</summary>
66

7+
![ex](https://github.com/mohammadrezaeicode/open-screenshot-close/blob/main/done/n2000-2069/negative-text2001.png?raw=true)
8+
79
![ex](https://github.com/mohammadrezaeicode/mr-excel-page-repo/blob/main/public/img/ex16.PNG?raw=true)
810

911
![ex](https://github.com/mohammadrezaeicode/mr-excel-page-repo/blob/main/public/img/ex14.PNG?raw=true)
@@ -48,17 +50,27 @@ Our library offers comprehensive support for a wide range of features, including
4850

4951
In version 2.1.0, we introduced a new feature called "convertTableToExcel," which enables the generation of an Excel file from a specified table or DOM element (table). The provided query is expected to be a valid input for the querySelector method. This enhancement allows for greater flexibility and convenience when creating Excel files directly from HTML tables.
5052

53+
We have four functions that are defined with specific use cases as follows:
54+
55+
- **`generateExcel`**: This is the primary and most important function that serves as the entry point for all other functions. Its responsibility is to generate an Excel file based on the received input data. We will provide examples of the various options that can be utilized.
56+
57+
- **`convertTableToExcel`**: This function is designed exclusively for **client-side** use. It requires passing a DOM element (a table element) as a parameter. The output of this function is an Excel file generated from the provided table.
58+
59+
- **`sideBySideLineByLine`**: This function offers the capability to generate a single-sheet Excel file containing multiple tables side by side and line by line.
60+
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/)
62+
5163
## Installation
5264

53-
Via CDN
65+
**Via CDN**
5466

55-
You can utilize our library, which comes bundled with Vite, by including the following link:
67+
You can utilize our library, which comes bundled with **Vite**, by including the following link:
5668

5769
```html
5870
<script src="https://unpkg.com/mr-excel@latest/dist/excel-table.umd.js"></script>
5971
```
6072

61-
Alternatively, you have the option to use the bundle with Webpack by incorporating the link provided below:
73+
Alternatively, you have the option to use the bundle with **Webpack** by incorporating the link provided below:
6274

6375
```html
6476
<script src="https://unpkg.com/mr-excel@latest/dist2/excel-table.js"></script>
@@ -69,19 +81,19 @@ Easily integrate our library into your project using either of these methods, an
6981
Using a Package Manager
7082
To seamlessly integrate our library, you can install it using your preferred package manager:
7183

72-
Via npm:
84+
**Via npm**:
7385

7486
```terminal/bash
7587
npm install mr-excel
7688
```
7789

78-
Using yarn:
90+
Using **yarn**:
7991

8092
```terminal/bash
8193
npm install mr-excel
8294
```
8395

84-
Alternatively, you have the option to use pnpm:
96+
Alternatively, you have the option to use **pnpm**:
8597

8698
```terminal/bash
8799
npm install mr-excel
@@ -93,6 +105,262 @@ Choose the package manager that suits your workflow, and effortlessly bring the
93105

94106
After adding the library to your project, generating XLSX files becomes straightforward. You can achieve this by creating a data object similar to the code snippet below:
95107

108+
### themeBaseGenerate
109+
110+
```javascript
111+
let data = {
112+
sheet: [
113+
{
114+
headers: [
115+
{
116+
label: "ID",
117+
text: "ID",
118+
},
119+
{
120+
label: "FirstName",
121+
text: "First Name",
122+
},
123+
{
124+
label: "LastName",
125+
text: "Last Name",
126+
},
127+
{
128+
label: "Age",
129+
text: "Age",
130+
},
131+
{
132+
label: "Email",
133+
text: "Email",
134+
},
135+
{
136+
label: "PhoneNumber",
137+
text: "PhoneNumber",
138+
},
139+
{
140+
label: "Address",
141+
text: "Address",
142+
},
143+
{
144+
label: "Occupation",
145+
text: "Occupation",
146+
},
147+
],
148+
data: [
149+
{
150+
ID: 1,
151+
FirstName: "John",
152+
LastName: "Smith",
153+
Age: 32,
154+
155+
PhoneNumber: "555-123-4567",
156+
Address: "123 Main St, City",
157+
Occupation: "Engineer",
158+
},
159+
{
160+
ID: 2,
161+
FirstName: "Jane",
162+
LastName: "Doe",
163+
Age: 28,
164+
165+
PhoneNumber: "555-987-6543",
166+
Address: "456 Elm St, Town",
167+
Occupation: "Teacher",
168+
},
169+
{
170+
ID: 3,
171+
FirstName: "David",
172+
LastName: "Johnson",
173+
Age: 45,
174+
175+
PhoneNumber: "555-555-5555",
176+
Address: "789 Oak St, City",
177+
Occupation: "Doctor",
178+
},
179+
{
180+
ID: 4,
181+
FirstName: "Sarah",
182+
LastName: "Brown",
183+
Age: 22,
184+
185+
PhoneNumber: "555-321-6549",
186+
Address: "101 Pine St, Town",
187+
Occupation: "Student",
188+
},
189+
{
190+
ID: 5,
191+
FirstName: "Michael",
192+
LastName: "Wilson",
193+
Age: 38,
194+
195+
PhoneNumber: "555-777-8888",
196+
Address: "246 Maple St, City",
197+
Occupation: "Lawyer",
198+
},
199+
{
200+
ID: 6,
201+
FirstName: "Emily",
202+
LastName: "Davis",
203+
Age: 29,
204+
205+
PhoneNumber: "555-444-3333",
206+
Address: "555 Birch St, Town",
207+
Occupation: "Nurse",
208+
},
209+
{
210+
ID: 7,
211+
FirstName: "Daniel",
212+
LastName: "Lee",
213+
Age: 31,
214+
215+
PhoneNumber: "555-666-9999",
216+
Address: "777 Cedar St, City",
217+
Occupation: "Software Dev",
218+
},
219+
{
220+
ID: 8,
221+
FirstName: "Olivia",
222+
LastName: "White",
223+
Age: 27,
224+
225+
PhoneNumber: "555-222-1111",
226+
Address: "888 Redwood St, Town",
227+
Occupation: "Artist",
228+
},
229+
{
230+
ID: 9,
231+
FirstName: "James",
232+
LastName: "Anderson",
233+
Age: 40,
234+
235+
PhoneNumber: "555-888-3333",
236+
Address: "333 Oak St, City",
237+
Occupation: "Accountant",
238+
},
239+
{
240+
ID: 10,
241+
FirstName: "Sophia",
242+
LastName: "Martinez",
243+
Age: 24,
244+
245+
PhoneNumber: "555-999-7777",
246+
Address: "666 Pine St, Town",
247+
Occupation: "Engineer",
248+
},
249+
],
250+
},
251+
],
252+
};
253+
ExcelTable.themeBaseGenerate(data, 0);
254+
```
255+
256+
Or:
257+
258+
```javascript
259+
let data = [
260+
{
261+
ID: 1,
262+
FirstName: "John",
263+
LastName: "Smith",
264+
Age: 32,
265+
266+
PhoneNumber: "555-123-4567",
267+
Address: "123 Main St, City",
268+
Occupation: "Engineer",
269+
},
270+
{
271+
ID: 2,
272+
FirstName: "Jane",
273+
LastName: "Doe",
274+
Age: 28,
275+
276+
PhoneNumber: "555-987-6543",
277+
Address: "456 Elm St, Town",
278+
Occupation: "Teacher",
279+
},
280+
{
281+
ID: 3,
282+
FirstName: "David",
283+
LastName: "Johnson",
284+
Age: 45,
285+
286+
PhoneNumber: "555-555-5555",
287+
Address: "789 Oak St, City",
288+
Occupation: "Doctor",
289+
},
290+
{
291+
ID: 4,
292+
FirstName: "Sarah",
293+
LastName: "Brown",
294+
Age: 22,
295+
296+
PhoneNumber: "555-321-6549",
297+
Address: "101 Pine St, Town",
298+
Occupation: "Student",
299+
},
300+
{
301+
ID: 5,
302+
FirstName: "Michael",
303+
LastName: "Wilson",
304+
Age: 38,
305+
306+
PhoneNumber: "555-777-8888",
307+
Address: "246 Maple St, City",
308+
Occupation: "Lawyer",
309+
},
310+
{
311+
ID: 6,
312+
FirstName: "Emily",
313+
LastName: "Davis",
314+
Age: 29,
315+
316+
PhoneNumber: "555-444-3333",
317+
Address: "555 Birch St, Town",
318+
Occupation: "Nurse",
319+
},
320+
{
321+
ID: 7,
322+
FirstName: "Daniel",
323+
LastName: "Lee",
324+
Age: 31,
325+
326+
PhoneNumber: "555-666-9999",
327+
Address: "777 Cedar St, City",
328+
Occupation: "Software Dev",
329+
},
330+
{
331+
ID: 8,
332+
FirstName: "Olivia",
333+
LastName: "White",
334+
Age: 27,
335+
336+
PhoneNumber: "555-222-1111",
337+
Address: "888 Redwood St, Town",
338+
Occupation: "Artist",
339+
},
340+
{
341+
ID: 9,
342+
FirstName: "James",
343+
LastName: "Anderson",
344+
Age: 40,
345+
346+
PhoneNumber: "555-888-3333",
347+
Address: "333 Oak St, City",
348+
Occupation: "Accountant",
349+
},
350+
{
351+
ID: 10,
352+
FirstName: "Sophia",
353+
LastName: "Martinez",
354+
Age: 24,
355+
356+
PhoneNumber: "555-999-7777",
357+
Address: "666 Pine St, Town",
358+
Occupation: "Engineer",
359+
},
360+
];
361+
ExcelTable.themeBaseGenerate(data, 12);
362+
```
363+
96364
### convertTableToExcel
97365

98366
```javascript
@@ -120,7 +388,7 @@ ExcelTable.convertTableToExcel("#table", null, true, rowF, colF)
120388

121389
### sideBySideLineByLine
122390

123-
sideBySideLineByLine is a new feature that provides the ability to generate multi-table in a single sheet Excel
391+
`sideBySideLineByLine` is a new feature that enables the generation of multiple tables within a single Excel sheet.
124392

125393
```javascript
126394
const sideData = [
@@ -3509,6 +3777,12 @@ These alignment options empower you to customize the appearance of cell content
35093777

35103778
## Release Notes
35113779

3780+
### Version 2.9.0 (2023-09-10)
3781+
3782+
#### New Features
3783+
3784+
- Generate excel base on Theme
3785+
35123786
### Version 2.8.0 (2023-09-08)
35133787

35143788
#### New Features

0 commit comments

Comments
 (0)