@wizishop/angular-components 0.0.59 → 0.0.63

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 () {
@@ -3605,6 +3607,147 @@
3605
3607
  },] }
3606
3608
  ];
3607
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
+
3686
+ var SelectedListComponent = /** @class */ (function () {
3687
+ function SelectedListComponent() {
3688
+ this.enableSelectAll = true;
3689
+ this.selectedItems = new i0.EventEmitter();
3690
+ this.selectedOptionIndex = [];
3691
+ this.switchSelectAll = false;
3692
+ }
3693
+ SelectedListComponent.prototype.ngOnInit = function () {
3694
+ if (typeof this.options !== typeof undefined) {
3695
+ this.checkSelectedItem();
3696
+ if (this.selectedOptionIndex.length === this.options.length) {
3697
+ this.switchSelectAll = true;
3698
+ }
3699
+ }
3700
+ };
3701
+ SelectedListComponent.prototype.selectAll = function () {
3702
+ var _this = this;
3703
+ this.selectedOptionIndex = [];
3704
+ this.options.forEach(function (eln, i) {
3705
+ _this.options[i].active = true;
3706
+ _this.selectedOptionIndex.push(i);
3707
+ });
3708
+ this.switchSelectAll = true;
3709
+ this.selectedItems.emit(this.selectedOptionIndex);
3710
+ };
3711
+ SelectedListComponent.prototype.checkSelectedItem = function () {
3712
+ var _this = this;
3713
+ this.selectedOptionIndex = [];
3714
+ this.options.forEach(function (eln, i) {
3715
+ if (eln.active) {
3716
+ _this.selectedOptionIndex.push(i);
3717
+ }
3718
+ });
3719
+ };
3720
+ SelectedListComponent.prototype.unSelectAll = function () {
3721
+ var _this = this;
3722
+ this.selectedOptionIndex = [];
3723
+ this.options.forEach(function (eln, i) {
3724
+ _this.options[i].active = false;
3725
+ });
3726
+ this.switchSelectAll = false;
3727
+ this.selectedItems.emit(this.selectedOptionIndex);
3728
+ };
3729
+ SelectedListComponent.prototype.selectItem = function (i) {
3730
+ this.options[i].active = !this.options[i].active;
3731
+ this.checkSelectedItem();
3732
+ this.selectedItems.emit(this.selectedOptionIndex);
3733
+ };
3734
+ return SelectedListComponent;
3735
+ }());
3736
+ SelectedListComponent.decorators = [
3737
+ { type: i0.Component, args: [{
3738
+ selector: 'wac-selected-list',
3739
+ template: "<div class=\"selected-list\">\n <div class=\"selected-list__wrapper\">\n <div class=\"selected-list__wrapper__head\">\n <p *ngIf=\"label\" [innerHTML]=\"label\"></p>\n <span *ngIf=\"textSelectAll && !switchSelectAll\" [innerHTML]=\"textSelectAll\" (click)=\"selectAll()\"></span>\n <span *ngIf=\"textUnSelectAll && switchSelectAll\" [innerHTML]=\"textUnSelectAll\" (click)=\"unSelectAll()\"></span>\n </div>\n <div class=\"selected-list__wrapper__content\">\n <div class=\"selected-list__wrapper__content__item\" *ngFor=\"let item of options;let i = index;\" [ngClass]=\"{'active': item.active}\" (click)=\"selectItem(i)\">\n <span [innerHTML]=\"item.label\"></span>\n <i class=\"fas fa-check\"></i>\n </div>\n </div>\n </div>\n</div>\n"
3740
+ },] }
3741
+ ];
3742
+ SelectedListComponent.propDecorators = {
3743
+ options: [{ type: i0.Input }],
3744
+ label: [{ type: i0.Input }],
3745
+ textSelectAll: [{ type: i0.Input }],
3746
+ textUnSelectAll: [{ type: i0.Input }],
3747
+ enableSelectAll: [{ type: i0.Input }],
3748
+ selectedItems: [{ type: i0.Output }]
3749
+ };
3750
+
3608
3751
  var components = [
3609
3752
  TagComponent,
3610
3753
  TabComponent,
@@ -3644,7 +3787,9 @@
3644
3787
  WrapperComponent,
3645
3788
  FiltersComponent,
3646
3789
  WrapperBlocsComponent,
3647
- SnackbarComponent
3790
+ SnackbarComponent,
3791
+ SearchComponent,
3792
+ SelectedListComponent
3648
3793
  ];
3649
3794
  var exportsFromModule = [
3650
3795
  PaginationComponent,
@@ -3757,8 +3902,10 @@
3757
3902
  exports.PopinComponent = PopinComponent;
3758
3903
  exports.ProgressBarComponent = ProgressBarComponent;
3759
3904
  exports.RadioComponent = RadioComponent;
3905
+ exports.SearchComponent = SearchComponent;
3760
3906
  exports.SelectComponent = SelectComponent;
3761
3907
  exports.SelectInTextComponent = SelectInTextComponent;
3908
+ exports.SelectedListComponent = SelectedListComponent;
3762
3909
  exports.SeparatorComponent = SeparatorComponent;
3763
3910
  exports.SettingsComponent = SettingsComponent;
3764
3911
  exports.SharedComponentsModule = SharedComponentsModule;