@wizishop/angular-components 0.0.126 → 0.0.129

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.
@@ -3135,6 +3135,17 @@
3135
3135
  this.onChange = function () { };
3136
3136
  this.onTouch = function () { };
3137
3137
  }
3138
+ Object.defineProperty(SelectComponent.prototype, "items", {
3139
+ get: function () {
3140
+ return this._items;
3141
+ },
3142
+ set: function (items) {
3143
+ this._items = items;
3144
+ this.setIndexItemSelected();
3145
+ },
3146
+ enumerable: false,
3147
+ configurable: true
3148
+ });
3138
3149
  Object.defineProperty(SelectComponent.prototype, "callToAction", {
3139
3150
  get: function () {
3140
3151
  return this._calllToAction;
@@ -3146,7 +3157,6 @@
3146
3157
  configurable: true
3147
3158
  });
3148
3159
  SelectComponent.prototype.ngOnInit = function () {
3149
- this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
3150
3160
  };
3151
3161
  SelectComponent.prototype.onClose = function () {
3152
3162
  this.openCategories = false;
@@ -3156,7 +3166,7 @@
3156
3166
  };
3157
3167
  SelectComponent.prototype.onSelectItem = function (id) {
3158
3168
  this.unselectAll();
3159
- this.setIndexItemSelected(id);
3169
+ this.setIndexItemSelectedById(id);
3160
3170
  var itemSelected = this.getItemSelected();
3161
3171
  itemSelected.selected = true;
3162
3172
  this.selectValue.emit(this.indexItemSelected);
@@ -3182,16 +3192,19 @@
3182
3192
  SelectComponent.prototype.unselectAll = function () {
3183
3193
  this.items.forEach(function (item) { return item.selected = false; });
3184
3194
  };
3185
- SelectComponent.prototype.setIndexItemSelected = function (id) {
3195
+ SelectComponent.prototype.setIndexItemSelectedById = function (id) {
3186
3196
  this.indexItemSelected = this.items.findIndex(function (item) { return item.id === id; });
3187
3197
  };
3198
+ SelectComponent.prototype.setIndexItemSelected = function () {
3199
+ this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
3200
+ };
3188
3201
  SelectComponent.prototype.writeValue = function (selectItem) {
3189
3202
  if (!selectItem) {
3190
3203
  return;
3191
3204
  }
3192
3205
  this.unselectAll();
3193
3206
  selectItem.selected = true;
3194
- this.setIndexItemSelected(selectItem.id);
3207
+ this.setIndexItemSelectedById(selectItem.id);
3195
3208
  };
3196
3209
  SelectComponent.prototype.registerOnChange = function (fn) {
3197
3210
  this.onChange = fn;
@@ -3962,7 +3975,7 @@
3962
3975
  SelectedListComponent.decorators = [
3963
3976
  { type: i0.Component, args: [{
3964
3977
  selector: 'wac-selected-list',
3965
- 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 <span [innerHTML]=\"textSelectAll\" (click)=\"onSelectAll()\"></span>\n <div class=\"selected-list__wrapper__head__button\">\n <wac-button\n [icon]=\"'fad 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]=\"'fad 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"
3966
3979
  },] }
3967
3980
  ];
3968
3981
  SelectedListComponent.propDecorators = {