codexly-ui 0.10.0 → 0.10.2
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.
- package/fesm2022/codexly-ui.mjs +51 -4
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +48 -11
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -2491,17 +2491,32 @@ class ClxTooltipService {
|
|
|
2491
2491
|
this._animate.animate(el, { animation: 'fadeIn', duration: 160, trigger: 'manual', fillMode: 'both' });
|
|
2492
2492
|
}
|
|
2493
2493
|
/** Hides the bubble, but only if `trigger` is the element that currently owns it — a hover-out
|
|
2494
|
-
* from an element that already lost ownership (a newer hover-in interrupted it) is a no-op.
|
|
2494
|
+
* from an element that already lost ownership (a newer hover-in interrupted it) is a no-op.
|
|
2495
|
+
* Relies on the 'animationend' DOM event to know when the fade-out finished — but that event
|
|
2496
|
+
* can simply never fire (backgrounded tab throttling animations, layout thrashing from a route
|
|
2497
|
+
* change interrupting the transition, etc.), which would leave the promise unresolved forever
|
|
2498
|
+
* and _owner never cleared — since this bubble lives outside any component's lifecycle (a
|
|
2499
|
+
* singleton appended straight to document.body), nothing else would ever hide it again. A hard
|
|
2500
|
+
* fallback timeout guarantees the bubble is actually hidden and ownership released regardless of
|
|
2501
|
+
* whether the CSS event cooperates. */
|
|
2495
2502
|
hide(trigger) {
|
|
2496
2503
|
if (!this._isBrowser || this._owner !== trigger || !this._ref)
|
|
2497
2504
|
return;
|
|
2498
2505
|
this._hiding = true;
|
|
2499
2506
|
trigger.removeAttribute('aria-describedby');
|
|
2500
2507
|
const el = this._ref.location.nativeElement;
|
|
2508
|
+
const settle = () => {
|
|
2509
|
+
if (this._owner !== trigger || !this._hiding)
|
|
2510
|
+
return;
|
|
2511
|
+
el.style.visibility = 'hidden';
|
|
2512
|
+
this._owner = null;
|
|
2513
|
+
this._hiding = false;
|
|
2514
|
+
};
|
|
2515
|
+
const fallback = setTimeout(settle, 400);
|
|
2501
2516
|
this._animate.animate(el, { animation: 'fadeOut', duration: 120, trigger: 'manual', fillMode: 'forwards' })
|
|
2502
2517
|
.then(() => {
|
|
2503
|
-
|
|
2504
|
-
|
|
2518
|
+
clearTimeout(fallback);
|
|
2519
|
+
settle();
|
|
2505
2520
|
});
|
|
2506
2521
|
}
|
|
2507
2522
|
/** Synchronous, no fade — used on touchend/click so the bubble can't linger over UI the
|
|
@@ -8028,6 +8043,16 @@ class ClxNativeOverlayService {
|
|
|
8028
8043
|
_injector = inject(Injector);
|
|
8029
8044
|
/** Block body scroll like CDK used to */
|
|
8030
8045
|
_scrollBlocked = 0;
|
|
8046
|
+
// Overlays (modals, drawers, …) mount straight to document.body, outside the router-outlet
|
|
8047
|
+
// tree — a route navigation never tears them down on its own. Tracked here so callers (e.g. an
|
|
8048
|
+
// auth interceptor forcing sign-out on session expiry) can close whatever's open instead of
|
|
8049
|
+
// leaving a modal visually stuck on top of the page the user gets redirected to.
|
|
8050
|
+
_active = new Set();
|
|
8051
|
+
/** Force-closes every currently mounted overlay — no exit animation, immediate DOM removal. */
|
|
8052
|
+
destroyAll() {
|
|
8053
|
+
for (const ref of [...this._active])
|
|
8054
|
+
ref.destroy();
|
|
8055
|
+
}
|
|
8031
8056
|
mount(component, injector, options) {
|
|
8032
8057
|
// ── backdrop ────────────────────────────────────────────────────────────
|
|
8033
8058
|
let backdropEl = null;
|
|
@@ -8062,12 +8087,14 @@ class ClxNativeOverlayService {
|
|
|
8062
8087
|
backdrop: backdropEl,
|
|
8063
8088
|
container,
|
|
8064
8089
|
destroy: () => {
|
|
8090
|
+
this._active.delete(overlayRef);
|
|
8065
8091
|
compRef.destroy();
|
|
8066
8092
|
backdropEl?.remove();
|
|
8067
8093
|
container.remove();
|
|
8068
8094
|
this._unblockScroll();
|
|
8069
8095
|
},
|
|
8070
8096
|
};
|
|
8097
|
+
this._active.add(overlayRef);
|
|
8071
8098
|
return { compRef, overlayRef };
|
|
8072
8099
|
}
|
|
8073
8100
|
_blockScroll() {
|
|
@@ -11557,6 +11584,11 @@ class ClxPaginationComponent {
|
|
|
11557
11584
|
_destroyRef = inject(DestroyRef);
|
|
11558
11585
|
// ── FormControl interno para el select de pageSize ─────────────────────────
|
|
11559
11586
|
_pageSizeCtrl = new FormControl(null);
|
|
11587
|
+
/** True once the user has explicitly picked a pageSize from the select — after that, their
|
|
11588
|
+
* choice is respected even if a later filter shrinks totalItems below it. Until then, a
|
|
11589
|
+
* caller-provided default (e.g. 20) that exceeds a small totalItems is auto-corrected down
|
|
11590
|
+
* to the smallest available option, so the select never opens pre-selected on the largest value. */
|
|
11591
|
+
_userTouchedPageSize = false;
|
|
11560
11592
|
constructor() {
|
|
11561
11593
|
// Sincroniza el pageSize model → FormControl cada vez que cambia desde afuera
|
|
11562
11594
|
effect(() => {
|
|
@@ -11565,11 +11597,26 @@ class ClxPaginationComponent {
|
|
|
11565
11597
|
this._pageSizeCtrl.setValue(ps, { emitEvent: false });
|
|
11566
11598
|
}
|
|
11567
11599
|
});
|
|
11600
|
+
// Mientras el usuario no haya elegido un pageSize a propósito, si el default provisto por el
|
|
11601
|
+
// padre excede totalItems, se ajusta al más pequeño disponible en vez de quedar seleccionado
|
|
11602
|
+
// como si fuera el "más grande elegido".
|
|
11603
|
+
effect(() => {
|
|
11604
|
+
if (this._userTouchedPageSize)
|
|
11605
|
+
return;
|
|
11606
|
+
const total = this.totalItems();
|
|
11607
|
+
if (!total || total <= 0)
|
|
11608
|
+
return;
|
|
11609
|
+
const smallest = this._pageSizeOptions()[0]?.value;
|
|
11610
|
+
if (smallest != null && this.pageSize() > total && smallest !== this.pageSize()) {
|
|
11611
|
+
this.pageSize.set(smallest);
|
|
11612
|
+
}
|
|
11613
|
+
});
|
|
11568
11614
|
// Sincroniza el FormControl → pageSize model cuando el usuario elige
|
|
11569
11615
|
this._pageSizeCtrl.valueChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(val => {
|
|
11570
11616
|
const newSize = Number(val);
|
|
11571
11617
|
if (!val || !Number.isFinite(newSize) || newSize <= 0 || newSize === this.pageSize())
|
|
11572
11618
|
return;
|
|
11619
|
+
this._userTouchedPageSize = true;
|
|
11573
11620
|
this.pageSize.set(newSize);
|
|
11574
11621
|
this.currentPage.set(1);
|
|
11575
11622
|
this.sizeChange.emit({ pageSize: newSize });
|
|
@@ -15914,5 +15961,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
15914
15961
|
* Generated bundle index. Do not edit.
|
|
15915
15962
|
*/
|
|
15916
15963
|
|
|
15917
|
-
export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxModalComponent, ClxModalService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
|
|
15964
|
+
export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxModalComponent, ClxModalService, ClxNativeOverlayService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
|
|
15918
15965
|
//# sourceMappingURL=codexly-ui.mjs.map
|