@brickclay-org/ui 0.1.48 → 0.1.49

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.
@@ -543,8 +543,8 @@ class BkCustomCalendar {
543
543
  customRangeDirection = false;
544
544
  lockStartDate = false;
545
545
  position = 'left';
546
- /** Vertical placement relative to the input. Takes precedence over {@link drop} for default bottom placement. */
547
- popupPosition = 'bottom';
546
+ /** Vertical placement relative to the input. When explicitly set, overrides viewport-space detection entirely. */
547
+ popupPosition;
548
548
  drop = 'down';
549
549
  dualCalendar = false;
550
550
  showRanges = true;
@@ -683,9 +683,9 @@ class BkCustomCalendar {
683
683
  this.onTouched();
684
684
  this.closed.emit();
685
685
  }
686
- /** User preference before viewport adjustment (legacy `drop` still applies when `popupPosition` is `bottom`). */
686
+ /** User preference before viewport adjustment (only used when popupPosition is not explicitly set). */
687
687
  preferPopupAbove() {
688
- return this.popupPosition === 'top' || (this.popupPosition === 'bottom' && this.drop === 'up');
688
+ return this.drop === 'up';
689
689
  }
690
690
  resolveCustomRangesFromInputsOrService() {
691
691
  const svc = this.calendarManager.getCustomRanges();
@@ -1116,6 +1116,12 @@ class BkCustomCalendar {
1116
1116
  this.popupPlacementAbove = this.computePlacementAbove(rect, popupH);
1117
1117
  }
1118
1118
  computePlacementAbove(rect, popupHeight) {
1119
+ // If the consumer explicitly set popupPosition, honour it — no space-check override.
1120
+ if (this.popupPosition === 'top')
1121
+ return true;
1122
+ if (this.popupPosition === 'bottom')
1123
+ return false;
1124
+ // No explicit value → auto-detect based on available viewport space.
1119
1125
  const gap = 12;
1120
1126
  const spaceBelow = window.innerHeight - rect.bottom - gap;
1121
1127
  const spaceAbove = rect.top - gap;