@wizishop/angular-components 0.0.52 → 0.0.53

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.
@@ -230,10 +230,16 @@
230
230
  r[k] = a[j];
231
231
  return r;
232
232
  }
233
- function __spreadArray(to, from) {
234
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235
- to[j] = from[i];
236
- return to;
233
+ function __spreadArray(to, from, pack) {
234
+ if (pack || arguments.length === 2)
235
+ for (var i = 0, l = from.length, ar; i < l; i++) {
236
+ if (ar || !(i in from)) {
237
+ if (!ar)
238
+ ar = Array.prototype.slice.call(from, 0, i);
239
+ ar[i] = from[i];
240
+ }
241
+ }
242
+ return to.concat(ar || Array.prototype.slice.call(from));
237
243
  }
238
244
  function __await(v) {
239
245
  return this instanceof __await ? (this.v = v, this) : new __await(v);
@@ -909,9 +915,13 @@
909
915
  this.disabled = false;
910
916
  this.whiteSpaceNowrap = false;
911
917
  this.opacity = false;
918
+ this.animation = false;
919
+ this.animationRight = false;
920
+ this.animationText = '';
912
921
  this.click = new i0.EventEmitter();
913
922
  this.isLoading = false;
914
923
  this.interval = null;
924
+ this.buttonMaxWidth = '0px';
915
925
  this.currentLoading = 0;
916
926
  }
917
927
  ButtonComponent.prototype.launchLoading = function () {
@@ -934,6 +944,12 @@
934
944
  }
935
945
  }, 200);
936
946
  };
947
+ ButtonComponent.prototype.addMaxWidth = function (size) {
948
+ this.buttonMaxWidth = size + 'px';
949
+ };
950
+ ButtonComponent.prototype.resetMaxWidth = function () {
951
+ this.buttonMaxWidth = '0px';
952
+ };
937
953
  ButtonComponent.prototype.onButtonClick = function (event) {
938
954
  event.stopPropagation();
939
955
  if (!this.disabled) {
@@ -948,7 +964,7 @@
948
964
  ButtonComponent.decorators = [
949
965
  { type: i0.Component, args: [{
950
966
  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"
967
+ 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]=\"animationText.length * 7 + 30 + 'px'\" *ngIf=\"animation && !label\">\n <span 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
968
  },] }
953
969
  ];
954
970
  ButtonComponent.ctorParameters = function () { return []; };
@@ -963,6 +979,9 @@
963
979
  disabled: [{ type: i0.Input }],
964
980
  whiteSpaceNowrap: [{ type: i0.Input }],
965
981
  opacity: [{ type: i0.Input }],
982
+ animation: [{ type: i0.Input }],
983
+ animationRight: [{ type: i0.Input }],
984
+ animationText: [{ type: i0.Input }],
966
985
  click: [{ type: i0.Output }]
967
986
  };
968
987