@progress/kendo-angular-notification 3.0.5 → 4.0.0-next.202203141327

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 (67) hide show
  1. package/bundles/kendo-angular-notification.umd.js +5 -0
  2. package/{dist/es/models/notification-ref.js → esm2015/kendo-angular-notification.js} +4 -0
  3. package/esm2015/localization/localized-messages.directive.js +38 -0
  4. package/{dist/es → esm2015}/main.js +2 -0
  5. package/{dist/es2015 → esm2015}/models/animation.js +1 -0
  6. package/{dist/es2015 → esm2015}/models/notification-ref.js +1 -0
  7. package/{dist/es2015 → esm2015}/models/notification-settings.js +0 -0
  8. package/{dist/es → esm2015}/models/position.js +1 -0
  9. package/{dist/es2015 → esm2015}/models/type.js +1 -0
  10. package/{dist/es2015 → esm2015}/notification.component.js +85 -73
  11. package/{dist/es2015 → esm2015}/notification.container.component.js +25 -27
  12. package/{dist/es → esm2015}/notification.module.js +16 -16
  13. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  14. package/{dist/es2015 → esm2015}/services/notification.service.js +14 -12
  15. package/{dist/es2015 → esm2015}/utils/animations.js +0 -0
  16. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-notification.js} +170 -146
  17. package/{dist/es/models/animation.js → kendo-angular-notification.d.ts} +5 -0
  18. package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
  19. package/{dist/es2015/main.d.ts → main.d.ts} +1 -0
  20. package/{dist/es2015/models → models}/animation.d.ts +0 -0
  21. package/{dist/es2015/models → models}/notification-ref.d.ts +0 -0
  22. package/{dist/es2015/models → models}/notification-settings.d.ts +0 -0
  23. package/{dist/es2015/models → models}/position.d.ts +0 -0
  24. package/{dist/es2015/models → models}/type.d.ts +0 -0
  25. package/{dist/es2015/notification.component.d.ts → notification.component.d.ts} +5 -2
  26. package/{dist/es2015/notification.container.component.d.ts → notification.container.component.d.ts} +3 -1
  27. package/{dist/es2015/notification.module.d.ts → notification.module.d.ts} +8 -0
  28. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  29. package/package.json +32 -95
  30. package/schematics/ngAdd/index.js +5 -2
  31. package/schematics/ngAdd/index.js.map +1 -1
  32. package/{dist/es2015/services → services}/notification.service.d.ts +4 -1
  33. package/{dist/es2015/utils → utils}/animations.d.ts +0 -0
  34. package/dist/cdn/js/kendo-angular-notification.js +0 -20
  35. package/dist/cdn/main.js +0 -5
  36. package/dist/es/index.js +0 -10
  37. package/dist/es/localization/localized-messages.directive.js +0 -38
  38. package/dist/es/models/notification-settings.js +0 -54
  39. package/dist/es/models/type.js +0 -4
  40. package/dist/es/notification.component.js +0 -222
  41. package/dist/es/notification.container.component.js +0 -154
  42. package/dist/es/package-metadata.js +0 -15
  43. package/dist/es/services/notification.service.js +0 -135
  44. package/dist/es/utils/animations.js +0 -41
  45. package/dist/es2015/index.d.ts +0 -10
  46. package/dist/es2015/index.js +0 -10
  47. package/dist/es2015/index.metadata.json +0 -1
  48. package/dist/es2015/localization/localized-messages.directive.js +0 -34
  49. package/dist/es2015/main.js +0 -8
  50. package/dist/es2015/models/position.js +0 -4
  51. package/dist/es2015/notification.module.js +0 -53
  52. package/dist/fesm5/index.js +0 -677
  53. package/dist/npm/index.js +0 -15
  54. package/dist/npm/localization/localized-messages.directive.js +0 -40
  55. package/dist/npm/main.js +0 -15
  56. package/dist/npm/models/animation.js +0 -6
  57. package/dist/npm/models/notification-ref.js +0 -6
  58. package/dist/npm/models/notification-settings.js +0 -56
  59. package/dist/npm/models/position.js +0 -6
  60. package/dist/npm/models/type.js +0 -6
  61. package/dist/npm/notification.component.js +0 -224
  62. package/dist/npm/notification.container.component.js +0 -156
  63. package/dist/npm/notification.module.js +0 -58
  64. package/dist/npm/package-metadata.js +0 -17
  65. package/dist/npm/services/notification.service.js +0 -137
  66. package/dist/npm/utils/animations.js +0 -47
  67. package/dist/systemjs/kendo-angular-notification.js +0 -5
