@wizishop/angular-components 0.0.58 → 0.0.62

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.
@@ -848,6 +848,7 @@
848
848
  this.label = '';
849
849
  this.hasClose = false;
850
850
  this.isOpen = true;
851
+ this.big = false;
851
852
  }
852
853
  TagComponent.prototype.closeTag = function () {
853
854
  if (this.hasClose) {
@@ -859,14 +860,15 @@
859
860
  TagComponent.decorators = [
860
861
  { type: i0.Component, args: [{
861
862
  selector: 'wac-tag',
862
- template: "<div class=\"wac-tag\" [classList]=\"'wac-tag--' + class\" [ngClass]=\"{ hover: hasClose }\" *ngIf=\"isOpen\" (click)=\"closeTag()\">\n {{ label }}\n <span *ngIf=\"hasClose\"><i class=\"fas fa-times\"></i></span>\n</div>\n"
863
+ template: "<div class=\"wac-tag\" [classList]=\"'wac-tag--' + class\" [ngClass]=\"{ hover: hasClose, 'big': big }\" *ngIf=\"isOpen\" (click)=\"closeTag()\">\n {{ label }}\n <span *ngIf=\"hasClose\"><i class=\"fas fa-times\"></i></span>\n</div>\n"
863
864
  },] }
864
865
  ];
865
866
  TagComponent.ctorParameters = function () { return []; };
866
867
  TagComponent.propDecorators = {
867
868
  label: [{ type: i0.Input }],
868
869
  class: [{ type: i0.Input }],
869
- hasClose: [{ type: i0.Input }]
870
+ hasClose: [{ type: i0.Input }],
871
+ big: [{ type: i0.Input }]
870
872
  };
871
873
 
872
874
  var TabComponent = /** @class */ (function () {
@@ -912,13 +914,24 @@
912
914
  this.animation = false;
913
915
  this.animationRight = false;
914
916
  this.animationText = '';
917
+ this.confirmDelete = false;
918
+ this.confirmDeleteText = '';
919
+ this.confirmDeletePosition = 'right';
915
920
  this.click = new i0.EventEmitter();
916
921
  this.isLoading = false;
917
922
  this.interval = null;
923
+ this.waitForConfirmDelete = false;
918
924
  this.buttonMaxWidth = '0px';
919
925
  this.buttonWidth = '0px';
926
+ this.buttonMaxWidthDelete = '0px';
927
+ this.buttonWidthDelete = '0px';
920
928
  this.currentLoading = 0;
921
929
  }
930
+ ButtonComponent.prototype.ngOnInit = function () {
931
+ if (this.confirmDelete) {
932
+ this.waitForConfirmDelete = true;
933
+ }
934
+ };
922
935
  ButtonComponent.prototype.launchLoading = function () {
923
936
  var _this = this;
924
937
  if (this.isLoading || this.interval !== null) {
@@ -945,13 +958,29 @@
945
958
  ButtonComponent.prototype.resetMaxWidth = function () {
946
959
  this.buttonMaxWidth = '0px';
947
960
  };
961
+ ButtonComponent.prototype.addMaxWidthDelete = function () {
962
+ this.buttonMaxWidthDelete = this.buttonWidthDelete + 'px';
963
+ console.log('here', this.buttonMaxWidthDelete);
964
+ };
965
+ ButtonComponent.prototype.resetMaxWidthDelete = function () {
966
+ this.buttonMaxWidthDelete = '0px';
967
+ this.waitForConfirmDelete = true;
968
+ };
948
969
  ButtonComponent.prototype.onButtonClick = function (event) {
949
970
  event.stopPropagation();
950
971
  if (!this.disabled) {
951
972
  if (this.hasLoader) {
952
973
  this.launchLoading();
953
974
  }
954
- this.click.emit(event);
975
+ if (!this.waitForConfirmDelete) {
976
+ this.click.emit(event);
977
+ if (this.confirmDelete) {
978
+ this.resetMaxWidthDelete();
979
+ }
980
+ }
981
+ else {
982
+ this.waitForConfirmDelete = false;
983
+ }
955
984
  }
956
985
  };
957
986
  ButtonComponent.prototype.ngAfterViewInit = function () {
@@ -960,6 +989,10 @@
960
989
  if (_this.animation) {
961
990
  _this.buttonWidth = _this.calculWidth.nativeElement.offsetWidth;
962
991
  }
992
+ if (_this.confirmDelete) {
993
+ _this.buttonWidthDelete = _this.calculWidthDelete.nativeElement.offsetWidth;
994
+ console.log('here2', _this.buttonWidthDelete);
995
+ }
963
996
  }, 1000);
964
997
  };
965
998
  return ButtonComponent;
@@ -967,7 +1000,7 @@
967
1000
  ButtonComponent.decorators = [
968
1001
  { type: i0.Component, args: [{
969
1002
  selector: 'wac-button',
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"
1003
+ template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"confirmDelete && waitForConfirmDelete ? addMaxWidthDelete() : '';onButtonClick($event);\"\n (mouseleave)=\"animation ? resetMaxWidth() : '';\"\n (mouseenter)=\"animation ? addMaxWidth() : '';\"\n wzAutoHide (clickOutside)=\"confirmDelete && !waitForConfirmDelete ? resetMaxWidthDelete() : ''\"\n [ngClass]=\"[label === '' ? 'alone' : '',animationRight ? 'animation-right' : '', animation ? 'animationText' : '', isLoading ? 'is-loading' : '', opacity ? 'opacity' : '', disabled ? 'disabled' : '', widthAuto ? 'width-auto' : '', whiteSpaceNowrap ? 'white-space-no-wrap' : '', !waitForConfirmDelete && confirmDelete ? 'step-delete' : '', confirmDelete ? 'deletePosition-' + confirmDeletePosition : '']\"\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 class=\"wac-button__confirmDelete\" [style.maxWidth]=\"buttonMaxWidthDelete\" [style.width]=\"buttonWidthDelete + 'px'\">\n <span #calculWidthDelete class=\"wac-button__confirmDelete__text\" [innerHTML]=\"confirmDeleteText\"></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"
971
1004
  },] }
972
1005
  ];
973
1006
  ButtonComponent.ctorParameters = function () { return []; };
@@ -985,8 +1018,12 @@
985
1018
  animation: [{ type: i0.Input }],
986
1019
  animationRight: [{ type: i0.Input }],
987
1020
  animationText: [{ type: i0.Input }],
1021
+ confirmDelete: [{ type: i0.Input }],
1022
+ confirmDeleteText: [{ type: i0.Input }],
1023
+ confirmDeletePosition: [{ type: i0.Input }],
988
1024
  click: [{ type: i0.Output }],
989
- calculWidth: [{ type: i0.ViewChild, args: ['calculWidth',] }]
1025
+ calculWidth: [{ type: i0.ViewChild, args: ['calculWidth',] }],
1026
+ calculWidthDelete: [{ type: i0.ViewChild, args: ['calculWidthDelete',] }]
990
1027
  };
991
1028
 
992
1029
  var InfoComponent = /** @class */ (function () {
@@ -3570,6 +3607,82 @@
3570
3607
  },] }
3571
3608
  ];
