@wizishop/angular-components 0.0.127 → 0.0.130

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.
@@ -3141,7 +3141,7 @@
3141
3141
  },
3142
3142
  set: function (items) {
3143
3143
  this._items = items;
3144
- this.indexItemSelected = -1;
3144
+ this.setIndexItemSelected();
3145
3145
  },
3146
3146
  enumerable: false,
3147
3147
  configurable: true
@@ -3157,7 +3157,6 @@
3157
3157
  configurable: true
3158
3158
  });
3159
3159
  SelectComponent.prototype.ngOnInit = function () {
3160
- this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
3161
3160
  };
3162
3161
  SelectComponent.prototype.onClose = function () {
3163
3162
  this.openCategories = false;
@@ -3167,7 +3166,7 @@
3167
3166
  };
3168
3167
  SelectComponent.prototype.onSelectItem = function (id) {
3169
3168
  this.unselectAll();
3170
- this.setIndexItemSelected(id);
3169
+ this.setIndexItemSelectedById(id);
3171
3170
  var itemSelected = this.getItemSelected();
3172
3171
  itemSelected.selected = true;
3173
3172
  this.selectValue.emit(this.indexItemSelected);
@@ -3193,16 +3192,19 @@
3193
3192
  SelectComponent.prototype.unselectAll = function () {
3194
3193
  this.items.forEach(function (item) { return item.selected = false; });
3195
3194
  };
3196
- SelectComponent.prototype.setIndexItemSelected = function (id) {
3195
+ SelectComponent.prototype.setIndexItemSelectedById = function (id) {
3197
3196
  this.indexItemSelected = this.items.findIndex(function (item) { return item.id === id; });
3198
3197
  };
3198
+ SelectComponent.prototype.setIndexItemSelected = function () {
3199
+ this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
3200
+ };
3199
3201
  SelectComponent.prototype.writeValue = function (selectItem) {
3200
3202
  if (!selectItem) {
3201
3203
  return;
3202
3204
  }
3203
3205
  this.unselectAll();
3204
3206
  selectItem.selected = true;
3205
- this.setIndexItemSelected(selectItem.id);
3207
+ this.setIndexItemSelectedById(selectItem.id);
3206
3208
  };
3207
3209
  SelectComponent.prototype.registerOnChange = function (fn) {
3208
3210
  this.onChange = fn;
@@ -3973,7 +3975,7 @@
3973
3975
  SelectedListComponent.decorators = [
3974
3976
  { type: i0.Component, args: [{
3975
3977
  selector: 'wac-selected-list',
3976
- 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 <ng-container *ngVar=\"(options | areAllOptionsSelected) as areAllOptionsSelected\">\n <ng-container *ngIf=\"textSelectAll && !areAllOptionsSelected\">\n\n <span [innerHTML]=\"textSelectAll\" (click)=\"onSelectAll()\"></span>\n <div class=\"selected-list__wrapper__head__button\">\n <wac-button\n [extraClasses]=\"'is-grey'\"\n [icon]=\"'fa-duotone fa-check-double'\"\n (click)=\"onSelectAll()\"\n >\n </wac-button>\n </div>\n\n </ng-container>\n\n <ng-container *ngIf=\"textUnSelectAll && areAllOptionsSelected\">\n <span [innerHTML]=\"textUnSelectAll\" (click)=\"onUnSelectAll()\"></span>\n <div class=\"selected-list__wrapper__head__button\">\n <wac-button\n [extraClasses]=\"'is-grey'\"\n [icon]=\"'fa-duotone fa-check-double'\"\n (click)=\"onUnSelectAll()\"\n >\n </wac-button>\n </div>\n </ng-container>\n\n </ng-container>\n\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)=\"onSelectItem(i)\">\n <span [innerHTML]=\"item.label\"></span>\n <i class=\"fas fa-check\"></i>\n </div>\n </div>\n </div>\n</div>\n"
3978
+ 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 <ng-container *ngVar=\"(options | areAllOptionsSelected) as areAllOptionsSelected\">\n <ng-container *ngIf=\"textSelectAll && !areAllOptionsSelected\">\n\n <div class=\"selected-list__wrapper__head__button\">\n\n <div class=\"selected-list__wrapper__head__button__notMobile\">\n <wac-button\n [label]=\"textSelectAll\"\n (click)=\"onSelectAll()\"\n >\n </wac-button>\n </div>\n\n <div class=\"selected-list__wrapper__head__button__mobile\">\n <wac-button\n [extraClasses]=\"'is-grey'\"\n [icon]=\"'fad fa-check-double'\"\n (click)=\"onSelectAll()\"\n >\n </wac-button>\n </div>\n\n </div>\n\n </ng-container>\n\n <ng-container *ngIf=\"textUnSelectAll && areAllOptionsSelected\">\n\n <div class=\"selected-list__wrapper__head__button\">\n\n <div class=\"selected-list__wrapper__head__button__notMobile\">\n <wac-button\n [extraClasses]=\"'is-info'\"\n [label]=\"textUnSelectAll\"\n (click)=\"onUnSelectAll()\"\n >\n </wac-button>\n </div>\n\n <div class=\"selected-list__wrapper__head__button__mobile\">\n <wac-button\n [extraClasses]=\"'is-grey'\"\n [icon]=\"'fad fa-check-double'\"\n (click)=\"onUnSelectAll()\"\n >\n </wac-button>\n </div>\n\n </div>\n\n </ng-container>\n\n </ng-container>\n\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)=\"onSelectItem(i)\">\n <span [innerHTML]=\"item.label\"></span>\n <i class=\"fas fa-check\"></i>\n </div>\n </div>\n </div>\n</div>\n"
3977
3979
  },] }
3978
3980
  ];
3979
3981
  SelectedListComponent.propDecorators = {