@wizishop/angular-components 0.0.167 → 0.0.168

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.
@@ -1 +1 @@
1
- {"wac.datatable.noresult":"There are no results for this search","wac.input.progressbar.information.good":"Very good","wac.input.progressbar.information.too.long":"Too long","wac.input.progressbar.information.too.short":"Too short","wac.PaginationComponent.on":"{{low}}-{{high}} of {{total}}","wac.PaginationComponent.page":"Go to page","wac.simpleSearchComponent.error":"The search field is compulsory"}
1
+ {"wac.datatable.noresult":"There are no results for this search","wac.input.progressbar.information.good":"Very good","wac.input.progressbar.information.too.long":"Too long","wac.input.progressbar.information.too.short":"Too short","wac.MosaicComponent.import":"Import","wac.PaginationComponent.on":"{{low}}-{{high}} of {{total}}","wac.PaginationComponent.page":"Go to page","wac.simpleSearchComponent.error":"The search field is compulsory"}
@@ -1 +1 @@
1
- {"wac.datatable.noresult":"Il n'y a aucun résultat pour cette recherche","wac.input.progressbar.information.good":"Très bien","wac.input.progressbar.information.too.long":"Trop long","wac.input.progressbar.information.too.short":"Trop court","wac.PaginationComponent.on":"{{low}}-{{high}} sur {{total}}","wac.PaginationComponent.page":"Aller à la page","wac.simpleSearchComponent.error":"Le champ de recherche est obligatoire"}
1
+ {"wac.datatable.noresult":"Il n'y a aucun résultat pour cette recherche","wac.input.progressbar.information.good":"Très bien","wac.input.progressbar.information.too.long":"Trop long","wac.input.progressbar.information.too.short":"Trop court","wac.MosaicComponent.import":"Importer","wac.PaginationComponent.on":"{{low}}-{{high}} sur {{total}}","wac.PaginationComponent.page":"Aller à la page","wac.simpleSearchComponent.error":"Le champ de recherche est obligatoire"}
@@ -4389,43 +4389,53 @@
4389
4389
 
