ngx-image-cropper 7.0.3 → 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/esm2020/lib/component/image-cropper.component.mjs +31 -34
- 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 +52 -58
- package/fesm2015/ngx-image-cropper.mjs.map +1 -1
- package/fesm2020/ngx-image-cropper.mjs +52 -58
- package/fesm2020/ngx-image-cropper.mjs.map +1 -1
- package/lib/component/image-cropper.component.d.ts +3 -2
- package/lib/services/crop.service.d.ts +3 -4
- package/lib/services/cropper-position.service.d.ts +1 -1
- package/package.json +2 -1
|
@@ -3,6 +3,7 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { Injectable, EventEmitter, isDevMode, Component, ChangeDetectionStrategy, Optional, Inject, ViewChild, Input, HostBinding, Output, HostListener, NgModule } from '@angular/core';
|
|
4
4
|
import * as i4 from '@angular/platform-browser';
|
|
5
5
|
import { HAMMER_LOADER } from '@angular/platform-browser';
|
|
6
|
+
import { merge, fromEvent, takeUntil, first } from 'rxjs';
|
|
6
7
|
import * as i5 from '@angular/common';
|
|
7
8
|
import { CommonModule } from '@angular/common';
|
|
8
9
|
|
|
@@ -188,8 +189,8 @@ function percentage(percent, totalValue) {
|
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
class CropService {
|
|
191
|
-
crop(
|
|
192
|
-
const imagePosition = this.getImagePosition(
|
|
192
|
+
crop(loadedImage, cropper, settings, output, maxSize) {
|
|
193
|
+
const imagePosition = this.getImagePosition(loadedImage, cropper, settings, maxSize);
|
|
193
194
|
const width = imagePosition.x2 - imagePosition.x1;
|
|
194
195
|
const height = imagePosition.y2 - imagePosition.y1;
|
|
195
196
|
const cropCanvas = document.createElement('canvas');
|
|
@@ -205,7 +206,7 @@ class CropService {
|
|
|
205
206
|
}
|
|
206
207
|
const scaleX = (settings.transform.scale || 1) * (settings.transform.flipH ? -1 : 1);
|
|
207
208
|
const scaleY = (settings.transform.scale || 1) * (settings.transform.flipV ? -1 : 1);
|
|
208
|
-
const { translateH, translateV } = this.getCanvasTranslate(
|
|
209
|
+
const { translateH, translateV } = this.getCanvasTranslate(loadedImage, settings, maxSize);
|
|
209
210
|
const transformedImage = loadedImage.transformed;
|
|
210
211
|
ctx.setTransform(scaleX, 0, 0, scaleY, transformedImage.size.width / 2 + translateH, transformedImage.size.height / 2 + translateV);
|
|
211
212
|
ctx.translate(-imagePosition.x1 / scaleX, -imagePosition.y1 / scaleY);
|
|
@@ -217,7 +218,7 @@ class CropService {
|
|
|
217
218
|
cropperPosition: Object.assign({}, cropper)
|
|
218
219
|
};
|
|
219
220
|
if (settings.containWithinAspectRatio) {
|
|
220
|
-
result.offsetImagePosition = this.getOffsetImagePosition(
|
|
221
|
+
result.offsetImagePosition = this.getOffsetImagePosition(loadedImage, cropper, settings, maxSize);
|
|
221
222
|
}
|
|
222
223
|
const resizeRatio = this.getResizeRatio(width, height, settings);
|
|
223
224
|
if (resizeRatio !== 1) {
|
|
@@ -244,9 +245,9 @@ class CropService {
|
|
|
244
245
|
return output;
|
|
245
246
|
});
|
|
246
247
|
}
|
|
247
|
-
getCanvasTranslate(
|
|
248
|
+
getCanvasTranslate(loadedImage, settings, maxSize) {
|
|
248
249
|
if (settings.transform.translateUnit === 'px') {
|
|
249
|
-
const ratio = this.getRatio(
|
|
250
|
+
const ratio = this.getRatio(loadedImage, maxSize);
|
|
250
251
|
return {
|
|
251
252
|
translateH: (settings.transform.translateH || 0) * ratio,
|
|
252
253
|
translateV: (settings.transform.translateV || 0) * ratio
|
|
@@ -259,12 +260,11 @@ class CropService {
|
|
|
259
260
|
};
|
|
260
261
|
}
|
|
261
262
|
}
|
|
262
|
-
getRatio(
|
|
263
|
-
|
|
264
|
-
return loadedImage.transformed.size.width / sourceImageElement.offsetWidth;
|
|
263
|
+
getRatio(loadedImage, maxSize) {
|
|
264
|
+
return loadedImage.transformed.size.width / maxSize.width;
|
|
265
265
|
}
|
|
266
|
-
getImagePosition(
|
|
267
|
-
const ratio = this.getRatio(
|
|
266
|
+
getImagePosition(loadedImage, cropper, settings, maxSize) {
|
|
267
|
+
const ratio = this.getRatio(loadedImage, maxSize);
|
|
268
268
|
const out = {
|
|
269
269
|
x1: Math.round(cropper.x1 * ratio),
|
|
270
270
|
y1: Math.round(cropper.y1 * ratio),
|
|
@@ -279,10 +279,9 @@ class CropService {
|
|
|
279
279
|
}
|
|
280
280
|
return out;
|
|
281
281
|
}
|
|
282
|
-
getOffsetImagePosition(
|
|
282
|
+
getOffsetImagePosition(loadedImage, cropper, settings, maxSize) {
|
|
283
283
|
const canvasRotation = settings.canvasRotation + loadedImage.exifTransform.rotate;
|
|
284
|
-
const
|
|
285
|
-
const ratio = loadedImage.transformed.size.width / sourceImageElement.offsetWidth;
|
|
284
|
+
const ratio = this.getRatio(loadedImage, maxSize);
|
|
286
285
|
let offsetX;
|
|
287
286
|
let offsetY;
|
|
288
287
|
if (canvasRotation % 2) {
|
|
@@ -335,40 +334,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
335
334
|
}] });
|
|
336
335
|
|
|
337
336
|
class CropperPositionService {
|
|
338
|
-
resetCropperPosition(sourceImage, cropperPosition, settings) {
|
|
337
|
+
resetCropperPosition(sourceImage, cropperPosition, settings, maxSize) {
|
|
339
338
|
if (!(sourceImage === null || sourceImage === void 0 ? void 0 : sourceImage.nativeElement)) {
|
|
340
339
|
return;
|
|
341
340
|
}
|
|
342
|
-
const sourceImageElement = sourceImage.nativeElement;
|
|
343
341
|
if (settings.cropperStaticHeight && settings.cropperStaticWidth) {
|
|
344
342
|
cropperPosition.x1 = 0;
|
|
345
|
-
cropperPosition.x2 =
|
|
346
|
-
settings.cropperStaticWidth :
|
|
343
|
+
cropperPosition.x2 = maxSize.width > settings.cropperStaticWidth ?
|
|
344
|
+
settings.cropperStaticWidth : maxSize.width;
|
|
347
345
|
cropperPosition.y1 = 0;
|
|
348
|
-
cropperPosition.y2 =
|
|
349
|
-
settings.cropperStaticHeight :
|
|
346
|
+
cropperPosition.y2 = maxSize.height > settings.cropperStaticHeight ?
|
|
347
|
+
settings.cropperStaticHeight : maxSize.height;
|
|
350
348
|
}
|
|
351
349
|
else {
|
|
352
|
-
const cropperWidth = Math.min(settings.cropperScaledMaxWidth,
|
|
353
|
-
const cropperHeight = Math.min(settings.cropperScaledMaxHeight,
|
|
350
|
+
const cropperWidth = Math.min(settings.cropperScaledMaxWidth, maxSize.width);
|
|
351
|
+
const cropperHeight = Math.min(settings.cropperScaledMaxHeight, maxSize.height);
|
|
354
352
|
if (!settings.maintainAspectRatio) {
|
|
355
353
|
cropperPosition.x1 = 0;
|
|
356
354
|
cropperPosition.x2 = cropperWidth;
|
|
357
355
|
cropperPosition.y1 = 0;
|
|
358
356
|
cropperPosition.y2 = cropperHeight;
|
|
359
357
|
}
|
|
360
|
-
else if (
|
|
358
|
+
else if (maxSize.width / settings.aspectRatio < maxSize.height) {
|
|
361
359
|
cropperPosition.x1 = 0;
|
|
362
360
|
cropperPosition.x2 = cropperWidth;
|
|
363
361
|
const cropperHeightWithAspectRatio = cropperWidth / settings.aspectRatio;
|
|
364
|
-
cropperPosition.y1 = (
|
|
362
|
+
cropperPosition.y1 = (maxSize.height - cropperHeightWithAspectRatio) / 2;
|
|
365
363
|
cropperPosition.y2 = cropperPosition.y1 + cropperHeightWithAspectRatio;
|
|
366
364
|
}
|
|
367
365
|
else {
|
|
368
366
|
cropperPosition.y1 = 0;
|
|
369
367
|
cropperPosition.y2 = cropperHeight;
|
|
370
368
|
const cropperWidthWithAspectRatio = cropperHeight * settings.aspectRatio;
|
|
371
|
-
cropperPosition.x1 = (
|
|
369
|
+
cropperPosition.x1 = (maxSize.width - cropperWidthWithAspectRatio) / 2;
|
|
372
370
|
cropperPosition.x2 = cropperPosition.x1 + cropperWidthWithAspectRatio;
|
|
373
371
|
}
|
|
374
372
|
}
|
|
@@ -1019,8 +1017,9 @@ class ImageCropperComponent {
|
|
|
1019
1017
|
this.resizedWhileHidden = true;
|
|
1020
1018
|
}
|
|
1021
1019
|
else {
|
|
1022
|
-
this.
|
|
1020
|
+
const oldMaxSize = Object.assign({}, this.maxSize);
|
|
1023
1021
|
this.setMaxSize();
|
|
1022
|
+
this.resizeCropperPosition(oldMaxSize);
|
|
1024
1023
|
this.setCropperScaledMinSize();
|
|
1025
1024
|
this.setCropperScaledMaxSize();
|
|
1026
1025
|
}
|
|
@@ -1043,17 +1042,16 @@ class ImageCropperComponent {
|
|
|
1043
1042
|
}
|
|
1044
1043
|
});
|
|
1045
1044
|
}
|
|
1046
|
-
resizeCropperPosition() {
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
this.cropper.
|
|
1050
|
-
this.cropper.
|
|
1051
|
-
this.cropper.
|
|
1052
|
-
this.cropper.y2 = this.cropper.y2 * sourceImageElement.offsetHeight / this.maxSize.height;
|
|
1045
|
+
resizeCropperPosition(oldMaxSize) {
|
|
1046
|
+
if (oldMaxSize.width !== this.maxSize.width || oldMaxSize.height !== this.maxSize.height) {
|
|
1047
|
+
this.cropper.x1 = this.cropper.x1 * this.maxSize.width / oldMaxSize.width;
|
|
1048
|
+
this.cropper.x2 = this.cropper.x2 * this.maxSize.width / oldMaxSize.width;
|
|
1049
|
+
this.cropper.y1 = this.cropper.y1 * this.maxSize.height / oldMaxSize.height;
|
|
1050
|
+
this.cropper.y2 = this.cropper.y2 * this.maxSize.height / oldMaxSize.height;
|
|
1053
1051
|
}
|
|
1054
1052
|
}
|
|
1055
1053
|
resetCropperPosition() {
|
|
1056
|
-
this.cropperPositionService.resetCropperPosition(this.sourceImage, this.cropper, this.settings);
|
|
1054
|
+
this.cropperPositionService.resetCropperPosition(this.sourceImage, this.cropper, this.settings, this.maxSize);
|
|
1057
1055
|
this.doAutoCrop();
|
|
1058
1056
|
this.imageVisible = true;
|
|
1059
1057
|
}
|
|
@@ -1078,8 +1076,8 @@ class ImageCropperComponent {
|
|
|
1078
1076
|
event.preventDefault();
|
|
1079
1077
|
event.stopPropagation();
|
|
1080
1078
|
this.startMove({ clientX: 0, clientY: 0 }, moveType, position);
|
|
1081
|
-
this.
|
|
1082
|
-
this.
|
|
1079
|
+
this.handleMouseMove(moveEvent);
|
|
1080
|
+
this.handleMouseUp();
|
|
1083
1081
|
}
|
|
1084
1082
|
startMove(event, moveType, position = null) {
|
|
1085
1083
|
var _a, _b;
|
|
@@ -1092,6 +1090,14 @@ class ImageCropperComponent {
|
|
|
1092
1090
|
event.preventDefault();
|
|
1093
1091
|
}
|
|
1094
1092
|
this.moveStart = Object.assign({ active: true, type: moveType, position, transform: Object.assign({}, this.transform), clientX: this.cropperPositionService.getClientX(event), clientY: this.cropperPositionService.getClientY(event) }, this.cropper);
|
|
1093
|
+
this.initMouseMove();
|
|
1094
|
+
}
|
|
1095
|
+
initMouseMove() {
|
|
1096
|
+
merge(fromEvent(document, 'mousemove'), fromEvent(document, 'touchmove')).pipe(takeUntil(merge(fromEvent(document, 'mouseup'), fromEvent(document, 'touchend')).pipe(first())))
|
|
1097
|
+
.subscribe({
|
|
1098
|
+
next: (event) => this.handleMouseMove(event),
|
|
1099
|
+
complete: () => this.handleMouseUp()
|
|
1100
|
+
});
|
|
1095
1101
|
}
|
|
1096
1102
|
startPinch(event) {
|
|
1097
1103
|
if (!this.safeImgDataUrl) {
|
|
@@ -1102,7 +1108,7 @@ class ImageCropperComponent {
|
|
|
1102
1108
|
}
|
|
1103
1109
|
this.moveStart = Object.assign({ active: true, type: MoveTypes.Pinch, position: 'center', clientX: this.cropper.x1 + (this.cropper.x2 - this.cropper.x1) / 2, clientY: this.cropper.y1 + (this.cropper.y2 - this.cropper.y1) / 2 }, this.cropper);
|
|
1104
1110
|
}
|
|
1105
|
-
|
|
1111
|
+
handleMouseMove(event) {
|
|
1106
1112
|
var _a, _b;
|
|
1107
1113
|
if (this.moveStart.active) {
|
|
1108
1114
|
if (event.stopPropagation) {
|
|
@@ -1127,7 +1133,7 @@ class ImageCropperComponent {
|
|
|
1127
1133
|
this.transform = Object.assign(Object.assign({}, this.transform), { translateH: (((_a = this.moveStart.transform) === null || _a === void 0 ? void 0 : _a.translateH) || 0) + diffX, translateV: (((_b = this.moveStart.transform) === null || _b === void 0 ? void 0 : _b.translateV) || 0) + diffY });
|
|
1128
1134
|
this.setCssTransform();
|
|
1129
1135
|
}
|
|
1130
|
-
this.cd.
|
|
1136
|
+
this.cd.markForCheck();
|
|
1131
1137
|
}
|
|
1132
1138
|
}
|
|
1133
1139
|
onPinch(event) {
|
|
@@ -1142,14 +1148,14 @@ class ImageCropperComponent {
|
|
|
1142
1148
|
this.cropperPositionService.resize(event, this.moveStart, this.cropper, this.maxSize, this.settings);
|
|
1143
1149
|
this.checkCropperPosition(false);
|
|
1144
1150
|
}
|
|
1145
|
-
this.cd.
|
|
1151
|
+
this.cd.markForCheck();
|
|
1146
1152
|
}
|
|
1147
1153
|
}
|
|
1148
1154
|
setMaxSize() {
|
|
1149
1155
|
if (this.sourceImage) {
|
|
1150
|
-
const
|
|
1151
|
-
this.maxSize.width =
|
|
1152
|
-
this.maxSize.height =
|
|
1156
|
+
const sourceImageStyle = getComputedStyle(this.sourceImage.nativeElement);
|
|
1157
|
+
this.maxSize.width = parseFloat(sourceImageStyle.width);
|
|
1158
|
+
this.maxSize.height = parseFloat(sourceImageStyle.height);
|
|
1153
1159
|
this.marginLeft = this.sanitizer.bypassSecurityTrustStyle('calc(50% - ' + this.maxSize.width / 2 + 'px)');
|
|
1154
1160
|
}
|
|
1155
1161
|
}
|
|
@@ -1218,7 +1224,7 @@ class ImageCropperComponent {
|
|
|
1218
1224
|
this.cropper.y2 = this.maxSize.height;
|
|
1219
1225
|
}
|
|
1220
1226
|
}
|
|
1221
|
-
|
|
1227
|
+
handleMouseUp() {
|
|
1222
1228
|
var _a;
|
|
1223
1229
|
if (this.moveStart.active) {
|
|
1224
1230
|
this.moveStart.active = false;
|
|
@@ -1255,7 +1261,7 @@ class ImageCropperComponent {
|
|
|
1255
1261
|
return null;
|
|
1256
1262
|
}
|
|
1257
1263
|
cropToBlob() {
|
|
1258
|
-
const result = this.cropService.crop(this.
|
|
1264
|
+
const result = this.cropService.crop(this.loadedImage, this.cropper, this.settings, 'blob', this.maxSize);
|
|
1259
1265
|
if (result) {
|
|
1260
1266
|
return Promise.resolve(result)
|
|
1261
1267
|
.then((output) => {
|
|
@@ -1266,7 +1272,7 @@ class ImageCropperComponent {
|
|
|
1266
1272
|
return null;
|
|
1267
1273
|
}
|
|
1268
1274
|
cropToBase64() {
|
|
1269
|
-
const result = this.cropService.crop(this.
|
|
1275
|
+
const result = this.cropService.crop(this.loadedImage, this.cropper, this.settings, 'base64', this.maxSize);
|
|
1270
1276
|
if (result) {
|
|
1271
1277
|
this.imageCropped.emit(result);
|
|
1272
1278
|
return result;
|
|
@@ -1279,7 +1285,7 @@ class ImageCropperComponent {
|
|
|
1279
1285
|
}
|
|
1280
1286
|
}
|
|
1281
1287
|
ImageCropperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImageCropperComponent, deps: [{ token: CropService }, { token: CropperPositionService }, { token: LoadImageService }, { token: i4.DomSanitizer }, { token: i0.ChangeDetectorRef }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1282
|
-
ImageCropperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ImageCropperComponent, selector: "image-cropper", inputs: { 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" }, outputs: { imageCropped: "imageCropped", startCropImage: "startCropImage", imageLoaded: "imageLoaded", cropperReady: "cropperReady", loadImageFailed: "loadImageFailed", transformChange: "transformChange" }, host: { listeners: { "window:resize": "onResize()", "document:mousemove": "moveImg($event)", "document:touchmove": "moveImg($event)", "document:mouseup": "moveStop()", "document:touchend": "moveStop()" }, properties: { "style.text-align": "this.alignImage", "class.disabled": "this.disabled", "class.ngx-ix-hidden": "this.hidden" } }, viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true, static: true }, { propertyName: "sourceImage", first: true, predicate: ["sourceImage"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n [style.background]=\"imageVisible && backgroundColor\"\n #wrapper\n>\n <img\n #sourceImage\n class=\"ngx-ic-source-image\"\n role=\"presentation\"\n *ngIf=\"safeImgDataUrl\"\n [src]=\"safeImgDataUrl\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n [style.transform]=\"safeTransformStyle\"\n [class.ngx-ic-draggable]=\"!disabled && allowMoveImage\"\n [attr.alt]=\"imageAltText\"\n (load)=\"imageLoadedInView()\"\n (mousedown)=\"startMove($event, moveTypes.Drag)\"\n (touchstart)=\"startMove($event, moveTypes.Drag)\"\n (error)=\"loadImageError($event)\"\n >\n <div\n class=\"ngx-ic-overlay\"\n [style.width.px]=\"maxSize.width\"\n [style.height.px]=\"maxSize.height\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n ></div>\n <div class=\"ngx-ic-cropper\"\n *ngIf=\"imageVisible\"\n [class.ngx-ic-round]=\"roundCropper\"\n [attr.aria-label]=\"cropperFrameAriaLabel\"\n [style.top.px]=\"cropper.y1\"\n [style.left.px]=\"cropper.x1\"\n [style.width.px]=\"cropper.x2 - cropper.x1\"\n [style.height.px]=\"cropper.y2 - cropper.y1\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n (keydown)=\"keyboardAccess($event)\"\n tabindex=\"0\"\n >\n <div\n (mousedown)=\"startMove($event, moveTypes.Move)\"\n (touchstart)=\"startMove($event, moveTypes.Move)\"\n class=\"ngx-ic-move\"\n role=\"presentation\">\n </div>\n <ng-container *ngIf=\"!hideResizeSquares\">\n <span class=\"ngx-ic-resize ngx-ic-topleft\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'topleft')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'topleft')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-top\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-topright\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'topright')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'topright')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-right\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottomright\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottomright')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottomright')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottom\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottomleft\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottomleft')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottomleft')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-left\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-top\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'top')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'top')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-right\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'right')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'right')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-bottom\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottom')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottom')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-left\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'left')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'left')\">\n </span>\n </ng-container>\n </div>\n</div>\n", styles: [":host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center}:host>div{width:100%;position:relative}:host>div img.ngx-ic-source-image{max-width:100%;max-height:100%;transform-origin:center}:host>div img.ngx-ic-source-image.ngx-ic-draggable{user-drag:none;-webkit-user-drag:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;cursor:grab}:host .ngx-ic-overlay{position:absolute;pointer-events:none;touch-action:none;outline:var(--cropper-overlay-color, white) solid 100vw;top:0;left:0}:host .ngx-ic-cropper{position:absolute;display:flex;color:#53535c;background:transparent;outline:rgba(255,255,255,.3) solid 100vw;outline:var(--cropper-outline-color, rgba(255, 255, 255, .3)) solid 100vw;touch-action:none}@media (orientation: portrait){:host .ngx-ic-cropper{outline-width:100vh}}:host .ngx-ic-cropper:after{position:absolute;content:\"\";inset:0;pointer-events:none;border:dashed 1px;opacity:.75;color:inherit;z-index:1}:host .ngx-ic-cropper .ngx-ic-move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .ngx-ic-cropper:focus .ngx-ic-move{border-color:#1e90ff;border-width:2px}:host .ngx-ic-cropper .ngx-ic-resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .ngx-ic-cropper .ngx-ic-resize .ngx-ic-square{display:inline-block;background:#53535C;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-topright{top:-12px;right:-12px;cursor:nesw-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar{position:absolute;z-index:1}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .ngx-ic-cropper.ngx-ic-round{outline-color:transparent}:host .ngx-ic-cropper.ngx-ic-round:after{border-radius:100%;box-shadow:0 0 0 100vw #ffffff4d;box-shadow:0 0 0 100vw var(--cropper-outline-color, rgba(255, 255, 255, .3))}@media (orientation: portrait){:host .ngx-ic-cropper.ngx-ic-round:after{box-shadow:0 0 0 100vh #ffffff4d;box-shadow:0 0 0 100vh var(--cropper-outline-color, rgba(255, 255, 255, .3))}}:host .ngx-ic-cropper.ngx-ic-round .ngx-ic-move{border-radius:100%}:host.disabled .ngx-ic-cropper .ngx-ic-resize,:host.disabled .ngx-ic-cropper .ngx-ic-resize-bar,:host.disabled .ngx-ic-cropper .ngx-ic-move{display:none}:host.ngx-ix-hidden{display:none}\n"], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1288
|
+
ImageCropperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ImageCropperComponent, selector: "image-cropper", inputs: { 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" }, outputs: { imageCropped: "imageCropped", startCropImage: "startCropImage", imageLoaded: "imageLoaded", cropperReady: "cropperReady", loadImageFailed: "loadImageFailed", transformChange: "transformChange" }, host: { listeners: { "window:resize": "onResize()" }, properties: { "style.text-align": "this.alignImage", "class.disabled": "this.disabled", "class.ngx-ix-hidden": "this.hidden" } }, viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true, static: true }, { propertyName: "sourceImage", first: true, predicate: ["sourceImage"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n [style.background]=\"imageVisible && backgroundColor\"\n #wrapper\n>\n <img\n #sourceImage\n class=\"ngx-ic-source-image\"\n role=\"presentation\"\n *ngIf=\"safeImgDataUrl\"\n [src]=\"safeImgDataUrl\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n [style.transform]=\"safeTransformStyle\"\n [class.ngx-ic-draggable]=\"!disabled && allowMoveImage\"\n [attr.alt]=\"imageAltText\"\n (load)=\"imageLoadedInView()\"\n (mousedown)=\"startMove($event, moveTypes.Drag)\"\n (touchstart)=\"startMove($event, moveTypes.Drag)\"\n (error)=\"loadImageError($event)\"\n >\n <div\n class=\"ngx-ic-overlay\"\n [style.width.px]=\"maxSize.width\"\n [style.height.px]=\"maxSize.height\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n ></div>\n <div class=\"ngx-ic-cropper\"\n *ngIf=\"imageVisible\"\n [class.ngx-ic-round]=\"roundCropper\"\n [attr.aria-label]=\"cropperFrameAriaLabel\"\n [style.top.px]=\"cropper.y1\"\n [style.left.px]=\"cropper.x1\"\n [style.width.px]=\"cropper.x2 - cropper.x1\"\n [style.height.px]=\"cropper.y2 - cropper.y1\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n (keydown)=\"keyboardAccess($event)\"\n tabindex=\"0\"\n >\n <div\n (mousedown)=\"startMove($event, moveTypes.Move)\"\n (touchstart)=\"startMove($event, moveTypes.Move)\"\n class=\"ngx-ic-move\"\n role=\"presentation\">\n </div>\n <ng-container *ngIf=\"!hideResizeSquares\">\n <span class=\"ngx-ic-resize ngx-ic-topleft\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'topleft')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'topleft')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-top\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-topright\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'topright')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'topright')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-right\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottomright\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottomright')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottomright')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottom\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottomleft\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottomleft')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottomleft')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-left\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-top\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'top')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'top')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-right\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'right')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'right')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-bottom\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottom')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottom')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-left\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'left')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'left')\">\n </span>\n </ng-container>\n </div>\n</div>\n", styles: [":host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center}:host>div{width:100%;position:relative}:host>div img.ngx-ic-source-image{max-width:100%;max-height:100%;transform-origin:center}:host>div img.ngx-ic-source-image.ngx-ic-draggable{user-drag:none;-webkit-user-drag:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;cursor:grab}:host .ngx-ic-overlay{position:absolute;pointer-events:none;touch-action:none;outline:var(--cropper-overlay-color, white) solid 100vw;top:0;left:0}:host .ngx-ic-cropper{position:absolute;display:flex;color:#53535c;background:transparent;outline:rgba(255,255,255,.3) solid 100vw;outline:var(--cropper-outline-color, rgba(255, 255, 255, .3)) solid 100vw;touch-action:none}@media (orientation: portrait){:host .ngx-ic-cropper{outline-width:100vh}}:host .ngx-ic-cropper:after{position:absolute;content:\"\";inset:0;pointer-events:none;border:dashed 1px;opacity:.75;color:inherit;z-index:1}:host .ngx-ic-cropper .ngx-ic-move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .ngx-ic-cropper:focus .ngx-ic-move{border-color:#1e90ff;border-width:2px}:host .ngx-ic-cropper .ngx-ic-resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .ngx-ic-cropper .ngx-ic-resize .ngx-ic-square{display:inline-block;background:#53535C;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-topright{top:-12px;right:-12px;cursor:nesw-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar{position:absolute;z-index:1}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .ngx-ic-cropper.ngx-ic-round{outline-color:transparent}:host .ngx-ic-cropper.ngx-ic-round:after{border-radius:100%;box-shadow:0 0 0 100vw #ffffff4d;box-shadow:0 0 0 100vw var(--cropper-outline-color, rgba(255, 255, 255, .3))}@media (orientation: portrait){:host .ngx-ic-cropper.ngx-ic-round:after{box-shadow:0 0 0 100vh #ffffff4d;box-shadow:0 0 0 100vh var(--cropper-outline-color, rgba(255, 255, 255, .3))}}:host .ngx-ic-cropper.ngx-ic-round .ngx-ic-move{border-radius:100%}:host.disabled .ngx-ic-cropper .ngx-ic-resize,:host.disabled .ngx-ic-cropper .ngx-ic-resize-bar,:host.disabled .ngx-ic-cropper .ngx-ic-move{display:none}:host.ngx-ix-hidden{display:none}\n"], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1283
1289
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImageCropperComponent, decorators: [{
|
|
1284
1290
|
type: Component,
|
|
1285
1291
|
args: [{ selector: 'image-cropper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [style.background]=\"imageVisible && backgroundColor\"\n #wrapper\n>\n <img\n #sourceImage\n class=\"ngx-ic-source-image\"\n role=\"presentation\"\n *ngIf=\"safeImgDataUrl\"\n [src]=\"safeImgDataUrl\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n [style.transform]=\"safeTransformStyle\"\n [class.ngx-ic-draggable]=\"!disabled && allowMoveImage\"\n [attr.alt]=\"imageAltText\"\n (load)=\"imageLoadedInView()\"\n (mousedown)=\"startMove($event, moveTypes.Drag)\"\n (touchstart)=\"startMove($event, moveTypes.Drag)\"\n (error)=\"loadImageError($event)\"\n >\n <div\n class=\"ngx-ic-overlay\"\n [style.width.px]=\"maxSize.width\"\n [style.height.px]=\"maxSize.height\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n ></div>\n <div class=\"ngx-ic-cropper\"\n *ngIf=\"imageVisible\"\n [class.ngx-ic-round]=\"roundCropper\"\n [attr.aria-label]=\"cropperFrameAriaLabel\"\n [style.top.px]=\"cropper.y1\"\n [style.left.px]=\"cropper.x1\"\n [style.width.px]=\"cropper.x2 - cropper.x1\"\n [style.height.px]=\"cropper.y2 - cropper.y1\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n (keydown)=\"keyboardAccess($event)\"\n tabindex=\"0\"\n >\n <div\n (mousedown)=\"startMove($event, moveTypes.Move)\"\n (touchstart)=\"startMove($event, moveTypes.Move)\"\n class=\"ngx-ic-move\"\n role=\"presentation\">\n </div>\n <ng-container *ngIf=\"!hideResizeSquares\">\n <span class=\"ngx-ic-resize ngx-ic-topleft\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'topleft')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'topleft')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-top\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-topright\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'topright')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'topright')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-right\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottomright\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottomright')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottomright')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottom\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-bottomleft\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottomleft')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottomleft')\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize ngx-ic-left\">\n <span class=\"ngx-ic-square\"></span>\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-top\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'top')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'top')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-right\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'right')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'right')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-bottom\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'bottom')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'bottom')\">\n </span>\n <span class=\"ngx-ic-resize-bar ngx-ic-left\"\n role=\"presentation\"\n (mousedown)=\"startMove($event, moveTypes.Resize, 'left')\"\n (touchstart)=\"startMove($event, moveTypes.Resize, 'left')\">\n </span>\n </ng-container>\n </div>\n</div>\n", styles: [":host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center}:host>div{width:100%;position:relative}:host>div img.ngx-ic-source-image{max-width:100%;max-height:100%;transform-origin:center}:host>div img.ngx-ic-source-image.ngx-ic-draggable{user-drag:none;-webkit-user-drag:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;cursor:grab}:host .ngx-ic-overlay{position:absolute;pointer-events:none;touch-action:none;outline:var(--cropper-overlay-color, white) solid 100vw;top:0;left:0}:host .ngx-ic-cropper{position:absolute;display:flex;color:#53535c;background:transparent;outline:rgba(255,255,255,.3) solid 100vw;outline:var(--cropper-outline-color, rgba(255, 255, 255, .3)) solid 100vw;touch-action:none}@media (orientation: portrait){:host .ngx-ic-cropper{outline-width:100vh}}:host .ngx-ic-cropper:after{position:absolute;content:\"\";inset:0;pointer-events:none;border:dashed 1px;opacity:.75;color:inherit;z-index:1}:host .ngx-ic-cropper .ngx-ic-move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .ngx-ic-cropper:focus .ngx-ic-move{border-color:#1e90ff;border-width:2px}:host .ngx-ic-cropper .ngx-ic-resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .ngx-ic-cropper .ngx-ic-resize .ngx-ic-square{display:inline-block;background:#53535C;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-topright{top:-12px;right:-12px;cursor:nesw-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .ngx-ic-cropper .ngx-ic-resize.ngx-ic-left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar{position:absolute;z-index:1}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .ngx-ic-cropper .ngx-ic-resize-bar.ngx-ic-left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .ngx-ic-cropper.ngx-ic-round{outline-color:transparent}:host .ngx-ic-cropper.ngx-ic-round:after{border-radius:100%;box-shadow:0 0 0 100vw #ffffff4d;box-shadow:0 0 0 100vw var(--cropper-outline-color, rgba(255, 255, 255, .3))}@media (orientation: portrait){:host .ngx-ic-cropper.ngx-ic-round:after{box-shadow:0 0 0 100vh #ffffff4d;box-shadow:0 0 0 100vh var(--cropper-outline-color, rgba(255, 255, 255, .3))}}:host .ngx-ic-cropper.ngx-ic-round .ngx-ic-move{border-radius:100%}:host.disabled .ngx-ic-cropper .ngx-ic-resize,:host.disabled .ngx-ic-cropper .ngx-ic-resize-bar,:host.disabled .ngx-ic-cropper .ngx-ic-move{display:none}:host.ngx-ix-hidden{display:none}\n"] }]
|
|
@@ -1388,18 +1394,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
1388
1394
|
}], onResize: [{
|
|
1389
1395
|
type: HostListener,
|
|
1390
1396
|
args: ['window:resize']
|
|
1391
|
-
}], moveImg: [{
|
|
1392
|
-
type: HostListener,
|
|
1393
|
-
args: ['document:mousemove', ['$event']]
|
|
1394
|
-
}, {
|
|
1395
|
-
type: HostListener,
|
|
1396
|
-
args: ['document:touchmove', ['$event']]
|
|
1397
|
-
}], moveStop: [{
|
|
1398
|
-
type: HostListener,
|
|
1399
|
-
args: ['document:mouseup']
|
|
1400
|
-
}, {
|
|
1401
|
-
type: HostListener,
|
|
1402
|
-
args: ['document:touchend']
|
|
1403
1397
|
}] } });
|
|
1404
1398
|
|
|
1405
1399
|
class ImageCropperModule {
|