codexly-ui 0.10.2 → 0.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.
@@ -4,11 +4,11 @@ import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT, NgStyle, CurrencyPipe, D
4
4
  import * as i1$1 from '@angular/forms';
5
5
  import { NG_VALUE_ACCESSOR, FormControl, NgControl, ReactiveFormsModule, FormGroup, Validators, FormsModule } from '@angular/forms';
6
6
  import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
- import { startWith, map, debounceTime, distinctUntilChanged, switchMap, of, catchError } from 'rxjs';
7
+ import { startWith, map, debounceTime, distinctUntilChanged, switchMap, of, catchError, filter } from 'rxjs';
8
8
  import * as i1 from '@angular/cdk/overlay';
9
9
  import { ScrollStrategyOptions, OverlayModule } from '@angular/cdk/overlay';
10
10
  import { ScrollingModule, CdkScrollable } from '@angular/cdk/scrolling';
11
- import { RouterLink, RouterLinkActive } from '@angular/router';
11
+ import { Router, NavigationEnd, RouterLink, RouterLinkActive } from '@angular/router';
12
12
 
13
13
  // ── Parse 'red' | 'red-500' → { color, shade } ───────────────────────────────
14
14
  function parseColorInput(input) {
@@ -9442,6 +9442,14 @@ class ClxAppLayoutComponent {
9442
9442
  const zone = inject(NgZone, { optional: true });
9443
9443
  this._zone = zone ?? { run: (fn) => fn(), runOutsideAngular: (fn) => fn() };
9444
9444
  this._document = inject(DOCUMENT);
9445
+ // On mobile the sidebar is an overlay drawer over the page content — leaving it open after
9446
+ // the user picks a menu item would hide the very page they just navigated to. Desktop is
9447
+ // unaffected: there the sidebar is a permanent rail, not an overlay, so it should stay as-is.
9448
+ const router = inject(Router, { optional: true });
9449
+ router?.events.pipe(filter((e) => e instanceof NavigationEnd), takeUntilDestroyed()).subscribe(() => {
9450
+ if (this._isMobile())
9451
+ this._sidebarOpen.set(false);
9452
+ });
9445
9453
  }
9446
9454
  _showBackdrop = computed(() => this._sidebarOpen() && this._isMobile(), ...(ngDevMode ? [{ debugName: "_showBackdrop" }] : /* istanbul ignore next */ []));
9447
9455
  _isExpanded = computed(() => !this.collapsed() || this._hovered(), ...(ngDevMode ? [{ debugName: "_isExpanded" }] : /* istanbul ignore next */ []));
@@ -11599,7 +11607,9 @@ class ClxPaginationComponent {
11599
11607
  });
11600
11608
  // Mientras el usuario no haya elegido un pageSize a propósito, si el default provisto por el
11601
11609
  // 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".
11610
+ // como si fuera el "más grande elegido". Debe emitir pageChange/sizeChange igual que la
11611
+ // selección manual — si no, el consumidor (ej. clx-table → su padre real) nunca se entera
11612
+ // del nuevo tamaño y sigue pidiendo datos al backend con el size viejo.
11603
11613
  effect(() => {
11604
11614
  if (this._userTouchedPageSize)
11605
11615
  return;
@@ -11609,6 +11619,9 @@ class ClxPaginationComponent {
11609
11619
  const smallest = this._pageSizeOptions()[0]?.value;
11610
11620
  if (smallest != null && this.pageSize() > total && smallest !== this.pageSize()) {
11611
11621
  this.pageSize.set(smallest);
11622
+ this.currentPage.set(1);
11623
+ this.sizeChange.emit({ pageSize: smallest });
11624
+ this.pageChange.emit({ page: 1, pageSize: smallest });
11612
11625
  }
11613
11626
  });
11614
11627
  // Sincroniza el FormControl → pageSize model cuando el usuario elige