@univerjs/sheets-ui 0.1.11 → 0.1.13
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 +13 -14
- package/lib/es/index.js +12373 -10663
- package/lib/index.css +1 -1
- package/lib/locale/en-US.json +612 -0
- package/lib/locale/ru-RU.json +612 -0
- package/lib/locale/zh-CN.json +612 -0
- package/lib/types/basics/const/permission.d.ts +16 -0
- package/lib/types/commands/commands/clipboard.command.d.ts +5 -0
- package/lib/types/commands/commands/range-protection.command.d.ts +28 -0
- package/lib/types/commands/commands/worksheet-protection.command.d.ts +21 -0
- package/lib/types/commands/operations/sheet-permission-open-dialog.operation.d.ts +3 -0
- package/lib/types/commands/operations/sheet-permission-open-panel.operation.d.ts +7 -0
- package/lib/types/common/keys.d.ts +4 -3
- package/lib/types/common/utils.d.ts +10 -2
- package/lib/types/controllers/clipboard/utils.d.ts +1 -1
- package/lib/types/controllers/drag-render.controller.d.ts +13 -0
- package/lib/types/controllers/editor/formula-editor.controller.d.ts +11 -1
- package/lib/types/controllers/hover-render.controller.d.ts +4 -1
- package/lib/types/controllers/menu/clear.menu.d.ts +5 -4
- package/lib/types/controllers/menu/delete.menu.d.ts +6 -5
- package/lib/types/controllers/menu/insert.menu.d.ts +5 -5
- package/lib/types/controllers/menu/menu-util.d.ts +10 -1
- package/lib/types/controllers/menu/menu.d.ts +11 -11
- package/lib/types/controllers/menu/permission-menu-util.d.ts +14 -0
- package/lib/types/controllers/menu/permission.menu.d.ts +14 -0
- package/lib/types/controllers/menu/sheet.menu.d.ts +3 -3
- package/lib/types/controllers/permission/sheet-permission-init.controller.d.ts +26 -0
- package/lib/types/controllers/permission/sheet-permission-interceptor-base.controller.d.ts +37 -0
- package/lib/types/controllers/permission/sheet-permission-interceptor-canvas-render.controller.d.ts +29 -0
- package/lib/types/controllers/permission/sheet-permission-interceptor-clipboard.controller.d.ts +16 -0
- package/lib/types/controllers/permission/sheet-permission-interceptor-formula-render.controller.d.ts +19 -0
- package/lib/types/controllers/permission/sheet-permission-render.controller.d.ts +19 -0
- package/lib/types/controllers/render-controllers/freeze.render-controller.d.ts +14 -1
- package/lib/types/controllers/render-controllers/header-move.render-controller.d.ts +5 -1
- package/lib/types/controllers/render-controllers/header-resize.render-controller.d.ts +11 -1
- package/lib/types/controllers/sheet-render.controller.d.ts +11 -0
- package/lib/types/controllers/sheet-ui.controller.d.ts +8 -3
- package/lib/types/controllers/status-bar.controller.d.ts +6 -2
- package/lib/types/hooks/useHighlightRange.d.ts +3 -0
- package/lib/types/index.d.ts +17 -4
- package/lib/types/locale/zh-CN.d.ts +99 -0
- package/lib/types/services/canvas-pop-manager.service.d.ts +4 -11
- package/lib/types/services/drag-manager.service.d.ts +25 -0
- package/lib/types/services/hover-manager.service.d.ts +3 -2
- package/lib/types/services/permission/permission-render.service.d.ts +17 -0
- package/lib/types/services/permission/sheet-permission-panel.model.d.ts +27 -0
- package/lib/types/services/permission/sheet-permission-user-list.service.d.ts +18 -0
- package/lib/types/services/selection/selection-render.service.d.ts +31 -14
- package/lib/types/sheets-ui-plugin.d.ts +3 -1
- package/lib/types/views/defined-name/DefinedName.d.ts +3 -1
- package/lib/types/views/permission/error-msg-dialog/index.d.ts +5 -0
- package/lib/types/{locale/index.d.ts → views/permission/error-msg-dialog/interface.d.ts} +2 -3
- package/lib/types/views/permission/footer/index.d.ts +5 -0
- package/lib/types/views/permission/footer/permission-detail-footer.d.ts +3 -0
- package/lib/types/views/permission/footer/permission-list-footer.d.ts +3 -0
- package/lib/types/views/permission/index.d.ts +21 -0
- package/lib/types/views/permission/panel/index.d.ts +8 -0
- package/lib/types/views/permission/panel-detail/index.d.ts +5 -0
- package/lib/types/views/permission/panel-list/constant.d.ts +16 -0
- package/lib/types/views/permission/panel-list/index.d.ts +3 -0
- package/lib/types/views/permission/permission-dialog/index.d.ts +3 -0
- package/lib/types/views/permission/spin/index.d.ts +8 -0
- package/lib/types/views/permission/user-dialog/constant.d.ts +16 -0
- package/lib/types/views/permission/user-dialog/index.d.ts +3 -0
- package/lib/types/views/sheet-bar/sheet-bar-menu/SheetBarMenu.d.ts +1 -1
- package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarItem.d.ts +1 -1
- package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +1 -0
- package/lib/types/views/sheet-canvas-view.d.ts +13 -0
- package/lib/types/views/sheet-container/SheetContainer.d.ts +3 -0
- package/lib/umd/index.js +13 -14
- package/package.json +25 -23
package/lib/types/index.d.ts
CHANGED
|
@@ -16,14 +16,13 @@
|
|
|
16
16
|
export * from './basics';
|
|
17
17
|
export { getEditorObject } from './basics/editor/get-editor-object';
|
|
18
18
|
export { AutoFillCommand } from './commands/commands/auto-fill.command';
|
|
19
|
-
export { SheetPasteCommand } from './commands/commands/clipboard.command';
|
|
20
19
|
export { SheetCopyCommand } from './commands/commands/clipboard.command';
|
|
21
20
|
export { expandToContinuousRange } from './commands/commands/utils/selection-utils';
|
|
22
21
|
export { ExpandSelectionCommand, JumpOver, MoveSelectionCommand } from './commands/commands/set-selection.command';
|
|
23
22
|
export { SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation } from './commands/operations/cell-edit.operation';
|
|
24
23
|
export { SetScrollOperation } from './commands/operations/scroll.operation';
|
|
25
24
|
export { SheetsScrollRenderController } from './controllers/render-controllers/scroll.render-controller';
|
|
26
|
-
export { deriveStateFromActiveSheet$ } from './controllers/menu/menu-util';
|
|
25
|
+
export { deriveStateFromActiveSheet$, getCurrentRangeDisable$, getCommentDisable$ } from './controllers/menu/menu-util';
|
|
27
26
|
export { SheetRenderController } from './controllers/sheet-render.controller';
|
|
28
27
|
export { SetZoomRatioOperation } from './commands/operations/set-zoom-ratio.operation';
|
|
29
28
|
export { ResetScrollCommand, ScrollCommand, ScrollToCellCommand, SetScrollRelativeCommand, type IScrollCommandParams, type IScrollToCellCommandParams, type ISetScrollRelativeCommandParams, } from './commands/commands/set-scroll.command';
|
|
@@ -36,7 +35,6 @@ export { getCoordByCell, getCoordByOffset, getSheetObject, getTransformCoord, }
|
|
|
36
35
|
export { useActiveWorkbook, useActiveWorksheet } from './components/hook';
|
|
37
36
|
export { whenSheetEditorFocused } from './controllers/shortcuts/utils';
|
|
38
37
|
export type { IEditorBridgeServiceParam } from './services/editor-bridge.service';
|
|
39
|
-
export { enUS, zhCN, ruRU } from './locale';
|
|
40
38
|
export { AutoFillService, IAutoFillService } from './services/auto-fill/auto-fill.service';
|
|
41
39
|
export { getAutoFillRepeatRange } from './services/auto-fill/tools';
|
|
42
40
|
export type { ICopyDataPiece, ISheetAutoFillHook } from './services/auto-fill/type';
|
|
@@ -59,13 +57,28 @@ export { SheetSkeletonManagerService } from './services/sheet-skeleton-manager.s
|
|
|
59
57
|
export { UniverSheetsUIPlugin } from './sheets-ui-plugin';
|
|
60
58
|
export { SheetCanvasView } from './views/sheet-canvas-view';
|
|
61
59
|
export { HoverManagerService } from './services/hover-manager.service';
|
|
60
|
+
export { DragManagerService } from './services/drag-manager.service';
|
|
62
61
|
export { CellAlertManagerService, CellAlertType, type ICellAlert } from './services/cell-alert-manager.service';
|
|
63
62
|
export { HoverRenderController } from './controllers/hover-render.controller';
|
|
63
|
+
export { DragRenderController } from './controllers/drag-render.controller';
|
|
64
64
|
export { SHEET_VIEW_KEY } from './common/keys';
|
|
65
|
-
export { SheetCanvasPopManagerService } from './services/canvas-pop-manager.service';
|
|
65
|
+
export { SheetCanvasPopManagerService, type ICanvasPopup } from './services/canvas-pop-manager.service';
|
|
66
66
|
export { mergeSetRangeValues } from './services/clipboard/utils';
|
|
67
67
|
export type { IAutoFillLocation } from './services/auto-fill/type';
|
|
68
68
|
export type { IDiscreteRange } from './controllers/utils/range-tools';
|
|
69
69
|
export { virtualizeDiscreteRanges, rangeToDiscreteRange } from './controllers/utils/range-tools';
|
|
70
70
|
export { type IHoverCellPosition } from './services/hover-manager.service';
|
|
71
71
|
export { AutoHeightController } from './controllers/auto-height.controller';
|
|
72
|
+
export { type IDragCellPosition } from './services/drag-manager.service';
|
|
73
|
+
export { SheetMenuPosition } from './controllers/menu/menu';
|
|
74
|
+
export { useHighlightRange } from './hooks/useHighlightRange';
|
|
75
|
+
export { HeaderMoveRenderController } from './controllers/render-controllers/header-move.render-controller';
|
|
76
|
+
export { HeaderResizeRenderController } from './controllers/render-controllers/header-resize.render-controller';
|
|
77
|
+
export type { ISheetPasteParams } from './commands/commands/clipboard.command';
|
|
78
|
+
export { SheetCutCommand, SheetPasteColWidthCommand, SheetPasteCommand, SheetPasteShortKeyCommand } from './commands/commands/clipboard.command';
|
|
79
|
+
export { SetRangeBoldCommand, SetRangeItalicCommand, SetRangeUnderlineCommand, SetRangeStrickThroughCommand } from './commands/commands/inline-format.command';
|
|
80
|
+
export { ApplyFormatPainterCommand } from './commands/commands/set-format-painter.command';
|
|
81
|
+
export { HeaderFreezeRenderController } from './controllers/render-controllers/freeze.render-controller';
|
|
82
|
+
export { FormulaEditorController } from './controllers/editor/formula-editor.controller';
|
|
83
|
+
export { StatusBarController } from './controllers/status-bar.controller';
|
|
84
|
+
export { SheetPermissionInterceptorBaseController } from './controllers/permission/sheet-permission-interceptor-base.controller';
|
|
@@ -304,6 +304,10 @@ declare const locale: {
|
|
|
304
304
|
sheetNameAlreadyExistsError: string;
|
|
305
305
|
deleteSheet: string;
|
|
306
306
|
deleteSheetContent: string;
|
|
307
|
+
addProtectSheet: string;
|
|
308
|
+
removeProtectSheet: string;
|
|
309
|
+
changeSheetPermission: string;
|
|
310
|
+
viewAllProtectArea: string;
|
|
307
311
|
};
|
|
308
312
|
rightClick: {
|
|
309
313
|
copy: string;
|
|
@@ -404,6 +408,11 @@ declare const locale: {
|
|
|
404
408
|
deleteAllColumnsAlert: string;
|
|
405
409
|
hideAllRowsAlert: string;
|
|
406
410
|
hideAllColumnsAlert: string;
|
|
411
|
+
protectRange: string;
|
|
412
|
+
editProtectRange: string;
|
|
413
|
+
removeProtectRange: string;
|
|
414
|
+
turnOnProtectRange: string;
|
|
415
|
+
viewAllProtectArea: string;
|
|
407
416
|
};
|
|
408
417
|
info: {
|
|
409
418
|
tooltip: string;
|
|
@@ -495,6 +504,7 @@ declare const locale: {
|
|
|
495
504
|
'set-italic': string;
|
|
496
505
|
'set-underline': string;
|
|
497
506
|
'set-strike-through': string;
|
|
507
|
+
'start-editing': string;
|
|
498
508
|
};
|
|
499
509
|
};
|
|
500
510
|
'sheet-view': string;
|
|
@@ -525,5 +535,94 @@ declare const locale: {
|
|
|
525
535
|
nameInvalid: string;
|
|
526
536
|
nameSheetConflict: string;
|
|
527
537
|
};
|
|
538
|
+
uploadLoading: {
|
|
539
|
+
loading: string;
|
|
540
|
+
error: string;
|
|
541
|
+
};
|
|
542
|
+
permission: {
|
|
543
|
+
toolbarMenu: string;
|
|
544
|
+
panel: {
|
|
545
|
+
title: string;
|
|
546
|
+
name: string;
|
|
547
|
+
protectedRange: string;
|
|
548
|
+
permissionDirection: string;
|
|
549
|
+
permissionDirectionPlaceholder: string;
|
|
550
|
+
editPermission: string;
|
|
551
|
+
onlyICanEdit: string;
|
|
552
|
+
designedUserCanEdit: string;
|
|
553
|
+
viewPermission: string;
|
|
554
|
+
othersCanView: string;
|
|
555
|
+
noOneElseCanView: string;
|
|
556
|
+
designedPerson: string;
|
|
557
|
+
addPerson: string;
|
|
558
|
+
canEdit: string;
|
|
559
|
+
canView: string;
|
|
560
|
+
delete: string;
|
|
561
|
+
currentSheet: string;
|
|
562
|
+
allSheet: string;
|
|
563
|
+
edit: string;
|
|
564
|
+
Print: string;
|
|
565
|
+
Comment: string;
|
|
566
|
+
Copy: string;
|
|
567
|
+
SetCellStyle: string;
|
|
568
|
+
SetCellValue: string;
|
|
569
|
+
SetHyperLink: string;
|
|
570
|
+
Sort: string;
|
|
571
|
+
Filter: string;
|
|
572
|
+
PivotTable: string;
|
|
573
|
+
FloatImage: string;
|
|
574
|
+
RowHeightColWidth: string;
|
|
575
|
+
RowHeightColWidthReadonly: string;
|
|
576
|
+
FilterReadonly: string;
|
|
577
|
+
nameError: string;
|
|
578
|
+
created: string;
|
|
579
|
+
iCanEdit: string;
|
|
580
|
+
iCanNotEdit: string;
|
|
581
|
+
iCanView: string;
|
|
582
|
+
iCanNotView: string;
|
|
583
|
+
emptyRangeError: string;
|
|
584
|
+
rangeOverlapError: string;
|
|
585
|
+
rangeOverlapOverPermissionError: string;
|
|
586
|
+
InsertHyperlink: string;
|
|
587
|
+
SetRowStyle: string;
|
|
588
|
+
SetColumnStyle: string;
|
|
589
|
+
InsertColumn: string;
|
|
590
|
+
InsertRow: string;
|
|
591
|
+
DeleteRow: string;
|
|
592
|
+
DeleteColumn: string;
|
|
593
|
+
EditExtraObject: string;
|
|
594
|
+
};
|
|
595
|
+
dialog: {
|
|
596
|
+
allowUserToEdit: string;
|
|
597
|
+
allowedPermissionType: string;
|
|
598
|
+
setCellValue: string;
|
|
599
|
+
setCellStyle: string;
|
|
600
|
+
copy: string;
|
|
601
|
+
alert: string;
|
|
602
|
+
alertContent: string;
|
|
603
|
+
userEmpty: string;
|
|
604
|
+
listEmpty: string;
|
|
605
|
+
commonErr: string;
|
|
606
|
+
editErr: string;
|
|
607
|
+
pasteErr: string;
|
|
608
|
+
setStyleErr: string;
|
|
609
|
+
copyErr: string;
|
|
610
|
+
setRowColStyleErr: string;
|
|
611
|
+
moveRowColErr: string;
|
|
612
|
+
moveRangeErr: string;
|
|
613
|
+
autoFillErr: string;
|
|
614
|
+
filterErr: string;
|
|
615
|
+
operatorSheetErr: string;
|
|
616
|
+
insertOrDeleteMoveRangeErr: string;
|
|
617
|
+
printErr: string;
|
|
618
|
+
formulaErr: string;
|
|
619
|
+
hyperLinkErr: string;
|
|
620
|
+
};
|
|
621
|
+
button: {
|
|
622
|
+
confirm: string;
|
|
623
|
+
cancel: string;
|
|
624
|
+
addNewPermission: string;
|
|
625
|
+
};
|
|
626
|
+
};
|
|
528
627
|
};
|
|
529
628
|
export default locale;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { Nullable, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IRenderManagerService, BaseObject, Viewport } from '@univerjs/engine-render';
|
|
3
|
-
import { ICanvasPopupService } from '@univerjs/ui';
|
|
3
|
+
import { IPopup, ICanvasPopupService } from '@univerjs/ui';
|
|
4
4
|
import { IDisposable } from '@wendellhu/redi';
|
|
5
5
|
import { RefRangeService } from '@univerjs/sheets';
|
|
6
6
|
import { SheetSkeletonManagerService } from './sheet-skeleton-manager.service';
|
|
7
7
|
|
|
8
|
-
export interface ICanvasPopup {
|
|
9
|
-
componentKey: string;
|
|
8
|
+
export interface ICanvasPopup extends Pick<IPopup, 'direction' | 'excludeOutside' | 'closeOnSelfTarget' | 'componentKey' | 'offset' | 'onClickOutside'> {
|
|
10
9
|
mask?: boolean;
|
|
11
|
-
onClickOutside?: (e: MouseEvent) => void;
|
|
12
|
-
direction?: 'vertical' | 'horizontal';
|
|
13
|
-
offset?: [number, number];
|
|
14
|
-
excludeOutside?: HTMLElement[];
|
|
15
|
-
/** Close the popup even if the outside element clicked is its target. */
|
|
16
|
-
closeOnSelfTarget?: boolean;
|
|
17
10
|
extraProps?: Record<string, any>;
|
|
18
11
|
}
|
|
19
12
|
export declare class SheetCanvasPopManagerService extends Disposable {
|
|
@@ -24,8 +17,6 @@ export declare class SheetCanvasPopManagerService extends Disposable {
|
|
|
24
17
|
private readonly _refRangeService;
|
|
25
18
|
private readonly _commandService;
|
|
26
19
|
constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _refRangeService: RefRangeService, _commandService: ICommandService);
|
|
27
|
-
private _calcCellPosition;
|
|
28
|
-
private _createCellPositionObserver;
|
|
29
20
|
private _createObjectPositionObserver;
|
|
30
21
|
/**
|
|
31
22
|
* attach a popup to canvas object
|
|
@@ -43,4 +34,6 @@ export declare class SheetCanvasPopManagerService extends Disposable {
|
|
|
43
34
|
* @returns disposable
|
|
44
35
|
*/
|
|
45
36
|
attachPopupToCell(row: number, col: number, popup: ICanvasPopup, viewport?: Viewport): Nullable<IDisposable>;
|
|
37
|
+
private _createCellPositionObserver;
|
|
38
|
+
private _calcCellPositionByCell;
|
|
46
39
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { IDragEvent, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
+
import { ScrollManagerService } from './scroll-manager.service';
|
|
4
|
+
import { SheetSkeletonManagerService } from './sheet-skeleton-manager.service';
|
|
5
|
+
import { IHoverCellPosition } from './hover-manager.service';
|
|
6
|
+
|
|
7
|
+
export interface IDragCellPosition extends IHoverCellPosition {
|
|
8
|
+
dataTransfer: DataTransfer;
|
|
9
|
+
}
|
|
10
|
+
export declare class DragManagerService extends Disposable {
|
|
11
|
+
private readonly _univerInstanceService;
|
|
12
|
+
private readonly _scrollManagerService;
|
|
13
|
+
private readonly _sheetSkeletonManagerService;
|
|
14
|
+
private readonly _renderManagerService;
|
|
15
|
+
private _currentCell$;
|
|
16
|
+
currentCell$: import('rxjs').Observable<Nullable<IDragCellPosition>>;
|
|
17
|
+
private _endCell$;
|
|
18
|
+
endCell$: import('rxjs').Observable<Nullable<IDragCellPosition>>;
|
|
19
|
+
constructor(_univerInstanceService: IUniverInstanceService, _scrollManagerService: ScrollManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _renderManagerService: IRenderManagerService);
|
|
20
|
+
dispose(): void;
|
|
21
|
+
private _initCellDisposableListener;
|
|
22
|
+
private _calcActiveCell;
|
|
23
|
+
onDragOver(evt: IDragEvent): void;
|
|
24
|
+
onDrop(evt: IDragEvent): void;
|
|
25
|
+
}
|
|
@@ -15,11 +15,12 @@ export declare class HoverManagerService extends Disposable {
|
|
|
15
15
|
private readonly _renderManagerService;
|
|
16
16
|
private _currentCell$;
|
|
17
17
|
currentCell$: import('rxjs').Observable<Nullable<IHoverCellPosition>>;
|
|
18
|
+
currentPosition$: import('rxjs').Observable<Nullable<IHoverCellPosition>>;
|
|
18
19
|
private _lastPosition;
|
|
19
20
|
constructor(_univerInstanceService: IUniverInstanceService, _scrollManagerService: ScrollManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _renderManagerService: IRenderManagerService);
|
|
21
|
+
dispose(): void;
|
|
20
22
|
private _initCellDisposableListener;
|
|
21
23
|
private _calcActiveCell;
|
|
22
24
|
onMouseMove(offsetX: number, offsetY: number): void;
|
|
23
|
-
|
|
24
|
-
onScrollEnd(): void;
|
|
25
|
+
onScroll(): void;
|
|
25
26
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
2
|
+
import { Disposable, IPermissionService, IUniverInstanceService } from '@univerjs/core';
|
|
3
|
+
import { RangeProtectionRuleModel } from '@univerjs/sheets';
|
|
4
|
+
import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
|
|
5
|
+
|
|
6
|
+
export declare class PermissionRenderService extends Disposable {
|
|
7
|
+
private _renderManagerService;
|
|
8
|
+
private _univerInstanceService;
|
|
9
|
+
private _rangeProtectionRuleModel;
|
|
10
|
+
private _sheetSkeletonManagerService;
|
|
11
|
+
private _permissionService;
|
|
12
|
+
private _rangeProtectionCanViewRenderExtension;
|
|
13
|
+
private _rangeProtectionCanNotViewRenderExtension;
|
|
14
|
+
constructor(_renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _rangeProtectionRuleModel: RangeProtectionRuleModel, _sheetSkeletonManagerService: SheetSkeletonManagerService, _permissionService: IPermissionService);
|
|
15
|
+
private _initRender;
|
|
16
|
+
private _initSkeleton;
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IRange, Nullable } from '@univerjs/core';
|
|
2
|
+
import { IRangeProtectionRule, IWorksheetProtectionRule } from '@univerjs/sheets';
|
|
3
|
+
|
|
4
|
+
export declare enum viewState {
|
|
5
|
+
othersCanView = "othersCanView",
|
|
6
|
+
noOneElseCanView = "noOneElseCanView"
|
|
7
|
+
}
|
|
8
|
+
type IPermissionPanelBaseRule = IRangeProtectionRule | IWorksheetProtectionRule;
|
|
9
|
+
export type IPermissionPanelRule = IPermissionPanelBaseRule & {
|
|
10
|
+
viewStatus?: viewState;
|
|
11
|
+
ranges: IRange[];
|
|
12
|
+
};
|
|
13
|
+
export declare class SheetPermissionPanelModel {
|
|
14
|
+
private _rule;
|
|
15
|
+
private _rule$;
|
|
16
|
+
private _oldRule;
|
|
17
|
+
private _rangeErrorMsg$;
|
|
18
|
+
rangeErrorMsg$: import('rxjs').Observable<string>;
|
|
19
|
+
setRangeErrorMsg(msg: string): void;
|
|
20
|
+
rule$: import('rxjs').Observable<IPermissionPanelRule>;
|
|
21
|
+
get rule(): IPermissionPanelRule;
|
|
22
|
+
setRule(ruleObj: Partial<IPermissionPanelRule>): void;
|
|
23
|
+
resetRule(): void;
|
|
24
|
+
get oldRule(): Nullable<IPermissionPanelRule>;
|
|
25
|
+
setOldRule(ruleObj: Nullable<IPermissionPanelRule>): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICollaborator } from '@univerjs/protocol';
|
|
2
|
+
|
|
3
|
+
export declare class SheetPermissionUserManagerService {
|
|
4
|
+
private _userList;
|
|
5
|
+
private _oldCollaboratorList;
|
|
6
|
+
private _selectUserList;
|
|
7
|
+
private _allUserList;
|
|
8
|
+
private _selectUserList$;
|
|
9
|
+
selectUserList$: import('rxjs').Observable<ICollaborator[]>;
|
|
10
|
+
get userList(): ICollaborator[];
|
|
11
|
+
get allUserList(): ICollaborator[];
|
|
12
|
+
setAllUserList(userList: ICollaborator[]): void;
|
|
13
|
+
setUserList(userList: ICollaborator[]): void;
|
|
14
|
+
get oldCollaboratorList(): ICollaborator[];
|
|
15
|
+
setOldCollaboratorList(userList: ICollaborator[]): void;
|
|
16
|
+
get selectUserList(): ICollaborator[];
|
|
17
|
+
setSelectUserList(userList: ICollaborator[]): void;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRange, IRangeWithCoord, ISelection, ISelectionCell, ISelectionCellWithCoord, Nullable, RANGE_TYPE, ThemeService } from '@univerjs/core';
|
|
1
|
+
import { IInterceptor, IRange, IRangeWithCoord, ISelection, ISelectionCell, ISelectionCellWithCoord, Nullable, InterceptorManager, RANGE_TYPE, ThemeService } from '@univerjs/core';
|
|
2
2
|
import { IMouseEvent, IPointerEvent, Scene, SpreadsheetSkeleton, Viewport, ScrollTimerType } from '@univerjs/engine-render';
|
|
3
3
|
import { ISelectionStyle, ISelectionWithCoordAndStyle, ISelectionWithStyle } from '@univerjs/sheets';
|
|
4
4
|
import { IShortcutService } from '@univerjs/ui';
|
|
@@ -17,6 +17,14 @@ export interface ISelectionRenderService {
|
|
|
17
17
|
readonly selectionMoving$: Observable<ISelectionWithCoordAndStyle[]>;
|
|
18
18
|
readonly selectionMoveStart$: Observable<ISelectionWithCoordAndStyle[]>;
|
|
19
19
|
readonly usable$: Observable<boolean>;
|
|
20
|
+
interceptor: InterceptorManager<{
|
|
21
|
+
RANGE_MOVE_PERMISSION_CHECK: IInterceptor<boolean, null>;
|
|
22
|
+
RANGE_FILL_PERMISSION_CHECK: IInterceptor<boolean, {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
skeleton: SpreadsheetSkeleton;
|
|
26
|
+
}>;
|
|
27
|
+
}>;
|
|
20
28
|
enableHeaderHighlight(): void;
|
|
21
29
|
disableHeaderHighlight(): void;
|
|
22
30
|
enableDetectMergedCell(): void;
|
|
@@ -41,9 +49,10 @@ export interface ISelectionRenderService {
|
|
|
41
49
|
getActiveRange(): Nullable<IRange>;
|
|
42
50
|
getActiveSelection(): Nullable<SelectionShape>;
|
|
43
51
|
getSelectionDataWithStyle(): ISelectionWithCoordAndStyle[];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
attachSelectionWithCoord(selectionWithStyle: ISelectionWithStyle): ISelectionWithCoordAndStyle;
|
|
53
|
+
attachRangeWithCoord(range: IRange): Nullable<IRangeWithCoord>;
|
|
54
|
+
attachPrimaryWithCoord(primary: Nullable<ISelectionCell>): Nullable<ISelectionCellWithCoord>;
|
|
55
|
+
getSelectionCellByPosition(x: number, y: number): Nullable<ISelectionCellWithCoord>;
|
|
47
56
|
eventTrigger(evt: IPointerEvent | IMouseEvent, zIndex: number, rangeType: RANGE_TYPE, viewport?: Viewport, scrollTimerType?: ScrollTimerType): void;
|
|
48
57
|
reset(): void;
|
|
49
58
|
refreshSelectionMoveStart(): void;
|
|
@@ -63,6 +72,12 @@ export interface ISelectionRenderService {
|
|
|
63
72
|
*
|
|
64
73
|
* @todo Refactor it to RenderController.
|
|
65
74
|
*/
|
|
75
|
+
export declare const RANGE_MOVE_PERMISSION_CHECK: IInterceptor<boolean, null>;
|
|
76
|
+
export declare const RANGE_FILL_PERMISSION_CHECK: IInterceptor<boolean, {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
skeleton: SpreadsheetSkeleton;
|
|
80
|
+
}>;
|
|
66
81
|
export declare class SelectionRenderService implements ISelectionRenderService {
|
|
67
82
|
private readonly _themeService;
|
|
68
83
|
private readonly _shortcutService;
|
|
@@ -110,6 +125,14 @@ export declare class SelectionRenderService implements ISelectionRenderService {
|
|
|
110
125
|
*/
|
|
111
126
|
private readonly _usable$;
|
|
112
127
|
readonly usable$: Observable<boolean>;
|
|
128
|
+
interceptor: InterceptorManager<{
|
|
129
|
+
RANGE_MOVE_PERMISSION_CHECK: IInterceptor<boolean, null>;
|
|
130
|
+
RANGE_FILL_PERMISSION_CHECK: IInterceptor<boolean, {
|
|
131
|
+
x: number;
|
|
132
|
+
y: number;
|
|
133
|
+
skeleton: SpreadsheetSkeleton;
|
|
134
|
+
}>;
|
|
135
|
+
}>;
|
|
113
136
|
constructor(_themeService: ThemeService, _shortcutService: IShortcutService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _injector: Injector);
|
|
114
137
|
enableHeaderHighlight(): void;
|
|
115
138
|
disableHeaderHighlight(): void;
|
|
@@ -134,12 +157,6 @@ export declare class SelectionRenderService implements ISelectionRenderService {
|
|
|
134
157
|
* @param curCellRange
|
|
135
158
|
*/
|
|
136
159
|
addControlToCurrentByRangeData(data: ISelectionWithCoordAndStyle): void;
|
|
137
|
-
/**
|
|
138
|
-
* update selection
|
|
139
|
-
* @param selectionRange
|
|
140
|
-
* @param curCellRange
|
|
141
|
-
* @returns
|
|
142
|
-
*/
|
|
143
160
|
updateControlForCurrentByRangeData(selections: ISelectionWithCoordAndStyle[]): void;
|
|
144
161
|
refreshSelectionMoveStart(): void;
|
|
145
162
|
changeRuntime(skeleton: Nullable<SpreadsheetSkeleton>, scene: Nullable<Scene>, viewport?: Viewport): void;
|
|
@@ -175,12 +192,12 @@ export declare class SelectionRenderService implements ISelectionRenderService {
|
|
|
175
192
|
* @param style selection style, Styles for user-customized selectors
|
|
176
193
|
* @param zIndex Stacking order of the selection object
|
|
177
194
|
* @param rangeType Determines whether the selection is made normally according to the range or by rows and columns
|
|
178
|
-
* @returns
|
|
179
195
|
*/
|
|
180
196
|
eventTrigger(evt: IPointerEvent | IMouseEvent, zIndex?: number, rangeType?: RANGE_TYPE, viewport?: Viewport, scrollTimerType?: ScrollTimerType): false | undefined;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
197
|
+
attachSelectionWithCoord(selectionWithStyle: ISelectionWithStyle): ISelectionWithCoordAndStyle;
|
|
198
|
+
attachRangeWithCoord(range: IRange): Nullable<IRangeWithCoord>;
|
|
199
|
+
attachPrimaryWithCoord(primary: Nullable<ISelectionCell>): Nullable<ISelectionCellWithCoord>;
|
|
200
|
+
getSelectionCellByPosition(x: number, y: number): Nullable<ISelectionCellWithCoord>;
|
|
184
201
|
/**
|
|
185
202
|
* When mousedown and mouseup need to go to the coordination and undo stack, when mousemove does not need to go to the coordination and undo stack
|
|
186
203
|
*/
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { IUniverInstanceService, LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
2
|
import { Injector } from '@wendellhu/redi';
|
|
3
3
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
|
+
import { IUniverSheetsUIConfig } from './controllers/sheet-ui.controller';
|
|
4
5
|
|
|
5
6
|
export declare class UniverSheetsUIPlugin extends Plugin {
|
|
7
|
+
private readonly _config;
|
|
6
8
|
readonly _injector: Injector;
|
|
7
9
|
private readonly _localeService;
|
|
8
10
|
private readonly _renderManagerService;
|
|
9
11
|
private readonly _univerInstanceService;
|
|
10
12
|
static pluginName: string;
|
|
11
13
|
static type: UniverInstanceType;
|
|
12
|
-
constructor(_config:
|
|
14
|
+
constructor(_config: Partial<IUniverSheetsUIConfig>, _injector: Injector, _localeService: LocaleService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService);
|
|
13
15
|
onStarting(injector: Injector): void;
|
|
14
16
|
onReady(): void;
|
|
15
17
|
private _registerRenderControllers;
|
|
@@ -13,6 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export { default as ruRU } from './ru-RU';
|
|
16
|
+
export declare const UNIVER_SHEET_PERMISSION_ALERT_DIALOG_ID = "UNIVER_SHEET_PERMISSION_ALERT_DIALOG_ID";
|
|
17
|
+
export declare const UNIVER_SHEET_PERMISSION_ALERT_DIALOG = "UNIVER_SHEET_PERMISSION_ALERT_DIALOG";
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { SheetPermissionPanel } from './panel';
|
|
17
|
+
export { SheetPermissionPanelFooter } from './footer';
|
|
18
|
+
export { SheetPermissionPanelList } from './panel-list';
|
|
19
|
+
export { SheetPermissionPanelAddFooter } from './footer/permission-list-footer';
|
|
20
|
+
export { SheetPermissionUserDialog } from './user-dialog';
|
|
21
|
+
export { SheetPermissionDialog } from './permission-dialog';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ISheetPermissionPanelProps {
|
|
4
|
+
showDetail: boolean;
|
|
5
|
+
fromSheetBar: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const SheetPermissionPanel: ({ showDetail, fromSheetBar }: ISheetPermissionPanelProps) => React.JSX.Element;
|
|
8
|
+
export {};
|