@wizishop/angular-components 0.0.125 → 0.0.128

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.
@@ -633,7 +633,28 @@
633
633
  ngVar: [{ type: i0.Input }]
634
634
  };
635
635
 
636
- var directives = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective];
636
+ var KeypressEnterDirective = /** @class */ (function () {
637
+ function KeypressEnterDirective() {
638
+ this.KEYPRESS_ENTER = "Enter";
639
+ this.keypressEnter = new i0.EventEmitter();
640
+ }
641
+ KeypressEnterDirective.prototype.onKeypress = function (event) {
642
+ if (event.key === this.KEYPRESS_ENTER) {
643
+ this.keypressEnter.next(true);
644
+ }
645
+ };
646
+ return KeypressEnterDirective;
647
+ }());
648
+ KeypressEnterDirective.decorators = [
649
+ { type: i0.Directive, args: [{ selector: '[keypressEnter]' },] }
650
+ ];
651
+ KeypressEnterDirective.ctorParameters = function () { return []; };
652
+ KeypressEnterDirective.propDecorators = {
653
+ onKeypress: [{ type: i0.HostListener, args: ['keypress', ['$event'],] }],
654
+ keypressEnter: [{ type: i0.Output }]
655
+ };
656
+
657
+ var directives = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective];
637
658
  var SharedDirectives = /** @class */ (function () {
638
659
  function SharedDirectives() {
639
660
  }
@@ -3114,6 +3135,17 @@
3114
3135
  this.onChange = function () { };
3115
3136
  this.onTouch = function () { };
3116
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
+ });
3117
3149
  Object.defineProperty(SelectComponent.prototype, "callToAction", {
3118
3150
  get: function () {
3119
3151
  return this._calllToAction;
@@ -3125,7 +3157,6 @@
3125
3157
  configurable: true
3126
3158
  });
3127
3159
  SelectComponent.prototype.ngOnInit = function () {
3128
- this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
3129
3160
  };
3130
3161
  SelectComponent.prototype.onClose = function () {
3131
3162
  this.openCategories = false;
@@ -3135,7 +3166,7 @@
3135
3166
  };
3136
3167
  SelectComponent.prototype.onSelectItem = function (id) {
3137
3168
  this.unselectAll();
3138
- this.setIndexItemSelected(id);
3169
+ this.setIndexItemSelectedById(id);
3139
3170
  var itemSelected = this.getItemSelected();
3140
3171
  itemSelected.selected = true;
3141
3172
  this.selectValue.emit(this.indexItemSelected);
@@ -3161,16 +3192,19 @@
3161
3192
  SelectComponent.prototype.unselectAll = function () {
3162
3193
  this.items.forEach(function (item) { return item.selected = false; });
3163
3194
  };
3164
- SelectComponent.prototype.setIndexItemSelected = function (id) {
3195
+ SelectComponent.prototype.setIndexItemSelectedById = function (id) {
3165
3196
  this.indexItemSelected = this.items.findIndex(function (item) { return item.id === id; });
3166
3197
  };
3198
+ SelectComponent.prototype.setIndexItemSelected = function () {
3199
+ this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
3200
+ };
3167
3201
  SelectComponent.prototype.writeValue = function (selectItem) {
3168
3202
  if (!selectItem) {
3169
3203
  return;
3170
3204
  }
3171
3205
  this.unselectAll();
3172
3206
  selectItem.selected = true;
3173
- this.setIndexItemSelected(selectItem.id);
3207
+ this.setIndexItemSelectedById(selectItem.id);
3174
3208
  };
3175
3209
  SelectComponent.prototype.registerOnChange = function (fn) {
3176
3210
  this.onChange = fn;
@@ -4303,6 +4337,7 @@
4303
4337
  exports.InputComponent = InputComponent;
4304
4338
  exports.InputSearchComponent = InputSearchComponent;
4305
4339
  exports.InputWithSelectComponent = InputWithSelectComponent;
4340
+ exports.KeypressEnterDirective = KeypressEnterDirective;
4306
4341
  exports.LabelComponent = LabelComponent;
4307
4342
  exports.LinkComponent = LinkComponent;
4308
4343
  exports.LoaderComponent = LoaderComponent;