3572
3609
 
3610
+ var SearchComponent = /** @class */ (function () {
3611
+ function SearchComponent() {
3612
+ this.alwaysOpen = false;
3613
+ this.disableSearchIn = false;
3614
+ this.emptyResult = '';
3615
+ this.search = '';
3616
+ this.openSelect = false;
3617
+ this.selectValue = new i0.EventEmitter();
3618
+ this.searchKeyUp = new i0.EventEmitter();
3619
+ this.searchFocusOut = new i0.EventEmitter();
3620
+ }
3621
+ SearchComponent.prototype.ngOnInit = function () {
3622
+ this.triggerOptions = this.options;
3623
+ };
3624
+ SearchComponent.prototype.onClose = function () {
3625
+ this.openSelect = false;
3626
+ };
3627
+ SearchComponent.prototype.setSearchValueToQuery = function (value) {
3628
+ var _this = this;
3629
+ this.search = value.target.value;
3630
+ if (this.disableSearchIn) {
3631
+ this.triggerOptions = this.options;
3632
+ }
3633
+ else {
3634
+ if (this.search.length > 0) {
3635
+ this.openSelect = true;
3636
+ this.triggerOptions = this.options.filter(function (element) { return element.label.toLowerCase().indexOf(_this.search.toLowerCase()) !== -1; });
3637
+ }
3638
+ else {
3639
+ this.triggerOptions = this.options;
3640
+ }
3641
+ }
3642
+ this.searchKeyUp.emit(this.search);
3643
+ };
3644
+ SearchComponent.prototype.sendEventFocusOut = function () {
3645
+ this.searchFocusOut.emit(this.search);
3646
+ };
3647
+ SearchComponent.prototype.closeSelect = function () {
3648
+ this.openSelect = false;
3649
+ };
3650
+ SearchComponent.prototype.onSelectItem = function (index, value, label) {
3651
+ this.search = '';
3652
+ this.openSelect = false;
3653
+ if (this.disableSearchIn) {
3654
+ this.selectValue.emit(index);
3655
+ }
3656
+ else {
3657
+ var findInOption = this.options.findIndex(function (element) { return element.label === label && element.value === value; });
3658
+ this.selectValue.emit(findInOption);
3659
+ }
3660
+ };
3661
+ SearchComponent.prototype.resetAllVue = function () {
3662
+ this.search = '';
3663
+ this.closeSelect();
3664
+ };
3665
+ return SearchComponent;
3666
+ }());
3667
+ SearchComponent.decorators = [
3668
+ { type: i0.Component, args: [{
3669
+ selector: 'wac-search',
3670
+ template: "<div class=\"wac-search\" [ngClass]=\"{ open: openSelect || alwaysOpen }\" [zIndexToggle]=\"openSelect\" wzAutoHide (clickOutside)=\"closeSelect()\">\n <div class=\"wac-search__wrapper\">\n <button><i class=\"fal fa-search\"></i></button>\n <input [value]=\"search\" type=\"text\" required [placeholder]=\"placeholder\" (focus)=\"openSelect = true;\" (focusout)=\"sendEventFocusOut()\" (keyup)=\"setSearchValueToQuery($event)\" />\n </div>\n <div class=\"wac-search__absolute\" *ngIf=\"triggerOptions\" [ngClass]=\"{'hidden': !openSelect}\">\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\" *ngIf=\"triggerOptions.length > 0\">\n <div (click)=\"onClose()\" class=\"wac-select__content__item\" *ngFor=\"let item of triggerOptions; let index = index;\">\n <div [ngClass]=\"{ selected: item.active }\" (click)=\"onSelectItem(index, item.value, item.label)\">\n {{ item.label }}\n </div>\n </div>\n </perfect-scrollbar>\n <div class=\"wac-select__content__empty\" *ngIf=\"triggerOptions.length === 0\">\n <span *ngIf=\"emptyResult\">{{emptyResult}}</span>\n </div>\n </div>\n</div>\n"
3671
+ },] }
3672
+ ];
3673
+ SearchComponent.ctorParameters = function () { return []; };
3674
+ SearchComponent.propDecorators = {
3675
+ placeholder: [{ type: i0.Input }],
3676
+ alwaysOpen: [{ type: i0.Input }],
3677
+ label: [{ type: i0.Input }],
3678
+ options: [{ type: i0.Input }],
3679
+ disableSearchIn: [{ type: i0.Input }],
3680
+ emptyResult: [{ type: i0.Input }],
3681
+ selectValue: [{ type: i0.Output }],
3682
+ searchKeyUp: [{ type: i0.Output }],
3683
+ searchFocusOut: [{ type: i0.Output }]
3684
+ };
3685
+
3573
3686
  var components = [
3574
3687
  TagComponent,
3575
3688
  TabComponent,
@@ -3609,7 +3722,8 @@
3609
3722
  WrapperComponent,
3610
3723
  FiltersComponent,
3611
3724
  WrapperBlocsComponent,
3612
- SnackbarComponent
3725
+ SnackbarComponent,
3726
+ SearchComponent
3613
3727
  ];
3614
3728
  var exportsFromModule = [
3615
3729
  PaginationComponent,
@@ -3722,6 +3836,7 @@
3722
3836
  exports.PopinComponent = PopinComponent;
3723
3837
  exports.ProgressBarComponent = ProgressBarComponent;
3724
3838
  exports.RadioComponent = RadioComponent;
3839
+ exports.SearchComponent = SearchComponent;
3725
3840
  exports.SelectComponent = SelectComponent;
3726
3841
  exports.SelectInTextComponent = SelectInTextComponent;
3727
3842
  exports.SeparatorComponent = SeparatorComponent;