@univerjs/sheets 0.3.0 → 0.4.0-alpha.1

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.
@@ -0,0 +1,14 @@
1
+ {
2
+ "sheets": {
3
+ "tabs": {
4
+ "sheetCopy": "(کپی{0})",
5
+ "sheet": "برگ"
6
+ },
7
+ "info": {
8
+ "overlappingSelections": "نمی‌توان از این دستور روی انتخاب‌های همپوشانی استفاده کرد",
9
+ "acrossMergedCell": "در سراسر سلول ادغام شده",
10
+ "partOfCell": "فقط بخشی از سلول ادغام شده انتخاب شده است",
11
+ "hideSheet": "پس از پنهان کردن این برگ، هیچ برگی قابل مشاهده نخواهد بود"
12
+ }
13
+ }
14
+ }
@@ -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,11 +1,9 @@
1
1
  import { ICommand } from '@univerjs/core';
2
- import { ISetDefinedNameMutationParam } from '@univerjs/engine-formula';
3
- export interface ISetDefinedNameCommandParams {
4
- unitId: string;
5
- oldDefinedName: ISetDefinedNameMutationParam;
6
- newDefinedName: ISetDefinedNameMutationParam;
7
- }
8
2
  /**
9
3
  * The command to update defined name
4
+ *
5
+ * 1. The old defined name can be obtained through IDefinedNamesService, and does not need to be passed in from the outside, making the command input more concise
6
+
7
+ 2. Unlike InsertDefinedNameCommand, the old defined name needs to be deleted here at the same time. Because the command interception in UpdateDefinedNameController will add SetDefinedNameMutation or RemoveDefinedNameMutation, it results in that in DefinedNameController, only mutations can be listened to to update Function Description (commands cannot be listened to), so it is necessary to ensure that each mutation triggered by the command has completed all work.
10
8
  */
11
9
  export declare const SetDefinedNameCommand: ICommand;
@@ -1,11 +1,10 @@
1
1
  import { HorizontalAlign, ICommand, IRange, IStyleData, VerticalAlign, WrapStrategy } from '@univerjs/core';
2
+ import { ISheetCommandSharedParams } from '../utils/interface';
2
3
  export interface IStyleTypeValue<T> {
3
4
  type: keyof IStyleData;
4
5
  value: T | T[][];
5
6
  }
6
- interface ISetStyleCommonParams {
7
- subUnitId?: string;
8
- unitId?: string;
7
+ interface ISetStyleCommonParams extends Partial<ISheetCommandSharedParams> {
9
8
  range?: IRange;
10
9
  }
11
10
  export interface ISetStyleCommandParams<T> extends ISetStyleCommonParams {
@@ -92,7 +92,7 @@ export { RemoveWorksheetMergeCommand } from './commands/commands/remove-workshee
92
92
  export { type IReorderRangeCommandParams, ReorderRangeCommand } from './commands/commands/reorder-range.command';
93
93
  export { type ISetBorderBasicCommandParams, type ISetBorderColorCommandParams, type ISetBorderCommandParams, type ISetBorderPositionCommandParams, type ISetBorderStyleCommandParams, SetBorderBasicCommand, SetBorderColorCommand, SetBorderCommand, SetBorderPositionCommand, SetBorderStyleCommand, } from './commands/commands/set-border-command';
94
94
  export { type ISetSpecificColsVisibleCommandParams, SetColHiddenCommand, SetSelectedColsVisibleCommand, SetSpecificColsVisibleCommand, } from './commands/commands/set-col-visible.command';
95
- export { type ISetDefinedNameCommandParams, SetDefinedNameCommand } from './commands/commands/set-defined-name.command';
95
+ export { SetDefinedNameCommand } from './commands/commands/set-defined-name.command';
96
96
  export { SetFrozenCancelCommand } from './commands/commands/set-frozen-cancel.command';
97
97
  export { SetFrozenCommand } from './commands/commands/set-frozen.command';
98
98
  export { SetHideGridlinesCommand } from './commands/commands/set-hide-gridlines.command';
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -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
  }