ngx-image-cropper 7.0.2 → 7.1.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/README.md +8 -6
- package/esm2020/lib/component/image-cropper.component.mjs +35 -35
- package/esm2020/lib/interfaces/cropper.settings.mjs +2 -1
- package/esm2020/lib/services/crop.service.mjs +13 -15
- package/esm2020/lib/services/cropper-position.service.mjs +11 -12
- package/fesm2015/ngx-image-cropper.mjs +57 -59
- package/fesm2015/ngx-image-cropper.mjs.map +1 -1
- package/fesm2020/ngx-image-cropper.mjs +57 -59
- package/fesm2020/ngx-image-cropper.mjs.map +1 -1
- package/lib/component/image-cropper.component.d.ts +5 -3
- package/lib/interfaces/cropper.settings.d.ts +1 -0
- package/lib/services/crop.service.d.ts +3 -4
- package/lib/services/cropper-position.service.d.ts +1 -1
- package/package.json +2 -1
|
@@ -32,6 +32,7 @@ export declare class ImageCropperComponent implements OnChanges, OnInit {
|
|
|
32
32
|
imageBase64?: string;
|
|
33
33
|
imageFile?: File;
|
|
34
34
|
imageAltText?: string;
|
|
35
|
+
cropperFrameAriaLabel: string;
|
|
35
36
|
output: 'blob' | 'base64';
|
|
36
37
|
format: OutputFormat;
|
|
37
38
|
transform: ImageTransform;
|
|
@@ -90,8 +91,9 @@ export declare class ImageCropperComponent implements OnChanges, OnInit {
|
|
|
90
91
|
private changeKeyboardStepSize;
|
|
91
92
|
private keyboardMoveCropper;
|
|
92
93
|
startMove(event: any, moveType: MoveTypes, position?: string | null): void;
|
|
94
|
+
private initMouseMove;
|
|
93
95
|
startPinch(event: any): void;
|
|
94
|
-
|
|
96
|
+
private handleMouseMove;
|
|
95
97
|
onPinch(event: any): void;
|
|
96
98
|
private setMaxSize;
|
|
97
99
|
private setCropperScaledMinSize;
|
|
@@ -99,7 +101,7 @@ export declare class ImageCropperComponent implements OnChanges, OnInit {
|
|
|
99
101
|
private setCropperScaledMinHeight;
|
|
100
102
|
private setCropperScaledMaxSize;
|
|
101
103
|
private checkCropperPosition;
|
|
102
|
-
|
|
104
|
+
private handleMouseUp;
|
|
103
105
|
pinchStop(): void;
|
|
104
106
|
private doAutoCrop;
|
|
105
107
|
crop(): ImageCroppedEvent | null;
|
|
@@ -109,5 +111,5 @@ export declare class ImageCropperComponent implements OnChanges, OnInit {
|
|
|
109
111
|
private cropToBase64;
|
|
110
112
|
private aspectRatioIsCorrect;
|
|
111
113
|
static ɵfac: i0.ɵɵFactoryDeclaration<ImageCropperComponent, [null, null, null, null, null, { optional: true; }]>;
|
|
112
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ImageCropperComponent, "image-cropper", never, { "imageChangedEvent": "imageChangedEvent"; "imageURL": "imageURL"; "imageBase64": "imageBase64"; "imageFile": "imageFile"; "imageAltText": "imageAltText"; "output": "output"; "format": "format"; "transform": "transform"; "maintainAspectRatio": "maintainAspectRatio"; "aspectRatio": "aspectRatio"; "resetCropOnAspectRatioChange": "resetCropOnAspectRatioChange"; "resizeToWidth": "resizeToWidth"; "resizeToHeight": "resizeToHeight"; "cropperMinWidth": "cropperMinWidth"; "cropperMinHeight": "cropperMinHeight"; "cropperMaxHeight": "cropperMaxHeight"; "cropperMaxWidth": "cropperMaxWidth"; "cropperStaticWidth": "cropperStaticWidth"; "cropperStaticHeight": "cropperStaticHeight"; "canvasRotation": "canvasRotation"; "initialStepSize": "initialStepSize"; "roundCropper": "roundCropper"; "onlyScaleDown": "onlyScaleDown"; "imageQuality": "imageQuality"; "autoCrop": "autoCrop"; "backgroundColor": "backgroundColor"; "containWithinAspectRatio": "containWithinAspectRatio"; "hideResizeSquares": "hideResizeSquares"; "allowMoveImage": "allowMoveImage"; "cropper": "cropper"; "alignImage": "alignImage"; "disabled": "disabled"; "hidden": "hidden"; }, { "imageCropped": "imageCropped"; "startCropImage": "startCropImage"; "imageLoaded": "imageLoaded"; "cropperReady": "cropperReady"; "loadImageFailed": "loadImageFailed"; "transformChange": "transformChange"; }, never, never>;
|
|
114
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ImageCropperComponent, "image-cropper", never, { "imageChangedEvent": "imageChangedEvent"; "imageURL": "imageURL"; "imageBase64": "imageBase64"; "imageFile": "imageFile"; "imageAltText": "imageAltText"; "cropperFrameAriaLabel": "cropperFrameAriaLabel"; "output": "output"; "format": "format"; "transform": "transform"; "maintainAspectRatio": "maintainAspectRatio"; "aspectRatio": "aspectRatio"; "resetCropOnAspectRatioChange": "resetCropOnAspectRatioChange"; "resizeToWidth": "resizeToWidth"; "resizeToHeight": "resizeToHeight"; "cropperMinWidth": "cropperMinWidth"; "cropperMinHeight": "cropperMinHeight"; "cropperMaxHeight": "cropperMaxHeight"; "cropperMaxWidth": "cropperMaxWidth"; "cropperStaticWidth": "cropperStaticWidth"; "cropperStaticHeight": "cropperStaticHeight"; "canvasRotation": "canvasRotation"; "initialStepSize": "initialStepSize"; "roundCropper": "roundCropper"; "onlyScaleDown": "onlyScaleDown"; "imageQuality": "imageQuality"; "autoCrop": "autoCrop"; "backgroundColor": "backgroundColor"; "containWithinAspectRatio": "containWithinAspectRatio"; "hideResizeSquares": "hideResizeSquares"; "allowMoveImage": "allowMoveImage"; "cropper": "cropper"; "alignImage": "alignImage"; "disabled": "disabled"; "hidden": "hidden"; }, { "imageCropped": "imageCropped"; "startCropImage": "startCropImage"; "imageLoaded": "imageLoaded"; "cropperReady": "cropperReady"; "loadImageFailed": "loadImageFailed"; "transformChange": "transformChange"; }, never, never>;
|
|
113
115
|
}
|
|
@@ -26,6 +26,7 @@ export declare class CropperSettings {
|
|
|
26
26
|
containWithinAspectRatio: boolean;
|
|
27
27
|
hideResizeSquares: boolean;
|
|
28
28
|
alignImage: 'left' | 'center';
|
|
29
|
+
cropperFrameAriaLabel: string;
|
|
29
30
|
cropperScaledMinWidth: number;
|
|
30
31
|
cropperScaledMinHeight: number;
|
|
31
32
|
cropperScaledMaxWidth: number;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CropperPosition, ImageCroppedEvent, LoadedImage } from '../interfaces';
|
|
1
|
+
import { CropperPosition, Dimensions, ImageCroppedEvent, LoadedImage } from '../interfaces';
|
|
3
2
|
import { CropperSettings } from '../interfaces/cropper.settings';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class CropService {
|
|
6
|
-
crop(
|
|
7
|
-
crop(
|
|
5
|
+
crop(loadedImage: LoadedImage, cropper: CropperPosition, settings: CropperSettings, output: 'blob', maxSize: Dimensions): Promise<ImageCroppedEvent> | null;
|
|
6
|
+
crop(loadedImage: LoadedImage, cropper: CropperPosition, settings: CropperSettings, output: 'base64', maxSize: Dimensions): ImageCroppedEvent | null;
|
|
8
7
|
private cropToBlob;
|
|
9
8
|
private getCanvasTranslate;
|
|
10
9
|
private getRatio;
|
|
@@ -3,7 +3,7 @@ import { CropperPosition, Dimensions, MoveStart } from '../interfaces';
|
|
|
3
3
|
import { CropperSettings } from '../interfaces/cropper.settings';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class CropperPositionService {
|
|
6
|
-
resetCropperPosition(sourceImage: ElementRef, cropperPosition: CropperPosition, settings: CropperSettings): void;
|
|
6
|
+
resetCropperPosition(sourceImage: ElementRef, cropperPosition: CropperPosition, settings: CropperSettings, maxSize: Dimensions): void;
|
|
7
7
|
move(event: any, moveStart: MoveStart, cropperPosition: CropperPosition): void;
|
|
8
8
|
resize(event: any, moveStart: MoveStart, cropperPosition: CropperPosition, maxSize: Dimensions, settings: CropperSettings): void;
|
|
9
9
|
checkAspectRatio(position: string, cropperPosition: CropperPosition, maxSize: Dimensions, settings: CropperSettings): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-image-cropper",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "An image cropper for Angular",
|
|
5
5
|
"author": "Martijn Willekens",
|
|
6
6
|
"repository": {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"angular 13",
|
|
17
17
|
"angular 14",
|
|
18
18
|
"angular 15",
|
|
19
|
+
"angular 16",
|
|
19
20
|
"ionic",
|
|
20
21
|
"ionic-angular",
|
|
21
22
|
"cropper",
|