@wizishop/img-manager 0.2.74 → 0.2.78

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 (35) hide show
  1. package/assets/i18n/en.json +1 -1
  2. package/bundles/wizishop-img-manager.umd.js +151 -25
  3. package/bundles/wizishop-img-manager.umd.js.map +1 -1
  4. package/bundles/wizishop-img-manager.umd.min.js +1 -1
  5. package/bundles/wizishop-img-manager.umd.min.js.map +1 -1
  6. package/esm2015/lib/components/images-view/images-view.component.js +10 -4
  7. package/esm2015/lib/components/img-editor/img-editor.component.js +6 -2
  8. package/esm2015/lib/components/shared/pagination/page-selector/page-selector.component.js +55 -0
  9. package/esm2015/lib/components/shared/pagination/pagination.component.js +4 -4
  10. package/esm2015/lib/pipes/pagination/large-number-of-page/large-number-of-page.pipe.js +51 -0
  11. package/esm2015/lib/services/img-manager.service.js +2 -2
  12. package/esm2015/lib/wz-img-manager.module.js +7 -3
  13. package/esm2015/wizishop-img-manager.js +18 -16
  14. package/esm5/lib/components/images-view/images-view.component.js +10 -4
  15. package/esm5/lib/components/img-editor/img-editor.component.js +6 -2
  16. package/esm5/lib/components/shared/pagination/page-selector/page-selector.component.js +64 -0
  17. package/esm5/lib/components/shared/pagination/pagination.component.js +4 -4
  18. package/esm5/lib/pipes/pagination/large-number-of-page/large-number-of-page.pipe.js +54 -0
  19. package/esm5/lib/services/img-manager.service.js +2 -2
  20. package/esm5/lib/wz-img-manager.module.js +7 -3
  21. package/esm5/wizishop-img-manager.js +18 -16
  22. package/fesm2015/wizishop-img-manager.js +123 -11
  23. package/fesm2015/wizishop-img-manager.js.map +1 -1
  24. package/fesm5/wizishop-img-manager.js +135 -11
  25. package/fesm5/wizishop-img-manager.js.map +1 -1
  26. package/lib/components/images-view/images-view.component.d.ts +1 -0
  27. package/lib/components/shared/pagination/page-selector/page-selector.component.d.ts +20 -0
  28. package/lib/components/shared/pagination/pagination.component.d.ts +1 -1
  29. package/lib/pipes/pagination/large-number-of-page/large-number-of-page.pipe.d.ts +10 -0
  30. package/package.json +1 -1
  31. package/wizishop-img-manager-0.2.78.tgz +0 -0
  32. package/wizishop-img-manager.d.ts +17 -15
  33. package/wizishop-img-manager.metadata.json +1 -1
  34. package/wz-img-manager.scss +2558 -2487
  35. package/wizishop-img-manager-0.2.74.tgz +0 -0
