@colijnit/corecomponents_v12 12.1.4 → 12.1.6

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