@colijnit/corecomponents_v12 260.1.6 → 260.1.8

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.
@@ -12052,6 +12052,7 @@
12052
12052
  var _a, _b, _c;
12053
12053
  return __awaiter(this, void 0, void 0, function () {
12054
12054
  var _d;
12055
+ var _this = this;
12055
12056
  return __generator(this, function (_e) {
12056
12057
  switch (_e.label) {
12057
12058
  case 0:
@@ -12076,8 +12077,13 @@
12076
12077
  this.isLoading = false;
12077
12078
  return [2 /*return*/, []];
12078
12079
  }
12079
- this.filteredCollection = (_a = this.collection) === null || _a === void 0 ? void 0 : _a.filter(function () {
12080
- return true;
12080
+ this.filteredCollection = (_a = this.collection) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
12081
+ if (_this.collectionLoadFnProp && _this.collectionLoadFnProp.length > 0) {
12082
+ return item[_this.collectionLoadFnProp] && item[_this.collectionLoadFnProp].toLowerCase().includes(text.toLowerCase());
12083
+ }
12084
+ else {
12085
+ return true;
12086
+ }
12081
12087
  });
12082
12088
  (((_b = this.filteredCollection) === null || _b === void 0 ? void 0 : _b.length) > 0 && ((_c = this.filterText) === null || _c === void 0 ? void 0 : _c.length) > 2) ? this.openPopup() : this.closePopup();
12083
12089
  this.isLoading = false;
@@ -12255,6 +12261,7 @@
12255
12261
  optionIcon: [{ type: i0.Input }],
12256
12262
  collection: [{ type: i0.Input }],
12257
12263
  collectionLoadFn: [{ type: i0.Input }],
12264
+ collectionLoadFnProp: [{ type: i0.Input }],
12258
12265
  leftIconData: [{ type: i0.Input }],
12259
12266
  searchPlaceholder: [{ type: i0.Input }],
12260
12267
  label: [{ type: i0.Input }],
@@ -12425,6 +12432,7 @@
12425
12432
  },
12426
12433
  set: function (value) {
12427
12434
  this._collection = value || [];
12435
+ this.activeItem = this.collection[0];
12428
12436
  },
12429
12437
  enumerable: false,
12430
12438
  configurable: true
@@ -12463,7 +12471,7 @@
12463
12471
  ListOfIconsComponent.decorators = [
12464
12472
  { type: i0.Component, args: [{
12465
12473
  selector: 'co-list-of-icons',
12466
- template: "\n <div class=\"icon-item active\" [class.menu-opened]=\"showMenu\" (click)=\"toggleMenu()\">\n <co-icon [iconData]=\"activeItem.icon\" [style.width.px]=\"iconSize\" [style.height.px]=\"iconSize\"></co-icon>\n <co-icon *ngIf=\"!showMenu\" class=\"drop-arrow\" [iconData]=\"icons.getIcon(Icon.CaretDownSolid)\"></co-icon>\n <co-icon *ngIf=\"showMenu\" class=\"drop-arrow\" [iconData]=\"icons.getIcon(Icon.CaretUpSolid)\"></co-icon>\n </div>\n <div class=\"dropdown-menu\" *ngIf=\"showMenu\" (clickOutside)=\"onClickOutside()\">\n <div class=\"icon-item\" *ngFor=\"let item of collection\" (click)=\"selectItem(item)\"\n [class.active]=\"item === activeItem\">\n <co-icon [iconData]=\"item.icon\" [style.width.px]=\"iconSize\" [style.height.px]=\"iconSize\"></co-icon>\n <div class=\"label\" [textContent]=\"item.label | coreLocalize\"></div>\n </div>\n <div class=\"picking-type-wrapper\" *ngIf=\"showSubCategories\">\n <div class=\"button-wrapper\" *ngFor=\"let subCategory of subCategories\" (click)=\"handlePickingCategoryClicked(subCategory)\">\n <co-icon \n class=\"co-transaction-button-bar-icon\" \n [iconData]=\"subCategory.icon\" \n [style.width.px]=\"iconSize\" \n [style.height.px]=\"iconSize\">\n </co-icon>\n <span class=\"button-title\" [textContent]=\"subCategory.label | coreLocalize\"></span>\n </div>\n </div>\n </div>\n ",
12474
+ template: "\n <div class=\"icon-item active\" [class.menu-opened]=\"showMenu\" (click)=\"toggleMenu()\">\n <co-icon [iconData]=\"activeItem.icon\" [style.width.px]=\"iconSize\" [style.height.px]=\"iconSize\"></co-icon>\n <co-icon *ngIf=\"!showMenu\" class=\"drop-arrow\" [iconData]=\"icons.getIcon(Icon.CaretDownSolid)\"></co-icon>\n <co-icon *ngIf=\"showMenu\" class=\"drop-arrow\" [iconData]=\"icons.getIcon(Icon.CaretUpSolid)\"></co-icon>\n </div>\n <div class=\"dropdown-menu\" *ngIf=\"showMenu\" (clickOutside)=\"onClickOutside()\">\n <div class=\"icon-item\" *ngFor=\"let item of collection\" (click)=\"selectItem(item)\"\n [class.active]=\"item === activeItem\">\n <co-icon [iconData]=\"item.icon\" [style.width.px]=\"iconSize\" [style.height.px]=\"iconSize\"></co-icon>\n <div class=\"label\" [textContent]=\"item.label | coreLocalize\"></div>\n </div>\n <div class=\"picking-type-wrapper\" *ngIf=\"showSubCategories\">\n <div class=\"button-wrapper\" *ngFor=\"let subCategory of subCategories\" (click)=\"handlePickingCategoryClicked(subCategory)\">\n <co-icon\n class=\"co-transaction-button-bar-icon\"\n [iconData]=\"subCategory.icon\"\n [style.width.px]=\"iconSize\"\n [style.height.px]=\"iconSize\">\n </co-icon>\n <span class=\"button-title\" [textContent]=\"subCategory.label | coreLocalize\"></span>\n </div>\n </div>\n </div>\n ",
12467
12475
  encapsulation: i0.ViewEncapsulation.None
12468
12476
  },] }
12469
12477
  ];
@@ -14020,17 +14028,14 @@
14020
14028
  this._clearTimeout();
14021
14029
  };
14022
14030
  InputScannerComponent.prototype.handleKeyDown = function (event) {
14023
- var _this = this;
14024
- this._clearTimeout();
14025
- this._keyDownTimeout = setTimeout(function () {
14026
- if (_this._blockEnterKeydown) {
14027
- return;
14028
- }
14029
- var enterKeys = ['Enter', 'NumpadEnter', 'Go'];
14030
- if (enterKeys.includes(event.key)) {
14031
- _this.search.next(_this.model);
14032
- }
14033
- }, 200);
14031
+ var enterKeys = ['Enter', 'NumpadEnter', 'Go'];
14032
+ if (enterKeys.includes(event.key) && !this._blockEnterKeydown) {
14033
+ event.preventDefault();
14034
+ event.stopPropagation();
14035
+ // Immediately emit before DOM resets or reflows
14036
+ var currentValue = this.model;
14037
+ this.search.next(currentValue);
14038
+ }
14034
14039
  };
14035
14040
  InputScannerComponent.prototype.triggerCodeScanned = function (code) {
14036
14041
  this._clearTimeout();