@nova-design-system/nova-angular-19 3.14.0 → 3.16.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.
Files changed (22) hide show
  1. package/dist/nova-components/fesm2022/nova-components.mjs +1268 -44
  2. package/dist/nova-components/fesm2022/nova-components.mjs.map +1 -1
  3. package/dist/nova-components/lib/components/datatable.utils/flex-render/context.d.ts +3 -0
  4. package/dist/nova-components/lib/components/datatable.utils/flex-render/flags.d.ts +40 -0
  5. package/dist/nova-components/lib/components/datatable.utils/flex-render/flex-render-component-ref.d.ts +39 -0
  6. package/dist/nova-components/lib/components/datatable.utils/flex-render/flex-render-component.d.ts +60 -0
  7. package/dist/nova-components/lib/components/datatable.utils/flex-render/view.d.ts +49 -0
  8. package/dist/nova-components/lib/components/datatable.utils/flex-render.d.ts +26 -0
  9. package/dist/nova-components/lib/components/datatable.utils/index.d.ts +6 -0
  10. package/dist/nova-components/lib/components/datatable.utils/lazy-signal-initializer.d.ts +5 -0
  11. package/dist/nova-components/lib/components/datatable.utils/proxy.d.ts +3 -0
  12. package/dist/nova-components/lib/components/index.d.ts +1 -0
  13. package/dist/nova-components/lib/components/nv-datatable.component.d.ts +46 -0
  14. package/dist/nova-components/lib/nova-components.module.d.ts +4 -3
  15. package/dist/nova-components/lib/providers/index.d.ts +2 -0
  16. package/dist/nova-components/lib/providers/notification-service.component.d.ts +56 -0
  17. package/dist/nova-components/lib/providers/notification.service.d.ts +116 -0
  18. package/dist/nova-components/lib/stencil-generated/component-value-accessors.d.ts +8 -1
  19. package/dist/nova-components/lib/stencil-generated/components.d.ts +13 -22
  20. package/dist/nova-components/lib/stencil-generated/index.d.ts +1 -1
  21. package/dist/nova-components/public-api.d.ts +2 -0
  22. package/package.json +6 -3
@@ -1,7 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Directive, HostListener, NgModule } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, untracked, computed, InjectionToken, inject, reflectComponentType, ViewContainerRef, Injectable, KeyValueDiffers, ChangeDetectorRef, OutputEmitterRef, TemplateRef, Type, Injector, runInInjectionContext, effect, Directive, Inject, Input, signal, input, CUSTOM_ELEMENTS_SCHEMA, HostListener, NgModule, ElementRef, ViewChildren } from '@angular/core';
3
3
  import { __decorate } from 'tslib';
4
- import { fromEvent } from 'rxjs';
4
+ import { fromEvent, BehaviorSubject } from 'rxjs';
5
+ import * as i2 from '@angular/common';
6
+ import { CommonModule } from '@angular/common';
7
+ import { memo, createTable, getCoreRowModel } from '@tanstack/table-core';
5
8
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
9
  export * from '@nova-design-system/nova-webcomponents/constants';
7
10
 
@@ -68,7 +71,7 @@ let NvAccordion = class NvAccordion {
68
71
  this.z = z;
69
72
  c.detach();
70
73
  this.el = r.nativeElement;
71
- proxyOutputs(this, this.el, ['openChanged']);
74
+ proxyOutputs(this, this.el, ['openIndexesChanged']);
72
75
  }
