@progress/kendo-angular-notification 3.0.6-dev.202203091018 → 4.0.0-dev.202204131907
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/bundles/kendo-angular-notification.umd.js +5 -0
- package/{dist/es/models/notification-ref.js → esm2015/kendo-angular-notification.js} +4 -0
- package/esm2015/localization/localized-messages.directive.js +38 -0
- package/{dist/es → esm2015}/main.js +2 -0
- package/{dist/es2015 → esm2015}/models/animation.js +1 -0
- package/{dist/es2015 → esm2015}/models/notification-ref.js +1 -0
- package/{dist/es2015 → esm2015}/models/notification-settings.js +0 -0
- package/{dist/es → esm2015}/models/position.js +1 -0
- package/{dist/es2015 → esm2015}/models/type.js +1 -0
- package/{dist/es2015 → esm2015}/notification.component.js +85 -73
- package/{dist/es2015 → esm2015}/notification.container.component.js +25 -27
- package/{dist/es → esm2015}/notification.module.js +16 -16
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/es2015 → esm2015}/services/notification.service.js +14 -12
- package/{dist/es2015 → esm2015}/utils/animations.js +0 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-notification.js} +170 -146
- package/{dist/es/models/animation.js → kendo-angular-notification.d.ts} +5 -0
- package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +1 -0
- package/{dist/es2015/models → models}/animation.d.ts +0 -0
- package/{dist/es2015/models → models}/notification-ref.d.ts +0 -0
- package/{dist/es2015/models → models}/notification-settings.d.ts +0 -0
- package/{dist/es2015/models → models}/position.d.ts +0 -0
- package/{dist/es2015/models → models}/type.d.ts +0 -0
- package/{dist/es2015/notification.component.d.ts → notification.component.d.ts} +5 -2
- package/{dist/es2015/notification.container.component.d.ts → notification.container.component.d.ts} +3 -1
- package/{dist/es2015/notification.module.d.ts → notification.module.d.ts} +8 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +34 -97
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/{dist/es2015/services → services}/notification.service.d.ts +4 -1
- package/{dist/es2015/utils → utils}/animations.d.ts +0 -0
- package/dist/cdn/js/kendo-angular-notification.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/index.js +0 -10
- package/dist/es/localization/localized-messages.directive.js +0 -38
- package/dist/es/models/notification-settings.js +0 -54
- package/dist/es/models/type.js +0 -4
- package/dist/es/notification.component.js +0 -222
- package/dist/es/notification.container.component.js +0 -154
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/services/notification.service.js +0 -135
- package/dist/es/utils/animations.js +0 -41
- package/dist/es2015/index.d.ts +0 -10
- package/dist/es2015/index.js +0 -10
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/localization/localized-messages.directive.js +0 -34
- package/dist/es2015/main.js +0 -8
- package/dist/es2015/models/position.js +0 -4
- package/dist/es2015/notification.module.js +0 -53
- package/dist/fesm5/index.js +0 -677
- package/dist/npm/index.js +0 -15
- package/dist/npm/localization/localized-messages.directive.js +0 -40
- package/dist/npm/main.js +0 -15
- package/dist/npm/models/animation.js +0 -6
- package/dist/npm/models/notification-ref.js +0 -6
- package/dist/npm/models/notification-settings.js +0 -56
- package/dist/npm/models/position.js +0 -6
- package/dist/npm/models/type.js +0 -6
- package/dist/npm/notification.component.js +0 -224
- package/dist/npm/notification.container.component.js +0 -156
- package/dist/npm/notification.module.js +0 -58
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/services/notification.service.js +0 -137
- package/dist/npm/utils/animations.js +0 -47
- package/dist/systemjs/kendo-angular-notification.js +0 -5
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var tslib_1 = require("tslib");
|
|
8
|
-
var core_1 = require("@angular/core");
|
|
9
|
-
var notification_container_component_1 = require("../notification.container.component");
|
|
10
|
-
/**
|
|
11
|
-
* Used to inject the Notification container. If not provided, the first root component of
|
|
12
|
-
* the application is used.
|
|
13
|
-
*
|
|
14
|
-
* > The `NOTIFICATION_CONTAINER` can be used only with the [`NotificationService`]({% slug api_notification_notificationservice %}) class.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* ```ts-no-run
|
|
19
|
-
* // Import the Notification module
|
|
20
|
-
* import { NotificationModule, NOTIFICATION_CONTAINER } from '@progress/kendo-angular-notification';
|
|
21
|
-
*
|
|
22
|
-
* // The browser platform with a compiler
|
|
23
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
24
|
-
*
|
|
25
|
-
* import { ElementRef, NgModule } from '@angular/core';
|
|
26
|
-
*
|
|
27
|
-
* // Import the app component
|
|
28
|
-
* import { AppComponent } from './app.component';
|
|
29
|
-
*
|
|
30
|
-
* // Define the app module
|
|
31
|
-
* _@NgModule({
|
|
32
|
-
* declarations: [AppComponent], // declare app component
|
|
33
|
-
* imports: [BrowserModule, NotificationModule], // import Notification module
|
|
34
|
-
* bootstrap: [AppComponent],
|
|
35
|
-
* providers: [{
|
|
36
|
-
* provide: NOTIFICATION_CONTAINER,
|
|
37
|
-
* useFactory: () => {
|
|
38
|
-
* //return the container ElementRef, where the notification will be injected
|
|
39
|
-
* return { nativeElement: document.body } as ElementRef;
|
|
40
|
-
* }
|
|
41
|
-
* }]
|
|
42
|
-
* })
|
|
43
|
-
* export class AppModule {}
|
|
44
|
-
*
|
|
45
|
-
* // Compile and launch the module
|
|
46
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
exports.NOTIFICATION_CONTAINER = new core_1.InjectionToken('Notification Container');
|
|
50
|
-
/**
|
|
51
|
-
* A service for opening Notification components dynamically
|
|
52
|
-
* ([see example]({% slug overview_notification %})).
|
|
53
|
-
*
|
|
54
|
-
* @export
|
|
55
|
-
* @class NotificationService
|
|
56
|
-
*/
|
|
57
|
-
var NotificationService = /** @class */ (function () {
|
|
58
|
-
/**
|
|
59
|
-
* @hidden
|
|
60
|
-
*/
|
|
61
|
-
function NotificationService(resolver, injector, container) {
|
|
62
|
-
this.resolver = resolver;
|
|
63
|
-
this.injector = injector;
|
|
64
|
-
this.container = container;
|
|
65
|
-
this.notificationContainers = [];
|
|
66
|
-
this.position = { horizontal: 'right', vertical: 'top' };
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Opens a Notification component. Created Notification are mounted
|
|
70
|
-
* in the DOM directly in the root application component.
|
|
71
|
-
*
|
|
72
|
-
* @param {NotificationSettings} settings - The settings which define the Notification.
|
|
73
|
-
*
|
|
74
|
-
* @returns {NotificationRef} - A reference to the Notification object and the convenience properties.
|
|
75
|
-
*/
|
|
76
|
-
NotificationService.prototype.show = function (settings) {
|
|
77
|
-
if (!settings) {
|
|
78
|
-
throw new Error('NotificationSettings settings are required');
|
|
79
|
-
}
|
|
80
|
-
var target = this.findGroupContainer(settings);
|
|
81
|
-
var position = settings.position || this.position;
|
|
82
|
-
var currentId = position.horizontal + " " + position.vertical;
|
|
83
|
-
var container;
|
|
84
|
-
var notificationRef;
|
|
85
|
-
var notificationContainer = this.notificationContainers.find(function (c) { return target.nativeElement.contains(c.element.nativeElement) && c.id === currentId; });
|
|
86
|
-
if (!notificationContainer) {
|
|
87
|
-
container = this.resolver
|
|
88
|
-
.resolveComponentFactory(notification_container_component_1.NotificationContainerComponent)
|
|
89
|
-
.create(this.injector);
|
|
90
|
-
notificationContainer = container.instance;
|
|
91
|
-
this.appRef.attachView(container.hostView);
|
|
92
|
-
var hostViewElement = container.location.nativeElement;
|
|
93
|
-
var groupContainer = this.findGroupContainer(settings);
|
|
94
|
-
if (!groupContainer) {
|
|
95
|
-
throw new Error("\n View Container not found! Inject the NOTIFICATION_CONTAINER or define a specific ViewContainerRef via\n the appendTo option. See http://www.telerik.com/kendo-angular-ui/components/notification/api/NOTIFICATION_CONTAINER/\n for more details.\n ");
|
|
96
|
-
}
|
|
97
|
-
groupContainer.nativeElement.appendChild(hostViewElement);
|
|
98
|
-
this.notificationContainers.push(notificationContainer);
|
|
99
|
-
}
|
|
100
|
-
settings.position = position;
|
|
101
|
-
notificationRef = notificationContainer.addNotification(settings);
|
|
102
|
-
return notificationRef;
|
|
103
|
-
};
|
|
104
|
-
Object.defineProperty(NotificationService.prototype, "appRef", {
|
|
105
|
-
get: function () {
|
|
106
|
-
if (!this.applicationRef) {
|
|
107
|
-
this.applicationRef = this.injector.get(core_1.ApplicationRef);
|
|
108
|
-
}
|
|
109
|
-
return this.applicationRef;
|
|
110
|
-
},
|
|
111
|
-
enumerable: true,
|
|
112
|
-
configurable: true
|
|
113
|
-
});
|
|
114
|
-
NotificationService.prototype.findGroupContainer = function (settings) {
|
|
115
|
-
var container;
|
|
116
|
-
if (settings.appendTo) {
|
|
117
|
-
container = settings.appendTo.element;
|
|
118
|
-
}
|
|
119
|
-
else if (this.container) {
|
|
120
|
-
container = this.container;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
var appRoot = this.appRef.components && this.appRef.components[0];
|
|
124
|
-
container = appRoot ? appRoot.location : null;
|
|
125
|
-
}
|
|
126
|
-
return container;
|
|
127
|
-
};
|
|
128
|
-
NotificationService = tslib_1.__decorate([
|
|
129
|
-
core_1.Injectable(),
|
|
130
|
-
tslib_1.__param(2, core_1.Inject(exports.NOTIFICATION_CONTAINER)), tslib_1.__param(2, core_1.Optional()),
|
|
131
|
-
tslib_1.__metadata("design:paramtypes", [core_1.ComponentFactoryResolver,
|
|
132
|
-
core_1.Injector,
|
|
133
|
-
core_1.ElementRef])
|
|
134
|
-
], NotificationService);
|
|
135
|
-
return NotificationService;
|
|
136
|
-
}());
|
|
137
|
-
exports.NotificationService = NotificationService;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var animations_1 = require("@angular/animations");
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
function slideAnimation(height, duration) {
|
|
12
|
-
return [
|
|
13
|
-
animations_1.style({ overflow: 'hidden', height: 0 }),
|
|
14
|
-
animations_1.animate(duration + "ms ease-in", animations_1.style({ height: height + "px" }))
|
|
15
|
-
];
|
|
16
|
-
}
|
|
17
|
-
exports.slideAnimation = slideAnimation;
|
|
18
|
-
/**
|
|
19
|
-
* @hidden
|
|
20
|
-
*/
|
|
21
|
-
function slideCloseAnimation(height, duration) {
|
|
22
|
-
return [
|
|
23
|
-
animations_1.style({ height: height + "px" }),
|
|
24
|
-
animations_1.animate(duration + "ms ease-in", animations_1.style({ overflow: 'hidden', height: 0 }))
|
|
25
|
-
];
|
|
26
|
-
}
|
|
27
|
-
exports.slideCloseAnimation = slideCloseAnimation;
|
|
28
|
-
/**
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
function fadeAnimation(duration) {
|
|
32
|
-
return [
|
|
33
|
-
animations_1.style({ opacity: 0 }),
|
|
34
|
-
animations_1.animate(duration + "ms ease-in", animations_1.style({ opacity: 1 }))
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
exports.fadeAnimation = fadeAnimation;
|
|
38
|
-
/**
|
|
39
|
-
* @hidden
|
|
40
|
-
*/
|
|
41
|
-
function fadeCloseAnimation(duration) {
|
|
42
|
-
return [
|
|
43
|
-
animations_1.style({ opacity: 1 }),
|
|
44
|
-
animations_1.animate(duration + "ms ease-in", animations_1.style({ opacity: 0 }))
|
|
45
|
-
];
|
|
46
|
-
}
|
|
47
|
-
exports.fadeCloseAnimation = fadeCloseAnimation;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
System.register("@progress/kendo-angular-notification",["tslib","@angular/core","rxjs/operators","@angular/animations","@progress/kendo-licensing","@progress/kendo-angular-l10n","@angular/common"],function(r){var a,s,c,l,p,d,u;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){a=e(t)},function(t){s=e(t)},function(t){c=e(t)},function(t){l=e(t)},function(t){p=e(t)},function(t){d=e(t)},function(t){u=e(t)}],execute:function(){function n(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}var i,o;i=[function(t,e){t.exports=s},function(t,e){t.exports=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),r=i(0),o=i(6),a=i(13),s=i(12),c=i(11),l=i(10),i=i(5),n=(Object.defineProperty(p.prototype,"containerClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"closeButtonTitle",{get:function(){return this.closeTitle||this.localizationService.get("closeTitle")},enumerable:!0,configurable:!0}),p.prototype.notificationClasses=function(){return(this.type?this.typeClass():"")+"\n "+(this.closable?"k-notification-closable":"")},p.prototype.ngOnInit=function(){clearTimeout(this.hideTimeout)},p.prototype.ngOnDestroy=function(){clearTimeout(this.hideTimeout),this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe()},p.prototype.ngAfterViewInit=function(){var t=this;this.closable||this.animation||this.setHideTimeout(),!this.closable&&this.animation&&this.animationEnd.pipe(a.take(1)).subscribe(function(){return t.setHideTimeout()}),this.animation&&this.animate(this.animation)},p.prototype.typeClass=function(){return{none:"",success:"k-notification-success",warning:"k-notification-warning",error:"k-notification-error",info:"k-notification-info"}[this.type.style]},p.prototype.typeIconClass=function(){return{none:"",success:"k-i-success",warning:"k-i-warning",error:"k-i-error",info:"k-i-info"}[this.type.style]},p.prototype.onCloseClick=function(){clearTimeout(this.hideTimeout),this.hide()},p.prototype.hide=function(t){var e=this,i=getComputedStyle(this.element.nativeElement).height;if(this.animation&&i)return this.animate(this.animation,!0),void this.animationEnd.subscribe(function(){e.emitClose(t)});this.emitClose(t)},p.prototype.setHideTimeout=function(){var t=this,e=this.hideAfter||this.defaultHideAfter;this.hideTimeout=window.setTimeout(function(){return t.onCloseClick()},e)},p.prototype.emitClose=function(t){t&&t.destroy(),this.close.emit()},p.prototype.play=function(t,e){var i=this,t=this.builder.build(t),n=this.element.nativeElement,o=(this.renderer.addClass(n,"k-notification-container-animating"),t.create(e));o.onDone(function(){i.renderer.removeClass(n,"k-notification-container-animating"),i.animationEnd.emit(),o&&(o.destroy(),o=null)}),o.play()},p.prototype.animate=function(t,e){var i=this.element.nativeElement,n=t.duration,o=i.offsetHeight,t="slide"===t.type?this.slideAnimation(o,n,e):this.fadeAnimation(n,e);this.play(t,i)},p.prototype.slideAnimation=function(t,e,i){return i?l.slideCloseAnimation(t,e):l.slideAnimation(t,e)},p.prototype.fadeAnimation=function(t,e){return e?l.fadeCloseAnimation(t):l.fadeAnimation(t)},n.__decorate([r.ViewChild("container",{read:r.ViewContainerRef,static:!0}),n.__metadata("design:type",r.ViewContainerRef)],p.prototype,"container",void 0),n.__decorate([r.Input(),n.__metadata("design:type",r.TemplateRef)],p.prototype,"templateRef",void 0),n.__decorate([r.Input(),n.__metadata("design:type",String)],p.prototype,"templateString",void 0),n.__decorate([r.Input(),n.__metadata("design:type",Number)],p.prototype,"width",void 0),n.__decorate([r.Input(),n.__metadata("design:type",Number)],p.prototype,"height",void 0),n.__decorate([r.Input(),n.__metadata("design:type",Object)],p.prototype,"cssClass",void 0),n.__decorate([r.Input(),n.__metadata("design:type",Number)],p.prototype,"hideAfter",void 0),n.__decorate([r.Input(),n.__metadata("design:type",Boolean)],p.prototype,"closable",void 0),n.__decorate([r.Input(),n.__metadata("design:type",Object)],p.prototype,"type",void 0),n.__decorate([r.Input(),n.__metadata("design:type",Object)],p.prototype,"animation",void 0),n.__decorate([r.HostBinding("attr.dir"),n.__metadata("design:type",String)],p.prototype,"direction",void 0),n.__decorate([r.HostBinding("class.k-notification-container"),n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[])],p.prototype,"containerClass",null),n.__decorate([r.Component({selector:"kendo-notification",template:'\n <ng-container kendoNotificationLocalizedMessages\n i18n-closeTitle="kendo.notification.closeTitle|The title of the close button"\n closeTitle="Close"\n >\n </ng-container>\n <div class="k-widget k-notification {{ notificationClasses() }}"\n [ngClass]="cssClass"\n [style.height.px]="height"\n [style.width.px]="width">\n <div class="k-notification-wrap k-hstack">\n <span *ngIf="type && type.icon && type.style !== \'none\'" class="k-icon" [ngClass]="typeIconClass()"></span>\n\n <div class="k-notification-content">\n <ng-template\n [ngIf]="templateRef"\n [ngTemplateOutlet]="templateRef">\n </ng-template>\n <ng-template\n [ngIf]="templateString">\n {{ templateString }}\n </ng-template>\n <ng-container #container></ng-container>\n </div>\n\n <a *ngIf="closable" class="k-icon k-i-close" [attr.title]="closeButtonTitle" (click)="onCloseClick()"></a>\n </div>\n </div>\n ',providers:[i.LocalizationService,{provide:i.L10N_PREFIX,useValue:"kendo.notification"}]}),n.__metadata("design:paramtypes",[r.ChangeDetectorRef,r.ElementRef,r.Renderer2,o.AnimationBuilder,i.LocalizationService])],p));function p(t,e,i,n,o){var a=this;this.cdr=t,this.element=e,this.renderer=i,this.builder=n,this.localizationService=o,this.close=new r.EventEmitter,this.width=null,this.height=null,this.defaultHideAfter=5e3,this.animationEnd=new r.EventEmitter,this.rtl=!1,s.validatePackage(c.packageMetadata),this.dynamicRTLSubscription=o.changes.subscribe(function(t){t=t.rtl;a.rtl=t,a.direction=a.rtl?"rtl":"ltr"})}e.NotificationComponent=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),r=i(0),o=i(2),i=(a.prototype.ngOnDestroy=function(){this.notifications.forEach(function(t){t.closeClickSubscription&&t.closeClickSubscription.unsubscribe()}),this.notifications=[]},a.prototype.addNotification=function(t){this.position=t.position,this.id=this.position.horizontal+" "+this.position.vertical;var e=this.resolver.resolveComponentFactory(o.NotificationComponent),i=this.container.createComponent(e),n=(this.applySettings(i,t),null);return"function"==typeof t.content&&(e=this.resolver.resolveComponentFactory(t.content),n=i.instance.container.createComponent(e)),i.changeDetectorRef.detectChanges(),this.notifications.push(i.instance),t.appendTo&&this.applyAbsolutePosition(t.appendTo),this.applyPosition(),this.applyContainerWrap(),{afterHide:i.instance.close,hide:function(){return i.instance.hide(n)},notification:i,content:n||null}},a.prototype.hide=function(t){var e=t.instance,i=this.notifications.indexOf(e);this.notifications.splice(i,1),e.closeClickSubscription&&e.closeClickSubscription.unsubscribe(),e.templateRef=null,e.templateString=null,t.destroy()},a.prototype.applyContainerWrap=function(){var t="right"===this.position.horizontal?"wrap-reverse":"wrap";this.renderer.setStyle(this.group.nativeElement,"flex-wrap",t)},a.prototype.applySettings=function(t,e){var i=this,n=t.instance,o=e.content,a=e.animation||null,o=(n.closeClickSubscription=n.close.subscribe(function(){return i.hide(t)}),"string"==typeof o&&(n.templateString=o),o instanceof r.TemplateRef&&(n.templateRef=o),n.animation=a,e.type);o&&void 0===o.style&&(o.style="none"),o&&void 0===o.icon&&(o.icon=!0),n.type=o,n.closeTitle=e.closeTitle,e.cssClass&&(n.cssClass=e.cssClass),n.closable=e.closable,n.hideAfter=e.hideAfter,n.width=e.width,n.height=e.height},a.prototype.applyAbsolutePosition=function(t){var t=t.element.nativeElement,e=this.element.nativeElement.children[0];"static"===window.getComputedStyle(t).position&&this.renderer.setStyle(t,"position","relative"),this.renderer.setStyle(e,"position","absolute")},a.prototype.applyPosition=function(){var e=this.element.nativeElement.children[0],t=e.getBoundingClientRect().width/2,i=this.setContainerPosition(this.position,t);Object.keys(i).forEach(function(t){e.style[t]=i[t]})},a.prototype.setContainerPosition=function(t,e){var e={horizontal:{left:{left:0,alignItems:"flex-start"},right:{right:0,alignItems:"flex-start"},center:{left:"50%",marginLeft:-e+"px",alignItems:"center"}},vertical:{top:{top:0},bottom:{bottom:0}}},i=e.horizontal[t.horizontal],e=e.vertical[t.vertical];return Object.assign({},i,e)},n.__decorate([r.ViewChild("container",{read:r.ViewContainerRef,static:!0}),n.__metadata("design:type",r.ViewContainerRef)],a.prototype,"container",void 0),n.__decorate([r.ViewChild("group",{static:!0}),n.__metadata("design:type",r.ElementRef)],a.prototype,"group",void 0),n.__decorate([r.Input(),n.__metadata("design:type",String)],a.prototype,"id",void 0),n.__decorate([r.Component({selector:"kendo-notification-container",template:'\n <div #group class="k-notification-group">\n <ng-container #container></ng-container>\n </div>\n '}),n.__metadata("design:paramtypes",[r.ElementRef,r.Renderer2,r.ComponentFactoryResolver])],a));function a(t,e,i){this.element=t,this.renderer=e,this.resolver=i,this.id="",this.notifications=[]}e.NotificationContainerComponent=i},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),o=i(0),s=i(3),i=(e.NOTIFICATION_CONTAINER=new o.InjectionToken("Notification Container"),a.prototype.show=function(t){if(!t)throw new Error("NotificationSettings settings are required");var e=this.findGroupContainer(t),i=t.position||this.position,n=i.horizontal+" "+i.vertical,o=this.notificationContainers.find(function(t){return e.nativeElement.contains(t.element.nativeElement)&&t.id===n});if(!o){o=(a=this.resolver.resolveComponentFactory(s.NotificationContainerComponent).create(this.injector)).instance,this.appRef.attachView(a.hostView);var a=a.location.nativeElement,r=this.findGroupContainer(t);if(!r)throw new Error("\n View Container not found! Inject the NOTIFICATION_CONTAINER or define a specific ViewContainerRef via\n the appendTo option. See http://www.telerik.com/kendo-angular-ui/components/notification/api/NOTIFICATION_CONTAINER/\n for more details.\n ");r.nativeElement.appendChild(a),this.notificationContainers.push(o)}return t.position=i,o.addNotification(t)},Object.defineProperty(a.prototype,"appRef",{get:function(){return this.applicationRef||(this.applicationRef=this.injector.get(o.ApplicationRef)),this.applicationRef},enumerable:!0,configurable:!0}),a.prototype.findGroupContainer=function(t){return t.appendTo?t.appendTo.element:this.container||((t=this.appRef.components&&this.appRef.components[0])?t.location:null)},n.__decorate([o.Injectable(),n.__param(2,o.Inject(e.NOTIFICATION_CONTAINER)),n.__param(2,o.Optional()),n.__metadata("design:paramtypes",[o.ComponentFactoryResolver,o.Injector,o.ElementRef])],a));function a(t,e,i){this.resolver=t,this.injector=e,this.container=i,this.notificationContainers=[],this.position={horizontal:"right",vertical:"top"}}e.NotificationService=i},function(t,e){t.exports=d},function(t,e){t.exports=l},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,o,a=i(1),r=i(0),i=i(5),r=(n=i.ComponentMessages,a.__extends(s,n),o=s,a.__decorate([r.Input(),a.__metadata("design:type",String)],s.prototype,"closeTitle",void 0),o=a.__decorate([r.Directive({providers:[{provide:i.ComponentMessages,useExisting:r.forwardRef(function(){return o})}],selector:"[kendoNotificationLocalizedMessages]"}),a.__metadata("design:paramtypes",[i.LocalizationService])],s));function s(t){var e=n.call(this)||this;return e.service=t,e}e.LocalizedMessagesDirective=r},function(t,e){t.exports=u},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),o=i(0),a=i(8),r=i(4),s=i(2),c=i(3),i=i(7),n=n.__decorate([o.NgModule({declarations:[s.NotificationComponent,c.NotificationContainerComponent,i.LocalizedMessagesDirective],entryComponents:[s.NotificationComponent,c.NotificationContainerComponent],imports:[a.CommonModule],exports:[s.NotificationComponent,c.NotificationContainerComponent],providers:[r.NotificationService]})],l);function l(){}e.NotificationModule=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(6);e.slideAnimation=function(t,e){return[n.style({overflow:"hidden",height:0}),n.animate(e+"ms ease-in",n.style({height:t+"px"}))]},e.slideCloseAnimation=function(t,e){return[n.style({height:t+"px"}),n.animate(e+"ms ease-in",n.style({overflow:"hidden",height:0}))]},e.fadeAnimation=function(t){return[n.style({opacity:0}),n.animate(t+"ms ease-in",n.style({opacity:1}))]},e.fadeCloseAnimation=function(t){return[n.style({opacity:1}),n.animate(t+"ms ease-in",n.style({opacity:0}))]}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.packageMetadata={name:"@progress/kendo-angular-notification",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1646821059,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"}},function(t,e){t.exports=p},function(t,e){t.exports=c},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotificationSettings=function(){this.hideAfter=5e3,this.position={horizontal:"right",vertical:"top"},this.animation={type:"fade",duration:500},this.closable=!1,this.type={style:"none",icon:!0}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,o=i(14),o=(e.NotificationSettings=o.NotificationSettings,i(2)),o=(e.NotificationComponent=o.NotificationComponent,i(4)),o=(e.NotificationService=o.NotificationService,e.NOTIFICATION_CONTAINER=o.NOTIFICATION_CONTAINER,i(9)),a=(e.NotificationModule=o.NotificationModule,e);for(n in a)r(n,a[n])}],o={},n.m=i,n.c=o,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=15)}}});
|