@nova-design-system/nova-angular-18 3.15.0 → 3.17.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/esm2022/lib/components/datatable.utils/flex-render/context.mjs +6 -0
- package/dist/nova-components/esm2022/lib/components/datatable.utils/flex-render/flags.mjs +42 -0
- package/dist/nova-components/esm2022/lib/components/datatable.utils/flex-render/flex-render-component-ref.mjs +171 -0
- package/dist/nova-components/esm2022/lib/components/datatable.utils/flex-render/flex-render-component.mjs +39 -0
- package/dist/nova-components/esm2022/lib/components/datatable.utils/flex-render/view.mjs +101 -0
- package/dist/nova-components/esm2022/lib/components/datatable.utils/flex-render.mjs +211 -0
- package/dist/nova-components/esm2022/lib/components/datatable.utils/index.mjs +49 -0
- package/dist/nova-components/esm2022/lib/components/datatable.utils/lazy-signal-initializer.mjs +43 -0
- package/dist/nova-components/esm2022/lib/components/datatable.utils/proxy.mjs +87 -0
- package/dist/nova-components/esm2022/lib/components/index.mjs +2 -0
- package/dist/nova-components/esm2022/lib/components/nv-datatable.component.mjs +158 -0
- package/dist/nova-components/esm2022/lib/nova-components.module.mjs +7 -5
- package/dist/nova-components/esm2022/lib/stencil-generated/component-value-accessors.mjs +73 -1
- package/dist/nova-components/esm2022/lib/stencil-generated/components.mjs +33 -34
- package/dist/nova-components/esm2022/lib/stencil-generated/index.mjs +2 -2
- package/dist/nova-components/esm2022/public-api.mjs +2 -1
- package/dist/nova-components/fesm2022/nova-components.mjs +990 -39
- package/dist/nova-components/fesm2022/nova-components.mjs.map +1 -1
- package/dist/nova-components/lib/components/datatable.utils/flex-render/context.d.ts +3 -0
- package/dist/nova-components/lib/components/datatable.utils/flex-render/flags.d.ts +40 -0
- package/dist/nova-components/lib/components/datatable.utils/flex-render/flex-render-component-ref.d.ts +39 -0
- package/dist/nova-components/lib/components/datatable.utils/flex-render/flex-render-component.d.ts +60 -0
- package/dist/nova-components/lib/components/datatable.utils/flex-render/view.d.ts +49 -0
- package/dist/nova-components/lib/components/datatable.utils/flex-render.d.ts +26 -0
- package/dist/nova-components/lib/components/datatable.utils/index.d.ts +6 -0
- package/dist/nova-components/lib/components/datatable.utils/lazy-signal-initializer.d.ts +5 -0
- package/dist/nova-components/lib/components/datatable.utils/proxy.d.ts +3 -0
- package/dist/nova-components/lib/components/index.d.ts +1 -0
- package/dist/nova-components/lib/components/nv-datatable.component.d.ts +46 -0
- package/dist/nova-components/lib/nova-components.module.d.ts +4 -3
- package/dist/nova-components/lib/stencil-generated/component-value-accessors.d.ts +15 -1
- package/dist/nova-components/lib/stencil-generated/components.d.ts +16 -21
- package/dist/nova-components/lib/stencil-generated/index.d.ts +1 -1
- package/dist/nova-components/public-api.d.ts +1 -0
- package/package.json +5 -3
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectionStrategy, Component,
|
|
2
|
+
import { ChangeDetectionStrategy, Component, untracked, computed, InjectionToken, inject, reflectComponentType, ViewContainerRef, Injectable, KeyValueDiffers, ChangeDetectorRef, OutputEmitterRef, TemplateRef, Type, Injector, runInInjectionContext, effect, Input, Inject, Directive, signal, input, CUSTOM_ELEMENTS_SCHEMA, HostListener, APP_INITIALIZER, NgModule, ElementRef, ViewChildren } from '@angular/core';
|
|
3
3
|
import { defineCustomElements } from '@nova-design-system/nova-webcomponents/loader';
|
|
4
4
|
import { __decorate } from 'tslib';
|
|
5
5
|
import { fromEvent, BehaviorSubject } from 'rxjs';
|
|
6
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
6
|
import * as i2 from '@angular/common';
|
|
8
7
|
import { CommonModule } from '@angular/common';
|
|
8
|
+
import { memo, createTable, getCoreRowModel } from '@tanstack/table-core';
|
|
9
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
10
|
export * from '@nova-design-system/nova-webcomponents/constants';
|
|
10
11
|
|
|
11
12
|
/* eslint-disable */
|
|
@@ -71,7 +72,7 @@ let NvAccordion = class NvAccordion {
|
|
|
71
72
|
this.z = z;
|
|
72
73
|
c.detach();
|
|
73
74
|
this.el = r.nativeElement;
|
|
74
|
-
proxyOutputs(this, this.el, ['
|
|
75
|
+
proxyOutputs(this, this.el, ['openIndexesChanged']);
|
|
75
76
|
}
|
|
76
77
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvAccordion, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
77
78
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NvAccordion, selector: "nv-accordion", inputs: { data: "data", mode: "mode", openIndexes: "openIndexes" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -1100,79 +1101,78 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1100
1101
|
standalone: false
|
|
1101
1102
|
}]
|
|
1102
1103
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
1103
|
-
let
|
|
1104
|
+
let NvSplit = class NvSplit {
|
|
1104
1105
|
constructor(c, r, z) {
|
|
1105
1106
|
this.z = z;
|
|
1106
1107
|
c.detach();
|
|
1107
1108
|
this.el = r.nativeElement;
|
|
1109
|
+
proxyOutputs(this, this.el, ['sizesChanged']);
|
|
1108
1110
|
}
|
|
1109
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type:
|
|
1110
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type:
|
|
1111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvSplit, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NvSplit, 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 }); }
|
|
1111
1113
|
};
|
|
1112
|
-
|
|
1114
|
+
NvSplit = __decorate([
|
|
1113
1115
|
ProxyCmp({
|
|
1114
|
-
inputs: ['
|
|
1116
|
+
inputs: ['direction', 'gutterSize', 'minSizes', 'sizes'],
|
|
1117
|
+
methods: ['setSizes', 'getSizes', 'collapse', 'destroy']
|
|
1115
1118
|
})
|
|
1116
|
-
],
|
|
1117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type:
|
|
1119
|
+
], NvSplit);
|
|
1120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvSplit, decorators: [{
|
|
1118
1121
|
type: Component,
|
|
1119
1122
|
args: [{
|
|
1120
|
-
selector: 'nv-
|
|
1123
|
+
selector: 'nv-split',
|
|
1121
1124
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1122
1125
|
template: '<ng-content></ng-content>',
|
|
1123
1126
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
1124
|
-
inputs: ['
|
|
1127
|
+
inputs: ['direction', 'gutterSize', 'minSizes', 'sizes'],
|
|
1125
1128
|
standalone: false
|
|
1126
1129
|
}]
|
|
1127
1130
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
1128
|
-
let
|
|
1131
|
+
let NvStack = class NvStack {
|
|
1129
1132
|
constructor(c, r, z) {
|
|
1130
1133
|
this.z = z;
|
|
1131
1134
|
c.detach();
|
|
1132
1135
|
this.el = r.nativeElement;
|
|
1133
|
-
proxyOutputs(this, this.el, ['action']);
|
|
1134
1136
|
}
|
|
1135
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type:
|
|
1136
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type:
|
|
1137
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvStack, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1138
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NvStack, selector: "nv-stack", inputs: { fill: "fill", flex: "flex", full: "full", gutter: "gutter", vertical: "vertical" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1137
1139
|
};
|
|
1138
|
-
|
|
1140
|
+
NvStack = __decorate([
|
|
1139
1141
|
ProxyCmp({
|
|
1140
|
-
inputs: ['
|
|
1142
|
+
inputs: ['fill', 'flex', 'full', 'gutter', 'vertical']
|
|
1141
1143
|
})
|
|
1142
|
-
],
|
|
1143
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type:
|
|
1144
|
+
], NvStack);
|
|
1145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvStack, decorators: [{
|
|
1144
1146
|
type: Component,
|
|
1145
1147
|
args: [{
|
|
1146
|
-
selector: 'nv-
|
|
1148
|
+
selector: 'nv-stack',
|
|
1147
1149
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1148
1150
|
template: '<ng-content></ng-content>',
|
|
1149
1151
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
1150
|
-
inputs: ['
|
|
1152
|
+
inputs: ['fill', 'flex', 'full', 'gutter', 'vertical'],
|
|
1151
1153
|
standalone: false
|
|
1152
1154
|
}]
|
|
1153
1155
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
1154
|
-
let
|
|
1156
|
+
let NvTable = class NvTable {
|
|
1155
1157
|
constructor(c, r, z) {
|
|
1156
1158
|
this.z = z;
|
|
1157
1159
|
c.detach();
|
|
1158
1160
|
this.el = r.nativeElement;
|
|
1159
1161
|
}
|
|
1160
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type:
|
|
1161
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type:
|
|
1162
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvTable, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1163
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NvTable, selector: "nv-table", ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1162
1164
|
};
|
|
1163
|
-
|
|
1164
|
-
ProxyCmp({
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
], NvTablecolumn);
|
|
1168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvTablecolumn, decorators: [{
|
|
1165
|
+
NvTable = __decorate([
|
|
1166
|
+
ProxyCmp({})
|
|
1167
|
+
], NvTable);
|
|
1168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvTable, decorators: [{
|
|
1169
1169
|
type: Component,
|
|
1170
1170
|
args: [{
|
|
1171
|
-
selector: 'nv-
|
|
1171
|
+
selector: 'nv-table',
|
|
1172
1172
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1173
1173
|
template: '<ng-content></ng-content>',
|
|
1174
1174
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
1175
|
-
inputs: [
|
|
1175
|
+
inputs: [],
|
|
1176
1176
|
standalone: false
|
|
1177
1177
|
}]
|
|
1178
1178
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
@@ -1322,15 +1322,893 @@ const DIRECTIVES = [
|
|
|
1322
1322
|
NvNotificationcontainer,
|
|
1323
1323
|
NvPopover,
|
|
1324
1324
|
NvRow,
|
|
1325
|
+
NvSplit,
|
|
1325
1326
|
NvStack,
|
|
1326
1327
|
NvTable,
|
|
1327
|
-
NvTablecolumn,
|
|
1328
1328
|
NvToggle,
|
|
1329
1329
|
NvTogglebutton,
|
|
1330
1330
|
NvTogglebuttongroup,
|
|
1331
1331
|
NvTooltip
|
|
1332
1332
|
];
|
|
1333
1333
|
|
|
1334
|
+
/**
|
|
1335
|
+
* Implementation from @tanstack/angular-query
|
|
1336
|
+
* {@link https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/util/lazy-init/lazy-init.ts}
|
|
1337
|
+
*/
|
|
1338
|
+
function lazyInit(initializer) {
|
|
1339
|
+
let object = null;
|
|
1340
|
+
const initializeObject = () => {
|
|
1341
|
+
if (!object) {
|
|
1342
|
+
object = untracked(() => initializer());
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
queueMicrotask(() => initializeObject());
|
|
1346
|
+
const table = () => { };
|
|
1347
|
+
return new Proxy(table, {
|
|
1348
|
+
apply(target, thisArg, argArray) {
|
|
1349
|
+
initializeObject();
|
|
1350
|
+
if (typeof object === 'function') {
|
|
1351
|
+
return Reflect.apply(object, thisArg, argArray);
|
|
1352
|
+
}
|
|
1353
|
+
return Reflect.apply(target, thisArg, argArray);
|
|
1354
|
+
},
|
|
1355
|
+
get(_, prop, receiver) {
|
|
1356
|
+
initializeObject();
|
|
1357
|
+
return Reflect.get(object, prop, receiver);
|
|
1358
|
+
},
|
|
1359
|
+
has(_, prop) {
|
|
1360
|
+
initializeObject();
|
|
1361
|
+
return Reflect.has(object, prop);
|
|
1362
|
+
},
|
|
1363
|
+
ownKeys() {
|
|
1364
|
+
initializeObject();
|
|
1365
|
+
return Reflect.ownKeys(object);
|
|
1366
|
+
},
|
|
1367
|
+
getOwnPropertyDescriptor() {
|
|
1368
|
+
return {
|
|
1369
|
+
enumerable: true,
|
|
1370
|
+
configurable: true,
|
|
1371
|
+
};
|
|
1372
|
+
},
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
function proxifyTable(tableSignal) {
|
|
1377
|
+
const internalState = tableSignal;
|
|
1378
|
+
return new Proxy(internalState, {
|
|
1379
|
+
apply() {
|
|
1380
|
+
return tableSignal();
|
|
1381
|
+
},
|
|
1382
|
+
get(target, property) {
|
|
1383
|
+
if (target[property]) {
|
|
1384
|
+
return target[property];
|
|
1385
|
+
}
|
|
1386
|
+
const table = untracked(tableSignal);
|
|
1387
|
+
/**
|
|
1388
|
+
* Attempt to convert all accessors into computed ones,
|
|
1389
|
+
* excluding handlers as they do not retain any reactive value
|
|
1390
|
+
*/
|
|
1391
|
+
if (property.startsWith('get') &&
|
|
1392
|
+
!property.endsWith('Handler')
|
|
1393
|
+
// e.g. getCoreRowModel, getSelectedRowModel etc.
|
|
1394
|
+
// We need that after a signal change even `rowModel` may mark the view as dirty.
|
|
1395
|
+
// This allows to always get the latest `getContext` value while using flexRender
|
|
1396
|
+
// && !property.endsWith('Model')
|
|
1397
|
+
) {
|
|
1398
|
+
const maybeFn = table[property];
|
|
1399
|
+
if (typeof maybeFn === 'function') {
|
|
1400
|
+
Object.defineProperty(target, property, {
|
|
1401
|
+
value: toComputed(tableSignal, maybeFn),
|
|
1402
|
+
configurable: true,
|
|
1403
|
+
enumerable: true,
|
|
1404
|
+
});
|
|
1405
|
+
return target[property];
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
// @ts-expect-error
|
|
1409
|
+
return (target[property] = table[property]);
|
|
1410
|
+
},
|
|
1411
|
+
has(_, prop) {
|
|
1412
|
+
return !!untracked(tableSignal)[prop];
|
|
1413
|
+
},
|
|
1414
|
+
ownKeys() {
|
|
1415
|
+
return Reflect.ownKeys(untracked(tableSignal));
|
|
1416
|
+
},
|
|
1417
|
+
getOwnPropertyDescriptor() {
|
|
1418
|
+
return {
|
|
1419
|
+
enumerable: true,
|
|
1420
|
+
configurable: true,
|
|
1421
|
+
};
|
|
1422
|
+
},
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
/**
|
|
1426
|
+
* Here we'll handle all type of accessors:
|
|
1427
|
+
* - 0 argument -> e.g. table.getCanNextPage())
|
|
1428
|
+
* - 0~1 arguments -> e.g. table.getIsSomeRowsPinned(position?)
|
|
1429
|
+
* - 1 required argument -> e.g. table.getColumn(columnId)
|
|
1430
|
+
* - 1+ argument -> e.g. table.getRow(id, searchAll?)
|
|
1431
|
+
*
|
|
1432
|
+
* Since we are not able to detect automatically the accessors parameters,
|
|
1433
|
+
* we'll wrap all accessors into a cached function wrapping a computed
|
|
1434
|
+
* that return it's value based on the given parameters
|
|
1435
|
+
*/
|
|
1436
|
+
function toComputed(signal, fn) {
|
|
1437
|
+
const hasArgs = fn.length > 0;
|
|
1438
|
+
if (!hasArgs) {
|
|
1439
|
+
return computed(() => {
|
|
1440
|
+
void signal();
|
|
1441
|
+
return fn();
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
const computedCache = {};
|
|
1445
|
+
return (...argsArray) => {
|
|
1446
|
+
const serializedArgs = serializeArgs(...argsArray);
|
|
1447
|
+
if (computedCache.hasOwnProperty(serializedArgs)) {
|
|
1448
|
+
return computedCache[serializedArgs]?.();
|
|
1449
|
+
}
|
|
1450
|
+
const computedSignal = computed(() => {
|
|
1451
|
+
void signal();
|
|
1452
|
+
return fn(...argsArray);
|
|
1453
|
+
});
|
|
1454
|
+
computedCache[serializedArgs] = computedSignal;
|
|
1455
|
+
return computedSignal();
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
function serializeArgs(...args) {
|
|
1459
|
+
return JSON.stringify(args);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
const FlexRenderComponentProps = new InjectionToken('[@tanstack/angular-table] Flex render component context props');
|
|
1463
|
+
function injectFlexRenderContext() {
|
|
1464
|
+
return inject(FlexRenderComponentProps);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Flags used to manage and optimize the rendering lifecycle of content of the cell,
|
|
1469
|
+
* while using FlexRenderDirective.
|
|
1470
|
+
*/
|
|
1471
|
+
var FlexRenderFlags;
|
|
1472
|
+
(function (FlexRenderFlags) {
|
|
1473
|
+
/**
|
|
1474
|
+
* Indicates that the view is being created for the first time or will be cleared during the next update phase.
|
|
1475
|
+
* This is the initial state and will transition after the first ngDoCheck.
|
|
1476
|
+
*/
|
|
1477
|
+
FlexRenderFlags[FlexRenderFlags["ViewFirstRender"] = 1] = "ViewFirstRender";
|
|
1478
|
+
/**
|
|
1479
|
+
* Represents a state where the view is not dirty, meaning no changes require rendering updates.
|
|
1480
|
+
*/
|
|
1481
|
+
FlexRenderFlags[FlexRenderFlags["Pristine"] = 2] = "Pristine";
|
|
1482
|
+
/**
|
|
1483
|
+
* Indicates the `content` property has been modified or the view requires a complete re-render.
|
|
1484
|
+
* When this flag is enabled, the view will be cleared and recreated from scratch.
|
|
1485
|
+
*/
|
|
1486
|
+
FlexRenderFlags[FlexRenderFlags["ContentChanged"] = 4] = "ContentChanged";
|
|
1487
|
+
/**
|
|
1488
|
+
* Indicates that the `props` property reference has changed.
|
|
1489
|
+
* When this flag is enabled, the view context is updated based on the type of the content.
|
|
1490
|
+
*
|
|
1491
|
+
* For Component view, inputs will be updated and view will be marked as dirty.
|
|
1492
|
+
* For TemplateRef and primitive values, view will be marked as dirty
|
|
1493
|
+
*/
|
|
1494
|
+
FlexRenderFlags[FlexRenderFlags["PropsReferenceChanged"] = 8] = "PropsReferenceChanged";
|
|
1495
|
+
/**
|
|
1496
|
+
* Indicates that the current rendered view needs to be checked for changes.
|
|
1497
|
+
*/
|
|
1498
|
+
FlexRenderFlags[FlexRenderFlags["DirtyCheck"] = 16] = "DirtyCheck";
|
|
1499
|
+
/**
|
|
1500
|
+
* Indicates that a signal within the `content(props)` result has changed
|
|
1501
|
+
*/
|
|
1502
|
+
FlexRenderFlags[FlexRenderFlags["DirtySignal"] = 32] = "DirtySignal";
|
|
1503
|
+
/**
|
|
1504
|
+
* Indicates that the first render effect has been checked at least one time.
|
|
1505
|
+
*/
|
|
1506
|
+
FlexRenderFlags[FlexRenderFlags["RenderEffectChecked"] = 64] = "RenderEffectChecked";
|
|
1507
|
+
})(FlexRenderFlags || (FlexRenderFlags = {}));
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* Helper function to create a [@link FlexRenderComponent] instance, with better type-safety.
|
|
1511
|
+
*
|
|
1512
|
+
* - options object must be passed when the given component instance contains at least one required signal input.
|
|
1513
|
+
* - options/inputs is typed with the given component inputs
|
|
1514
|
+
* - options/outputs is typed with the given component outputs
|
|
1515
|
+
*/
|
|
1516
|
+
function flexRenderComponent(component, ...options) {
|
|
1517
|
+
const { inputs, injector, outputs } = options?.[0] ?? {};
|
|
1518
|
+
return new FlexRenderComponent(component, inputs, injector, outputs);
|
|
1519
|
+
}
|
|
1520
|
+
/**
|
|
1521
|
+
* Wrapper class for a component that will be used as content for {@link FlexRenderDirective}
|
|
1522
|
+
*
|
|
1523
|
+
* Prefer {@link flexRenderComponent} helper for better type-safety
|
|
1524
|
+
*/
|
|
1525
|
+
class FlexRenderComponent {
|
|
1526
|
+
constructor(component, inputs, injector, outputs) {
|
|
1527
|
+
this.component = component;
|
|
1528
|
+
this.inputs = inputs;
|
|
1529
|
+
this.injector = injector;
|
|
1530
|
+
this.outputs = outputs;
|
|
1531
|
+
this.allowedInputNames = [];
|
|
1532
|
+
this.allowedOutputNames = [];
|
|
1533
|
+
const mirror = reflectComponentType(component);
|
|
1534
|
+
if (!mirror) {
|
|
1535
|
+
throw new Error(`[@tanstack-table/angular] The provided symbol is not a component`);
|
|
1536
|
+
}
|
|
1537
|
+
this.mirror = mirror;
|
|
1538
|
+
for (const input of this.mirror.inputs) {
|
|
1539
|
+
this.allowedInputNames.push(input.propName);
|
|
1540
|
+
}
|
|
1541
|
+
for (const output of this.mirror.outputs) {
|
|
1542
|
+
this.allowedOutputNames.push(output.propName);
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
class FlexRenderComponentFactory {
|
|
1548
|
+
#viewContainerRef = inject(ViewContainerRef);
|
|
1549
|
+
createComponent(flexRenderComponent, componentInjector) {
|
|
1550
|
+
const componentRef = this.#viewContainerRef.createComponent(flexRenderComponent.component, {
|
|
1551
|
+
injector: componentInjector,
|
|
1552
|
+
});
|
|
1553
|
+
const view = new FlexRenderComponentRef(componentRef, flexRenderComponent, componentInjector);
|
|
1554
|
+
const { inputs, outputs } = flexRenderComponent;
|
|
1555
|
+
if (inputs)
|
|
1556
|
+
view.setInputs(inputs);
|
|
1557
|
+
if (outputs)
|
|
1558
|
+
view.setOutputs(outputs);
|
|
1559
|
+
return view;
|
|
1560
|
+
}
|
|
1561
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FlexRenderComponentFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1562
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FlexRenderComponentFactory }); }
|
|
1563
|
+
}
|
|
1564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FlexRenderComponentFactory, decorators: [{
|
|
1565
|
+
type: Injectable
|
|
1566
|
+
}] });
|
|
1567
|
+
class FlexRenderComponentRef {
|
|
1568
|
+
#keyValueDiffersFactory;
|
|
1569
|
+
#componentData;
|
|
1570
|
+
#inputValueDiffer;
|
|
1571
|
+
#outputRegistry;
|
|
1572
|
+
constructor(componentRef, componentData, componentInjector) {
|
|
1573
|
+
this.componentRef = componentRef;
|
|
1574
|
+
this.componentInjector = componentInjector;
|
|
1575
|
+
this.#componentData = componentData;
|
|
1576
|
+
this.#keyValueDiffersFactory = componentInjector.get(KeyValueDiffers);
|
|
1577
|
+
this.#outputRegistry = new FlexRenderComponentOutputManager(this.#keyValueDiffersFactory, this.outputs);
|
|
1578
|
+
this.#inputValueDiffer = this.#keyValueDiffersFactory
|
|
1579
|
+
.find(this.inputs)
|
|
1580
|
+
.create();
|
|
1581
|
+
this.#inputValueDiffer.diff(this.inputs);
|
|
1582
|
+
this.componentRef.onDestroy(() => this.#outputRegistry.unsubscribeAll());
|
|
1583
|
+
}
|
|
1584
|
+
get component() {
|
|
1585
|
+
return this.#componentData.component;
|
|
1586
|
+
}
|
|
1587
|
+
get inputs() {
|
|
1588
|
+
return this.#componentData.inputs ?? {};
|
|
1589
|
+
}
|
|
1590
|
+
get outputs() {
|
|
1591
|
+
return this.#componentData.outputs ?? {};
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Get component input and output diff by the given item
|
|
1595
|
+
*/
|
|
1596
|
+
diff(item) {
|
|
1597
|
+
return {
|
|
1598
|
+
inputDiff: this.#inputValueDiffer.diff(item.inputs ?? {}),
|
|
1599
|
+
outputDiff: this.#outputRegistry.diff(item.outputs ?? {}),
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
*
|
|
1604
|
+
* @param compare Whether the current ref component instance is the same as the given one
|
|
1605
|
+
*/
|
|
1606
|
+
eqType(compare) {
|
|
1607
|
+
return compare.component === this.component;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Tries to update current component refs input by the new given content component.
|
|
1611
|
+
*/
|
|
1612
|
+
update(content) {
|
|
1613
|
+
const eq = this.eqType(content);
|
|
1614
|
+
if (!eq)
|
|
1615
|
+
return;
|
|
1616
|
+
const { inputDiff, outputDiff } = this.diff(content);
|
|
1617
|
+
if (inputDiff) {
|
|
1618
|
+
inputDiff.forEachAddedItem(item => this.setInput(item.key, item.currentValue));
|
|
1619
|
+
inputDiff.forEachChangedItem(item => this.setInput(item.key, item.currentValue));
|
|
1620
|
+
inputDiff.forEachRemovedItem(item => this.setInput(item.key, undefined));
|
|
1621
|
+
}
|
|
1622
|
+
if (outputDiff) {
|
|
1623
|
+
outputDiff.forEachAddedItem(item => {
|
|
1624
|
+
this.setOutput(item.key, item.currentValue);
|
|
1625
|
+
});
|
|
1626
|
+
outputDiff.forEachChangedItem(item => {
|
|
1627
|
+
if (item.currentValue) {
|
|
1628
|
+
this.#outputRegistry.setListener(item.key, item.currentValue);
|
|
1629
|
+
}
|
|
1630
|
+
else {
|
|
1631
|
+
this.#outputRegistry.unsubscribe(item.key);
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
outputDiff.forEachRemovedItem(item => {
|
|
1635
|
+
this.#outputRegistry.unsubscribe(item.key);
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
this.#componentData = content;
|
|
1639
|
+
}
|
|
1640
|
+
markAsDirty() {
|
|
1641
|
+
this.componentRef.injector.get(ChangeDetectorRef).markForCheck();
|
|
1642
|
+
}
|
|
1643
|
+
setInputs(inputs) {
|
|
1644
|
+
for (const prop in inputs) {
|
|
1645
|
+
this.setInput(prop, inputs[prop]);
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
setInput(key, value) {
|
|
1649
|
+
if (this.#componentData.allowedInputNames.includes(key)) {
|
|
1650
|
+
this.componentRef.setInput(key, value);
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
setOutputs(outputs) {
|
|
1654
|
+
this.#outputRegistry.unsubscribeAll();
|
|
1655
|
+
for (const prop in outputs) {
|
|
1656
|
+
this.setOutput(prop, outputs[prop]);
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
setOutput(outputName, emit) {
|
|
1660
|
+
if (!this.#componentData.allowedOutputNames.includes(outputName))
|
|
1661
|
+
return;
|
|
1662
|
+
if (!emit) {
|
|
1663
|
+
this.#outputRegistry.unsubscribe(outputName);
|
|
1664
|
+
return;
|
|
1665
|
+
}
|
|
1666
|
+
const hasListener = this.#outputRegistry.hasListener(outputName);
|
|
1667
|
+
this.#outputRegistry.setListener(outputName, emit);
|
|
1668
|
+
if (hasListener) {
|
|
1669
|
+
return;
|
|
1670
|
+
}
|
|
1671
|
+
const instance = this.componentRef.instance;
|
|
1672
|
+
const output = instance[outputName];
|
|
1673
|
+
if (output && output instanceof OutputEmitterRef) {
|
|
1674
|
+
output.subscribe(value => {
|
|
1675
|
+
this.#outputRegistry.getListener(outputName)?.(value);
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
class FlexRenderComponentOutputManager {
|
|
1681
|
+
#outputSubscribers = {};
|
|
1682
|
+
#outputListeners = {};
|
|
1683
|
+
#valueDiffer;
|
|
1684
|
+
constructor(keyValueDiffers, initialOutputs) {
|
|
1685
|
+
this.#valueDiffer = keyValueDiffers.find(initialOutputs).create();
|
|
1686
|
+
if (initialOutputs) {
|
|
1687
|
+
this.#valueDiffer.diff(initialOutputs);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
hasListener(outputName) {
|
|
1691
|
+
return outputName in this.#outputListeners;
|
|
1692
|
+
}
|
|
1693
|
+
setListener(outputName, callback) {
|
|
1694
|
+
this.#outputListeners[outputName] = callback;
|
|
1695
|
+
}
|
|
1696
|
+
getListener(outputName) {
|
|
1697
|
+
return this.#outputListeners[outputName];
|
|
1698
|
+
}
|
|
1699
|
+
unsubscribeAll() {
|
|
1700
|
+
for (const prop in this.#outputSubscribers) {
|
|
1701
|
+
this.unsubscribe(prop);
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
unsubscribe(outputName) {
|
|
1705
|
+
if (outputName in this.#outputSubscribers) {
|
|
1706
|
+
this.#outputSubscribers[outputName]?.unsubscribe();
|
|
1707
|
+
delete this.#outputSubscribers[outputName];
|
|
1708
|
+
delete this.#outputListeners[outputName];
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
diff(outputs) {
|
|
1712
|
+
return this.#valueDiffer.diff(outputs ?? {});
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
function mapToFlexRenderTypedContent(content) {
|
|
1717
|
+
if (content === null || content === undefined) {
|
|
1718
|
+
return { kind: 'null' };
|
|
1719
|
+
}
|
|
1720
|
+
if (typeof content === 'string' || typeof content === 'number') {
|
|
1721
|
+
return { kind: 'primitive', content };
|
|
1722
|
+
}
|
|
1723
|
+
if (content instanceof FlexRenderComponent) {
|
|
1724
|
+
return { kind: 'flexRenderComponent', content };
|
|
1725
|
+
}
|
|
1726
|
+
else if (content instanceof TemplateRef) {
|
|
1727
|
+
return { kind: 'templateRef', content };
|
|
1728
|
+
}
|
|
1729
|
+
else if (content instanceof Type) {
|
|
1730
|
+
return { kind: 'component', content };
|
|
1731
|
+
}
|
|
1732
|
+
else {
|
|
1733
|
+
return { kind: 'primitive', content };
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
class FlexRenderView {
|
|
1737
|
+
#previousContent;
|
|
1738
|
+
#content;
|
|
1739
|
+
constructor(initialContent, view) {
|
|
1740
|
+
this.#content = initialContent;
|
|
1741
|
+
this.view = view;
|
|
1742
|
+
}
|
|
1743
|
+
get previousContent() {
|
|
1744
|
+
return this.#previousContent ?? { kind: 'null' };
|
|
1745
|
+
}
|
|
1746
|
+
get content() {
|
|
1747
|
+
return this.#content;
|
|
1748
|
+
}
|
|
1749
|
+
set content(content) {
|
|
1750
|
+
this.#previousContent = this.#content;
|
|
1751
|
+
this.#content = content;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
class FlexRenderTemplateView extends FlexRenderView {
|
|
1755
|
+
constructor(initialContent, view) {
|
|
1756
|
+
super(initialContent, view);
|
|
1757
|
+
}
|
|
1758
|
+
updateProps(props) {
|
|
1759
|
+
this.view.markForCheck();
|
|
1760
|
+
}
|
|
1761
|
+
dirtyCheck() {
|
|
1762
|
+
// Basically a no-op. When the view is created via EmbeddedViewRef, we don't need to do any manual update
|
|
1763
|
+
// since this type of content has a proxy as a context, then every time the root component is checked for changes,
|
|
1764
|
+
// the property getter will be re-evaluated.
|
|
1765
|
+
//
|
|
1766
|
+
// If in a future we need to manually mark the view as dirty, just uncomment next line
|
|
1767
|
+
// this.view.markForCheck()
|
|
1768
|
+
}
|
|
1769
|
+
onDestroy(callback) {
|
|
1770
|
+
this.view.onDestroy(callback);
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
class FlexRenderComponentView extends FlexRenderView {
|
|
1774
|
+
constructor(initialContent, view) {
|
|
1775
|
+
super(initialContent, view);
|
|
1776
|
+
}
|
|
1777
|
+
updateProps(props) {
|
|
1778
|
+
switch (this.content.kind) {
|
|
1779
|
+
case 'component': {
|
|
1780
|
+
this.view.setInputs(props);
|
|
1781
|
+
break;
|
|
1782
|
+
}
|
|
1783
|
+
case 'flexRenderComponent': {
|
|
1784
|
+
// No-op. When FlexRenderFlags.PropsReferenceChanged is set,
|
|
1785
|
+
// FlexRenderComponent will be updated into `dirtyCheck`.
|
|
1786
|
+
break;
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
dirtyCheck() {
|
|
1791
|
+
switch (this.content.kind) {
|
|
1792
|
+
case 'component': {
|
|
1793
|
+
// Component context is currently valuated with the cell context. Since it's reference
|
|
1794
|
+
// shouldn't change, we force mark the component as dirty in order to re-evaluate function invocation in view.
|
|
1795
|
+
// NOTE: this should behave like having a component with ChangeDetectionStrategy.Default
|
|
1796
|
+
this.view.markAsDirty();
|
|
1797
|
+
break;
|
|
1798
|
+
}
|
|
1799
|
+
case 'flexRenderComponent': {
|
|
1800
|
+
// Given context instance will always have a different reference than the previous one,
|
|
1801
|
+
// so instead of recreating the entire view, we will only update the current view
|
|
1802
|
+
if (this.view.eqType(this.content.content)) {
|
|
1803
|
+
this.view.update(this.content.content);
|
|
1804
|
+
}
|
|
1805
|
+
this.view.markAsDirty();
|
|
1806
|
+
break;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
onDestroy(callback) {
|
|
1811
|
+
this.view.componentRef.onDestroy(callback);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
class FlexRenderDirective {
|
|
1816
|
+
#flexRenderComponentFactory;
|
|
1817
|
+
#changeDetectorRef;
|
|
1818
|
+
#latestContent;
|
|
1819
|
+
#getContentValue;
|
|
1820
|
+
constructor(viewContainerRef, templateRef) {
|
|
1821
|
+
this.viewContainerRef = viewContainerRef;
|
|
1822
|
+
this.templateRef = templateRef;
|
|
1823
|
+
this.#flexRenderComponentFactory = inject(FlexRenderComponentFactory);
|
|
1824
|
+
this.#changeDetectorRef = inject(ChangeDetectorRef);
|
|
1825
|
+
this.content = undefined;
|
|
1826
|
+
this.props = {};
|
|
1827
|
+
this.injector = inject(Injector);
|
|
1828
|
+
this.renderFlags = FlexRenderFlags.ViewFirstRender;
|
|
1829
|
+
this.renderView = null;
|
|
1830
|
+
this.#latestContent = () => {
|
|
1831
|
+
const { content, props } = this;
|
|
1832
|
+
return typeof content !== 'function'
|
|
1833
|
+
? content
|
|
1834
|
+
: runInInjectionContext(this.injector, () => content(props));
|
|
1835
|
+
};
|
|
1836
|
+
this.#getContentValue = memo(() => [this.#latestContent(), this.props, this.content], latestContent => {
|
|
1837
|
+
return mapToFlexRenderTypedContent(latestContent);
|
|
1838
|
+
}, { key: 'flexRenderContentValue', debug: () => false });
|
|
1839
|
+
this.#currentEffectRef = null;
|
|
1840
|
+
}
|
|
1841
|
+
ngOnChanges(changes) {
|
|
1842
|
+
if (changes['props']) {
|
|
1843
|
+
this.renderFlags |= FlexRenderFlags.PropsReferenceChanged;
|
|
1844
|
+
}
|
|
1845
|
+
if (changes['content']) {
|
|
1846
|
+
this.renderFlags |=
|
|
1847
|
+
FlexRenderFlags.ContentChanged | FlexRenderFlags.ViewFirstRender;
|
|
1848
|
+
this.update();
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
ngDoCheck() {
|
|
1852
|
+
if (this.renderFlags & FlexRenderFlags.ViewFirstRender) {
|
|
1853
|
+
// On the initial render, the view is created during the `ngOnChanges` hook.
|
|
1854
|
+
// Since `ngDoCheck` is called immediately afterward, there's no need to check for changes in this phase.
|
|
1855
|
+
this.renderFlags &= ~FlexRenderFlags.ViewFirstRender;
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
this.renderFlags |= FlexRenderFlags.DirtyCheck;
|
|
1859
|
+
const latestContent = this.#getContentValue();
|
|
1860
|
+
if (latestContent.kind === 'null' || !this.renderView) {
|
|
1861
|
+
this.renderFlags |= FlexRenderFlags.ContentChanged;
|
|
1862
|
+
}
|
|
1863
|
+
else {
|
|
1864
|
+
this.renderView.content = latestContent;
|
|
1865
|
+
const { kind: previousKind } = this.renderView.previousContent;
|
|
1866
|
+
if (latestContent.kind !== previousKind) {
|
|
1867
|
+
this.renderFlags |= FlexRenderFlags.ContentChanged;
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
this.update();
|
|
1871
|
+
}
|
|
1872
|
+
update() {
|
|
1873
|
+
if (this.renderFlags &
|
|
1874
|
+
(FlexRenderFlags.ContentChanged | FlexRenderFlags.ViewFirstRender)) {
|
|
1875
|
+
this.render();
|
|
1876
|
+
return;
|
|
1877
|
+
}
|
|
1878
|
+
if (this.renderFlags & FlexRenderFlags.PropsReferenceChanged) {
|
|
1879
|
+
if (this.renderView)
|
|
1880
|
+
this.renderView.updateProps(this.props);
|
|
1881
|
+
this.renderFlags &= ~FlexRenderFlags.PropsReferenceChanged;
|
|
1882
|
+
}
|
|
1883
|
+
if (this.renderFlags &
|
|
1884
|
+
(FlexRenderFlags.DirtyCheck | FlexRenderFlags.DirtySignal)) {
|
|
1885
|
+
if (this.renderView)
|
|
1886
|
+
this.renderView.dirtyCheck();
|
|
1887
|
+
this.renderFlags &= ~(FlexRenderFlags.DirtyCheck | FlexRenderFlags.DirtySignal);
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
#currentEffectRef;
|
|
1891
|
+
render() {
|
|
1892
|
+
if (this.#shouldRecreateEntireView() && this.#currentEffectRef) {
|
|
1893
|
+
this.#currentEffectRef.destroy();
|
|
1894
|
+
this.#currentEffectRef = null;
|
|
1895
|
+
this.renderFlags &= ~FlexRenderFlags.RenderEffectChecked;
|
|
1896
|
+
}
|
|
1897
|
+
this.viewContainerRef.clear();
|
|
1898
|
+
this.renderFlags =
|
|
1899
|
+
FlexRenderFlags.Pristine |
|
|
1900
|
+
(this.renderFlags & FlexRenderFlags.ViewFirstRender) |
|
|
1901
|
+
(this.renderFlags & FlexRenderFlags.RenderEffectChecked);
|
|
1902
|
+
const resolvedContent = this.#getContentValue();
|
|
1903
|
+
if (resolvedContent.kind === 'null') {
|
|
1904
|
+
this.renderView = null;
|
|
1905
|
+
}
|
|
1906
|
+
else {
|
|
1907
|
+
this.renderView = this.#renderViewByContent(resolvedContent);
|
|
1908
|
+
}
|
|
1909
|
+
// If the content is a function `content(props)`, we initialize an effect
|
|
1910
|
+
// in order to react to changes if the given definition use signals.
|
|
1911
|
+
if (!this.#currentEffectRef && typeof this.content === 'function') {
|
|
1912
|
+
this.#currentEffectRef = effect(() => {
|
|
1913
|
+
this.#latestContent();
|
|
1914
|
+
if (!(this.renderFlags & FlexRenderFlags.RenderEffectChecked)) {
|
|
1915
|
+
this.renderFlags |= FlexRenderFlags.RenderEffectChecked;
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1918
|
+
this.renderFlags |= FlexRenderFlags.DirtySignal;
|
|
1919
|
+
// This will mark the view as changed,
|
|
1920
|
+
// so we'll try to check for updates into ngDoCheck
|
|
1921
|
+
this.#changeDetectorRef.markForCheck();
|
|
1922
|
+
}, { injector: this.viewContainerRef.injector });
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
#shouldRecreateEntireView() {
|
|
1926
|
+
return (this.renderFlags &
|
|
1927
|
+
FlexRenderFlags.ContentChanged &
|
|
1928
|
+
FlexRenderFlags.ViewFirstRender);
|
|
1929
|
+
}
|
|
1930
|
+
#renderViewByContent(content) {
|
|
1931
|
+
if (content.kind === 'primitive') {
|
|
1932
|
+
return this.#renderStringContent(content);
|
|
1933
|
+
}
|
|
1934
|
+
else if (content.kind === 'templateRef') {
|
|
1935
|
+
return this.#renderTemplateRefContent(content);
|
|
1936
|
+
}
|
|
1937
|
+
else if (content.kind === 'flexRenderComponent') {
|
|
1938
|
+
return this.#renderComponent(content);
|
|
1939
|
+
}
|
|
1940
|
+
else if (content.kind === 'component') {
|
|
1941
|
+
return this.#renderCustomComponent(content);
|
|
1942
|
+
}
|
|
1943
|
+
else {
|
|
1944
|
+
return null;
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
#renderStringContent(template) {
|
|
1948
|
+
const context = () => {
|
|
1949
|
+
return typeof this.content === 'string' ||
|
|
1950
|
+
typeof this.content === 'number'
|
|
1951
|
+
? this.content
|
|
1952
|
+
: this.content?.(this.props);
|
|
1953
|
+
};
|
|
1954
|
+
const ref = this.viewContainerRef.createEmbeddedView(this.templateRef, {
|
|
1955
|
+
get $implicit() {
|
|
1956
|
+
return context();
|
|
1957
|
+
},
|
|
1958
|
+
});
|
|
1959
|
+
return new FlexRenderTemplateView(template, ref);
|
|
1960
|
+
}
|
|
1961
|
+
#renderTemplateRefContent(template) {
|
|
1962
|
+
const latestContext = () => this.props;
|
|
1963
|
+
const view = this.viewContainerRef.createEmbeddedView(template.content, {
|
|
1964
|
+
get $implicit() {
|
|
1965
|
+
return latestContext();
|
|
1966
|
+
},
|
|
1967
|
+
});
|
|
1968
|
+
return new FlexRenderTemplateView(template, view);
|
|
1969
|
+
}
|
|
1970
|
+
#renderComponent(flexRenderComponent) {
|
|
1971
|
+
const { inputs, outputs, injector } = flexRenderComponent.content;
|
|
1972
|
+
const getContext = () => this.props;
|
|
1973
|
+
const proxy = new Proxy(this.props, {
|
|
1974
|
+
get: (_, key) => getContext()[key],
|
|
1975
|
+
});
|
|
1976
|
+
const componentInjector = Injector.create({
|
|
1977
|
+
parent: injector ?? this.injector,
|
|
1978
|
+
providers: [{ provide: FlexRenderComponentProps, useValue: proxy }],
|
|
1979
|
+
});
|
|
1980
|
+
const view = this.#flexRenderComponentFactory.createComponent(flexRenderComponent.content, componentInjector);
|
|
1981
|
+
return new FlexRenderComponentView(flexRenderComponent, view);
|
|
1982
|
+
}
|
|
1983
|
+
#renderCustomComponent(component) {
|
|
1984
|
+
const view = this.#flexRenderComponentFactory.createComponent(flexRenderComponent(component.content, {
|
|
1985
|
+
inputs: this.props,
|
|
1986
|
+
injector: this.injector,
|
|
1987
|
+
}), this.injector);
|
|
1988
|
+
return new FlexRenderComponentView(component, view);
|
|
1989
|
+
}
|
|
1990
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FlexRenderDirective, deps: [{ token: ViewContainerRef }, { token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1991
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: FlexRenderDirective, isStandalone: true, selector: "[flexRender]", inputs: { content: ["flexRender", "content"], props: ["flexRenderProps", "props"], injector: ["flexRenderInjector", "injector"] }, providers: [FlexRenderComponentFactory], usesOnChanges: true, ngImport: i0 }); }
|
|
1992
|
+
}
|
|
1993
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FlexRenderDirective, decorators: [{
|
|
1994
|
+
type: Directive,
|
|
1995
|
+
args: [{
|
|
1996
|
+
selector: '[flexRender]',
|
|
1997
|
+
standalone: true,
|
|
1998
|
+
providers: [FlexRenderComponentFactory],
|
|
1999
|
+
}]
|
|
2000
|
+
}], ctorParameters: () => [{ type: i0.ViewContainerRef, decorators: [{
|
|
2001
|
+
type: Inject,
|
|
2002
|
+
args: [ViewContainerRef]
|
|
2003
|
+
}] }, { type: i0.TemplateRef, decorators: [{
|
|
2004
|
+
type: Inject,
|
|
2005
|
+
args: [TemplateRef]
|
|
2006
|
+
}] }], propDecorators: { content: [{
|
|
2007
|
+
type: Input,
|
|
2008
|
+
args: [{ required: true, alias: 'flexRender' }]
|
|
2009
|
+
}], props: [{
|
|
2010
|
+
type: Input,
|
|
2011
|
+
args: [{ required: true, alias: 'flexRenderProps' }]
|
|
2012
|
+
}], injector: [{
|
|
2013
|
+
type: Input,
|
|
2014
|
+
args: [{ required: false, alias: 'flexRenderInjector' }]
|
|
2015
|
+
}] } });
|
|
2016
|
+
|
|
2017
|
+
function createAngularTable(options) {
|
|
2018
|
+
return lazyInit(() => {
|
|
2019
|
+
const resolvedOptions = {
|
|
2020
|
+
state: {},
|
|
2021
|
+
onStateChange: () => { },
|
|
2022
|
+
renderFallbackValue: null,
|
|
2023
|
+
...options(),
|
|
2024
|
+
};
|
|
2025
|
+
const table = createTable(resolvedOptions);
|
|
2026
|
+
// By default, manage table state here using the table's initial state
|
|
2027
|
+
const state = signal(table.initialState);
|
|
2028
|
+
// Compose table options using computed.
|
|
2029
|
+
// This is to allow `tableSignal` to listen and set table option
|
|
2030
|
+
const updatedOptions = computed(() => {
|
|
2031
|
+
// listen to table state changed
|
|
2032
|
+
const tableState = state();
|
|
2033
|
+
// listen to input options changed
|
|
2034
|
+
const tableOptions = options();
|
|
2035
|
+
return {
|
|
2036
|
+
...table.options,
|
|
2037
|
+
...resolvedOptions,
|
|
2038
|
+
...tableOptions,
|
|
2039
|
+
state: { ...tableState, ...tableOptions.state },
|
|
2040
|
+
onStateChange: updater => {
|
|
2041
|
+
const value = updater instanceof Function ? updater(tableState) : updater;
|
|
2042
|
+
state.set(value);
|
|
2043
|
+
resolvedOptions.onStateChange?.(updater);
|
|
2044
|
+
},
|
|
2045
|
+
};
|
|
2046
|
+
});
|
|
2047
|
+
// convert table instance to signal for proxify to listen to any table state and options changes
|
|
2048
|
+
const tableSignal = computed(() => {
|
|
2049
|
+
table.setOptions(updatedOptions());
|
|
2050
|
+
return table;
|
|
2051
|
+
}, {
|
|
2052
|
+
equal: () => false,
|
|
2053
|
+
});
|
|
2054
|
+
// proxify Table instance to provide ability for consumer to listen to any table state changes
|
|
2055
|
+
return proxifyTable(tableSignal);
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
2060
|
+
/* eslint-disable jsdoc/require-returns */
|
|
2061
|
+
/**
|
|
2062
|
+
* Nova Datatable built on TanStack Table (Angular).
|
|
2063
|
+
*/
|
|
2064
|
+
class NvDatatable {
|
|
2065
|
+
constructor() {
|
|
2066
|
+
/** Column definitions */
|
|
2067
|
+
this.columns = input([]);
|
|
2068
|
+
/** Row data */
|
|
2069
|
+
this.rows = input([]);
|
|
2070
|
+
/** Computed table columns with proper typing and filtering. */
|
|
2071
|
+
this.tableColumns = computed(() => this.columns()
|
|
2072
|
+
.filter((col) => !col.hidden)
|
|
2073
|
+
.map((col) => ({
|
|
2074
|
+
accessorKey: col.field,
|
|
2075
|
+
header: col.headerName || String(col.field),
|
|
2076
|
+
size: col.width,
|
|
2077
|
+
enableResizing: col.resizable ?? true,
|
|
2078
|
+
cell: col.renderCell ??
|
|
2079
|
+
((context) => context.getValue()),
|
|
2080
|
+
})));
|
|
2081
|
+
/** TanStack table instance with Signals */
|
|
2082
|
+
this.tableInstance = createAngularTable(() => ({
|
|
2083
|
+
data: this.rows(),
|
|
2084
|
+
columns: this.tableColumns(),
|
|
2085
|
+
getCoreRowModel: getCoreRowModel(),
|
|
2086
|
+
}));
|
|
2087
|
+
}
|
|
2088
|
+
/** Public getter for table instance. */
|
|
2089
|
+
table() {
|
|
2090
|
+
return this.tableInstance();
|
|
2091
|
+
}
|
|
2092
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvDatatable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2093
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", 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: `
|
|
2094
|
+
<nv-table>
|
|
2095
|
+
<table>
|
|
2096
|
+
<thead>
|
|
2097
|
+
@for (headerGroup of table().getHeaderGroups(); track headerGroup.id)
|
|
2098
|
+
{
|
|
2099
|
+
<tr>
|
|
2100
|
+
@for (header of headerGroup.headers; track header.id) {
|
|
2101
|
+
<th
|
|
2102
|
+
[attr.data-testid]="'datatable-header-' + header.id"
|
|
2103
|
+
[style.width]="
|
|
2104
|
+
header.column.columnDef.size
|
|
2105
|
+
? header.column.columnDef.size + 'px'
|
|
2106
|
+
: null
|
|
2107
|
+
"
|
|
2108
|
+
[attr.data-no-resize]="
|
|
2109
|
+
!header.column.columnDef.enableResizing ? 'true' : null
|
|
2110
|
+
"
|
|
2111
|
+
>
|
|
2112
|
+
@if (!header.isPlaceholder) {
|
|
2113
|
+
{{ header.column.columnDef.header }}
|
|
2114
|
+
}
|
|
2115
|
+
</th>
|
|
2116
|
+
}
|
|
2117
|
+
</tr>
|
|
2118
|
+
}
|
|
2119
|
+
</thead>
|
|
2120
|
+
|
|
2121
|
+
<tbody>
|
|
2122
|
+
@for (row of table().getRowModel().rows; track row.id) {
|
|
2123
|
+
<tr [attr.data-testid]="'datatable-row-' + row.id">
|
|
2124
|
+
@for (cell of row.getVisibleCells(); track cell.id) {
|
|
2125
|
+
<td
|
|
2126
|
+
[attr.data-testid]="'datatable-cell-' + cell.id"
|
|
2127
|
+
style="padding: 8px; border-bottom: 1px solid #eee;"
|
|
2128
|
+
>
|
|
2129
|
+
<!-- Let FlexRender handle strings vs TemplateRef -->
|
|
2130
|
+
<ng-container
|
|
2131
|
+
*flexRender="
|
|
2132
|
+
cell.column.columnDef.cell;
|
|
2133
|
+
props: cell.getContext();
|
|
2134
|
+
let cellContent
|
|
2135
|
+
"
|
|
2136
|
+
>
|
|
2137
|
+
{{ cellContent }}
|
|
2138
|
+
</ng-container>
|
|
2139
|
+
</td>
|
|
2140
|
+
}
|
|
2141
|
+
</tr>
|
|
2142
|
+
}
|
|
2143
|
+
</tbody>
|
|
2144
|
+
</table>
|
|
2145
|
+
</nv-table>
|
|
2146
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: FlexRenderDirective, selector: "[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }] }); }
|
|
2147
|
+
}
|
|
2148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvDatatable, decorators: [{
|
|
2149
|
+
type: Component,
|
|
2150
|
+
args: [{
|
|
2151
|
+
selector: 'nv-datatable',
|
|
2152
|
+
standalone: true,
|
|
2153
|
+
imports: [CommonModule, FlexRenderDirective],
|
|
2154
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
2155
|
+
template: `
|
|
2156
|
+
<nv-table>
|
|
2157
|
+
<table>
|
|
2158
|
+
<thead>
|
|
2159
|
+
@for (headerGroup of table().getHeaderGroups(); track headerGroup.id)
|
|
2160
|
+
{
|
|
2161
|
+
<tr>
|
|
2162
|
+
@for (header of headerGroup.headers; track header.id) {
|
|
2163
|
+
<th
|
|
2164
|
+
[attr.data-testid]="'datatable-header-' + header.id"
|
|
2165
|
+
[style.width]="
|
|
2166
|
+
header.column.columnDef.size
|
|
2167
|
+
? header.column.columnDef.size + 'px'
|
|
2168
|
+
: null
|
|
2169
|
+
"
|
|
2170
|
+
[attr.data-no-resize]="
|
|
2171
|
+
!header.column.columnDef.enableResizing ? 'true' : null
|
|
2172
|
+
"
|
|
2173
|
+
>
|
|
2174
|
+
@if (!header.isPlaceholder) {
|
|
2175
|
+
{{ header.column.columnDef.header }}
|
|
2176
|
+
}
|
|
2177
|
+
</th>
|
|
2178
|
+
}
|
|
2179
|
+
</tr>
|
|
2180
|
+
}
|
|
2181
|
+
</thead>
|
|
2182
|
+
|
|
2183
|
+
<tbody>
|
|
2184
|
+
@for (row of table().getRowModel().rows; track row.id) {
|
|
2185
|
+
<tr [attr.data-testid]="'datatable-row-' + row.id">
|
|
2186
|
+
@for (cell of row.getVisibleCells(); track cell.id) {
|
|
2187
|
+
<td
|
|
2188
|
+
[attr.data-testid]="'datatable-cell-' + cell.id"
|
|
2189
|
+
style="padding: 8px; border-bottom: 1px solid #eee;"
|
|
2190
|
+
>
|
|
2191
|
+
<!-- Let FlexRender handle strings vs TemplateRef -->
|
|
2192
|
+
<ng-container
|
|
2193
|
+
*flexRender="
|
|
2194
|
+
cell.column.columnDef.cell;
|
|
2195
|
+
props: cell.getContext();
|
|
2196
|
+
let cellContent
|
|
2197
|
+
"
|
|
2198
|
+
>
|
|
2199
|
+
{{ cellContent }}
|
|
2200
|
+
</ng-container>
|
|
2201
|
+
</td>
|
|
2202
|
+
}
|
|
2203
|
+
</tr>
|
|
2204
|
+
}
|
|
2205
|
+
</tbody>
|
|
2206
|
+
</table>
|
|
2207
|
+
</nv-table>
|
|
2208
|
+
`,
|
|
2209
|
+
}]
|
|
2210
|
+
}] });
|
|
2211
|
+
|
|
1334
2212
|
class ValueAccessor {
|
|
1335
2213
|
constructor(el) {
|
|
1336
2214
|
this.el = el;
|
|
@@ -1370,6 +2248,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1370
2248
|
args: ['focusout']
|
|
1371
2249
|
}] } });
|
|
1372
2250
|
|
|
2251
|
+
class NvAccordionValueAccessor extends ValueAccessor {
|
|
2252
|
+
constructor(el) {
|
|
2253
|
+
super(el);
|
|
2254
|
+
}
|
|
2255
|
+
handleOpenIndexesChanged(event) {
|
|
2256
|
+
this.handleChangeEvent(event.target.openIndexes);
|
|
2257
|
+
}
|
|
2258
|
+
writeValue(value) {
|
|
2259
|
+
this.el.nativeElement.openIndexes = this.lastValue = value;
|
|
2260
|
+
}
|
|
2261
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvAccordionValueAccessor, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2262
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: NvAccordionValueAccessor, selector: "nv-accordion", host: { listeners: { "openIndexesChanged": "handleOpenIndexesChanged($event)" } }, providers: [
|
|
2263
|
+
{
|
|
2264
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2265
|
+
useExisting: NvAccordionValueAccessor,
|
|
2266
|
+
multi: true,
|
|
2267
|
+
},
|
|
2268
|
+
], usesInheritance: true, ngImport: i0 }); }
|
|
2269
|
+
}
|
|
2270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvAccordionValueAccessor, decorators: [{
|
|
2271
|
+
type: Directive,
|
|
2272
|
+
args: [{
|
|
2273
|
+
selector: 'nv-accordion',
|
|
2274
|
+
providers: [
|
|
2275
|
+
{
|
|
2276
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2277
|
+
useExisting: NvAccordionValueAccessor,
|
|
2278
|
+
multi: true,
|
|
2279
|
+
},
|
|
2280
|
+
],
|
|
2281
|
+
}]
|
|
2282
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { handleOpenIndexesChanged: [{
|
|
2283
|
+
type: HostListener,
|
|
2284
|
+
args: ['openIndexesChanged', ['$event']]
|
|
2285
|
+
}] } });
|
|
1373
2286
|
class NvAlertValueAccessor extends ValueAccessor {
|
|
1374
2287
|
constructor(el) {
|
|
1375
2288
|
super(el);
|
|
@@ -2000,6 +2913,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2000
2913
|
type: HostListener,
|
|
2001
2914
|
args: ['openChanged', ['$event']]
|
|
2002
2915
|
}] } });
|
|
2916
|
+
class NvSplitValueAccessor extends ValueAccessor {
|
|
2917
|
+
constructor(el) {
|
|
2918
|
+
super(el);
|
|
2919
|
+
}
|
|
2920
|
+
handleSizesChanged(event) {
|
|
2921
|
+
this.handleChangeEvent(event.target.sizes);
|
|
2922
|
+
}
|
|
2923
|
+
writeValue(value) {
|
|
2924
|
+
this.el.nativeElement.sizes = this.lastValue = value;
|
|
2925
|
+
}
|
|
2926
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvSplitValueAccessor, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2927
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: NvSplitValueAccessor, selector: "nv-split", host: { listeners: { "sizesChanged": "handleSizesChanged($event)" } }, providers: [
|
|
2928
|
+
{
|
|
2929
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2930
|
+
useExisting: NvSplitValueAccessor,
|
|
2931
|
+
multi: true,
|
|
2932
|
+
},
|
|
2933
|
+
], usesInheritance: true, ngImport: i0 }); }
|
|
2934
|
+
}
|
|
2935
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NvSplitValueAccessor, decorators: [{
|
|
2936
|
+
type: Directive,
|
|
2937
|
+
args: [{
|
|
2938
|
+
selector: 'nv-split',
|
|
2939
|
+
providers: [
|
|
2940
|
+
{
|
|
2941
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2942
|
+
useExisting: NvSplitValueAccessor,
|
|
2943
|
+
multi: true,
|
|
2944
|
+
},
|
|
2945
|
+
],
|
|
2946
|
+
}]
|
|
2947
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { handleSizesChanged: [{
|
|
2948
|
+
type: HostListener,
|
|
2949
|
+
args: ['sizesChanged', ['$event']]
|
|
2950
|
+
}] } });
|
|
2003
2951
|
class NvToggleValueAccessor extends ValueAccessor {
|
|
2004
2952
|
constructor(el) {
|
|
2005
2953
|
super(el);
|
|
@@ -2071,6 +3019,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2071
3019
|
args: ['valueChanged', ['$event']]
|
|
2072
3020
|
}] } });
|
|
2073
3021
|
const VALUE_ACCESSORS = [
|
|
3022
|
+
NvAccordionValueAccessor,
|
|
2074
3023
|
NvAlertValueAccessor,
|
|
2075
3024
|
NvCalendarValueAccessor,
|
|
2076
3025
|
NvDatagridValueAccessor,
|
|
@@ -2089,6 +3038,7 @@ const VALUE_ACCESSORS = [
|
|
|
2089
3038
|
NvFieldtextareaValueAccessor,
|
|
2090
3039
|
NvNotificationValueAccessor,
|
|
2091
3040
|
NvPopoverValueAccessor,
|
|
3041
|
+
NvSplitValueAccessor,
|
|
2092
3042
|
NvToggleValueAccessor,
|
|
2093
3043
|
NvTogglebuttongroupValueAccessor,
|
|
2094
3044
|
];
|
|
@@ -2107,20 +3057,21 @@ function provideNovaComponents() {
|
|
|
2107
3057
|
}
|
|
2108
3058
|
class NovaComponentsModule {
|
|
2109
3059
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2110
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", 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,
|
|
2111
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsModule, providers: [provideNovaComponents()] }); }
|
|
3060
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", 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] }); }
|
|
3061
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsModule, providers: [provideNovaComponents()], imports: [NvDatatable] }); }
|
|
2112
3062
|
}
|
|
2113
3063
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsModule, decorators: [{
|
|
2114
3064
|
type: NgModule,
|
|
2115
3065
|
args: [{
|
|
3066
|
+
imports: [NvDatatable],
|
|
2116
3067
|
declarations: [...DIRECTIVES],
|
|
2117
|
-
exports: [...DIRECTIVES],
|
|
3068
|
+
exports: [...DIRECTIVES, NvDatatable],
|
|
2118
3069
|
providers: [provideNovaComponents()],
|
|
2119
3070
|
}]
|
|
2120
3071
|
}] });
|
|
2121
3072
|
class NovaComponentsValueAccessorModule {
|
|
2122
3073
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsValueAccessorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2123
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsValueAccessorModule, declarations: [NvAlertValueAccessor, NvCalendarValueAccessor, NvDatagridValueAccessor, NvDialogValueAccessor, NvFieldcheckboxValueAccessor, NvFielddateValueAccessor, NvFielddaterangeValueAccessor, NvFielddropdownValueAccessor, NvFieldmultiselectValueAccessor, NvFieldnumberValueAccessor, NvFieldpasswordValueAccessor, NvFieldradioValueAccessor, NvFieldselectValueAccessor, NvFieldsliderValueAccessor, NvFieldtextValueAccessor, NvFieldtextareaValueAccessor, NvNotificationValueAccessor, NvPopoverValueAccessor, NvToggleValueAccessor, NvTogglebuttongroupValueAccessor], exports: [NvAlertValueAccessor, NvCalendarValueAccessor, NvDatagridValueAccessor, NvDialogValueAccessor, NvFieldcheckboxValueAccessor, NvFielddateValueAccessor, NvFielddaterangeValueAccessor, NvFielddropdownValueAccessor, NvFieldmultiselectValueAccessor, NvFieldnumberValueAccessor, NvFieldpasswordValueAccessor, NvFieldradioValueAccessor, NvFieldselectValueAccessor, NvFieldsliderValueAccessor, NvFieldtextValueAccessor, NvFieldtextareaValueAccessor, NvNotificationValueAccessor, NvPopoverValueAccessor, NvToggleValueAccessor, NvTogglebuttongroupValueAccessor] }); }
|
|
3074
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsValueAccessorModule, declarations: [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] }); }
|
|
2124
3075
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsValueAccessorModule }); }
|
|
2125
3076
|
}
|
|
2126
3077
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NovaComponentsValueAccessorModule, decorators: [{
|
|
@@ -2448,5 +3399,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2448
3399
|
* Generated bundle index. Do not edit.
|
|
2449
3400
|
*/
|
|
2450
3401
|
|
|
2451
|
-
export { NotificationService, NotificationServiceComponent, NovaComponentsModule, NovaComponentsValueAccessorModule, NvAccordion, NvAccordionItem, NvAlert, NvAlertValueAccessor, NvAvatar, NvBadge, NvBreadcrumb, NvBreadcrumbs, NvButton, NvButtongroup, NvCalendar, NvCalendarValueAccessor, NvCol, NvDatagrid, NvDatagridValueAccessor, NvDatagridcolumn, 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,
|
|
3402
|
+
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, NvSplit, NvSplitValueAccessor, NvStack, NvTable, NvToggle, NvToggleValueAccessor, NvTogglebutton, NvTogglebuttongroup, NvTogglebuttongroupValueAccessor, NvTooltip, VALUE_ACCESSORS, flexRenderComponent as nvDatatableRenderComponent, provideNovaComponents };
|
|
2452
3403
|
//# sourceMappingURL=nova-components.mjs.map
|