@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.
Files changed (54) hide show
  1. package/lib/cjs/index.js +14 -14
  2. package/lib/cjs/locale/ca-ES.js +1 -1
  3. package/lib/cjs/locale/en-US.js +1 -1
  4. package/lib/cjs/locale/es-ES.js +1 -1
  5. package/lib/cjs/locale/fa-IR.js +1 -1
  6. package/lib/cjs/locale/fr-FR.js +1 -1
  7. package/lib/cjs/locale/ja-JP.js +1 -1
  8. package/lib/cjs/locale/ko-KR.js +1 -1
  9. package/lib/cjs/locale/ru-RU.js +1 -1
  10. package/lib/cjs/locale/vi-VN.js +1 -1
  11. package/lib/cjs/locale/zh-CN.js +1 -1
  12. package/lib/cjs/locale/zh-TW.js +1 -1
  13. package/lib/es/index.js +6240 -6157
  14. package/lib/es/locale/ca-ES.js +1 -0
  15. package/lib/es/locale/en-US.js +1 -0
  16. package/lib/es/locale/es-ES.js +1 -0
  17. package/lib/es/locale/fa-IR.js +1 -0
  18. package/lib/es/locale/fr-FR.js +1 -0
  19. package/lib/es/locale/ja-JP.js +1 -0
  20. package/lib/es/locale/ko-KR.js +1 -0
  21. package/lib/es/locale/ru-RU.js +1 -0
  22. package/lib/es/locale/vi-VN.js +1 -0
  23. package/lib/es/locale/zh-CN.js +1 -0
  24. package/lib/es/locale/zh-TW.js +1 -0
  25. package/lib/index.js +6240 -6157
  26. package/lib/locale/ca-ES.js +1 -0
  27. package/lib/locale/en-US.js +1 -0
  28. package/lib/locale/es-ES.js +1 -0
  29. package/lib/locale/fa-IR.js +1 -0
  30. package/lib/locale/fr-FR.js +1 -0
  31. package/lib/locale/ja-JP.js +1 -0
  32. package/lib/locale/ko-KR.js +1 -0
  33. package/lib/locale/ru-RU.js +1 -0
  34. package/lib/locale/vi-VN.js +1 -0
  35. package/lib/locale/zh-CN.js +1 -0
  36. package/lib/locale/zh-TW.js +1 -0
  37. package/lib/types/controllers/menu/menu.d.ts +2 -0
  38. package/lib/types/index.d.ts +3 -3
  39. package/lib/types/locale/en-US.d.ts +1 -0
  40. package/lib/types/services/clipboard/clipboard.service.d.ts +19 -6
  41. package/lib/types/services/clipboard/type.d.ts +15 -6
  42. package/lib/umd/index.js +13 -13
  43. package/lib/umd/locale/ca-ES.js +1 -1
  44. package/lib/umd/locale/en-US.js +1 -1
  45. package/lib/umd/locale/es-ES.js +1 -1
  46. package/lib/umd/locale/fa-IR.js +1 -1
  47. package/lib/umd/locale/fr-FR.js +1 -1
  48. package/lib/umd/locale/ja-JP.js +1 -1
  49. package/lib/umd/locale/ko-KR.js +1 -1
  50. package/lib/umd/locale/ru-RU.js +1 -1
  51. package/lib/umd/locale/vi-VN.js +1 -1
  52. package/lib/umd/locale/zh-CN.js +1 -1
  53. package/lib/umd/locale/zh-TW.js +1 -1
  54. package/package.json +13 -13
