@univerjs/sheets 1.1.0 → 1.3.0
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 +349 -178
- package/lib/es/index.js +350 -179
- package/lib/index.js +350 -179
- package/lib/types/controllers/auto-fill.controller.d.ts +3 -0
- package/lib/types/controllers/permission/sheet-permission-check.controller.d.ts +10 -4
- package/lib/types/models/range-theme-model.d.ts +4 -2
- package/lib/types/services/auto-fill/auto-fill.service.d.ts +3 -3
- package/lib/types/services/auto-fill/type.d.ts +8 -1
- package/lib/umd/index.js +2 -2
- package/package.json +9 -9
|
@@ -31,6 +31,9 @@ export declare class AutoFillController extends Disposable {
|
|
|
31
31
|
private _getCopyData;
|
|
32
32
|
private _getEmptyCopyDataPiece;
|
|
33
33
|
private _getMergeApplyData;
|
|
34
|
+
private _getFillCells;
|
|
35
|
+
private _prepareFillData;
|
|
36
|
+
private _getRemoveMergeMutations;
|
|
34
37
|
private _fillData;
|
|
35
38
|
private _shouldDisableSeries;
|
|
36
39
|
private _getPreferredApplyType;
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IPermissionTypes, IRange } from '@univerjs/core';
|
|
17
17
|
import { Disposable, DisposableCollection, ICommandService, IPermissionService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
18
|
-
import { IDefinedNamesService, LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
18
|
+
import { FormulaDataModel, IDefinedNamesService, IFunctionService, LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
19
19
|
import { RangeProtectionRuleModel } from '../../models/range-protection-rule.model';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { IAutoFillService } from '../../services/auto-fill/auto-fill.service';
|
|
21
|
+
import { WorksheetProtectionRuleModel } from '../../services/permission/worksheet-permission/worksheet-permission-rule.model';
|
|
22
|
+
import { SheetsSelectionsService } from '../../services/selections/selection.service';
|
|
22
23
|
export declare class SheetPermissionCheckController extends Disposable {
|
|
23
24
|
private readonly _commandService;
|
|
24
25
|
private readonly _univerInstanceService;
|
|
@@ -29,10 +30,13 @@ export declare class SheetPermissionCheckController extends Disposable {
|
|
|
29
30
|
private readonly _localeService;
|
|
30
31
|
private readonly _lexerTreeBuilder;
|
|
31
32
|
private readonly _definedNamesService;
|
|
33
|
+
private readonly _autoFillService;
|
|
34
|
+
private readonly _formulaDataModel;
|
|
35
|
+
private readonly _functionService;
|
|
32
36
|
disposableCollection: DisposableCollection;
|
|
33
37
|
private _triggerPermissionUIEvent$;
|
|
34
38
|
triggerPermissionUIEvent$: import("rxjs").Observable<string>;
|
|
35
|
-
constructor(_commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _permissionService: IPermissionService, _selectionManagerService: SheetsSelectionsService, _rangeProtectionRuleModel: RangeProtectionRuleModel, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _localeService: LocaleService, _lexerTreeBuilder: LexerTreeBuilder, _definedNamesService: IDefinedNamesService);
|
|
39
|
+
constructor(_commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _permissionService: IPermissionService, _selectionManagerService: SheetsSelectionsService, _rangeProtectionRuleModel: RangeProtectionRuleModel, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _localeService: LocaleService, _lexerTreeBuilder: LexerTreeBuilder, _definedNamesService: IDefinedNamesService, _autoFillService: IAutoFillService, _formulaDataModel: FormulaDataModel, _functionService: IFunctionService);
|
|
36
40
|
private _initialize;
|
|
37
41
|
private _commandExecutedListener;
|
|
38
42
|
blockExecuteWithoutPermission(errorMsg: string): void;
|
|
@@ -40,6 +44,8 @@ export declare class SheetPermissionCheckController extends Disposable {
|
|
|
40
44
|
permissionCheckWithRanges(permissionTypes: IPermissionTypes, selectionRanges?: IRange[], unitId?: string, subUnitId?: string): boolean;
|
|
41
45
|
permissionCheckWithoutRange(permissionTypes: IPermissionTypes, unitId?: string, subUnitId?: string): boolean;
|
|
42
46
|
private _permissionCheckWithFormula;
|
|
47
|
+
private _getFormulaReferenceWorkbook;
|
|
48
|
+
private _permissionCheckFormulaReferences;
|
|
43
49
|
private _permissionCheckBySetRangeValue;
|
|
44
50
|
private _permissionCheckByMoveRowsColsCommand;
|
|
45
51
|
private _permissionCheckByMoveRangeCommand;
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IRange, Nullable } from '@univerjs/core';
|
|
17
|
-
import type { IRangeThemeStyleItem, IRangeThemeStyleJSON } from './range-theme-util';
|
|
18
17
|
import { Disposable, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
18
|
+
import { ISheetRowFilteredService } from '@univerjs/engine-formula';
|
|
19
|
+
import type { IRangeThemeStyleItem, IRangeThemeStyleJSON } from './range-theme-util';
|
|
19
20
|
import { SheetInterceptorService } from '../services/sheet-interceptor/sheet-interceptor.service';
|
|
20
21
|
import { RangeThemeStyle } from './range-theme-util';
|
|
21
22
|
export interface IRangeThemeRangeInfo {
|
|
@@ -35,6 +36,7 @@ export declare class SheetRangeThemeModel extends Disposable {
|
|
|
35
36
|
private _sheetInterceptorService;
|
|
36
37
|
private _resourceManagerService;
|
|
37
38
|
private readonly _univerInstanceService;
|
|
39
|
+
private readonly _sheetRowFilteredService?;
|
|
38
40
|
private _rangeThemeStyleMap;
|
|
39
41
|
private _rangeThemeStyleRuleMap;
|
|
40
42
|
private _rTreeCollection;
|
|
@@ -49,7 +51,7 @@ export declare class SheetRangeThemeModel extends Disposable {
|
|
|
49
51
|
type: "add" | "remove";
|
|
50
52
|
styleName: string;
|
|
51
53
|
}>;
|
|
52
|
-
constructor(_sheetInterceptorService: SheetInterceptorService, _resourceManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService);
|
|
54
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _resourceManagerService: IResourceManagerService, _univerInstanceService: IUniverInstanceService, _sheetRowFilteredService?: ISheetRowFilteredService | undefined);
|
|
53
55
|
private _initDefaultTheme;
|
|
54
56
|
private _ensureRangeThemeStyleMap;
|
|
55
57
|
private _ensureRangeThemeStyleRuleMap;
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IDisposable, IRange, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { Observable } from 'rxjs';
|
|
18
|
-
import type { IAutoFillLocation, IAutoFillRule, ISheetAutoFillHook } from './type';
|
|
19
18
|
import { Direction, Disposable, ICommandService, Injector, IUndoRedoService, IUniverInstanceService } from '@univerjs/core';
|
|
19
|
+
import type { IAutoFillLocation, IAutoFillRule, ISheetAutoFillHook } from './type';
|
|
20
20
|
import { AUTO_FILL_APPLY_TYPE } from './type';
|
|
21
21
|
export interface IAutoFillService {
|
|
22
22
|
applyType$: Observable<AUTO_FILL_APPLY_TYPE>;
|
|
@@ -34,7 +34,7 @@ export interface IAutoFillService {
|
|
|
34
34
|
setFillingStyle(isFillingStyle: boolean): void;
|
|
35
35
|
registerRule(rule: IAutoFillRule): void;
|
|
36
36
|
getAllHooks(): ISheetAutoFillHook[];
|
|
37
|
-
getActiveHooks(): ISheetAutoFillHook[];
|
|
37
|
+
getActiveHooks(applyType?: AUTO_FILL_APPLY_TYPE): ISheetAutoFillHook[];
|
|
38
38
|
addHook(hook: ISheetAutoFillHook): IDisposable;
|
|
39
39
|
fillData(applyType: AUTO_FILL_APPLY_TYPE): boolean;
|
|
40
40
|
triggerAutoFill(unitId: string, subUnitId: string, source: IRange, target: IRange, manualApplyType?: AUTO_FILL_APPLY_TYPE): Promise<boolean>;
|
|
@@ -71,7 +71,7 @@ export declare class AutoFillService extends Disposable implements IAutoFillServ
|
|
|
71
71
|
registerRule(rule: IAutoFillRule): void;
|
|
72
72
|
getRules(): IAutoFillRule[];
|
|
73
73
|
getAllHooks(): ISheetAutoFillHook[];
|
|
74
|
-
getActiveHooks(): ISheetAutoFillHook[];
|
|
74
|
+
getActiveHooks(applyType?: AUTO_FILL_APPLY_TYPE): ISheetAutoFillHook[];
|
|
75
75
|
get applyType(): AUTO_FILL_APPLY_TYPE;
|
|
76
76
|
set applyType(type: AUTO_FILL_APPLY_TYPE);
|
|
77
77
|
get menu(): IApplyMenuItem[];
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Direction, IAccessor, ICellData, IMutationInfo, IObjectMatrixPrimitiveType, Nullable } from '@univerjs/core';
|
|
17
|
-
import type { IDiscreteRange } from '../../basics';
|
|
17
|
+
import type { IDiscreteRange } from '../../basics/interfaces/selection-config';
|
|
18
18
|
export declare enum AUTO_FILL_APPLY_TYPE {
|
|
19
19
|
COPY = "COPY",
|
|
20
20
|
SERIES = "SERIES",
|
|
@@ -50,11 +50,18 @@ export interface ISheetAutoFillHook {
|
|
|
50
50
|
bindUnit?: string;
|
|
51
51
|
disable?: (location: IAutoFillLocation, direction: Direction, applyType: AUTO_FILL_APPLY_TYPE) => boolean;
|
|
52
52
|
onBeforeFillData?(location: IAutoFillLocation, direction: Direction): AUTO_FILL_APPLY_TYPE | void;
|
|
53
|
+
/** Prepare and validate without mutations; the returned callback captures undo data after reverting a previous fill. */
|
|
54
|
+
onPrepareFillData?(location: IAutoFillLocation, direction: Direction, applyType: AUTO_FILL_APPLY_TYPE): () => {
|
|
55
|
+
undos: IMutationInfo[];
|
|
56
|
+
redos: IMutationInfo[];
|
|
57
|
+
};
|
|
53
58
|
onFillData?(location: IAutoFillLocation, direction: Direction, applyType: AUTO_FILL_APPLY_TYPE): {
|
|
54
59
|
undos: IMutationInfo[];
|
|
55
60
|
redos: IMutationInfo[];
|
|
56
61
|
};
|
|
57
62
|
onAfterFillData?(location: IAutoFillLocation, direction: Direction, applyType: AUTO_FILL_APPLY_TYPE): boolean | void;
|
|
63
|
+
/** Validate proposed values before reverting or applying any fill mutations. Throw to reject the entire fill. */
|
|
64
|
+
onValidateFillData?(location: IAutoFillLocation, direction: Direction, applyType: AUTO_FILL_APPLY_TYPE, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
58
65
|
onBeforeSubmit?: (location: IAutoFillLocation, direction: Direction, applyType: AUTO_FILL_APPLY_TYPE, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>) => void;
|
|
59
66
|
}
|
|
60
67
|
export type IAutoFillCopyDataInTypeIndexInfo = number[];
|