@univerjs/core 0.2.1 → 0.2.3
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 +17 -8
- package/lib/cjs/index.js +9 -9
- package/lib/es/index.js +1848 -1805
- package/lib/types/docs/data-model/types.d.ts +2 -2
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/command/command.service.d.ts +3 -1
- package/lib/types/services/lifecycle/lifecycle.service.d.ts +2 -2
- package/lib/types/services/plugin/plugin.service.d.ts +2 -0
- package/lib/types/shared/__tests__/rxjs.spec.d.ts +16 -0
- package/lib/types/shared/common.d.ts +1 -1
- package/lib/types/shared/rxjs.d.ts +4 -0
- package/lib/types/sheets/workbook.d.ts +10 -4
- package/lib/types/types/enum/locale-type.d.ts +3 -1
- package/lib/types/types/interfaces/i-data-validation.d.ts +19 -4
- package/lib/types/types/interfaces/i-range.d.ts +13 -11
- package/lib/umd/index.js +9 -9
- package/package.json +3 -3
|
@@ -28,8 +28,8 @@ export declare enum DataStreamTreeTokenType {
|
|
|
28
28
|
TABLE_ROW_START = "\u001B",// 表格开始
|
|
29
29
|
TABLE_CELL_START = "\u001C",// 表格开始
|
|
30
30
|
TABLE_CELL_END = "\u001D",// 表格开始
|
|
31
|
-
TABLE_ROW_END = "
|
|
32
|
-
TABLE_END = "
|
|
31
|
+
TABLE_ROW_END = "\u000E",// 表格开始
|
|
32
|
+
TABLE_END = "\u000F",// 表格结束
|
|
33
33
|
CUSTOM_RANGE_START = "\u001F",// 自定义范围开始
|
|
34
34
|
CUSTOM_RANGE_END = "\u001E",// 自定义范围结束
|
|
35
35
|
COLUMN_BREAK = "\v",// 换列
|
package/lib/types/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export { IResourceManagerService } from './services/resource-manager/type';
|
|
|
61
61
|
export { type IStyleSheet, ThemeService } from './services/theme/theme.service';
|
|
62
62
|
export { type IUndoRedoCommandInfos, type IUndoRedoCommandInfosByInterceptor, type IUndoRedoItem, IUndoRedoService, type IUndoRedoStatus, LocalUndoRedoService, RedoCommand, UndoCommand, RedoCommandId, UndoCommandId, } from './services/undoredo/undoredo.service';
|
|
63
63
|
export * from './shared';
|
|
64
|
-
export { fromCallback } from './shared/rxjs';
|
|
64
|
+
export { fromCallback, takeAfter } from './shared/rxjs';
|
|
65
65
|
export { UserManagerService, type IUser } from './services/user-manager/user-manager.service';
|
|
66
66
|
export type { IComposeInterceptors, IInterceptor, InterceptorHandler } from './common/interceptor';
|
|
67
67
|
export { composeInterceptors, createInterceptorKey, InterceptorManager } from './common/interceptor';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IAccessor, IDisposable, Injector } from '@wendellhu/redi';
|
|
2
|
+
import { Disposable } from '../../shared/lifecycle';
|
|
2
3
|
import { IContextService } from '../context/context.service';
|
|
3
4
|
import { ILogService } from '../log/log.service';
|
|
4
5
|
|
|
@@ -123,7 +124,7 @@ export declare class CommandRegistry {
|
|
|
123
124
|
getCommandType(id: string): CommandType | undefined;
|
|
124
125
|
}
|
|
125
126
|
export declare const NilCommand: ICommand;
|
|
126
|
-
export declare class CommandService implements ICommandService {
|
|
127
|
+
export declare class CommandService extends Disposable implements ICommandService {
|
|
127
128
|
private readonly _injector;
|
|
128
129
|
private readonly _logService;
|
|
129
130
|
protected readonly _commandRegistry: CommandRegistry;
|
|
@@ -133,6 +134,7 @@ export declare class CommandService implements ICommandService {
|
|
|
133
134
|
private _commandExecutingLevel;
|
|
134
135
|
private _commandExecutionStack;
|
|
135
136
|
constructor(_injector: Injector, _logService: ILogService);
|
|
137
|
+
dispose(): void;
|
|
136
138
|
hasCommand(commandId: string): boolean;
|
|
137
139
|
registerCommand(command: ICommand): IDisposable;
|
|
138
140
|
registerMultipleCommand(command: ICommand): IDisposable;
|
|
@@ -33,9 +33,9 @@ export declare class LifecycleService extends Disposable {
|
|
|
33
33
|
* @internal
|
|
34
34
|
*/
|
|
35
35
|
export declare class LifecycleInitializerService extends Disposable {
|
|
36
|
-
private _lifecycleService;
|
|
37
36
|
private readonly _injector;
|
|
38
37
|
private _seenTokens;
|
|
39
|
-
constructor(
|
|
38
|
+
constructor(_injector: Injector);
|
|
40
39
|
initModulesOnStage(stage: LifecycleStages): void;
|
|
41
40
|
}
|
|
41
|
+
export declare function getLifecycleStagesAndBefore(lifecycleStage: LifecycleStages): Observable<LifecycleStages>;
|
|
@@ -53,6 +53,7 @@ export declare class PluginHolder extends Disposable {
|
|
|
53
53
|
protected readonly _pluginRegistry: PluginRegistry;
|
|
54
54
|
/** Stores initialized plugin instances. */
|
|
55
55
|
protected readonly _pluginStore: PluginStore;
|
|
56
|
+
private readonly _awaitingPlugins;
|
|
56
57
|
constructor(_checkPluginRegistered: (pluginCtor: PluginCtor) => boolean, _registerPlugin: <T extends PluginCtor>(plugin: T, config?: ConstructorParameters<T>[0]) => void, _logService: ILogService, _injector: Injector, _lifecycleService: LifecycleService, _lifecycleInitializerService: LifecycleInitializerService);
|
|
57
58
|
dispose(): void;
|
|
58
59
|
register<T extends PluginCtor<Plugin>>(pluginCtor: T, config?: ConstructorParameters<T>[0]): void;
|
|
@@ -61,4 +62,5 @@ export declare class PluginHolder extends Disposable {
|
|
|
61
62
|
flush(): void;
|
|
62
63
|
private _initPlugin;
|
|
63
64
|
protected _pluginsRunLifecycle(plugins: Plugin[]): void;
|
|
65
|
+
private _runStage;
|
|
64
66
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 {};
|
|
@@ -5,7 +5,7 @@ import { IRangeWithCoord, ISelectionCell, ISelectionCellWithMergeInfo } from '..
|
|
|
5
5
|
import { IColorStyle, IStyleData } from '../types/interfaces/i-style-data';
|
|
6
6
|
import { Nullable } from './types';
|
|
7
7
|
|
|
8
|
-
export declare function makeCellToSelection(cellInfo:
|
|
8
|
+
export declare function makeCellToSelection(cellInfo: ISelectionCellWithMergeInfo): IRangeWithCoord;
|
|
9
9
|
export declare function makeCellRangeToRangeData(cellInfo: Nullable<ISelectionCell>): Nullable<IRange>;
|
|
10
10
|
export declare function isEmptyCell(cell: Nullable<ICellData>): boolean;
|
|
11
11
|
export declare function isCellCoverable(cell: Nullable<ICellDataForSheetInterceptor>): boolean;
|
|
@@ -12,4 +12,8 @@ type CallbackFn<T extends readonly unknown[]> = (cb: (...args: T) => void) => ID
|
|
|
12
12
|
* @returns The observable that will emit when the callback function gets called.
|
|
13
13
|
*/
|
|
14
14
|
export declare function fromCallback<T extends readonly unknown[]>(callback: CallbackFn<T>): Observable<T>;
|
|
15
|
+
/**
|
|
16
|
+
* An operator that would complete the stream once a condition is met. Consider it as a shortcut of `takeUntil`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function takeAfter<T>(callback: (value: T) => boolean): (source: Observable<T>) => Observable<T>;
|
|
15
19
|
export {};
|
|
@@ -63,16 +63,22 @@ export declare class Workbook extends UnitModel<IWorkbookData, UniverInstanceTyp
|
|
|
63
63
|
getConfig(): IWorkbookData;
|
|
64
64
|
getIndexBySheetId(sheetId: string): number;
|
|
65
65
|
/**
|
|
66
|
-
* Get the active sheet
|
|
66
|
+
* Get the active sheet.
|
|
67
67
|
*/
|
|
68
|
-
getActiveSheet():
|
|
68
|
+
getActiveSheet(): Worksheet;
|
|
69
|
+
getActiveSheet(allowNull: true): Nullable<Worksheet>;
|
|
69
70
|
/**
|
|
70
71
|
* If there is no active sheet, the first sheet would
|
|
71
72
|
* be set active.
|
|
72
73
|
* @returns
|
|
73
74
|
*/
|
|
74
75
|
ensureActiveSheet(): Worksheet;
|
|
75
|
-
|
|
76
|
+
/**
|
|
77
|
+
* ActiveSheet should not be null!
|
|
78
|
+
* There is at least one sheet in a workbook. You can not delete all sheets in a workbook.
|
|
79
|
+
* @param worksheet
|
|
80
|
+
*/
|
|
81
|
+
setActiveSheet(worksheet: Worksheet): void;
|
|
76
82
|
removeSheet(sheetId: string): boolean;
|
|
77
83
|
getActiveSheetIndex(): number;
|
|
78
84
|
getSheetSize(): number;
|
|
@@ -106,5 +112,5 @@ export declare class Workbook extends UnitModel<IWorkbookData, UniverInstanceTyp
|
|
|
106
112
|
/**
|
|
107
113
|
* Get Default Sheet
|
|
108
114
|
*/
|
|
109
|
-
private
|
|
115
|
+
private _parseWorksheetSnapshots;
|
|
110
116
|
}
|
|
@@ -13,19 +13,34 @@ export interface IDataValidationRuleBase {
|
|
|
13
13
|
operator?: DataValidationOperator;
|
|
14
14
|
}
|
|
15
15
|
export interface IDataValidationRuleOptions {
|
|
16
|
+
imeMode?: DataValidationImeMode;
|
|
17
|
+
/**
|
|
18
|
+
* for dropdown
|
|
19
|
+
*/
|
|
20
|
+
showDropDown?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* validator error
|
|
23
|
+
*/
|
|
24
|
+
showErrorMessage?: boolean;
|
|
16
25
|
error?: string;
|
|
17
26
|
errorStyle?: DataValidationErrorStyle;
|
|
18
27
|
errorTitle?: string;
|
|
19
|
-
|
|
28
|
+
/**
|
|
29
|
+
* input prompt, not for using now.
|
|
30
|
+
*/
|
|
31
|
+
showInputMessage?: boolean;
|
|
20
32
|
prompt?: string;
|
|
21
33
|
promptTitle?: string;
|
|
22
|
-
showDropDown?: boolean;
|
|
23
|
-
showErrorMessage?: boolean;
|
|
24
|
-
showInputMessage?: boolean;
|
|
25
34
|
/**
|
|
26
35
|
* cell render mode of data validation
|
|
27
36
|
*/
|
|
28
37
|
renderMode?: DataValidationRenderMode;
|
|
38
|
+
/**
|
|
39
|
+
* custom biz info
|
|
40
|
+
*/
|
|
41
|
+
bizInfo?: {
|
|
42
|
+
showTime?: boolean;
|
|
43
|
+
};
|
|
29
44
|
}
|
|
30
45
|
export interface IDataValidationRule extends IDataValidationRuleBase, IDataValidationRuleOptions {
|
|
31
46
|
uid: string;
|
|
@@ -43,6 +43,18 @@ export interface IRowRange {
|
|
|
43
43
|
*/
|
|
44
44
|
endRow: number;
|
|
45
45
|
}
|
|
46
|
+
export interface IColumnRange {
|
|
47
|
+
/**
|
|
48
|
+
* The start column (inclusive) of the range
|
|
49
|
+
* startColumn
|
|
50
|
+
*/
|
|
51
|
+
startColumn: number;
|
|
52
|
+
/**
|
|
53
|
+
* The end column (exclusive) of the range
|
|
54
|
+
* endColumn
|
|
55
|
+
*/
|
|
56
|
+
endColumn: number;
|
|
57
|
+
}
|
|
46
58
|
/**
|
|
47
59
|
* Range data structure
|
|
48
60
|
*
|
|
@@ -58,17 +70,7 @@ export interface IRowRange {
|
|
|
58
70
|
*
|
|
59
71
|
* means "A1:B2"
|
|
60
72
|
*/
|
|
61
|
-
export interface IRange extends IRowRange {
|
|
62
|
-
/**
|
|
63
|
-
* The start column (inclusive) of the range
|
|
64
|
-
* startColumn
|
|
65
|
-
*/
|
|
66
|
-
startColumn: number;
|
|
67
|
-
/**
|
|
68
|
-
* The end column (exclusive) of the range
|
|
69
|
-
* endColumn
|
|
70
|
-
*/
|
|
71
|
-
endColumn: number;
|
|
73
|
+
export interface IRange extends IRowRange, IColumnRange {
|
|
72
74
|
rangeType?: RANGE_TYPE;
|
|
73
75
|
startAbsoluteRefType?: AbsoluteRefType;
|
|
74
76
|
endAbsoluteRefType?: AbsoluteRefType;
|