@wizishop/angular-components 0.0.62 → 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.
@@ -3683,6 +3683,71 @@
3683
3683
  searchFocusOut: [{ type: i0.Output }]
3684
3684
  };
3685
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
+
3686
3751
  var components = [
3687
3752
  TagComponent,
3688
3753
  TabComponent,
@@ -3723,7 +3788,8 @@
3723
3788
  FiltersComponent,
3724
3789
  WrapperBlocsComponent,
3725
3790
  SnackbarComponent,
3726
- SearchComponent
3791
+ SearchComponent,
3792
+ SelectedListComponent
3727
3793
  ];
3728
3794
  var exportsFromModule = [
3729
3795
  PaginationComponent,
@@ -3839,6 +3905,7 @@
3839
3905
  exports.SearchComponent = SearchComponent;
3840
3906
  exports.SelectComponent = SelectComponent;
3841
3907
  exports.SelectInTextComponent = SelectInTextComponent;
3908
+ exports.SelectedListComponent = SelectedListComponent;
3842
3909
  exports.SeparatorComponent = SeparatorComponent;
3843
3910
  exports.SettingsComponent = SettingsComponent;
3844
3911
  exports.SharedComponentsModule = SharedComponentsModule;