@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.
- package/README.md +21 -0
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/es/facade.js +67 -0
- package/lib/es/index.js +2696 -0
- package/lib/facade.js +67 -0
- package/lib/index.js +2696 -0
- package/lib/types/commands/commands/add-sheet-table.command.d.ts +11 -0
- package/lib/types/commands/commands/add-table-theme.command.d.ts +8 -0
- package/lib/types/commands/commands/delete-sheet-table.command.d.ts +3 -0
- package/lib/types/commands/commands/remove-table-theme.command.d.ts +7 -0
- package/lib/types/commands/commands/set-sheet-table.command.d.ts +7 -0
- package/lib/types/commands/commands/set-table-filter.command.d.ts +3 -0
- package/lib/types/commands/commands/sheet-table-row-col.command.d.ts +11 -0
- package/lib/types/commands/mutations/add-sheet-table.mutation.d.ts +14 -0
- package/lib/types/commands/mutations/delete-sheet-table.mutation.d.ts +7 -0
- package/lib/types/commands/mutations/set-sheet-table.mutation.d.ts +9 -0
- package/lib/types/commands/mutations/set-table-filter.mutation.d.ts +11 -0
- package/lib/types/const.d.ts +18 -0
- package/lib/types/controllers/sheet-table-range.controller.d.ts +9 -0
- package/lib/types/controllers/sheet-table-ref-range.controller.d.ts +19 -0
- package/lib/types/controllers/sheet-table-theme.controller.d.ts +12 -0
- package/lib/types/controllers/sheets-table.controller.d.ts +19 -0
- package/lib/types/controllers/table-filter.controller.d.ts +18 -0
- package/lib/types/controllers/table-theme.factory.d.ts +88 -0
- package/lib/types/facade/f-workbook.d.ts +88 -0
- package/lib/types/facade/f-worksheet.d.ts +17 -0
- package/lib/types/facade/index.d.ts +19 -0
- package/lib/types/index.d.ts +42 -0
- package/lib/types/model/filter-util/condition.d.ts +11 -0
- package/lib/types/model/filter-util/date-filter-util.d.ts +210 -0
- package/lib/types/model/filter-util/manual.d.ts +7 -0
- package/lib/types/model/filter-util/number-filter-util.d.ts +32 -0
- package/lib/types/model/filter-util/text-filter-util.d.ts +8 -0
- package/lib/types/model/filter-util/top-n.d.ts +29 -0
- package/lib/types/model/table-column.d.ts +24 -0
- package/lib/types/model/table-filter.d.ts +26 -0
- package/lib/types/model/table-manager.d.ts +79 -0
- package/lib/types/model/table.d.ts +81 -0
- package/lib/types/plugin.d.ts +12 -0
- package/lib/types/services/table-service.d.ts +18 -0
- package/lib/types/types/enum.d.ts +115 -0
- package/lib/types/types/type.d.ts +205 -0
- package/lib/types/util.d.ts +16 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ICommand, IRange } from '@univerjs/core';
|
|
2
|
+
import { ITableOptions } from '../../types/type';
|
|
3
|
+
export interface IAddSheetTableCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
range: IRange;
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
options?: ITableOptions;
|
|
10
|
+
}
|
|
11
|
+
export declare const AddSheetTableCommand: ICommand<IAddSheetTableCommandParams>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { RangeThemeStyle } from '@univerjs/sheets';
|
|
3
|
+
export interface IAddTableThemeCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
tableId: string;
|
|
6
|
+
themeStyle: RangeThemeStyle;
|
|
7
|
+
}
|
|
8
|
+
export declare const AddTableThemeCommand: ICommand<IAddTableThemeCommandParams>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { ITableSetConfig } from '../../types/type';
|
|
3
|
+
export interface ISetSheetTableCommandParams extends ITableSetConfig {
|
|
4
|
+
unitId: string;
|
|
5
|
+
tableId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const SetSheetTableCommand: ICommand<ISetSheetTableCommandParams>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
interface ISheetTableRowColOperationCommandParams {
|
|
3
|
+
tableId: string;
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const SheetTableInsertRowCommand: ICommand<ISheetTableRowColOperationCommandParams>;
|
|
8
|
+
export declare const SheetTableInsertColCommand: ICommand<ISheetTableRowColOperationCommandParams>;
|
|
9
|
+
export declare const SheetTableRemoveRowCommand: ICommand<ISheetTableRowColOperationCommandParams>;
|
|
10
|
+
export declare const SheetTableRemoveColCommand: ICommand<ISheetTableRowColOperationCommandParams>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IMutation } from '@univerjs/core';
|
|
2
|
+
import { ITableOptions, ITableRange } from '../../types/type';
|
|
3
|
+
export interface IAddSheetTableParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
range: ITableRange;
|
|
8
|
+
options?: ITableOptions;
|
|
9
|
+
tableId?: string;
|
|
10
|
+
header?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare const AddSheetTableMutation: IMutation<IAddSheetTableParams & {
|
|
13
|
+
tableId: string;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IMutation } from '@univerjs/core';
|
|
2
|
+
import { ITableSetConfig } from '../../types/type';
|
|
3
|
+
export interface ISetSheetTableMutationParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
tableId: string;
|
|
7
|
+
config: ITableSetConfig;
|
|
8
|
+
}
|
|
9
|
+
export declare const SetSheetTableMutation: IMutation<ISetSheetTableMutationParams>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IMutation } from '@univerjs/core';
|
|
2
|
+
import { ITableFilterItem } from '../../types/type';
|
|
3
|
+
export interface ISetSheetTableParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
tableId: string;
|
|
6
|
+
column: number;
|
|
7
|
+
tableFilter: ITableFilterItem | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare const SetSheetTableFilterMutation: IMutation<ISetSheetTableParams & {
|
|
10
|
+
tableId: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PLUGIN_NAME = "SHEET_TABLE_PLUGIN";
|
|
17
|
+
export declare const FEATURE_TABLE_ID = "SHEET_TABLE";
|
|
18
|
+
export declare const DEFAULT_COLUMN_NAME_PREFIX = "Column";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { IExclusiveRangeService } from '@univerjs/sheets';
|
|
3
|
+
import { TableManager } from '../model/table-manager';
|
|
4
|
+
export declare class SheetTableRangeController extends Disposable {
|
|
5
|
+
private _tableManager;
|
|
6
|
+
private _exclusiveRangeService;
|
|
7
|
+
constructor(_tableManager: TableManager, _exclusiveRangeService: IExclusiveRangeService);
|
|
8
|
+
private _initRangeListener;
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Disposable, ICommandService, Injector, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
|
+
import { RefRangeService, SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
+
import { TableManager } from '../model/table-manager';
|
|
4
|
+
export declare class SheetTableRefRangeController extends Disposable {
|
|
5
|
+
private readonly _commandService;
|
|
6
|
+
private readonly _refRangeService;
|
|
7
|
+
private readonly _univerInstanceService;
|
|
8
|
+
private _injector;
|
|
9
|
+
private _sheetInterceptorService;
|
|
10
|
+
private _tableManager;
|
|
11
|
+
private _localeService;
|
|
12
|
+
constructor(_commandService: ICommandService, _refRangeService: RefRangeService, _univerInstanceService: IUniverInstanceService, _injector: Injector, _sheetInterceptorService: SheetInterceptorService, _tableManager: TableManager, _localeService: LocaleService);
|
|
13
|
+
private _initCommandInterceptor;
|
|
14
|
+
private _generateTableMutationWithInsertRow;
|
|
15
|
+
private _generateTableMutationWithInsertCol;
|
|
16
|
+
private _generateTableMutationWithRemoveRow;
|
|
17
|
+
private _generateTableMutationWithRemoveCol;
|
|
18
|
+
private _initCommandListener;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { SheetRangeThemeModel, SheetRangeThemeService } from '@univerjs/sheets';
|
|
3
|
+
import { TableManager } from '../model/table-manager';
|
|
4
|
+
export declare class SheetsTableThemeController extends Disposable {
|
|
5
|
+
private _tableManager;
|
|
6
|
+
private _sheetRangeThemeService;
|
|
7
|
+
private _sheetRangeThemeModel;
|
|
8
|
+
constructor(_tableManager: TableManager, _sheetRangeThemeService: SheetRangeThemeService, _sheetRangeThemeModel: SheetRangeThemeModel);
|
|
9
|
+
registerTableChangeEvent(): void;
|
|
10
|
+
private _initDefaultTableTheme;
|
|
11
|
+
dispose(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IRange, Disposable, IResourceManagerService } from '@univerjs/core';
|
|
2
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
+
import { TableManager } from '../model/table-manager';
|
|
4
|
+
export declare class SheetsTableController extends Disposable {
|
|
5
|
+
private _sheetInterceptorService;
|
|
6
|
+
private _tableManager;
|
|
7
|
+
private _resourceManagerService;
|
|
8
|
+
private _tableRangeRTree;
|
|
9
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _tableManager: TableManager, _resourceManagerService: IResourceManagerService);
|
|
10
|
+
getContainerTableWithRange(unitId: string, subUnitId: string, range: IRange): import('../model/table').Table | undefined;
|
|
11
|
+
private _ensureTableRangeRTree;
|
|
12
|
+
registerTableChangeEvent(): void;
|
|
13
|
+
registerTableHeaderInterceptor(): void;
|
|
14
|
+
private _toJson;
|
|
15
|
+
private _fromJSON;
|
|
16
|
+
private _deleteUnitId;
|
|
17
|
+
private _initSnapshot;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
+
import { TableManager } from '../model/table-manager';
|
|
4
|
+
export declare class TableFilterController extends Disposable {
|
|
5
|
+
private _tableManager;
|
|
6
|
+
private readonly _sheetInterceptorService;
|
|
7
|
+
private readonly _univerInstanceService;
|
|
8
|
+
private readonly _tableFilteredOutRows$;
|
|
9
|
+
readonly tableFilteredOutRows$: import('rxjs').Observable<Readonly<Set<number>>>;
|
|
10
|
+
private _subscription;
|
|
11
|
+
constructor(_tableManager: TableManager, _sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService);
|
|
12
|
+
get tableFilteredOutRows(): Set<number>;
|
|
13
|
+
set tableFilteredOutRows(value: Set<number>);
|
|
14
|
+
initTableHiddenRowIntercept(): void;
|
|
15
|
+
private _initFilteredOutRows;
|
|
16
|
+
registerFilterChangeEvent(): void;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { IRangeThemeStyleItem, IRangeThemeStyleJSON } from '@univerjs/sheets';
|
|
2
|
+
import { BorderStyleTypes } from '@univerjs/core';
|
|
3
|
+
interface ITableDefaultThemeStyle {
|
|
4
|
+
name: string;
|
|
5
|
+
style: Omit<IRangeThemeStyleJSON, 'name'>;
|
|
6
|
+
}
|
|
7
|
+
export declare const tableDefaultBorderStyle: {
|
|
8
|
+
s: BorderStyleTypes;
|
|
9
|
+
cl: {
|
|
10
|
+
rgb: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const customEmptyThemeWithBorderStyle: Omit<IRangeThemeStyleJSON, 'name'>;
|
|
14
|
+
export declare const processStyleWithBorderStyle: (key: keyof Omit<IRangeThemeStyleJSON, "name">, style: IRangeThemeStyleItem) => IRangeThemeStyleItem | {
|
|
15
|
+
bd: {
|
|
16
|
+
t: {
|
|
17
|
+
s: BorderStyleTypes;
|
|
18
|
+
cl: {
|
|
19
|
+
rgb: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
b?: undefined;
|
|
23
|
+
r?: undefined;
|
|
24
|
+
l?: undefined;
|
|
25
|
+
};
|
|
26
|
+
ht?: import('@univerjs/core').Nullable<import('@univerjs/core').HorizontalAlign>;
|
|
27
|
+
vt?: import('@univerjs/core').Nullable<import('@univerjs/core').VerticalAlign>;
|
|
28
|
+
bg?: import('@univerjs/core').Nullable<import('@univerjs/core').IColorStyle>;
|
|
29
|
+
cl?: import('@univerjs/core').Nullable<import('@univerjs/core').IColorStyle>;
|
|
30
|
+
bl?: import('@univerjs/core').BooleanNumber | undefined;
|
|
31
|
+
ol?: import('@univerjs/core').ITextDecoration | undefined;
|
|
32
|
+
} | {
|
|
33
|
+
bd: {
|
|
34
|
+
b: {
|
|
35
|
+
s: BorderStyleTypes;
|
|
36
|
+
cl: {
|
|
37
|
+
rgb: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
t?: undefined;
|
|
41
|
+
r?: undefined;
|
|
42
|
+
l?: undefined;
|
|
43
|
+
};
|
|
44
|
+
ht?: import('@univerjs/core').Nullable<import('@univerjs/core').HorizontalAlign>;
|
|
45
|
+
vt?: import('@univerjs/core').Nullable<import('@univerjs/core').VerticalAlign>;
|
|
46
|
+
bg?: import('@univerjs/core').Nullable<import('@univerjs/core').IColorStyle>;
|
|
47
|
+
cl?: import('@univerjs/core').Nullable<import('@univerjs/core').IColorStyle>;
|
|
48
|
+
bl?: import('@univerjs/core').BooleanNumber | undefined;
|
|
49
|
+
ol?: import('@univerjs/core').ITextDecoration | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
bd: {
|
|
52
|
+
r: {
|
|
53
|
+
s: BorderStyleTypes;
|
|
54
|
+
cl: {
|
|
55
|
+
rgb: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
t?: undefined;
|
|
59
|
+
b?: undefined;
|
|
60
|
+
l?: undefined;
|
|
61
|
+
};
|
|
62
|
+
ht?: import('@univerjs/core').Nullable<import('@univerjs/core').HorizontalAlign>;
|
|
63
|
+
vt?: import('@univerjs/core').Nullable<import('@univerjs/core').VerticalAlign>;
|
|
64
|
+
bg?: import('@univerjs/core').Nullable<import('@univerjs/core').IColorStyle>;
|
|
65
|
+
cl?: import('@univerjs/core').Nullable<import('@univerjs/core').IColorStyle>;
|
|
66
|
+
bl?: import('@univerjs/core').BooleanNumber | undefined;
|
|
67
|
+
ol?: import('@univerjs/core').ITextDecoration | undefined;
|
|
68
|
+
} | {
|
|
69
|
+
bd: {
|
|
70
|
+
l: {
|
|
71
|
+
s: BorderStyleTypes;
|
|
72
|
+
cl: {
|
|
73
|
+
rgb: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
t?: undefined;
|
|
77
|
+
b?: undefined;
|
|
78
|
+
r?: undefined;
|
|
79
|
+
};
|
|
80
|
+
ht?: import('@univerjs/core').Nullable<import('@univerjs/core').HorizontalAlign>;
|
|
81
|
+
vt?: import('@univerjs/core').Nullable<import('@univerjs/core').VerticalAlign>;
|
|
82
|
+
bg?: import('@univerjs/core').Nullable<import('@univerjs/core').IColorStyle>;
|
|
83
|
+
cl?: import('@univerjs/core').Nullable<import('@univerjs/core').IColorStyle>;
|
|
84
|
+
bl?: import('@univerjs/core').BooleanNumber | undefined;
|
|
85
|
+
ol?: import('@univerjs/core').ITextDecoration | undefined;
|
|
86
|
+
};
|
|
87
|
+
export declare const tableThemeConfig: ITableDefaultThemeStyle[];
|
|
88
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ITableFilterItem, ITableInfo, ITableInfoWithUnitId, ITableOptions, ITableRange } from '@univerjs/sheets-table';
|
|
2
|
+
import { FWorkbook } from '@univerjs/sheets/facade';
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
export interface IFWorkbookSheetsTableMixin {
|
|
7
|
+
/**
|
|
8
|
+
* Get table information
|
|
9
|
+
* @param {string} tableId The table id
|
|
10
|
+
* @returns {ITableInfo} The table information
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
14
|
+
* const fSheet = fWorkbook.getActiveSheet();
|
|
15
|
+
* const id = fWorkbook.addTable('Table1', {
|
|
16
|
+
* unitId: fWorkbook.getId(),
|
|
17
|
+
* subUnitId:fSheet.getSheetId(),
|
|
18
|
+
* range: {
|
|
19
|
+
* startRow: 1,
|
|
20
|
+
* startColumn: 1,
|
|
21
|
+
* endRow: 10,
|
|
22
|
+
* endColumn: 5,
|
|
23
|
+
* },
|
|
24
|
+
* }, { showHeader: true });
|
|
25
|
+
* const tableInfo = fWorkbook.getTableInfo(fWorkbook.getId(), id);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
getTableInfo(tableId: string): ITableInfoWithUnitId | undefined;
|
|
29
|
+
getTableInfoByName(tableName: string): ITableInfoWithUnitId | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Get table list
|
|
32
|
+
* @returns {ITableInfo[]} The table list
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
36
|
+
* const fSheet = fWorkbook.getActiveSheet();
|
|
37
|
+
* const id = fWorkbook.addTable('Table1', {
|
|
38
|
+
* unitId: fWorkbook.getId(),
|
|
39
|
+
* subUnitId:fSheet.getSheetId(),
|
|
40
|
+
* range: {
|
|
41
|
+
* startRow: 1,
|
|
42
|
+
* startColumn: 1,
|
|
43
|
+
* endRow: 10,
|
|
44
|
+
* endColumn: 5,
|
|
45
|
+
* },
|
|
46
|
+
* }, { showHeader: true });
|
|
47
|
+
* const tableList = fWorkbook.getTableList(fWorkbook.getId());
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
getTableList(): ITableInfo[];
|
|
51
|
+
/**
|
|
52
|
+
* Add table
|
|
53
|
+
* @param {string} tableName The table name
|
|
54
|
+
* @param {ITableRange} rangeInfo The table range information
|
|
55
|
+
* @param {ITableOptions} options The table options
|
|
56
|
+
* @returns {string} The table id
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
60
|
+
* const fSheet = fWorkbook.getActiveSheet();
|
|
61
|
+
* const id = fWorkbook.addTable('Table1', {
|
|
62
|
+
* unitId: fWorkbook.getId(),
|
|
63
|
+
* subUnitId:fSheet.getSheetId(),
|
|
64
|
+
* range: {
|
|
65
|
+
* startRow: 1,
|
|
66
|
+
* startColumn: 1,
|
|
67
|
+
* endRow: 10,
|
|
68
|
+
* endColumn: 5,
|
|
69
|
+
* },
|
|
70
|
+
* }, 'table1' ,{ showHeader: true });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
addTable(subUnitId: string, tableName: string, rangeInfo: ITableRange, tableId?: string, options?: ITableOptions): Promise<string | undefined>;
|
|
74
|
+
setTableFilter(tableId: string, column: number, filter: ITableFilterItem | undefined): void;
|
|
75
|
+
removeTable(tableId: string): Promise<boolean>;
|
|
76
|
+
}
|
|
77
|
+
export declare class FWorkbookSheetsTableMixin extends FWorkbook implements IFWorkbookSheetsTableMixin {
|
|
78
|
+
getTableInfo(tableId: string): ITableInfoWithUnitId | undefined;
|
|
79
|
+
getTableList(): ITableInfoWithUnitId[];
|
|
80
|
+
addTable(subUnitId: string, tableName: string, rangeInfo: ITableRange, tableId?: string, options?: ITableOptions): Promise<string | undefined>;
|
|
81
|
+
removeTable(tableId: string): Promise<boolean>;
|
|
82
|
+
getTableInfoByName(tableName: string): ITableInfoWithUnitId | undefined;
|
|
83
|
+
setTableFilter(tableId: string, column: number, filter: ITableFilterItem | undefined): Promise<boolean>;
|
|
84
|
+
}
|
|
85
|
+
declare module '@univerjs/sheets/facade' {
|
|
86
|
+
interface FWorkbook extends IFWorkbookSheetsTableMixin {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ITableFilterItem, ITableOptions, ITableRange } from '@univerjs/sheets-table';
|
|
2
|
+
import { FWorksheet } from '@univerjs/sheets/facade';
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
export interface IFWorkSheetTableMixin {
|
|
7
|
+
addTable(tableName: string, rangeInfo: ITableRange, tableId?: string, options?: ITableOptions): string;
|
|
8
|
+
addTableFilter(tableId: string, column: number, filter: ITableFilterItem): Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export declare class FWorkSheetTableMixin extends FWorksheet implements IFWorkSheetTableMixin {
|
|
11
|
+
addTable(tableName: string, rangeInfo: ITableRange, tableId?: string, options?: ITableOptions): string;
|
|
12
|
+
addTableFilter(tableId: string, column: number, filter: ITableFilterItem): Promise<boolean>;
|
|
13
|
+
}
|
|
14
|
+
declare module '@univerjs/sheets/facade' {
|
|
15
|
+
interface FWorksheet extends IFWorkSheetTableMixin {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import './f-workbook';
|
|
17
|
+
import './f-worksheet';
|
|
18
|
+
export type * from './f-workbook';
|
|
19
|
+
export type * from './f-worksheet';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { SheetsTableButtonStateEnum, SheetsTableSortStateEnum, TableColumnDataTypeEnum, TableColumnFilterTypeEnum, TableConditionTypeEnum, TableDateCompareTypeEnum, TableNumberCompareTypeEnum, TableStringCompareTypeEnum } from './types/enum';
|
|
17
|
+
export { UniverSheetTablePlugin } from './plugin';
|
|
18
|
+
export type { ITableColumnJson, ITableConditionFilterItem, ITableData, ITableFilterItem, ITableInfo, ITableInfoWithUnitId, ITableManualFilterItem, ITableOptions, ITableRange, ITableRangeWithState, TableMetaType, TableRelationTupleType } from './types/type';
|
|
19
|
+
export { SheetTableService } from '../src/services/table-service';
|
|
20
|
+
export { TableManager } from '../src/model/table-manager';
|
|
21
|
+
export { isConditionFilter, isManualFilter } from '../src/util';
|
|
22
|
+
export { SheetsTableController } from '../src/controllers/sheets-table.controller';
|
|
23
|
+
export { AddSheetTableCommand } from '../src/commands/commands/add-sheet-table.command';
|
|
24
|
+
export { AddSheetTableMutation } from '../src/commands/mutations/add-sheet-table.mutation';
|
|
25
|
+
export { SetSheetTableFilterCommand } from '../src/commands/commands/set-table-filter.command';
|
|
26
|
+
export { SetSheetTableFilterMutation } from '../src/commands/mutations/set-table-filter.mutation';
|
|
27
|
+
export { DeleteSheetTableCommand } from '../src/commands/commands/delete-sheet-table.command';
|
|
28
|
+
export { DeleteSheetTableMutation } from '../src/commands/mutations/delete-sheet-table.mutation';
|
|
29
|
+
export type { ISetSheetTableParams } from '../src/commands/mutations/set-table-filter.mutation';
|
|
30
|
+
export type { IAddSheetTableParams } from '../src/commands/mutations/add-sheet-table.mutation';
|
|
31
|
+
export type { IDeleteSheetTableParams } from '../src/commands/mutations/delete-sheet-table.mutation';
|
|
32
|
+
export type { IAddSheetTableCommandParams } from './commands/commands/add-sheet-table.command';
|
|
33
|
+
export { SetSheetTableCommand } from './commands/commands/set-sheet-table.command';
|
|
34
|
+
export type { ISetSheetTableCommandParams } from './commands/commands/set-sheet-table.command';
|
|
35
|
+
export type { ITableSetConfig } from './types/type';
|
|
36
|
+
export { SetSheetTableMutation } from './commands/mutations/set-sheet-table.mutation';
|
|
37
|
+
export type { ISetSheetTableMutationParams } from './commands/mutations/set-sheet-table.mutation';
|
|
38
|
+
export type { IAddTableThemeCommandParams } from './commands/commands/add-table-theme.command';
|
|
39
|
+
export { AddTableThemeCommand } from './commands/commands/add-table-theme.command';
|
|
40
|
+
export { RemoveTableThemeCommand } from './commands/commands/remove-table-theme.command';
|
|
41
|
+
export { SheetTableInsertColCommand, SheetTableInsertRowCommand, SheetTableRemoveColCommand, SheetTableRemoveRowCommand } from './commands/commands/sheet-table-row-col.command';
|
|
42
|
+
export { customEmptyThemeWithBorderStyle, processStyleWithBorderStyle } from './controllers/table-theme.factory';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDocumentData, Worksheet } from '@univerjs/core';
|
|
2
|
+
import { TableStringCompareTypeEnum, TableConditionTypeEnum, TableDateCompareTypeEnum, TableNumberCompareTypeEnum } from '../../types/enum';
|
|
3
|
+
import { ICalculatedOptions, ITableConditionFilterItem } from '../../types/type';
|
|
4
|
+
type TableConditionCompareType = TableNumberCompareTypeEnum | TableDateCompareTypeEnum | TableStringCompareTypeEnum;
|
|
5
|
+
export declare function isNumberDynamicFilter(compareType: TableConditionCompareType): compareType is TableNumberCompareTypeEnum;
|
|
6
|
+
export declare function isDateDynamicFilter(compareType: TableConditionCompareType): compareType is TableDateCompareTypeEnum;
|
|
7
|
+
export declare function getConditionExecuteFunc(filter: ITableConditionFilterItem, calculatedOptions: ICalculatedOptions | undefined): ((date: Date) => boolean) | ((value: number) => boolean) | ((value: string) => boolean);
|
|
8
|
+
export declare function getCellValueWithConditionType(sheet: Worksheet, row: number, col: number, conditionType: TableConditionTypeEnum): string | number | Date | null;
|
|
9
|
+
export declare const getStringFromDataStream: (data: IDocumentData) => string;
|
|
10
|
+
export declare function excelSerialToDateTime(serial: number): Date;
|
|
11
|
+
export {};
|