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 +1 -1
- package/dist/index-DAu7y5UJ.js +27 -0
- package/dist/mig-schema-table.es.js +1721 -9
- package/dist/mig-schema-table.umd.js +1 -116
- package/package.json +6 -6
- package/dist/index-Cn6jLJbq.js +0 -23112
- package/dist/index-DL8oZORc.js +0 -51962
- /package/dist/{style.css → mig-schema-table.css} +0 -0
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/
|
|
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
|
+
};
|