@wizishop/img-manager 0.2.103 → 0.2.108
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/bundles/wizishop-img-manager.umd.js +67 -36
- package/bundles/wizishop-img-manager.umd.js.map +1 -1
- package/bundles/wizishop-img-manager.umd.min.js +12 -12
- package/bundles/wizishop-img-manager.umd.min.js.map +1 -1
- package/esm2015/lib/components/img-editor/cropper/cropper.component.js +31 -11
- package/esm2015/lib/components/img-editor/img-editor.component.js +2 -2
- package/esm2015/lib/components/shared/alert/alert.component.js +1 -1
- package/esm5/lib/components/img-editor/cropper/cropper.component.js +38 -11
- package/esm5/lib/components/img-editor/img-editor.component.js +2 -2
- package/esm5/lib/components/shared/alert/alert.component.js +1 -1
- package/fesm2015/wizishop-img-manager.js +31 -12
- package/fesm2015/wizishop-img-manager.js.map +1 -1
- package/fesm5/wizishop-img-manager.js +38 -12
- package/fesm5/wizishop-img-manager.js.map +1 -1
- package/lib/components/img-editor/cropper/cropper.component.d.ts +6 -2
- package/package.json +5 -3
- package/wizishop-img-manager-0.2.108.tgz +0 -0
- package/wizishop-img-manager.metadata.json +1 -1
- package/wz-img-manager.scss +2579 -2573
- package/wizishop-img-manager-0.2.103.tgz +0 -0
|
@@ -1922,7 +1922,7 @@ __decorate([
|
|
|
1922
1922
|
ImgEditorComponent = __decorate([
|
|
1923
1923
|
Component({
|
|
1924
1924
|
selector: 'img-editor',
|
|
1925
|
-
template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n
|
|
1925
|
+
template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n <!-- Button Action Section -->\n\n <div class=\"img-editor__infoSection__actions\">\n <div>\n <button\n class=\"button img-editor__infoSection__actions__cancel\"\n (click)=\"onCancel()\"\n [disabled]=\"isLoading || (!isImgModified && !isNameModified)\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <div\n class=\"button danger button img-editor__infoSection__actions__save\"\n [ngClass]=\"{'img-editor__infoSection__actions__save--disable': isLoading}\"\n (click)=\"onSave()\"\n >\n {{ 'ImgManager.ImgEditor.saveBtn' | translate }}\n <span btnLoadingAnim *ngIf=\"isLoading\" class=\"btnLoadingAnnimation\"></span>\n </div>\n\n </div>\n </div>\n\n <perfect-scrollbar\n [config]=\"{suppressScrollX: true}\"\n class=\"img-editor__scroll\"\n [ngClass]=\"{\n 'img-editor__scroll--full': stateDisplayed === 'full',\n 'img-editor__scroll--smallDisplay': stateDisplayed === 'small',\n 'img-editor__scroll--window': stateDisplayed === 'window'\n }\"\n >\n <div class=\"columns\">\n <!-- Left section -->\n <div class=\"column is-one-third img-editor__infoSection\">\n\n <info-section\n [imgToEdit]=\"imgToEdit\"\n [(isNameModified)]=\"isNameModified\"\n >\n </info-section>\n </div>\n\n\n <!-- Right section -->\n <div class=\"column img-editor__container\">\n <cropper\n [imgToEdit]=\"imgToEdit\"\n [(isImgModified)]=\"isImgModified\"\n (currentCroppedImageChange)=\"onImgCropped($event)\"\n (editClosed)=\"onEditClosed($event)\">\n </cropper>\n </div>\n </div>\n </perfect-scrollbar>\n</div>\n",
|
|
1926
1926
|
animations: [
|
|
1927
1927
|
easeInOut
|
|
1928
1928
|
]
|
|
@@ -2280,8 +2280,9 @@ let CropperComponent = class CropperComponent {
|
|
|
2280
2280
|
this.currentCroppedImage = ''; // Img modified return in base64
|
|
2281
2281
|
this.isCropped = false;
|
|
2282
2282
|
this.isLoading = false;
|
|
2283
|
-
this.
|
|
2284
|
-
this.
|
|
2283
|
+
this._isImgCropped = false;
|
|
2284
|
+
this.imgCropperChange = new Subject();
|
|
2285
|
+
this.skipNextImgCropped = 1;
|
|
2285
2286
|
this.imageChangedEvent = '';
|
|
2286
2287
|
this.croppedImage = '';
|
|
2287
2288
|
this.canvasRotation = 0;
|
|
@@ -2378,8 +2379,17 @@ let CropperComponent = class CropperComponent {
|
|
|
2378
2379
|
get isImgModified() {
|
|
2379
2380
|
return this._isImgModified;
|
|
2380
2381
|
}
|
|
2382
|
+
set isImgCropped(isImgCropped) {
|
|
2383
|
+
setTimeout(() => {
|
|
2384
|
+
this._isImgCropped = isImgCropped;
|
|
2385
|
+
}, 0);
|
|
2386
|
+
}
|
|
2387
|
+
get isImgCropped() {
|
|
2388
|
+
return this._isImgCropped;
|
|
2389
|
+
}
|
|
2381
2390
|
ngOnInit() {
|
|
2382
2391
|
this.init();
|
|
2392
|
+
this.detectImgCropperChange();
|
|
2383
2393
|
}
|
|
2384
2394
|
init() {
|
|
2385
2395
|
this.imgRoute = this.getRAWImgRoute();
|
|
@@ -2420,7 +2430,7 @@ let CropperComponent = class CropperComponent {
|
|
|
2420
2430
|
this.imageChangedEvent = event;
|
|
2421
2431
|
}
|
|
2422
2432
|
imageCropped(event) {
|
|
2423
|
-
this.
|
|
2433
|
+
this.imgCropperChange.next();
|
|
2424
2434
|
this.currentCroppedImage = event.base64;
|
|
2425
2435
|
this.currentCroppedImageChange.emit(this.currentCroppedImage);
|
|
2426
2436
|
}
|
|
@@ -2440,10 +2450,12 @@ let CropperComponent = class CropperComponent {
|
|
|
2440
2450
|
this.setCropperProperties(config);
|
|
2441
2451
|
}
|
|
2442
2452
|
confirmCrop() {
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2453
|
+
setTimeout(() => {
|
|
2454
|
+
this.imgRoute = null;
|
|
2455
|
+
this.croppedImage = this.currentCroppedImage;
|
|
2456
|
+
this.skipNextImgCropped = 2;
|
|
2457
|
+
this.isImgCropped = false;
|
|
2458
|
+
}, 0);
|
|
2447
2459
|
this.resetConfCropper();
|
|
2448
2460
|
this.onImgModified();
|
|
2449
2461
|
}
|
|
@@ -2465,8 +2477,15 @@ let CropperComponent = class CropperComponent {
|
|
|
2465
2477
|
}
|
|
2466
2478
|
}
|
|
2467
2479
|
detectImgCropperChange() {
|
|
2468
|
-
this.
|
|
2469
|
-
|
|
2480
|
+
this.imgCropperChange
|
|
2481
|
+
.subscribe(() => {
|
|
2482
|
+
this.skipNextImgCropped--;
|
|
2483
|
+
if (this.skipNextImgCropped >= 0) {
|
|
2484
|
+
return;
|
|
2485
|
+
}
|
|
2486
|
+
this.skipNextImgCropped = 0;
|
|
2487
|
+
this.isImgCropped = true;
|
|
2488
|
+
});
|
|
2470
2489
|
}
|
|
2471
2490
|
/* Rotations functions */
|
|
2472
2491
|
rotateLeft() {
|
|
@@ -2534,7 +2553,7 @@ __decorate([
|
|
|
2534
2553
|
CropperComponent = __decorate([
|
|
2535
2554
|
Component({
|
|
2536
2555
|
selector: 'cropper',
|
|
2537
|
-
template: "<div class=\"img-editor__container__toolsContainer\">\n\n <div *ngIf=\"isImgCropped\">\n <div\n class=\"img-editor__container__toolsContainer__tool img-editor__container__toolsContainer__tool--button\"\n (click)=\"confirmCrop()\"\n [nwbToolTip]=\"'ImgManager.ImgEditor.ValidtToolTip' | translate\"\n nwbToolTipPosition=\"left\"\n >\n <i class=\"far fa-check\"></i>\n <p>{{ 'ImgManager.ImgEditor.Valid' | translate }}</p>\n </div>\n </div>\n\n <!-- Resolution -->\n <dropdown dropdownId=\"dropdown-resolution\">\n <ng-container label>\n <div\n class=\"img-editor__container__toolsContainer__tool\"\n >\n <i class=\"far fa-crop\"></i>\n <p>{{ 'ImgManager.ImgEditor.crop' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item *ngFor=\"let item of resolutionConfig; let index = index;\">\n <div\n class=\"dropdown-item\"\n [ngClass]=\"{'active-item': item.active}\"\n (click)=\"changeResolutionSize(index)\">\n <p>{{item.label | translate}}</p>\n </div>\n </ng-container>\n </dropdown>\n\n <!-- Zoom -->\n <dropdown dropdownId=\"dropdown-rotation\">\n <ng-container label>\n <div class=\"img-editor__container__toolsContainer__tool\" (click)=\"zoomIn()\">\n <i class=\"far fa-expand-arrows-alt\"></i>\n <p>{{ 'ImgManager.ImgEditor.display' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item *ngFor=\"let item of zoomConfig; let index = index;\">\n <div\n class=\"dropdown-item\"\n [ngClass]=\"{'active-item': item.active}\"\n (click)=\"applyMethod(item.method)\">\n <i *ngIf=\"item.icon\" [ngClass]=\"item.icon\"></i>\n <p>{{item.label | translate}}</p>\n </div>\n </ng-container>\n </dropdown>\n\n <!-- Rotation -->\n <dropdown dropdownId=\"dropdown-rotation\" dropDownMenuClass=\"img-editor__container__toolsContainer__RotationDropdown\">\n <ng-container label>\n <div class=\"img-editor__container__toolsContainer__tool\" (click)=\"rotateRight()\">\n <i class=\"far fa-redo\"></i>\n <p>{{ 'ImgManager.ImgEditor.rotation' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item *ngFor=\"let item of rotationConfig; let index = index;\">\n <div\n class=\"dropdown-item\"\n [ngClass]=\"{'active-item': item.active}\"\n (click)=\"applyMethod(item.method)\">\n <i *ngIf=\"item.icon\" [ngClass]=\"item.icon\"></i>\n <p>{{item.label | translate}}</p>\n </div>\n </ng-container>\n </dropdown>\n\n <div\n class=\"img-editor__container__toolsContainer__tool\"\n (click)=\"onRestart()\"\n @insertRemoveAnnim\n >\n <i class=\"far fa-retweet-alt\"></i>\n <p>{{ 'ImgManager.ImgEditor.restart' | translate }}</p>\n </div>\n</div>\n\n<div class=\"img-editor__image-cropper\" >\n <image-cropper\n [imageURL]
|
|
2556
|
+
template: "<div class=\"img-editor__container__toolsContainer\">\n\n <div *ngIf=\"isImgCropped\">\n <div\n class=\"img-editor__container__toolsContainer__tool img-editor__container__toolsContainer__tool--button\"\n (click)=\"confirmCrop()\"\n [nwbToolTip]=\"'ImgManager.ImgEditor.ValidtToolTip' | translate\"\n nwbToolTipPosition=\"left\"\n >\n <i class=\"far fa-check\"></i>\n <p>{{ 'ImgManager.ImgEditor.Valid' | translate }}</p>\n </div>\n </div>\n\n <!-- Resolution -->\n <dropdown dropdownId=\"dropdown-resolution\">\n <ng-container label>\n <div\n class=\"img-editor__container__toolsContainer__tool\"\n >\n <i class=\"far fa-crop\"></i>\n <p>{{ 'ImgManager.ImgEditor.crop' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item *ngFor=\"let item of resolutionConfig; let index = index;\">\n <div\n class=\"dropdown-item\"\n [ngClass]=\"{'active-item': item.active}\"\n (click)=\"changeResolutionSize(index)\">\n <p>{{item.label | translate}}</p>\n </div>\n </ng-container>\n </dropdown>\n\n <!-- Zoom -->\n <dropdown dropdownId=\"dropdown-rotation\">\n <ng-container label>\n <div class=\"img-editor__container__toolsContainer__tool\" (click)=\"zoomIn()\">\n <i class=\"far fa-expand-arrows-alt\"></i>\n <p>{{ 'ImgManager.ImgEditor.display' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item *ngFor=\"let item of zoomConfig; let index = index;\">\n <div\n class=\"dropdown-item\"\n [ngClass]=\"{'active-item': item.active}\"\n (click)=\"applyMethod(item.method)\">\n <i *ngIf=\"item.icon\" [ngClass]=\"item.icon\"></i>\n <p>{{item.label | translate}}</p>\n </div>\n </ng-container>\n </dropdown>\n\n <!-- Rotation -->\n <dropdown dropdownId=\"dropdown-rotation\" dropDownMenuClass=\"img-editor__container__toolsContainer__RotationDropdown\">\n <ng-container label>\n <div class=\"img-editor__container__toolsContainer__tool\" (click)=\"rotateRight()\">\n <i class=\"far fa-redo\"></i>\n <p>{{ 'ImgManager.ImgEditor.rotation' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item *ngFor=\"let item of rotationConfig; let index = index;\">\n <div\n class=\"dropdown-item\"\n [ngClass]=\"{'active-item': item.active}\"\n (click)=\"applyMethod(item.method)\">\n <i *ngIf=\"item.icon\" [ngClass]=\"item.icon\"></i>\n <p>{{item.label | translate}}</p>\n </div>\n </ng-container>\n </dropdown>\n\n <div\n class=\"img-editor__container__toolsContainer__tool\"\n (click)=\"onRestart()\"\n @insertRemoveAnnim\n >\n <i class=\"far fa-retweet-alt\"></i>\n <p>{{ 'ImgManager.ImgEditor.restart' | translate }}</p>\n </div>\n</div>\n\n<div class=\"img-editor__image-cropper\" >\n <image-cropper\n [imageURL]=\"imgRoute\"\n [imageBase64]=\"croppedImage\"\n [maintainAspectRatio]=\"imgCropperConfig.maintainAspectRatio\"\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\n [aspectRatio]=\"imgCropperConfig.aspectRatio\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"false\"\n [canvasRotation]=\"canvasRotation\"\n [transform]=\"transform\"\n [alignImage]=\"'center'\"\n [style.display]=\"showCropper ? null : 'none'\"\n [format]=\"imgType\"\n [backgroundColor]=\"'white'\"\n (imageCropped)=\"imageCropped($event)\"\n (imageLoaded)=\"imageLoaded()\"\n (cropperReady)=\"cropperReady()\"\n (loadImageFailed)=\"loadImageFailed()\"\n ></image-cropper>\n</div>\n",
|
|
2538
2557
|
animations: [
|
|
2539
2558
|
insertRemove
|
|
2540
2559
|
]
|
|
@@ -4098,7 +4117,7 @@ AlertComponent = __decorate([
|
|
|
4098
4117
|
Component({
|
|
4099
4118
|
selector: 'wz-alert',
|
|
4100
4119
|
template: "<div class=\"wz-alert\" [ngClass]=\"{ success: success, warning: warning }\">\n <i *ngIf=\"icon\" [ngClass]=\"iconClass\"></i>\n <p><ng-content></ng-content></p>\n</div>\n",
|
|
4101
|
-
styles: [".wz-alert{width:100%;background-color:rgba(82,174,205,.15);color:#52aecd;border-radius:3px;display
|
|
4120
|
+
styles: [".wz-alert{width:100%;background-color:rgba(82,174,205,.15);color:#52aecd;border-radius:3px;display:flex;flex-wrap:nowrap;justify-content:space-between;padding:20px}.wz-alert.success{background-color:rgba(46,204,113,.15)}.wz-alert.success p,.wz-alert.success p>*{color:#11552e}.wz-alert.success i{color:#2ecc71}.wz-alert.warning{background-color:rgba(233,86,86,.15)}.wz-alert.warning p,.wz-alert.warning p>*{color:#3a0505}.wz-alert.warning i{color:#e95656}.wz-alert p{width:100%;font-size:rem(14);line-height:rem(25);margin:0;padding:0;color:#1e5568}.wz-alert p>*{color:#1e5568}.wz-alert i{width:auto;margin:0 10px 0 0;color:inherit;font-size:rem(14);line-height:rem(25)}"]
|
|
4102
4121
|
}),
|
|
4103
4122
|
__metadata("design:paramtypes", [])
|
|
4104
4123
|
], AlertComponent);
|