@nova-design-system/nova-angular-19 3.16.0 → 3.18.0-beta.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 +366 -42
- package/dist/nova-components/fesm2022/nova-components.mjs.map +1 -1
- package/dist/nova-components/lib/components/index.d.ts +1 -0
- package/dist/nova-components/lib/components/nv-datatable-cell.directive.d.ts +37 -0
- package/dist/nova-components/lib/components/nv-datatable.component.d.ts +95 -3
- package/dist/nova-components/lib/nova-components.module.d.ts +2 -2
- package/dist/nova-components/lib/stencil-generated/component-value-accessors.d.ts +8 -1
- package/dist/nova-components/lib/stencil-generated/components.d.ts +13 -0
- package/dist/nova-components/lib/stencil-generated/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, untracked, computed, InjectionToken, inject, reflectComponentType, ViewContainerRef, Injectable, KeyValueDiffers, ChangeDetectorRef, OutputEmitterRef, TemplateRef, Type, Injector, runInInjectionContext, effect,
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Directive, Input, untracked, computed, InjectionToken, inject, reflectComponentType, ViewContainerRef, Injectable, KeyValueDiffers, ChangeDetectorRef, OutputEmitterRef, TemplateRef, Type, Injector, runInInjectionContext, effect, Inject, signal, input, viewChild, CUSTOM_ELEMENTS_SCHEMA, ContentChild, ContentChildren, HostListener, NgModule, ElementRef, ViewChildren } from '@angular/core';
|
|
3
3
|
import { __decorate } from 'tslib';
|
|
4
4
|
import { fromEvent, BehaviorSubject } from 'rxjs';
|
|
5
5
|
import * as i2 from '@angular/common';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
|
-
import { memo, createTable, getCoreRowModel } from '@tanstack/table-core';
|
|
7
|
+
import { memo, createTable, getCoreRowModel, getPaginationRowModel } from '@tanstack/table-core';
|
|
8
8
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
9
|
export * from '@nova-design-system/nova-webcomponents/constants';
|
|
10
10
|
|
|
@@ -1100,6 +1100,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
1100
1100
|
standalone: false
|
|
1101
1101
|
}]
|
|
1102
1102
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
1103
|
+
let NvSplit = class NvSplit {
|
|
1104
|
+
constructor(c, r, z) {
|
|
1105
|
+
this.z = z;
|
|
1106
|
+
c.detach();
|
|
1107
|
+
this.el = r.nativeElement;
|
|
1108
|
+
proxyOutputs(this, this.el, ['sizesChanged']);
|
|
1109
|
+
}
|
|
1110
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvSplit, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1111
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NvSplit, isStandalone: false, selector: "nv-split", inputs: { direction: "direction", gutterSize: "gutterSize", minSizes: "minSizes", sizes: "sizes" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1112
|
+
};
|
|
1113
|
+
NvSplit = __decorate([
|
|
1114
|
+
ProxyCmp({
|
|
1115
|
+
inputs: ['direction', 'gutterSize', 'minSizes', 'sizes'],
|
|
1116
|
+
methods: ['setSizes', 'getSizes', 'collapse', 'destroy']
|
|
1117
|
+
})
|
|
1118
|
+
], NvSplit);
|
|
1119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvSplit, decorators: [{
|
|
1120
|
+
type: Component,
|
|
1121
|
+
args: [{
|
|
1122
|
+
selector: 'nv-split',
|
|
1123
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1124
|
+
template: '<ng-content></ng-content>',
|
|
1125
|
+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
1126
|
+
inputs: ['direction', 'gutterSize', 'minSizes', 'sizes'],
|
|
1127
|
+
standalone: false
|
|
1128
|
+
}]
|
|
1129
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
1103
1130
|
let NvStack = class NvStack {
|
|
1104
1131
|
constructor(c, r, z) {
|
|
1105
1132
|
this.z = z;
|
|
@@ -1294,6 +1321,7 @@ const DIRECTIVES = [
|
|
|
1294
1321
|
NvNotificationcontainer,
|
|
1295
1322
|
NvPopover,
|
|
1296
1323
|
NvRow,
|
|
1324
|
+
NvSplit,
|
|
1297
1325
|
NvStack,
|
|
1298
1326
|
NvTable,
|
|
1299
1327
|
NvToggle,
|
|
@@ -1302,6 +1330,41 @@ const DIRECTIVES = [
|
|
|
1302
1330
|
NvTooltip
|
|
1303
1331
|
];
|
|
1304
1332
|
|
|
1333
|
+
/**
|
|
1334
|
+
* Directive to mark ng-templates as cell templates for specific fields.
|
|
1335
|
+
*
|
|
1336
|
+
* @example
|
|
1337
|
+
* ```html
|
|
1338
|
+
* <nv-datatable [columns]="columns" [rows]="data">
|
|
1339
|
+
* <ng-template nvDatatableCell="name" let-context>
|
|
1340
|
+
* <div class="font-semibold">{{ context.value }}</div>
|
|
1341
|
+
* </ng-template>
|
|
1342
|
+
*
|
|
1343
|
+
* <ng-template nvDatatableCell="price" let-context>
|
|
1344
|
+
* <span class="font-mono">${{ context.value }}</span>
|
|
1345
|
+
* </ng-template>
|
|
1346
|
+
* </nv-datatable>
|
|
1347
|
+
* ```
|
|
1348
|
+
*/
|
|
1349
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1350
|
+
class NvDatatableCellDirective {
|
|
1351
|
+
constructor(template) {
|
|
1352
|
+
this.template = template;
|
|
1353
|
+
}
|
|
1354
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvDatatableCellDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1355
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: NvDatatableCellDirective, isStandalone: true, selector: "ng-template[nvDatatableCell]", inputs: { nvDatatableCell: "nvDatatableCell" }, ngImport: i0 }); }
|
|
1356
|
+
}
|
|
1357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvDatatableCellDirective, decorators: [{
|
|
1358
|
+
type: Directive,
|
|
1359
|
+
args: [{
|
|
1360
|
+
selector: 'ng-template[nvDatatableCell]',
|
|
1361
|
+
standalone: true,
|
|
1362
|
+
}]
|
|
1363
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { nvDatatableCell: [{
|
|
1364
|
+
type: Input,
|
|
1365
|
+
args: [{ required: true }]
|
|
1366
|
+
}] } });
|
|
1367
|
+
|
|
1305
1368
|
/**
|
|
1306
1369
|
* Implementation from @tanstack/angular-query
|
|
1307
1370
|
* {@link https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/util/lazy-init/lazy-init.ts}
|
|
@@ -2033,38 +2096,227 @@ function createAngularTable(options) {
|
|
|
2033
2096
|
* Nova Datatable built on TanStack Table (Angular).
|
|
2034
2097
|
*/
|
|
2035
2098
|
class NvDatatable {
|
|
2099
|
+
/** Public getter for table instance. */
|
|
2100
|
+
table() {
|
|
2101
|
+
return this.tableInstance();
|
|
2102
|
+
}
|
|
2036
2103
|
constructor() {
|
|
2037
2104
|
/** Column definitions */
|
|
2038
2105
|
this.columns = input([]);
|
|
2039
2106
|
/** Row data */
|
|
2040
2107
|
this.rows = input([]);
|
|
2108
|
+
/** Optional pagination configuration */
|
|
2109
|
+
this.pagination = input(undefined);
|
|
2110
|
+
/** Should the header stick to the top of the table when scrolling? */
|
|
2111
|
+
this.stickyHeader = input(false);
|
|
2112
|
+
/** Signal to track cell templates array */
|
|
2113
|
+
this.cellTemplatesSignal = signal([]);
|
|
2114
|
+
/** Map of field names to cell templates */
|
|
2115
|
+
this.cellTemplateMap = computed(() => {
|
|
2116
|
+
const map = new Map();
|
|
2117
|
+
this.cellTemplatesSignal().forEach((directive) => {
|
|
2118
|
+
map.set(directive.nvDatatableCell, directive.template);
|
|
2119
|
+
});
|
|
2120
|
+
return map;
|
|
2121
|
+
});
|
|
2122
|
+
/** Pagination state for server mode */
|
|
2123
|
+
this.paginationState = signal({
|
|
2124
|
+
pageIndex: 0,
|
|
2125
|
+
pageSize: this.pagination()?.initialPageSize || 10,
|
|
2126
|
+
});
|
|
2127
|
+
/** Reference to table rows for infinite scroll observer */
|
|
2128
|
+
this.tableRows = viewChild('tableRow');
|
|
2129
|
+
/** Intersection observer for infinite scroll */
|
|
2130
|
+
this.observer = null;
|
|
2131
|
+
/** Helper to check if using infinite scroll */
|
|
2132
|
+
this.isInfiniteScroll = computed(() => this.pagination()?.mode === 'infinite');
|
|
2041
2133
|
/** Computed table columns with proper typing and filtering. */
|
|
2042
|
-
this.tableColumns = computed(() =>
|
|
2043
|
-
|
|
2044
|
-
.
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2134
|
+
this.tableColumns = computed(() => {
|
|
2135
|
+
const templateMap = this.cellTemplateMap();
|
|
2136
|
+
return this.columns()
|
|
2137
|
+
.filter((col) => !col.hidden)
|
|
2138
|
+
.map((col) => ({
|
|
2139
|
+
accessorKey: col.field,
|
|
2140
|
+
header: col.headerName || String(col.field),
|
|
2141
|
+
size: col.width,
|
|
2142
|
+
enableResizing: col.resizable ?? true,
|
|
2143
|
+
cell: (context) => {
|
|
2144
|
+
const fieldName = String(col.field);
|
|
2145
|
+
const cellTemplate = templateMap.get(fieldName);
|
|
2146
|
+
// Priority: template > renderCell > default
|
|
2147
|
+
if (cellTemplate) {
|
|
2148
|
+
// Return TemplateRef directly - FlexRender will handle it
|
|
2149
|
+
return cellTemplate;
|
|
2150
|
+
}
|
|
2151
|
+
// Fall back to renderCell if provided
|
|
2152
|
+
if (col.renderCell) {
|
|
2153
|
+
return col.renderCell(context);
|
|
2154
|
+
}
|
|
2155
|
+
// Default: just return the value
|
|
2156
|
+
return context.getValue();
|
|
2157
|
+
},
|
|
2158
|
+
}));
|
|
2159
|
+
});
|
|
2052
2160
|
/** TanStack table instance with Signals */
|
|
2053
|
-
this.tableInstance = createAngularTable(() =>
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2161
|
+
this.tableInstance = createAngularTable(() => {
|
|
2162
|
+
const paginationConfig = this.pagination();
|
|
2163
|
+
if (!paginationConfig || paginationConfig.mode === 'infinite') {
|
|
2164
|
+
// No pagination or infinite scroll - simple config
|
|
2165
|
+
return {
|
|
2166
|
+
data: this.rows(),
|
|
2167
|
+
columns: this.tableColumns(),
|
|
2168
|
+
getCoreRowModel: getCoreRowModel(),
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
else if (paginationConfig.mode === 'client') {
|
|
2172
|
+
// Client-side pagination
|
|
2173
|
+
return {
|
|
2174
|
+
data: this.rows(),
|
|
2175
|
+
columns: this.tableColumns(),
|
|
2176
|
+
getCoreRowModel: getCoreRowModel(),
|
|
2177
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
2178
|
+
initialState: {
|
|
2179
|
+
pagination: {
|
|
2180
|
+
pageIndex: 0,
|
|
2181
|
+
pageSize: paginationConfig.initialPageSize || 10,
|
|
2182
|
+
},
|
|
2183
|
+
},
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
else {
|
|
2187
|
+
// Server-side pagination
|
|
2188
|
+
const pageSize = this.paginationState().pageSize;
|
|
2189
|
+
return {
|
|
2190
|
+
data: this.rows(),
|
|
2191
|
+
columns: this.tableColumns(),
|
|
2192
|
+
getCoreRowModel: getCoreRowModel(),
|
|
2193
|
+
manualPagination: true,
|
|
2194
|
+
pageCount: paginationConfig.totalPageCount !== undefined
|
|
2195
|
+
? paginationConfig.totalPageCount
|
|
2196
|
+
: paginationConfig.totalRowCount !== undefined
|
|
2197
|
+
? Math.ceil(paginationConfig.totalRowCount / pageSize)
|
|
2198
|
+
: -1,
|
|
2199
|
+
state: {
|
|
2200
|
+
pagination: this.paginationState(),
|
|
2201
|
+
},
|
|
2202
|
+
onPaginationChange: (updaterOrValue) => {
|
|
2203
|
+
if (typeof updaterOrValue === 'function') {
|
|
2204
|
+
this.paginationState.set(updaterOrValue(this.paginationState()));
|
|
2205
|
+
}
|
|
2206
|
+
else {
|
|
2207
|
+
this.paginationState.set(updaterOrValue);
|
|
2208
|
+
}
|
|
2209
|
+
},
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
});
|
|
2213
|
+
/** Build pagination API for template */
|
|
2214
|
+
this.paginationAPI = computed(() => {
|
|
2215
|
+
const paginationConfig = this.pagination();
|
|
2216
|
+
if (!paginationConfig) {
|
|
2217
|
+
return null;
|
|
2218
|
+
}
|
|
2219
|
+
const table = this.table();
|
|
2220
|
+
const tablePaginationState = table.getState().pagination;
|
|
2221
|
+
const pageCount = table.getPageCount();
|
|
2222
|
+
const rowCount = paginationConfig.mode === 'server'
|
|
2223
|
+
? paginationConfig.totalRowCount || this.rows().length
|
|
2224
|
+
: this.rows().length;
|
|
2225
|
+
return {
|
|
2226
|
+
pageIndex: tablePaginationState.pageIndex,
|
|
2227
|
+
pageSize: tablePaginationState.pageSize,
|
|
2228
|
+
pageCount,
|
|
2229
|
+
rowCount,
|
|
2230
|
+
firstPage: () => table.setPageIndex(0),
|
|
2231
|
+
previousPage: () => table.previousPage(),
|
|
2232
|
+
nextPage: () => table.nextPage(),
|
|
2233
|
+
lastPage: () => table.setPageIndex(pageCount - 1),
|
|
2234
|
+
setPageIndex: (index) => table.setPageIndex(index),
|
|
2235
|
+
setPageSize: (size) => table.setPageSize(size),
|
|
2236
|
+
canPreviousPage: table.getCanPreviousPage(),
|
|
2237
|
+
canNextPage: table.getCanNextPage(),
|
|
2238
|
+
isLoading: paginationConfig.mode === 'infinite'
|
|
2239
|
+
? paginationConfig.isLoading
|
|
2240
|
+
: undefined,
|
|
2241
|
+
hasMore: paginationConfig.mode === 'infinite'
|
|
2242
|
+
? paginationConfig.hasMore
|
|
2243
|
+
: undefined,
|
|
2244
|
+
};
|
|
2245
|
+
});
|
|
2246
|
+
// Watch pagination state changes for server mode
|
|
2247
|
+
effect(() => {
|
|
2248
|
+
const paginationConfig = this.pagination();
|
|
2249
|
+
const state = this.paginationState();
|
|
2250
|
+
if (paginationConfig?.mode === 'server' &&
|
|
2251
|
+
paginationConfig.onPaginationChange) {
|
|
2252
|
+
paginationConfig.onPaginationChange({
|
|
2253
|
+
pageIndex: state.pageIndex,
|
|
2254
|
+
pageSize: state.pageSize,
|
|
2255
|
+
});
|
|
2256
|
+
}
|
|
2257
|
+
}, { allowSignalWrites: true });
|
|
2258
|
+
// Set up intersection observer for infinite scroll
|
|
2259
|
+
effect(() => {
|
|
2260
|
+
const paginationConfig = this.pagination();
|
|
2261
|
+
const rows = this.rows(); // Track rows changes
|
|
2262
|
+
// Clean up existing observer
|
|
2263
|
+
if (this.observer) {
|
|
2264
|
+
this.observer.disconnect();
|
|
2265
|
+
this.observer = null;
|
|
2266
|
+
}
|
|
2267
|
+
// Only set up observer for infinite scroll mode
|
|
2268
|
+
if (paginationConfig?.mode !== 'infinite' || rows.length === 0) {
|
|
2269
|
+
return;
|
|
2270
|
+
}
|
|
2271
|
+
// Use setTimeout to ensure DOM is updated
|
|
2272
|
+
setTimeout(() => {
|
|
2273
|
+
const threshold = paginationConfig.loadMoreThreshold || 500;
|
|
2274
|
+
// Find the last row element
|
|
2275
|
+
const tableRowElements = document.querySelectorAll('[data-is-last="true"]');
|
|
2276
|
+
const lastRowElement = tableRowElements[tableRowElements.length - 1];
|
|
2277
|
+
if (!lastRowElement) {
|
|
2278
|
+
return;
|
|
2279
|
+
}
|
|
2280
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
2281
|
+
const entry = entries[0];
|
|
2282
|
+
if (entry.isIntersecting &&
|
|
2283
|
+
paginationConfig.mode === 'infinite' &&
|
|
2284
|
+
paginationConfig.hasMore &&
|
|
2285
|
+
!paginationConfig.isLoading &&
|
|
2286
|
+
paginationConfig.onLoadMore) {
|
|
2287
|
+
paginationConfig.onLoadMore();
|
|
2288
|
+
}
|
|
2289
|
+
}, {
|
|
2290
|
+
rootMargin: `${threshold}px`,
|
|
2291
|
+
root: null,
|
|
2292
|
+
});
|
|
2293
|
+
this.observer.observe(lastRowElement);
|
|
2294
|
+
}, 0);
|
|
2295
|
+
}, { allowSignalWrites: true });
|
|
2058
2296
|
}
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2297
|
+
ngAfterViewInit() {
|
|
2298
|
+
// Sync cell templates QueryList to signal
|
|
2299
|
+
if (this.cellTemplates) {
|
|
2300
|
+
this.cellTemplatesSignal.set(this.cellTemplates.toArray());
|
|
2301
|
+
// Subscribe to changes in the QueryList
|
|
2302
|
+
this.cellTemplates.changes.subscribe(() => {
|
|
2303
|
+
if (this.cellTemplates) {
|
|
2304
|
+
this.cellTemplatesSignal.set(this.cellTemplates.toArray());
|
|
2305
|
+
}
|
|
2306
|
+
});
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
ngOnDestroy() {
|
|
2310
|
+
if (this.observer) {
|
|
2311
|
+
this.observer.disconnect();
|
|
2312
|
+
this.observer = null;
|
|
2313
|
+
}
|
|
2062
2314
|
}
|
|
2063
2315
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvDatatable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2064
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: NvDatatable, isStandalone: true, selector: "nv-datatable", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
2316
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: NvDatatable, isStandalone: true, selector: "nv-datatable", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "paginationTemplate", first: true, predicate: ["paginationTemplate"], descendants: true, read: TemplateRef }, { propertyName: "cellTemplates", predicate: NvDatatableCellDirective }], viewQueries: [{ propertyName: "tableRows", first: true, predicate: ["tableRow"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2065
2317
|
<nv-table>
|
|
2066
2318
|
<table>
|
|
2067
|
-
<thead>
|
|
2319
|
+
<thead [attr.data-sticky-top]="stickyHeader() ? 'true' : null">
|
|
2068
2320
|
@for (headerGroup of table().getHeaderGroups(); track headerGroup.id)
|
|
2069
2321
|
{
|
|
2070
2322
|
<tr>
|
|
@@ -2090,14 +2342,19 @@ class NvDatatable {
|
|
|
2090
2342
|
</thead>
|
|
2091
2343
|
|
|
2092
2344
|
<tbody>
|
|
2093
|
-
@for (row of table().getRowModel().rows; track row.id)
|
|
2094
|
-
|
|
2345
|
+
@for (row of table().getRowModel().rows; track row.id; let i = $index)
|
|
2346
|
+
{
|
|
2347
|
+
<tr
|
|
2348
|
+
[attr.data-testid]="'datatable-row-' + row.id"
|
|
2349
|
+
#tableRow
|
|
2350
|
+
[attr.data-is-last]="
|
|
2351
|
+
isInfiniteScroll() && i === table().getRowModel().rows.length - 1
|
|
2352
|
+
? 'true'
|
|
2353
|
+
: null
|
|
2354
|
+
"
|
|
2355
|
+
>
|
|
2095
2356
|
@for (cell of row.getVisibleCells(); track cell.id) {
|
|
2096
|
-
<td
|
|
2097
|
-
[attr.data-testid]="'datatable-cell-' + cell.id"
|
|
2098
|
-
style="padding: 8px; border-bottom: 1px solid #eee;"
|
|
2099
|
-
>
|
|
2100
|
-
<!-- Let FlexRender handle strings vs TemplateRef -->
|
|
2357
|
+
<td [attr.data-testid]="'datatable-cell-' + cell.id">
|
|
2101
2358
|
<ng-container
|
|
2102
2359
|
*flexRender="
|
|
2103
2360
|
cell.column.columnDef.cell;
|
|
@@ -2114,7 +2371,17 @@ class NvDatatable {
|
|
|
2114
2371
|
</tbody>
|
|
2115
2372
|
</table>
|
|
2116
2373
|
</nv-table>
|
|
2117
|
-
|
|
2374
|
+
|
|
2375
|
+
<!-- Render pagination if configured -->
|
|
2376
|
+
@if (paginationAPI()) {
|
|
2377
|
+
<ng-container
|
|
2378
|
+
*ngTemplateOutlet="
|
|
2379
|
+
paginationTemplate || null;
|
|
2380
|
+
context: { $implicit: paginationAPI() }
|
|
2381
|
+
"
|
|
2382
|
+
></ng-container>
|
|
2383
|
+
}
|
|
2384
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: FlexRenderDirective, selector: "[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }] }); }
|
|
2118
2385
|
}
|
|
2119
2386
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvDatatable, decorators: [{
|
|
2120
2387
|
type: Component,
|
|
@@ -2126,7 +2393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
2126
2393
|
template: `
|
|
2127
2394
|
<nv-table>
|
|
2128
2395
|
<table>
|
|
2129
|
-
<thead>
|
|
2396
|
+
<thead [attr.data-sticky-top]="stickyHeader() ? 'true' : null">
|
|
2130
2397
|
@for (headerGroup of table().getHeaderGroups(); track headerGroup.id)
|
|
2131
2398
|
{
|
|
2132
2399
|
<tr>
|
|
@@ -2152,14 +2419,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
2152
2419
|
</thead>
|
|
2153
2420
|
|
|
2154
2421
|
<tbody>
|
|
2155
|
-
@for (row of table().getRowModel().rows; track row.id)
|
|
2156
|
-
|
|
2422
|
+
@for (row of table().getRowModel().rows; track row.id; let i = $index)
|
|
2423
|
+
{
|
|
2424
|
+
<tr
|
|
2425
|
+
[attr.data-testid]="'datatable-row-' + row.id"
|
|
2426
|
+
#tableRow
|
|
2427
|
+
[attr.data-is-last]="
|
|
2428
|
+
isInfiniteScroll() && i === table().getRowModel().rows.length - 1
|
|
2429
|
+
? 'true'
|
|
2430
|
+
: null
|
|
2431
|
+
"
|
|
2432
|
+
>
|
|
2157
2433
|
@for (cell of row.getVisibleCells(); track cell.id) {
|
|
2158
|
-
<td
|
|
2159
|
-
[attr.data-testid]="'datatable-cell-' + cell.id"
|
|
2160
|
-
style="padding: 8px; border-bottom: 1px solid #eee;"
|
|
2161
|
-
>
|
|
2162
|
-
<!-- Let FlexRender handle strings vs TemplateRef -->
|
|
2434
|
+
<td [attr.data-testid]="'datatable-cell-' + cell.id">
|
|
2163
2435
|
<ng-container
|
|
2164
2436
|
*flexRender="
|
|
2165
2437
|
cell.column.columnDef.cell;
|
|
@@ -2176,9 +2448,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
2176
2448
|
</tbody>
|
|
2177
2449
|
</table>
|
|
2178
2450
|
</nv-table>
|
|
2451
|
+
|
|
2452
|
+
<!-- Render pagination if configured -->
|
|
2453
|
+
@if (paginationAPI()) {
|
|
2454
|
+
<ng-container
|
|
2455
|
+
*ngTemplateOutlet="
|
|
2456
|
+
paginationTemplate || null;
|
|
2457
|
+
context: { $implicit: paginationAPI() }
|
|
2458
|
+
"
|
|
2459
|
+
></ng-container>
|
|
2460
|
+
}
|
|
2179
2461
|
`,
|
|
2180
2462
|
}]
|
|
2181
|
-
}]
|
|
2463
|
+
}], ctorParameters: () => [], propDecorators: { paginationTemplate: [{
|
|
2464
|
+
type: ContentChild,
|
|
2465
|
+
args: ['paginationTemplate', { read: TemplateRef }]
|
|
2466
|
+
}], cellTemplates: [{
|
|
2467
|
+
type: ContentChildren,
|
|
2468
|
+
args: [NvDatatableCellDirective]
|
|
2469
|
+
}] } });
|
|
2182
2470
|
|
|
2183
2471
|
class ValueAccessor {
|
|
2184
2472
|
constructor(el) {
|
|
@@ -2884,6 +3172,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
2884
3172
|
type: HostListener,
|
|
2885
3173
|
args: ['openChanged', ['$event']]
|
|
2886
3174
|
}] } });
|
|
3175
|
+
class NvSplitValueAccessor extends ValueAccessor {
|
|
3176
|
+
constructor(el) {
|
|
3177
|
+
super(el);
|
|
3178
|
+
}
|
|
3179
|
+
handleSizesChanged(event) {
|
|
3180
|
+
this.handleChangeEvent(event.target.sizes);
|
|
3181
|
+
}
|
|
3182
|
+
writeValue(value) {
|
|
3183
|
+
this.el.nativeElement.sizes = this.lastValue = value;
|
|
3184
|
+
}
|
|
3185
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvSplitValueAccessor, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3186
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: NvSplitValueAccessor, isStandalone: true, selector: "nv-split", host: { listeners: { "sizesChanged": "handleSizesChanged($event)" } }, providers: [
|
|
3187
|
+
{
|
|
3188
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3189
|
+
useExisting: NvSplitValueAccessor,
|
|
3190
|
+
multi: true,
|
|
3191
|
+
},
|
|
3192
|
+
], usesInheritance: true, ngImport: i0 }); }
|
|
3193
|
+
}
|
|
3194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvSplitValueAccessor, decorators: [{
|
|
3195
|
+
type: Directive,
|
|
3196
|
+
args: [{
|
|
3197
|
+
selector: 'nv-split',
|
|
3198
|
+
providers: [
|
|
3199
|
+
{
|
|
3200
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3201
|
+
useExisting: NvSplitValueAccessor,
|
|
3202
|
+
multi: true,
|
|
3203
|
+
},
|
|
3204
|
+
],
|
|
3205
|
+
}]
|
|
3206
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { handleSizesChanged: [{
|
|
3207
|
+
type: HostListener,
|
|
3208
|
+
args: ['sizesChanged', ['$event']]
|
|
3209
|
+
}] } });
|
|
2887
3210
|
class NvToggleValueAccessor extends ValueAccessor {
|
|
2888
3211
|
constructor(el) {
|
|
2889
3212
|
super(el);
|
|
@@ -2974,13 +3297,14 @@ const VALUE_ACCESSORS = [
|
|
|
2974
3297
|
NvFieldtextareaValueAccessor,
|
|
2975
3298
|
NvNotificationValueAccessor,
|
|
2976
3299
|
NvPopoverValueAccessor,
|
|
3300
|
+
NvSplitValueAccessor,
|
|
2977
3301
|
NvToggleValueAccessor,
|
|
2978
3302
|
NvTogglebuttongroupValueAccessor,
|
|
2979
3303
|
];
|
|
2980
3304
|
|
|
2981
3305
|
class NovaComponentsModule {
|
|
2982
3306
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2983
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule, declarations: [NvAccordion, NvAccordionItem, NvAlert, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCol, NvDatagrid, NvDatagridcolumn, NvDialog, NvDialogfooter, NvDialogheader, NvFieldcheckbox, NvFielddate, NvFielddaterange, NvFielddropdown, NvFielddropdownitem, NvFielddropdownitemcheck, NvFieldmultiselect, NvFieldnumber, NvFieldpassword, NvFieldradio, NvFieldselect, NvFieldslider, NvFieldtext, NvFieldtextarea, NvFieldtime, NvIcon, NvIconbutton, NvLoader, NvMenu, NvMenuitem, NvNotification, NvNotificationcontainer, NvPopover, NvRow, NvStack, NvTable, NvToggle, NvTogglebutton, NvTogglebuttongroup, NvTooltip], imports: [NvDatatable], exports: [NvAccordion, NvAccordionItem, NvAlert, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCol, NvDatagrid, NvDatagridcolumn, NvDialog, NvDialogfooter, NvDialogheader, NvFieldcheckbox, NvFielddate, NvFielddaterange, NvFielddropdown, NvFielddropdownitem, NvFielddropdownitemcheck, NvFieldmultiselect, NvFieldnumber, NvFieldpassword, NvFieldradio, NvFieldselect, NvFieldslider, NvFieldtext, NvFieldtextarea, NvFieldtime, NvIcon, NvIconbutton, NvLoader, NvMenu, NvMenuitem, NvNotification, NvNotificationcontainer, NvPopover, NvRow, NvStack, NvTable, NvToggle, NvTogglebutton, NvTogglebuttongroup, NvTooltip, NvDatatable] }); }
|
|
3307
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule, declarations: [NvAccordion, NvAccordionItem, NvAlert, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCol, NvDatagrid, NvDatagridcolumn, NvDialog, NvDialogfooter, NvDialogheader, NvFieldcheckbox, NvFielddate, NvFielddaterange, NvFielddropdown, NvFielddropdownitem, NvFielddropdownitemcheck, NvFieldmultiselect, NvFieldnumber, NvFieldpassword, NvFieldradio, NvFieldselect, NvFieldslider, NvFieldtext, NvFieldtextarea, NvFieldtime, NvIcon, NvIconbutton, NvLoader, NvMenu, NvMenuitem, NvNotification, NvNotificationcontainer, NvPopover, NvRow, NvSplit, NvStack, NvTable, NvToggle, NvTogglebutton, NvTogglebuttongroup, NvTooltip], imports: [NvDatatable], exports: [NvAccordion, NvAccordionItem, NvAlert, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCol, NvDatagrid, NvDatagridcolumn, NvDialog, NvDialogfooter, NvDialogheader, NvFieldcheckbox, NvFielddate, NvFielddaterange, NvFielddropdown, NvFielddropdownitem, NvFielddropdownitemcheck, NvFieldmultiselect, NvFieldnumber, NvFieldpassword, NvFieldradio, NvFieldselect, NvFieldslider, NvFieldtext, NvFieldtextarea, NvFieldtime, NvIcon, NvIconbutton, NvLoader, NvMenu, NvMenuitem, NvNotification, NvNotificationcontainer, NvPopover, NvRow, NvSplit, NvStack, NvTable, NvToggle, NvTogglebutton, NvTogglebuttongroup, NvTooltip, NvDatatable] }); }
|
|
2984
3308
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule, imports: [NvDatatable] }); }
|
|
2985
3309
|
}
|
|
2986
3310
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule, decorators: [{
|
|
@@ -2993,7 +3317,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
2993
3317
|
}] });
|
|
2994
3318
|
class NovaComponentsValueAccessorModule {
|
|
2995
3319
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2996
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule, imports: [NvAccordionValueAccessor, NvAlertValueAccessor, NvCalendarValueAccessor, NvDatagridValueAccessor, NvDialogValueAccessor, NvFieldcheckboxValueAccessor, NvFielddateValueAccessor, NvFielddaterangeValueAccessor, NvFielddropdownValueAccessor, NvFieldmultiselectValueAccessor, NvFieldnumberValueAccessor, NvFieldpasswordValueAccessor, NvFieldradioValueAccessor, NvFieldselectValueAccessor, NvFieldsliderValueAccessor, NvFieldtextValueAccessor, NvFieldtextareaValueAccessor, NvNotificationValueAccessor, NvPopoverValueAccessor, NvToggleValueAccessor, NvTogglebuttongroupValueAccessor], exports: [NvAccordionValueAccessor, NvAlertValueAccessor, NvCalendarValueAccessor, NvDatagridValueAccessor, NvDialogValueAccessor, NvFieldcheckboxValueAccessor, NvFielddateValueAccessor, NvFielddaterangeValueAccessor, NvFielddropdownValueAccessor, NvFieldmultiselectValueAccessor, NvFieldnumberValueAccessor, NvFieldpasswordValueAccessor, NvFieldradioValueAccessor, NvFieldselectValueAccessor, NvFieldsliderValueAccessor, NvFieldtextValueAccessor, NvFieldtextareaValueAccessor, NvNotificationValueAccessor, NvPopoverValueAccessor, NvToggleValueAccessor, NvTogglebuttongroupValueAccessor] }); }
|
|
3320
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule, imports: [NvAccordionValueAccessor, NvAlertValueAccessor, NvCalendarValueAccessor, NvDatagridValueAccessor, NvDialogValueAccessor, NvFieldcheckboxValueAccessor, NvFielddateValueAccessor, NvFielddaterangeValueAccessor, NvFielddropdownValueAccessor, NvFieldmultiselectValueAccessor, NvFieldnumberValueAccessor, NvFieldpasswordValueAccessor, NvFieldradioValueAccessor, NvFieldselectValueAccessor, NvFieldsliderValueAccessor, NvFieldtextValueAccessor, NvFieldtextareaValueAccessor, NvNotificationValueAccessor, NvPopoverValueAccessor, NvSplitValueAccessor, NvToggleValueAccessor, NvTogglebuttongroupValueAccessor], exports: [NvAccordionValueAccessor, NvAlertValueAccessor, NvCalendarValueAccessor, NvDatagridValueAccessor, NvDialogValueAccessor, NvFieldcheckboxValueAccessor, NvFielddateValueAccessor, NvFielddaterangeValueAccessor, NvFielddropdownValueAccessor, NvFieldmultiselectValueAccessor, NvFieldnumberValueAccessor, NvFieldpasswordValueAccessor, NvFieldradioValueAccessor, NvFieldselectValueAccessor, NvFieldsliderValueAccessor, NvFieldtextValueAccessor, NvFieldtextareaValueAccessor, NvNotificationValueAccessor, NvPopoverValueAccessor, NvSplitValueAccessor, NvToggleValueAccessor, NvTogglebuttongroupValueAccessor] }); }
|
|
2997
3321
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule }); }
|
|
2998
3322
|
}
|
|
2999
3323
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule, decorators: [{
|
|
@@ -3321,5 +3645,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
3321
3645
|
* Generated bundle index. Do not edit.
|
|
3322
3646
|
*/
|
|
3323
3647
|
|
|
3324
|
-
export { NotificationService, NotificationServiceComponent, NovaComponentsModule, NovaComponentsValueAccessorModule, NvAccordion, NvAccordionItem, NvAccordionValueAccessor, NvAlert, NvAlertValueAccessor, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCalendarValueAccessor, NvCol, NvDatagrid, NvDatagridValueAccessor, NvDatagridcolumn, NvDatatable, NvDialog, NvDialogValueAccessor, NvDialogfooter, NvDialogheader, NvFieldcheckbox, NvFieldcheckboxValueAccessor, NvFielddate, NvFielddateValueAccessor, NvFielddaterange, NvFielddaterangeValueAccessor, NvFielddropdown, NvFielddropdownValueAccessor, NvFielddropdownitem, NvFielddropdownitemcheck, NvFieldmultiselect, NvFieldmultiselectValueAccessor, NvFieldnumber, NvFieldnumberValueAccessor, NvFieldpassword, NvFieldpasswordValueAccessor, NvFieldradio, NvFieldradioValueAccessor, NvFieldselect, NvFieldselectValueAccessor, NvFieldslider, NvFieldsliderValueAccessor, NvFieldtext, NvFieldtextValueAccessor, NvFieldtextarea, NvFieldtextareaValueAccessor, NvFieldtime, NvIcon, NvIconbutton, NvLoader, NvMenu, NvMenuitem, NvNotification, NvNotificationValueAccessor, NvNotificationcontainer, NvPopover, NvPopoverValueAccessor, NvRow, NvStack, NvTable, NvToggle, NvToggleValueAccessor, NvTogglebutton, NvTogglebuttongroup, NvTogglebuttongroupValueAccessor, NvTooltip, VALUE_ACCESSORS, flexRenderComponent as nvDatatableRenderComponent };
|
|
3648
|
+
export { NotificationService, NotificationServiceComponent, NovaComponentsModule, NovaComponentsValueAccessorModule, NvAccordion, NvAccordionItem, NvAccordionValueAccessor, NvAlert, NvAlertValueAccessor, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCalendarValueAccessor, NvCol, NvDatagrid, NvDatagridValueAccessor, NvDatagridcolumn, NvDatatable, NvDatatableCellDirective, NvDialog, NvDialogValueAccessor, NvDialogfooter, NvDialogheader, NvFieldcheckbox, NvFieldcheckboxValueAccessor, NvFielddate, NvFielddateValueAccessor, NvFielddaterange, NvFielddaterangeValueAccessor, NvFielddropdown, NvFielddropdownValueAccessor, NvFielddropdownitem, NvFielddropdownitemcheck, NvFieldmultiselect, NvFieldmultiselectValueAccessor, NvFieldnumber, NvFieldnumberValueAccessor, NvFieldpassword, NvFieldpasswordValueAccessor, NvFieldradio, NvFieldradioValueAccessor, NvFieldselect, NvFieldselectValueAccessor, NvFieldslider, NvFieldsliderValueAccessor, NvFieldtext, NvFieldtextValueAccessor, NvFieldtextarea, NvFieldtextareaValueAccessor, NvFieldtime, NvIcon, NvIconbutton, NvLoader, NvMenu, NvMenuitem, NvNotification, NvNotificationValueAccessor, NvNotificationcontainer, NvPopover, NvPopoverValueAccessor, NvRow, NvSplit, NvSplitValueAccessor, NvStack, NvTable, NvToggle, NvToggleValueAccessor, NvTogglebutton, NvTogglebuttongroup, NvTogglebuttongroupValueAccessor, NvTooltip, VALUE_ACCESSORS, flexRenderComponent as nvDatatableRenderComponent };
|
|
3325
3649
|
//# sourceMappingURL=nova-components.mjs.map
|