@wizishop/img-manager 0.2.76 → 0.2.77

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 (27) hide show
  1. package/bundles/wizishop-img-manager.umd.js +136 -20
  2. package/bundles/wizishop-img-manager.umd.js.map +1 -1
  3. package/bundles/wizishop-img-manager.umd.min.js +1 -1
  4. package/bundles/wizishop-img-manager.umd.min.js.map +1 -1
  5. package/esm2015/lib/components/shared/pagination/page-selector/page-selector.component.js +55 -0
  6. package/esm2015/lib/components/shared/pagination/pagination.component.js +4 -4
  7. package/esm2015/lib/pipes/pagination/large-number-of-page/large-number-of-page.pipe.js +51 -0
  8. package/esm2015/lib/wz-img-manager.module.js +7 -3
  9. package/esm2015/wizishop-img-manager.js +18 -16
  10. package/esm5/lib/components/shared/pagination/page-selector/page-selector.component.js +64 -0
  11. package/esm5/lib/components/shared/pagination/pagination.component.js +4 -4
  12. package/esm5/lib/pipes/pagination/large-number-of-page/large-number-of-page.pipe.js +54 -0
  13. package/esm5/lib/wz-img-manager.module.js +7 -3
  14. package/esm5/wizishop-img-manager.js +18 -16
  15. package/fesm2015/wizishop-img-manager.js +108 -6
  16. package/fesm2015/wizishop-img-manager.js.map +1 -1
  17. package/fesm5/wizishop-img-manager.js +120 -6
  18. package/fesm5/wizishop-img-manager.js.map +1 -1
  19. package/lib/components/shared/pagination/page-selector/page-selector.component.d.ts +20 -0
  20. package/lib/components/shared/pagination/pagination.component.d.ts +1 -1
  21. package/lib/pipes/pagination/large-number-of-page/large-number-of-page.pipe.d.ts +10 -0
  22. package/package.json +1 -1
  23. package/wizishop-img-manager-0.2.77.tgz +0 -0
  24. package/wizishop-img-manager.d.ts +17 -15
  25. package/wizishop-img-manager.metadata.json +1 -1
  26. package/wz-img-manager.scss +2117 -2046
  27. package/wizishop-img-manager-0.2.76.tgz +0 -0