73
76
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvAccordion, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
74
77
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NvAccordion, isStandalone: false, selector: "nv-accordion", inputs: { data: "data", mode: "mode", openIndexes: "openIndexes" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
@@ -1003,12 +1006,12 @@ let NvNotification = class NvNotification {
1003
1006
  proxyOutputs(this, this.el, ['hiddenChanged']);
1004
1007
  }
1005
1008
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvNotification, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
1006
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NvNotification, isStandalone: false, selector: "nv-notification", inputs: { dismissible: "dismissible", emphasis: "emphasis", feedback: "feedback", heading: "heading", hidden: "hidden", icon: "icon", message: "message", uid: "uid" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1009
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NvNotification, isStandalone: false, selector: "nv-notification", inputs: { dismissible: "dismissible", emphasis: "emphasis", feedback: "feedback", heading: "heading", hidden: "hidden", icon: "icon", initiallyHidden: "initiallyHidden", message: "message", uid: "uid" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1007
1010
  };
1008
1011
  NvNotification = __decorate([
1009
1012
  ProxyCmp({
1010
- inputs: ['dismissible', 'emphasis', 'feedback', 'heading', 'hidden', 'icon', 'message', 'uid'],
1011
- methods: ['dismiss']
1013
+ inputs: ['dismissible', 'emphasis', 'feedback', 'heading', 'hidden', 'icon', 'initiallyHidden', 'message', 'uid'],
1014
+ methods: ['dismiss', 'show']
1012
1015
  })
1013
1016
  ], NvNotification);
1014
1017
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvNotification, decorators: [{
@@ -1018,7 +1021,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
1018
1021
  changeDetection: ChangeDetectionStrategy.OnPush,
1019
1022
  template: '<ng-content></ng-content>',
1020
1023
  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1021
- inputs: ['dismissible', 'emphasis', 'feedback', 'heading', 'hidden', 'icon', 'message', 'uid'],
1024
+ inputs: ['dismissible', 'emphasis', 'feedback', 'heading', 'hidden', 'icon', 'initiallyHidden', 'message', 'uid'],
1025
+ standalone: false
1026
+ }]
1027
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
1028
+ let NvNotificationcontainer = class NvNotificationcontainer {
1029
+ constructor(c, r, z) {
1030
+ this.z = z;
1031
+ c.detach();
1032
+ this.el = r.nativeElement;
1033
+ }
1034
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvNotificationcontainer, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
1035
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NvNotificationcontainer, isStandalone: false, selector: "nv-notificationcontainer", inputs: { position: "position" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1036
+ };
1037
+ NvNotificationcontainer = __decorate([
1038
+ ProxyCmp({
1039
+ inputs: ['position']
1040
+ })
1041
+ ], NvNotificationcontainer);
1042
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvNotificationcontainer, decorators: [{
1043
+ type: Component,
1044
+ args: [{
1045
+ selector: 'nv-notificationcontainer',
1046
+ changeDetection: ChangeDetectionStrategy.OnPush,
1047
+ template: '<ng-content></ng-content>',
1048
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1049
+ inputs: ['position'],
1022
1050
  standalone: false
1023
1051
  }]
1024
1052
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
@@ -1102,15 +1130,12 @@ let NvTable = class NvTable {
1102
1130
  this.z = z;
1103
1131
  c.detach();
1104
1132
  this.el = r.nativeElement;
1105
- proxyOutputs(this, this.el, ['action']);
1106
1133
  }
1107
1134
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvTable, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
1108
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NvTable, isStandalone: false, selector: "nv-table", inputs: { columnsConfig: "columnsConfig", columnsConfigJson: "columnsConfigJson", data: "data", dataJson: "dataJson", fallbackValue: "fallbackValue", noColumnsNoDataMessage: "noColumnsNoDataMessage", noDataMessage: "noDataMessage" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1135
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NvTable, isStandalone: false, selector: "nv-table", ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1109
1136
  };
1110
1137
  NvTable = __decorate([
1111
- ProxyCmp({
1112
- inputs: ['columnsConfig', 'columnsConfigJson', 'data', 'dataJson', 'fallbackValue', 'noColumnsNoDataMessage', 'noDataMessage']
1113
- })
1138
+ ProxyCmp({})
1114
1139
  ], NvTable);
1115
1140
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvTable, decorators: [{
1116
1141
  type: Component,
@@ -1119,32 +1144,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
1119
1144
  changeDetection: ChangeDetectionStrategy.OnPush,
1120
1145
  template: '<ng-content></ng-content>',
1121
1146
  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1122
- inputs: ['columnsConfig', 'columnsConfigJson', 'data', 'dataJson', 'fallbackValue', 'noColumnsNoDataMessage', 'noDataMessage'],
1123
- standalone: false
1124
- }]
1125
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
1126
- let NvTablecolumn = class NvTablecolumn {
1127
- constructor(c, r, z) {
1128
- this.z = z;
1129
- c.detach();
1130
- this.el = r.nativeElement;
1131
- }
1132
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvTablecolumn, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
1133
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NvTablecolumn, isStandalone: false, selector: "nv-tablecolumn", inputs: { header: "header", name: "name" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1134
- };
1135
- NvTablecolumn = __decorate([
1136
- ProxyCmp({
1137
- inputs: ['header', 'name']
1138
- })
1139
- ], NvTablecolumn);
1140
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvTablecolumn, decorators: [{
1141
- type: Component,
1142
- args: [{
1143
- selector: 'nv-tablecolumn',
1144
- changeDetection: ChangeDetectionStrategy.OnPush,
1145
- template: '<ng-content></ng-content>',
1146
- // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1147
- inputs: ['header', { name: 'name', required: true }],
1147
+ inputs: [],
1148
1148
  standalone: false
1149
1149
  }]
1150
1150
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
@@ -1291,17 +1291,895 @@ const DIRECTIVES = [
1291
1291
  NvMenu,
1292
1292
  NvMenuitem,
1293
1293
  NvNotification,
1294
+ NvNotificationcontainer,
1294
1295
  NvPopover,
1295
1296
  NvRow,
1296
1297
  NvStack,
1297
1298
  NvTable,
1298
- NvTablecolumn,
1299
1299
  NvToggle,
1300
1300
  NvTogglebutton,
1301
1301
  NvTogglebuttongroup,
1302
1302
  NvTooltip
1303
1303
  ];
1304
1304
 
1305
+ /**
1306
+ * Implementation from @tanstack/angular-query
1307
+ * {@link https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/util/lazy-init/lazy-init.ts}
1308
+ */
1309
+ function lazyInit(initializer) {
1310
+ let object = null;
1311
+ const initializeObject = () => {
1312
+ if (!object) {
1313
+ object = untracked(() => initializer());
1314
+ }
1315
+ };
1316
+ queueMicrotask(() => initializeObject());
1317
+ const table = () => { };
1318
+ return new Proxy(table, {
1319
+ apply(target, thisArg, argArray) {
1320
+ initializeObject();
1321
+ if (typeof object === 'function') {
1322
+ return Reflect.apply(object, thisArg, argArray);
1323
+ }
1324
+ return Reflect.apply(target, thisArg, argArray);
1325
+ },
1326
+ get(_, prop, receiver) {
1327
+ initializeObject();
1328
+ return Reflect.get(object, prop, receiver);
1329
+ },
1330
+ has(_, prop) {
1331
+ initializeObject();
1332
+ return Reflect.has(object, prop);
1333
+ },
1334
+ ownKeys() {
1335
+ initializeObject();
1336
+ return Reflect.ownKeys(object);
1337
+ },
1338
+ getOwnPropertyDescriptor() {
1339
+ return {
1340
+ enumerable: true,
1341
+ configurable: true,
1342
+ };
1343
+ },
1344
+ });
1345
+ }
1346
+
1347
+ function proxifyTable(tableSignal) {
1348
+ const internalState = tableSignal;
1349
+ return new Proxy(internalState, {
1350
+ apply() {
1351
+ return tableSignal();
1352
+ },
1353
+ get(target, property) {
1354
+ if (target[property]) {
1355
+ return target[property];
1356
+ }
1357
+ const table = untracked(tableSignal);
1358
+ /**
1359
+ * Attempt to convert all accessors into computed ones,
1360
+ * excluding handlers as they do not retain any reactive value
1361
+ */
1362
+ if (property.startsWith('get') &&
1363
+ !property.endsWith('Handler')
1364
+ // e.g. getCoreRowModel, getSelectedRowModel etc.
1365
+ // We need that after a signal change even `rowModel` may mark the view as dirty.
1366
+ // This allows to always get the latest `getContext` value while using flexRender
1367
+ // && !property.endsWith('Model')
1368
+ ) {
1369
+ const maybeFn = table[property];
1370
+ if (typeof maybeFn === 'function') {
1371
+ Object.defineProperty(target, property, {
1372
+ value: toComputed(tableSignal, maybeFn),
1373
+ configurable: true,
1374
+ enumerable: true,
1375
+ });
1376
+ return target[property];
1377
+ }
1378
+ }
1379
+ // @ts-expect-error
1380
+ return (target[property] = table[property]);
1381
+ },
1382
+ has(_, prop) {
1383
+ return !!untracked(tableSignal)[prop];
1384
+ },
1385
+ ownKeys() {
1386
+ return Reflect.ownKeys(untracked(tableSignal));
1387
+ },
1388
+ getOwnPropertyDescriptor() {
1389
+ return {
1390
+ enumerable: true,
1391
+ configurable: true,
1392
+ };
1393
+ },
1394
+ });
1395
+ }
1396
+ /**
1397
+ * Here we'll handle all type of accessors:
1398
+ * - 0 argument -> e.g. table.getCanNextPage())
1399
+ * - 0~1 arguments -> e.g. table.getIsSomeRowsPinned(position?)
1400
+ * - 1 required argument -> e.g. table.getColumn(columnId)
1401
+ * - 1+ argument -> e.g. table.getRow(id, searchAll?)
1402
+ *
1403
+ * Since we are not able to detect automatically the accessors parameters,
1404
+ * we'll wrap all accessors into a cached function wrapping a computed
1405
+ * that return it's value based on the given parameters
1406
+ */
1407
+ function toComputed(signal, fn) {
1408
+ const hasArgs = fn.length > 0;
1409
+ if (!hasArgs) {
1410
+ return computed(() => {
1411
+ void signal();
1412
+ return fn();
1413
+ });
1414
+ }
1415
+ const computedCache = {};
1416
+ return (...argsArray) => {
1417
+ const serializedArgs = serializeArgs(...argsArray);
1418
+ if (computedCache.hasOwnProperty(serializedArgs)) {
1419
+ return computedCache[serializedArgs]?.();
1420
+ }
1421
+ const computedSignal = computed(() => {
1422
+ void signal();
1423
+ return fn(...argsArray);
1424
+ });
1425
+ computedCache[serializedArgs] = computedSignal;
1426
+ return computedSignal();
1427
+ };
1428
+ }
1429
+ function serializeArgs(...args) {
1430
+ return JSON.stringify(args);
1431
+ }
1432
+
1433
+ const FlexRenderComponentProps = new InjectionToken('[@tanstack/angular-table] Flex render component context props');
1434
+ function injectFlexRenderContext() {
1435
+ return inject(FlexRenderComponentProps);
1436
+ }
1437
+
1438
+ /**
1439
+ * Flags used to manage and optimize the rendering lifecycle of content of the cell,
1440
+ * while using FlexRenderDirective.
1441
+ */
1442
+ var FlexRenderFlags;
1443
+ (function (FlexRenderFlags) {
1444
+ /**
1445
+ * Indicates that the view is being created for the first time or will be cleared during the next update phase.
1446
+ * This is the initial state and will transition after the first ngDoCheck.
1447
+ */
1448
+ FlexRenderFlags[FlexRenderFlags["ViewFirstRender"] = 1] = "ViewFirstRender";
1449
+ /**
1450
+ * Represents a state where the view is not dirty, meaning no changes require rendering updates.
1451
+ */
1452
+ FlexRenderFlags[FlexRenderFlags["Pristine"] = 2] = "Pristine";
1453
+ /**
1454
+ * Indicates the `content` property has been modified or the view requires a complete re-render.
1455
+ * When this flag is enabled, the view will be cleared and recreated from scratch.
1456
+ */
1457
+ FlexRenderFlags[FlexRenderFlags["ContentChanged"] = 4] = "ContentChanged";
1458
+ /**
1459
+ * Indicates that the `props` property reference has changed.
1460
+ * When this flag is enabled, the view context is updated based on the type of the content.
1461
+ *
1462
+ * For Component view, inputs will be updated and view will be marked as dirty.
1463
+ * For TemplateRef and primitive values, view will be marked as dirty
1464
+ */
1465
+ FlexRenderFlags[FlexRenderFlags["PropsReferenceChanged"] = 8] = "PropsReferenceChanged";
1466
+ /**
1467
+ * Indicates that the current rendered view needs to be checked for changes.
1468
+ */
1469
+ FlexRenderFlags[FlexRenderFlags["DirtyCheck"] = 16] = "DirtyCheck";
1470
+ /**
1471
+ * Indicates that a signal within the `content(props)` result has changed
1472
+ */
1473
+ FlexRenderFlags[FlexRenderFlags["DirtySignal"] = 32] = "DirtySignal";
1474
+ /**
1475
+ * Indicates that the first render effect has been checked at least one time.
1476
+ */
1477
+ FlexRenderFlags[FlexRenderFlags["RenderEffectChecked"] = 64] = "RenderEffectChecked";
1478
+ })(FlexRenderFlags || (FlexRenderFlags = {}));
1479
+
1480
+ /**
1481
+ * Helper function to create a [@link FlexRenderComponent] instance, with better type-safety.
1482
+ *
1483
+ * - options object must be passed when the given component instance contains at least one required signal input.
1484
+ * - options/inputs is typed with the given component inputs
1485
+ * - options/outputs is typed with the given component outputs
1486
+ */
1487
+ function flexRenderComponent(component, ...options) {
1488
+ const { inputs, injector, outputs } = options?.[0] ?? {};
1489
+ return new FlexRenderComponent(component, inputs, injector, outputs);
1490
+ }
1491
+ /**
1492
+ * Wrapper class for a component that will be used as content for {@link FlexRenderDirective}
1493
+ *
1494
+ * Prefer {@link flexRenderComponent} helper for better type-safety
1495
+ */
1496
+ class FlexRenderComponent {
1497
+ constructor(component, inputs, injector, outputs) {
1498
+ this.component = component;
1499
+ this.inputs = inputs;
1500
+ this.injector = injector;
1501
+ this.outputs = outputs;
1502
+ this.allowedInputNames = [];
1503
+ this.allowedOutputNames = [];
1504
+ const mirror = reflectComponentType(component);
1505
+ if (!mirror) {
1506
+ throw new Error(`[@tanstack-table/angular] The provided symbol is not a component`);
1507
+ }
1508
+ this.mirror = mirror;
1509
+ for (const input of this.mirror.inputs) {
1510
+ this.allowedInputNames.push(input.propName);
1511
+ }
1512
+ for (const output of this.mirror.outputs) {
1513
+ this.allowedOutputNames.push(output.propName);
1514
+ }
1515
+ }
1516
+ }
1517
+
1518
+ class FlexRenderComponentFactory {
1519
+ #viewContainerRef = inject(ViewContainerRef);
1520
+ createComponent(flexRenderComponent, componentInjector) {
1521
+ const componentRef = this.#viewContainerRef.createComponent(flexRenderComponent.component, {
1522
+ injector: componentInjector,
1523
+ });
1524
+ const view = new FlexRenderComponentRef(componentRef, flexRenderComponent, componentInjector);
1525
+ const { inputs, outputs } = flexRenderComponent;
1526
+ if (inputs)
1527
+ view.setInputs(inputs);
1528
+ if (outputs)
1529
+ view.setOutputs(outputs);
1530
+ return view;
1531
+ }
1532
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FlexRenderComponentFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1533
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FlexRenderComponentFactory }); }
1534
+ }
1535
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FlexRenderComponentFactory, decorators: [{
1536
+ type: Injectable
1537
+ }] });
1538
+ class FlexRenderComponentRef {
1539
+ #keyValueDiffersFactory;
1540
+ #componentData;
1541
+ #inputValueDiffer;
1542
+ #outputRegistry;
1543
+ constructor(componentRef, componentData, componentInjector) {
1544
+ this.componentRef = componentRef;
1545
+ this.componentInjector = componentInjector;
1546
+ this.#componentData = componentData;
1547
+ this.#keyValueDiffersFactory = componentInjector.get(KeyValueDiffers);
1548
+ this.#outputRegistry = new FlexRenderComponentOutputManager(this.#keyValueDiffersFactory, this.outputs);
1549
+ this.#inputValueDiffer = this.#keyValueDiffersFactory
1550
+ .find(this.inputs)
1551
+ .create();
1552
+ this.#inputValueDiffer.diff(this.inputs);
1553
+ this.componentRef.onDestroy(() => this.#outputRegistry.unsubscribeAll());
1554
+ }
1555
+ get component() {
1556
+ return this.#componentData.component;
1557
+ }
1558
+ get inputs() {
1559
+ return this.#componentData.inputs ?? {};
1560
+ }
1561
+ get outputs() {
1562
+ return this.#componentData.outputs ?? {};
1563
+ }
1564
+ /**
1565
+ * Get component input and output diff by the given item
1566
+ */
1567
+ diff(item) {
1568
+ return {
1569
+ inputDiff: this.#inputValueDiffer.diff(item.inputs ?? {}),
1570
+ outputDiff: this.#outputRegistry.diff(item.outputs ?? {}),
1571
+ };
1572
+ }
1573
+ /**
1574
+ *
1575
+ * @param compare Whether the current ref component instance is the same as the given one
1576
+ */
1577
+ eqType(compare) {
1578
+ return compare.component === this.component;
1579
+ }
1580
+ /**
1581
+ * Tries to update current component refs input by the new given content component.
1582
+ */
1583
+ update(content) {
1584
+ const eq = this.eqType(content);
1585
+ if (!eq)
1586
+ return;
1587
+ const { inputDiff, outputDiff } = this.diff(content);
1588
+ if (inputDiff) {
1589
+ inputDiff.forEachAddedItem(item => this.setInput(item.key, item.currentValue));
1590
+ inputDiff.forEachChangedItem(item => this.setInput(item.key, item.currentValue));
1591
+ inputDiff.forEachRemovedItem(item => this.setInput(item.key, undefined));
1592
+ }
1593
+ if (outputDiff) {
1594
+ outputDiff.forEachAddedItem(item => {
1595
+ this.setOutput(item.key, item.currentValue);
1596
+ });
1597
+ outputDiff.forEachChangedItem(item => {
1598
+ if (item.currentValue) {
1599
+ this.#outputRegistry.setListener(item.key, item.currentValue);
1600
+ }
1601
+ else {
1602
+ this.#outputRegistry.unsubscribe(item.key);
1603
+ }
1604
+ });
1605
+ outputDiff.forEachRemovedItem(item => {
1606
+ this.#outputRegistry.unsubscribe(item.key);
1607
+ });
1608
+ }
1609
+ this.#componentData = content;
1610
+ }
1611
+ markAsDirty() {
1612
+ this.componentRef.injector.get(ChangeDetectorRef).markForCheck();
1613
+ }
1614
+ setInputs(inputs) {
1615
+ for (const prop in inputs) {
1616
+ this.setInput(prop, inputs[prop]);
1617
+ }
1618
+ }
1619
+ setInput(key, value) {
1620
+ if (this.#componentData.allowedInputNames.includes(key)) {
1621
+ this.componentRef.setInput(key, value);
1622
+ }
1623
+ }
1624
+ setOutputs(outputs) {
1625
+ this.#outputRegistry.unsubscribeAll();
1626
+ for (const prop in outputs) {
1627
+ this.setOutput(prop, outputs[prop]);
1628
+ }
1629
+ }
1630
+ setOutput(outputName, emit) {
1631
+ if (!this.#componentData.allowedOutputNames.includes(outputName))
1632
+ return;
1633
+ if (!emit) {
1634
+ this.#outputRegistry.unsubscribe(outputName);
1635
+ return;
1636
+ }
1637
+ const hasListener = this.#outputRegistry.hasListener(outputName);
1638
+ this.#outputRegistry.setListener(outputName, emit);
1639
+ if (hasListener) {
1640
+ return;
1641
+ }
1642
+ const instance = this.componentRef.instance;
1643
+ const output = instance[outputName];
1644
+ if (output && output instanceof OutputEmitterRef) {
1645
+ output.subscribe(value => {
1646
+ this.#outputRegistry.getListener(outputName)?.(value);
1647
+ });
1648
+ }
1649
+ }
1650
+ }
1651
+ class FlexRenderComponentOutputManager {
1652
+ #outputSubscribers = {};
1653
+ #outputListeners = {};
1654
+ #valueDiffer;
1655
+ constructor(keyValueDiffers, initialOutputs) {
1656
+ this.#valueDiffer = keyValueDiffers.find(initialOutputs).create();
1657
+ if (initialOutputs) {
1658
+ this.#valueDiffer.diff(initialOutputs);
1659
+ }
1660
+ }
1661
+ hasListener(outputName) {
1662
+ return outputName in this.#outputListeners;
1663
+ }
1664
+ setListener(outputName, callback) {
1665
+ this.#outputListeners[outputName] = callback;
1666
+ }
1667
+ getListener(outputName) {
1668
+ return this.#outputListeners[outputName];
1669
+ }
1670
+ unsubscribeAll() {
1671
+ for (const prop in this.#outputSubscribers) {
1672
+ this.unsubscribe(prop);
1673
+ }
1674
+ }
1675
+ unsubscribe(outputName) {
1676
+ if (outputName in this.#outputSubscribers) {
1677
+ this.#outputSubscribers[outputName]?.unsubscribe();
1678
+ delete this.#outputSubscribers[outputName];
1679
+ delete this.#outputListeners[outputName];
1680
+ }
1681
+ }
1682
+ diff(outputs) {
1683
+ return this.#valueDiffer.diff(outputs ?? {});
1684
+ }
1685
+ }
1686
+
1687
+ function mapToFlexRenderTypedContent(content) {
1688
+ if (content === null || content === undefined) {
1689
+ return { kind: 'null' };
1690
+ }
1691
+ if (typeof content === 'string' || typeof content === 'number') {
1692
+ return { kind: 'primitive', content };
1693
+ }
1694
+ if (content instanceof FlexRenderComponent) {
1695
+ return { kind: 'flexRenderComponent', content };
1696
+ }
1697
+ else if (content instanceof TemplateRef) {
1698
+ return { kind: 'templateRef', content };
1699
+ }
1700
+ else if (content instanceof Type) {
1701
+ return { kind: 'component', content };
1702
+ }
1703
+ else {
1704
+ return { kind: 'primitive', content };
1705
+ }
1706
+ }
1707
+ class FlexRenderView {
1708
+ #previousContent;
1709
+ #content;
1710
+ constructor(initialContent, view) {
1711
+ this.#content = initialContent;
1712
+ this.view = view;
1713
+ }
1714
+ get previousContent() {
1715
+ return this.#previousContent ?? { kind: 'null' };
1716
+ }
1717
+ get content() {
1718
+ return this.#content;
1719
+ }
1720
+ set content(content) {
1721
+ this.#previousContent = this.#content;
1722
+ this.#content = content;
1723
+ }
1724
+ }
1725
+ class FlexRenderTemplateView extends FlexRenderView {
1726
+ constructor(initialContent, view) {
1727
+ super(initialContent, view);
1728
+ }
1729
+ updateProps(props) {
1730
+ this.view.markForCheck();
1731
+ }
1732
+ dirtyCheck() {
1733
+ // Basically a no-op. When the view is created via EmbeddedViewRef, we don't need to do any manual update
1734
+ // since this type of content has a proxy as a context, then every time the root component is checked for changes,
1735
+ // the property getter will be re-evaluated.
1736
+ //
1737
+ // If in a future we need to manually mark the view as dirty, just uncomment next line
1738
+ // this.view.markForCheck()
1739
+ }
1740
+ onDestroy(callback) {
1741
+ this.view.onDestroy(callback);
1742
+ }
1743
+ }
1744
+ class FlexRenderComponentView extends FlexRenderView {
1745
+ constructor(initialContent, view) {
1746
+ super(initialContent, view);
1747
+ }
1748
+ updateProps(props) {
1749
+ switch (this.content.kind) {
1750
+ case 'component': {
1751
+ this.view.setInputs(props);
1752
+ break;
1753
+ }
1754
+ case 'flexRenderComponent': {
1755
+ // No-op. When FlexRenderFlags.PropsReferenceChanged is set,
1756
+ // FlexRenderComponent will be updated into `dirtyCheck`.
1757
+ break;
1758
+ }
1759
+ }
1760
+ }
1761
+ dirtyCheck() {
1762
+ switch (this.content.kind) {
1763
+ case 'component': {
1764
+ // Component context is currently valuated with the cell context. Since it's reference
1765
+ // shouldn't change, we force mark the component as dirty in order to re-evaluate function invocation in view.
1766
+ // NOTE: this should behave like having a component with ChangeDetectionStrategy.Default
1767
+ this.view.markAsDirty();
1768
+ break;
1769
+ }
1770
+ case 'flexRenderComponent': {
1771
+ // Given context instance will always have a different reference than the previous one,
1772
+ // so instead of recreating the entire view, we will only update the current view
1773
+ if (this.view.eqType(this.content.content)) {
1774
+ this.view.update(this.content.content);
1775
+ }
1776
+ this.view.markAsDirty();
1777
+ break;
1778
+ }
1779
+ }
1780
+ }
1781
+ onDestroy(callback) {
1782
+ this.view.componentRef.onDestroy(callback);
1783
+ }
1784
+ }
1785
+
1786
+ class FlexRenderDirective {
1787
+ #flexRenderComponentFactory;
1788
+ #changeDetectorRef;
1789
+ #latestContent;
1790
+ #getContentValue;
1791
+ constructor(viewContainerRef, templateRef) {
1792
+ this.viewContainerRef = viewContainerRef;
1793
+ this.templateRef = templateRef;
1794
+ this.#flexRenderComponentFactory = inject(FlexRenderComponentFactory);
1795
+ this.#changeDetectorRef = inject(ChangeDetectorRef);
1796
+ this.content = undefined;
1797
+ this.props = {};
1798
+ this.injector = inject(Injector);
1799
+ this.renderFlags = FlexRenderFlags.ViewFirstRender;
1800
+ this.renderView = null;
1801
+ this.#latestContent = () => {
1802
+ const { content, props } = this;
1803
+ return typeof content !== 'function'
1804
+ ? content
1805
+ : runInInjectionContext(this.injector, () => content(props));
1806
+ };
1807
+ this.#getContentValue = memo(() => [this.#latestContent(), this.props, this.content], latestContent => {
1808
+ return mapToFlexRenderTypedContent(latestContent);
1809
+ }, { key: 'flexRenderContentValue', debug: () => false });
1810
+ this.#currentEffectRef = null;
1811
+ }
1812
+ ngOnChanges(changes) {
1813
+ if (changes['props']) {
1814
+ this.renderFlags |= FlexRenderFlags.PropsReferenceChanged;
1815
+ }
1816
+ if (changes['content']) {
1817
+ this.renderFlags |=
1818
+ FlexRenderFlags.ContentChanged | FlexRenderFlags.ViewFirstRender;
1819
+ this.update();
1820
+ }
1821
+ }
1822
+ ngDoCheck() {
1823
+ if (this.renderFlags & FlexRenderFlags.ViewFirstRender) {
1824
+ // On the initial render, the view is created during the `ngOnChanges` hook.
1825
+ // Since `ngDoCheck` is called immediately afterward, there's no need to check for changes in this phase.
1826
+ this.renderFlags &= ~FlexRenderFlags.ViewFirstRender;
1827
+ return;
1828
+ }
1829
+ this.renderFlags |= FlexRenderFlags.DirtyCheck;
1830
+ const latestContent = this.#getContentValue();
1831
+ if (latestContent.kind === 'null' || !this.renderView) {
1832
+ this.renderFlags |= FlexRenderFlags.ContentChanged;
1833
+ }
1834
+ else {
1835
+ this.renderView.content = latestContent;
1836
+ const { kind: previousKind } = this.renderView.previousContent;
1837
+ if (latestContent.kind !== previousKind) {
1838
+ this.renderFlags |= FlexRenderFlags.ContentChanged;
1839
+ }
1840
+ }
1841
+ this.update();
1842
+ }
1843
+ update() {
1844
+ if (this.renderFlags &
1845
+ (FlexRenderFlags.ContentChanged | FlexRenderFlags.ViewFirstRender)) {
1846
+ this.render();
1847
+ return;
1848
+ }
1849
+ if (this.renderFlags & FlexRenderFlags.PropsReferenceChanged) {
1850
+ if (this.renderView)
1851
+ this.renderView.updateProps(this.props);
1852
+ this.renderFlags &= ~FlexRenderFlags.PropsReferenceChanged;
1853
+ }
1854
+ if (this.renderFlags &
1855
+ (FlexRenderFlags.DirtyCheck | FlexRenderFlags.DirtySignal)) {
1856
+ if (this.renderView)
1857
+ this.renderView.dirtyCheck();
1858
+ this.renderFlags &= ~(FlexRenderFlags.DirtyCheck | FlexRenderFlags.DirtySignal);
1859
+ }
1860
+ }
1861
+ #currentEffectRef;
1862
+ render() {
1863
+ if (this.#shouldRecreateEntireView() && this.#currentEffectRef) {
1864
+ this.#currentEffectRef.destroy();
1865
+ this.#currentEffectRef = null;
1866
+ this.renderFlags &= ~FlexRenderFlags.RenderEffectChecked;
1867
+ }
1868
+ this.viewContainerRef.clear();
1869
+ this.renderFlags =
1870
+ FlexRenderFlags.Pristine |
1871
+ (this.renderFlags & FlexRenderFlags.ViewFirstRender) |
1872
+ (this.renderFlags & FlexRenderFlags.RenderEffectChecked);
1873
+ const resolvedContent = this.#getContentValue();
1874
+ if (resolvedContent.kind === 'null') {
1875
+ this.renderView = null;
1876
+ }
1877
+ else {
1878
+ this.renderView = this.#renderViewByContent(resolvedContent);
1879
+ }
1880
+ // If the content is a function `content(props)`, we initialize an effect
1881
+ // in order to react to changes if the given definition use signals.
1882
+ if (!this.#currentEffectRef && typeof this.content === 'function') {
1883
+ this.#currentEffectRef = effect(() => {
1884
+ this.#latestContent();
1885
+ if (!(this.renderFlags & FlexRenderFlags.RenderEffectChecked)) {
1886
+ this.renderFlags |= FlexRenderFlags.RenderEffectChecked;
1887
+ return;
1888
+ }
1889
+ this.renderFlags |= FlexRenderFlags.DirtySignal;
1890
+ // This will mark the view as changed,
1891
+ // so we'll try to check for updates into ngDoCheck
1892
+ this.#changeDetectorRef.markForCheck();
1893
+ }, { injector: this.viewContainerRef.injector });
1894
+ }
1895
+ }
1896
+ #shouldRecreateEntireView() {
1897
+ return (this.renderFlags &
1898
+ FlexRenderFlags.ContentChanged &
1899
+ FlexRenderFlags.ViewFirstRender);
1900
+ }
1901
+ #renderViewByContent(content) {
1902
+ if (content.kind === 'primitive') {
1903
+ return this.#renderStringContent(content);
1904
+ }
1905
+ else if (content.kind === 'templateRef') {
1906
+ return this.#renderTemplateRefContent(content);
1907
+ }
1908
+ else if (content.kind === 'flexRenderComponent') {
1909
+ return this.#renderComponent(content);
1910
+ }
1911
+ else if (content.kind === 'component') {
1912
+ return this.#renderCustomComponent(content);
1913
+ }
1914
+ else {
1915
+ return null;
1916
+ }
1917
+ }
1918
+ #renderStringContent(template) {
1919
+ const context = () => {
1920
+ return typeof this.content === 'string' ||
1921
+ typeof this.content === 'number'
1922
+ ? this.content
1923
+ : this.content?.(this.props);
1924
+ };
1925
+ const ref = this.viewContainerRef.createEmbeddedView(this.templateRef, {
1926
+ get $implicit() {
1927
+ return context();
1928
+ },
1929
+ });
1930
+ return new FlexRenderTemplateView(template, ref);
1931
+ }
1932
+ #renderTemplateRefContent(template) {
1933
+ const latestContext = () => this.props;
1934
+ const view = this.viewContainerRef.createEmbeddedView(template.content, {
1935
+ get $implicit() {
1936
+ return latestContext();
1937
+ },
1938
+ });
1939
+ return new FlexRenderTemplateView(template, view);
1940
+ }
1941
+ #renderComponent(flexRenderComponent) {
1942
+ const { inputs, outputs, injector } = flexRenderComponent.content;
1943
+ const getContext = () => this.props;
1944
+ const proxy = new Proxy(this.props, {
1945
+ get: (_, key) => getContext()[key],
1946
+ });
1947
+ const componentInjector = Injector.create({
1948
+ parent: injector ?? this.injector,
1949
+ providers: [{ provide: FlexRenderComponentProps, useValue: proxy }],
1950
+ });
1951
+ const view = this.#flexRenderComponentFactory.createComponent(flexRenderComponent.content, componentInjector);
1952
+ return new FlexRenderComponentView(flexRenderComponent, view);
1953
+ }
1954
+ #renderCustomComponent(component) {
1955
+ const view = this.#flexRenderComponentFactory.createComponent(flexRenderComponent(component.content, {
1956
+ inputs: this.props,
1957
+ injector: this.injector,
1958
+ }), this.injector);
1959
+ return new FlexRenderComponentView(component, view);
1960
+ }
1961
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FlexRenderDirective, deps: [{ token: ViewContainerRef }, { token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1962
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: FlexRenderDirective, isStandalone: true, selector: "[flexRender]", inputs: { content: ["flexRender", "content"], props: ["flexRenderProps", "props"], injector: ["flexRenderInjector", "injector"] }, providers: [FlexRenderComponentFactory], usesOnChanges: true, ngImport: i0 }); }
1963
+ }
1964
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FlexRenderDirective, decorators: [{
1965
+ type: Directive,
1966
+ args: [{
1967
+ selector: '[flexRender]',
1968
+ standalone: true,
1969
+ providers: [FlexRenderComponentFactory],
1970
+ }]
1971
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef, decorators: [{
1972
+ type: Inject,
1973
+ args: [ViewContainerRef]
1974
+ }] }, { type: i0.TemplateRef, decorators: [{
1975
+ type: Inject,
1976
+ args: [TemplateRef]
1977
+ }] }], propDecorators: { content: [{
1978
+ type: Input,
1979
+ args: [{ required: true, alias: 'flexRender' }]
1980
+ }], props: [{
1981
+ type: Input,
1982
+ args: [{ required: true, alias: 'flexRenderProps' }]
1983
+ }], injector: [{
1984
+ type: Input,
1985
+ args: [{ required: false, alias: 'flexRenderInjector' }]
1986
+ }] } });
1987
+
1988
+ function createAngularTable(options) {
1989
+ return lazyInit(() => {
1990
+ const resolvedOptions = {
1991
+ state: {},
1992
+ onStateChange: () => { },
1993
+ renderFallbackValue: null,
1994
+ ...options(),
1995
+ };
1996
+ const table = createTable(resolvedOptions);
1997
+ // By default, manage table state here using the table's initial state
1998
+ const state = signal(table.initialState);
1999
+ // Compose table options using computed.
2000
+ // This is to allow `tableSignal` to listen and set table option
2001
+ const updatedOptions = computed(() => {
2002
+ // listen to table state changed
2003
+ const tableState = state();
2004
+ // listen to input options changed
2005
+ const tableOptions = options();
2006
+ return {
2007
+ ...table.options,
2008
+ ...resolvedOptions,
2009
+ ...tableOptions,
2010
+ state: { ...tableState, ...tableOptions.state },
2011
+ onStateChange: updater => {
2012
+ const value = updater instanceof Function ? updater(tableState) : updater;
2013
+ state.set(value);
2014
+ resolvedOptions.onStateChange?.(updater);
2015
+ },
2016
+ };
2017
+ });
2018
+ // convert table instance to signal for proxify to listen to any table state and options changes
2019
+ const tableSignal = computed(() => {
2020
+ table.setOptions(updatedOptions());
2021
+ return table;
2022
+ }, {
2023
+ equal: () => false,
2024
+ });
2025
+ // proxify Table instance to provide ability for consumer to listen to any table state changes
2026
+ return proxifyTable(tableSignal);
2027
+ });
2028
+ }
2029
+
2030
+ /* eslint-disable jsdoc/require-jsdoc */
2031
+ /* eslint-disable jsdoc/require-returns */
2032
+ /**
2033
+ * Nova Datatable built on TanStack Table (Angular).
2034
+ */
2035
+ class NvDatatable {
2036
+ constructor() {
2037
+ /** Column definitions */
2038
+ this.columns = input([]);
2039
+ /** Row data */
2040
+ this.rows = input([]);
2041
+ /** Computed table columns with proper typing and filtering. */
2042
+ this.tableColumns = computed(() => this.columns()
2043
+ .filter((col) => !col.hidden)
2044
+ .map((col) => ({
2045
+ accessorKey: col.field,
2046
+ header: col.headerName || String(col.field),
2047
+ size: col.width,
2048
+ enableResizing: col.resizable ?? true,
2049
+ cell: col.renderCell ??
2050
+ ((context) => context.getValue()),
2051
+ })));
2052
+ /** TanStack table instance with Signals */
2053
+ this.tableInstance = createAngularTable(() => ({
2054
+ data: this.rows(),
2055
+ columns: this.tableColumns(),
2056
+ getCoreRowModel: getCoreRowModel(),
2057
+ }));
2058
+ }
2059
+ /** Public getter for table instance. */
2060
+ table() {
2061
+ return this.tableInstance();
2062
+ }
2063
+ 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: `
2065
+ <nv-table>
2066
+ <table>
2067
+ <thead>
2068
+ @for (headerGroup of table().getHeaderGroups(); track headerGroup.id)
2069
+ {
2070
+ <tr>
2071
+ @for (header of headerGroup.headers; track header.id) {
2072
+ <th
2073
+ [attr.data-testid]="'datatable-header-' + header.id"
2074
+ [style.width]="
2075
+ header.column.columnDef.size
2076
+ ? header.column.columnDef.size + 'px'
2077
+ : null
2078
+ "
2079
+ [attr.data-no-resize]="
2080
+ !header.column.columnDef.enableResizing ? 'true' : null
2081
+ "
2082
+ >
2083
+ @if (!header.isPlaceholder) {
2084
+ {{ header.column.columnDef.header }}
2085
+ }
2086
+ </th>
2087
+ }
2088
+ </tr>
2089
+ }
2090
+ </thead>
2091
+
2092
+ <tbody>
2093
+ @for (row of table().getRowModel().rows; track row.id) {
2094
+ <tr [attr.data-testid]="'datatable-row-' + row.id">
2095
+ @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 -->
2101
+ <ng-container
2102
+ *flexRender="
2103
+ cell.column.columnDef.cell;
2104
+ props: cell.getContext();
2105
+ let cellContent
2106
+ "
2107
+ >
2108
+ {{ cellContent }}
2109
+ </ng-container>
2110
+ </td>
2111
+ }
2112
+ </tr>
2113
+ }
2114
+ </tbody>
2115
+ </table>
2116
+ </nv-table>
2117
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: FlexRenderDirective, selector: "[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }] }); }
2118
+ }
2119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvDatatable, decorators: [{
2120
+ type: Component,
2121
+ args: [{
2122
+ selector: 'nv-datatable',
2123
+ standalone: true,
2124
+ imports: [CommonModule, FlexRenderDirective],
2125
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
2126
+ template: `
2127
+ <nv-table>
2128
+ <table>
2129
+ <thead>
2130
+ @for (headerGroup of table().getHeaderGroups(); track headerGroup.id)
2131
+ {
2132
+ <tr>
2133
+ @for (header of headerGroup.headers; track header.id) {
2134
+ <th
2135
+ [attr.data-testid]="'datatable-header-' + header.id"
2136
+ [style.width]="
2137
+ header.column.columnDef.size
2138
+ ? header.column.columnDef.size + 'px'
2139
+ : null
2140
+ "
2141
+ [attr.data-no-resize]="
2142
+ !header.column.columnDef.enableResizing ? 'true' : null
2143
+ "
2144
+ >
2145
+ @if (!header.isPlaceholder) {
2146
+ {{ header.column.columnDef.header }}
2147
+ }
2148
+ </th>
2149
+ }
2150
+ </tr>
2151
+ }
2152
+ </thead>
2153
+
2154
+ <tbody>
2155
+ @for (row of table().getRowModel().rows; track row.id) {
2156
+ <tr [attr.data-testid]="'datatable-row-' + row.id">
2157
+ @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 -->
2163
+ <ng-container
2164
+ *flexRender="
2165
+ cell.column.columnDef.cell;
2166
+ props: cell.getContext();
2167
+ let cellContent
2168
+ "
2169
+ >
2170
+ {{ cellContent }}
2171
+ </ng-container>
2172
+ </td>
2173
+ }
2174
+ </tr>
2175
+ }
2176
+ </tbody>
2177
+ </table>
2178
+ </nv-table>
2179
+ `,
2180
+ }]
2181
+ }] });
2182
+
1305
2183
  class ValueAccessor {
1306
2184
  constructor(el) {
1307
2185
  this.el = el;
@@ -1341,6 +2219,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
1341
2219
  args: ['focusout']
1342
2220
  }] } });
1343
2221
 
2222
+ class NvAccordionValueAccessor extends ValueAccessor {
2223
+ constructor(el) {
2224
+ super(el);
2225
+ }
2226
+ handleOpenIndexesChanged(event) {
2227
+ this.handleChangeEvent(event.target.openIndexes);
2228
+ }
2229
+ writeValue(value) {
2230
+ this.el.nativeElement.openIndexes = this.lastValue = value;
2231
+ }
2232
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvAccordionValueAccessor, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2233
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: NvAccordionValueAccessor, isStandalone: true, selector: "nv-accordion", host: { listeners: { "openIndexesChanged": "handleOpenIndexesChanged($event)" } }, providers: [
2234
+ {
2235
+ provide: NG_VALUE_ACCESSOR,
2236
+ useExisting: NvAccordionValueAccessor,
2237
+ multi: true,
2238
+ },
2239
+ ], usesInheritance: true, ngImport: i0 }); }
2240
+ }
2241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NvAccordionValueAccessor, decorators: [{
2242
+ type: Directive,
2243
+ args: [{
2244
+ selector: 'nv-accordion',
2245
+ providers: [
2246
+ {
2247
+ provide: NG_VALUE_ACCESSOR,
2248
+ useExisting: NvAccordionValueAccessor,
2249
+ multi: true,
2250
+ },
2251
+ ],
2252
+ }]
2253
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { handleOpenIndexesChanged: [{
2254
+ type: HostListener,
2255
+ args: ['openIndexesChanged', ['$event']]
2256
+ }] } });
1344
2257
  class NvAlertValueAccessor extends ValueAccessor {
1345
2258
  constructor(el) {
1346
2259
  super(el);
@@ -2042,6 +2955,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
2042
2955
  args: ['valueChanged', ['$event']]
2043
2956
  }] } });
2044
2957
  const VALUE_ACCESSORS = [
2958
+ NvAccordionValueAccessor,
2045
2959
  NvAlertValueAccessor,
2046
2960
  NvCalendarValueAccessor,
2047
2961
  NvDatagridValueAccessor,
@@ -2066,19 +2980,20 @@ const VALUE_ACCESSORS = [
2066
2980
 
2067
2981
  class NovaComponentsModule {
2068
2982
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2069
- 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, NvPopover, NvRow, NvStack, NvTable, NvTablecolumn, NvToggle, NvTogglebutton, NvTogglebuttongroup, NvTooltip], 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, NvPopover, NvRow, NvStack, NvTable, NvTablecolumn, NvToggle, NvTogglebutton, NvTogglebuttongroup, NvTooltip] }); }
2070
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule }); }
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] }); }
2984
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule, imports: [NvDatatable] }); }
2071
2985
  }
2072
2986
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsModule, decorators: [{
2073
2987
  type: NgModule,
2074
2988
  args: [{
2989
+ imports: [NvDatatable],
2075
2990
  declarations: [...DIRECTIVES],
2076
- exports: [...DIRECTIVES],
2991
+ exports: [...DIRECTIVES, NvDatatable],
2077
2992
  }]
2078
2993
  }] });
2079
2994
  class NovaComponentsValueAccessorModule {
2080
2995
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2081
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule, imports: [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] }); }
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] }); }
2082
2997
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule }); }
2083
2998
  }
2084
2999
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NovaComponentsValueAccessorModule, decorators: [{
@@ -2089,6 +3004,315 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
2089
3004
  }]
2090
3005
  }] });
2091
3006
 
3007
+ /**
3008
+ * Utility function to generate unique IDs.
3009
+ *
3010
+ * @returns {string} A unique identifier string
3011
+ */
3012
+ const generateId = () => {
3013
+ return `notification-${Date.now()}-${Math.random()
3014
+ .toString(36)
3015
+ .substr(2, 9)}`;
3016
+ };
3017
+ /**
3018
+ * Angular service for managing notifications.
3019
+ */
3020
+ class NotificationService {
3021
+ /**
3022
+ * Current array of notifications.
3023
+ *
3024
+ * @returns {Notification[]} Array of active notifications
3025
+ */
3026
+ get notifications() {
3027
+ return this._notifications.value;
3028
+ }
3029
+ constructor() {
3030
+ this._notifications = new BehaviorSubject([]);
3031
+ /**
3032
+ * Observable stream of active notifications.
3033
+ */
3034
+ this.notifications$ = this._notifications.asObservable();
3035
+ // keep track of all notification refs
3036
+ this.elRefs = new Map();
3037
+ this._config = {
3038
+ position: 'top-right',
3039
+ maxNotifications: 50,
3040
+ className: '',
3041
+ };
3042
+ }
3043
+ /**
3044
+ * Configure the notification service.
3045
+ *
3046
+ * @param {NotificationServiceConfig} config Configuration options
3047
+ */
3048
+ configure(config) {
3049
+ Object.assign(this._config, config);
3050
+ }
3051
+ /**
3052
+ * Get the current configuration.
3053
+ *
3054
+ * @returns {Required<NotificationServiceConfig>} Current configuration
3055
+ */
3056
+ get config() {
3057
+ return { ...this._config };
3058
+ }
3059
+ registerRef(id, el) {
3060
+ this.elRefs.set(id, el);
3061
+ }
3062
+ unregisterRef(id) {
3063
+ this.elRefs.delete(id);
3064
+ }
3065
+ clearRefs() {
3066
+ this.elRefs.clear();
3067
+ }
3068
+ /**
3069
+ * Show a new notification.
3070
+ *
3071
+ * @param {NotificationOptions} options The notification options
3072
+ * @returns {string} The notification ID
3073
+ */
3074
+ show(options) {
3075
+ const id = options.id || generateId();
3076
+ const notification = {
3077
+ id,
3078
+ heading: options.heading,
3079
+ message: options.message,
3080
+ dismissible: options.dismissible ?? true,
3081
+ emphasis: options.emphasis ?? 'medium',
3082
+ feedback: options.feedback ?? 'information',
3083
+ icon: options.icon,
3084
+ actions: options.actions ?? [],
3085
+ actionSlot: options.actionSlot,
3086
+ createdAt: Date.now(),
3087
+ };
3088
+ const currentNotifications = this._notifications.value;
3089
+ // Remove oldest notifications if we exceed max
3090
+ const newNotifications = [notification, ...currentNotifications];
3091
+ if (newNotifications.length > this._config.maxNotifications) {
3092
+ this._notifications.next(newNotifications.slice(0, this._config.maxNotifications));
3093
+ }
3094
+ else {
3095
+ this._notifications.next(newNotifications);
3096
+ }
3097
+ setTimeout(() => {
3098
+ const ref = this.elRefs.get(id);
3099
+ ref?.show();
3100
+ }, 0);
3101
+ return id;
3102
+ }
3103
+ /**
3104
+ * Dismiss a specific notification by ID. This will remove the notification
3105
+ * after the animation completes.
3106
+ *
3107
+ * @param {string} id The notification ID to dismiss
3108
+ */
3109
+ dismiss(id) {
3110
+ this.elRefs.get(id)?.dismiss?.();
3111
+ }
3112
+ /**
3113
+ * Immediately remove a specific notification by ID.
3114
+ *
3115
+ * @param {string} id The notification ID to dismiss
3116
+ */
3117
+ remove(id) {
3118
+ const currentNotifications = this._notifications.value;
3119
+ const filteredNotifications = currentNotifications.filter((notification) => notification.id !== id);
3120
+ this._notifications.next(filteredNotifications);
3121
+ }
3122
+ /**
3123
+ * Immediately remove all active notifications.
3124
+ */
3125
+ removeAll() {
3126
+ this._notifications.next([]);
3127
+ }
3128
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3129
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NotificationService, providedIn: 'root' }); }
3130
+ }
3131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NotificationService, decorators: [{
3132
+ type: Injectable,
3133
+ args: [{
3134
+ providedIn: 'root',
3135
+ }]
3136
+ }], ctorParameters: () => [] });
3137
+
3138
+ /**
3139
+ * Angular component that renders the notification container with active notifications.
3140
+ */
3141
+ class NotificationServiceComponent {
3142
+ constructor(notificationService) {
3143
+ this.notificationService = notificationService;
3144
+ /**
3145
+ * Array of active notifications.
3146
+ */
3147
+ this.notifications = [];
3148
+ }
3149
+ /**
3150
+ * Component initialization.
3151
+ */
3152
+ ngOnInit() {
3153
+ // Use service config if no input provided
3154
+ this.position ??= this.notificationService.config.position;
3155
+ this.className ??= this.notificationService.config.className;
3156
+ // Subscribe to notification changes
3157
+ this.subscription = this.notificationService.notifications$.subscribe((list) => (this.notifications = list));
3158
+ }
3159
+ /**
3160
+ * Synchronize notification elements/refs with the service.
3161
+ */
3162
+ ngAfterViewInit() {
3163
+ const sync = () => {
3164
+ this.notificationService.clearRefs();
3165
+ for (const elRef of this.notificationEls.toArray()) {
3166
+ const el = elRef.nativeElement;
3167
+ const id = el.getAttribute('data-id');
3168
+ if (id)
3169
+ this.notificationService.registerRef(id, el);
3170
+ }
3171
+ };
3172
+ sync();
3173
+ this.notificationEls.changes.subscribe(sync);
3174
+ }
3175
+ /**
3176
+ * Component cleanup.
3177
+ */
3178
+ ngOnDestroy() {
3179
+ this.subscription?.unsubscribe();
3180
+ this.notificationService.clearRefs();
3181
+ }
3182
+ /**
3183
+ * Track function for ngFor to optimize rendering.
3184
+ *
3185
+ * @param {number} index The index of the item
3186
+ * @param {Notification} notification The notification item
3187
+ * @returns {string} The notification ID
3188
+ */
3189
+ trackByNotificationId(index, notification) {
3190
+ return notification.id;
3191
+ }
3192
+ /**
3193
+ * Handle notification hidden state change.
3194
+ *
3195
+ * @param {CustomEvent<boolean>} event The hidden changed event
3196
+ * @param {string} id The notification ID
3197
+ */
3198
+ handleHiddenChanged(event, id) {
3199
+ if (event.detail && id) {
3200
+ this.notificationService.remove(id);
3201
+ }
3202
+ }
3203
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NotificationServiceComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component }); }
3204
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NotificationServiceComponent, isStandalone: true, selector: "nv-notification-service", inputs: { position: "position", className: "className" }, viewQueries: [{ propertyName: "notificationEls", predicate: ["notificationEl"], descendants: true, read: ElementRef }], ngImport: i0, template: `
3205
+ <nv-notificationcontainer
3206
+ [position]="position"
3207
+ [class]="className"
3208
+ data-testid="notification-container"
3209
+ >
3210
+ <nv-notification
3211
+ *ngFor="
3212
+ let notification of notifications;
3213
+ trackBy: trackByNotificationId
3214
+ "
3215
+ #notificationEl
3216
+ [attr.data-id]="notification.id"
3217
+ [heading]="notification.heading"
3218
+ [message]="notification.message"
3219
+ [dismissible]="notification.dismissible"
3220
+ [emphasis]="notification.emphasis"
3221
+ [feedback]="notification.feedback"
3222
+ [icon]="notification.icon"
3223
+ [initiallyHidden]="true"
3224
+ (hiddenChanged)="handleHiddenChanged($event, notification.id)"
3225
+ >
3226
+ <!-- Actions slot content for the custom element -->
3227
+ <div
3228
+ slot="actions"
3229
+ class="flex gap-2"
3230
+ *ngIf="notification.actions?.length || notification.actionSlot"
3231
+ >
3232
+ <!-- Config-driven actions -->
3233
+ <nv-button
3234
+ *ngFor="let action of notification.actions"
3235
+ emphasis="low"
3236
+ size="sm"
3237
+ (click)="action.onClick()"
3238
+ >
3239
+ {{ action.label }}
3240
+ </nv-button>
3241
+
3242
+ <!-- Component-driven actions -->
3243
+ <ng-container
3244
+ *ngIf="notification.actionSlot"
3245
+ [ngComponentOutlet]="notification.actionSlot"
3246
+ ></ng-container>
3247
+ </div>
3248
+ </nv-notification>
3249
+ </nv-notificationcontainer>
3250
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
3251
+ }
3252
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NotificationServiceComponent, decorators: [{
3253
+ type: Component,
3254
+ args: [{
3255
+ selector: 'nv-notification-service',
3256
+ standalone: true,
3257
+ imports: [CommonModule],
3258
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
3259
+ template: `
3260
+ <nv-notificationcontainer
3261
+ [position]="position"
3262
+ [class]="className"
3263
+ data-testid="notification-container"
3264
+ >
3265
+ <nv-notification
3266
+ *ngFor="
3267
+ let notification of notifications;
3268
+ trackBy: trackByNotificationId
3269
+ "
3270
+ #notificationEl
3271
+ [attr.data-id]="notification.id"
3272
+ [heading]="notification.heading"
3273
+ [message]="notification.message"
3274
+ [dismissible]="notification.dismissible"
3275
+ [emphasis]="notification.emphasis"
3276
+ [feedback]="notification.feedback"
3277
+ [icon]="notification.icon"
3278
+ [initiallyHidden]="true"
3279
+ (hiddenChanged)="handleHiddenChanged($event, notification.id)"
3280
+ >
3281
+ <!-- Actions slot content for the custom element -->
3282
+ <div
3283
+ slot="actions"
3284
+ class="flex gap-2"
3285
+ *ngIf="notification.actions?.length || notification.actionSlot"
3286
+ >
3287
+ <!-- Config-driven actions -->
3288
+ <nv-button
3289
+ *ngFor="let action of notification.actions"
3290
+ emphasis="low"
3291
+ size="sm"
3292
+ (click)="action.onClick()"
3293
+ >
3294
+ {{ action.label }}
3295
+ </nv-button>
3296
+
3297
+ <!-- Component-driven actions -->
3298
+ <ng-container
3299
+ *ngIf="notification.actionSlot"
3300
+ [ngComponentOutlet]="notification.actionSlot"
3301
+ ></ng-container>
3302
+ </div>
3303
+ </nv-notification>
3304
+ </nv-notificationcontainer>
3305
+ `,
3306
+ }]
3307
+ }], ctorParameters: () => [{ type: NotificationService }], propDecorators: { position: [{
3308
+ type: Input
3309
+ }], className: [{
3310
+ type: Input
3311
+ }], notificationEls: [{
3312
+ type: ViewChildren,
3313
+ args: ['notificationEl', { read: ElementRef }]
3314
+ }] } });
3315
+
2092
3316
  /*
2093
3317
  * Public API Surface of nova-components
2094
3318
  */
@@ -2097,5 +3321,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
2097
3321
  * Generated bundle index. Do not edit.
2098
3322
  */
2099
3323
 
2100
- export { 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, NvPopover, NvPopoverValueAccessor, NvRow, NvStack, NvTable, NvTablecolumn, NvToggle, NvToggleValueAccessor, NvTogglebutton, NvTogglebuttongroup, NvTogglebuttongroupValueAccessor, NvTooltip, VALUE_ACCESSORS };
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 };
2101
3325
  //# sourceMappingURL=nova-components.mjs.map