@nova-design-system/nova-angular 3.20.0 → 3.21.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.
@@ -1,6 +1,6 @@
1
1
  import { TemplateRef, QueryList, AfterViewInit, OnDestroy } from '@angular/core';
2
2
  import { NvDatatableCellDirective } from './nv-datatable-cell.directive';
3
- import { type FlexRenderComponent, type ColumnDef, type CellContext, type NoInfer } from './datatable.utils';
3
+ import { type FlexRenderComponent, type ColumnDef, type CellContext, type SortingState, type NoInfer } from './datatable.utils';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * A powerful, flexible datatable component built on TanStack Table.
@@ -13,6 +13,8 @@ export declare class NvDatatable<T> implements AfterViewInit, OnDestroy {
13
13
  rows: import("@angular/core").InputSignal<T[]>;
14
14
  /** Optional pagination configuration */
15
15
  pagination: import("@angular/core").InputSignal<NvDatatablePaginationConfig | undefined>;
16
+ /** Optional sorting configuration */
17
+ sorting: import("@angular/core").InputSignal<NvDatatableSortingConfig | undefined>;
16
18
  /** Should the header stick to the top of the table when scrolling? */
17
19
  stickyHeader: import("@angular/core").InputSignal<boolean>;
18
20
  /** Template for custom pagination UI */
@@ -27,6 +29,8 @@ export declare class NvDatatable<T> implements AfterViewInit, OnDestroy {
27
29
  private cellTemplateMap;
28
30
  /** Pagination state for server mode */
29
31
  private paginationState;
32
+ /** Sorting state for controlled sorting (server mode) */
33
+ private sortingState;
30
34
  /** Reference to table rows for infinite scroll observer */
31
35
  private tableRows;
32
36
  /** Intersection observer for infinite scroll */
@@ -39,13 +43,24 @@ export declare class NvDatatable<T> implements AfterViewInit, OnDestroy {
39
43
  private tableInstance;
40
44
  /** Public getter for table instance. */
41
45
  table(): import("./datatable.utils").Table<T>;
46
+ /**
47
+ * Handle sort direction change from table header
48
+ * @param {Event} event The sort direction change event or direction string
49
+ * @param {object} header The table header object
50
+ */
51
+ handleSortDirectionChanged(event: Event | CustomEvent<string> | string, header: {
52
+ column: {
53
+ clearSorting: () => void;
54
+ toggleSorting: (desc?: boolean, multi?: boolean) => void;
55
+ };
56
+ }): void;
42
57
  /** Build pagination API for template */
43
58
  paginationAPI: import("@angular/core").Signal<NvDatatableRenderPaginationAPI | null>;
44
59
  constructor();
45
60
  ngAfterViewInit(): void;
46
61
  ngOnDestroy(): void;
47
62
  static ɵfac: i0.ɵɵFactoryDeclaration<NvDatatable<any>, never>;
48
- static ɵcmp: i0.ɵɵComponentDeclaration<NvDatatable<any>, "nv-datatable", never, { "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; }, {}, ["paginationTemplate", "cellTemplates"], never, true, never>;
63
+ static ɵcmp: i0.ɵɵComponentDeclaration<NvDatatable<any>, "nv-datatable", never, { "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "sorting": { "alias": "sorting"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; }, {}, ["paginationTemplate", "cellTemplates"], never, true, never>;
49
64
  }
50
65
  /********************************* UTILS **************************************/
51
66
  /**
@@ -97,6 +112,16 @@ export interface NvDatatableColumn<Row, K extends keyof Row = keyof Row, F = Row
97
112
  renderCell?: (context: CellContext<Row, F>) => string | FlexRenderComponent | TemplateRef<{
98
113
  $implicit: CellContext<Row, F>;
99
114
  }>;
115
+ /** Enable/disable sorting for this column */
116
+ sortable?: boolean;
117
+ /** Custom sorting function or built-in function name */
118
+ sortingFn?: ((rowA: any, rowB: any, columnId: string) => number) | string;
119
+ /** Start with descending sort for this column */
120
+ sortDescFirst?: boolean;
121
+ /** Invert the sort order (useful for rankings) */
122
+ invertSorting?: boolean;
123
+ /** Where to place undefined values in sort */
124
+ sortUndefined?: 'first' | 'last' | false | -1 | 1;
100
125
  }
101
126
  /** Parameters for custom cell rendering function. */
102
127
  export interface NvTableRenderCellParams<Row, Value, Field> {
@@ -184,3 +209,27 @@ export interface NvDatatableRenderPaginationAPI {
184
209
  /** Whether more items are available (only for infinite scroll) */
185
210
  hasMore?: boolean;
186
211
  }
212
+ /**
213
+ * Sorting configuration for NvDatatable.
214
+ * Supports both client-side and server-side sorting.
215
+ */
216
+ export interface NvDatatableSortingConfig {
217
+ /** Sorting mode */
218
+ mode: 'client' | 'server';
219
+ /** Enable multi-column sorting with Shift+Click */
220
+ enableMultiSort?: boolean;
221
+ /** Allow cycling through to "no sort" state */
222
+ enableSortingRemoval?: boolean;
223
+ /** Maximum number of columns for multi-sort */
224
+ maxMultiSortColCount?: number;
225
+ /** Start with descending sort as first toggle state */
226
+ sortDescFirst?: boolean;
227
+ /** Controlled sort state (for server-side sorting) */
228
+ sortState?: SortingState;
229
+ /** Callback when sorting changes (for server-side sorting) */
230
+ onSortingChange?: (sorting: SortingState) => void;
231
+ }
232
+ /**
233
+ * Sorting state type - array of sort descriptors
234
+ */
235
+ export type NvDataTableSortingState = SortingState;
@@ -12,7 +12,7 @@ import * as i4 from "./providers/notification-service.component";
12
12
  export declare function provideNovaComponents(): Provider;
13
13
  export declare class NovaComponentsModule {
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<NovaComponentsModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<NovaComponentsModule, [typeof i1.NvAccordion, typeof i1.NvAccordionItem, typeof i1.NvAlert, typeof i1.NvAvatar, typeof i1.NvBadge, typeof i1.NvBreadcrumb, typeof i1.NvBreadcrumbs, typeof i1.NvButton, typeof i1.NvButtongroup, typeof i1.NvCalendar, typeof i1.NvCol, typeof i1.NvDatagrid, typeof i1.NvDatagridcolumn, typeof i1.NvDialog, typeof i1.NvDialogfooter, typeof i1.NvDialogheader, typeof i1.NvFieldcheckbox, typeof i1.NvFielddate, typeof i1.NvFielddaterange, typeof i1.NvFielddropdown, typeof i1.NvFielddropdownitem, typeof i1.NvFielddropdownitemcheck, typeof i1.NvFieldmultiselect, typeof i1.NvFieldnumber, typeof i1.NvFieldpassword, typeof i1.NvFieldradio, typeof i1.NvFieldselect, typeof i1.NvFieldslider, typeof i1.NvFieldtext, typeof i1.NvFieldtextarea, typeof i1.NvFieldtime, typeof i1.NvIcon, typeof i1.NvIconbutton, typeof i1.NvLoader, typeof i1.NvMenu, typeof i1.NvMenuitem, typeof i1.NvNotification, typeof i1.NvNotificationcontainer, typeof i1.NvPopover, typeof i1.NvRow, typeof i1.NvSplit, typeof i1.NvStack, typeof i1.NvTable, typeof i1.NvToggle, typeof i1.NvTogglebutton, typeof i1.NvTogglebuttongroup, typeof i1.NvTooltip], [typeof i2.NvDatatable], [typeof i1.NvAccordion, typeof i1.NvAccordionItem, typeof i1.NvAlert, typeof i1.NvAvatar, typeof i1.NvBadge, typeof i1.NvBreadcrumb, typeof i1.NvBreadcrumbs, typeof i1.NvButton, typeof i1.NvButtongroup, typeof i1.NvCalendar, typeof i1.NvCol, typeof i1.NvDatagrid, typeof i1.NvDatagridcolumn, typeof i1.NvDialog, typeof i1.NvDialogfooter, typeof i1.NvDialogheader, typeof i1.NvFieldcheckbox, typeof i1.NvFielddate, typeof i1.NvFielddaterange, typeof i1.NvFielddropdown, typeof i1.NvFielddropdownitem, typeof i1.NvFielddropdownitemcheck, typeof i1.NvFieldmultiselect, typeof i1.NvFieldnumber, typeof i1.NvFieldpassword, typeof i1.NvFieldradio, typeof i1.NvFieldselect, typeof i1.NvFieldslider, typeof i1.NvFieldtext, typeof i1.NvFieldtextarea, typeof i1.NvFieldtime, typeof i1.NvIcon, typeof i1.NvIconbutton, typeof i1.NvLoader, typeof i1.NvMenu, typeof i1.NvMenuitem, typeof i1.NvNotification, typeof i1.NvNotificationcontainer, typeof i1.NvPopover, typeof i1.NvRow, typeof i1.NvSplit, typeof i1.NvStack, typeof i1.NvTable, typeof i1.NvToggle, typeof i1.NvTogglebutton, typeof i1.NvTogglebuttongroup, typeof i1.NvTooltip, typeof i2.NvDatatable]>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NovaComponentsModule, [typeof i1.NvAccordion, typeof i1.NvAccordionItem, typeof i1.NvAlert, typeof i1.NvAvatar, typeof i1.NvBadge, typeof i1.NvBreadcrumb, typeof i1.NvBreadcrumbs, typeof i1.NvButton, typeof i1.NvButtongroup, typeof i1.NvCalendar, typeof i1.NvCol, typeof i1.NvDatagrid, typeof i1.NvDatagridcolumn, typeof i1.NvDialog, typeof i1.NvDialogfooter, typeof i1.NvDialogheader, typeof i1.NvFieldcheckbox, typeof i1.NvFielddate, typeof i1.NvFielddaterange, typeof i1.NvFielddropdown, typeof i1.NvFielddropdownitem, typeof i1.NvFielddropdownitemcheck, typeof i1.NvFieldmultiselect, typeof i1.NvFieldnumber, typeof i1.NvFieldpassword, typeof i1.NvFieldradio, typeof i1.NvFieldselect, typeof i1.NvFieldslider, typeof i1.NvFieldtext, typeof i1.NvFieldtextarea, typeof i1.NvFieldtime, typeof i1.NvIcon, typeof i1.NvIconbutton, typeof i1.NvLoader, typeof i1.NvMenu, typeof i1.NvMenuitem, typeof i1.NvNotification, typeof i1.NvNotificationcontainer, typeof i1.NvPopover, typeof i1.NvRow, typeof i1.NvSplit, typeof i1.NvStack, typeof i1.NvTable, typeof i1.NvTableheader, typeof i1.NvToggle, typeof i1.NvTogglebutton, typeof i1.NvTogglebuttongroup, typeof i1.NvTooltip], [typeof i2.NvDatatable], [typeof i1.NvAccordion, typeof i1.NvAccordionItem, typeof i1.NvAlert, typeof i1.NvAvatar, typeof i1.NvBadge, typeof i1.NvBreadcrumb, typeof i1.NvBreadcrumbs, typeof i1.NvButton, typeof i1.NvButtongroup, typeof i1.NvCalendar, typeof i1.NvCol, typeof i1.NvDatagrid, typeof i1.NvDatagridcolumn, typeof i1.NvDialog, typeof i1.NvDialogfooter, typeof i1.NvDialogheader, typeof i1.NvFieldcheckbox, typeof i1.NvFielddate, typeof i1.NvFielddaterange, typeof i1.NvFielddropdown, typeof i1.NvFielddropdownitem, typeof i1.NvFielddropdownitemcheck, typeof i1.NvFieldmultiselect, typeof i1.NvFieldnumber, typeof i1.NvFieldpassword, typeof i1.NvFieldradio, typeof i1.NvFieldselect, typeof i1.NvFieldslider, typeof i1.NvFieldtext, typeof i1.NvFieldtextarea, typeof i1.NvFieldtime, typeof i1.NvIcon, typeof i1.NvIconbutton, typeof i1.NvLoader, typeof i1.NvMenu, typeof i1.NvMenuitem, typeof i1.NvNotification, typeof i1.NvNotificationcontainer, typeof i1.NvPopover, typeof i1.NvRow, typeof i1.NvSplit, typeof i1.NvStack, typeof i1.NvTable, typeof i1.NvTableheader, typeof i1.NvToggle, typeof i1.NvTogglebutton, typeof i1.NvTogglebuttongroup, typeof i1.NvTooltip, typeof i2.NvDatatable]>;
16
16
  static ɵinj: i0.ɵɵInjectorDeclaration<NovaComponentsModule>;
17
17
  }
18
18
  export declare class NovaComponentsValueAccessorModule {
@@ -35,6 +35,8 @@ export interface NotificationOptions {
35
35
  actions?: NotificationAction[];
36
36
  /** Custom components for the notification actions. */
37
37
  actionSlot?: Type<unknown>;
38
+ /** Duration in milliseconds before auto-dismissing. 0 = sticky (no auto-dismiss). Default: 0 */
39
+ duration?: number;
38
40
  }
39
41
  /**
40
42
  * A notification with all required fields populated.
@@ -60,6 +62,7 @@ export interface NotificationServiceConfig {
60
62
  export declare class NotificationService {
61
63
  private readonly _notifications;
62
64
  private readonly _config;
65
+ private readonly timers;
63
66
  /**
64
67
  * Observable stream of active notifications.
65
68
  */
@@ -87,6 +90,10 @@ export declare class NotificationService {
87
90
  registerRef(id: string, el: HTMLNvNotificationElement): void;
88
91
  unregisterRef(id: string): void;
89
92
  clearRefs(): void;
93
+ /**
94
+ * Clean up all timers and references.
95
+ */
96
+ ngOnDestroy(): void;
90
97
  /**
91
98
  * Show a new notification.
92
99
  *
@@ -103,7 +103,7 @@ export declare class NvButton {
103
103
  protected el: HTMLNvButtonElement;
104
104
  constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
105
105
  static ɵfac: i0.ɵɵFactoryDeclaration<NvButton, never>;
106
- static ɵcmp: i0.ɵɵComponentDeclaration<NvButton, "nv-button", never, { "active": { "alias": "active"; "required": false; }; "danger": { "alias": "danger"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "emphasis": { "alias": "emphasis"; "required": false; }; "fluid": { "alias": "fluid"; "required": false; }; "form": { "alias": "form"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "size": { "alias": "size"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, ["*"], false, never>;
106
+ static ɵcmp: i0.ɵɵComponentDeclaration<NvButton, "nv-button", never, { "active": { "alias": "active"; "required": false; }; "danger": { "alias": "danger"; "required": false; }; "disableTabindex": { "alias": "disableTabindex"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "emphasis": { "alias": "emphasis"; "required": false; }; "fluid": { "alias": "fluid"; "required": false; }; "form": { "alias": "form"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "size": { "alias": "size"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, ["*"], false, never>;
107
107
  }
108
108
  export declare interface NvButton extends Components.NvButton {
109
109
  }
@@ -468,7 +468,7 @@ export declare class NvIconbutton {
468
468
  protected el: HTMLNvIconbuttonElement;
469
469
  constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
470
470
  static ɵfac: i0.ɵɵFactoryDeclaration<NvIconbutton, never>;
471
- static ɵcmp: i0.ɵɵComponentDeclaration<NvIconbutton, "nv-iconbutton", never, { "active": { "alias": "active"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "emphasis": { "alias": "emphasis"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "name": { "alias": "name"; "required": false; }; "shape": { "alias": "shape"; "required": false; }; "size": { "alias": "size"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, ["*"], false, never>;
471
+ static ɵcmp: i0.ɵɵComponentDeclaration<NvIconbutton, "nv-iconbutton", never, { "active": { "alias": "active"; "required": false; }; "disableTabindex": { "alias": "disableTabindex"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "emphasis": { "alias": "emphasis"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "name": { "alias": "name"; "required": false; }; "shape": { "alias": "shape"; "required": false; }; "size": { "alias": "size"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, ["*"], false, never>;
472
472
  }
473
473
  export declare interface NvIconbutton extends Components.NvIconbutton {
474
474
  }
@@ -590,6 +590,20 @@ export declare class NvTable {
590
590
  }
591
591
  export declare interface NvTable extends Components.NvTable {
592
592
  }
593
+ export declare class NvTableheader {
594
+ protected z: NgZone;
595
+ protected el: HTMLNvTableheaderElement;
596
+ constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
597
+ static ɵfac: i0.ɵɵFactoryDeclaration<NvTableheader, never>;
598
+ static ɵcmp: i0.ɵɵComponentDeclaration<NvTableheader, "nv-tableheader", never, { "sortDirection": { "alias": "sortDirection"; "required": false; }; "sortable": { "alias": "sortable"; "required": false; }; }, {}, never, ["*"], false, never>;
599
+ }
600
+ export declare interface NvTableheader extends Components.NvTableheader {
601
+ /**
602
+ * Event emitted when the sort direction changes. Payload is the new sort
603
+ direction.
604
+ */
605
+ sortDirectionChanged: EventEmitter<CustomEvent<string>>;
606
+ }
593
607
  export declare class NvToggle {
594
608
  protected z: NgZone;
595
609
  protected el: HTMLNvToggleElement;
@@ -1,2 +1,2 @@
1
1
  import * as d from './components';
2
- export declare const DIRECTIVES: (typeof d.NvAccordion | typeof d.NvAccordionItem | typeof d.NvAlert | typeof d.NvAvatar | typeof d.NvBadge | typeof d.NvBreadcrumb | typeof d.NvBreadcrumbs | typeof d.NvButton | typeof d.NvButtongroup | typeof d.NvCalendar | typeof d.NvCol | typeof d.NvDatagrid | typeof d.NvDatagridcolumn | typeof d.NvDialog | typeof d.NvDialogfooter | typeof d.NvDialogheader | typeof d.NvFieldcheckbox | typeof d.NvFielddate | typeof d.NvFielddaterange | typeof d.NvFielddropdown | typeof d.NvFielddropdownitem | typeof d.NvFielddropdownitemcheck | typeof d.NvFieldmultiselect | typeof d.NvFieldnumber | typeof d.NvFieldpassword | typeof d.NvFieldradio | typeof d.NvFieldselect | typeof d.NvFieldslider | typeof d.NvFieldtext | typeof d.NvFieldtextarea | typeof d.NvFieldtime | typeof d.NvIcon | typeof d.NvIconbutton | typeof d.NvLoader | typeof d.NvMenu | typeof d.NvMenuitem | typeof d.NvNotification | typeof d.NvNotificationcontainer | typeof d.NvPopover | typeof d.NvRow | typeof d.NvSplit | typeof d.NvStack | typeof d.NvTable | typeof d.NvToggle | typeof d.NvTogglebutton | typeof d.NvTogglebuttongroup | typeof d.NvTooltip)[];
2
+ export declare const DIRECTIVES: (typeof d.NvAccordion | typeof d.NvAccordionItem | typeof d.NvAlert | typeof d.NvAvatar | typeof d.NvBadge | typeof d.NvBreadcrumb | typeof d.NvBreadcrumbs | typeof d.NvButton | typeof d.NvButtongroup | typeof d.NvCalendar | typeof d.NvCol | typeof d.NvDatagrid | typeof d.NvDatagridcolumn | typeof d.NvDialog | typeof d.NvDialogfooter | typeof d.NvDialogheader | typeof d.NvFieldcheckbox | typeof d.NvFielddate | typeof d.NvFielddaterange | typeof d.NvFielddropdown | typeof d.NvFielddropdownitem | typeof d.NvFielddropdownitemcheck | typeof d.NvFieldmultiselect | typeof d.NvFieldnumber | typeof d.NvFieldpassword | typeof d.NvFieldradio | typeof d.NvFieldselect | typeof d.NvFieldslider | typeof d.NvFieldtext | typeof d.NvFieldtextarea | typeof d.NvFieldtime | typeof d.NvIcon | typeof d.NvIconbutton | typeof d.NvLoader | typeof d.NvMenu | typeof d.NvMenuitem | typeof d.NvNotification | typeof d.NvNotificationcontainer | typeof d.NvPopover | typeof d.NvRow | typeof d.NvSplit | typeof d.NvStack | typeof d.NvTable | typeof d.NvTableheader | typeof d.NvToggle | typeof d.NvTogglebutton | typeof d.NvTogglebuttongroup | typeof d.NvTooltip)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nova-design-system/nova-angular",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "Nova is a design system created by Elia Group to empower creators to efficiently build solutions that people love to use.",
5
5
  "author": "Elia Group",
6
6
  "homepage": "https://nova.eliagroup.io",