@tachybase/plugin-action-export 0.23.8

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.
Files changed (49) hide show
  1. package/.turbo/turbo-build.log +14 -0
  2. package/LICENSE +201 -0
  3. package/README.md +9 -0
  4. package/README.zh-CN.md +9 -0
  5. package/client.d.ts +2 -0
  6. package/client.js +1 -0
  7. package/dist/client/ExportActionInitializer.d.ts +8 -0
  8. package/dist/client/ExportDesigner.d.ts +2 -0
  9. package/dist/client/ExportPluginProvider.d.ts +2 -0
  10. package/dist/client/index.d.ts +9 -0
  11. package/dist/client/index.js +14 -0
  12. package/dist/client/schemaSettings.d.ts +2 -0
  13. package/dist/client/useExportAction.d.ts +3 -0
  14. package/dist/client/useFields.d.ts +1 -0
  15. package/dist/client/useShared.d.ts +70 -0
  16. package/dist/externalVersion.js +13 -0
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.js +39 -0
  19. package/dist/node_modules/node-xlsx/dist/bin/cli.cjs +95 -0
  20. package/dist/node_modules/node-xlsx/dist/bin/cli.d.cts +1 -0
  21. package/dist/node_modules/node-xlsx/dist/bin/cli.d.ts +1 -0
  22. package/dist/node_modules/node-xlsx/dist/bin/cli.js +37 -0
  23. package/dist/node_modules/node-xlsx/dist/chunk-ID6OMQGT.js +78 -0
  24. package/dist/node_modules/node-xlsx/dist/index.cjs +7 -0
  25. package/dist/node_modules/node-xlsx/dist/index.d.cts +46 -0
  26. package/dist/node_modules/node-xlsx/dist/index.d.ts +46 -0
  27. package/dist/node_modules/node-xlsx/dist/index.js +13 -0
  28. package/dist/node_modules/node-xlsx/node_modules/.bin/xlsx +17 -0
  29. package/dist/node_modules/node-xlsx/package.json +1 -0
  30. package/dist/server/actions/export-xlsx.d.ts +2 -0
  31. package/dist/server/actions/export-xlsx.js +132 -0
  32. package/dist/server/actions/index.d.ts +1 -0
  33. package/dist/server/actions/index.js +21 -0
  34. package/dist/server/constants.d.ts +2 -0
  35. package/dist/server/constants.js +30 -0
  36. package/dist/server/index.d.ts +10 -0
  37. package/dist/server/index.js +122 -0
  38. package/dist/server/renders/index.d.ts +10 -0
  39. package/dist/server/renders/index.js +159 -0
  40. package/dist/server/renders/renders.d.ts +21 -0
  41. package/dist/server/renders/renders.js +163 -0
  42. package/dist/server/utils/columns2Appends.d.ts +1 -0
  43. package/dist/server/utils/columns2Appends.js +45 -0
  44. package/dist/server/utils/index.d.ts +1 -0
  45. package/dist/server/utils/index.js +21 -0
  46. package/dist/swagger/index.json +21 -0
  47. package/package.json +35 -0
  48. package/server.d.ts +2 -0
  49. package/server.js +1 -0
@@ -0,0 +1,78 @@
1
+ // src/index.ts
2
+ import {
3
+ read,
4
+ readFile,
5
+ utils,
6
+ write
7
+ } from "xlsx";
8
+
9
+ // src/config.ts
10
+ import * as fs from "fs";
11
+ import { set_fs } from "xlsx";
12
+ set_fs(fs);
13
+
14
+ // src/helpers.ts
15
+ var isString = (maybeString) => typeof maybeString === "string";
16
+
17
+ // src/workbook.ts
18
+ var WorkBook = class {
19
+ Sheets = {};
20
+ SheetNames = [];
21
+ };
22
+
23
+ // src/index.ts
24
+ var parse = (mixed, options = {}) => {
25
+ const { dateNF, header = 1, range, blankrows, defval, raw = true, rawNumbers, ...otherOptions } = options;
26
+ const workBook = isString(mixed) ? readFile(mixed, { dateNF, raw, ...otherOptions }) : read(mixed, { dateNF, raw, ...otherOptions });
27
+ return Object.keys(workBook.Sheets).map((name) => {
28
+ const sheet = workBook.Sheets[name];
29
+ return {
30
+ name,
31
+ data: utils.sheet_to_json(sheet, {
32
+ dateNF,
33
+ header,
34
+ range: typeof range === "function" ? range(sheet) : range,
35
+ blankrows,
36
+ defval,
37
+ raw,
38
+ rawNumbers
39
+ })
40
+ };
41
+ });
42
+ };
43
+ var parseMetadata = (mixed, options = {}) => {
44
+ const workBook = isString(mixed) ? readFile(mixed, options) : read(mixed, options);
45
+ return Object.keys(workBook.Sheets).map((name) => {
46
+ const sheet = workBook.Sheets[name];
47
+ return { name, data: sheet["!ref"] ? utils.decode_range(sheet["!ref"]) : null };
48
+ });
49
+ };
50
+ var build = (worksheets, { parseOptions = {}, writeOptions = {}, sheetOptions = {}, ...otherOptions } = {}) => {
51
+ const { bookType = "xlsx", bookSST = false, type = "buffer", ...otherWriteOptions } = writeOptions;
52
+ const legacyOptions = Object.keys(otherOptions).filter((key) => {
53
+ if (["!cols", "!rows", "!merges", "!protect", "!autofilter"].includes(key)) {
54
+ console.debug(`Deprecated options['${key}'], please use options.sheetOptions['${key}'] instead.`);
55
+ return true;
56
+ }
57
+ console.debug(`Unknown options['${key}'], please use options.parseOptions / options.writeOptions`);
58
+ return false;
59
+ });
60
+ const workBook = worksheets.reduce((soFar, { name, data, options = {} }, index) => {
61
+ const sheetName = name || `Sheet_${index}`;
62
+ const sheetData = utils.aoa_to_sheet(data, parseOptions);
63
+ soFar.SheetNames.push(sheetName);
64
+ soFar.Sheets[sheetName] = sheetData;
65
+ Object.assign(soFar.Sheets[sheetName], legacyOptions, sheetOptions, options);
66
+ return soFar;
67
+ }, new WorkBook());
68
+ return write(workBook, { bookType, bookSST, type, ...otherWriteOptions });
69
+ };
70
+ var src_default = { parse, parseMetadata, build };
71
+
72
+ export {
73
+ parse,
74
+ parseMetadata,
75
+ build,
76
+ src_default
77
+ };
78
+ //# sourceMappingURL=chunk-ID6OMQGT.js.map