ngx-lite-form 1.4.1 → 1.4.3

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/index.d.ts CHANGED
@@ -51,20 +51,26 @@ interface TableColumn {
51
51
  label: string;
52
52
  flex?: string;
53
53
  sortable?: boolean;
54
- cellTemplate?: (value: any, row: any) => string;
55
- type?: 'text' | 'menu';
54
+ cellTemplate?: (_value: any, _row: any) => string;
55
+ type?: 'text' | 'menu' | 'select';
56
56
  menuItems?: Array<{
57
57
  label: string;
58
58
  value: string;
59
59
  variant?: 'danger' | 'default';
60
60
  }>;
61
61
  }
62
+ type SortDirection = 'asc' | 'desc' | null;
63
+ interface SortState {
64
+ column: string;
65
+ direction: SortDirection;
66
+ }
62
67
  declare class TableFieldDto<T = any> {
63
68
  columns: TableColumn[];
64
69
  data: T[];
65
70
  showPaginator?: boolean;
66
71
  paginatorConfig: PaginatorFieldDto;
67
- constructor(columns: TableColumn[], data: T[], showPaginator?: boolean, paginatorConfig?: PaginatorFieldDto);
72
+ sortState?: SortState;
73
+ constructor(columns: TableColumn[], data: T[], showPaginator?: boolean, paginatorConfig?: PaginatorFieldDto, sortState?: SortState);
68
74
  }
69
75
 
70
76
  /**
@@ -461,18 +467,34 @@ declare class LiteTable<T = any> {
461
467
  action: string;
462
468
  row: T;
463
469
  }>;
470
+ sortChange: _angular_core.OutputEmitterRef<{
471
+ column: string;
472
+ direction: SortDirection;
473
+ }>;
474
+ selectionChange: _angular_core.OutputEmitterRef<T[]>;
475
+ private internalSortState;
476
+ private selectedRows;
464
477
  openMenuIndex: number | null;
465
478
  menuOpenUpward: boolean;
479
+ constructor();
480
+ private sortRows;
466
481
  paginatedData: _angular_core.Signal<T[]>;
467
482
  getCellValue(row: any, column: TableColumn): string;
468
483
  private getValue;
469
484
  onPageChange(page: number): void;
470
485
  onItemsPerPageChange(itemsPerPage: number): void;
486
+ isRowSelected(row: T): boolean;
487
+ toggleRow(row: T, checked: boolean): void;
488
+ areAllVisibleSelected(): boolean;
489
+ isSomeVisibleSelected(): boolean;
490
+ toggleSelectAllVisible(checked: boolean): void;
471
491
  toggleMenu(rowIndex: number, event?: MouseEvent): void;
472
492
  onMenuItemClick(action: string, row: T, event?: MouseEvent): void;
473
493
  onDocumentClick(): void;
494
+ onSort(column: TableColumn): void;
495
+ getSortDirection(columnKey: string): SortDirection;
474
496
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<LiteTable<any>, never>;
475
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<LiteTable<any>, "lite-table", never, { "table": { "alias": "table"; "required": true; "isSignal": true; }; }, { "pageChange": "pageChange"; "itemsPerPageChange": "itemsPerPageChange"; "menuAction": "menuAction"; }, never, never, true, never>;
497
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<LiteTable<any>, "lite-table", never, { "table": { "alias": "table"; "required": true; "isSignal": true; }; }, { "pageChange": "pageChange"; "itemsPerPageChange": "itemsPerPageChange"; "menuAction": "menuAction"; "sortChange": "sortChange"; "selectionChange": "selectionChange"; }, never, never, true, never>;
476
498
  }
477
499
 
478
500
  interface LitePanelAction {
@@ -511,7 +533,7 @@ declare class LitePanel implements AfterViewInit, OnDestroy {
511
533
  readonly contentComponent: _angular_core.Signal<Type<any> | null>;
512
534
  readonly templateContext: {
513
535
  panel: LitePanel;
514
- close: (value?: unknown) => void;
536
+ close: (_value?: unknown) => void;
515
537
  };
516
538
  readonly panelStyles: _angular_core.Signal<Record<string, string>>;
517
539
  close(value?: unknown | null): void;
@@ -572,4 +594,4 @@ declare class LiteLoading {
572
594
  }
573
595
 
574
596
  export { BaseSelectFieldDto, FieldDto, FileFieldDto, FormUtils, LiteCheckbox, LiteDate, LiteDateTime, LiteFile, LiteInput, LiteLoading, LiteMultiSelect, LitePaginator, LitePanel, LitePassword, LiteRadio, LiteSelect, LiteSnackbarService, LiteTable, LiteTextarea, MultiSelectFieldDto, PaginatorFieldDto, RadioFieldDto, SelectFieldDto, TableFieldDto };
575
- export type { DateRangeFieldDto, FileItem, LitePanelAction, LoadingView, SnackbarType, TableColumn };
597
+ export type { DateRangeFieldDto, FileItem, LitePanelAction, LoadingView, SnackbarType, SortDirection, SortState, TableColumn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-lite-form",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Lightweight Angular 20+ form library with 15+ standalone components: input, textarea, select, multi-select, radio, checkbox, password, date picker, datetime picker, file upload, data table, pagination, modal panel, loading indicators, and toast notifications",
5
5
  "keywords": [
6
6
  "angular",