@univerjs/sheets 0.3.0-alpha.0 → 0.3.0-nightly.202410101606

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.
@@ -1,4 +1,4 @@
1
- import { BorderType, BorderStyleTypes, ICommand } from '@univerjs/core';
1
+ import { BorderStyleTypes, ICommand, BorderType } from '@univerjs/core';
2
2
  import { IBorderInfo } from '../../services/border-style-manager.service';
3
3
  export interface ISetBorderBasicCommandParams {
4
4
  unitId?: string;
@@ -1,4 +1,4 @@
1
- import { IPermissionService, IRange } from '@univerjs/core';
1
+ import { IRange, IPermissionService } from '@univerjs/core';
2
2
  import { UnitAction } from '@univerjs/protocol';
3
3
  import { RangeProtectionRuleModel } from './range-protection-rule.model';
4
4
  export type ICellPermission = Record<UnitAction, boolean> & {
@@ -8,15 +8,21 @@ export declare class RangeProtectionCache extends Disposable {
8
8
  private readonly _cellRuleCache;
9
9
  private readonly _permissionIdCache;
10
10
  private readonly _cellInfoCache;
11
+ private readonly _rowInfoCache;
12
+ private readonly _colInfoCache;
11
13
  constructor(_ruleModel: RangeProtectionRuleModel, _permissionService: IPermissionService, _univerInstanceService: IUniverInstanceService);
12
14
  private _initCache;
13
15
  private _initUpdateCellInfoCache;
14
16
  private _initUpdateCellRuleCache;
15
17
  private _ensureRuleMap;
16
18
  private _ensureCellInfoMap;
19
+ private _ensureRowColInfoMap;
17
20
  private _addCellRuleCache;
18
21
  private _deleteCellRuleCache;
19
22
  reBuildCache(unitId: string, subUnitId: string): void;
23
+ getRowPermissionInfo(unitId: string, subUnitId: string, row: number, types: UnitAction[]): boolean;
24
+ getColPermissionInfo(unitId: string, subUnitId: string, col: number, types: UnitAction[]): boolean;
25
+ private _initUpdateRowColInfoCache;
20
26
  getCellInfo(unitId: string, subUnitId: string, row: number, col: number): (Partial<Record<UnitAction, boolean>> & {
21
27
  ruleId?: string;
22
28
  ranges?: IRange[];
@@ -10,6 +10,7 @@ export interface INumfmtItemWithCache {
10
10
  };
11
11
  pattern: string;
12
12
  }
13
+ export declare const INumfmtService: import('@wendellhu/redi').IdentifierDecorator<INumfmtService>;
13
14
  export interface INumfmtService {
14
15
  getValue(unitId: string, subUnitId: string, row: number, col: number, model?: ObjectMatrix<INumfmtItem>): Nullable<INumfmtItemWithCache>;
15
16
  setValues(unitId: string, subUnitId: string, values: Array<{
@@ -18,4 +19,3 @@ export interface INumfmtService {
18
19
  }>): void;
19
20
  deleteValues(unitId: string, subUnitId: string, values: IRange[]): void;
20
21
  }
21
- export declare const INumfmtService: import('@wendellhu/redi').IdentifierDecorator<INumfmtService>;
@@ -7,6 +7,7 @@ import { RangeProtectionCache } from '../../../model/range-protection.cache';
7
7
  import { RangeProtectionRenderModel } from '../../../model/range-protection-render.model';
8
8
  import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
9
9
  import { RefRangeService } from '../../../services/ref-range/ref-range.service';
10
+ import { SheetInterceptorService } from '../../sheet-interceptor/sheet-interceptor.service';
10
11
  export declare class RangeProtectionRefRangeService extends Disposable {
11
12
  private _selectionProtectionRuleModel;
12
13
  private _univerInstanceService;
@@ -14,8 +15,10 @@ export declare class RangeProtectionRefRangeService extends Disposable {
14
15
  private readonly _refRangeService;
15
16
  private readonly _selectionProtectionRenderModel;
16
17
  private readonly _rangeProtectionCache;
18
+ private readonly _sheetInterceptorService;
19
+ private readonly _rangeProtectionRuleModel;
17
20
  disposableCollection: DisposableCollection;
18
- constructor(_selectionProtectionRuleModel: RangeProtectionRuleModel, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _refRangeService: RefRangeService, _selectionProtectionRenderModel: RangeProtectionRenderModel, _rangeProtectionCache: RangeProtectionCache);
21
+ constructor(_selectionProtectionRuleModel: RangeProtectionRuleModel, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _refRangeService: RefRangeService, _selectionProtectionRenderModel: RangeProtectionRenderModel, _rangeProtectionCache: RangeProtectionCache, _sheetInterceptorService: SheetInterceptorService, _rangeProtectionRuleModel: RangeProtectionRuleModel);
19
22
  private _onRefRangeChange;
20
23
  refRangeHandle(config: EffectRefRangeParams, unitId: string, subUnitId: string): {
21
24
  redos: {
@@ -39,4 +42,5 @@ export declare class RangeProtectionRefRangeService extends Disposable {
39
42
  private _correctPermissionRange;
40
43
  private _checkIsRightRange;
41
44
  private _initReBuildCache;
45
+ private _initRemoveSheet;
42
46
  }
@@ -1,7 +1,7 @@
1
1
  import { Injector, IPermissionService, IResourceManagerService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
2
2
  import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
3
- import { WorksheetProtectionRuleModel } from './worksheet-permission-rule.model';
4
3
  import { WorksheetProtectionPointModel } from './worksheet-permission-point.model';
4
+ import { WorksheetProtectionRuleModel } from './worksheet-permission-rule.model';
5
5
  export declare const RULE_MODEL_PLUGIN_NAME = "SHEET_WORKSHEET_PROTECTION_PLUGIN";
6
6
  export declare const POINT_MODEL_PLUGIN_NAME = "SHEET_WORKSHEET_PROTECTION_POINT_PLUGIN";
7
7
  export declare class WorksheetPermissionService extends RxDisposable {
@@ -1,7 +1,7 @@
1
1
  import { IDisposable, IMutationInfo, IRange, Nullable, Disposable, ICommandService, InterceptorManager, IUniverInstanceService } from '@univerjs/core';
2
+ import { EffectRefRangeParams } from './type';
2
3
  import { SheetsSelectionsService } from '../selections/selection-manager.service';
3
4
  import { SheetInterceptorService } from '../sheet-interceptor/sheet-interceptor.service';
4
- import { EffectRefRangeParams } from './type';
5
5
  type RefRangCallback = (params: EffectRefRangeParams) => {
6
6
  redos: IMutationInfo[];
7
7
  undos: IMutationInfo[];
@@ -1,4 +1,4 @@
1
- import { Disposable, InterceptorEffectEnum, IUniverInstanceService, ICommandInfo, IDisposable, IInterceptor, IRange, IUndoRedoCommandInfosByInterceptor, Nullable } from '@univerjs/core';
1
+ import { ICommandInfo, IDisposable, IInterceptor, IRange, IUndoRedoCommandInfosByInterceptor, Nullable, Disposable, InterceptorEffectEnum, IUniverInstanceService } from '@univerjs/core';
2
2
  export interface IBeforeCommandInterceptor {
3
3
  priority?: number;
4
4
  performCheck(info: ICommandInfo): Promise<boolean>;
@@ -9,5 +9,7 @@ export declare class UniverSheetsPlugin extends Plugin {
9
9
  constructor(_config: Partial<IUniverSheetsConfig> | undefined, _injector: Injector, _configService: IConfigService);
10
10
  private _initConfig;
11
11
  private _initDependencies;
12
- onStarting(_injector?: Injector): void;
12
+ onStarting(): void;
13
+ onRendered(): void;
14
+ onReady(): void;
13
15
  }