mig-schema-table 4.4.33 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,7 +39,7 @@ const userSchema = {
39
39
  ```typescript jsx
40
40
  import React from "react";
41
41
  import { SchemaTable, IColumnConfig } from "mig-schema-table";
42
- import "mig-schema-table/dist/index.css";
42
+ import "mig-schema-table/dist/mig-schema-table.css";
43
43
  // Add this for default datepicker styling
44
44
  import "react-datepicker/dist/react-datepicker.css";
45
45
  // Optionally add bootstrap5 styles
@@ -0,0 +1,27 @@
1
+ import { Workbook as c } from "exceljs";
2
+ import { difference as a } from "lodash";
3
+ import { saveAs as l } from "file-saver";
4
+ const p = (o) => {
5
+ const r = new c(), t = r.addWorksheet("Data");
6
+ o.length && (t.addRow(
7
+ a(Object.keys(o[0]), [
8
+ "_index",
9
+ "SELECT_ALL_COLUMN_NAME"
10
+ ])
11
+ ), t.getRow(1).font = { bold: !0 }, t.addRows(
12
+ o.map((e) => {
13
+ const { _index: n, SELECT_ALL_COLUMN_NAME: f, ...s } = e;
14
+ return Object.values(s);
15
+ })
16
+ ), r.xlsx.writeBuffer().then((e) => {
17
+ const n = new Blob([e], {
18
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
19
+ });
20
+ l(n, "export.xlsx");
21
+ }).catch((e) => {
22
+ console.error("Error generating Excel file:", e);
23
+ }));
24
+ };
25
+ export {
26
+ p as renderDataToExcel
27
+ };