@@ -1 +1 @@
1
- {"ImgManager.CanvaBtn.bigSquare":"Big","ImgManager.CanvaBtn.createImg":"Create an image with","ImgManager.CanvaBtn.createImg.title":"Create an image with Canva","ImgManager.CanvaBtn.errorRenameCanvaImg":"Error: the title of the image from Canva could not be retrieved.","ImgManager.CanvaBtn.errorUploadCanvaImg":"Error: the image from Canva could not be uploaded.","ImgManager.CanvaBtn.info":"Select a format","ImgManager.CanvaBtn.mediumSquare":"Medium","ImgManager.CanvaBtn.publish":"Import","ImgManager.CanvaBtn.recommanded":"Recommended","ImgManager.CanvaBtn.smallSquare":"Small","ImgManager.CanvaBtn.successImport":"Your image has been imported.","ImgManager.CanvaBtn.uploadingImg":"Image loading.","ImgManager.ImgCard.confirmDeleteImg":"Are you sure you want to delete this image?","ImgManager.ImgCard.del":"Delete","ImgManager.ImgCard.download":"Download","ImgManager.ImgCard.edit":"Edit","ImgManager.ImgCard.select":"Select","ImgManager.ImgCard.validImgSmall":"Select","ImgManager.ImgEditor.nameEx":"Ex: Black T-shirt","ImgManager.ImgEditor.restart":"Refresh","ImgManager.ImgEditor.Valid":"Confirm","ImgManager.ImgEditor.ValidtToolTip":"Click here to crop the image","ImgManager.ImgLib.confirmSupQuestion":"{{nbImage}} image to delete: Are you sure?","ImgManager.ImgLib.confirmSupQuestions":"{{nbImage}} images to delete: Are you sure?","ImgManager.ImgLib.delMlt":"Delete","ImgManager.ImgLib.errorGetCanvaImg":"Error: the image from Canva could not be retrieved.","ImgManager.ImgLib.imgNameSaved":"Image name saved.","ImgManager.ImgLib.lastImgs":"Your last images","ImgManager.ImgLib.nbImg":"Number of images","ImgManager.ImgLib.savingImgName":"Backup in progress...","ImgManager.ImgList.download":"Download","ImgManager.ImgList.edit":"Edit","ImgManager.ImgList.errorAlreadyUsed":"This image can not be deleted as it is being used.","ImgManager.ImgList.remove":"Delete","ImgManager.ImgList.titleImgName":"Image name","ImgManager.ImgList.titleResolution":"Resolution","ImgManager.ImgSelection.deleteImg":"Delete","ImgManager.ImgSelection.tooltips":"Click to change the order of the images","ImgManager.ImgUpload.dropImg":"Drag and drop your image here","ImgManager.ImgUpload.loading":"Loading...","ImgManager.ImgUpload.or":"or","ImgManager.ImgUpload.selectImg":"Select the images to be imported","ImgManager.PexelLib.errorUploadPhoto":"Error: the image could not be imported","ImgManager.PexelLib.import":"Import","ImgManager.PexelLib.importation":"Import","ImgManager.PexelLib.nbImgFound":"Number if images found","ImgManager.PexelLib.successImport":"Image imported","ImgManager.SearchBar.placeholder":"Name of the image to search","ImgManager.snackBar.action":"View image","ImgManager.Tabs.addImg":"Add an image","ImgManager.Tabs.freeImgLib":"Free image library","ImgManager.Tabs.imgLib":"Your images","ImgManager.UploadList.imgSuccessImport":"Images successfully imported","ImgManager.UploadList.properties.imgSize":"Size of original image","ImgManager.UploadList.properties.imgWeight":"Size of original file","ImgManager.UploadList.seo.cdn":"Addition in the CDN.","ImgManager.UploadList.seo.lazyloading":"Automatic lazyloading.","ImgManager.UploadList.seo.rezise":"Resizing and compression.","ImgManager.UploadList.seo.webp":"Webp generation","ImgManager.webElement.infoBulle":"The image manager allows you to <strong>download</strong> images, <strong> select them </strong> and apply some <strong>effects</strong> (crop, rotations...).<br/><br/>We recommend using <strong>several photos</strong> of the product (3 or 4) in various positions or environments.","ImgManager.webElement.OpenBtn":"Add photos","no":"no","PaginationComponent.on":"{{low}}-{{high}} on {{total}}","PaginationComponent.page":"Go to page","yes":"yes"}
1
+ {"ImgManager.CanvaBtn.bigSquare":"Big","ImgManager.CanvaBtn.createImg":"Create an image with","ImgManager.CanvaBtn.createImg.title":"Create an image with Canva","ImgManager.CanvaBtn.errorRenameCanvaImg":"Error: the title of the image from Canva could not be retrieved.","ImgManager.CanvaBtn.errorUploadCanvaImg":"Error: the image from Canva could not be uploaded.","ImgManager.CanvaBtn.info":"Select a format","ImgManager.CanvaBtn.mediumSquare":"Medium","ImgManager.CanvaBtn.publish":"Import","ImgManager.CanvaBtn.recommanded":"Recommended","ImgManager.CanvaBtn.smallSquare":"Small","ImgManager.CanvaBtn.successImport":"Your image has been imported.","ImgManager.CanvaBtn.uploadingImg":"Image loading.","ImgManager.ImgCard.confirmDeleteImg":"Are you sure you want to delete this image?","ImgManager.ImgCard.del":"Delete","ImgManager.ImgCard.download":"Download","ImgManager.ImgCard.edit":"Edit","ImgManager.ImgCard.select":"Select","ImgManager.ImgCard.validImgSmall":"Select","ImgManager.ImgEditor.config.AntiSchedule":"Anti-clockwise","ImgManager.ImgEditor.config.flipHoriz":"Turn horizontally","ImgManager.ImgEditor.config.landscape":"Landscape","ImgManager.ImgEditor.config.origin":"Original format","ImgManager.ImgEditor.config.schedule":"Clockwise","ImgManager.ImgEditor.config.square":"Square","ImgManager.ImgEditor.config.zoom":"Zoom more","ImgManager.ImgEditor.crop":"Crop","ImgManager.ImgEditor.msgFailLoad":"Error: please start again.","ImgManager.ImgEditor.msgFailSave":"Error: The image could not be saved.<br/>Please try again.","ImgManager.ImgEditor.nameEx":"Ex: Black T-shirt","ImgManager.ImgEditor.NameInfo":"The name of the image is used to define the alt attribute.","ImgManager.ImgEditor.restart":"Refresh","ImgManager.ImgEditor.rotation":"Rotate","ImgManager.ImgEditor.saveBtn":"Save and close","ImgManager.ImgEditor.Valid":"Confirm","ImgManager.ImgEditor.ValidtToolTip":"Click here to crop the image","ImgManager.ImgLib.cancel":"Cancel","ImgManager.ImgLib.confirm":"Confirm","ImgManager.ImgLib.confirmSupQuestion":"{{nbImage}} image to delete: Are you sure?","ImgManager.ImgLib.confirmSupQuestions":"{{nbImage}} images to delete: Are you sure?","ImgManager.ImgLib.delMlt":"Delete","ImgManager.ImgLib.errorGetAllImg":"Error: Your images could not be recovered.","ImgManager.ImgLib.errorGetCanvaImg":"Error: the image from Canva could not be retrieved.","ImgManager.ImgLib.errorGetTotalImg":"Error: The total number of images has not been recovered.","ImgManager.ImgLib.imgNameSaved":"Image name saved.","ImgManager.ImgLib.lastImgs":"Your last images","ImgManager.ImgLib.nbImg":"Number of images","ImgManager.ImgLib.noImgFound":"No images found.<br/>Display free images.","ImgManager.ImgLib.savingImgName":"Backup in progress...","ImgManager.ImgLib.select":"Select","ImgManager.ImgList.download":"Download","ImgManager.ImgList.edit":"Edit","ImgManager.ImgList.errorAlreadyUsed":"This image can not be deleted as it is being used.","ImgManager.ImgList.errorRemoveImg":"Error: Some images could not be deleted.","ImgManager.ImgList.errorRenameImg":"Error: Some images could not be renamed.","ImgManager.ImgList.remove":"Delete","ImgManager.ImgList.titleImgName":"Image name","ImgManager.ImgList.titleResolution":"Resolution","ImgManager.ImgSelection.deleteImg":"Delete","ImgManager.ImgSelection.tooltips":"Click to change the order of the images","ImgManager.ImgSelection.unselect":"Drag the image here to remove it from the selection","ImgManager.ImgUpload.dropImg":"Drag and drop your image here","ImgManager.ImgUpload.errorNotImg":"Error: Only images can be imported.","ImgManager.ImgUpload.errorUploadingImg":"Error: An image could not be imported.","ImgManager.ImgUpload.loading":"Loading...","ImgManager.ImgUpload.or":"or","ImgManager.ImgUpload.selectImg":"Select the images to be imported","ImgManager.PexelLib.errorRetrievePhotos":"Error: The Pexel images have not been recovered.","ImgManager.PexelLib.errorUploadPhoto":"Error: the image could not be imported","ImgManager.PexelLib.import":"Import","ImgManager.PexelLib.importation":"Import","ImgManager.PexelLib.landscape":"Landscape","ImgManager.PexelLib.nbImgFound":"Number if images found","ImgManager.PexelLib.noResult":"No image found.","ImgManager.PexelLib.original":"Original.","ImgManager.PexelLib.portrait":"Portrait","ImgManager.PexelLib.successImport":"Image imported","ImgManager.PexelLib.untitled":"No title","ImgManager.PexelLib.uploadingImg":"Loading the current image.","ImgManager.SearchBar.placeholder":"Name of the image to search","ImgManager.snackBar.action":"View image","ImgManager.Tabs.addImg":"Add an image","ImgManager.Tabs.Editor":"Image editor","ImgManager.Tabs.freeImgLib":"Free image library","ImgManager.Tabs.imgLib":"Your images","ImgManager.UploadList.imgSuccessImport":"Images successfully imported","ImgManager.UploadList.imgSuccessImportOne":"imported image optimized for SEO","ImgManager.UploadList.properties.imgName":"Image name","ImgManager.UploadList.properties.imgSize":"Size of original image","ImgManager.UploadList.properties.imgURL":"Image URL","ImgManager.UploadList.properties.imgWeight":"Size of original file","ImgManager.UploadList.seo.cdn":"Addition in the CDN.","ImgManager.UploadList.seo.cdnTooltips":"The images you add to your website are sent directly to our CDN (Content Delivery Network). This allows the visuals to be loaded from the servers closest to the user.","ImgManager.UploadList.seo.lazyloading":"Automatic lazyloading.","ImgManager.UploadList.seo.lazyloadingTooltips":"With lazyloading, the content is loaded as the user scrolls down the page. This allows to load only the visible content.","ImgManager.UploadList.seo.rezise":"Resizing and compression.","ImgManager.UploadList.seo.reziseTooltips":"When importing your image on WiziShop, more than 22 formats are created to adapt to different screen sizes. This optimization allows us to send a different size of visual and compressed according to the support of the Internet user.","ImgManager.UploadList.seo.title":"SEO Optimizations","ImgManager.UploadList.seo.webp":"Webp generation","ImgManager.UploadList.seo.webpTooltips":"As soon as you add an image to your site, it will be accessible in the standard format, but it will also be automatically converted to the WebP format for Google. This format allows you to compress, as much as possible, the images present on your store to load them very quickly.","ImgManager.webElement.infoBulle":"The image manager allows you to <strong>download</strong> images, <strong> select them </strong> and apply some <strong>effects</strong> (crop, rotations...).<br/><br/>We recommend using <strong>several photos</strong> of the product (3 or 4) in various positions or environments.","ImgManager.webElement.OpenBtn":"Add photos","ImgManager.webElement.photosTitle":"Photos","no":"no","PaginationComponent.on":"{{low}}-{{high}} on {{total}}","PaginationComponent.page":"Go to page","yes":"yes"}
@@ -416,7 +416,7 @@
416
416
  return this.http.get(this.imgManagerRoute + "/images", this.getOptionsHeaders(params));
