@nova-design-system/nova-angular-19 3.18.0 → 3.20.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.
- package/dist/nova-components/fesm2022/nova-components.mjs +60 -20
- package/dist/nova-components/fesm2022/nova-components.mjs.map +1 -1
- package/dist/nova-components/lib/components/nv-datatable-cell.directive.d.ts +7 -7
- package/dist/nova-components/lib/components/nv-datatable.component.d.ts +107 -59
- package/dist/nova-components/lib/stencil-generated/components.d.ts +13 -4
- package/package.json +1 -1
|
@@ -4,9 +4,9 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
/**
|
|
5
5
|
* Context type for cell templates - uses TanStack Table's CellContext directly
|
|
6
6
|
*/
|
|
7
|
-
export type NvDatatableCellContext<T> = {
|
|
7
|
+
export type NvDatatableCellContext<T, V> = {
|
|
8
8
|
/** The cell's actual value */
|
|
9
|
-
$implicit: CellContext<T,
|
|
9
|
+
$implicit: CellContext<T, V>;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Directive to mark ng-templates as cell templates for specific fields.
|
|
@@ -24,14 +24,14 @@ export type NvDatatableCellContext<T> = {
|
|
|
24
24
|
* </nv-datatable>
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
export declare class NvDatatableCellDirective<T
|
|
28
|
-
template: TemplateRef<NvDatatableCellContext<T>>;
|
|
27
|
+
export declare class NvDatatableCellDirective<T, V> {
|
|
28
|
+
template: TemplateRef<NvDatatableCellContext<T, V>>;
|
|
29
29
|
/**
|
|
30
30
|
* The field name this template should render.
|
|
31
31
|
* Should match a field in your column definitions.
|
|
32
32
|
*/
|
|
33
33
|
nvDatatableCell: string;
|
|
34
|
-
constructor(template: TemplateRef<NvDatatableCellContext<T>>);
|
|
35
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NvDatatableCellDirective<any>, never>;
|
|
36
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NvDatatableCellDirective<any>, "ng-template[nvDatatableCell]", never, { "nvDatatableCell": { "alias": "nvDatatableCell"; "required": true; }; }, {}, never, never, true, never>;
|
|
34
|
+
constructor(template: TemplateRef<NvDatatableCellContext<T, V>>);
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NvDatatableCellDirective<any, any>, never>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NvDatatableCellDirective<any, any>, "ng-template[nvDatatableCell]", never, { "nvDatatableCell": { "alias": "nvDatatableCell"; "required": true; }; }, {}, never, never, true, never>;
|
|
37
37
|
}
|
|
@@ -1,33 +1,125 @@
|
|
|
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 } from './datatable.utils';
|
|
3
|
+
import { type FlexRenderComponent, type ColumnDef, type CellContext, type NoInfer } from './datatable.utils';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A powerful, flexible datatable component built on TanStack Table.
|
|
7
|
+
* Supports custom cell rendering, column configuration, pagination, and full TypeScript typing.
|
|
8
|
+
*/
|
|
9
|
+
export declare class NvDatatable<T> implements AfterViewInit, OnDestroy {
|
|
10
|
+
/** Column definitions */
|
|
11
|
+
columns: import("@angular/core").InputSignal<NvDatatableColumn<T, keyof T, T[keyof T]>[]>;
|
|
12
|
+
/** Row data */
|
|
13
|
+
rows: import("@angular/core").InputSignal<T[]>;
|
|
14
|
+
/** Optional pagination configuration */
|
|
15
|
+
pagination: import("@angular/core").InputSignal<NvDatatablePaginationConfig | undefined>;
|
|
16
|
+
/** Should the header stick to the top of the table when scrolling? */
|
|
17
|
+
stickyHeader: import("@angular/core").InputSignal<boolean>;
|
|
18
|
+
/** Template for custom pagination UI */
|
|
19
|
+
paginationTemplate?: TemplateRef<{
|
|
20
|
+
$implicit: NvDatatableRenderPaginationAPI;
|
|
21
|
+
}>;
|
|
22
|
+
/** Cell templates provided via nvDatatableCell directive */
|
|
23
|
+
cellTemplates?: QueryList<NvDatatableCellDirective<T, T[keyof T]>>;
|
|
24
|
+
/** Signal to track cell templates array */
|
|
25
|
+
private cellTemplatesSignal;
|
|
26
|
+
/** Map of field names to cell templates */
|
|
27
|
+
private cellTemplateMap;
|
|
28
|
+
/** Pagination state for server mode */
|
|
29
|
+
private paginationState;
|
|
30
|
+
/** Reference to table rows for infinite scroll observer */
|
|
31
|
+
private tableRows;
|
|
32
|
+
/** Intersection observer for infinite scroll */
|
|
33
|
+
private observer;
|
|
34
|
+
/** Helper to check if using infinite scroll */
|
|
35
|
+
isInfiniteScroll: import("@angular/core").Signal<boolean>;
|
|
36
|
+
/** Computed table columns with proper typing and filtering. */
|
|
37
|
+
tableColumns: import("@angular/core").Signal<ColumnDef<T, T[keyof T]>[]>;
|
|
38
|
+
/** TanStack table instance with Signals */
|
|
39
|
+
private tableInstance;
|
|
40
|
+
/** Public getter for table instance. */
|
|
41
|
+
table(): import("@tanstack/table-core").Table<T>;
|
|
42
|
+
/** Build pagination API for template */
|
|
43
|
+
paginationAPI: import("@angular/core").Signal<NvDatatableRenderPaginationAPI | null>;
|
|
44
|
+
constructor();
|
|
45
|
+
ngAfterViewInit(): void;
|
|
46
|
+
ngOnDestroy(): void;
|
|
47
|
+
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>;
|
|
15
49
|
}
|
|
50
|
+
/********************************* UTILS **************************************/
|
|
51
|
+
/**
|
|
52
|
+
* Creates a strongly-typed column factory for a given row type.
|
|
53
|
+
*
|
|
54
|
+
* @template Row The row data type (e.g., `Product`)
|
|
55
|
+
*
|
|
56
|
+
* @returns {function} A function that accepts a column definition and infers:
|
|
57
|
+
* - `K` as the field key (`keyof Row`)
|
|
58
|
+
* - `F` as the return type of `valueFormatter` (defaults to `Row[K]`)
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* // Define your row type
|
|
63
|
+
* interface Product {
|
|
64
|
+
* name: string;
|
|
65
|
+
* price: number;
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
* const col = makeColumn<Product>();
|
|
69
|
+
*/
|
|
70
|
+
export declare function makeColumn<Row>(): <K extends keyof Row, F = Row[K]>(col: NvDatatableColumn<Row, K, F>) => NvDatatableColumn<Row>;
|
|
71
|
+
export { flexRenderComponent as nvDatatableRenderComponent } from './datatable.utils';
|
|
72
|
+
/********************************* TYPES **************************************/
|
|
73
|
+
export type { CellContext as NvDatatableCellContext };
|
|
16
74
|
/** Column definition for NvDatatable. */
|
|
17
|
-
export interface NvDatatableColumn<
|
|
18
|
-
|
|
75
|
+
export interface NvDatatableColumn<Row, K extends keyof Row = keyof Row, F = Row[K]> {
|
|
76
|
+
/** Field name from row data */
|
|
77
|
+
field: K;
|
|
78
|
+
/** Display name for column header */
|
|
19
79
|
headerName?: string;
|
|
80
|
+
/** Column width in pixels */
|
|
20
81
|
width?: number;
|
|
82
|
+
/** Whether column is resizable */
|
|
21
83
|
resizable?: boolean;
|
|
84
|
+
/** Whether column is hidden */
|
|
22
85
|
hidden?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Transform the raw value before rendering. Receives the cell value and full row object.
|
|
88
|
+
* This is useful for formatting dates, converting arrays to strings, accessing nested objects, etc.
|
|
89
|
+
* The transformed value is then passed to renderCell or templates.
|
|
90
|
+
*/
|
|
91
|
+
valueFormatter?: (params: NvTableValueFormatterParams<Row, Row[K], K>) => F;
|
|
23
92
|
/**
|
|
24
93
|
* Custom cell renderer function that can return either a string or Angular TemplateRef.
|
|
25
94
|
* Use `$implicit` in your template to receive the CellContext.
|
|
95
|
+
* Note: If valueFormatter is provided, renderCell receives the formatted value.
|
|
26
96
|
*/
|
|
27
|
-
renderCell?: (context: CellContext<
|
|
28
|
-
$implicit: CellContext<
|
|
97
|
+
renderCell?: (context: CellContext<Row, F>) => string | FlexRenderComponent | TemplateRef<{
|
|
98
|
+
$implicit: CellContext<Row, F>;
|
|
29
99
|
}>;
|
|
30
100
|
}
|
|
101
|
+
/** Parameters for custom cell rendering function. */
|
|
102
|
+
export interface NvTableRenderCellParams<Row, Value, Field> {
|
|
103
|
+
/** Cell value */
|
|
104
|
+
value: Value | NoInfer<Value>;
|
|
105
|
+
/** Row data */
|
|
106
|
+
row: Row;
|
|
107
|
+
/** Field name */
|
|
108
|
+
field: Field;
|
|
109
|
+
/** Row index */
|
|
110
|
+
rowIndex: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Parameters for valueFormatter function.
|
|
114
|
+
*/
|
|
115
|
+
export interface NvTableValueFormatterParams<Row, Value, Field> {
|
|
116
|
+
/** Cell original value */
|
|
117
|
+
value: Value;
|
|
118
|
+
/** Row data */
|
|
119
|
+
row: Row;
|
|
120
|
+
/** Field name */
|
|
121
|
+
field: Field;
|
|
122
|
+
}
|
|
31
123
|
/**
|
|
32
124
|
* Pagination configuration for NvDatatable.
|
|
33
125
|
* Supports three modes: client-side, server-side with buttons, and infinite scroll.
|
|
@@ -92,47 +184,3 @@ export interface NvDatatableRenderPaginationAPI {
|
|
|
92
184
|
/** Whether more items are available (only for infinite scroll) */
|
|
93
185
|
hasMore?: boolean;
|
|
94
186
|
}
|
|
95
|
-
/**
|
|
96
|
-
* Nova Datatable built on TanStack Table (Angular).
|
|
97
|
-
*/
|
|
98
|
-
export declare class NvDatatable<T extends NvDatatableRow = NvDatatableRow> implements AfterViewInit, OnDestroy {
|
|
99
|
-
/** Column definitions */
|
|
100
|
-
columns: import("@angular/core").InputSignal<NvDatatableColumn<T>[]>;
|
|
101
|
-
/** Row data */
|
|
102
|
-
rows: import("@angular/core").InputSignal<T[]>;
|
|
103
|
-
/** Optional pagination configuration */
|
|
104
|
-
pagination: import("@angular/core").InputSignal<NvDatatablePaginationConfig | undefined>;
|
|
105
|
-
/** Should the header stick to the top of the table when scrolling? */
|
|
106
|
-
stickyHeader: import("@angular/core").InputSignal<boolean>;
|
|
107
|
-
/** Template for custom pagination UI */
|
|
108
|
-
paginationTemplate?: TemplateRef<{
|
|
109
|
-
$implicit: NvDatatableRenderPaginationAPI;
|
|
110
|
-
}>;
|
|
111
|
-
/** Cell templates provided via nvDatatableCell directive */
|
|
112
|
-
cellTemplates?: QueryList<NvDatatableCellDirective<T>>;
|
|
113
|
-
/** Signal to track cell templates array */
|
|
114
|
-
private cellTemplatesSignal;
|
|
115
|
-
/** Map of field names to cell templates */
|
|
116
|
-
private cellTemplateMap;
|
|
117
|
-
/** Pagination state for server mode */
|
|
118
|
-
private paginationState;
|
|
119
|
-
/** Reference to table rows for infinite scroll observer */
|
|
120
|
-
private tableRows;
|
|
121
|
-
/** Intersection observer for infinite scroll */
|
|
122
|
-
private observer;
|
|
123
|
-
/** Helper to check if using infinite scroll */
|
|
124
|
-
isInfiniteScroll: import("@angular/core").Signal<boolean>;
|
|
125
|
-
/** Computed table columns with proper typing and filtering. */
|
|
126
|
-
tableColumns: import("@angular/core").Signal<ColumnDef<T>[]>;
|
|
127
|
-
/** TanStack table instance with Signals */
|
|
128
|
-
private tableInstance;
|
|
129
|
-
/** Public getter for table instance. */
|
|
130
|
-
table(): import("@tanstack/table-core").Table<T>;
|
|
131
|
-
/** Build pagination API for template */
|
|
132
|
-
paginationAPI: import("@angular/core").Signal<NvDatatableRenderPaginationAPI | null>;
|
|
133
|
-
constructor();
|
|
134
|
-
ngAfterViewInit(): void;
|
|
135
|
-
ngOnDestroy(): void;
|
|
136
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NvDatatable<any>, never>;
|
|
137
|
-
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>;
|
|
138
|
-
}
|
|
@@ -277,13 +277,21 @@ export declare class NvFielddropdown {
|
|
|
277
277
|
protected el: HTMLNvFielddropdownElement;
|
|
278
278
|
constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
|
|
279
279
|
static ɵfac: i0.ɵɵFactoryDeclaration<NvFielddropdown, never>;
|
|
280
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NvFielddropdown, "nv-fielddropdown", never, { "autocomplete": { "alias": "autocomplete"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; "debounceDelay": { "alias": "debounceDelay"; "required": false; }; "description": { "alias": "description"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "emptyResult": { "alias": "emptyResult"; "required": false; }; "error": { "alias": "error"; "required": false; }; "errorDescription": { "alias": "errorDescription"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "fluid": { "alias": "fluid"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "label": { "alias": "label"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "name": { "alias": "name"; "required": false; }; "
|
|
280
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NvFielddropdown, "nv-fielddropdown", never, { "autocomplete": { "alias": "autocomplete"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; "controlledFilter": { "alias": "controlledFilter"; "required": false; }; "debounceDelay": { "alias": "debounceDelay"; "required": false; }; "description": { "alias": "description"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "emptyResult": { "alias": "emptyResult"; "required": false; }; "error": { "alias": "error"; "required": false; }; "errorDescription": { "alias": "errorDescription"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "fluid": { "alias": "fluid"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "label": { "alias": "label"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "name": { "alias": "name"; "required": false; }; "openOnSelect": { "alias": "openOnSelect"; "required": false; }; "options": { "alias": "options"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
281
281
|
}
|
|
282
282
|
export declare interface NvFielddropdown extends Components.NvFielddropdown {
|
|
283
283
|
/**
|
|
284
284
|
* Emitted when the input value changes. @bind value
|
|
285
285
|
*/
|
|
286
286
|
valueChanged: EventEmitter<CustomEvent<string>>;
|
|
287
|
+
/**
|
|
288
|
+
* Event emitted when the filter input value changes.
|
|
289
|
+
*/
|
|
290
|
+
filterTextChanged: EventEmitter<CustomEvent<string>>;
|
|
291
|
+
/**
|
|
292
|
+
* Event emitted when the dropdown opened or closed.
|
|
293
|
+
*/
|
|
294
|
+
openChanged: EventEmitter<CustomEvent<HTMLNvPopoverElementEventMap['openChanged']>>;
|
|
287
295
|
/**
|
|
288
296
|
* Event emitted when an item is clicked.
|
|
289
297
|
*/
|
|
@@ -294,7 +302,7 @@ export declare class NvFielddropdownitem {
|
|
|
294
302
|
protected el: HTMLNvFielddropdownitemElement;
|
|
295
303
|
constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
|
|
296
304
|
static ɵfac: i0.ɵɵFactoryDeclaration<NvFielddropdownitem, never>;
|
|
297
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NvFielddropdownitem, "nv-fielddropdownitem", never, { "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
305
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NvFielddropdownitem, "nv-fielddropdownitem", never, { "detached": { "alias": "detached"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
298
306
|
}
|
|
299
307
|
export declare interface NvFielddropdownitem extends Components.NvFielddropdownitem {
|
|
300
308
|
/**
|
|
@@ -302,7 +310,8 @@ export declare interface NvFielddropdownitem extends Components.NvFielddropdowni
|
|
|
302
310
|
*/
|
|
303
311
|
dropdownItemSelected: EventEmitter<CustomEvent<{
|
|
304
312
|
label?: string; /** The value associated with the item. */
|
|
305
|
-
value: string;
|
|
313
|
+
value: string; /** Is the item detached? */
|
|
314
|
+
detached?: boolean;
|
|
306
315
|
}>>;
|
|
307
316
|
}
|
|
308
317
|
export declare class NvFielddropdownitemcheck {
|
|
@@ -351,7 +360,7 @@ export declare interface NvFieldnumber extends Components.NvFieldnumber {
|
|
|
351
360
|
/**
|
|
352
361
|
* Emitted when the input value changes. @bind value
|
|
353
362
|
*/
|
|
354
|
-
valueChanged: EventEmitter<CustomEvent<number>>;
|
|
363
|
+
valueChanged: EventEmitter<CustomEvent<number | null>>;
|
|
355
364
|
}
|
|
356
365
|
export declare class NvFieldpassword {
|
|
357
366
|
protected z: NgZone;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nova-design-system/nova-angular-19",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.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",
|