@univerjs/sheets 0.1.7 → 0.1.8
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/index.js +2 -2
- package/lib/es/index.js +3443 -3379
- package/lib/types/basics/const/command-listener-const.d.ts +3 -0
- package/lib/types/basics/numfmt-kit.d.ts +41 -0
- package/lib/types/basics/selection.d.ts +1 -1
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +1 -1
- package/lib/types/commands/commands/insert-row-col.command.d.ts +2 -2
- package/lib/types/commands/commands/utils/selection-utils.d.ts +10 -1
- package/lib/types/commands/commands/utils/target-util.d.ts +33 -0
- package/lib/types/commands/mutations/__tests__/create-command-test-bed.d.ts +1 -1
- package/lib/types/commands/mutations/numfmt-mutation.d.ts +0 -3
- package/lib/types/controllers/__tests__/util.d.ts +1 -1
- package/lib/types/controllers/calculate-result-apply.controller.d.ts +11 -2
- package/lib/types/controllers/feature-calculation.controller.d.ts +2 -2
- package/lib/types/index.d.ts +5 -2
- package/lib/types/locale/zh-CN.d.ts +10 -2
- package/lib/types/services/__tests__/util.d.ts +1 -1
- package/lib/types/services/numfmt/numfmt.service.d.ts +5 -25
- package/lib/types/services/numfmt/type.d.ts +1 -17
- package/lib/types/services/permission/sheet-permission.service.d.ts +7 -8
- package/lib/types/services/permission/tool.d.ts +1 -2
- package/lib/types/services/ref-range/__tests__/__testing__.d.ts +1 -1
- package/lib/types/services/sheet-interceptor/__tests__/create-core-test-bed.d.ts +1 -1
- package/lib/types/services/sheet-interceptor/interceptor-const.d.ts +3 -3
- package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +3 -3
- package/lib/types/services/sheet-interceptor/utils/interceptor.d.ts +7 -0
- package/lib/types/sheets-plugin.d.ts +3 -2
- package/lib/umd/index.js +2 -2
- package/package.json +14 -12
- package/lib/types/commands/commands/copy-to-worksheet.command.d.ts +0 -9
- package/lib/types/commands/mutations/set-worksheet-config.mutation.d.ts +0 -13
- package/lib/types/commands/utils/get-target.d.ts +0 -18
- /package/lib/types/{services/__tests__/sheet-permission.spec.d.ts → basics/__tests__/numfmt-kit.spec.d.ts} +0 -0
|
@@ -13,5 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* Mutations those will trigger the skeleton change.
|
|
18
|
+
*/
|
|
16
19
|
export declare const COMMAND_LISTENER_SKELETON_CHANGE: string[];
|
|
17
20
|
export declare const COMMAND_LISTENER_VALUE_CHANGE: string[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ICellData, Nullable, Styles } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Handling number formats in styles
|
|
5
|
+
*
|
|
6
|
+
* @param oldCell
|
|
7
|
+
* @param cell
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleNumfmtInCell(oldCell: Nullable<ICellData>, cell: Nullable<ICellData>, styles: Styles | undefined): Nullable<ICellData>;
|
|
10
|
+
/**
|
|
11
|
+
* Process the priority of the newly set number format and the original format.
|
|
12
|
+
*
|
|
13
|
+
* Here is the priority of the number format in Excel:
|
|
14
|
+
* ┌─────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
15
|
+
* │ │ new format │
|
|
16
|
+
* ├─────────────────┼────────────┬────────────┬────────────┬────────────┬──────────┬──────────┬────────────┬──────────┬────────────┬──────────┬────────────┬───────────┤
|
|
17
|
+
* │ Original format │ General │ Number │ Currency │ Accounting │ Date │ Time │ Percentage │ Fraction │ Scientific │ Text │ Special │ Custom │
|
|
18
|
+
* ├─────────────────┼────────────┼────────────┼────────────┼────────────┼──────────┼──────────┼────────────┼──────────┼────────────┼──────────┼────────────┼───────────┤
|
|
19
|
+
* │ General │ General │ Number │ Currency │ Accounting │ Date │ Time │ Percentage │ Fraction │ Scientific │ Text │ Special │ Custom │
|
|
20
|
+
* │ Number │ Number │ Number │ Number │ Number │ Number │ Number │ Number │ Number │ Number │ Number │ Number │ Number │
|
|
21
|
+
* │ Currency │ Currency │ Currency │ Currency │ Currency │ Currency │ Currency │ Currency │ Currency │ Currency │ Currency │ Currency │ Currency │
|
|
22
|
+
* │ Accounting │ Accounting │ Accounting │ Accounting │ Accounting │ Date │ Time │ Percentage │ Fraction │ Scientific │ Text │ Accounting │ Custom │
|
|
23
|
+
* │ Date │ Date │ Date │ Currency │ Accounting │ Date │ Time │ Percentage │ Fraction │ Scientific │ Text │ Date │ Custom │
|
|
24
|
+
* │ Time │ Time │ Time │ Time │ Time │ Time │ Time │ Time │ Time │ Time │ Time │ Time │ Time │
|
|
25
|
+
* │ Percentage │ Percentage │ Percentage │ Currency │ Accounting │ Date │ Time │ Percentage │ Fraction │ Scientific │ Text │ Percentage │ Custom │
|
|
26
|
+
* │ Fraction │ Fraction │ Fraction │ Currency │ Accounting │ Date │ Time │ Percentage │ Fraction │ Scientific │ Text │ Fraction │ Custom │
|
|
27
|
+
* │ Scientific │ Scientific │ Scientific │ Currency │ Accounting │ Date │ Time │ Percentage │ Fraction │ Scientific │ Text │ Scientific │ Custom │
|
|
28
|
+
* │ Text │ Text │ Text │ Text │ Text │ Text │ Text │ Text │ Text │ Text │ Text │ Text │ Text │
|
|
29
|
+
* │ Special │ Special │ Special │ Special │ Special │ Special │ Special │ Special │ Special │ Special │ Special │ Special │ Special │
|
|
30
|
+
* │ Custom │ Custom │ Custom │ Currency │ Accounting │ Date │ Custom │ Percentage │ Fraction │ Scientific │ Text │ Custom │ Custom │
|
|
31
|
+
* └─────────────────┴────────────┴────────────┴────────────┴────────────┴──────────┴──────────┴────────────┴──────────┴────────────┴──────────┴────────────┴───────────┘
|
|
32
|
+
*
|
|
33
|
+
* The number formats supported by Univer are different from Excel, so it only processes the parts that are the same as Excel. For different parts, we consider the newly set number format to have a higher priority.
|
|
34
|
+
*
|
|
35
|
+
* In the future, if Univer completely matches Excel, we will implement Excel’s priority rules.
|
|
36
|
+
*
|
|
37
|
+
* @param oldPattern
|
|
38
|
+
* @param pattern
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
export declare function compareNumfmtPriority(oldPattern: string, pattern: string): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRange, ISelection, ISelectionCellWithCoord, ISelectionWithCoord, Nullable, ThemeService } from '@univerjs/core';
|
|
2
2
|
|
|
3
3
|
export declare const SELECTION_CONTROL_BORDER_BUFFER_WIDTH = 1.5;
|
|
4
|
-
export declare const SELECTION_CONTROL_BORDER_BUFFER_COLOR = "rgba(255,255,255, 0.01)";
|
|
4
|
+
export declare const SELECTION_CONTROL_BORDER_BUFFER_COLOR = "rgba(255, 255, 255, 0.01)";
|
|
5
5
|
/**
|
|
6
6
|
* Whether to display the controller that modifies the selection, distributed in 8 locations
|
|
7
7
|
* tl top_left_corner
|
|
@@ -6,4 +6,4 @@ export interface ITestBed {
|
|
|
6
6
|
get: Injector['get'];
|
|
7
7
|
sheet: Workbook;
|
|
8
8
|
}
|
|
9
|
-
export declare function createCommandTestBed(
|
|
9
|
+
export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): ITestBed;
|
|
@@ -17,9 +17,9 @@ export interface IInsertRowCommandParams {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const InsertRowCommandId = "sheet.command.insert-row";
|
|
19
19
|
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*
|
|
22
20
|
* this command and its interface should not be exported from index.ts
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
23
|
*/
|
|
24
24
|
export declare const InsertRowCommand: ICommand;
|
|
25
25
|
export declare const InsertRowBeforeCommand: ICommand;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ISelectionWithStyle } from '../../../basics/selection';
|
|
1
2
|
import { ISetSelectionsOperationParams } from '../../operations/selection.operation';
|
|
2
|
-
import { IRange, ISelectionCell, Workbook, Worksheet } from '@univerjs/core';
|
|
3
|
+
import { IRange, ISelectionCell, Nullable, Workbook, Worksheet } from '@univerjs/core';
|
|
3
4
|
|
|
4
5
|
export interface IExpandParams {
|
|
5
6
|
left?: boolean;
|
|
@@ -32,3 +33,11 @@ export declare const followSelectionOperation: (range: IRange, workbook: Workboo
|
|
|
32
33
|
id: string;
|
|
33
34
|
params: ISetSelectionsOperationParams;
|
|
34
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Examine if a selection only contains a single cell (a merged cell is considered as a single cell in this case).
|
|
38
|
+
* @param selection
|
|
39
|
+
* @returns `true` if the selection only contains a single cell.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isSingleCellSelection(selection: Nullable<ISelectionWithStyle & {
|
|
42
|
+
primary: ISelectionCell;
|
|
43
|
+
}>): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IUniverInstanceService, Nullable, Workbook, Worksheet } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
export declare function getSheetCommandTargetWorkbook(univerInstanceService: IUniverInstanceService, params: {
|
|
4
|
+
unitId?: string;
|
|
5
|
+
}): Nullable<{
|
|
6
|
+
workbook: Workbook;
|
|
7
|
+
unitId: string;
|
|
8
|
+
}>;
|
|
9
|
+
interface IResult {
|
|
10
|
+
workbook: Workbook;
|
|
11
|
+
worksheet: Worksheet;
|
|
12
|
+
unitId: string;
|
|
13
|
+
subUnitId: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get targeted Workbook & Worksheet of a command. If `unitId` and `subUnitId` are given, the function would
|
|
17
|
+
* try to get these instances. If not, it would try to get the current active instances.
|
|
18
|
+
*
|
|
19
|
+
* @param univerInstanceService
|
|
20
|
+
* @param params - unitId and subUnitId
|
|
21
|
+
* @param params.unitId - The unitId of the Workbook
|
|
22
|
+
* @param params.subUnitId - The subUnitId of the Worksheet
|
|
23
|
+
* @returns Targeted Workbook & Worksheet
|
|
24
|
+
*/
|
|
25
|
+
export declare function getSheetCommandTarget(univerInstanceService: IUniverInstanceService, params?: {
|
|
26
|
+
unitId?: string;
|
|
27
|
+
subUnitId?: string;
|
|
28
|
+
}): Nullable<IResult>;
|
|
29
|
+
export declare function getSheetMutationTarget(univerInstanceService: IUniverInstanceService, params: {
|
|
30
|
+
unitId: string;
|
|
31
|
+
subUnitId: string;
|
|
32
|
+
}): Nullable<Pick<IResult, 'workbook' | 'worksheet'>>;
|
|
33
|
+
export {};
|
|
@@ -6,4 +6,4 @@ export interface ITestBed {
|
|
|
6
6
|
get: Injector['get'];
|
|
7
7
|
sheet: Workbook;
|
|
8
8
|
}
|
|
9
|
-
export declare function createCommandTestBed(
|
|
9
|
+
export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): ITestBed;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FormatType } from '../../services/numfmt/type';
|
|
2
1
|
import { IAccessor } from '@wendellhu/redi';
|
|
3
2
|
import { ICommand, IMutationInfo, IRange } from '@univerjs/core';
|
|
4
3
|
|
|
@@ -12,7 +11,6 @@ export interface ISetNumfmtMutationParams {
|
|
|
12
11
|
refMap: {
|
|
13
12
|
[id: string]: {
|
|
14
13
|
pattern: string;
|
|
15
|
-
type: FormatType;
|
|
16
14
|
};
|
|
17
15
|
};
|
|
18
16
|
unitId: string;
|
|
@@ -31,7 +29,6 @@ export declare const factoryRemoveNumfmtUndoMutation: (accessor: IAccessor, opti
|
|
|
31
29
|
}[];
|
|
32
30
|
export type ISetCellsNumfmt = Array<{
|
|
33
31
|
pattern: string;
|
|
34
|
-
type: FormatType;
|
|
35
32
|
row: number;
|
|
36
33
|
col: number;
|
|
37
34
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dependency } from '@wendellhu/redi';
|
|
2
2
|
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
3
3
|
|
|
4
|
-
export declare function createTestBase(
|
|
4
|
+
export declare function createTestBase(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
5
5
|
univer: Univer;
|
|
6
6
|
get: {
|
|
7
7
|
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { Disposable, ICommandService } from '@univerjs/core';
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
|
|
3
3
|
export declare class CalculateResultApplyController extends Disposable {
|
|
4
|
+
private _univerInstanceService;
|
|
4
5
|
private readonly _commandService;
|
|
5
|
-
constructor(_commandService: ICommandService);
|
|
6
|
+
constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService);
|
|
6
7
|
private _initialize;
|
|
7
8
|
private _commandExecutedListener;
|
|
9
|
+
/**
|
|
10
|
+
* Priority that mainly deals with number format in unitData
|
|
11
|
+
* @param unitId
|
|
12
|
+
* @param sheetId
|
|
13
|
+
* @param cellData
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
private _getMergedCellData;
|
|
8
17
|
}
|
|
@@ -4,9 +4,9 @@ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/c
|
|
|
4
4
|
export declare class FeatureCalculationController extends Disposable {
|
|
5
5
|
private readonly _commandService;
|
|
6
6
|
private readonly _featureCalculationManagerService;
|
|
7
|
-
private readonly
|
|
7
|
+
private readonly _univerInstanceService;
|
|
8
8
|
private readonly _formulaDataModel;
|
|
9
|
-
constructor(_commandService: ICommandService, _featureCalculationManagerService: IFeatureCalculationManagerService,
|
|
9
|
+
constructor(_commandService: ICommandService, _featureCalculationManagerService: IFeatureCalculationManagerService, _univerInstanceService: IUniverInstanceService, _formulaDataModel: FormulaDataModel);
|
|
10
10
|
/**
|
|
11
11
|
* Test function access to the formula system example , feature calculation ,
|
|
12
12
|
* you can register a listening range and callback function ,
|
package/lib/types/index.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ export { type IUniverSheetsConfig, UniverSheetsPlugin } from './sheets-plugin';
|
|
|
17
17
|
export { COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE } from './basics/const/command-listener-const';
|
|
18
18
|
export { type IAddWorksheetMergeMutationParams, type IDeleteRangeMutationParams, type IInsertColMutationParams, type IInsertRangeMutationParams, type IInsertRowMutationParams, type IInsertSheetMutationParams, type IRemoveColMutationParams, type IRemoveRowsMutationParams, type IRemoveSheetMutationParams, type IRemoveWorksheetMergeMutationParams, } from './basics/interfaces/mutation-interface';
|
|
19
19
|
export { convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, getNormalSelectionStyle, type ISelectionStyle, type ISelectionWidgetConfig, type ISelectionWithCoordAndStyle, type ISelectionWithStyle, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, transformCellDataToSelectionData, } from './basics/selection';
|
|
20
|
-
export {
|
|
20
|
+
export { getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget } from './commands/commands/utils/target-util';
|
|
21
|
+
export { alignToMergedCellsBorders, getCellAtRowCol, setEndForRange, isSingleCellSelection } from './commands/commands/utils/selection-utils';
|
|
21
22
|
export { MAX_CELL_PER_SHEET_KEY } from './controllers/config/config';
|
|
22
23
|
export { BorderStyleManagerService, type IBorderInfo } from './services/border-style-manager.service';
|
|
23
24
|
export { getCurrentSheetDisabled$, SheetEditablePermission, SheetPermissionService } from './services/permission';
|
|
@@ -103,7 +104,7 @@ export { type ISheetCommandSharedParams } from './commands/utils/interface';
|
|
|
103
104
|
export { getAddMergeMutationRangeByType } from './controllers/merge-cell.controller';
|
|
104
105
|
export { enUS, zhCN } from './locale';
|
|
105
106
|
export { NumfmtService } from './services/numfmt/numfmt.service';
|
|
106
|
-
export type {
|
|
107
|
+
export type { INumfmtItem, INumfmtItemWithCache } from './services/numfmt/type';
|
|
107
108
|
export { INumfmtService } from './services/numfmt/type';
|
|
108
109
|
export { RefRangeService } from './services/ref-range/ref-range.service';
|
|
109
110
|
export type { EffectRefRangeParams, IOperator } from './services/ref-range/type';
|
|
@@ -118,3 +119,5 @@ export { InsertDefinedNameCommand } from './commands/commands/insert-defined-nam
|
|
|
118
119
|
export { RemoveDefinedNameCommand } from './commands/commands/remove-defined-name.command';
|
|
119
120
|
export { SetDefinedNameCommand, type ISetDefinedNameCommandParams } from './commands/commands/set-defined-name.command';
|
|
120
121
|
export { ScrollToCellOperation } from './commands/operations/scroll-to-cell.operation';
|
|
122
|
+
export type { FormatType } from './services/numfmt/type';
|
|
123
|
+
export { getMoveRangeUndoRedoMutations } from './commands/commands/move-range.command';
|
|
@@ -15,8 +15,16 @@
|
|
|
15
15
|
*/
|
|
16
16
|
declare const locale: {
|
|
17
17
|
sheets: {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
tabs: {
|
|
19
|
+
sheetCopy: string;
|
|
20
|
+
sheet: string;
|
|
21
|
+
};
|
|
22
|
+
info: {
|
|
23
|
+
overlappingSelections: string;
|
|
24
|
+
acrossMergedCell: string;
|
|
25
|
+
partOfCell: string;
|
|
26
|
+
hideSheet: string;
|
|
27
|
+
};
|
|
20
28
|
};
|
|
21
29
|
};
|
|
22
30
|
export default locale;
|
|
@@ -2,7 +2,7 @@ import { Dependency } from '@wendellhu/redi';
|
|
|
2
2
|
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare const TEST_WORKBOOK_DATA_DEMO: IWorkbookData;
|
|
5
|
-
export declare function createTestBase(
|
|
5
|
+
export declare function createTestBase(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
6
6
|
univer: Univer;
|
|
7
7
|
get: {
|
|
8
8
|
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
|
|
@@ -1,37 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IRange, Disposable,
|
|
1
|
+
import { INumfmtService } from './type';
|
|
2
|
+
import { IRange, Disposable, ILogService, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare class NumfmtService extends Disposable implements INumfmtService {
|
|
5
|
-
private _commandService;
|
|
6
5
|
private _resourceManagerService;
|
|
7
6
|
private _univerInstanceService;
|
|
8
7
|
private _logService;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* @type {Map<string, Map<string, ObjectMatrix<INumfmtItemWithCache>>>}
|
|
12
|
-
* @memberof NumfmtService
|
|
13
|
-
*/
|
|
14
|
-
private _numfmtModel;
|
|
15
|
-
private _refAliasModel;
|
|
16
|
-
private _modelReplace$;
|
|
17
|
-
modelReplace$: import('rxjs').Observable<string>;
|
|
18
|
-
constructor(_commandService: ICommandService, _resourceManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService, _logService: ILogService);
|
|
19
|
-
private _initModel;
|
|
20
|
-
private _toJson;
|
|
21
|
-
private _parseJson;
|
|
22
|
-
private _setValue;
|
|
23
|
-
private _getUniqueRefId;
|
|
24
|
-
getValue(unitId: string, subUnitId: string, row: number, col: number, model?: ObjectMatrix<INumfmtItem>): {
|
|
8
|
+
constructor(_resourceManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService, _logService: ILogService);
|
|
9
|
+
getValue(unitId: string, subUnitId: string, row: number, col: number): {
|
|
25
10
|
pattern: string;
|
|
26
|
-
|
|
27
|
-
} | null;
|
|
11
|
+
} | null | undefined;
|
|
28
12
|
deleteValues(unitId: string, subUnitId: string, values: IRange[]): void;
|
|
29
13
|
setValues(unitId: string, subUnitId: string, values: Array<{
|
|
30
14
|
ranges: IRange[];
|
|
31
15
|
pattern: string;
|
|
32
|
-
type: FormatType;
|
|
33
16
|
}>): void;
|
|
34
|
-
getModel(unitId: string, subUnitId: string): ObjectMatrix<INumfmtItem> | undefined;
|
|
35
|
-
getRefModel(unitId: string): RefAlias<IRefItem, "i" | "pattern"> | undefined;
|
|
36
|
-
serialTimeToTimestamp(serialValue: number, is1900?: boolean): number;
|
|
37
17
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ICellData, IObjectMatrixPrimitiveType, IRange, Nullable, ObjectMatrix, RefAlias } from '@univerjs/core';
|
|
1
|
+
import { ICellData, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
3
2
|
|
|
4
3
|
export type INumfmtItem = {
|
|
5
4
|
i: string;
|
|
@@ -11,28 +10,13 @@ export interface INumfmtItemWithCache {
|
|
|
11
10
|
parameters: number;
|
|
12
11
|
};
|
|
13
12
|
pattern: string;
|
|
14
|
-
type: FormatType;
|
|
15
13
|
}
|
|
16
|
-
export type IRefItem = INumfmtItem & {
|
|
17
|
-
count: number;
|
|
18
|
-
type: FormatType;
|
|
19
|
-
pattern: string;
|
|
20
|
-
};
|
|
21
14
|
export interface INumfmtService {
|
|
22
15
|
getValue(unitId: string, subUnitId: string, row: number, col: number, model?: ObjectMatrix<INumfmtItem>): Nullable<INumfmtItemWithCache>;
|
|
23
|
-
getModel(unitId: string, subUnitId: string): Nullable<ObjectMatrix<INumfmtItem>>;
|
|
24
16
|
setValues(unitId: string, subUnitId: string, values: Array<{
|
|
25
17
|
ranges: IRange[];
|
|
26
18
|
pattern: string;
|
|
27
|
-
type: FormatType;
|
|
28
19
|
}>): void;
|
|
29
20
|
deleteValues(unitId: string, subUnitId: string, values: IRange[]): void;
|
|
30
|
-
getRefModel(unitId: string): Nullable<RefAlias<IRefItem, 'i' | 'pattern'>>;
|
|
31
|
-
modelReplace$: Observable<string>;
|
|
32
|
-
serialTimeToTimestamp: (v: number, is1900?: boolean) => number;
|
|
33
|
-
}
|
|
34
|
-
export interface ISnapshot {
|
|
35
|
-
model: Record<string, IObjectMatrixPrimitiveType<INumfmtItem>>;
|
|
36
|
-
refModel: IRefItem[];
|
|
37
21
|
}
|
|
38
22
|
export declare const INumfmtService: import('@wendellhu/redi').IdentifierDecorator<INumfmtService>;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PermissionService, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
1
|
+
import { IPermissionService, IUniverInstanceService, PermissionStatus, RxDisposable } from '@univerjs/core';
|
|
3
2
|
|
|
4
|
-
export declare class SheetPermissionService extends
|
|
3
|
+
export declare class SheetPermissionService extends RxDisposable {
|
|
5
4
|
private _permissionService;
|
|
6
5
|
private _univerInstanceService;
|
|
7
|
-
private
|
|
8
|
-
constructor(_permissionService:
|
|
6
|
+
private _disposableByUnit;
|
|
7
|
+
constructor(_permissionService: IPermissionService, _univerInstanceService: IUniverInstanceService);
|
|
9
8
|
private _init;
|
|
10
|
-
private
|
|
9
|
+
private _interceptWorkbook;
|
|
11
10
|
getEditable$(unitId?: string, sheetId?: string): import('rxjs').Observable<{
|
|
12
|
-
value:
|
|
13
|
-
status:
|
|
11
|
+
value: boolean;
|
|
12
|
+
status: PermissionStatus;
|
|
14
13
|
}>;
|
|
15
14
|
getSheetEditable(unitId?: string, sheetId?: string): boolean;
|
|
16
15
|
setSheetEditable(v: boolean, unitId?: string, sheetId?: string): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
1
|
import { IAccessor } from '@wendellhu/redi';
|
|
3
2
|
|
|
4
|
-
export declare function getCurrentSheetDisabled$(accessor: IAccessor): Observable<boolean>;
|
|
3
|
+
export declare function getCurrentSheetDisabled$(accessor: IAccessor): import('rxjs').Observable<boolean>;
|
|
@@ -2,7 +2,7 @@ import { Dependency } from '@wendellhu/redi';
|
|
|
2
2
|
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare const TEST_WORKBOOK_DATA_DEMO: IWorkbookData;
|
|
5
|
-
export declare function createTestBase(
|
|
5
|
+
export declare function createTestBase(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
6
6
|
univer: Univer;
|
|
7
7
|
get: {
|
|
8
8
|
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dependency } from '@wendellhu/redi';
|
|
2
2
|
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
3
3
|
|
|
4
|
-
export declare function createCoreTestBed(
|
|
4
|
+
export declare function createCoreTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
5
5
|
univer: Univer;
|
|
6
6
|
get: {
|
|
7
7
|
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ISheetLocation } from './utils/interceptor';
|
|
2
|
-
import { ICellDataForSheetInterceptor
|
|
1
|
+
import { ISheetLocation, ISheetRowLocation } from './utils/interceptor';
|
|
2
|
+
import { ICellDataForSheetInterceptor } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export declare const INTERCEPTOR_POINT: {
|
|
5
5
|
CELL_CONTENT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocation>;
|
|
6
|
-
|
|
6
|
+
ROW_FILTERED: import('@univerjs/core').IInterceptor<boolean, ISheetRowLocation>;
|
|
7
7
|
};
|
|
@@ -11,12 +11,12 @@ export interface ICommandInterceptor {
|
|
|
11
11
|
* It would inject Workbook & Worksheet.
|
|
12
12
|
*/
|
|
13
13
|
export declare class SheetInterceptorService extends Disposable {
|
|
14
|
-
private readonly
|
|
14
|
+
private readonly _univerInstanceService;
|
|
15
15
|
private _interceptorsByName;
|
|
16
16
|
private _commandInterceptors;
|
|
17
17
|
private readonly _workbookDisposables;
|
|
18
18
|
private readonly _worksheetDisposables;
|
|
19
|
-
constructor(
|
|
19
|
+
constructor(_univerInstanceService: IUniverInstanceService);
|
|
20
20
|
dispose(): void;
|
|
21
21
|
interceptCommand(interceptor: ICommandInterceptor): IDisposable;
|
|
22
22
|
/**
|
|
@@ -26,7 +26,7 @@ export declare class SheetInterceptorService extends Disposable {
|
|
|
26
26
|
*/
|
|
27
27
|
onCommandExecute(command: ICommandInfo): IUndoRedoCommandInfosByInterceptor;
|
|
28
28
|
intercept<T extends IInterceptor<any, any>>(name: T, interceptor: T): IDisposable;
|
|
29
|
-
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>): (initValue: import('@univerjs/core/common/type-
|
|
29
|
+
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>): (initValue: import('@univerjs/core/common/type-util.js').Nullable<T>, initContext: C) => import('@univerjs/core/common/type-util.js').Nullable<T>;
|
|
30
30
|
private _interceptWorkbook;
|
|
31
31
|
private _disposeWorkbookInterceptor;
|
|
32
32
|
private _disposeSheetInterceptor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injector } from '@wendellhu/redi';
|
|
2
|
-
import { ICommandService, LocaleService, Plugin,
|
|
2
|
+
import { ICommandService, LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export interface IUniverSheetsConfig {
|
|
5
5
|
notExecuteFormula?: boolean;
|
|
@@ -12,7 +12,8 @@ export declare class UniverSheetsPlugin extends Plugin {
|
|
|
12
12
|
private readonly _commandService;
|
|
13
13
|
private readonly _localeService;
|
|
14
14
|
readonly _injector: Injector;
|
|
15
|
-
static
|
|
15
|
+
static pluginName: string;
|
|
16
|
+
static type: UniverInstanceType;
|
|
16
17
|
constructor(_config: IUniverSheetsConfig, _commandService: ICommandService, _localeService: LocaleService, _injector: Injector);
|
|
17
18
|
onRendered(): void;
|
|
18
19
|
private _initializeDependencies;
|