@univerjs-pro/sheets-print 0.2.4 → 0.2.6
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 +1 -1
- package/lib/es/index.js +1 -1
- package/lib/locale/en-US.json +5 -0
- package/lib/locale/ru-RU.json +5 -0
- package/lib/locale/vi-VN.json +5 -0
- package/lib/locale/zh-CN.json +5 -0
- package/lib/locale/zh-TW.json +5 -0
- package/lib/types/commands/operations/sheet-screenshot.operation.d.ts +4 -0
- package/lib/types/common/types.d.ts +4 -0
- package/lib/types/controllers/menu.d.ts +2 -1
- package/lib/types/controllers/sheet-print.controller.d.ts +5 -6
- package/lib/types/locale/zh-CN.d.ts +5 -0
- package/lib/types/plugin.d.ts +1 -2
- package/lib/types/services/sheet-print-manager.service.d.ts +12 -1
- package/lib/types/services/sheet-print.service.d.ts +17 -0
- package/lib/types/views/components/sheet-print-canvas-view.d.ts +15 -8
- package/lib/umd/index.js +1 -1
- package/package.json +21 -23
package/lib/locale/en-US.json
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"menu": "Print",
|
|
10
10
|
"title": "Print",
|
|
11
|
+
"screenshot": {
|
|
12
|
+
"title": "Copy as picture",
|
|
13
|
+
"success": "Picture successful saved to clipboard!",
|
|
14
|
+
"fail": "Picture failed save to clipboard!"
|
|
15
|
+
},
|
|
11
16
|
"size": {
|
|
12
17
|
"title": "Paper Size",
|
|
13
18
|
"letter": "Letter (8.5\" x11\")",
|
package/lib/locale/ru-RU.json
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"menu": "Print",
|
|
10
10
|
"title": "Print",
|
|
11
|
+
"screenshot": {
|
|
12
|
+
"title": "Copy as picture",
|
|
13
|
+
"success": "Picture successful saved to clipboard!",
|
|
14
|
+
"fail": "Picture failed save to clipboard!"
|
|
15
|
+
},
|
|
11
16
|
"size": {
|
|
12
17
|
"title": "Paper Size",
|
|
13
18
|
"letter": "Letter (8.5\" x11\")",
|
package/lib/locale/vi-VN.json
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"menu": "Print",
|
|
10
10
|
"title": "Print",
|
|
11
|
+
"screenshot": {
|
|
12
|
+
"title": "Copy as picture",
|
|
13
|
+
"success": "Picture successful saved to clipboard!",
|
|
14
|
+
"fail": "Picture failed save to clipboard!"
|
|
15
|
+
},
|
|
11
16
|
"size": {
|
|
12
17
|
"title": "Paper Size",
|
|
13
18
|
"letter": "Letter (8.5\" x11\")",
|
package/lib/locale/zh-CN.json
CHANGED
package/lib/locale/zh-TW.json
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"menu": "Print",
|
|
10
10
|
"title": "Print",
|
|
11
|
+
"screenshot": {
|
|
12
|
+
"title": "Copy as picture",
|
|
13
|
+
"success": "Picture successful saved to clipboard!",
|
|
14
|
+
"fail": "Picture failed save to clipboard!"
|
|
15
|
+
},
|
|
11
16
|
"size": {
|
|
12
17
|
"title": "Paper Size",
|
|
13
18
|
"letter": "Letter (8.5\" x11\")",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { IAccessor } from '@univerjs/core';
|
|
1
2
|
import { IMenuButtonItem } from '@univerjs/ui';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
3
3
|
|
|
4
4
|
export declare function PrintMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
5
|
+
export declare function ScreenshotMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
|
-
import { IGlobalZoneService } from '@univerjs/ui';
|
|
3
|
-
import { Injector } from '@wendellhu/redi';
|
|
2
|
+
import { ComponentManager, IGlobalZoneService } from '@univerjs/ui';
|
|
4
3
|
import { ISheetPrintManagerService } from '../services/sheet-print-manager.service';
|
|
5
|
-
import {
|
|
4
|
+
import { SheetPrintClientService } from '../services/sheet-print.service';
|
|
6
5
|
|
|
7
6
|
export declare class SheetPrintController extends Disposable {
|
|
8
7
|
private readonly _printService;
|
|
9
8
|
private readonly _commandService;
|
|
10
|
-
private readonly _injector;
|
|
11
9
|
private readonly _sheetPrintManagerService;
|
|
12
|
-
private readonly
|
|
13
|
-
|
|
10
|
+
private readonly _sheetPrintClientService;
|
|
11
|
+
private readonly _componentManager;
|
|
12
|
+
constructor(_printService: IGlobalZoneService, _commandService: ICommandService, _sheetPrintManagerService: ISheetPrintManagerService, _sheetPrintClientService: SheetPrintClientService, _componentManager: ComponentManager);
|
|
14
13
|
private _initialize;
|
|
15
14
|
private _initComponents;
|
|
16
15
|
private _initConfigChangeListener;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ICommandService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
1
|
+
import { ICommandService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
2
|
import { MenuConfig, ComponentManager, IMenuService, IShortcutService } from '@univerjs/ui';
|
|
3
|
-
import { Injector } from '@wendellhu/redi';
|
|
4
3
|
|
|
5
4
|
export interface IUniverSheetsPrintConfig {
|
|
6
5
|
menu: MenuConfig;
|
|
@@ -31,6 +31,11 @@ export interface ISheetPrintLayoutInfo {
|
|
|
31
31
|
scale: number;
|
|
32
32
|
unitId: string;
|
|
33
33
|
subUnitId: string;
|
|
34
|
+
margin: IPrintMargin;
|
|
35
|
+
pageSize: {
|
|
36
|
+
w: number;
|
|
37
|
+
h: number;
|
|
38
|
+
};
|
|
34
39
|
}
|
|
35
40
|
export interface ISheetPrintManagerService {
|
|
36
41
|
layoutConfig$: Observable<ISheetPrintLayoutConfig>;
|
|
@@ -49,7 +54,13 @@ export interface ISheetPrintManagerService {
|
|
|
49
54
|
reLayout: () => void;
|
|
50
55
|
reset: () => void;
|
|
51
56
|
}
|
|
52
|
-
export declare const ISheetPrintManagerService: import('@
|
|
57
|
+
export declare const ISheetPrintManagerService: import('@univerjs/core').IdentifierDecorator<ISheetPrintManagerService>;
|
|
58
|
+
export declare const DEFAULT_FREEZE: {
|
|
59
|
+
startColumn: number;
|
|
60
|
+
startRow: number;
|
|
61
|
+
xSplit: number;
|
|
62
|
+
ySplit: number;
|
|
63
|
+
};
|
|
53
64
|
export declare class SheetPrintManagerService implements ISheetPrintManagerService {
|
|
54
65
|
private readonly _univerInstanceService;
|
|
55
66
|
private readonly _sheetsSelectionsSrv;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Injector, IRange } from '@univerjs/core';
|
|
2
|
+
import { IGlobalZoneService } from '@univerjs/ui';
|
|
3
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
|
+
import { ISheetPrintRenderConfig } from '../common/types';
|
|
5
|
+
import { ISheetPrintLayoutInfo, ISheetPrintManagerService } from './sheet-print-manager.service';
|
|
6
|
+
import { SheetPrintLicenseService } from './sheet-print-license.service';
|
|
7
|
+
|
|
8
|
+
export declare class SheetPrintClientService {
|
|
9
|
+
private readonly _sheetPrintLicenseService;
|
|
10
|
+
private readonly _injector;
|
|
11
|
+
private readonly _globalZoneService;
|
|
12
|
+
private readonly _sheetPrintManagerService;
|
|
13
|
+
private readonly _renderManagerService;
|
|
14
|
+
constructor(_sheetPrintLicenseService: SheetPrintLicenseService, _injector: Injector, _globalZoneService: IGlobalZoneService, _sheetPrintManagerService: ISheetPrintManagerService, _renderManagerService: IRenderManagerService);
|
|
15
|
+
print(configs: ISheetPrintLayoutInfo[], renderConfig: ISheetPrintRenderConfig): Promise<boolean>;
|
|
16
|
+
getRangeImage(unitId: string, subUnitId: string, range: IRange): string | false;
|
|
17
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { IFreeze, IRange, Disposable } from '@univerjs/core';
|
|
1
|
+
import { IAccessor, IFreeze, IRange, Disposable } from '@univerjs/core';
|
|
2
2
|
import { Engine } from '@univerjs/engine-render';
|
|
3
|
-
import {
|
|
3
|
+
import { IPrintMargin } from '@univerjs-pro/print';
|
|
4
|
+
import { ISheetPrintRenderConfig } from '../../common/types';
|
|
4
5
|
|
|
5
6
|
export interface IPrintSheetPageInfo {
|
|
6
7
|
unitId: string;
|
|
@@ -9,10 +10,16 @@ export interface IPrintSheetPageInfo {
|
|
|
9
10
|
freeze: IFreeze;
|
|
10
11
|
scale: number;
|
|
11
12
|
page: number;
|
|
13
|
+
pageSize: {
|
|
14
|
+
w: number;
|
|
15
|
+
h: number;
|
|
16
|
+
};
|
|
17
|
+
margin: IPrintMargin;
|
|
12
18
|
}
|
|
13
19
|
export declare class SheetPrintCanvasView extends Disposable {
|
|
14
20
|
private _accessor;
|
|
15
21
|
private _config;
|
|
22
|
+
private _renderConfig;
|
|
16
23
|
private _isPreview;
|
|
17
24
|
private _previewScale;
|
|
18
25
|
private _engine;
|
|
@@ -26,7 +33,6 @@ export declare class SheetPrintCanvasView extends Disposable {
|
|
|
26
33
|
private _viewTop;
|
|
27
34
|
private _viewLeftTop;
|
|
28
35
|
private _container;
|
|
29
|
-
private _sheetPrintManagerService;
|
|
30
36
|
private _skeleton;
|
|
31
37
|
private _univerInstanceService;
|
|
32
38
|
private _dirty;
|
|
@@ -34,13 +40,13 @@ export declare class SheetPrintCanvasView extends Disposable {
|
|
|
34
40
|
get key(): string;
|
|
35
41
|
get engine(): Engine;
|
|
36
42
|
get container(): HTMLDivElement;
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
get renderConfig(): ISheetPrintRenderConfig;
|
|
44
|
+
set renderConfig(config: ISheetPrintRenderConfig);
|
|
39
45
|
private _spreadsheetObject;
|
|
40
|
-
constructor(_accessor: IAccessor, _config: IPrintSheetPageInfo, _isPreview?: boolean, _previewScale?: number);
|
|
46
|
+
constructor(_accessor: IAccessor, _config: IPrintSheetPageInfo, _renderConfig: ISheetPrintRenderConfig, _isPreview?: boolean, _previewScale?: number);
|
|
41
47
|
dispose(): void;
|
|
42
|
-
private get
|
|
43
|
-
private get
|
|
48
|
+
private get paperSize();
|
|
49
|
+
private get margin();
|
|
44
50
|
private _initRenderer;
|
|
45
51
|
setPreviewScale(previewScale: number): void;
|
|
46
52
|
updateConfig(config: IPrintSheetPageInfo): void;
|
|
@@ -57,4 +63,5 @@ export declare class SheetPrintCanvasView extends Disposable {
|
|
|
57
63
|
private _renderWaterMark;
|
|
58
64
|
render(): void;
|
|
59
65
|
renderOnReady(): void;
|
|
66
|
+
getImage(): string;
|
|
60
67
|
}
|