@nova-design-system/nova-angular 3.13.0 → 3.14.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nova-components/esm2022/lib/nova-components.module.mjs +15 -2
- package/dist/nova-components/esm2022/lib/providers/index.mjs +3 -0
- package/dist/nova-components/esm2022/lib/providers/notification-service.component.mjs +183 -0
- package/dist/nova-components/esm2022/lib/providers/notification.service.mjs +134 -0
- package/dist/nova-components/esm2022/lib/stencil-generated/components.mjs +31 -5
- package/dist/nova-components/esm2022/lib/stencil-generated/index.mjs +2 -1
- package/dist/nova-components/esm2022/public-api.mjs +2 -1
- package/dist/nova-components/fesm2022/nova-components.mjs +357 -8
- package/dist/nova-components/fesm2022/nova-components.mjs.map +1 -1
- package/dist/nova-components/lib/nova-components.module.d.ts +7 -1
- package/dist/nova-components/lib/providers/index.d.ts +2 -0
- package/dist/nova-components/lib/providers/notification-service.component.d.ts +56 -0
- package/dist/nova-components/lib/providers/notification.service.d.ts +116 -0
- package/dist/nova-components/lib/stencil-generated/components.d.ts +10 -1
- 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 +1 -1
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
export * from './lib/nova-components.module';
|
|
5
5
|
export * from './lib/stencil-generated/components';
|
|
6
6
|
export * from './lib/stencil-generated/component-value-accessors';
|
|
7
|
+
export * from './lib/providers';
|
|
7
8
|
export * from '@nova-design-system/nova-webcomponents/constants';
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25vdmEtY29tcG9uZW50cy9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsOEJBQThCLENBQUM7QUFDN0MsY0FBYyxvQ0FBb0MsQ0FBQztBQUNuRCxjQUFjLG1EQUFtRCxDQUFDO0FBQ2xFLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxrREFBa0QsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygbm92YS1jb21wb25lbnRzXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9saWIvbm92YS1jb21wb25lbnRzLm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdGVuY2lsLWdlbmVyYXRlZC9jb21wb25lbnRzJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3N0ZW5jaWwtZ2VuZXJhdGVkL2NvbXBvbmVudC12YWx1ZS1hY2Nlc3NvcnMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvcHJvdmlkZXJzJztcbmV4cG9ydCAqIGZyb20gJ0Bub3ZhLWRlc2lnbi1zeXN0ZW0vbm92YS13ZWJjb21wb25lbnRzL2NvbnN0YW50cyc7XG4iXX0=
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, Directive, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Directive, HostListener, Injectable, ElementRef, CUSTOM_ELEMENTS_SCHEMA, Input, ViewChildren, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
3
3
|
import { defineCustomElements } from '@nova-design-system/nova-webcomponents/loader';
|
|
4
4
|
import { __decorate } from 'tslib';
|
|
5
|
-
import { fromEvent } from 'rxjs';
|
|
5
|
+
import { fromEvent, BehaviorSubject } from 'rxjs';
|
|
6
6
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
|
+
import * as i2 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
7
9
|
export * from '@nova-design-system/nova-webcomponents/constants';
|
|
8
10
|
|
|
9
11
|
/* eslint-disable */
|
|
@@ -1004,12 +1006,12 @@ let NvNotification = class NvNotification {
|
|
|
1004
1006
|
proxyOutputs(this, this.el, ['hiddenChanged']);
|
|
1005
1007
|
}
|
|
1006
1008
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NvNotification, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1007
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.9", type: NvNotification, 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: "17.3.9", type: NvNotification, 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 }); }
|
|
1008
1010
|
};
|
|
1009
1011
|
NvNotification = __decorate([
|
|
1010
1012
|
ProxyCmp({
|
|
1011
|
-
inputs: ['dismissible', 'emphasis', 'feedback', 'heading', 'hidden', 'icon', 'message', 'uid'],
|
|
1012
|
-
methods: ['dismiss']
|
|
1013
|
+
inputs: ['dismissible', 'emphasis', 'feedback', 'heading', 'hidden', 'icon', 'initiallyHidden', 'message', 'uid'],
|
|
1014
|
+
methods: ['dismiss', 'show']
|
|
1013
1015
|
})
|
|
1014
1016
|
], NvNotification);
|
|
1015
1017
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NvNotification, decorators: [{
|
|
@@ -1019,7 +1021,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImpor
|
|
|
1019
1021
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1020
1022
|
template: '<ng-content></ng-content>',
|
|
1021
1023
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
1022
|
-
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: "17.3.9", 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: "17.3.9", type: NvNotificationcontainer, 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: "17.3.9", 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'],
|
|
1023
1050
|
standalone: false
|
|
1024
1051
|
}]
|
|
1025
1052
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
@@ -1292,6 +1319,7 @@ const DIRECTIVES = [
|
|
|
1292
1319
|
NvMenu,
|
|
1293
1320
|
NvMenuitem,
|
|
1294
1321
|
NvNotification,
|
|
1322
|
+
NvNotificationcontainer,
|
|
1295
1323
|
NvPopover,
|
|
1296
1324
|
NvRow,
|
|
1297
1325
|
NvStack,
|
|
@@ -2065,6 +2093,315 @@ const VALUE_ACCESSORS = [
|
|
|
2065
2093
|
NvTogglebuttongroupValueAccessor,
|
|
2066
2094
|
];
|
|
2067
2095
|
|
|
2096
|
+
/**
|
|
2097
|
+
* Utility function to generate unique IDs.
|
|
2098
|
+
*
|
|
2099
|
+
* @returns {string} A unique identifier string
|
|
2100
|
+
*/
|
|
2101
|
+
const generateId = () => {
|
|
2102
|
+
return `notification-${Date.now()}-${Math.random()
|
|
2103
|
+
.toString(36)
|
|
2104
|
+
.substr(2, 9)}`;
|
|
2105
|
+
};
|
|
2106
|
+
/**
|
|
2107
|
+
* Angular service for managing notifications.
|
|
2108
|
+
*/
|
|
2109
|
+
class NotificationService {
|
|
2110
|
+
/**
|
|
2111
|
+
* Current array of notifications.
|
|
2112
|
+
*
|
|
2113
|
+
* @returns {Notification[]} Array of active notifications
|
|
2114
|
+
*/
|
|
2115
|
+
get notifications() {
|
|
2116
|
+
return this._notifications.value;
|
|
2117
|
+
}
|
|
2118
|
+
constructor() {
|
|
2119
|
+
this._notifications = new BehaviorSubject([]);
|
|
2120
|
+
/**
|
|
2121
|
+
* Observable stream of active notifications.
|
|
2122
|
+
*/
|
|
2123
|
+
this.notifications$ = this._notifications.asObservable();
|
|
2124
|
+
// keep track of all notification refs
|
|
2125
|
+
this.elRefs = new Map();
|
|
2126
|
+
this._config = {
|
|
2127
|
+
position: 'top-right',
|
|
2128
|
+
maxNotifications: 50,
|
|
2129
|
+
className: '',
|
|
2130
|
+
};
|
|
2131
|
+
}
|
|
2132
|
+
/**
|
|
2133
|
+
* Configure the notification service.
|
|
2134
|
+
*
|
|
2135
|
+
* @param {NotificationServiceConfig} config Configuration options
|
|
2136
|
+
*/
|
|
2137
|
+
configure(config) {
|
|
2138
|
+
Object.assign(this._config, config);
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* Get the current configuration.
|
|
2142
|
+
*
|
|
2143
|
+
* @returns {Required<NotificationServiceConfig>} Current configuration
|
|
2144
|
+
*/
|
|
2145
|
+
get config() {
|
|
2146
|
+
return { ...this._config };
|
|
2147
|
+
}
|
|
2148
|
+
registerRef(id, el) {
|
|
2149
|
+
this.elRefs.set(id, el);
|
|
2150
|
+
}
|
|
2151
|
+
unregisterRef(id) {
|
|
2152
|
+
this.elRefs.delete(id);
|
|
2153
|
+
}
|
|
2154
|
+
clearRefs() {
|
|
2155
|
+
this.elRefs.clear();
|
|
2156
|
+
}
|
|
2157
|
+
/**
|
|
2158
|
+
* Show a new notification.
|
|
2159
|
+
*
|
|
2160
|
+
* @param {NotificationOptions} options The notification options
|
|
2161
|
+
* @returns {string} The notification ID
|
|
2162
|
+
*/
|
|
2163
|
+
show(options) {
|
|
2164
|
+
const id = options.id || generateId();
|
|
2165
|
+
const notification = {
|
|
2166
|
+
id,
|
|
2167
|
+
heading: options.heading,
|
|
2168
|
+
message: options.message,
|
|
2169
|
+
dismissible: options.dismissible ?? true,
|
|
2170
|
+
emphasis: options.emphasis ?? 'medium',
|
|
2171
|
+
feedback: options.feedback ?? 'information',
|
|
2172
|
+
icon: options.icon,
|
|
2173
|
+
actions: options.actions ?? [],
|
|
2174
|
+
actionSlot: options.actionSlot,
|
|
2175
|
+
createdAt: Date.now(),
|
|
2176
|
+
};
|
|
2177
|
+
const currentNotifications = this._notifications.value;
|
|
2178
|
+
// Remove oldest notifications if we exceed max
|
|
2179
|
+
const newNotifications = [notification, ...currentNotifications];
|
|
2180
|
+
if (newNotifications.length > this._config.maxNotifications) {
|
|
2181
|
+
this._notifications.next(newNotifications.slice(0, this._config.maxNotifications));
|
|
2182
|
+
}
|
|
2183
|
+
else {
|
|
2184
|
+
this._notifications.next(newNotifications);
|
|
2185
|
+
}
|
|
2186
|
+
setTimeout(() => {
|
|
2187
|
+
const ref = this.elRefs.get(id);
|
|
2188
|
+
ref?.show();
|
|
2189
|
+
}, 0);
|
|
2190
|
+
return id;
|
|
2191
|
+
}
|
|
2192
|
+
/**
|
|
2193
|
+
* Dismiss a specific notification by ID. This will remove the notification
|
|
2194
|
+
* after the animation completes.
|
|
2195
|
+
*
|
|
2196
|
+
* @param {string} id The notification ID to dismiss
|
|
2197
|
+
*/
|
|
2198
|
+
dismiss(id) {
|
|
2199
|
+
this.elRefs.get(id)?.dismiss?.();
|
|
2200
|
+
}
|
|
2201
|
+
/**
|
|
2202
|
+
* Immediately remove a specific notification by ID.
|
|
2203
|
+
*
|
|
2204
|
+
* @param {string} id The notification ID to dismiss
|
|
2205
|
+
*/
|
|
2206
|
+
remove(id) {
|
|
2207
|
+
const currentNotifications = this._notifications.value;
|
|
2208
|
+
const filteredNotifications = currentNotifications.filter((notification) => notification.id !== id);
|
|
2209
|
+
this._notifications.next(filteredNotifications);
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* Immediately remove all active notifications.
|
|
2213
|
+
*/
|
|
2214
|
+
removeAll() {
|
|
2215
|
+
this._notifications.next([]);
|
|
2216
|
+
}
|
|
2217
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2218
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NotificationService, providedIn: 'root' }); }
|
|
2219
|
+
}
|
|
2220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NotificationService, decorators: [{
|
|
2221
|
+
type: Injectable,
|
|
2222
|
+
args: [{
|
|
2223
|
+
providedIn: 'root',
|
|
2224
|
+
}]
|
|
2225
|
+
}], ctorParameters: () => [] });
|
|
2226
|
+
|
|
2227
|
+
/**
|
|
2228
|
+
* Angular component that renders the notification container with active notifications.
|
|
2229
|
+
*/
|
|
2230
|
+
class NotificationServiceComponent {
|
|
2231
|
+
constructor(notificationService) {
|
|
2232
|
+
this.notificationService = notificationService;
|
|
2233
|
+
/**
|
|
2234
|
+
* Array of active notifications.
|
|
2235
|
+
*/
|
|
2236
|
+
this.notifications = [];
|
|
2237
|
+
}
|
|
2238
|
+
/**
|
|
2239
|
+
* Component initialization.
|
|
2240
|
+
*/
|
|
2241
|
+
ngOnInit() {
|
|
2242
|
+
// Use service config if no input provided
|
|
2243
|
+
this.position ??= this.notificationService.config.position;
|
|
2244
|
+
this.className ??= this.notificationService.config.className;
|
|
2245
|
+
// Subscribe to notification changes
|
|
2246
|
+
this.subscription = this.notificationService.notifications$.subscribe((list) => (this.notifications = list));
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* Synchronize notification elements/refs with the service.
|
|
2250
|
+
*/
|
|
2251
|
+
ngAfterViewInit() {
|
|
2252
|
+
const sync = () => {
|
|
2253
|
+
this.notificationService.clearRefs();
|
|
2254
|
+
for (const elRef of this.notificationEls.toArray()) {
|
|
2255
|
+
const el = elRef.nativeElement;
|
|
2256
|
+
const id = el.getAttribute('data-id');
|
|
2257
|
+
if (id)
|
|
2258
|
+
this.notificationService.registerRef(id, el);
|
|
2259
|
+
}
|
|
2260
|
+
};
|
|
2261
|
+
sync();
|
|
2262
|
+
this.notificationEls.changes.subscribe(sync);
|
|
2263
|
+
}
|
|
2264
|
+
/**
|
|
2265
|
+
* Component cleanup.
|
|
2266
|
+
*/
|
|
2267
|
+
ngOnDestroy() {
|
|
2268
|
+
this.subscription?.unsubscribe();
|
|
2269
|
+
this.notificationService.clearRefs();
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* Track function for ngFor to optimize rendering.
|
|
2273
|
+
*
|
|
2274
|
+
* @param {number} index The index of the item
|
|
2275
|
+
* @param {Notification} notification The notification item
|
|
2276
|
+
* @returns {string} The notification ID
|
|
2277
|
+
*/
|
|
2278
|
+
trackByNotificationId(index, notification) {
|
|
2279
|
+
return notification.id;
|
|
2280
|
+
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Handle notification hidden state change.
|
|
2283
|
+
*
|
|
2284
|
+
* @param {CustomEvent<boolean>} event The hidden changed event
|
|
2285
|
+
* @param {string} id The notification ID
|
|
2286
|
+
*/
|
|
2287
|
+
handleHiddenChanged(event, id) {
|
|
2288
|
+
if (event.detail && id) {
|
|
2289
|
+
this.notificationService.remove(id);
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NotificationServiceComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2293
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.9", 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: `
|
|
2294
|
+
<nv-notificationcontainer
|
|
2295
|
+
[position]="position"
|
|
2296
|
+
[class]="className"
|
|
2297
|
+
data-testid="notification-container"
|
|
2298
|
+
>
|
|
2299
|
+
<nv-notification
|
|
2300
|
+
*ngFor="
|
|
2301
|
+
let notification of notifications;
|
|
2302
|
+
trackBy: trackByNotificationId
|
|
2303
|
+
"
|
|
2304
|
+
#notificationEl
|
|
2305
|
+
[attr.data-id]="notification.id"
|
|
2306
|
+
[heading]="notification.heading"
|
|
2307
|
+
[message]="notification.message"
|
|
2308
|
+
[dismissible]="notification.dismissible"
|
|
2309
|
+
[emphasis]="notification.emphasis"
|
|
2310
|
+
[feedback]="notification.feedback"
|
|
2311
|
+
[icon]="notification.icon"
|
|
2312
|
+
[initiallyHidden]="true"
|
|
2313
|
+
(hiddenChanged)="handleHiddenChanged($event, notification.id)"
|
|
2314
|
+
>
|
|
2315
|
+
<!-- Actions slot content for the custom element -->
|
|
2316
|
+
<div
|
|
2317
|
+
slot="actions"
|
|
2318
|
+
class="flex gap-2"
|
|
2319
|
+
*ngIf="notification.actions?.length || notification.actionSlot"
|
|
2320
|
+
>
|
|
2321
|
+
<!-- Config-driven actions -->
|
|
2322
|
+
<nv-button
|
|
2323
|
+
*ngFor="let action of notification.actions"
|
|
2324
|
+
emphasis="low"
|
|
2325
|
+
size="sm"
|
|
2326
|
+
(click)="action.onClick()"
|
|
2327
|
+
>
|
|
2328
|
+
{{ action.label }}
|
|
2329
|
+
</nv-button>
|
|
2330
|
+
|
|
2331
|
+
<!-- Component-driven actions -->
|
|
2332
|
+
<ng-container
|
|
2333
|
+
*ngIf="notification.actionSlot"
|
|
2334
|
+
[ngComponentOutlet]="notification.actionSlot"
|
|
2335
|
+
></ng-container>
|
|
2336
|
+
</div>
|
|
2337
|
+
</nv-notification>
|
|
2338
|
+
</nv-notificationcontainer>
|
|
2339
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
2340
|
+
}
|
|
2341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NotificationServiceComponent, decorators: [{
|
|
2342
|
+
type: Component,
|
|
2343
|
+
args: [{
|
|
2344
|
+
selector: 'nv-notification-service',
|
|
2345
|
+
standalone: true,
|
|
2346
|
+
imports: [CommonModule],
|
|
2347
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
2348
|
+
template: `
|
|
2349
|
+
<nv-notificationcontainer
|
|
2350
|
+
[position]="position"
|
|
2351
|
+
[class]="className"
|
|
2352
|
+
data-testid="notification-container"
|
|
2353
|
+
>
|
|
2354
|
+
<nv-notification
|
|
2355
|
+
*ngFor="
|
|
2356
|
+
let notification of notifications;
|
|
2357
|
+
trackBy: trackByNotificationId
|
|
2358
|
+
"
|
|
2359
|
+
#notificationEl
|
|
2360
|
+
[attr.data-id]="notification.id"
|
|
2361
|
+
[heading]="notification.heading"
|
|
2362
|
+
[message]="notification.message"
|
|
2363
|
+
[dismissible]="notification.dismissible"
|
|
2364
|
+
[emphasis]="notification.emphasis"
|
|
2365
|
+
[feedback]="notification.feedback"
|
|
2366
|
+
[icon]="notification.icon"
|
|
2367
|
+
[initiallyHidden]="true"
|
|
2368
|
+
(hiddenChanged)="handleHiddenChanged($event, notification.id)"
|
|
2369
|
+
>
|
|
2370
|
+
<!-- Actions slot content for the custom element -->
|
|
2371
|
+
<div
|
|
2372
|
+
slot="actions"
|
|
2373
|
+
class="flex gap-2"
|
|
2374
|
+
*ngIf="notification.actions?.length || notification.actionSlot"
|
|
2375
|
+
>
|
|
2376
|
+
<!-- Config-driven actions -->
|
|
2377
|
+
<nv-button
|
|
2378
|
+
*ngFor="let action of notification.actions"
|
|
2379
|
+
emphasis="low"
|
|
2380
|
+
size="sm"
|
|
2381
|
+
(click)="action.onClick()"
|
|
2382
|
+
>
|
|
2383
|
+
{{ action.label }}
|
|
2384
|
+
</nv-button>
|
|
2385
|
+
|
|
2386
|
+
<!-- Component-driven actions -->
|
|
2387
|
+
<ng-container
|
|
2388
|
+
*ngIf="notification.actionSlot"
|
|
2389
|
+
[ngComponentOutlet]="notification.actionSlot"
|
|
2390
|
+
></ng-container>
|
|
2391
|
+
</div>
|
|
2392
|
+
</nv-notification>
|
|
2393
|
+
</nv-notificationcontainer>
|
|
2394
|
+
`,
|
|
2395
|
+
}]
|
|
2396
|
+
}], ctorParameters: () => [{ type: NotificationService }], propDecorators: { position: [{
|
|
2397
|
+
type: Input
|
|
2398
|
+
}], className: [{
|
|
2399
|
+
type: Input
|
|
2400
|
+
}], notificationEls: [{
|
|
2401
|
+
type: ViewChildren,
|
|
2402
|
+
args: ['notificationEl', { read: ElementRef }]
|
|
2403
|
+
}] } });
|
|
2404
|
+
|
|
2068
2405
|
/**
|
|
2069
2406
|
* Initialize the Nova Components
|
|
2070
2407
|
*
|
|
@@ -2079,7 +2416,7 @@ function provideNovaComponents() {
|
|
|
2079
2416
|
}
|
|
2080
2417
|
class NovaComponentsModule {
|
|
2081
2418
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NovaComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2082
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.9", 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] }); }
|
|
2419
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.9", 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, 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, NvNotificationcontainer, NvPopover, NvRow, NvStack, NvTable, NvTablecolumn, NvToggle, NvTogglebutton, NvTogglebuttongroup, NvTooltip] }); }
|
|
2083
2420
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NovaComponentsModule }); }
|
|
2084
2421
|
}
|
|
2085
2422
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NovaComponentsModule, decorators: [{
|
|
@@ -2101,6 +2438,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImpor
|
|
|
2101
2438
|
exports: [...VALUE_ACCESSORS],
|
|
2102
2439
|
}]
|
|
2103
2440
|
}] });
|
|
2441
|
+
class NovaComponentsProvidersModule {
|
|
2442
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NovaComponentsProvidersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2443
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.9", ngImport: i0, type: NovaComponentsProvidersModule, imports: [NotificationServiceComponent], exports: [NotificationServiceComponent] }); }
|
|
2444
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NovaComponentsProvidersModule, imports: [NotificationServiceComponent] }); }
|
|
2445
|
+
}
|
|
2446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: NovaComponentsProvidersModule, decorators: [{
|
|
2447
|
+
type: NgModule,
|
|
2448
|
+
args: [{
|
|
2449
|
+
imports: [NotificationServiceComponent],
|
|
2450
|
+
exports: [NotificationServiceComponent],
|
|
2451
|
+
}]
|
|
2452
|
+
}] });
|
|
2104
2453
|
|
|
2105
2454
|
/*
|
|
2106
2455
|
* Public API Surface of nova-components
|
|
@@ -2110,5 +2459,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImpor
|
|
|
2110
2459
|
* Generated bundle index. Do not edit.
|
|
2111
2460
|
*/
|
|
2112
2461
|
|
|
2113
|
-
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, provideNovaComponents };
|
|
2462
|
+
export { NotificationService, NotificationServiceComponent, NovaComponentsModule, NovaComponentsProvidersModule, 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, NvTablecolumn, NvToggle, NvToggleValueAccessor, NvTogglebutton, NvTogglebuttongroup, NvTogglebuttongroupValueAccessor, NvTooltip, VALUE_ACCESSORS, provideNovaComponents };
|
|
2114
2463
|
//# sourceMappingURL=nova-components.mjs.map
|