417
417
  };
418
418
  ImgManagerService.prototype.getShopTotalImgList = function (params) {
419
- return this.http.get(this.imgManagerRoute + "/total/images", this.getOptionsHeaders(params));
419
+ return this.http.get(this.imgManagerRoute + "/total/image", this.getOptionsHeaders(params));
420
420
  };
421
421
  ImgManagerService.prototype.getShopImg = function (idFile) {
422
422
  return this.http.get(this.imgManagerRoute + "/images/" + idFile, this.getOptionsHeaders());
@@ -1984,6 +1984,10 @@
1984
1984
  return;
1985
1985
  }
1986
1986
  this.isLoading = true;
1987
+ if (!this.isImgModified && !this.isNameModified) {
1988
+ this.isLoading = false;
1989
+ this.onEditClosed();
1990
+ }
1987
1991
  var obsReplaceImg = this.imgManagerService.replaceImg(this.currentCroppedImage, this.imgToEdit.id_file);
1988
1992
  var obsChangeImgName = this.imgManagerService.changeImgName(this.imgToEdit.display_name, this.imgToEdit.id_file);
1989
1993
  if (this.isImgModified && this.isNameModified) {
@@ -2059,7 +2063,7 @@
2059
2063
  ImgEditorComponent = __decorate([
2060
2064
  core.Component({
2061
2065
  selector: 'img-editor',
2062
- template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n <ng-scrollbar\n #scrollable\n [visibility]=\"'native'\"\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\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\"\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 </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 </ng-scrollbar>\n</div>\n",
2066
+ template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\n\n <ng-scrollbar\n #scrollable\n [visibility]=\"'native'\"\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\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 </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 </ng-scrollbar>\n</div>\n",
2063
2067
  animations: [
2064
2068
  easeInOut
2065
2069
  ]
@@ -3183,8 +3187,8 @@
3183
3187
  var _this = this;
3184
3188
  this.isLoading = true;
3185
3189
  this.displayPexelsResults = false;
3186
- this.isTotalRetieved = false;
3187
3190
  this.setParams();
3191
+ this.refreshTotalImgList();
3188
3192
  this.imgManager.getShopImgList(this.params).pipe(operators.take(1)).subscribe(function (data) {
3189
3193
  _this.initVariables(true);
3190
3194
  var nbImgDisplayed = data.data.length;
@@ -3202,7 +3206,6 @@
3202
3206
  if (data.totalRecords === 0) {
3203
3207
  _this.displayPexelsLib();
3204
3208
  }
3205
- _this.refreshTotalImgList();
3206
3209
  }, function (error) {
3207
3210
  _this.alertService.openAlert(_this.errorGetAllImg);
3208
3211
  _this.initVariables(false);
@@ -3210,12 +3213,19 @@
3210
3213
  };
3211
3214
  ImagesViewComponent.prototype.refreshTotalImgList = function () {
3212
3215
  var _this = this;
3216
+ var searchValue = this.tableFilters.searchValue;
3217
+ if (this.isTotalRetieved && searchValue === this.previousSearchValue) {
3218
+ // Keep current total result
3219
+ return;
3220
+ }
3221
+ this.isTotalRetieved = false;
3213
3222
  this.imgManager.getShopTotalImgList(this.params).pipe(operators.take(1)).subscribe(function (data) {
3223
+ _this.previousSearchValue = searchValue;
3214
3224
  _this.isTotalRetieved = true;
3215
3225
  _this.length = data.totalRecords;
3216
3226
  _this.tableFilters.totalItems = data.totalRecords;
3217
3227
  }, function (error) {
3218
- _this.alertService.openAlert(_this.errorGetTotalImg);
3228
+ //this.alertService.openAlert(this.errorGetTotalImg);
3219
3229
  _this.initVariables(false);
3220
3230
  });
3221
3231
  };
@@ -3687,8 +3697,8 @@
3687
3697
  this.pagination.currentPage++;
3688
3698
  this.pageChange.emit(this.pagination);
3689
3699
  };
3690
- PaginationComponent.prototype.onGotoPageChange = function (event) {
3691
- this.pagination.currentPage = parseInt(event.target.value);
3700
+ PaginationComponent.prototype.onGotoPageChange = function (pageNumber) {
3701
+ this.pagination.currentPage = parseInt(pageNumber);
3692
3702
  this.pageChange.emit(this.pagination);
3693
3703
  };
3694
3704
  __decorate([
@@ -3703,7 +3713,7 @@
3703
3713
  PaginationComponent = __decorate([
3704
3714
  core.Component({
3705
3715
  selector: 'wz-pagination',
3706
- template: "<div class=\"wz-pagination\" *ngIf=\"pagination && pagination.itemsPerPage\">\n <div class=\"wz-pagination__wrapper\">\n <div class=\"wz-pagination__wrapper__page\">\n <p>{{ 'PaginationComponent.page' | translate }}</p>\n\n <select name=\"page\" (change)=\"onGotoPageChange($event)\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\">\n <ng-container *ngFor=\"let pageIndex of pagination.totalItems | ArrayTotalPages: pagination.itemsPerPage\">\n <option [selected]=\"pageIndex === pagination.currentPage\" [value]=\"pageIndex\">\n {{ pageIndex }}\n </option>\n </ng-container>\n </select>\n </div>\n\n <div class=\"wz-pagination__wrapper__elements\">\n <p>{{ pagination.currentPage | customPagniationText: pagination.totalItems:pagination.itemsPerPage }}</p>\n </div>\n\n <div class=\"wz-pagination__wrapper__arrows\">\n <div\n (click)=\"decrementPage()\"\n class=\"wz-pagination__wrapper__arrows__arrow wz-pagination__wrapper__arrows__arrow--left\"\n [ngClass]=\"{ 'wz-pagination__wrapper__arrows__arrow--disabled': pagination.currentPage === 1 }\"\n >\n <span class=\"wz-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n <div\n (click)=\"incrementPage()\"\n class=\"wz-pagination__wrapper__arrows__arrow wz-pagination__wrapper__arrows__arrow--right\"\n [ngClass]=\"{\n 'wz-pagination__wrapper__arrows__arrow--disabled':\n pagination.currentPage | IsLastPage: pagination.totalItems:pagination.itemsPerPage\n }\"\n >\n <span class=\"wz-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n </div>\n </div>\n</div>\n"
3716
+ template: "<div class=\"wz-pagination\" *ngIf=\"pagination && pagination.itemsPerPage\">\n <div class=\"wz-pagination__wrapper\">\n <div class=\"wz-pagination__wrapper__page\">\n <p>{{ 'PaginationComponent.page' | translate }}</p>\n\n <wz-page-selector [pagination]=\"pagination\" [totalItems]=\"pagination.totalItems\" (pageChange)=\"onGotoPageChange($event)\"></wz-page-selector>\n </div>\n\n <div class=\"wz-pagination__wrapper__elements\">\n <p>{{ pagination.currentPage | customPagniationText: pagination.totalItems:pagination.itemsPerPage }}</p>\n </div>\n\n <div class=\"wz-pagination__wrapper__arrows\">\n <div\n (click)=\"decrementPage()\"\n class=\"wz-pagination__wrapper__arrows__arrow wz-pagination__wrapper__arrows__arrow--left\"\n [ngClass]=\"{ 'wz-pagination__wrapper__arrows__arrow--disabled': pagination.currentPage === 1 }\"\n >\n <span class=\"wz-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n <div\n (click)=\"incrementPage()\"\n class=\"wz-pagination__wrapper__arrows__arrow wz-pagination__wrapper__arrows__arrow--right\"\n [ngClass]=\"{\n 'wz-pagination__wrapper__arrows__arrow--disabled':\n pagination.currentPage | IsLastPage: pagination.totalItems:pagination.itemsPerPage\n }\"\n >\n <span class=\"wz-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n </div>\n </div>\n</div>\n"
3707
3717
  }),
3708
3718
  __metadata("design:paramtypes", [])
3709
3719
  ], PaginationComponent);
@@ -4422,6 +4432,118 @@
4422
4432
  return NumberToArray;
4423
4433
  }());
4424
4434
 
4435
+ var PageSelectorComponent = /** @class */ (function () {
4436
+ function PageSelectorComponent() {
4437
+ this.openAbsoluteSelect = false;
4438
+ this.largeNumberOfPage = false;
4439
+ this.numberOfPage = 0;
4440
+ this.pageChange = new core.EventEmitter();
4441
+ }
4442
+ Object.defineProperty(PageSelectorComponent.prototype, "pagination", {
4443
+ get: function () {
4444
+ return this._pagination;
4445
+ },
4446
+ set: function (pagination) {
4447
+ this._pagination = pagination;
4448
+ },
4449
+ enumerable: true,
4450
+ configurable: true
4451
+ });
4452
+ Object.defineProperty(PageSelectorComponent.prototype, "totalItems", {
4453
+ get: function () {
4454
+ return this._totalItems;
4455
+ },
4456
+ set: function (totalItems) {
4457
+ this.numberOfPage = Math.ceil(totalItems / this.pagination.itemsPerPage);
4458
+ this.largeNumberOfPage = this.numberOfPage > 30;
4459
+ },
4460
+ enumerable: true,
4461
+ configurable: true
4462
+ });
4463
+ PageSelectorComponent.prototype.onGotoPageChange = function (event, directValue) {
4464
+ if (directValue) {
4465
+ this.pageChange.emit(event);
4466
+ this.openAbsoluteSelect = false;
4467
+ }
4468
+ else {
4469
+ this.pageChange.emit(parseInt(event.target.value));
4470
+ }
4471
+ };
4472
+ __decorate([
4473
+ core.Input(),
4474
+ __metadata("design:type", Object),
4475
+ __metadata("design:paramtypes", [Object])
4476
+ ], PageSelectorComponent.prototype, "pagination", null);
4477
+ __decorate([
4478
+ core.Input(),
4479
+ __metadata("design:type", Number),
4480
+ __metadata("design:paramtypes", [Number])
4481
+ ], PageSelectorComponent.prototype, "totalItems", null);
4482
+ __decorate([
4483
+ core.Output(),
4484
+ __metadata("design:type", core.EventEmitter)
4485
+ ], PageSelectorComponent.prototype, "pageChange", void 0);
4486
+ PageSelectorComponent = __decorate([
4487
+ core.Component({
4488
+ selector: 'wz-page-selector',
4489
+ template: "<div class=\"wz-selector\">\n\n <div class=\"wz-selector__default\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\">\n <div class=\"wz-selector__default__base\" *ngIf=\"largeNumberOfPage;\" (click)=\"openAbsoluteSelect = !openAbsoluteSelect\">\n <input name=\"page-input\" [value]=\"pagination.currentPage\" (change)=\"onGotoPageChange($event, false);openAbsoluteSelect = false;\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\" />\n <i class=\"fas fa-sort-down\"></i>\n </div>\n <div class=\"wz-selector__default__absolute\" *ngIf=\"openAbsoluteSelect\">\n <div class=\"wz-selector__default__absolute__wrapper\" *ngFor=\"let pageIndex of (pagination.totalItems | LargeNumberOfPage: pagination.itemsPerPage : pagination.currentPage).slice().reverse() as result\">\n <div class=\"wz-selector__default__absolute__wrapper__item\" [ngClass]=\"{'selected': pageIndex.value === pagination.currentPage}\" (click)=\"onGotoPageChange(pageIndex.value, true)\">\n <span>{{ pageIndex.display }}</span>\n </div>\n </div>\n </div>\n </div>\n\n <ng-container *ngIf=\"!largeNumberOfPage\">\n <select name=\"page\" (change)=\"onGotoPageChange($event, false)\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\">\n <ng-container *ngFor=\"let pageIndex of pagination.totalItems | ArrayTotalPages: pagination.itemsPerPage\">\n <option [selected]=\"pageIndex === pagination.currentPage\" [value]=\"pageIndex\">\n {{ pageIndex }}\n </option>\n </ng-container>\n </select>\n </ng-container>\n</div>\n"
4490
+ }),
4491
+ __metadata("design:paramtypes", [])
4492
+ ], PageSelectorComponent);
4493
+ return PageSelectorComponent;
4494
+ }());
4495
+
4496
+ var LargeNumberOfPagePipe = /** @class */ (function () {
4497
+ function LargeNumberOfPagePipe() {
4498
+ }
4499
+ /**
4500
+ * Return an incremental array
4501
+ * Display 30 pages, from -15 to +15 of the current page
4502
+ * @param totalItems
4503
+ * @param itemsPerPage
4504
+ */
4505
+ LargeNumberOfPagePipe.prototype.transform = function (totalItems, itemsPerPage, currentPage) {
4506
+ if (!(totalItems >= 0 && itemsPerPage >= 0)) {
4507
+ throw new Error('totalItems or itemsPerPage missing in ArrayTotalPages pipe.');
4508
+ }
4509
+ var arrayLength = 32;
4510
+ var startAtPage = currentPage <= 15 ? 0 : currentPage - 15;
4511
+ var totalPage = Math.ceil(totalItems / itemsPerPage);
4512
+ var arrayWithPageNumber = Array.apply(null, { length: arrayLength })
4513
+ .map(Number.call, Number)
4514
+ .map(function (x) {
4515
+ var pageIndex = {
4516
+ display: startAtPage + x + 1,
4517
+ value: startAtPage + x + 1
4518
+ };
4519
+ if (x === arrayLength - 2) {
4520
+ pageIndex.display = '...';
4521
+ }
4522
+ if (x === arrayLength - 1) {
4523
+ pageIndex.display = totalPage;
4524
+ pageIndex.value = totalPage;
4525
+ }
4526
+ return pageIndex;
4527
+ });
4528
+ if (startAtPage) {
4529
+ arrayWithPageNumber.unshift({
4530
+ display: 1,
4531
+ value: 1
4532
+ }, {
4533
+ display: "...",
4534
+ value: 2
4535
+ });
4536
+ }
4537
+ return arrayWithPageNumber;
4538
+ };
4539
+ LargeNumberOfPagePipe = __decorate([
4540
+ core.Pipe({
4541
+ name: 'LargeNumberOfPage'
4542
+ })
4543
+ ], LargeNumberOfPagePipe);
4544
+ return LargeNumberOfPagePipe;
4545
+ }());
4546
+
4425
4547
  ;
4426
4548
  var components = [
4427
4549
  WzImgManagerComponent,
@@ -4444,7 +4566,8 @@
4444
4566
  InputSearchComponent,
4445
4567
  PaginationComponent,
4446
4568
  CheckboxComponent,
4447
- AlertComponent
4569
+ AlertComponent,
4570
+ PageSelectorComponent,
4448
4571
  ];
4449
4572
  var directives = [
4450
4573
  DragDropDirective,
@@ -4463,7 +4586,8 @@
4463
4586
  PagniationIsLastPage,
4464
4587
  PagniationText,
4465
4588
  ImageSrcPipe,
4466
- NumberToArray
4589
+ NumberToArray,
4590
+ LargeNumberOfPagePipe
4467
4591
  ];
4468
4592
  var WzImgManagerModule = /** @class */ (function () {
4469
4593
  function WzImgManagerModule() {
@@ -4538,21 +4662,23 @@
4538
4662
  exports.ɵbd = PaginationComponent;
4539
4663
  exports.ɵbe = CheckboxComponent;
4540
4664
  exports.ɵbf = AlertComponent;
4541
- exports.ɵbg = DragDropDirective;
4542
- exports.ɵbh = LoadingDirective;
4543
- exports.ɵbi = AutoHideDirective;
4544
- exports.ɵbj = CopyClipboardDirective;
4545
- exports.ɵbk = TableColumn;
4546
- exports.ɵbl = CheckBoxRow;
4547
- exports.ɵbm = TableColumnHeader;
4548
- exports.ɵbn = TableRow;
4549
- exports.ɵbo = AbstractDebounceDirective;
4550
- exports.ɵbp = DebounceKeyupDirective;
4551
- exports.ɵbq = PagniationArrayTotalPages;
4552
- exports.ɵbr = PagniationIsLastPage;
4553
- exports.ɵbs = PagniationText;
4554
- exports.ɵbt = ImageSrcPipe;
4555
- exports.ɵbu = NumberToArray;
4665
+ exports.ɵbg = PageSelectorComponent;
4666
+ exports.ɵbh = DragDropDirective;
4667
+ exports.ɵbi = LoadingDirective;
4668
+ exports.ɵbj = AutoHideDirective;
4669
+ exports.ɵbk = CopyClipboardDirective;
4670
+ exports.ɵbl = TableColumn;
4671
+ exports.ɵbm = CheckBoxRow;
4672
+ exports.ɵbn = TableColumnHeader;
4673
+ exports.ɵbo = TableRow;
4674
+ exports.ɵbp = AbstractDebounceDirective;
4675
+ exports.ɵbq = DebounceKeyupDirective;
4676
+ exports.ɵbr = PagniationArrayTotalPages;
4677
+ exports.ɵbs = PagniationIsLastPage;
4678
+ exports.ɵbt = PagniationText;
4679
+ exports.ɵbu = ImageSrcPipe;
4680
+ exports.ɵbv = NumberToArray;
4681
+ exports.ɵbw = LargeNumberOfPagePipe;
4556
4682
  exports.ɵc = UserSettingsService;
4557
4683
  exports.ɵd = ImgEventService;
4558
4684
  exports.ɵe = DomService;