@univerjs/sheets-table 0.6.10-experimental.20250418-8830bd4

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 (47) hide show
  1. package/README.md +21 -0
  2. package/lib/cjs/facade.js +1 -0
  3. package/lib/cjs/index.js +1 -0
  4. package/lib/es/facade.js +67 -0
  5. package/lib/es/index.js +2696 -0
  6. package/lib/facade.js +67 -0
  7. package/lib/index.js +2696 -0
  8. package/lib/types/commands/commands/add-sheet-table.command.d.ts +11 -0
  9. package/lib/types/commands/commands/add-table-theme.command.d.ts +8 -0
  10. package/lib/types/commands/commands/delete-sheet-table.command.d.ts +3 -0
  11. package/lib/types/commands/commands/remove-table-theme.command.d.ts +7 -0
  12. package/lib/types/commands/commands/set-sheet-table.command.d.ts +7 -0
  13. package/lib/types/commands/commands/set-table-filter.command.d.ts +3 -0
  14. package/lib/types/commands/commands/sheet-table-row-col.command.d.ts +11 -0
  15. package/lib/types/commands/mutations/add-sheet-table.mutation.d.ts +14 -0
  16. package/lib/types/commands/mutations/delete-sheet-table.mutation.d.ts +7 -0
  17. package/lib/types/commands/mutations/set-sheet-table.mutation.d.ts +9 -0
  18. package/lib/types/commands/mutations/set-table-filter.mutation.d.ts +11 -0
  19. package/lib/types/const.d.ts +18 -0
  20. package/lib/types/controllers/sheet-table-range.controller.d.ts +9 -0
  21. package/lib/types/controllers/sheet-table-ref-range.controller.d.ts +19 -0
  22. package/lib/types/controllers/sheet-table-theme.controller.d.ts +12 -0
  23. package/lib/types/controllers/sheets-table.controller.d.ts +19 -0
  24. package/lib/types/controllers/table-filter.controller.d.ts +18 -0
  25. package/lib/types/controllers/table-theme.factory.d.ts +88 -0
  26. package/lib/types/facade/f-workbook.d.ts +88 -0
  27. package/lib/types/facade/f-worksheet.d.ts +17 -0
  28. package/lib/types/facade/index.d.ts +19 -0
  29. package/lib/types/index.d.ts +42 -0
  30. package/lib/types/model/filter-util/condition.d.ts +11 -0
  31. package/lib/types/model/filter-util/date-filter-util.d.ts +210 -0
  32. package/lib/types/model/filter-util/manual.d.ts +7 -0
  33. package/lib/types/model/filter-util/number-filter-util.d.ts +32 -0
  34. package/lib/types/model/filter-util/text-filter-util.d.ts +8 -0
  35. package/lib/types/model/filter-util/top-n.d.ts +29 -0
  36. package/lib/types/model/table-column.d.ts +24 -0
  37. package/lib/types/model/table-filter.d.ts +26 -0
  38. package/lib/types/model/table-manager.d.ts +79 -0
  39. package/lib/types/model/table.d.ts +81 -0
  40. package/lib/types/plugin.d.ts +12 -0
  41. package/lib/types/services/table-service.d.ts +18 -0
  42. package/lib/types/types/enum.d.ts +115 -0
  43. package/lib/types/types/type.d.ts +205 -0
  44. package/lib/types/util.d.ts +16 -0
  45. package/lib/umd/facade.js +1 -0
  46. package/lib/umd/index.js +1 -0
  47. package/package.json +81 -0
package/lib/facade.js ADDED
@@ -0,0 +1,67 @@
1
+ import { SheetTableService as o, AddSheetTableCommand as g, DeleteSheetTableCommand as u, SetSheetTableFilterCommand as b, TableManager as I } from "@univerjs/sheets-table";
2
+ import { FWorkbook as m, FWorksheet as h } from "@univerjs/sheets/facade";
3
+ import { LocaleService as S } from "@univerjs/core";
4
+ class v extends m {
5
+ getTableInfo(e) {
6
+ const t = this.getId();
7
+ return this._injector.get(o).getTableInfo(t, e);
8
+ }
9
+ getTableList() {
10
+ const e = this.getId();
11
+ return this._injector.get(o).getTableList(e);
12
+ }
13
+ async addTable(e, t, i, a, d) {
14
+ var r;
15
+ const n = this._injector.get(o), s = {
16
+ unitId: this.getId(),
17
+ name: t,
18
+ subUnitId: e,
19
+ range: i,
20
+ options: d,
21
+ tableId: a
22
+ };
23
+ if (await this._commandService.executeCommand(g.id, s))
24
+ return (r = n.getTableList(this.getId()).find((c) => c.name === t)) == null ? void 0 : r.id;
25
+ }
26
+ async removeTable(e) {
27
+ var a;
28
+ const t = (a = this.getTableInfo(e)) == null ? void 0 : a.subUnitId;
29
+ if (!t)
30
+ return !1;
31
+ const i = {
32
+ unitId: this.getId(),
33
+ subUnitId: t,
34
+ tableId: e
35
+ };
36
+ return this._commandService.executeCommand(u.id, i);
37
+ }
38
+ getTableInfoByName(e) {
39
+ return this.getTableList().find((i) => i.name === e);
40
+ }
41
+ setTableFilter(e, t, i) {
42
+ const a = {
43
+ unitId: this.getId(),
44
+ tableId: e,
45
+ column: t,
46
+ tableFilter: i
47
+ };
48
+ return this._commandService.executeCommand(b.id, a);
49
+ }
50
+ }
51
+ m.extend(v);
52
+ class f extends h {
53
+ addTable(e, t, i, a) {
54
+ const d = this._injector.get(o), n = this.getSheetId(), s = this.getWorkbook().getUnitId(), l = this._injector.get(I), r = this._injector.get(S), c = l.getColumnHeader(s, n, t, r.t("sheets-table.columnPrefix"));
55
+ return d.addTable(s, n, e, t, c, i, a);
56
+ }
57
+ addTableFilter(e, t, i) {
58
+ const a = {
59
+ unitId: this.getWorkbook().getUnitId(),
60
+ tableId: e,
61
+ column: t,
62
+ tableFilter: i
63
+ };
64
+ return this._commandService.executeCommand(b.id, a);
65
+ }
66
+ }
67
+ h.extend(f);