@univerjs/sheets-table 1.0.0-rc.0 → 1.0.0
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/lib/cjs/facade.js +23 -1
- package/lib/cjs/index.js +484 -74
- package/lib/cjs/locale/ar-SA.js +0 -1
- package/lib/cjs/locale/ca-ES.js +0 -1
- package/lib/cjs/locale/de-DE.js +0 -1
- package/lib/cjs/locale/en-US.js +0 -1
- package/lib/cjs/locale/es-ES.js +0 -1
- package/lib/cjs/locale/fa-IR.js +0 -1
- package/lib/cjs/locale/fr-FR.js +0 -1
- package/lib/cjs/locale/id-ID.js +0 -1
- package/lib/cjs/locale/it-IT.js +0 -1
- package/lib/cjs/locale/ja-JP.js +0 -1
- package/lib/cjs/locale/ko-KR.js +0 -1
- package/lib/cjs/locale/pl-PL.js +0 -1
- package/lib/cjs/locale/pt-BR.js +0 -1
- package/lib/cjs/locale/ru-RU.js +0 -1
- package/lib/cjs/locale/sk-SK.js +0 -1
- package/lib/cjs/locale/vi-VN.js +0 -1
- package/lib/cjs/locale/zh-CN.js +0 -1
- package/lib/cjs/locale/zh-HK.js +0 -1
- package/lib/cjs/locale/zh-TW.js +0 -1
- package/lib/es/facade.js +25 -3
- package/lib/es/index.js +484 -78
- package/lib/facade.js +25 -3
- package/lib/index.js +484 -78
- package/lib/types/commands/mutations/set-table-filter.mutation.d.ts +3 -0
- package/lib/types/commands/utils/calculated-column.d.ts +20 -0
- package/lib/types/controllers/sheet-table-formula.controller.d.ts +4 -1
- package/lib/types/controllers/table-filter.controller.d.ts +4 -1
- package/lib/types/facade/f-enum.d.ts +5 -0
- package/lib/types/facade/f-workbook.d.ts +6 -6
- package/lib/types/facade/f-worksheet.d.ts +22 -3
- package/lib/types/index.d.ts +3 -2
- package/lib/types/model/filter-util/condition.d.ts +27 -0
- package/lib/types/model/filter-util/date-filter-util.d.ts +225 -0
- package/lib/types/model/filter-util/number-filter-util.d.ts +47 -0
- package/lib/types/model/filter-util/text-filter-util.d.ts +23 -0
- package/lib/types/model/filter-util/top-n.d.ts +29 -0
- package/lib/types/model/table-column.d.ts +39 -0
- package/lib/types/model/table-filter.d.ts +42 -0
- package/lib/types/model/table-manager.d.ts +97 -0
- package/lib/types/model/table.d.ts +96 -0
- package/lib/types/models/filter-util/record-filter.d.ts +24 -0
- package/lib/types/models/table-column.d.ts +11 -0
- package/lib/types/models/table-filter.d.ts +1 -0
- package/lib/types/models/table.d.ts +4 -0
- package/lib/types/types/enum.d.ts +2 -1
- package/lib/types/types/type.d.ts +55 -2
- package/lib/types/util.d.ts +2 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/facade.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IUniverInstanceService,
|
|
2
|
-
import { AddSheetTableCommand, AddTableThemeCommand, DeleteSheetTableCommand, SetSheetTableCommand, SetSheetTableFilterCommand, SheetTableService, TableColumnFilterTypeEnum, TableConditionTypeEnum, TableDateCompareTypeEnum, TableNumberCompareTypeEnum, TableStringCompareTypeEnum } from "@univerjs/sheets-table";
|
|
1
|
+
import { IUniverInstanceService, Rectangle, UniverInstanceType, cellToRange, customNameCharacterCheck } from "@univerjs/core";
|
|
2
|
+
import { AddSheetTableCommand, AddTableThemeCommand, DeleteSheetTableCommand, SetSheetTableCommand, SetSheetTableFilterCommand, SheetTableService, TableColumnFilterTypeEnum, TableConditionTypeEnum, TableDateCompareTypeEnum, TableManager, TableNumberCompareTypeEnum, TableStringCompareTypeEnum } from "@univerjs/sheets-table";
|
|
3
3
|
import { FWorkbook, FWorksheet } from "@univerjs/sheets/facade";
|
|
4
4
|
import { RangeThemeStyle } from "@univerjs/sheets";
|
|
5
5
|
import { FEnum } from "@univerjs/core/facade";
|
|
@@ -64,11 +64,33 @@ FWorkbook.extend(FWorkbookSheetsTableMixin);
|
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/facade/f-worksheet.ts
|
|
66
66
|
var FWorksheetTableMixin = class extends FWorksheet {
|
|
67
|
+
setTableColumnFormula(tableId, columnId, formula) {
|
|
68
|
+
const unitId = this.getWorkbook().getUnitId();
|
|
69
|
+
const table = this._injector.get(TableManager).getTableById(unitId, tableId);
|
|
70
|
+
if (!table || table.getSubunitId() !== this.getSheetId()) return false;
|
|
71
|
+
return this._commandService.syncExecuteCommand(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(TableManager).getTableById(unitId, tableId);
|
|
83
|
+
if (!table || table.getSubunitId() !== this.getSheetId()) return false;
|
|
84
|
+
return this._commandService.syncExecuteCommand(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(LocaleService);
|
|
72
94
|
const sheetNameSet = /* @__PURE__ */ new Set();
|
|
73
95
|
if (workbook) workbook.getSheets().forEach((sheet) => {
|
|
74
96
|
sheetNameSet.add(sheet.getName());
|