@univerjs/sheets-ui 0.12.4 → 0.13.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 +14 -14
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +6240 -6157
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/index.js +6240 -6157
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/controllers/menu/menu.d.ts +2 -0
- package/lib/types/index.d.ts +3 -3
- package/lib/types/locale/en-US.d.ts +1 -0
- package/lib/types/services/clipboard/clipboard.service.d.ts +19 -6
- package/lib/types/services/clipboard/type.d.ts +15 -6
- package/lib/umd/index.js +13 -13
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +13 -13
package/lib/locale/ca-ES.js
CHANGED
package/lib/locale/en-US.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
package/lib/locale/fa-IR.js
CHANGED
package/lib/locale/fr-FR.js
CHANGED
package/lib/locale/ja-JP.js
CHANGED
package/lib/locale/ko-KR.js
CHANGED
package/lib/locale/ru-RU.js
CHANGED
package/lib/locale/vi-VN.js
CHANGED
package/lib/locale/zh-CN.js
CHANGED
package/lib/locale/zh-TW.js
CHANGED
|
@@ -47,6 +47,8 @@ export declare function TextRotateMenuItemFactory(accessor: IAccessor): IMenuSel
|
|
|
47
47
|
export declare function CopyMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
48
48
|
export declare function CutMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
49
49
|
export declare function PasteMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
50
|
+
export declare const COPY_SPECIAL_MENU_ID = "sheet.menu.copy-special";
|
|
51
|
+
export declare function CopySpacialMenuItemFactory(accessor: IAccessor): IMenuSelectorItem;
|
|
50
52
|
export declare const PASTE_SPECIAL_MENU_ID = "sheet.menu.paste-special";
|
|
51
53
|
export declare function PasteSpacialMenuItemFactory(accessor: IAccessor): IMenuSelectorItem;
|
|
52
54
|
export declare function PasteValueMenuItemFactory(accessor: IAccessor): IMenuButtonItem<string>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export { EMBEDDING_FORMULA_EDITOR, isEmbeddingFormulaEditor } from './controller
|
|
|
64
64
|
export { isRangeSelector, RANGE_SELECTOR_SYMBOLS } from './controllers/editor/utils/is-range-selector';
|
|
65
65
|
export { HoverRenderController } from './controllers/hover-render.controller';
|
|
66
66
|
export { menuSchema as SheetsUIMenuSchema } from './controllers/menu.schema';
|
|
67
|
-
export { PASTE_SPECIAL_MENU_ID, SheetMenuPosition } from './controllers/menu/menu';
|
|
67
|
+
export { COPY_SPECIAL_MENU_ID, PASTE_SPECIAL_MENU_ID, SheetMenuPosition } from './controllers/menu/menu';
|
|
68
68
|
export { deriveStateFromActiveSheet$, getCurrentExclusiveRangeInterest$, getCurrentRangeDisable$, getObservableWithExclusiveRange$ } from './controllers/menu/menu-util';
|
|
69
69
|
export { SheetPermissionCheckUIController } from './controllers/permission/sheet-permission-check-ui.controller';
|
|
70
70
|
export { HeaderFreezeRenderController } from './controllers/render-controllers/freeze.render-controller';
|
|
@@ -90,9 +90,9 @@ export { type ICanvasPopup, SheetCanvasPopManagerService } from './services/canv
|
|
|
90
90
|
export { CellAlertManagerService, CellAlertType, type ICellAlert } from './services/cell-alert-manager.service';
|
|
91
91
|
export { type IDropdownParam, ISheetCellDropdownManagerService, SheetCellDropdownManagerService } from './services/cell-dropdown-manager.service';
|
|
92
92
|
export { CellPopupManagerService } from './services/cell-popup-manager.service';
|
|
93
|
-
export { getMatrixPlainText, ISheetClipboardService, PREDEFINED_HOOK_NAME, SheetClipboardService } from './services/clipboard/clipboard.service';
|
|
93
|
+
export { getMatrixPlainText, ISheetClipboardService, PREDEFINED_HOOK_NAME, PREDEFINED_HOOK_NAME_COPY, PREDEFINED_HOOK_NAME_PASTE, SheetClipboardService } from './services/clipboard/clipboard.service';
|
|
94
94
|
export { COPY_TYPE } from './services/clipboard/type';
|
|
95
|
-
export type { ICellDataWithSpanInfo, ICopyPastePayload, IPasteHookValueType, ISheetClipboardHook, ISheetDiscreteRangeLocation } from './services/clipboard/type';
|
|
95
|
+
export type { ICellDataWithSpanInfo, ICopyHookKeyType, ICopyHookValueType, ICopyPastePayload, IPasteHookKeyType, IPasteHookValueType, ISheetClipboardHook, ISheetDiscreteRangeLocation } from './services/clipboard/type';
|
|
96
96
|
export { getRepeatRange, mergeSetRangeValues } from './services/clipboard/utils';
|
|
97
97
|
export { DragManagerService, type IDragCellPosition } from './services/drag-manager.service';
|
|
98
98
|
export { EditorBridgeService, IEditorBridgeService, type IEditorBridgeServiceVisibleParam } from './services/editor-bridge.service';
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { ICellDataWithSpanAndDisplay, IDisposable, IRange, Nullable, Disposable, ErrorService, ICommandService, ILogService, Injector, IUndoRedoService, IUniverInstanceService, LocaleService, ObjectMatrix, ThemeService } from '@univerjs/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { IDiscreteRange } from '../../controllers/utils/range-tools';
|
|
4
|
-
import { IPasteHookKeyType, IPasteOptionCache, ISheetClipboardHook
|
|
4
|
+
import { ICopyOptions, IPasteHookKeyType, IPasteOptionCache, ISheetClipboardHook } from './type';
|
|
5
5
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
6
6
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
7
7
|
import { IClipboardInterfaceService, INotificationService, IPlatformService } from '@univerjs/ui';
|
|
8
8
|
import { IMarkSelectionService } from '../mark-selection/mark-selection.service';
|
|
9
9
|
import { CopyContentCache } from './copy-content-cache';
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const PREDEFINED_HOOK_NAME_COPY: {
|
|
11
11
|
readonly DEFAULT_COPY: "default-copy";
|
|
12
|
+
readonly SPECIAL_COPY_FORMULA_ONLY: "special-copy-formula-only";
|
|
13
|
+
};
|
|
14
|
+
export declare const PREDEFINED_HOOK_NAME_PASTE: {
|
|
12
15
|
readonly DEFAULT_PASTE: "default-paste";
|
|
13
16
|
readonly SPECIAL_PASTE_VALUE: "special-paste-value";
|
|
14
17
|
readonly SPECIAL_PASTE_FORMAT: "special-paste-format";
|
|
@@ -16,6 +19,16 @@ export declare const PREDEFINED_HOOK_NAME: {
|
|
|
16
19
|
readonly SPECIAL_PASTE_BESIDES_BORDER: "special-paste-besides-border";
|
|
17
20
|
readonly SPECIAL_PASTE_FORMULA: "special-paste-formula";
|
|
18
21
|
};
|
|
22
|
+
export declare const PREDEFINED_HOOK_NAME: {
|
|
23
|
+
readonly DEFAULT_PASTE: "default-paste";
|
|
24
|
+
readonly SPECIAL_PASTE_VALUE: "special-paste-value";
|
|
25
|
+
readonly SPECIAL_PASTE_FORMAT: "special-paste-format";
|
|
26
|
+
readonly SPECIAL_PASTE_COL_WIDTH: "special-paste-col-width";
|
|
27
|
+
readonly SPECIAL_PASTE_BESIDES_BORDER: "special-paste-besides-border";
|
|
28
|
+
readonly SPECIAL_PASTE_FORMULA: "special-paste-formula";
|
|
29
|
+
readonly DEFAULT_COPY: "default-copy";
|
|
30
|
+
readonly SPECIAL_COPY_FORMULA_ONLY: "special-copy-formula-only";
|
|
31
|
+
};
|
|
19
32
|
interface ICopyContent {
|
|
20
33
|
copyId: string;
|
|
21
34
|
plain: string;
|
|
@@ -30,13 +43,13 @@ export interface ISheetClipboardService {
|
|
|
30
43
|
pasteOptionsCache$: Observable<IPasteOptionCache | null>;
|
|
31
44
|
getPasteOptionsCache: () => IPasteOptionCache | null;
|
|
32
45
|
updatePasteOptionsCache(cache: IPasteOptionCache | null): void;
|
|
33
|
-
copy(): Promise<boolean>;
|
|
46
|
+
copy(options?: ICopyOptions): Promise<boolean>;
|
|
34
47
|
cut(): Promise<boolean>;
|
|
35
48
|
paste(item: ClipboardItem, pasteType?: string): Promise<boolean>;
|
|
36
49
|
legacyPaste(html?: string, text?: string, files?: File[]): Promise<boolean>;
|
|
37
50
|
rePasteWithPasteType(type: IPasteHookKeyType): boolean;
|
|
38
51
|
disposePasteOptionsCache(): void;
|
|
39
|
-
generateCopyContent(workbookId: string, worksheetId: string, range: IRange,
|
|
52
|
+
generateCopyContent(workbookId: string, worksheetId: string, range: IRange, options?: ICopyOptions): Nullable<ICopyContent>;
|
|
40
53
|
copyContentCache(): CopyContentCache;
|
|
41
54
|
addClipboardHook(hook: ISheetClipboardHook): IDisposable;
|
|
42
55
|
getClipboardHooks(): ISheetClipboardHook[];
|
|
@@ -74,8 +87,8 @@ export declare class SheetClipboardService extends Disposable implements ISheetC
|
|
|
74
87
|
getPasteMenuVisible(): boolean;
|
|
75
88
|
getPasteOptionsCache(): IPasteOptionCache | null;
|
|
76
89
|
copyContentCache(): CopyContentCache;
|
|
77
|
-
generateCopyContent(workbookId: string, worksheetId: string, range: IRange,
|
|
78
|
-
copy(
|
|
90
|
+
generateCopyContent(workbookId: string, worksheetId: string, range: IRange, options?: ICopyOptions): Nullable<ICopyContent>;
|
|
91
|
+
copy(options?: ICopyOptions): Promise<boolean>;
|
|
79
92
|
cut(): Promise<boolean>;
|
|
80
93
|
paste(item: ClipboardItem, pasteType?: "default-paste"): Promise<boolean>;
|
|
81
94
|
legacyPaste(html?: string, text?: string, files?: File[]): Promise<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ICellData, IDocumentData, IMutationInfo, IRange, ObjectMatrix } from '@univerjs/core';
|
|
1
|
+
import { ICellData, ICellDataWithSpanAndDisplay, IDocumentData, IMutationInfo, IRange, ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
import { IDiscreteRange } from '../../controllers/utils/range-tools';
|
|
3
|
-
import {
|
|
3
|
+
import { PREDEFINED_HOOK_NAME_COPY, PREDEFINED_HOOK_NAME_PASTE } from './clipboard.service';
|
|
4
4
|
export declare enum COPY_TYPE {
|
|
5
5
|
COPY = "COPY",
|
|
6
6
|
CUT = "CUT"
|
|
@@ -196,8 +196,18 @@ export interface ISheetClipboardHook {
|
|
|
196
196
|
* The callback would be called before the clipboard service decides what region need to be copied from or pasted to.
|
|
197
197
|
* It would jump over these filtered rows when copying or pasting.
|
|
198
198
|
*/
|
|
199
|
-
getFilteredOutRows?(range: IRange): number[];
|
|
199
|
+
getFilteredOutRows?(unitId: string, subUnitId: string, range: IRange): number[];
|
|
200
|
+
/**
|
|
201
|
+
* Handle matrix on each cell of copy operation.
|
|
202
|
+
*/
|
|
203
|
+
handleMatrixOnCell?(row: number, column: number, rowIndexInMatrix: number, columnIndexInMatrix: number, matrix: ObjectMatrix<ICellDataWithSpanAndDisplay>, matrixFragment: ObjectMatrix<ICellDataWithSpanInfo>, plainMatrix: ObjectMatrix<ICellDataWithSpanAndDisplay>): void;
|
|
204
|
+
}
|
|
205
|
+
export interface ICopyOptions {
|
|
206
|
+
copyType?: COPY_TYPE;
|
|
207
|
+
copyHookType?: ICopyHookValueType;
|
|
200
208
|
}
|
|
209
|
+
export type ICopyHookKeyType = keyof typeof PREDEFINED_HOOK_NAME_COPY;
|
|
210
|
+
export type ICopyHookValueType = typeof PREDEFINED_HOOK_NAME_COPY[ICopyHookKeyType];
|
|
201
211
|
export interface IPasteOptionCache {
|
|
202
212
|
target: IPasteTarget;
|
|
203
213
|
source?: IPasteSource;
|
|
@@ -210,6 +220,5 @@ export type IPasteSource = ISheetDiscreteRangeLocation & {
|
|
|
210
220
|
copyId: string;
|
|
211
221
|
copyType: COPY_TYPE;
|
|
212
222
|
};
|
|
213
|
-
export type IPasteHookKeyType =
|
|
214
|
-
export type
|
|
215
|
-
export type IPasteHookValueType = Exclude<IPasteHookValueTypeWithoutDefaultCopy, 'default-copy'>;
|
|
223
|
+
export type IPasteHookKeyType = keyof typeof PREDEFINED_HOOK_NAME_PASTE;
|
|
224
|
+
export type IPasteHookValueType = typeof PREDEFINED_HOOK_NAME_PASTE[IPasteHookKeyType];
|