@univerjs/sheets-ui 0.1.0-beta.1 → 0.1.0-beta.3
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/{LICENSE.txt → LICENSE} +0 -2
- package/lib/cjs/index.js +13 -10
- package/lib/es/index.js +7936 -6974
- package/lib/index.css +1 -1
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +25 -0
- package/lib/types/{components/font-size/FontSize.d.ts → commands/commands/__tests__/hide-row-col-confirm.command.spec.d.ts} +1 -3
- package/lib/types/{components/font-family/FontFamily.d.ts → commands/commands/__tests__/remove-row-col-confirm.command.spec.d.ts} +1 -3
- package/lib/types/commands/commands/__tests__/selection-utils.spec.d.ts +16 -0
- package/lib/types/commands/commands/auto-fill.command.d.ts +1 -11
- package/lib/types/commands/commands/delete-range-move-left-confirm.command .d.ts +17 -0
- package/lib/types/commands/commands/{set-selection-frozen.command.d.ts → delete-range-move-up-confirm.command.d.ts} +1 -1
- package/lib/types/commands/commands/hide-row-col-confirm.command.d.ts +18 -0
- package/lib/types/commands/commands/insert-range-move-down-confirm.command.d.ts +17 -0
- package/lib/types/commands/commands/insert-range-move-right-confirm.command.d.ts +17 -0
- package/lib/types/commands/commands/remove-row-col-confirm.command.d.ts +18 -0
- package/lib/types/commands/commands/set-scroll.command.d.ts +1 -1
- package/lib/types/commands/commands/utils/selection-utils.d.ts +14 -0
- package/lib/types/commands/operations/activate-cell-edit.operation.d.ts +2 -2
- package/lib/types/common/keys.d.ts +1 -0
- package/lib/types/components/font-family/index.d.ts +2 -2
- package/lib/types/components/font-family/interface.d.ts +0 -7
- package/lib/types/components/font-size/index.d.ts +1 -1
- package/lib/types/components/font-size/interface.d.ts +0 -7
- package/lib/types/components/menu-item-input/interface.d.ts +2 -0
- package/lib/types/controllers/auto-fill.controller.d.ts +13 -9
- package/lib/types/controllers/clipboard/clipboard.controller.d.ts +5 -1
- package/lib/types/controllers/clipboard/utils.d.ts +16 -14
- package/lib/types/{components/font-family/FontFamilyItem.d.ts → controllers/editor/__tests__/create-test-bed.d.ts} +10 -3
- package/lib/types/controllers/editor/__tests__/end-edit.controller.spec.d.ts +16 -0
- package/lib/types/controllers/editor/end-edit.controller.d.ts +3 -0
- package/lib/types/controllers/editor/formula-editor.controller.d.ts +1 -0
- package/lib/types/controllers/editor-bridge.controller.d.ts +2 -5
- package/lib/types/controllers/format-painter/format-painter.controller.d.ts +3 -3
- package/lib/types/controllers/freeze.controller.d.ts +11 -3
- package/lib/types/controllers/header-menu.controller.d.ts +4 -2
- package/lib/types/controllers/header-move.controller.d.ts +1 -1
- package/lib/types/controllers/menu/menu.d.ts +2 -10
- package/lib/types/controllers/menu/sheet.menu.d.ts +3 -3
- package/lib/types/controllers/scroll.controller.d.ts +2 -2
- package/lib/types/controllers/selection.controller.d.ts +4 -1
- package/lib/types/controllers/shortcuts/utils.d.ts +24 -5
- package/lib/types/controllers/shortcuts/view.shortcut.d.ts +3 -0
- package/lib/types/controllers/status-bar.controller.d.ts +5 -3
- package/lib/types/index.d.ts +2 -2
- package/lib/types/locale/en-US.d.ts +7 -18
- package/lib/types/locale/zh-CN.d.ts +7 -18
- package/lib/types/services/auto-fill/auto-fill.service.d.ts +33 -29
- package/lib/types/services/auto-fill/rules.d.ts +1 -0
- package/lib/types/services/auto-fill/tools.d.ts +11 -3
- package/lib/types/services/auto-fill/type.d.ts +23 -9
- package/lib/types/services/clipboard/__tests__/clipboard-test-bed.d.ts +1 -0
- package/lib/types/services/clipboard/copy-content-cache.d.ts +2 -2
- package/lib/types/services/clipboard/type.d.ts +16 -14
- package/lib/types/services/editor/formula-editor-manager.service.d.ts +4 -0
- package/lib/types/services/editor-bridge.service.d.ts +52 -13
- package/lib/types/services/mark-selection/mark-selection.service.d.ts +14 -2
- package/lib/types/services/selection/__test__/create-service-test-bed.d.ts +25 -0
- package/lib/types/services/selection/__test__/selection-render.test.d.ts +16 -0
- package/lib/types/services/selection/selection-render.service.d.ts +19 -3
- package/lib/types/services/selection/selection-shape-extension.d.ts +7 -2
- package/lib/types/services/selection/selection-shape.d.ts +1 -2
- package/lib/types/services/shortcut-experience.service.d.ts +45 -0
- package/lib/types/services/status-bar.service.d.ts +7 -4
- package/lib/types/views/header-menu-shape.d.ts +2 -2
- package/lib/types/views/header-resize-shape.d.ts +2 -2
- package/lib/types/views/header-unhide-shape.d.ts +2 -2
- package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +3 -1
- package/lib/types/views/status-bar/CopyableStatisticItem.d.ts +2 -1
- package/lib/umd/index.js +13 -10
- package/package.json +48 -45
- /package/lib/types/views/count-bar/{zoom-slider.d.ts → ZoomSlider.d.ts} +0 -0
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Disposable, ICommandService, IUniverInstanceService, ThemeService } from '@univerjs/core';
|
|
17
17
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
18
|
-
import { SelectionManagerService } from '@univerjs/sheets';
|
|
18
|
+
import { SelectionManagerService, SheetInterceptorService } from '@univerjs/sheets';
|
|
19
|
+
import { Injector } from '@wendellhu/redi';
|
|
19
20
|
import { ScrollManagerService } from '../services/scroll-manager.service';
|
|
20
21
|
import { ISelectionRenderService } from '../services/selection/selection-render.service';
|
|
21
22
|
import { SheetSkeletonManagerService } from '../services/sheet-skeleton-manager.service';
|
|
@@ -28,6 +29,8 @@ export declare class FreezeController extends Disposable {
|
|
|
28
29
|
private readonly _selectionManagerService;
|
|
29
30
|
private readonly _scrollManagerService;
|
|
30
31
|
private readonly _themeService;
|
|
32
|
+
private _sheetInterceptorService;
|
|
33
|
+
private _injector;
|
|
31
34
|
private _rowFreezeHeaderRect;
|
|
32
35
|
private _rowFreezeMainRect;
|
|
33
36
|
private _columnFreezeHeaderRect;
|
|
@@ -37,22 +40,26 @@ export declare class FreezeController extends Disposable {
|
|
|
37
40
|
private _freezeLeaveObservers;
|
|
38
41
|
private _moveObserver;
|
|
39
42
|
private _upObserver;
|
|
40
|
-
private _viewportObservers;
|
|
41
43
|
private _changeToRow;
|
|
42
44
|
private _changeToColumn;
|
|
43
45
|
private _changeToOffsetX;
|
|
44
46
|
private _changeToOffsetY;
|
|
47
|
+
private _activeViewport;
|
|
45
48
|
private _freezeNormalHeaderColor;
|
|
46
49
|
private _freezeNormalMainColor;
|
|
47
50
|
private _freezeActiveColor;
|
|
48
51
|
private _freezeHoverColor;
|
|
49
|
-
|
|
52
|
+
private _lastFreeze;
|
|
53
|
+
constructor(_sheetSkeletonManagerService: SheetSkeletonManagerService, _currentUniverService: IUniverInstanceService, _commandService: ICommandService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService, _selectionManagerService: SelectionManagerService, _scrollManagerService: ScrollManagerService, _themeService: ThemeService, _sheetInterceptorService: SheetInterceptorService, _injector: Injector);
|
|
50
54
|
dispose(): void;
|
|
51
55
|
private _initialize;
|
|
52
56
|
private _createFreeze;
|
|
53
57
|
private _eventBinding;
|
|
54
58
|
private _getCurrentLastVisibleRow;
|
|
59
|
+
private _getActiveViewport;
|
|
55
60
|
private _freezeDown;
|
|
61
|
+
private _getViewports;
|
|
62
|
+
private _bindViewportScroll;
|
|
56
63
|
private _updateViewport;
|
|
57
64
|
/**
|
|
58
65
|
* When switching sheet tabs, it is necessary to update the frozen state of the current view.
|
|
@@ -61,6 +68,7 @@ export declare class FreezeController extends Disposable {
|
|
|
61
68
|
private _refreshCurrent;
|
|
62
69
|
private _themeChangeListener;
|
|
63
70
|
private _themeChange;
|
|
71
|
+
private _interceptorCommands;
|
|
64
72
|
private _commandExecutedListener;
|
|
65
73
|
private _clearObserverEvent;
|
|
66
74
|
private _clearFreeze;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
16
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
17
17
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
18
18
|
import { SelectionManagerService } from '@univerjs/sheets';
|
|
19
19
|
import { IContextMenuService } from '@univerjs/ui';
|
|
@@ -27,15 +27,17 @@ export declare class HeaderMenuController extends Disposable {
|
|
|
27
27
|
private readonly _currentUniverService;
|
|
28
28
|
private readonly _renderManagerService;
|
|
29
29
|
private readonly _contextMenuService;
|
|
30
|
+
private readonly _commandService;
|
|
30
31
|
private readonly _selectionManagerService;
|
|
31
32
|
private _hoverRect;
|
|
32
33
|
private _hoverMenu;
|
|
33
34
|
private _currentColumn;
|
|
34
35
|
private _observers;
|
|
35
|
-
constructor(_sheetSkeletonManagerService: SheetSkeletonManagerService, _currentUniverService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _contextMenuService: IContextMenuService, _selectionManagerService: SelectionManagerService);
|
|
36
|
+
constructor(_sheetSkeletonManagerService: SheetSkeletonManagerService, _currentUniverService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _contextMenuService: IContextMenuService, _commandService: ICommandService, _selectionManagerService: SelectionManagerService);
|
|
36
37
|
dispose(): void;
|
|
37
38
|
private _initialize;
|
|
38
39
|
private _initialHover;
|
|
39
40
|
private _initialHoverMenu;
|
|
40
41
|
private _getSheetObject;
|
|
42
|
+
private _getSelectionOnColumn;
|
|
41
43
|
}
|
|
@@ -44,7 +44,7 @@ export declare class HeaderMoveController extends Disposable {
|
|
|
44
44
|
constructor(_sheetSkeletonManagerService: SheetSkeletonManagerService, _currentUniverService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _commandService: ICommandService, _selectionRenderService: ISelectionRenderService, _selectionManagerService: SelectionManagerService);
|
|
45
45
|
private _initialize;
|
|
46
46
|
private _initialRowOrColumn;
|
|
47
|
-
private
|
|
47
|
+
private _rowColumnMoving;
|
|
48
48
|
private _checkInHeaderRange;
|
|
49
49
|
private _clearObserverEvent;
|
|
50
50
|
private _newBackgroundAndLine;
|
|
@@ -26,19 +26,11 @@ export declare function BoldMenuItemFactory(accessor: IAccessor): IMenuButtonIte
|
|
|
26
26
|
export declare function ItalicMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
27
27
|
export declare function UnderlineMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
28
28
|
export declare function StrikeThroughMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
29
|
-
export declare const FONT_SIZE_CHILDREN: {
|
|
30
|
-
label: string;
|
|
31
|
-
value: number;
|
|
32
|
-
}[];
|
|
33
|
-
export declare const FONT_FAMILY_CHILDREN: {
|
|
34
|
-
label: string;
|
|
35
|
-
value: string;
|
|
36
|
-
}[];
|
|
37
29
|
export declare function FontFamilySelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
|
|
38
30
|
export declare function FontSizeSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<number>;
|
|
39
|
-
export declare function ResetTextColorMenuItemFactory(): IMenuButtonItem;
|
|
31
|
+
export declare function ResetTextColorMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
40
32
|
export declare function TextColorSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
|
|
41
|
-
export declare function ResetBackgroundColorMenuItemFactory(): IMenuButtonItem;
|
|
33
|
+
export declare function ResetBackgroundColorMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
42
34
|
export declare function BackgroundColorSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
|
|
43
35
|
export declare const HORIZONTAL_ALIGN_CHILDREN: {
|
|
44
36
|
label: string;
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
17
17
|
import type { IAccessor } from '@wendellhu/redi';
|
|
18
|
-
export declare function DeleteSheetMenuItemFactory(): IMenuButtonItem;
|
|
18
|
+
export declare function DeleteSheetMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
19
19
|
export declare function CopySheetMenuItemFactory(): IMenuButtonItem;
|
|
20
20
|
export declare function RenameSheetMenuItemFactory(): IMenuButtonItem;
|
|
21
21
|
export declare function ChangeColorSheetMenuItemFactory(): IMenuSelectorItem<string>;
|
|
22
|
-
export declare function HideSheetMenuItemFactory(): IMenuButtonItem;
|
|
22
|
+
export declare function HideSheetMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
23
23
|
export declare function UnHideSheetMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<any>;
|
|
24
|
-
export declare function ShowMenuItemFactory(): IMenuButtonItem;
|
|
24
|
+
export declare function ShowMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { Direction } from '@univerjs/core';
|
|
17
16
|
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
18
17
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
19
18
|
import { SelectionManagerService } from '@univerjs/sheets';
|
|
@@ -27,10 +26,11 @@ export declare class ScrollController extends Disposable {
|
|
|
27
26
|
private readonly _selectionManagerService;
|
|
28
27
|
private readonly _scrollManagerService;
|
|
29
28
|
constructor(_sheetSkeletonManagerService: SheetSkeletonManagerService, _currentUniverService: IUniverInstanceService, _commandService: ICommandService, _renderManagerService: IRenderManagerService, _selectionManagerService: SelectionManagerService, _scrollManagerService: ScrollManagerService);
|
|
29
|
+
scrollToVisible(targetIsActualRowAndColumn?: boolean): void;
|
|
30
30
|
dispose(): void;
|
|
31
31
|
private _initialize;
|
|
32
|
+
private _getFreeze;
|
|
32
33
|
private _scrollEventBinding;
|
|
33
|
-
scrollToVisible(direction: Direction): void;
|
|
34
34
|
private _scrollSubscribeBinding;
|
|
35
35
|
private _skeletonListener;
|
|
36
36
|
private _updateSceneSize;
|
|
@@ -18,6 +18,7 @@ import { IRenderManagerService } from '@univerjs/engine-render';
|
|
|
18
18
|
import { SelectionManagerService } from '@univerjs/sheets';
|
|
19
19
|
import { ISelectionRenderService } from '../services/selection/selection-render.service';
|
|
20
20
|
import { SheetSkeletonManagerService } from '../services/sheet-skeleton-manager.service';
|
|
21
|
+
import { ScrollController } from './scroll.controller';
|
|
21
22
|
export declare class SelectionController extends Disposable {
|
|
22
23
|
private readonly _sheetSkeletonManagerService;
|
|
23
24
|
private readonly _currentUniverService;
|
|
@@ -26,8 +27,10 @@ export declare class SelectionController extends Disposable {
|
|
|
26
27
|
private readonly _selectionRenderService;
|
|
27
28
|
private readonly _selectionManagerService;
|
|
28
29
|
private readonly _themeService;
|
|
29
|
-
|
|
30
|
+
private readonly _scrollController;
|
|
31
|
+
constructor(_sheetSkeletonManagerService: SheetSkeletonManagerService, _currentUniverService: IUniverInstanceService, _commandService: ICommandService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService, _selectionManagerService: SelectionManagerService, _themeService: ThemeService, _scrollController: ScrollController);
|
|
30
32
|
private _initialize;
|
|
33
|
+
private _getActiveViewport;
|
|
31
34
|
private _initViewMainListener;
|
|
32
35
|
private _initThemeChangeListener;
|
|
33
36
|
private _refreshSelection;
|
|
@@ -14,11 +14,30 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IContextService } from '@univerjs/core';
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function whenSheetFocused(contextService: IContextService): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Requires the currently focused unit to be Workbook and the sheet editor is focused but not activated.
|
|
20
|
+
* @param contextService
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare function whenSheetEditorFocused(contextService: IContextService): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Requires the currently focused unit to be Workbook and the sheet editor is activated.
|
|
26
|
+
* @param contextService
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare function whenSheetEditorActivated(contextService: IContextService): boolean;
|
|
18
30
|
export declare function whenEditorActivated(contextService: IContextService): boolean;
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Requires the currently focused editor is a formula editor.
|
|
33
|
+
* @param contextService
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
21
36
|
export declare function whenFormulaEditorFocused(contextService: IContextService): boolean;
|
|
22
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Requires the currently focused editor is a formula editor, and it is activated.
|
|
39
|
+
* @param contextService
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
export declare function whenFormulaEditorActivated(contextService: IContextService): boolean;
|
|
23
43
|
export declare function whenEditorDidNotInputFormulaActivated(contextService: IContextService): boolean;
|
|
24
|
-
export declare function whenEditorNotActivatedOrFormulaActivated(contextService: IContextService): boolean;
|
|
@@ -15,5 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IShortcutItem } from '@univerjs/ui';
|
|
17
17
|
export declare const ZoomInShortcutItem: IShortcutItem;
|
|
18
|
+
export declare const PreventDefaultZoomInShortcutItem: IShortcutItem;
|
|
18
19
|
export declare const ZoomOutShortcutItem: IShortcutItem;
|
|
20
|
+
export declare const PreventDefaultZoomOutShortcutItem: IShortcutItem;
|
|
19
21
|
export declare const ResetZoomShortcutItem: IShortcutItem;
|
|
22
|
+
export declare const PreventDefaultResetZoomShortcutItem: IShortcutItem;
|
|
@@ -13,18 +13,20 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
16
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
17
17
|
import { FormulaDataModel, IFunctionService } from '@univerjs/engine-formula';
|
|
18
|
-
import { SelectionManagerService } from '@univerjs/sheets';
|
|
18
|
+
import { INumfmtService, SelectionManagerService } from '@univerjs/sheets';
|
|
19
19
|
import { IStatusBarService } from '../services/status-bar.service';
|
|
20
20
|
export declare class StatusBarController extends Disposable {
|
|
21
21
|
private readonly _univerInstanceService;
|
|
22
22
|
private readonly _selectionManagerService;
|
|
23
23
|
private readonly _functionService;
|
|
24
24
|
private readonly _statusBarService;
|
|
25
|
+
private readonly _commandService;
|
|
25
26
|
private readonly _formulaDataModel;
|
|
27
|
+
private _numfmtService;
|
|
26
28
|
private _calculateTimeout;
|
|
27
|
-
constructor(_univerInstanceService: IUniverInstanceService, _selectionManagerService: SelectionManagerService, _functionService: IFunctionService, _statusBarService: IStatusBarService, _formulaDataModel: FormulaDataModel);
|
|
29
|
+
constructor(_univerInstanceService: IUniverInstanceService, _selectionManagerService: SelectionManagerService, _functionService: IFunctionService, _statusBarService: IStatusBarService, _commandService: ICommandService, _formulaDataModel: FormulaDataModel, _numfmtService: INumfmtService);
|
|
28
30
|
private _init;
|
|
29
31
|
private _registerSelectionListener;
|
|
30
32
|
private _calculateSelection;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -27,12 +27,12 @@ export { VIEWPORT_KEY } from './common/keys';
|
|
|
27
27
|
export { RangeSelector } from './components/range-selector/RangeSelector';
|
|
28
28
|
export { AutoFillController } from './controllers/auto-fill.controller';
|
|
29
29
|
export { PASTE_SPECIAL_MENU_ID } from './controllers/menu/menu';
|
|
30
|
-
export {
|
|
30
|
+
export { whenFormulaEditorActivated } from './controllers/shortcuts/utils';
|
|
31
31
|
export { getCoordByCell, getCoordByOffset, getSheetObject, getTransformCoord, } from './controllers/utils/component-tools';
|
|
32
32
|
export { enUS, zhCN } from './locale';
|
|
33
33
|
export { AutoFillService, IAutoFillService } from './services/auto-fill/auto-fill.service';
|
|
34
34
|
export { getAutoFillRepeatRange } from './services/auto-fill/tools';
|
|
35
|
-
export type {
|
|
35
|
+
export type { ICopyDataPiece, ISheetAutoFillHook } from './services/auto-fill/type';
|
|
36
36
|
export { APPLY_TYPE, DATA_TYPE, type IAutoFillRule } from './services/auto-fill/type';
|
|
37
37
|
export { type ICopyDataInTypeIndexInfo } from './services/auto-fill/type';
|
|
38
38
|
export { ISheetClipboardService, PREDEFINED_HOOK_NAME, SheetClipboardService, } from './services/clipboard/clipboard.service';
|
|
@@ -190,24 +190,6 @@ declare const _default: {
|
|
|
190
190
|
titleDateTime: string;
|
|
191
191
|
titleNumber: string;
|
|
192
192
|
};
|
|
193
|
-
fontFamily: {
|
|
194
|
-
TimesNewRoman: string;
|
|
195
|
-
Arial: string;
|
|
196
|
-
Tahoma: string;
|
|
197
|
-
Verdana: string;
|
|
198
|
-
MicrosoftYaHei: string;
|
|
199
|
-
SimSun: string;
|
|
200
|
-
SimHei: string;
|
|
201
|
-
Kaiti: string;
|
|
202
|
-
FangSong: string;
|
|
203
|
-
NSimSun: string;
|
|
204
|
-
STXinwei: string;
|
|
205
|
-
STXingkai: string;
|
|
206
|
-
STLiti: string;
|
|
207
|
-
HanaleiFill: string;
|
|
208
|
-
Anton: string;
|
|
209
|
-
Pacifico: string;
|
|
210
|
-
};
|
|
211
193
|
print: {
|
|
212
194
|
normalBtn: string;
|
|
213
195
|
layoutBtn: string;
|
|
@@ -283,6 +265,8 @@ declare const _default: {
|
|
|
283
265
|
title: string;
|
|
284
266
|
cancel: string;
|
|
285
267
|
confirm: string;
|
|
268
|
+
waring: string;
|
|
269
|
+
dismantleMergeCellWaring: string;
|
|
286
270
|
};
|
|
287
271
|
};
|
|
288
272
|
textWrap: {
|
|
@@ -418,6 +402,10 @@ declare const _default: {
|
|
|
418
402
|
freezeRow: string;
|
|
419
403
|
cancelFreeze: string;
|
|
420
404
|
zenEditor: string;
|
|
405
|
+
deleteAllRowsAlert: string;
|
|
406
|
+
deleteAllColumnsAlert: string;
|
|
407
|
+
hideAllRowsAlert: string;
|
|
408
|
+
hideAllColumnsAlert: string;
|
|
421
409
|
};
|
|
422
410
|
info: {
|
|
423
411
|
tooltip: string;
|
|
@@ -443,6 +431,7 @@ declare const _default: {
|
|
|
443
431
|
tipRowHeightLimit: string;
|
|
444
432
|
tipColumnWidthLimit: string;
|
|
445
433
|
pageInfoFull: string;
|
|
434
|
+
problem: string;
|
|
446
435
|
};
|
|
447
436
|
clipboard: {
|
|
448
437
|
paste: {
|
|
@@ -190,24 +190,6 @@ declare const _default: {
|
|
|
190
190
|
titleDateTime: string;
|
|
191
191
|
titleNumber: string;
|
|
192
192
|
};
|
|
193
|
-
fontFamily: {
|
|
194
|
-
TimesNewRoman: string;
|
|
195
|
-
Arial: string;
|
|
196
|
-
Tahoma: string;
|
|
197
|
-
Verdana: string;
|
|
198
|
-
MicrosoftYaHei: string;
|
|
199
|
-
SimSun: string;
|
|
200
|
-
SimHei: string;
|
|
201
|
-
Kaiti: string;
|
|
202
|
-
FangSong: string;
|
|
203
|
-
NSimSun: string;
|
|
204
|
-
STXinwei: string;
|
|
205
|
-
STXingkai: string;
|
|
206
|
-
STLiti: string;
|
|
207
|
-
HanaleiFill: string;
|
|
208
|
-
Anton: string;
|
|
209
|
-
Pacifico: string;
|
|
210
|
-
};
|
|
211
193
|
print: {
|
|
212
194
|
normalBtn: string;
|
|
213
195
|
layoutBtn: string;
|
|
@@ -275,6 +257,8 @@ declare const _default: {
|
|
|
275
257
|
title: string;
|
|
276
258
|
cancel: string;
|
|
277
259
|
confirm: string;
|
|
260
|
+
waring: string;
|
|
261
|
+
dismantleMergeCellWaring: string;
|
|
278
262
|
};
|
|
279
263
|
};
|
|
280
264
|
textWrap: {
|
|
@@ -410,6 +394,10 @@ declare const _default: {
|
|
|
410
394
|
freezeRow: string;
|
|
411
395
|
cancelFreeze: string;
|
|
412
396
|
zenEditor: string;
|
|
397
|
+
deleteAllRowsAlert: string;
|
|
398
|
+
deleteAllColumnsAlert: string;
|
|
399
|
+
hideAllRowsAlert: string;
|
|
400
|
+
hideAllColumnsAlert: string;
|
|
413
401
|
};
|
|
414
402
|
info: {
|
|
415
403
|
tooltip: string;
|
|
@@ -435,6 +423,7 @@ declare const _default: {
|
|
|
435
423
|
tipRowHeightLimit: string;
|
|
436
424
|
tipColumnWidthLimit: string;
|
|
437
425
|
pageInfoFull: string;
|
|
426
|
+
problem: string;
|
|
438
427
|
};
|
|
439
428
|
clipboard: {
|
|
440
429
|
paste: {
|
|
@@ -13,31 +13,31 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
17
|
-
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
16
|
+
import type { Nullable } from '@univerjs/core';
|
|
17
|
+
import { Direction, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
18
18
|
import { SelectionManagerService, SheetInterceptorService } from '@univerjs/sheets';
|
|
19
19
|
import type { IDisposable } from '@wendellhu/redi';
|
|
20
20
|
import type { Observable } from 'rxjs';
|
|
21
|
-
import type {
|
|
21
|
+
import type { IAutoFillLocation, IAutoFillRule, ISheetAutoFillHook } from './type';
|
|
22
22
|
import { APPLY_TYPE } from './type';
|
|
23
23
|
export interface IAutoFillService {
|
|
24
|
-
getRules(): IAutoFillRule[];
|
|
25
|
-
getApplyType(): APPLY_TYPE;
|
|
26
|
-
isFillingStyle(): boolean;
|
|
27
|
-
setApplyType(type: APPLY_TYPE): void;
|
|
28
|
-
setRanges(sourceRange: IRange, destRange: IRange, applyRange: IRange): void;
|
|
29
|
-
getRanges(): {
|
|
30
|
-
sourceRange: IRange | null;
|
|
31
|
-
destRange: IRange | null;
|
|
32
|
-
applyRange: IRange | null;
|
|
33
|
-
};
|
|
34
|
-
setFillingStyle(isFillingStyle: boolean): void;
|
|
35
24
|
applyType$: Observable<APPLY_TYPE>;
|
|
25
|
+
applyType: APPLY_TYPE;
|
|
26
|
+
direction: Direction;
|
|
36
27
|
menu$: Observable<IApplyMenuItem[]>;
|
|
28
|
+
menu: IApplyMenuItem[];
|
|
29
|
+
showMenu$: Observable<boolean>;
|
|
30
|
+
setShowMenu: (show: boolean) => void;
|
|
37
31
|
setDisableApplyType: (type: APPLY_TYPE, disable: boolean) => void;
|
|
32
|
+
getRules(): IAutoFillRule[];
|
|
33
|
+
isFillingStyle(): boolean;
|
|
34
|
+
autoFillLocation$: Observable<Nullable<IAutoFillLocation>>;
|
|
35
|
+
autoFillLocation: Nullable<IAutoFillLocation>;
|
|
36
|
+
setFillingStyle(isFillingStyle: boolean): void;
|
|
38
37
|
registerRule(rule: IAutoFillRule): void;
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
getAllHooks(): ISheetAutoFillHook[];
|
|
39
|
+
getActiveHooks(): ISheetAutoFillHook[];
|
|
40
|
+
addHook(hook: ISheetAutoFillHook): IDisposable;
|
|
41
41
|
}
|
|
42
42
|
export interface IApplyMenuItem {
|
|
43
43
|
label: string;
|
|
@@ -52,28 +52,32 @@ export declare class AutoFillService extends Disposable implements IAutoFillServ
|
|
|
52
52
|
private _hooks;
|
|
53
53
|
private readonly _applyType$;
|
|
54
54
|
private _isFillingStyle;
|
|
55
|
-
private
|
|
56
|
-
|
|
57
|
-
private
|
|
55
|
+
private readonly _autoFillLocation$;
|
|
56
|
+
readonly autoFillLocation$: Observable<Nullable<IAutoFillLocation>>;
|
|
57
|
+
private readonly _showMenu$;
|
|
58
|
+
readonly showMenu$: Observable<boolean>;
|
|
59
|
+
private _direction;
|
|
58
60
|
readonly applyType$: Observable<APPLY_TYPE>;
|
|
59
61
|
private readonly _menu$;
|
|
60
62
|
readonly menu$: Observable<IApplyMenuItem[]>;
|
|
61
63
|
constructor(_sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _selectionManagerService: SelectionManagerService);
|
|
62
64
|
private _init;
|
|
63
|
-
|
|
65
|
+
private getOneByPriority;
|
|
66
|
+
addHook(hook: ISheetAutoFillHook): IDisposable;
|
|
64
67
|
registerRule(rule: IAutoFillRule): void;
|
|
65
68
|
getRules(): IAutoFillRule[];
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
getAllHooks(): ISheetAutoFillHook[];
|
|
70
|
+
getActiveHooks(): ISheetAutoFillHook[];
|
|
71
|
+
get applyType(): APPLY_TYPE;
|
|
72
|
+
set applyType(type: APPLY_TYPE);
|
|
73
|
+
get menu(): IApplyMenuItem[];
|
|
74
|
+
get direction(): Direction;
|
|
75
|
+
set direction(direction: Direction);
|
|
69
76
|
isFillingStyle(): boolean;
|
|
70
77
|
setFillingStyle(isFillingStyle: boolean): void;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
sourceRange: IRange | null;
|
|
74
|
-
destRange: IRange | null;
|
|
75
|
-
applyRange: IRange | null;
|
|
76
|
-
};
|
|
78
|
+
get autoFillLocation(): Nullable<IAutoFillLocation>;
|
|
79
|
+
set autoFillLocation(location: Nullable<IAutoFillLocation>);
|
|
77
80
|
setDisableApplyType(type: APPLY_TYPE, disable: boolean): void;
|
|
81
|
+
setShowMenu(show: boolean): void;
|
|
78
82
|
}
|
|
79
83
|
export declare const IAutoFillService: import("@wendellhu/redi").IdentifierDecorator<AutoFillService>;
|
|
@@ -21,3 +21,4 @@ export declare const chnNumberRule: IAutoFillRule;
|
|
|
21
21
|
export declare const chnWeek2Rule: IAutoFillRule;
|
|
22
22
|
export declare const chnWeek3Rule: IAutoFillRule;
|
|
23
23
|
export declare const loopSeriesRule: IAutoFillRule;
|
|
24
|
+
export declare function reverseIfNeed<T>(data: T[], reverse: boolean): T[];
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { ICellData, IRange, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { ICellData, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core';
|
|
17
17
|
import { Direction } from '@univerjs/core';
|
|
18
18
|
export declare const chnNumChar: {
|
|
19
19
|
零: number;
|
|
@@ -83,14 +83,21 @@ export declare function getLenS(indexArr: any[], rsd: number): number;
|
|
|
83
83
|
*/
|
|
84
84
|
export declare function isEqualDiff(arr: number[]): boolean;
|
|
85
85
|
export declare function getDataIndex(csLen: number, asLen: number, indexArr: number[]): ICopyDataInTypeIndexInfo;
|
|
86
|
-
export declare function fillCopy(data: Array<Nullable<ICellData>>, len: number):
|
|
86
|
+
export declare function fillCopy(data: Array<Nullable<ICellData>>, len: number): {
|
|
87
|
+
p: import("@univerjs/core").IDocumentData | null;
|
|
88
|
+
s: string | import("@univerjs/core").IStyleData | null;
|
|
89
|
+
v: import("@univerjs/core").CellValue | null;
|
|
90
|
+
t: import("@univerjs/core").CellValueType | null;
|
|
91
|
+
f: string | null;
|
|
92
|
+
si: string | null;
|
|
93
|
+
}[];
|
|
87
94
|
export declare function fillCopyStyles(data: Array<Nullable<ICellData>>, len: number): {
|
|
88
95
|
s: Nullable<string | import("@univerjs/core").IStyleData>;
|
|
89
96
|
}[];
|
|
90
97
|
export declare function isEqualRatio(arr: number[]): boolean;
|
|
91
98
|
export declare function getXArr(len: number): number[];
|
|
92
99
|
export declare function fillSeries(data: Array<Nullable<ICellData>>, len: number, direction: Direction): ICellData[];
|
|
93
|
-
export declare function forecast(x: number, yArr: number[], xArr: number[]): number;
|
|
100
|
+
export declare function forecast(x: number, yArr: number[], xArr: number[], forward?: boolean): number;
|
|
94
101
|
export declare function fillExtendNumber(data: Array<Nullable<ICellData>>, len: number, step: number): ICellData[];
|
|
95
102
|
export declare function fillOnlyFormat(data: Array<Nullable<ICellData>>, len: number): ICellData[];
|
|
96
103
|
export declare function fillChnWeek(data: Array<Nullable<ICellData>>, len: number, step: number, weekType?: number): ICellData[];
|
|
@@ -108,3 +115,4 @@ export declare function getAutoFillRepeatRange(sourceRange: IRange, targetRange:
|
|
|
108
115
|
};
|
|
109
116
|
relativeRange: IRange;
|
|
110
117
|
}[];
|
|
118
|
+
export declare function generateNullCellValue(range: IRange[]): IObjectMatrixPrimitiveType<ICellData>;
|
|
@@ -14,6 +14,29 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Direction, ICellData, IMutationInfo, IRange, Nullable } from '@univerjs/core';
|
|
17
|
+
export declare enum AutoFillHookType {
|
|
18
|
+
Append = "APPEND",
|
|
19
|
+
Default = "DEFAULT",
|
|
20
|
+
Only = "ONLY"
|
|
21
|
+
}
|
|
22
|
+
export interface IAutoFillLocation {
|
|
23
|
+
source: IRange;
|
|
24
|
+
target: IRange;
|
|
25
|
+
unitId: string;
|
|
26
|
+
subUnitId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ISheetAutoFillHook {
|
|
29
|
+
id: string;
|
|
30
|
+
priority?: number;
|
|
31
|
+
type?: AutoFillHookType;
|
|
32
|
+
disable?: (location: IAutoFillLocation, direction: Direction, applyType: APPLY_TYPE) => boolean;
|
|
33
|
+
onBeforeFillData?(location: IAutoFillLocation, direction: Direction): boolean | void;
|
|
34
|
+
onFillData?(location: IAutoFillLocation, direction: Direction, applyType: APPLY_TYPE): {
|
|
35
|
+
undos: IMutationInfo[];
|
|
36
|
+
redos: IMutationInfo[];
|
|
37
|
+
};
|
|
38
|
+
onAfterFillData?(location: IAutoFillLocation, direction: Direction, applyType: APPLY_TYPE): boolean | void;
|
|
39
|
+
}
|
|
17
40
|
export declare enum DATA_TYPE {
|
|
18
41
|
NUMBER = "number",
|
|
19
42
|
DATE = "date",
|
|
@@ -44,15 +67,6 @@ export interface IMutations {
|
|
|
44
67
|
redos: IMutationInfo[];
|
|
45
68
|
undos: IMutationInfo[];
|
|
46
69
|
}
|
|
47
|
-
export interface IAutoFillHook {
|
|
48
|
-
hookName: string;
|
|
49
|
-
hook: {
|
|
50
|
-
[APPLY_TYPE.SERIES]: (sourceRange: IRange, targetRange: IRange) => IMutations;
|
|
51
|
-
[APPLY_TYPE.NO_FORMAT]: (sourceRange: IRange, targetRange: IRange) => IMutations;
|
|
52
|
-
[APPLY_TYPE.ONLY_FORMAT]: (sourceRange: IRange, targetRange: IRange) => IMutations;
|
|
53
|
-
[APPLY_TYPE.COPY]: (sourceRange: IRange, targetRange: IRange) => IMutations;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
70
|
export interface IRuleConfirmedData {
|
|
57
71
|
type?: string;
|
|
58
72
|
cellData: Nullable<ICellData>;
|
|
@@ -21,6 +21,7 @@ export declare class testMarkSelectionService {
|
|
|
21
21
|
removeShape(id: string): void;
|
|
22
22
|
removeAllShapes(): void;
|
|
23
23
|
refreshShapes(): void;
|
|
24
|
+
getShapeMap(): Map<string, any>;
|
|
24
25
|
}
|
|
25
26
|
export declare function clipboardTestBed(workbookConfig?: IWorkbookData, dependencies?: Dependency[]): {
|
|
26
27
|
univer: Univer;
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IRange, ObjectMatrix } from '@univerjs/core';
|
|
16
|
+
import type { IRange, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
17
17
|
import type { COPY_TYPE, ICellDataWithSpanInfo } from './type';
|
|
18
18
|
export interface ICopyContentCacheData {
|
|
19
19
|
subUnitId: string;
|
|
20
20
|
unitId: string;
|
|
21
21
|
range: IRange;
|
|
22
22
|
copyType: COPY_TYPE;
|
|
23
|
-
matrix: ObjectMatrix<ICellDataWithSpanInfo
|
|
23
|
+
matrix: Nullable<ObjectMatrix<ICellDataWithSpanInfo>>;
|
|
24
24
|
}
|
|
25
25
|
export declare function genId(): string;
|
|
26
26
|
export declare function extractId(html: string): string | null;
|
|
@@ -41,12 +41,15 @@ export interface IPasteTarget {
|
|
|
41
41
|
subUnitId: string;
|
|
42
42
|
unitId: string;
|
|
43
43
|
}
|
|
44
|
-
export interface
|
|
45
|
-
|
|
44
|
+
export interface ICopyPastePayload {
|
|
45
|
+
copyType?: COPY_TYPE;
|
|
46
|
+
copyId?: string;
|
|
47
|
+
pasteType: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ISheetRangeLocation {
|
|
50
|
+
range: IRange;
|
|
46
51
|
subUnitId: string;
|
|
47
52
|
unitId: string;
|
|
48
|
-
range: IRange;
|
|
49
|
-
copyType: COPY_TYPE;
|
|
50
53
|
}
|
|
51
54
|
export interface ISpecialPasteInfo {
|
|
52
55
|
label: string;
|
|
@@ -59,7 +62,7 @@ export interface ISpecialPasteInfo {
|
|
|
59
62
|
* 1. When pasting, get access to the clipboard content and append mutations to the paste command.
|
|
60
63
|
*/
|
|
61
64
|
export interface ISheetClipboardHook {
|
|
62
|
-
|
|
65
|
+
id: string;
|
|
63
66
|
isDefaultHook?: boolean;
|
|
64
67
|
specialPasteInfo?: ISpecialPasteInfo;
|
|
65
68
|
priority?: number;
|
|
@@ -104,26 +107,25 @@ export interface ISheetClipboardHook {
|
|
|
104
107
|
*
|
|
105
108
|
* @returns if it block copying it should return false
|
|
106
109
|
*/
|
|
107
|
-
onBeforePaste?(
|
|
110
|
+
onBeforePaste?(pasteTo: ISheetRangeLocation): boolean;
|
|
108
111
|
/**
|
|
109
112
|
*
|
|
110
113
|
* @param row
|
|
111
114
|
* @param col
|
|
112
115
|
*/
|
|
113
|
-
onPasteCells?(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}): {
|
|
116
|
+
onPasteCells?(pasteFrom: ISheetRangeLocation | null, pasteTo: ISheetRangeLocation, data: ObjectMatrix<ICellDataWithSpanInfo>, payload: ICopyPastePayload): {
|
|
117
|
+
undos: IMutationInfo[];
|
|
118
|
+
redos: IMutationInfo[];
|
|
119
|
+
};
|
|
120
|
+
onPasteRows?(pasteTo: ISheetRangeLocation, rowProperties: IClipboardPropertyItem[], payload: ICopyPastePayload): {
|
|
119
121
|
undos: IMutationInfo[];
|
|
120
122
|
redos: IMutationInfo[];
|
|
121
123
|
};
|
|
122
|
-
|
|
124
|
+
onPasteColumns?(pasteTo: ISheetRangeLocation, colProperties: IClipboardPropertyItem[], payload: ICopyPastePayload): {
|
|
123
125
|
undos: IMutationInfo[];
|
|
124
126
|
redos: IMutationInfo[];
|
|
125
127
|
};
|
|
126
|
-
|
|
128
|
+
onPastePlainText?(pasteTo: ISheetRangeLocation, text: string, payload: ICopyPastePayload): {
|
|
127
129
|
undos: IMutationInfo[];
|
|
128
130
|
redos: IMutationInfo[];
|
|
129
131
|
};
|