@klippa/ngx-enhancy-forms 14.10.2 → 14.10.4

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.
@@ -173,7 +173,7 @@ class FormComponent {
173
173
  this.formGroup.patchValue(valueBeforeInject);
174
174
  }
175
175
  injectInto.setControl(injectAt, this.formGroup);
176
- this.onInjected.emit();
176
+ this.onInjected.emit(valueBeforeInject);
177
177
  }
178
178
  else if (injectInto instanceof UntypedFormGroup) {
179
179
  if (typeof injectAt !== 'string') {
@@ -187,7 +187,7 @@ class FormComponent {
187
187
  this.formGroup.patchValue(valueBeforeInject);
188
188
  }
189
189
  injectInto.setControl(injectAt, this.formGroup);
190
- this.onInjected.emit();
190
+ this.onInjected.emit(valueBeforeInject);
191
191
  }
192
192
  }
193
193
  }
@@ -987,6 +987,7 @@ class SelectComponent extends ValueAccessorBase {
987
987
  const maxWidth = Math.max(...widths);
988
988
  const dropdownPanel = this.elRef.nativeElement.querySelector('ng-dropdown-panel');
989
989
  if (dropdownPanel) {
990
+ dropdownPanel.style.minWidth = `${this.elRef.nativeElement.clientWidth}px`;
990
991
  dropdownPanel.style.width = `${Math.max(this.elRef.nativeElement.clientWidth, maxWidth + 40, dropdownPanel.getBoundingClientRect().width)}px`;
991
992
  }
992
993
  let limitingParentContainer = this.elRef.nativeElement;
@@ -997,9 +998,8 @@ class SelectComponent extends ValueAccessorBase {
997
998
  const spaceInParent = limitingParentContainer.clientWidth;
998
999
  const spaceLeftOfElRef = this.elRef?.nativeElement.getBoundingClientRect().left - limitingParentContainer.getBoundingClientRect().left;
999
1000
  const spaceRightOfElRef = spaceInParent - spaceLeftOfElRef;
1000
- const shiftToLeft = dropdownPanel?.clientWidth - spaceRightOfElRef + 20;
1001
- if (shiftToLeft > 0) {
1002
- dropdownPanel.style.left = `-${shiftToLeft}px`;
1001
+ if (spaceRightOfElRef < dropdownPanel?.clientWidth) {
1002
+ dropdownPanel.style.right = `0px`;
1003
1003
  }
1004
1004
  }
1005
1005
  });