@wizishop/angular-components 0.0.51 → 0.0.55

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.
@@ -909,9 +909,14 @@
909
909
  this.disabled = false;
910
910
  this.whiteSpaceNowrap = false;
911
911
  this.opacity = false;
912
+ this.animation = false;
913
+ this.animationRight = false;
914
+ this.animationText = '';
912
915
  this.click = new i0.EventEmitter();
913
916
  this.isLoading = false;
914
917
  this.interval = null;
918
+ this.buttonMaxWidth = '0px';
919
+ this.buttonWidth = '0px';
915
920
  this.currentLoading = 0;
916
921
  }
917
922
  ButtonComponent.prototype.launchLoading = function () {
@@ -934,6 +939,12 @@
934
939
  }
935
940
  }, 200);
936
941
  };
942
+ ButtonComponent.prototype.addMaxWidth = function () {
943
+ this.buttonMaxWidth = this.buttonWidth + 'px';
944
+ };
945
+ ButtonComponent.prototype.resetMaxWidth = function () {
946
+ this.buttonMaxWidth = '0px';
947
+ };
937
948
  ButtonComponent.prototype.onButtonClick = function (event) {
938
949
  event.stopPropagation();
939
950
  if (!this.disabled) {
@@ -943,12 +954,20 @@
943
954
  this.click.emit(event);
944
955
  }
945
956
  };
957
+ ButtonComponent.prototype.ngAfterViewInit = function () {
958
+ var _this = this;
959
+ setTimeout(function () {
960
+ if (_this.animation) {
961
+ _this.buttonWidth = _this.calculWidth.nativeElement.offsetWidth;
962
+ }
963
+ }, 0);
964
+ };
946
965
  return ButtonComponent;
947
966
  }());
948
967
  ButtonComponent.decorators = [
949
968
  { type: i0.Component, args: [{
950
969
  selector: 'wac-button',
951
- 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"
970
+ template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"onButtonClick($event)\"\n (mouseleave)=\"animation ? resetMaxWidth() : ''\"\n (mouseenter)=\"animation ? addMaxWidth() : ''\"\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"
952
971
  },] }
953
972
  ];
954
973
  ButtonComponent.ctorParameters = function () { return []; };
@@ -963,7 +982,11 @@
963
982
  disabled: [{ type: i0.Input }],
964
983
  whiteSpaceNowrap: [{ type: i0.Input }],
965
984
  opacity: [{ type: i0.Input }],
966
- click: [{ type: i0.Output }]
985
+ animation: [{ type: i0.Input }],
986
+ animationRight: [{ type: i0.Input }],
987
+ animationText: [{ type: i0.Input }],
988
+ click: [{ type: i0.Output }],
989
+ calculWidth: [{ type: i0.ViewChild, args: ['calculWidth',] }]
967
990
  };
968
991
 
969
992
  var InfoComponent = /** @class */ (function () {