@@ -1,40 +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 kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
10
- /**
11
- * @hidden
12
- */
13
- var LocalizedMessagesDirective = /** @class */ (function (_super) {
14
- tslib_1.__extends(LocalizedMessagesDirective, _super);
15
- function LocalizedMessagesDirective(service) {
16
- var _this = _super.call(this) || this;
17
- _this.service = service;
18
- return _this;
19
- }
20
- LocalizedMessagesDirective_1 = LocalizedMessagesDirective;
21
- var LocalizedMessagesDirective_1;
22
- tslib_1.__decorate([
23
- core_1.Input(),
24
- tslib_1.__metadata("design:type", String)
25
- ], LocalizedMessagesDirective.prototype, "closeTitle", void 0);
26
- LocalizedMessagesDirective = LocalizedMessagesDirective_1 = tslib_1.__decorate([
27
- core_1.Directive({
28
- providers: [
29
- {
30
- provide: kendo_angular_l10n_1.ComponentMessages,
31
- useExisting: core_1.forwardRef(function () { return LocalizedMessagesDirective_1; })
32
- }
33
- ],
34
- selector: "[kendoNotificationLocalizedMessages]"
35
- }),
36
- tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
37
- ], LocalizedMessagesDirective);
38
- return LocalizedMessagesDirective;
39
- }(kendo_angular_l10n_1.ComponentMessages));
40
- exports.LocalizedMessagesDirective = LocalizedMessagesDirective;
package/dist/npm/main.js DELETED
@@ -1,15 +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 notification_settings_1 = require("./models/notification-settings");
8
- exports.NotificationSettings = notification_settings_1.NotificationSettings;
9
- var notification_component_1 = require("./notification.component");
10
- exports.NotificationComponent = notification_component_1.NotificationComponent;
11
- var notification_service_1 = require("./services/notification.service");
12
- exports.NotificationService = notification_service_1.NotificationService;
13
- exports.NOTIFICATION_CONTAINER = notification_service_1.NOTIFICATION_CONTAINER;
14
- var notification_module_1 = require("./notification.module");
15
- exports.NotificationModule = notification_module_1.NotificationModule;
@@ -1,6 +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 });
@@ -1,6 +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 });
@@ -1,56 +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 NotificationSettings = /** @class */ (function () {
8
- function NotificationSettings() {
9
- /**
10
- * Specifies the time in milliseconds after which the
11
- * Notification will hide
12
- * ([see example]({% slug hiding_notifications %}#toc-definig-a-delay-before-hiding)).
13
- * Defaults to `5000`.
14
- */
15
- this.hideAfter = 5000;
16
- /**
17
- * Defines the position of the Notification
18
- * ([see example]({% slug positioning_notification %})).
19
- *
20
- * The possible values are:
21
- * * `horizontal: 'left'|'center'|'right'`
22
- * * `vertical: 'top'|'bottom'`
23
- */
24
- this.position = { horizontal: 'right', vertical: 'top' };
25
- /**
26
- * Specifies the animation settings of the Notification
27
- * ([see example]({% slug animations_notification %})).
28
- *
29
- * The possible values are:
30
- * * `duration`—Accepts a number in milliseconds. Defaults to `500ms`.
31
- * * `type?: 'slide'| (Default) 'fade'`
32
- */
33
- this.animation = { type: 'fade', duration: 500 };
34
- /**
35
- * Specifies if the Notification will require a user action to hide.
36
- * If the property is set to `true`, the Notification renders a **Close** button
37
- * ([see example]({% slug hiding_notifications %}#toc-defining-a-closable-notification)).
38
- *
39
- * The possible values are:
40
- * * (Default) `false`
41
- * * `true`
42
- */
43
- this.closable = false;
44
- /**
45
- * Specifies the type of the Notification
46
- * ([see example]({% slug types_notification %})).
47
- *
48
- * The possible values are:
49
- * * `style: (Default) 'none'|'success'|'error'|'warning'|'info'`
50
- * * `icon: 'true'|'false'`
51
- */
52
- this.type = { style: 'none', icon: true };
53
- }
54
- return NotificationSettings;
55
- }());
56
- exports.NotificationSettings = NotificationSettings;
@@ -1,6 +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 });
@@ -1,6 +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 });
@@ -1,224 +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 animations_1 = require("@angular/animations");
10
- var operators_1 = require("rxjs/operators");
11
- var kendo_licensing_1 = require("@progress/kendo-licensing");
12
- var package_metadata_1 = require("./package-metadata");
13
- var animations_2 = require("./utils/animations");
14
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
15
- /**
16
- * @hidden
17
- *
18
- */
19
- var NotificationComponent = /** @class */ (function () {
20
- function NotificationComponent(cdr, element, renderer, builder, localizationService) {
21
- var _this = this;
22
- this.cdr = cdr;
23
- this.element = element;
24
- this.renderer = renderer;
25
- this.builder = builder;
26
- this.localizationService = localizationService;
27
- this.close = new core_1.EventEmitter();
28
- this.width = null;
29
- this.height = null;
30
- this.defaultHideAfter = 5000;
31
- this.animationEnd = new core_1.EventEmitter();
32
- this.rtl = false;
33
- kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
34
- this.dynamicRTLSubscription = localizationService.changes.subscribe(function (_a) {
35
- var rtl = _a.rtl;
36
- _this.rtl = rtl;
37
- _this.direction = _this.rtl ? 'rtl' : 'ltr';
38
- });
39
- }
40
- Object.defineProperty(NotificationComponent.prototype, "containerClass", {
41
- get: function () {
42
- return true;
43
- },
44
- enumerable: true,
45
- configurable: true
46
- });
47
- Object.defineProperty(NotificationComponent.prototype, "closeButtonTitle", {
48
- get: function () {
49
- return this.closeTitle || this.localizationService.get('closeTitle');
50
- },
51
- enumerable: true,
52
- configurable: true
53
- });
54
- NotificationComponent.prototype.notificationClasses = function () {
55
- return (this.type ? this.typeClass() : '') + "\n " + (this.closable ? 'k-notification-closable' : '');
56
- };
57
- NotificationComponent.prototype.ngOnInit = function () {
58
- clearTimeout(this.hideTimeout);
59
- };
60
- NotificationComponent.prototype.ngOnDestroy = function () {
61
- clearTimeout(this.hideTimeout);
62
- if (this.dynamicRTLSubscription) {
63
- this.dynamicRTLSubscription.unsubscribe();
64
- }
65
- };
66
- NotificationComponent.prototype.ngAfterViewInit = function () {
67
- var _this = this;
68
- if (!this.closable && !this.animation) {
69
- this.setHideTimeout();
70
- }
71
- if (!this.closable && this.animation) {
72
- this.animationEnd.pipe(operators_1.take(1))
73
- .subscribe(function () { return _this.setHideTimeout(); });
74
- }
75
- if (this.animation) {
76
- this.animate(this.animation);
77
- }
78
- };
79
- NotificationComponent.prototype.typeClass = function () {
80
- return {
81
- 'none': '',
82
- 'success': 'k-notification-success',
83
- 'warning': 'k-notification-warning',
84
- 'error': 'k-notification-error',
85
- 'info': 'k-notification-info'
86
- }[this.type.style];
87
- };
88
- NotificationComponent.prototype.typeIconClass = function () {
89
- return {
90
- 'none': '',
91
- 'success': 'k-i-success',
92
- 'warning': 'k-i-warning',
93
- 'error': 'k-i-error',
94
- 'info': 'k-i-info'
95
- }[this.type.style];
96
- };
97
- NotificationComponent.prototype.onCloseClick = function () {
98
- clearTimeout(this.hideTimeout);
99
- this.hide();
100
- };
101
- NotificationComponent.prototype.hide = function (customComponent) {
102
- var _this = this;
103
- var elementHeight = getComputedStyle(this.element.nativeElement).height;
104
- if (this.animation && elementHeight) {
105
- this.animate(this.animation, true);
106
- this.animationEnd.subscribe(function () {
107
- _this.emitClose(customComponent);
108
- });
109
- return;
110
- }
111
- this.emitClose(customComponent);
112
- };
113
- NotificationComponent.prototype.setHideTimeout = function () {
114
- var _this = this;
115
- var hideAfter = this.hideAfter || this.defaultHideAfter;
116
- this.hideTimeout = window.setTimeout(function () { return _this.onCloseClick(); }, hideAfter);
117
- };
118
- NotificationComponent.prototype.emitClose = function (customComponent) {
119
- if (customComponent) {
120
- customComponent.destroy();
121
- }
122
- this.close.emit();
123
- };
124
- NotificationComponent.prototype.play = function (animation, animatedElement) {
125
- var _this = this;
126
- var factory = this.builder.build(animation);
127
- var element = this.element.nativeElement;
128
- this.renderer.addClass(element, 'k-notification-container-animating');
129
- var player = factory.create(animatedElement);
130
- player.onDone(function () {
131
- _this.renderer.removeClass(element, 'k-notification-container-animating');
132
- _this.animationEnd.emit();
133
- if (player) {
134
- player.destroy();
135
- player = null;
136
- }
137
- });
138
- player.play();
139
- };
140
- NotificationComponent.prototype.animate = function (animation, onclose) {
141
- var element = this.element.nativeElement;
142
- var duration = animation.duration;
143
- var height = element.offsetHeight;
144
- var generatedAnimation = animation.type === 'slide' ?
145
- this.slideAnimation(height, duration, onclose) :
146
- this.fadeAnimation(duration, onclose);
147
- this.play(generatedAnimation, element);
148
- };
149
- NotificationComponent.prototype.slideAnimation = function (height, duration, onclose) {
150
- return onclose ? animations_2.slideCloseAnimation(height, duration) : animations_2.slideAnimation(height, duration);
151
- };
152
- NotificationComponent.prototype.fadeAnimation = function (duration, onclose) {
153
- return onclose ? animations_2.fadeCloseAnimation(duration) : animations_2.fadeAnimation(duration);
154
- };
155
- tslib_1.__decorate([
156
- core_1.ViewChild('container', { read: core_1.ViewContainerRef, static: true }),
157
- tslib_1.__metadata("design:type", core_1.ViewContainerRef)
158
- ], NotificationComponent.prototype, "container", void 0);
159
- tslib_1.__decorate([
160
- core_1.Input(),
161
- tslib_1.__metadata("design:type", core_1.TemplateRef)
162
- ], NotificationComponent.prototype, "templateRef", void 0);
163
- tslib_1.__decorate([
164
- core_1.Input(),
165
- tslib_1.__metadata("design:type", String)
166
- ], NotificationComponent.prototype, "templateString", void 0);
167
- tslib_1.__decorate([
168
- core_1.Input(),
169
- tslib_1.__metadata("design:type", Number)
170
- ], NotificationComponent.prototype, "width", void 0);
171
- tslib_1.__decorate([
172
- core_1.Input(),
173
- tslib_1.__metadata("design:type", Number)
174
- ], NotificationComponent.prototype, "height", void 0);
175
- tslib_1.__decorate([
176
- core_1.Input(),
177
- tslib_1.__metadata("design:type", Object)
178
- ], NotificationComponent.prototype, "cssClass", void 0);
179
- tslib_1.__decorate([
180
- core_1.Input(),
181
- tslib_1.__metadata("design:type", Number)
182
- ], NotificationComponent.prototype, "hideAfter", void 0);
183
- tslib_1.__decorate([
184
- core_1.Input(),
185
- tslib_1.__metadata("design:type", Boolean)
186
- ], NotificationComponent.prototype, "closable", void 0);
187
- tslib_1.__decorate([
188
- core_1.Input(),
189
- tslib_1.__metadata("design:type", Object)
190
- ], NotificationComponent.prototype, "type", void 0);
191
- tslib_1.__decorate([
192
- core_1.Input(),
193
- tslib_1.__metadata("design:type", Object)
194
- ], NotificationComponent.prototype, "animation", void 0);
195
- tslib_1.__decorate([
196
- core_1.HostBinding('attr.dir'),
197
- tslib_1.__metadata("design:type", String)
198
- ], NotificationComponent.prototype, "direction", void 0);
199
- tslib_1.__decorate([
200
- core_1.HostBinding('class.k-notification-container'),
201
- tslib_1.__metadata("design:type", Boolean),
202
- tslib_1.__metadata("design:paramtypes", [])
203
- ], NotificationComponent.prototype, "containerClass", null);
204
- NotificationComponent = tslib_1.__decorate([
205
- core_1.Component({
206
- selector: 'kendo-notification',
207
- 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 ",
208
- providers: [
209
- kendo_angular_l10n_1.LocalizationService,
210
- {
211
- provide: kendo_angular_l10n_1.L10N_PREFIX,
212
- useValue: 'kendo.notification'
213
- }
214
- ]
215
- }),
216
- tslib_1.__metadata("design:paramtypes", [core_1.ChangeDetectorRef,
217
- core_1.ElementRef,
218
- core_1.Renderer2,
219
- animations_1.AnimationBuilder,
220
- kendo_angular_l10n_1.LocalizationService])
221
- ], NotificationComponent);
222
- return NotificationComponent;
223
- }());
224
- exports.NotificationComponent = NotificationComponent;
@@ -1,156 +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_component_1 = require("./notification.component");
10
- /**
11
- * @hidden
12
- *
13
- */
14
- var NotificationContainerComponent = /** @class */ (function () {
15
- function NotificationContainerComponent(element, renderer, resolver) {
16
- this.element = element;
17
- this.renderer = renderer;
18
- this.resolver = resolver;
19
- this.id = '';
20
- this.notifications = [];
21
- }
22
- NotificationContainerComponent.prototype.ngOnDestroy = function () {
23
- this.notifications.forEach(function (notification) {
24
- if (notification.closeClickSubscription) {
25
- notification.closeClickSubscription.unsubscribe();
26
- }
27
- });
28
- this.notifications = [];
29
- };
30
- NotificationContainerComponent.prototype.addNotification = function (settings) {
31
- this.position = settings.position;
32
- this.id = this.position.horizontal + " " + this.position.vertical;
33
- var factory = this.resolver.resolveComponentFactory(notification_component_1.NotificationComponent);
34
- var notificationRef = this.container.createComponent(factory);
35
- this.applySettings(notificationRef, settings);
36
- var customComponent = null;
37
- if (typeof settings.content === 'function') {
38
- var customFactory = this.resolver.resolveComponentFactory(settings.content);
39
- customComponent = notificationRef.instance.container.createComponent(customFactory);
40
- }
41
- notificationRef.changeDetectorRef.detectChanges();
42
- this.notifications.push(notificationRef.instance);
43
- if (settings.appendTo) {
44
- this.applyAbsolutePosition(settings.appendTo);
45
- }
46
- this.applyPosition();
47
- this.applyContainerWrap();
48
- return {
49
- afterHide: notificationRef.instance.close,
50
- hide: function () { return notificationRef.instance.hide(customComponent); },
51
- notification: notificationRef,
52
- content: customComponent || null
53
- };
54
- };
55
- NotificationContainerComponent.prototype.hide = function (notificationRef) {
56
- var instance = notificationRef.instance;
57
- var index = this.notifications.indexOf(instance);
58
- this.notifications.splice(index, 1);
59
- if (instance.closeClickSubscription) {
60
- instance.closeClickSubscription.unsubscribe();
61
- }
62
- instance.templateRef = null;
63
- instance.templateString = null;
64
- notificationRef.destroy();
65
- };
66
- NotificationContainerComponent.prototype.applyContainerWrap = function () {
67
- var value = this.position.horizontal === 'right' ? 'wrap-reverse' : 'wrap';
68
- this.renderer.setStyle(this.group.nativeElement, 'flex-wrap', value);
69
- };
70
- NotificationContainerComponent.prototype.applySettings = function (notificationRef, settings) {
71
- var _this = this;
72
- var notification = notificationRef.instance;
73
- var content = settings.content;
74
- var animation = settings.animation || null;
75
- notification.closeClickSubscription = notification.close
76
- .subscribe(function () { return _this.hide(notificationRef); });
77
- if (typeof content === 'string') {
78
- notification.templateString = content;
79
- }
80
- if (content instanceof core_1.TemplateRef) {
81
- notification.templateRef = content;
82
- }
83
- notification.animation = animation;
84
- var type = settings.type;
85
- if (type && type.style === undefined) {
86
- type.style = 'none';
87
- }
88
- if (type && type.icon === undefined) {
89
- type.icon = true;
90
- }
91
- notification.type = type;
92
- notification.closeTitle = settings.closeTitle;
93
- if (settings.cssClass) {
94
- notification.cssClass = settings.cssClass;
95
- }
96
- notification.closable = settings.closable;
97
- notification.hideAfter = settings.hideAfter;
98
- notification.width = settings.width;
99
- notification.height = settings.height;
100
- };
101
- NotificationContainerComponent.prototype.applyAbsolutePosition = function (appendToContainer) {
102
- var appendTo = appendToContainer.element.nativeElement;
103
- var el = this.element.nativeElement.children[0];
104
- if (window.getComputedStyle(appendTo).position === 'static') {
105
- this.renderer.setStyle(appendTo, 'position', 'relative');
106
- }
107
- this.renderer.setStyle(el, 'position', 'absolute');
108
- };
109
- NotificationContainerComponent.prototype.applyPosition = function () {
110
- var element = this.element.nativeElement.children[0];
111
- var elementHalfWidth = element.getBoundingClientRect().width / 2;
112
- var positionStyles = this.setContainerPosition(this.position, elementHalfWidth);
113
- Object.keys(positionStyles).forEach(function (cssStyle) {
114
- element.style[cssStyle] = positionStyles[cssStyle];
115
- });
116
- };
117
- NotificationContainerComponent.prototype.setContainerPosition = function (position, offsetMargin) {
118
- var positionLayout = {
119
- horizontal: {
120
- left: { left: 0, alignItems: 'flex-start' },
121
- right: { right: 0, alignItems: 'flex-start' },
122
- center: { left: '50%', marginLeft: -offsetMargin + "px", alignItems: 'center' }
123
- },
124
- vertical: {
125
- top: { top: 0 },
126
- bottom: { bottom: 0 }
127
- }
128
- };
129
- var horizontal = positionLayout.horizontal[position.horizontal];
130
- var vertical = positionLayout.vertical[position.vertical];
131
- return Object.assign({}, horizontal, vertical);
132
- };
133
- tslib_1.__decorate([
134
- core_1.ViewChild('container', { read: core_1.ViewContainerRef, static: true }),
135
- tslib_1.__metadata("design:type", core_1.ViewContainerRef)
136
- ], NotificationContainerComponent.prototype, "container", void 0);
137
- tslib_1.__decorate([
138
- core_1.ViewChild('group', { static: true }),
139
- tslib_1.__metadata("design:type", core_1.ElementRef)
140
- ], NotificationContainerComponent.prototype, "group", void 0);
141
- tslib_1.__decorate([
142
- core_1.Input(),
143
- tslib_1.__metadata("design:type", String)
144
- ], NotificationContainerComponent.prototype, "id", void 0);
145
- NotificationContainerComponent = tslib_1.__decorate([
146
- core_1.Component({
147
- selector: 'kendo-notification-container',
148
- template: "\n <div #group class=\"k-notification-group\">\n <ng-container #container></ng-container>\n </div>\n "
149
- }),
150
- tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
151
- core_1.Renderer2,
152
- core_1.ComponentFactoryResolver])
153
- ], NotificationContainerComponent);
154
- return NotificationContainerComponent;
155
- }());
156
- exports.NotificationContainerComponent = NotificationContainerComponent;
@@ -1,58 +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 common_1 = require("@angular/common");
10
- var notification_service_1 = require("./services/notification.service");
11
- var notification_component_1 = require("./notification.component");
12
- var notification_container_component_1 = require("./notification.container.component");
13
- var localized_messages_directive_1 = require("./localization/localized-messages.directive");
14
- /**
15
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
16
- * definition for the Notification component.
17
- *
18
- * The package exports:
19
- * - `NotificationService`&mdash;The Notification service class.
20
- *
21
- * @example
22
- *
23
- * ```ts-no-run
24
- * // Import the Notification module
25
- * import { NotificationModule } from '@progress/kendo-angular-notification';
26
- *
27
- * // The browser platform with a compiler
28
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
29
- *
30
- * import { NgModule } from '@angular/core';
31
- *
32
- * // Import the app component
33
- * _@NgModule{{
34
- * declarations: [AppComponent], // declare app component
35
- * imports: [BrowserModule, NotificationModule], // import NotificationModule module
36
- * bootstrap: [AppComponent]
37
- * }}
38
- * export class AppModule {}
39
- *
40
- * // Compile and launch the module
41
- * platformBrowserDynamic().bootstrapModule(AppModule);
42
- * ```
43
- */
44
- var NotificationModule = /** @class */ (function () {
45
- function NotificationModule() {
46
- }
47
- NotificationModule = tslib_1.__decorate([
48
- core_1.NgModule({
49
- declarations: [notification_component_1.NotificationComponent, notification_container_component_1.NotificationContainerComponent, localized_messages_directive_1.LocalizedMessagesDirective],
50
- entryComponents: [notification_component_1.NotificationComponent, notification_container_component_1.NotificationContainerComponent],
51
- imports: [common_1.CommonModule],
52
- exports: [notification_component_1.NotificationComponent, notification_container_component_1.NotificationContainerComponent],
53
- providers: [notification_service_1.NotificationService]
54
- })
55
- ], NotificationModule);
56
- return NotificationModule;
57
- }());
58
- exports.NotificationModule = NotificationModule;
@@ -1,17 +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
- /**
8
- * @hidden
9
- */
10
- exports.packageMetadata = {
11
- name: '@progress/kendo-angular-notification',
12
- productName: 'Kendo UI for Angular',
13
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
14
- publishDate: 1646219065,
15
- version: '',
16
- 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'
17
- };