@wizishop/angular-components 0.0.50 → 0.0.54

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.
@@ -915,9 +915,14 @@
915
915
  this.disabled = false;
916
916
  this.whiteSpaceNowrap = false;
917
917
  this.opacity = false;
918
+ this.animation = false;
919
+ this.animationRight = false;
920
+ this.animationText = '';
918
921
  this.click = new i0.EventEmitter();
919
922
  this.isLoading = false;
920
923
  this.interval = null;
924
+ this.buttonMaxWidth = '0px';
925
+ this.buttonWidth = '0px';
921
926
  this.currentLoading = 0;
922
927
  }
923
928
  ButtonComponent.prototype.launchLoading = function () {
@@ -940,6 +945,12 @@
940
945
  }
941
946
  }, 200);
942
947
  };
948
+ ButtonComponent.prototype.addMaxWidth = function (size) {
949
+ this.buttonMaxWidth = size + 'px';
950
+ };
951
+ ButtonComponent.prototype.resetMaxWidth = function () {
952
+ this.buttonMaxWidth = '0px';
953
+ };
943
954
  ButtonComponent.prototype.onButtonClick = function (event) {
944
955
  event.stopPropagation();
945
956
  if (!this.disabled) {
@@ -949,12 +960,20 @@
949
960
  this.click.emit(event);
950
961
  }
951
962
  };
963
+ ButtonComponent.prototype.ngAfterViewInit = function () {
964
+ var _this = this;
965
+ setTimeout(function () {
966
+ if (_this.animation) {
967
+ _this.buttonWidth = _this.calculWidth.nativeElement.offsetWidth;
968
+ }
969
+ }, 0);
970
+ };
952
971
  return ButtonComponent;
953
972
  }());
954
973
  ButtonComponent.decorators = [
955
974
  { type: i0.Component, args: [{
956
975
  selector: 'wac-button',
957
- template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"onButtonClick($event)\"\n [ngClass]=\"[label === '' ? 'alone' : '', isLoading ? 'is-loading' : '', opacity ? 'opacity' : '', disabled ? 'disabled' : '', widthAuto ? 'width-auto' : '', whiteSpaceNowrap ? 'white-space-no-wrap' : '']\"\n>\n <span class=\"wac-button__wrapper\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n <span\n class=\"wac-button__loader\"\n [ngClass]=\"extraClasses.includes('is-outlined') ? 'outlined' : ''\"\n *ngIf=\"isLoading || interval !== null\"\n [style.width]=\"currentLoading + '%'\"\n >\n <span *ngIf=\"extraClasses.includes('is-outlined')\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n </span>\n</a>\n"
976
+ template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"onButtonClick($event)\"\n (mouseleave)=\"animation ? resetMaxWidth() : ''\"\n (mouseenter)=\"animation ? addMaxWidth(animationText.length * 7 + 30) : ''\"\n [ngClass]=\"[label === '' ? 'alone' : '',animationRight ? 'animation-right' : '', animation ? 'animationText' : '', isLoading ? 'is-loading' : '', opacity ? 'opacity' : '', disabled ? 'disabled' : '', widthAuto ? 'width-auto' : '', whiteSpaceNowrap ? 'white-space-no-wrap' : '']\"\n>\n <span class=\"wac-button__wrapper\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n <span class=\"wac-button__animation\" [style.maxWidth]=\"buttonMaxWidth\" [style.width]=\"buttonWidth + 'px'\">\n <span #calculWidth class=\"wac-button__animation__text\" [innerHTML]=\"animationText\"></span>\n </span>\n <span\n class=\"wac-button__loader\"\n [ngClass]=\"extraClasses.includes('is-outlined') ? 'outlined' : ''\"\n *ngIf=\"isLoading || interval !== null\"\n [style.width]=\"currentLoading + '%'\"\n >\n <span *ngIf=\"extraClasses.includes('is-outlined')\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n\n </span>\n</a>\n"
958
977
  },] }
959
978
  ];
960
979
  ButtonComponent.ctorParameters = function () { return []; };
@@ -969,7 +988,11 @@
969
988
  disabled: [{ type: i0.Input }],
970
989
  whiteSpaceNowrap: [{ type: i0.Input }],
971
990
  opacity: [{ type: i0.Input }],
972
- click: [{ type: i0.Output }]
991
+ animation: [{ type: i0.Input }],
992
+ animationRight: [{ type: i0.Input }],
993
+ animationText: [{ type: i0.Input }],
994
+ click: [{ type: i0.Output }],
995
+ calculWidth: [{ type: i0.ViewChild, args: ['calculWidth',] }]
973
996
  };
974
997
 
975
998
  var InfoComponent = /** @class */ (function () {
@@ -3362,14 +3385,14 @@
3362
3385
  FiltersComponent.prototype.activeFilter = function (index) {
3363
3386
  this.options[index].active = true;
3364
3387
  this.filterActiveIndex = '' + index;
3365
- this.filterChange.emit(true);
3388
+ this.filterChange.emit(index);
3366
3389
  };
3367
3390
  FiltersComponent.prototype.resetFilter = function () {
3368
3391
  this.options.forEach(function (item) {
3369
3392
  item.active = false;
3370
3393
  });
3371
3394
  this.filterActiveIndex = null;
3372
- this.filterChange.emit(true);
3395
+ this.filterChange.emit(-1);
3373
3396
  };
3374
3397
  return FiltersComponent;
3375
3398
  }());