@acorex/cdk 22.1.7 → 22.2.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.
@@ -2705,9 +2705,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
2705
2705
  type: Input
2706
2706
  }] } });
2707
2707
 
2708
+ /**
2709
+ * Scrolls `element` into view inside `container` using nearest-edge behavior.
2710
+ * Only adjusts the container's own scrollTop — never the document — so overlay
2711
+ * dismissal on document scroll is not triggered.
2712
+ */
2713
+ function scrollNearestIntoView(container, element, topInset = 0) {
2714
+ const containerRect = container.getBoundingClientRect();
2715
+ const elementRect = element.getBoundingClientRect();
2716
+ const top = elementRect.top - containerRect.top - topInset;
2717
+ const bottom = elementRect.bottom - containerRect.bottom;
2718
+ if (top < 0) {
2719
+ container.scrollTop += top;
2720
+ }
2721
+ else if (bottom > 0) {
2722
+ container.scrollTop += bottom;
2723
+ }
2724
+ }
2725
+ /**
2726
+ * Scrolls an option into view inside a scrollable container using nearest-edge behavior.
2727
+ * Uses bounding rects relative to the container so it works even when offsetParent differs.
2728
+ */
2729
+ function scrollOptionWithinContainer(container, option) {
2730
+ const containerRect = container.getBoundingClientRect();
2731
+ const optionRect = option.getBoundingClientRect();
2732
+ const relativeTop = optionRect.top - containerRect.top + container.scrollTop;
2733
+ const relativeBottom = relativeTop + option.offsetHeight;
2734
+ const viewTop = container.scrollTop;
2735
+ const viewBottom = viewTop + container.clientHeight;
2736
+ const maxScroll = Math.max(0, container.scrollHeight - container.clientHeight);
2737
+ if (relativeTop < viewTop) {
2738
+ container.scrollTop = relativeTop;
2739
+ }
2740
+ else if (relativeBottom > viewBottom) {
2741
+ container.scrollTop = Math.min(relativeBottom - container.clientHeight, maxScroll);
2742
+ }
2743
+ }
2744
+ /**
2745
+ * Retries `fn` on successive animation frames until it returns true or `attempts` is exhausted.
2746
+ * Used when the target element appears only after an overlay has been positioned and laid out.
2747
+ */
2748
+ function retryFrames(fn, attempts = 5) {
2749
+ if (typeof requestAnimationFrame === 'undefined') {
2750
+ return;
2751
+ }
2752
+ let remaining = attempts;
2753
+ const tick = () => {
2754
+ if (fn() || --remaining <= 0) {
2755
+ return;
2756
+ }
2757
+ requestAnimationFrame(tick);
2758
+ };
2759
+ requestAnimationFrame(tick);
2760
+ }
2761
+
2708
2762
  /**
2709
2763
  * Generated bundle index. Do not edit.
2710
2764
  */
2711
2765
 
2712
- export { AXAutoFocusDirective, AXAutocompleteParentComponent, AXButtonClickEvent, AXClearableComponent, AXClickEvent, AXClosableComponent, AXCommonModule, AXComponent, AXComponentCloseEvent, AXComponentClosedPromise, AXComponentClosing, AXComponentResult, AXDataSource, AXDomService, AXEvent, AXFocusEvent, AXFocusableComponent, AXHotkeyDirective, AXHotkeysService, AXHtmlEvent, AXInfiniteScrollerDirective, AXInvertedColorDirective, AXItemClickEvent, AXItemSelectedEvent, AXListDataSource, AXNgModelDelayedValueChangedDirective, AXOptionChangedEvent, AXPagedComponent, AXRangeChangedEvent, AXResponsiveDirective, AXRippleDirective, AXSearchableComponent, AXSelectionValueChangedEvent, AXValuableComponent, AXValueChangedEvent, AX_LOCATIONS, AX_PLACEMENT_BOTTOM, AX_PLACEMENT_BOTTOM_END, AX_PLACEMENT_BOTTOM_START, AX_PLACEMENT_END, AX_PLACEMENT_END_BOTTOM, AX_PLACEMENT_END_TOP, AX_PLACEMENT_MAP, AX_PLACEMENT_START, AX_PLACEMENT_START_BOTTOM, AX_PLACEMENT_START_TOP, AX_PLACEMENT_TOP, AX_PLACEMENT_TOP_END, AX_PLACEMENT_TOP_START, AX_SELECTION_DATA_TOKEN, AX_STYLE_COLOR_TYPES, AX_STYLE_LOOK_TYPES, MXBaseComponent, MXButtonBaseComponent, MXColorComponent, MXColorLookComponent, MXInputBaseValueComponent, MXInteractiveComponent, MXLookComponent, MXLookableComponent, MXSelectionBridgeService, MXSelectionValueComponent, MXValueComponent, NXButtonComponent, NXClickEvent, NXColorComponent, NXComponent, NXEvent, NXInteractiveComponent, NXLookComponent, NXNativeEvent, NXValueComponent, TAB_META_KEY, applyDataSourceQuery, convertArrayToDataSource, convertToPlacement };
2766
+ export { AXAutoFocusDirective, AXAutocompleteParentComponent, AXButtonClickEvent, AXClearableComponent, AXClickEvent, AXClosableComponent, AXCommonModule, AXComponent, AXComponentCloseEvent, AXComponentClosedPromise, AXComponentClosing, AXComponentResult, AXDataSource, AXDomService, AXEvent, AXFocusEvent, AXFocusableComponent, AXHotkeyDirective, AXHotkeysService, AXHtmlEvent, AXInfiniteScrollerDirective, AXInvertedColorDirective, AXItemClickEvent, AXItemSelectedEvent, AXListDataSource, AXNgModelDelayedValueChangedDirective, AXOptionChangedEvent, AXPagedComponent, AXRangeChangedEvent, AXResponsiveDirective, AXRippleDirective, AXSearchableComponent, AXSelectionValueChangedEvent, AXValuableComponent, AXValueChangedEvent, AX_LOCATIONS, AX_PLACEMENT_BOTTOM, AX_PLACEMENT_BOTTOM_END, AX_PLACEMENT_BOTTOM_START, AX_PLACEMENT_END, AX_PLACEMENT_END_BOTTOM, AX_PLACEMENT_END_TOP, AX_PLACEMENT_MAP, AX_PLACEMENT_START, AX_PLACEMENT_START_BOTTOM, AX_PLACEMENT_START_TOP, AX_PLACEMENT_TOP, AX_PLACEMENT_TOP_END, AX_PLACEMENT_TOP_START, AX_SELECTION_DATA_TOKEN, AX_STYLE_COLOR_TYPES, AX_STYLE_LOOK_TYPES, MXBaseComponent, MXButtonBaseComponent, MXColorComponent, MXColorLookComponent, MXInputBaseValueComponent, MXInteractiveComponent, MXLookComponent, MXLookableComponent, MXSelectionBridgeService, MXSelectionValueComponent, MXValueComponent, NXButtonComponent, NXClickEvent, NXColorComponent, NXComponent, NXEvent, NXInteractiveComponent, NXLookComponent, NXNativeEvent, NXValueComponent, TAB_META_KEY, applyDataSourceQuery, convertArrayToDataSource, convertToPlacement, retryFrames, scrollNearestIntoView, scrollOptionWithinContainer };
2713
2767
  //# sourceMappingURL=acorex-cdk-common.mjs.map