@@ -3494,8 +3494,8 @@ var PaginationComponent = /** @class */ (function () {
3494
3494
  this.pagination.currentPage++;
3495
3495
  this.pageChange.emit(this.pagination);
3496
3496
  };
3497
- PaginationComponent.prototype.onGotoPageChange = function (event) {
3498
- this.pagination.currentPage = parseInt(event.target.value);
3497
+ PaginationComponent.prototype.onGotoPageChange = function (pageNumber) {
3498
+ this.pagination.currentPage = parseInt(pageNumber);
3499
3499
  this.pageChange.emit(this.pagination);
3500
3500
  };
3501
3501
  __decorate([
@@ -3510,7 +3510,7 @@ var PaginationComponent = /** @class */ (function () {
3510
3510
  PaginationComponent = __decorate([
3511
3511
  Component({
3512
3512
  selector: 'wz-pagination',
3513
- 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"
3513
+ 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"
3514
3514
  }),
3515
3515
  __metadata("design:paramtypes", [])
3516
3516
  ], PaginationComponent);
@@ -4229,6 +4229,118 @@ var NumberToArray = /** @class */ (function () {
4229
4229
  return NumberToArray;
4230
4230
  }());
4231
4231
 
4232
+ var PageSelectorComponent = /** @class */ (function () {
4233
+ function PageSelectorComponent() {
4234
+ this.openAbsoluteSelect = false;
4235
+ this.largeNumberOfPage = false;
4236
+ this.numberOfPage = 0;
4237
+ this.pageChange = new EventEmitter();
4238
+ }
4239
+ Object.defineProperty(PageSelectorComponent.prototype, "pagination", {
4240
+ get: function () {
4241
+ return this._pagination;
4242
+ },
4243
+ set: function (pagination) {
4244
+ this._pagination = pagination;
4245
+ },
4246
+ enumerable: true,
4247
+ configurable: true
4248
+ });
4249
+ Object.defineProperty(PageSelectorComponent.prototype, "totalItems", {
4250
+ get: function () {
4251
+ return this._totalItems;
4252
+ },
4253
+ set: function (totalItems) {
4254
+ this.numberOfPage = Math.ceil(totalItems / this.pagination.itemsPerPage);
4255
+ this.largeNumberOfPage = this.numberOfPage > 30;
4256
+ },
4257
+ enumerable: true,
4258
+ configurable: true
4259
+ });
4260
+ PageSelectorComponent.prototype.onGotoPageChange = function (event, directValue) {
4261
+ if (directValue) {
4262
+ this.pageChange.emit(event);
4263
+ this.openAbsoluteSelect = false;
4264
+ }
4265
+ else {
4266
+ this.pageChange.emit(parseInt(event.target.value));
4267
+ }
4268
+ };
4269
+ __decorate([
4270
+ Input(),
4271
+ __metadata("design:type", Object),
4272
+ __metadata("design:paramtypes", [Object])
4273
+ ], PageSelectorComponent.prototype, "pagination", null);
4274
+ __decorate([
4275
+ Input(),
4276
+ __metadata("design:type", Number),
4277
+ __metadata("design:paramtypes", [Number])
4278
+ ], PageSelectorComponent.prototype, "totalItems", null);
4279
+ __decorate([
4280
+ Output(),
4281
+ __metadata("design:type", EventEmitter)
4282
+ ], PageSelectorComponent.prototype, "pageChange", void 0);
4283
+ PageSelectorComponent = __decorate([
4284
+ Component({
4285
+ selector: 'wz-page-selector',
4286
+ 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"
4287
+ }),
4288
+ __metadata("design:paramtypes", [])
4289
+ ], PageSelectorComponent);
4290
+ return PageSelectorComponent;
4291
+ }());
4292
+
4293
+ var LargeNumberOfPagePipe = /** @class */ (function () {
4294
+ function LargeNumberOfPagePipe() {
4295
+ }
4296
+ /**
4297
+ * Return an incremental array
4298
+ * Display 30 pages, from -15 to +15 of the current page
4299
+ * @param totalItems
4300
+ * @param itemsPerPage
4301
+ */
4302
+ LargeNumberOfPagePipe.prototype.transform = function (totalItems, itemsPerPage, currentPage) {
4303
+ if (!(totalItems >= 0 && itemsPerPage >= 0)) {
4304
+ throw new Error('totalItems or itemsPerPage missing in ArrayTotalPages pipe.');
4305
+ }
4306
+ var arrayLength = 32;
4307
+ var startAtPage = currentPage <= 15 ? 0 : currentPage - 15;
4308
+ var totalPage = Math.ceil(totalItems / itemsPerPage);
4309
+ var arrayWithPageNumber = Array.apply(null, { length: arrayLength })
4310
+ .map(Number.call, Number)
4311
+ .map(function (x) {
4312
+ var pageIndex = {
4313
+ display: startAtPage + x + 1,
4314
+ value: startAtPage + x + 1
4315
+ };
4316
+ if (x === arrayLength - 2) {
4317
+ pageIndex.display = '...';
4318
+ }
4319
+ if (x === arrayLength - 1) {
4320
+ pageIndex.display = totalPage;
4321
+ pageIndex.value = totalPage;
4322
+ }
4323
+ return pageIndex;
4324
+ });
4325
+ if (startAtPage) {
4326
+ arrayWithPageNumber.unshift({
4327
+ display: 1,
4328
+ value: 1
4329
+ }, {
4330
+ display: "...",
4331
+ value: 2
4332
+ });
4333
+ }
4334
+ return arrayWithPageNumber;
4335
+ };
4336
+ LargeNumberOfPagePipe = __decorate([
4337
+ Pipe({
4338
+ name: 'LargeNumberOfPage'
4339
+ })
4340
+ ], LargeNumberOfPagePipe);
4341
+ return LargeNumberOfPagePipe;
4342
+ }());
4343
+
4232
4344
  ;
4233
4345
  var components = [
4234
4346
  WzImgManagerComponent,
@@ -4251,7 +4363,8 @@ var components = [
4251
4363
  InputSearchComponent,
4252
4364
  PaginationComponent,
4253
4365
  CheckboxComponent,
4254
- AlertComponent
4366
+ AlertComponent,
4367
+ PageSelectorComponent,
4255
4368
  ];
4256
4369
  var directives = [
4257
4370
  DragDropDirective,
@@ -4270,7 +4383,8 @@ var pipes = [
4270
4383
  PagniationIsLastPage,
4271
4384
  PagniationText,
4272
4385
  ImageSrcPipe,
4273
- NumberToArray
4386
+ NumberToArray,
4387
+ LargeNumberOfPagePipe
4274
4388
  ];
4275
4389
  var WzImgManagerModule = /** @class */ (function () {
4276
4390
  function WzImgManagerModule() {
@@ -4335,5 +4449,5 @@ var ImgCDNConfigDTO = /** @class */ (function () {
4335
4449
  * Generated bundle index. Do not edit.
4336
4450
  */
4337
4451
 
4338
- export { CanvaButtonApi, CanvaService, ImgApiDto, ImgCDNConfigDTO, ImgManagerConfigDto, ImgManagerService, ImgSelectionService, RenamePictureService, WzImgManagerComponent, WzImgManagerModule, ImgManagerConfigService as ɵa, ImgCDNService as ɵb, TableComponent as ɵba, FiltersTableService as ɵbb, InputSearchComponent as ɵbc, PaginationComponent as ɵbd, CheckboxComponent as ɵbe, AlertComponent as ɵbf, DragDropDirective as ɵbg, LoadingDirective as ɵbh, AutoHideDirective as ɵbi, CopyClipboardDirective as ɵbj, TableColumn as ɵbk, CheckBoxRow as ɵbl, TableColumnHeader as ɵbm, TableRow as ɵbn, AbstractDebounceDirective as ɵbo, DebounceKeyupDirective as ɵbp, PagniationArrayTotalPages as ɵbq, PagniationIsLastPage as ɵbr, PagniationText as ɵbs, ImageSrcPipe as ɵbt, NumberToArray as ɵbu, UserSettingsService as ɵc, ImgEventService as ɵd, DomService as ɵe, ImgTabsComponent as ɵf, AlertService as ɵg, ImgUploadComponent as ɵh, easeInOut as ɵi, PexelLibComponent as ɵj, listAnnimation as ɵk, PexelsService as ɵl, ImgCardComponent as ɵm, ImagesActionHandler as ɵn, UploadListComponent as ɵo, ImgEditorComponent as ɵp, EditorInfoSectionComponent as ɵq, CanvaBtnComponent as ɵr, ImgSelectionComponent as ɵs, LoaderComponent as ɵt, DropdownComponent as ɵu, CropperComponent as ɵv, insertRemove as ɵw, ImagesViewComponent as ɵx, MosaicViewComponent as ɵy, TableViewComponent as ɵz };
4452
+ export { CanvaButtonApi, CanvaService, ImgApiDto, ImgCDNConfigDTO, ImgManagerConfigDto, ImgManagerService, ImgSelectionService, RenamePictureService, WzImgManagerComponent, WzImgManagerModule, ImgManagerConfigService as ɵa, ImgCDNService as ɵb, TableComponent as ɵba, FiltersTableService as ɵbb, InputSearchComponent as ɵbc, PaginationComponent as ɵbd, CheckboxComponent as ɵbe, AlertComponent as ɵbf, PageSelectorComponent as ɵbg, DragDropDirective as ɵbh, LoadingDirective as ɵbi, AutoHideDirective as ɵbj, CopyClipboardDirective as ɵbk, TableColumn as ɵbl, CheckBoxRow as ɵbm, TableColumnHeader as ɵbn, TableRow as ɵbo, AbstractDebounceDirective as ɵbp, DebounceKeyupDirective as ɵbq, PagniationArrayTotalPages as ɵbr, PagniationIsLastPage as ɵbs, PagniationText as ɵbt, ImageSrcPipe as ɵbu, NumberToArray as ɵbv, LargeNumberOfPagePipe as ɵbw, UserSettingsService as ɵc, ImgEventService as ɵd, DomService as ɵe, ImgTabsComponent as ɵf, AlertService as ɵg, ImgUploadComponent as ɵh, easeInOut as ɵi, PexelLibComponent as ɵj, listAnnimation as ɵk, PexelsService as ɵl, ImgCardComponent as ɵm, ImagesActionHandler as ɵn, UploadListComponent as ɵo, ImgEditorComponent as ɵp, EditorInfoSectionComponent as ɵq, CanvaBtnComponent as ɵr, ImgSelectionComponent as ɵs, LoaderComponent as ɵt, DropdownComponent as ɵu, CropperComponent as ɵv, insertRemove as ɵw, ImagesViewComponent as ɵx, MosaicViewComponent as ɵy, TableViewComponent as ɵz };
4339
4453
  //# sourceMappingURL=wizishop-img-manager.js.map