@univerjs/sheets-table 1.0.0-rc.0 → 1.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.
Files changed (43) hide show
  1. package/lib/cjs/facade.js +23 -1
  2. package/lib/cjs/index.js +484 -74
  3. package/lib/cjs/locale/ar-SA.js +0 -1
  4. package/lib/cjs/locale/ca-ES.js +0 -1
  5. package/lib/cjs/locale/de-DE.js +0 -1
  6. package/lib/cjs/locale/en-US.js +0 -1
  7. package/lib/cjs/locale/es-ES.js +0 -1
  8. package/lib/cjs/locale/fa-IR.js +0 -1
  9. package/lib/cjs/locale/fr-FR.js +0 -1
  10. package/lib/cjs/locale/id-ID.js +0 -1
  11. package/lib/cjs/locale/it-IT.js +0 -1
  12. package/lib/cjs/locale/ja-JP.js +0 -1
  13. package/lib/cjs/locale/ko-KR.js +0 -1
  14. package/lib/cjs/locale/pl-PL.js +0 -1
  15. package/lib/cjs/locale/pt-BR.js +0 -1
  16. package/lib/cjs/locale/ru-RU.js +0 -1
  17. package/lib/cjs/locale/sk-SK.js +0 -1
  18. package/lib/cjs/locale/vi-VN.js +0 -1
  19. package/lib/cjs/locale/zh-CN.js +0 -1
  20. package/lib/cjs/locale/zh-HK.js +0 -1
  21. package/lib/cjs/locale/zh-TW.js +0 -1
  22. package/lib/es/facade.js +25 -3
  23. package/lib/es/index.js +484 -78
  24. package/lib/facade.js +25 -3
  25. package/lib/index.js +484 -78
  26. package/lib/types/commands/mutations/set-table-filter.mutation.d.ts +3 -0
  27. package/lib/types/commands/utils/calculated-column.d.ts +20 -0
  28. package/lib/types/controllers/sheet-table-formula.controller.d.ts +4 -1
  29. package/lib/types/controllers/table-filter.controller.d.ts +4 -1
  30. package/lib/types/facade/f-enum.d.ts +5 -0
  31. package/lib/types/facade/f-workbook.d.ts +6 -6
  32. package/lib/types/facade/f-worksheet.d.ts +22 -3
  33. package/lib/types/index.d.ts +3 -2
  34. package/lib/types/models/filter-util/record-filter.d.ts +24 -0
  35. package/lib/types/models/table-column.d.ts +11 -0
  36. package/lib/types/models/table-filter.d.ts +1 -0
  37. package/lib/types/models/table.d.ts +4 -0
  38. package/lib/types/types/enum.d.ts +2 -1
  39. package/lib/types/types/type.d.ts +55 -2
  40. package/lib/types/util.d.ts +2 -1
  41. package/lib/umd/facade.js +1 -1
  42. package/lib/umd/index.js +1 -1
  43. package/package.json +8 -8
package/lib/cjs/facade.js CHANGED
@@ -64,11 +64,33 @@ _univerjs_sheets_facade.FWorkbook.extend(FWorkbookSheetsTableMixin);
64
64
  //#endregion
65
65
  //#region src/facade/f-worksheet.ts
66
66
  var FWorksheetTableMixin = class extends _univerjs_sheets_facade.FWorksheet {
67
+ setTableColumnFormula(tableId, columnId, formula) {
68
+ const unitId = this.getWorkbook().getUnitId();
69
+ const table = this._injector.get(_univerjs_sheets_table.TableManager).getTableById(unitId, tableId);
70
+ if (!table || table.getSubunitId() !== this.getSheetId()) return false;
71
+ return this._commandService.syncExecuteCommand(_univerjs_sheets_table.SetSheetTableCommand.id, {
72
+ unitId,
73
+ tableId,
74
+ calculatedColumn: {
75
+ columnId,
76
+ formula
77
+ }
78
+ });
79
+ }
80
+ setTableFilterButtons(tableId, config) {
81
+ const unitId = this.getWorkbook().getUnitId();
82
+ const table = this._injector.get(_univerjs_sheets_table.TableManager).getTableById(unitId, tableId);
83
+ if (!table || table.getSubunitId() !== this.getSheetId()) return false;
84
+ return this._commandService.syncExecuteCommand(_univerjs_sheets_table.SetSheetTableCommand.id, {
85
+ unitId,
86
+ tableId,
87
+ filterButtons: config
88
+ });
89
+ }
67
90
  addTable(tableName, rangeInfo, tableId, options) {
68
91
  const subUnitId = this.getSheetId();
69
92
  const workbook = this.getWorkbook();
70
93
  const unitId = workbook.getUnitId();
71
- this._injector.get(_univerjs_core.LocaleService);
72
94
  const sheetNameSet = /* @__PURE__ */ new Set();
73
95
  if (workbook) workbook.getSheets().forEach((sheet) => {
74
96
  sheetNameSet.add(sheet.getName());