4390
4390
  var MosaicComponent = /** @class */ (function () {
4391
4391
  function MosaicComponent() {
4392
- this.isLoading = true;
4393
- this.import = new i0.EventEmitter();
4392
+ this._imagesList = [];
4393
+ this.isLoading = false;
4394
+ this.numberOfColumn = 3;
4395
+ this.importImageSrc = new i0.EventEmitter();
4394
4396
  }
4395
- MosaicComponent.prototype.ngOnInit = function () {
4396
- if (this.items) {
4397
- var splitItems = this.sliceIntoChunks(this.items, (this.items.length / 3));
4398
- this.columnLeft = splitItems[0];
4399
- this.columnCenter = splitItems[1];
4400
- this.columnRight = splitItems[2];
4397
+ Object.defineProperty(MosaicComponent.prototype, "imagesList", {
4398
+ get: function () {
4399
+ return this._imagesList;
4400
+ },
4401
+ set: function (imagesList) {
4402
+ this._imagesList = imagesList;
4403
+ this.generateColumns();
4404
+ },
4405
+ enumerable: false,
4406
+ configurable: true
4407
+ });
4408
+ MosaicComponent.prototype.generateColumns = function () {
4409
+ this.columns = this.sliceIntoChunks();
4410
+ };
4411
+ MosaicComponent.prototype.sliceIntoChunks = function () {
4412
+ var columns = [];
4413
+ var numberOfImagePerColumn = this.imagesList.length / this.numberOfColumn;
4414
+ for (var i = 0; i < this.imagesList.length; i += numberOfImagePerColumn) {
4415
+ var chunk = this.imagesList.slice(i, i + numberOfImagePerColumn);
4416
+ columns.push(chunk);
4401
4417
  }
4402
- this.isLoading = false;
4418
+ return columns;
4403
4419
  };
4404
- MosaicComponent.prototype.emitIndex = function (index) {
4405
- this.import.emit(index);
4406
- };
4407
- MosaicComponent.prototype.sliceIntoChunks = function (arr, chunkSize) {
4408
- var res = [];
4409
- for (var i = 0; i < arr.length; i += chunkSize) {
4410
- var chunk = arr.slice(i, i + chunkSize);
4411
- res.push(chunk);
4412
- }
4413
- return res;
4420
+ MosaicComponent.prototype.onImportImage = function (src) {
4421
+ this.importImageSrc.emit(src);
4414
4422
  };
4415
4423
  return MosaicComponent;
4416
4424
  }());
4417
4425
  MosaicComponent.decorators = [
4418
4426
  { type: i0.Component, args: [{
4419
4427
  selector: 'wac-mosaic',
4420
- template: "<div class=\"wac-mosaic__loader\" *ngIf=\"isLoading\">\n <wac-loader></wac-loader>\n</div>\n<div class=\"wac-mosaic\" *ngIf=\"!isLoading\">\n <div class=\"wac-mosaic__wrapper\">\n <div class=\"wac-mosaic__wrapper__column\" *ngIf=\"columnLeft\">\n <div class=\"wac-mosaic__wrapper__column__item\" *ngFor=\"let img of columnLeft; let i = index;\">\n <img [src]=\"img\" />\n <div class=\"hover\">\n <wac-button [icon]=\"iconButtons\" [label]=\"labelButtons\" [extraClasses]=\"'is-success'\" (click)=\"emitIndex(i)\"></wac-button>\n </div>\n </div>\n </div>\n <div class=\"wac-mosaic__wrapper__column\" *ngIf=\"columnCenter\" >\n <div class=\"wac-mosaic__wrapper__column__item\" *ngFor=\"let img of columnCenter; let i = index;\">\n <img [src]=\"img\" />\n <div class=\"hover\">\n <wac-button [icon]=\"iconButtons\" [label]=\"labelButtons\" [extraClasses]=\"'is-success'\" (click)=\"emitIndex(i + this.columnLeft.length)\"></wac-button>\n </div>\n </div>\n </div>\n <div class=\"wac-mosaic__wrapper__column\" *ngIf=\"columnRight\">\n <div class=\"wac-mosaic__wrapper__column__item\" *ngFor=\"let img of columnRight; let i = index;\">\n <img [src]=\"img\" />\n <div class=\"hover\">\n <wac-button [icon]=\"iconButtons\" [label]=\"labelButtons\" [extraClasses]=\"'is-success'\" (click)=\"emitIndex(i + this.columnLeft.length + this.columnCenter.length)\"></wac-button>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
4428
+ template: "<div class=\"wac-mosaic__loader\" *ngIf=\"isLoading\">\n <wac-loader></wac-loader>\n</div>\n<div class=\"wac-mosaic\" *ngIf=\"!isLoading\">\n <div class=\"wac-mosaic__wrapper\">\n <div class=\"wac-mosaic__wrapper__column\" *ngFor=\"let column of columns\">\n <div class=\"wac-mosaic__wrapper__column__image\" *ngFor=\"let image of column; let i = index;\">\n <img [src]=\"image.src\" [alt]=\"image.alt\"/>\n <div class=\"hover\">\n <ng-container\n [ngTemplateOutlet]=\"importButtonTemplate || defaultImportButton\"\n [ngTemplateOutletContext]=\"{ $implicit: image }\"\n >\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #defaultImportButton let-image>\n <wac-button [icon]=\"'fa-solid fa-image'\" [label]=\"'wac.MosaicComponent.import' | translate\" [extraClasses]=\"'is-success'\" (click)=\"onImportImage(image.src)\"></wac-button>\n</ng-template>\n",
4429
+ encapsulation: i0.ViewEncapsulation.None
4421
4430
  },] }
4422
4431
  ];
4423
4432
  MosaicComponent.ctorParameters = function () { return []; };
4424
4433
  MosaicComponent.propDecorators = {
4425
- items: [{ type: i0.Input }],
4426
- labelButtons: [{ type: i0.Input }],
4427
- iconButtons: [{ type: i0.Input }],
4428
- import: [{ type: i0.Output }]
4434
+ imagesList: [{ type: i0.Input }],
4435
+ isLoading: [{ type: i0.Input }],
4436
+ numberOfColumn: [{ type: i0.Input }],
4437
+ importButtonTemplate: [{ type: i0.Input }],
4438
+ importImageSrc: [{ type: i0.Output }]
4429
4439
  };
4430
4440
 
4431
4441
  var components = [