@ai-matrx/records 0.81.3 → 0.82.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/CHANGELOG.md +23 -0
- package/dist/app-table/index.cjs +1 -1
- package/dist/app-table/index.cjs.map +1 -1
- package/dist/app-table/index.js +1 -1
- package/dist/app-table/index.js.map +1 -1
- package/dist/core/index.cjs +3 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +3 -3
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +1 -1
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/templates/index.cjs +542 -5
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.js +542 -5
- package/dist/templates/index.js.map +1 -1
- package/package.json +4 -4
package/dist/core/index.js
CHANGED
|
@@ -1283,7 +1283,7 @@ function exportCellText(value) {
|
|
|
1283
1283
|
return JSON.stringify(value);
|
|
1284
1284
|
}
|
|
1285
1285
|
async function exportPageXlsx(page, labels = {}, sheetLabel = "Records") {
|
|
1286
|
-
const { writeWorkbookBytes } = await import("@ai-matrx/
|
|
1286
|
+
const { writeWorkbookBytes } = await import("@ai-matrx/print/xlsx");
|
|
1287
1287
|
const header = page.columns.map((c) => labels[c] ?? c);
|
|
1288
1288
|
const body = page.rows.map((row) => page.columns.map((c) => exportCellText(row[c])));
|
|
1289
1289
|
const name = sheetLabel.replace(/[\\/?*[\]:]/g, " ").trim().slice(0, 31) || "Records";
|
|
@@ -9944,7 +9944,7 @@ function toAoa(fields, rows2) {
|
|
|
9944
9944
|
return [fields.map(headerFor), ...rows2.map((row) => fields.map((f) => exportCellText2(f, row[f.key])))];
|
|
9945
9945
|
}
|
|
9946
9946
|
async function exportXlsx(fields, rows2, sheetLabel = "Records") {
|
|
9947
|
-
const { writeWorkbookBytes } = await import("@ai-matrx/
|
|
9947
|
+
const { writeWorkbookBytes } = await import("@ai-matrx/print/xlsx");
|
|
9948
9948
|
const name = sheetLabel.replace(/[\\/?*[\]:]/g, " ").trim().slice(0, 31) || "Data";
|
|
9949
9949
|
return writeWorkbookBytes({ sheets: [{ name, rows: toAoa(fields, rows2) }] });
|
|
9950
9950
|
}
|
|
@@ -9955,7 +9955,7 @@ function importCsv(text2) {
|
|
|
9955
9955
|
return fromMatrix(parseCsv(text2));
|
|
9956
9956
|
}
|
|
9957
9957
|
async function importXlsx(bytes) {
|
|
9958
|
-
const { readWorkbook } = await import("@ai-matrx/
|
|
9958
|
+
const { readWorkbookBytes: readWorkbook } = await import("@ai-matrx/print/xlsx");
|
|
9959
9959
|
const sheet = (await readWorkbook(bytes)).sheets[0];
|
|
9960
9960
|
if (!sheet) return { headers: [], rows: [] };
|
|
9961
9961
|
return fromMatrix(sheet.grid({ raw: false, defval: "" }));
|