@@ -166,6 +166,7 @@ const e = {
166
166
  copy: "Copiar",
167
167
  cut: "Retallar",
168
168
  paste: "Enganxar",
169
+ copySpecial: "Còpia especial",
169
170
  pasteSpecial: "Enganxat especial",
170
171
  pasteValue: "Enganxar només els valors",
171
172
  pasteFormat: "Enganxar només el format",
@@ -166,6 +166,7 @@ const e = {
166
166
  copy: "Copy",
167
167
  cut: "Cut",
168
168
  paste: "Paste",
169
+ copySpecial: "Copy Special",
169
170
  pasteSpecial: "Paste Special",
170
171
  pasteValue: "Paste Value",
171
172
  pasteFormat: "Paste Format",
@@ -166,6 +166,7 @@ const e = {
166
166
  copy: "Copiar",
167
167
  cut: "Cortar",
168
168
  paste: "Pegar",
169
+ copySpecial: "Copiar especial",
169
170
  pasteSpecial: "Pegado especial",
170
171
  pasteValue: "Pegar solo valores",
171
172
  pasteFormat: "Pegar solo formato",
@@ -166,6 +166,7 @@ const e = {
166
166
  copy: "کپی",
167
167
  cut: "برش",
168
168
  paste: "چسباندن",
169
+ copySpecial: "کپی ویژه",
169
170
  pasteSpecial: "چسباندن ویژه",
170
171
  pasteValue: "چسباندن مقدار",
171
172
  pasteFormat: "چسباندن قالب",
@@ -166,6 +166,7 @@ const e = {
166
166
  copy: "Copier",
167
167
  cut: "Couper",
168
168
  paste: "Coller",
169
+ copySpecial: "Collage spécial",
169
170
  pasteSpecial: "Collage spécial",
170
171
  pasteValue: "Coller la valeur",
171
172
  pasteFormat: "Coller le format",
@@ -166,6 +166,7 @@ const e = {
166
166
  copy: "コピー",
167
167
  cut: "切り取り",
168
168
  paste: "貼り付け",
169
+ copySpecial: "選択的にコピー",
169
170
  pasteSpecial: "形式を選択して貼り付け",
170
171
  pasteValue: "値を貼り付け",
171
172
  pasteFormat: "書式を貼り付け",
@@ -166,6 +166,7 @@ const e = {
166
166
  copy: "복사",
167
167
  cut: "자르기",
168
168
  paste: "붙여넣기",
169
+ copySpecial: "선택하여 복사",
169
170
  pasteSpecial: "선택하여 붙여넣기",
170
171
  pasteValue: "값 붙여넣기",
171
172
  pasteFormat: "서식 붙여넣기",
@@ -166,6 +166,7 @@ const e = {
166
166
  copy: "Копировать",
167
167
  cut: "Вырезать",
168
168
  paste: "Вставить",
169
+ copySpecial: "Выборочная копия",
169
170
  pasteSpecial: "Специальная вставка",
170
171
  pasteValue: "Вставить значение",
171
172
  pasteFormat: "Вставить формат",
@@ -166,6 +166,7 @@ const n = {
166
166
  copy: "Sao chép",
167
167
  cut: "Cắt",
168
168
  paste: "Dán",
169
+ copySpecial: "Sao chép đặc biệt",
169
170
  pasteSpecial: "Dán đặc biệt",
170
171
  pasteValue: "Chỉ dán giá trị",
171
172
  pasteFormat: "Chỉ dán định dạng",
@@ -167,6 +167,7 @@ const e = {
167
167
  copy: "复制",
168
168
  cut: "剪切",
169
169
  paste: "粘贴",
170
+ copySpecial: "选择性复制",
170
171
  pasteSpecial: "选择性粘贴",
171
172
  pasteValue: "仅粘贴值",
172
173
  pasteFormat: "仅粘贴格式",
@@ -167,6 +167,7 @@ const e = {
167
167
  copy: "複製",
168
168
  cut: "剪下",
169
169
  paste: "貼上",
170
+ copySpecial: "選擇性複製",
170
171
  pasteSpecial: "選擇性貼上",
171
172
  pasteValue: "僅貼上值",
172
173
  pasteFormat: "僅貼上格式",
@@ -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>;
@@ -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';
@@ -181,6 +181,7 @@ declare const locale: {
181
181
  copy: string;
182
182
  cut: string;
183
183
  paste: string;
184
+ copySpecial: string;
184
185
  pasteSpecial: string;
185
186
  pasteValue: string;
186
187
  pasteFormat: string;
@@ -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, COPY_TYPE } from './type';
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 PREDEFINED_HOOK_NAME: {
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, copyType?: COPY_TYPE): Nullable<ICopyContent>;
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, copyType?: COPY_TYPE): Nullable<ICopyContent>;
78
- copy(copyType?: COPY_TYPE): Promise<boolean>;
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 { PREDEFINED_HOOK_NAME } from './clipboard.service';
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 = Exclude<keyof typeof PREDEFINED_HOOK_NAME, 'default-copy'>;
214
- export type IPasteHookValueTypeWithoutDefaultCopy = typeof PREDEFINED_HOOK_NAME[IPasteHookKeyType];
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];