@colijnit/corecomponents_v12 12.1.4 → 12.1.5

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.
@@ -5898,6 +5898,7 @@
5898
5898
  this.keepInView = false;
5899
5899
  this.inheritWidth = false;
5900
5900
  this.rightAlign = false;
5901
+ this.fullSize = false;
5901
5902
  this.handleScroll = function (event) {
5902
5903
  _this._checkAndPlaceElement();
5903
5904
  };
@@ -5956,11 +5957,18 @@
5956
5957
  OverlayDirective.prototype._checkAndPlaceElement = function () {
5957
5958
  if (this._elementRef && this._elementRef.nativeElement && this._parent && this._parent.nativeElement) {
5958
5959
  var elementRect = this._elementRef.nativeElement.getBoundingClientRect();
5959
- var parentRect = this._parent.nativeElement.getBoundingClientRect();
5960
+ var parentBoundingRect = this._parent.nativeElement.getBoundingClientRect();
5961
+ var parentRect = {
5962
+ bottom: this._parent.nativeElement.offsetTop + parentBoundingRect.height,
5963
+ right: this._parent.nativeElement.offsetLeft + parentBoundingRect.width,
5964
+ left: this._parent.nativeElement.offsetLeft,
5965
+ top: this._parent.nativeElement.offsetTop
5966
+ };
5960
5967
  this._placeElement(window.innerHeight, window.innerWidth, parentRect, elementRect);
5961
5968
  }
5962
5969
  };
5963
5970
  OverlayDirective.prototype._placeElement = function (bottom, right, parentRect, elementRect) {
5971
+ this._elementRef.nativeElement.style.position = "fixed";
5964
5972
  if (bottom < parentRect.bottom + elementRect.height) { // make sure it fits at the bottom
5965
5973
  this._elementRef.nativeElement.style.top = (parentRect.top - elementRect.height) + "px";
5966
5974
  this._elementRef.nativeElement.classList.add('top');
@@ -5975,18 +5983,23 @@
5975
5983
  if (this.rightAlign) {
5976
5984
  this._elementRef.nativeElement.style.left = (parentRect.right - elementRect.width) + "px";
5977
5985
  }
5986
+ else if (this.fullSize) {
5987
+ this._elementRef.nativeElement.style.left = "0px";
5988
+ }
5978
5989
  else {
5979
5990
  this._elementRef.nativeElement.style.left = parentRect.left + "px";
5980
5991
  }
5981
5992
  if (this.keepInView) {
5982
- if (elementRect.right > window.innerWidth) {
5993
+ var viewToKeepIn = this.view ? this.view : window;
5994
+ var viewWidth = viewToKeepIn.innerWidth || viewToKeepIn.clientWidth;
5995
+ if (elementRect.right > viewWidth) {
5983
5996
  //see if we can move it to the left
5984
- if ((window.innerWidth - elementRect.width) > 0) {
5985
- this._elementRef.nativeElement.style.left = (window.innerWidth - elementRect.width) + "px";
5997
+ if (((viewWidth - elementRect.width) > 0) && !this.fullSize) {
5998
+ this._elementRef.nativeElement.style.left = (viewWidth - elementRect.width) + "px";
5986
5999
  }
5987
6000
  else { //resize so it fits into view
5988
- this._elementRef.nativeElement.style.width = window.innerWidth + "px";
5989
- this._elementRef.nativeElement.style.left = 0;
6001
+ this._elementRef.nativeElement.style.width = viewWidth + "px";
6002
+ this._elementRef.nativeElement.style.left = viewToKeepIn.offsetLeft + "px";
5990
6003
  }
5991
6004
  }
5992
6005
  }
@@ -6003,9 +6016,11 @@
6003
6016
  ]; };
6004
6017
  OverlayDirective.propDecorators = {
6005
6018
  parent: [{ type: i0.Input, args: ["overlay",] }],
6019
+ view: [{ type: i0.Input }],
6006
6020
  keepInView: [{ type: i0.Input }],
6007
6021
  inheritWidth: [{ type: i0.Input }],
6008
- rightAlign: [{ type: i0.Input }]
6022
+ rightAlign: [{ type: i0.Input }],
6023
+ fullSize: [{ type: i0.Input }]
6009
6024
  };
6010
6025
 
6011
6026
  var OverlayParentDirective = /** @class */ (function () {
@@ -11037,6 +11052,7 @@
11037
11052
  _this.multiselect = false;
11038
11053
  _this.displayField = 'description';
11039
11054
  _this.searchDisabled = false;
11055
+ _this.closeAfterOptionChosen = true;
11040
11056
  _this.isSelectOpen = false;
11041
11057
  _this.state = 'default';
11042
11058
  _this.selectedModels = [];
@@ -11151,6 +11167,9 @@
11151
11167
  }
11152
11168
  else {
11153
11169
  this.selectedModel = option[this.displayField];
11170
+ if (this.closeAfterOptionChosen) {
11171
+ this.toggleSelect();
11172
+ }
11154
11173
  }
11155
11174
  }
11156
11175
  this.model = option;
@@ -11220,6 +11239,7 @@
11220
11239
  label: [{ type: i0.Input }],
11221
11240
  customCssClass: [{ type: i0.Input }],
11222
11241
  searchDisabled: [{ type: i0.Input }],
11242
+ closeAfterOptionChosen: [{ type: i0.Input }],
11223
11243
  showClass: [{ type: i0.HostBinding, args: ['class.co-list-of-values',] }]
11224
11244
  };
11225
11245