@wizishop/angular-components 0.0.60 → 0.0.64

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.
@@ -3607,6 +3607,147 @@
3607
3607
  },] }
3608
3608
  ];
3609
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.id === 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.checked }\" (click)=\"onSelectItem(index, item.id, 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].checked = 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.checked) {
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].checked = false;
3725
+ });
3726
+ this.switchSelectAll = false;
3727
+ this.selectedItems.emit(this.selectedOptionIndex);
3728
+ };
3729
+ SelectedListComponent.prototype.selectItem = function (i) {
3730
+ this.options[i].checked = !this.options[i].checked;
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.checked}\" (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
+
3610
3751
  var components = [
3611
3752
  TagComponent,
3612
3753
  TabComponent,
@@ -3646,7 +3787,9 @@
3646
3787
  WrapperComponent,
3647
3788
  FiltersComponent,
3648
3789
  WrapperBlocsComponent,
3649
- SnackbarComponent
3790
+ SnackbarComponent,
3791
+ SearchComponent,
3792
+ SelectedListComponent
3650
3793
  ];
3651
3794
  var exportsFromModule = [
3652
3795
  PaginationComponent,
@@ -3759,8 +3902,10 @@
3759
3902
  exports.PopinComponent = PopinComponent;
3760
3903
  exports.ProgressBarComponent = ProgressBarComponent;
3761
3904
  exports.RadioComponent = RadioComponent;
3905
+ exports.SearchComponent = SearchComponent;
3762
3906
  exports.SelectComponent = SelectComponent;
3763
3907
  exports.SelectInTextComponent = SelectInTextComponent;
3908
+ exports.SelectedListComponent = SelectedListComponent;
3764
3909
  exports.SeparatorComponent = SeparatorComponent;
3765
3910
  exports.SettingsComponent = SettingsComponent;
3766
3911
  exports.SharedComponentsModule = SharedComponentsModule;