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