@klippa/ngx-enhancy-forms 9.2.0 → 9.3.0

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.
@@ -992,6 +992,7 @@
992
992
  _this.multiple = false;
993
993
  _this.multipleDisplayedAsAmount = false;
994
994
  _this.clearable = true;
995
+ _this.truncateOptions = true;
995
996
  _this.onSearch = new core.EventEmitter();
996
997
  _this.onEndReached = new core.EventEmitter();
997
998
  _this.onOpened = new core.EventEmitter();
@@ -1035,6 +1036,12 @@
1035
1036
  // waiting for the thing to render until we fire the event
1036
1037
  setTimeout(function () {
1037
1038
  _this.onOpened.emit();
1039
+ if (_this.truncateOptions === false) {
1040
+ var widths = Array.from(_this.elRef.nativeElement.querySelectorAll('.ng-option div')).map(function (e) { return e.scrollWidth; });
1041
+ var maxWidth = Math.max.apply(Math, __spread(widths));
1042
+ var dropdownPanel = _this.elRef.nativeElement.querySelector('ng-dropdown-panel');
1043
+ dropdownPanel.style.width = maxWidth + 40 + "px";
1044
+ }
1038
1045
  });
1039
1046
  };
1040
1047
  return SelectComponent;
@@ -1059,6 +1066,7 @@
1059
1066
  multiple: [{ type: core.Input }],
1060
1067
  multipleDisplayedAsAmount: [{ type: core.Input }],
1061
1068
  clearable: [{ type: core.Input }],
1069
+ truncateOptions: [{ type: core.Input }],
1062
1070
  dropdownPosition: [{ type: core.Input }],
1063
1071
  customSearchFn: [{ type: core.Input }],
1064
1072
  footerElement: [{ type: core.Input }],