UNPKG

28.1 kBJavaScriptView Raw
1/**
2 * @license ngx-smart-modal
3 * MIT license
4 */
5
6import { ChangeDetectorRef, Component, EventEmitter, HostListener, Injectable, Input, NgModule, Output, Renderer2, ViewChild } from '@angular/core';
7import { CommonModule } from '@angular/common';
8
9/**
10 * @fileoverview added by tsickle
11 * @suppress {checkTypes} checked by tsc
12 */
13var NgxSmartModalService = (function () {
14 function NgxSmartModalService() {
15 this.modalStack = [];
16 }
17 /**
18 * Add a new modal instance. This step is essential and allows to retrieve any modal at any time.
19 * It stores an object that contains the given modal identifier and the modal itself directly in the `modalStack`.
20 *
21 * @param {?} modalInstance The object that contains the given modal identifier and the modal itself.
22 * @param {?=} force Optional parameter that forces the overriding of modal instance if it already exists.
23 * @return {?} nothing special.
24 */
25 NgxSmartModalService.prototype.addModal = /**
26 * Add a new modal instance. This step is essential and allows to retrieve any modal at any time.
27 * It stores an object that contains the given modal identifier and the modal itself directly in the `modalStack`.
28 *
29 * @param {?} modalInstance The object that contains the given modal identifier and the modal itself.
30 * @param {?=} force Optional parameter that forces the overriding of modal instance if it already exists.
31 * @return {?} nothing special.
32 */
33 function (modalInstance, force) {
34 if (force) {
35 var /** @type {?} */ i = this.modalStack.findIndex(function (o) {
36 return o.id === modalInstance.id;
37 });
38 if (i > -1) {
39 this.modalStack[i].modal = modalInstance.modal;
40 }
41 else {
42 this.modalStack.push(modalInstance);
43 }
44 return;
45 }
46 this.modalStack.push(modalInstance);
47 };
48 /**
49 * Retrieve a modal instance by its identifier.
50 *
51 * @param {?} id The modal identifier used at creation time.
52 * @return {?}
53 */
54 NgxSmartModalService.prototype.getModal = /**
55 * Retrieve a modal instance by its identifier.
56 *
57 * @param {?} id The modal identifier used at creation time.
58 * @return {?}
59 */
60 function (id) {
61 return this.modalStack.filter(function (o) {
62 return o.id === id;
63 })[0].modal;
64 };
65 /**
66 * Alias of `getModal` to retrieve a modal instance by its identifier.
67 *
68 * @param {?} id The modal identifier used at creation time.
69 * @return {?}
70 */
71 NgxSmartModalService.prototype.get = /**
72 * Alias of `getModal` to retrieve a modal instance by its identifier.
73 *
74 * @param {?} id The modal identifier used at creation time.
75 * @return {?}
76 */
77 function (id) {
78 return this.getModal(id);
79 };
80 /**
81 * Open a given modal
82 *
83 * @param {?} id The modal identifier used at creation time.
84 * @param {?=} force Tell the modal to open top of all other opened modals
85 * @return {?}
86 */
87 NgxSmartModalService.prototype.open = /**
88 * Open a given modal
89 *
90 * @param {?} id The modal identifier used at creation time.
91 * @param {?=} force Tell the modal to open top of all other opened modals
92 * @return {?}
93 */
94 function (id, force) {
95 if (force === void 0) { force = false; }
96 var /** @type {?} */ instance = this.modalStack.find(function (o) {
97 return o.id === id;
98 });
99 if (!!instance) {
100 instance.modal.open(force);
101 }
102 else {
103 throw new Error('Modal not found');
104 }
105 };
106 /**
107 * Close a given modal
108 *
109 * @param {?} id The modal identifier used at creation time.
110 * @return {?}
111 */
112 NgxSmartModalService.prototype.close = /**
113 * Close a given modal
114 *
115 * @param {?} id The modal identifier used at creation time.
116 * @return {?}
117 */
118 function (id) {
119 var /** @type {?} */ instance = this.modalStack.find(function (o) {
120 return o.id === id;
121 });
122 if (!!instance) {
123 instance.modal.close();
124 }
125 else {
126 throw new Error('Modal not found');
127 }
128 };
129 /**
130 * Toggles a given modal
131 * If the retrieved modal is opened it closes it, else it opens it.
132 *
133 * @param {?} id The modal identifier used at creation time.
134 * @param {?=} force Tell the modal to open top of all other opened modals
135 * @return {?}
136 */
137 NgxSmartModalService.prototype.toggle = /**
138 * Toggles a given modal
139 * If the retrieved modal is opened it closes it, else it opens it.
140 *
141 * @param {?} id The modal identifier used at creation time.
142 * @param {?=} force Tell the modal to open top of all other opened modals
143 * @return {?}
144 */
145 function (id, force) {
146 if (force === void 0) { force = false; }
147 var /** @type {?} */ instance = this.modalStack.find(function (o) {
148 return o.id === id;
149 });
150 if (!!instance) {
151 instance.modal.toggle(force);
152 }
153 else {
154 throw new Error('Modal not found');
155 }
156 };
157 /**
158 * Retrieve all the created modals.
159 *
160 * @return {?} an array that contains all modal instances.
161 */
162 NgxSmartModalService.prototype.getModalStack = /**
163 * Retrieve all the created modals.
164 *
165 * @return {?} an array that contains all modal instances.
166 */
167 function () {
168 return this.modalStack;
169 };
170 /**
171 * Retrieve all the opened modals. It looks for all modal instances with their `visible` property set to `true`.
172 *
173 * @return {?} an array that contains all the opened modals.
174 */
175 NgxSmartModalService.prototype.getOpenedModals = /**
176 * Retrieve all the opened modals. It looks for all modal instances with their `visible` property set to `true`.
177 *
178 * @return {?} an array that contains all the opened modals.
179 */
180 function () {
181 var /** @type {?} */ modals = [];
182 this.modalStack.forEach(function (o) {
183 if (o.modal.visible) {
184 modals.push(o);
185 }
186 });
187 return modals;
188 };
189 /**
190 * Get the higher `z-index` value between all the modal instances. It iterates over the `ModalStack` array and
191 * calculates a higher value (it takes the highest index value between all the modal instances and adds 1).
192 * Use it to make a modal appear foreground.
193 *
194 * @return {?} a higher index from all the existing modal instances.
195 */
196 NgxSmartModalService.prototype.getHigherIndex = /**
197 * Get the higher `z-index` value between all the modal instances. It iterates over the `ModalStack` array and
198 * calculates a higher value (it takes the highest index value between all the modal instances and adds 1).
199 * Use it to make a modal appear foreground.
200 *
201 * @return {?} a higher index from all the existing modal instances.
202 */
203 function () {
204 var /** @type {?} */ index = [1041];
205 var /** @type {?} */ modals = this.getModalStack();
206 modals.forEach(function (o) {
207 index.push(o.modal.layerPosition);
208 });
209 return Math.max.apply(Math, index) + 1;
210 };
211 /**
212 * It gives the number of modal instances. It's helpful to know if the modal stack is empty or not.
213 *
214 * @return {?} the number of modal instances.
215 */
216 NgxSmartModalService.prototype.getModalStackCount = /**
217 * It gives the number of modal instances. It's helpful to know if the modal stack is empty or not.
218 *
219 * @return {?} the number of modal instances.
220 */
221 function () {
222 return this.modalStack.length;
223 };
224 /**
225 * Remove a modal instance from the modal stack.
226 *
227 * @param {?} id The modal identifier.
228 * @return {?} the removed modal instance.
229 */
230 NgxSmartModalService.prototype.removeModal = /**
231 * Remove a modal instance from the modal stack.
232 *
233 * @param {?} id The modal identifier.
234 * @return {?} the removed modal instance.
235 */
236 function (id) {
237 var /** @type {?} */ i = this.modalStack.findIndex(function (o) {
238 return o.id === id;
239 });
240 if (i > -1) {
241 this.modalStack.splice(i, 1);
242 }
243 };
244 /**
245 * Associate data to an identified modal. If the modal isn't already associated to some data, it creates a new
246 * entry in the `modalData` array with its `id` and the given `data`. If the modal already has data, it rewrites
247 * them with the new ones. Finally if no modal found it returns an error message in the console and false value
248 * as method output.
249 *
250 * @param {?} data The data you want to associate to the modal.
251 * @param {?} id The modal identifier.
252 * @param {?=} force If true, overrides the previous stored data if there was.
253 * @return {?} true if the given modal exists and the process has been tried, either false.
254 */
255 NgxSmartModalService.prototype.setModalData = /**
256 * Associate data to an identified modal. If the modal isn't already associated to some data, it creates a new
257 * entry in the `modalData` array with its `id` and the given `data`. If the modal already has data, it rewrites
258 * them with the new ones. Finally if no modal found it returns an error message in the console and false value
259 * as method output.
260 *
261 * @param {?} data The data you want to associate to the modal.
262 * @param {?} id The modal identifier.
263 * @param {?=} force If true, overrides the previous stored data if there was.
264 * @return {?} true if the given modal exists and the process has been tried, either false.
265 */
266 function (data, id, force) {
267 if (!!this.modalStack.find(function (o) {
268 return o.id === id;
269 })) {
270 this.getModal(id).setData(data, force);
271 return true;
272 }
273 else {
274 return false;
275 }
276 };
277 /**
278 * Retrieve modal data by its identifier.
279 *
280 * @param {?} id The modal identifier used at creation time.
281 * @return {?} the associated modal data.
282 */
283 NgxSmartModalService.prototype.getModalData = /**
284 * Retrieve modal data by its identifier.
285 *
286 * @param {?} id The modal identifier used at creation time.
287 * @return {?} the associated modal data.
288 */
289 function (id) {
290 return this.getModal(id).getData();
291 };
292 /**
293 * Reset the data attached to a given modal.
294 *
295 * @param {?} id The modal identifier used at creation time.
296 * @return {?} the removed data or false if modal doesn't exist.
297 */
298 NgxSmartModalService.prototype.resetModalData = /**
299 * Reset the data attached to a given modal.
300 *
301 * @param {?} id The modal identifier used at creation time.
302 * @return {?} the removed data or false if modal doesn't exist.
303 */
304 function (id) {
305 if (!!this.modalStack.find(function (o) {
306 return o.id === id;
307 })) {
308 var /** @type {?} */ removed = this.getModal(id).getData();
309 this.getModal(id).removeData();
310 return removed;
311 }
312 else {
313 return false;
314 }
315 };
316 /**
317 * Close the latest opened modal if it has been declared as escapable
318 * Using a debounce system because one or more modals could be listening
319 * escape key press event.
320 * @return {?}
321 */
322 NgxSmartModalService.prototype.closeLatestModal = /**
323 * Close the latest opened modal if it has been declared as escapable
324 * Using a debounce system because one or more modals could be listening
325 * escape key press event.
326 * @return {?}
327 */
328 function () {
329 var /** @type {?} */ me = this;
330 clearTimeout(this.debouncer);
331 this.debouncer = setTimeout(function () {
332 var /** @type {?} */ tmp;
333 me.getOpenedModals().forEach(function (m) {
334 if (m.modal.layerPosition > (!!tmp ? tmp.modal.layerPosition : 0 && m.modal.escapable)) {
335 tmp = m;
336 }
337 });
338 return !!tmp ? tmp.modal.close() : false;
339 }, 100);
340 };
341 NgxSmartModalService.decorators = [
342 { type: Injectable },
343 ];
344 /** @nocollapse */
345 NgxSmartModalService.ctorParameters = function () { return []; };
346 return NgxSmartModalService;
347}());
348
349/**
350 * @fileoverview added by tsickle
351 * @suppress {checkTypes} checked by tsc
352 */
353var NgxSmartModalComponent = (function () {
354 function NgxSmartModalComponent(_renderer, _changeDetectorRef, _ngxSmartModalService) {
355 var _this = this;
356 this._renderer = _renderer;
357 this._changeDetectorRef = _changeDetectorRef;
358 this._ngxSmartModalService = _ngxSmartModalService;
359 this.closable = true;
360 this.escapable = true;
361 this.dismissable = true;
362 this.identifier = '';
363 this.customClass = 'nsm-dialog-animation-fade';
364 this.visible = false;
365 this.backdrop = true;
366 this.force = true;
367 this.hideDelay = 500;
368 this.autostart = false;
369 this.visibleChange = new EventEmitter();
370 this.onClose = new EventEmitter();
371 this.onCloseFinished = new EventEmitter();
372 this.onDismiss = new EventEmitter();
373 this.onDismissFinished = new EventEmitter();
374 this.onAnyCloseEvent = new EventEmitter();
375 this.onAnyCloseEventFinished = new EventEmitter();
376 this.onOpen = new EventEmitter();
377 this.onEscape = new EventEmitter();
378 this.onDataAdded = new EventEmitter();
379 this.onDataRemoved = new EventEmitter();
380 this.layerPosition = 1041;
381 this.overlayVisible = false;
382 this.openedClass = false;
383 this.escapeKeyboardEvent = function (event) {
384 if (event.keyCode === 27) {
385 _this.onEscape.emit(_this);
386 _this._ngxSmartModalService.closeLatestModal();
387 }
388 };
389 }
390 /**
391 * @return {?}
392 */
393 NgxSmartModalComponent.prototype.ngOnInit = /**
394 * @return {?}
395 */
396 function () {
397 if (!!this.identifier && this.identifier.length) {
398 this.layerPosition += this._ngxSmartModalService.getModalStackCount();
399 this._ngxSmartModalService.addModal({ id: this.identifier, modal: this }, this.force);
400 if (this.autostart) {
401 this._ngxSmartModalService.open(this.identifier);
402 }
403 }
404 else {
405 throw new Error('identifier field isn’t set. Please set one before calling <ngx-smart-modal> in a template.');
406 }
407 };
408 /**
409 * @return {?}
410 */
411 NgxSmartModalComponent.prototype.ngOnDestroy = /**
412 * @return {?}
413 */
414 function () {
415 this._ngxSmartModalService.removeModal(this.identifier);
416 window.removeEventListener('keyup', this.escapeKeyboardEvent);
417 if (!this._ngxSmartModalService.getModalStack.length) {
418 this._renderer.removeClass(document.body, 'dialog-open');
419 }
420 };
421 /**
422 * @param {?=} top
423 * @return {?}
424 */
425 NgxSmartModalComponent.prototype.open = /**
426 * @param {?=} top
427 * @return {?}
428 */
429 function (top) {
430 var _this = this;
431 if (top) {
432 this.layerPosition = this._ngxSmartModalService.getHigherIndex();
433 }
434 this._renderer.addClass(document.body, 'dialog-open');
435 this.overlayVisible = true;
436 this.visible = true;
437 setTimeout(function () {
438 _this.openedClass = true;
439 if (_this.target) {
440 _this.targetPlacement();
441 }
442 _this._changeDetectorRef.markForCheck();
443 });
444 this.onOpen.emit(this);
445 if (this.escapable) {
446 window.addEventListener('keyup', this.escapeKeyboardEvent);
447 }
448 };
449 /**
450 * @return {?}
451 */
452 NgxSmartModalComponent.prototype.close = /**
453 * @return {?}
454 */
455 function () {
456 var /** @type {?} */ me = this;
457 this.openedClass = false;
458 this.onClose.emit(this);
459 this.onAnyCloseEvent.emit(this);
460 if (this._ngxSmartModalService.getOpenedModals().length < 2) {
461 this._renderer.removeClass(document.body, 'dialog-open');
462 }
463 setTimeout(function () {
464 me.visibleChange.emit(me.visible);
465 me.visible = false;
466 me.overlayVisible = false;
467 me._changeDetectorRef.markForCheck();
468 me.onCloseFinished.emit(me);
469 me.onAnyCloseEventFinished.emit(me);
470 }, this.hideDelay);
471 window.removeEventListener('keyup', this.escapeKeyboardEvent);
472 };
473 /**
474 * @param {?} e
475 * @return {?}
476 */
477 NgxSmartModalComponent.prototype.dismiss = /**
478 * @param {?} e
479 * @return {?}
480 */
481 function (e) {
482 var /** @type {?} */ me = this;
483 if (!this.dismissable) {
484 return;
485 }
486 if (e.target.classList.contains('overlay')) {
487 this.openedClass = false;
488 this.onDismiss.emit(this);
489 this.onAnyCloseEvent.emit(this);
490 if (this._ngxSmartModalService.getOpenedModals().length < 2) {
491 this._renderer.removeClass(document.body, 'dialog-open');
492 }
493 setTimeout(function () {
494 me.visible = false;
495 me.visibleChange.emit(me.visible);
496 me.overlayVisible = false;
497 me._changeDetectorRef.markForCheck();
498 me.onDismissFinished.emit(me);
499 me.onAnyCloseEventFinished.emit(me);
500 }, this.hideDelay);
501 window.removeEventListener('keyup', this.escapeKeyboardEvent);
502 }
503 };
504 /**
505 * @param {?=} top
506 * @return {?}
507 */
508 NgxSmartModalComponent.prototype.toggle = /**
509 * @param {?=} top
510 * @return {?}
511 */
512 function (top) {
513 if (this.visible) {
514 this.close();
515 }
516 else {
517 this.open(top);
518 }
519 };
520 /**
521 * @param {?} className
522 * @return {?}
523 */
524 NgxSmartModalComponent.prototype.addCustomClass = /**
525 * @param {?} className
526 * @return {?}
527 */
528 function (className) {
529 if (!this.customClass.length) {
530 this.customClass = className;
531 }
532 else {
533 this.customClass += ' ' + className;
534 }
535 };
536 /**
537 * @param {?=} className
538 * @return {?}
539 */
540 NgxSmartModalComponent.prototype.removeCustomClass = /**
541 * @param {?=} className
542 * @return {?}
543 */
544 function (className) {
545 if (className) {
546 this.customClass = this.customClass.replace(className, '').trim();
547 }
548 else {
549 this.customClass = '';
550 }
551 };
552 /**
553 * @return {?}
554 */
555 NgxSmartModalComponent.prototype.isVisible = /**
556 * @return {?}
557 */
558 function () {
559 return this.visible;
560 };
561 /**
562 * @return {?}
563 */
564 NgxSmartModalComponent.prototype.hasData = /**
565 * @return {?}
566 */
567 function () {
568 return this._data !== undefined;
569 };
570 /**
571 * @param {?} data
572 * @param {?=} force
573 * @return {?}
574 */
575 NgxSmartModalComponent.prototype.setData = /**
576 * @param {?} data
577 * @param {?=} force
578 * @return {?}
579 */
580 function (data, force) {
581 if (!this.hasData() || (this.hasData() && force)) {
582 this._data = data;
583 this.onDataAdded.emit(this._data);
584 this._changeDetectorRef.markForCheck();
585 }
586 };
587 /**
588 * @return {?}
589 */
590 NgxSmartModalComponent.prototype.getData = /**
591 * @return {?}
592 */
593 function () {
594 return this._data;
595 };
596 /**
597 * @return {?}
598 */
599 NgxSmartModalComponent.prototype.removeData = /**
600 * @return {?}
601 */
602 function () {
603 this._data = undefined;
604 this.onDataRemoved.emit(true);
605 this._changeDetectorRef.markForCheck();
606 };
607 /**
608 * @return {?}
609 */
610 NgxSmartModalComponent.prototype.targetPlacement = /**
611 * @return {?}
612 */
613 function () {
614 if (!this.nsmDialog || !this.nsmContent || !this.nsmOverlay || !this.target) {
615 return;
616 }
617 var /** @type {?} */ targetElementRect = document.querySelector(this.target).getBoundingClientRect();
618 var /** @type {?} */ bodyRect = this.nsmOverlay.nativeElement.getBoundingClientRect();
619 var /** @type {?} */ nsmContentRect = this.nsmContent.nativeElement.getBoundingClientRect();
620 var /** @type {?} */ nsmDialogRect = this.nsmDialog.nativeElement.getBoundingClientRect();
621 var /** @type {?} */ marginLeft = parseInt(/** @type {?} */ (getComputedStyle(this.nsmContent.nativeElement).marginLeft), 10);
622 var /** @type {?} */ marginTop = parseInt(/** @type {?} */ (getComputedStyle(this.nsmContent.nativeElement).marginTop), 10);
623 var /** @type {?} */ offsetTop = targetElementRect.top - nsmDialogRect.top - ((nsmContentRect.height - targetElementRect.height) / 2);
624 var /** @type {?} */ offsetLeft = targetElementRect.left - nsmDialogRect.left - ((nsmContentRect.width - targetElementRect.width) / 2);
625 if (offsetLeft + nsmDialogRect.left + nsmContentRect.width + (marginLeft * 2) > bodyRect.width) {
626 offsetLeft = bodyRect.width - (nsmDialogRect.left + nsmContentRect.width) - (marginLeft * 2);
627 }
628 else if (offsetLeft + nsmDialogRect.left < 0) {
629 offsetLeft = -nsmDialogRect.left;
630 }
631 if (offsetTop + nsmDialogRect.top + nsmContentRect.height + marginTop > bodyRect.height) {
632 offsetTop = bodyRect.height - (nsmDialogRect.top + nsmContentRect.height) - marginTop;
633 }
634 if (offsetTop < 0) {
635 offsetTop = 0;
636 }
637 this._renderer.setStyle(this.nsmContent.nativeElement, 'top', offsetTop + 'px');
638 this._renderer.setStyle(this.nsmContent.nativeElement, 'left', offsetLeft + 'px');
639 };
640 NgxSmartModalComponent.decorators = [
641 { type: Component, args: [{
642 selector: 'ngx-smart-modal',
643 template: "\n <div *ngIf=\"overlayVisible\"\n [style.z-index]=\"visible ? layerPosition-1 : -1\"\n [ngClass]=\"{'transparent':!backdrop, 'overlay':true, 'nsm-overlay-open':openedClass}\"\n (click)=\"dismiss($event)\" #nsmOverlay>\n <div [style.z-index]=\"visible ? layerPosition : -1\"\n [ngClass]=\"['nsm-dialog', customClass, openedClass ? 'nsm-dialog-open': 'nsm-dialog-close']\" #nsmDialog>\n <div class=\"nsm-content\" #nsmContent>\n <div class=\"nsm-body\">\n <ng-content></ng-content>\n </div>\n <button type=\"button\" *ngIf=\"closable\" (click)=\"close()\" aria-label=\"Close\" class=\"nsm-dialog-btn-close\">\n <img\n src=\"data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCI+CjxnPgoJPGc+CgkJPHBhdGggZD0iTTUwNS45NDMsNi4wNThjLTguMDc3LTguMDc3LTIxLjE3Mi04LjA3Ny0yOS4yNDksMEw2LjA1OCw0NzYuNjkzYy04LjA3Nyw4LjA3Ny04LjA3NywyMS4xNzIsMCwyOS4yNDkgICAgQzEwLjA5Niw1MDkuOTgyLDE1LjM5LDUxMiwyMC42ODMsNTEyYzUuMjkzLDAsMTAuNTg2LTIuMDE5LDE0LjYyNS02LjA1OUw1MDUuOTQzLDM1LjMwNiAgICBDNTE0LjAxOSwyNy4yMyw1MTQuMDE5LDE0LjEzNSw1MDUuOTQzLDYuMDU4eiIgZmlsbD0iIzAwMDAwMCIvPgoJPC9nPgo8L2c+CjxnPgoJPGc+CgkJPHBhdGggZD0iTTUwNS45NDIsNDc2LjY5NEwzNS4zMDYsNi4wNTljLTguMDc2LTguMDc3LTIxLjE3Mi04LjA3Ny0yOS4yNDgsMGMtOC4wNzcsOC4wNzYtOC4wNzcsMjEuMTcxLDAsMjkuMjQ4bDQ3MC42MzYsNDcwLjYzNiAgICBjNC4wMzgsNC4wMzksOS4zMzIsNi4wNTgsMTQuNjI1LDYuMDU4YzUuMjkzLDAsMTAuNTg3LTIuMDE5LDE0LjYyNC02LjA1N0M1MTQuMDE4LDQ5Ny44NjYsNTE0LjAxOCw0ODQuNzcxLDUwNS45NDIsNDc2LjY5NHoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K\" />\n </button>\n </div>\n </div>\n </div>\n "
644 },] },
645 ];
646 /** @nocollapse */
647 NgxSmartModalComponent.ctorParameters = function () { return [
648 { type: Renderer2, },
649 { type: ChangeDetectorRef, },
650 { type: NgxSmartModalService, },
651 ]; };
652 NgxSmartModalComponent.propDecorators = {
653 "closable": [{ type: Input },],
654 "escapable": [{ type: Input },],
655 "dismissable": [{ type: Input },],
656 "identifier": [{ type: Input },],
657 "customClass": [{ type: Input },],
658 "visible": [{ type: Input },],
659 "backdrop": [{ type: Input },],
660 "force": [{ type: Input },],
661 "hideDelay": [{ type: Input },],
662 "autostart": [{ type: Input },],
663 "target": [{ type: Input },],
664 "visibleChange": [{ type: Output },],
665 "onClose": [{ type: Output },],
666 "onCloseFinished": [{ type: Output },],
667 "onDismiss": [{ type: Output },],
668 "onDismissFinished": [{ type: Output },],
669 "onAnyCloseEvent": [{ type: Output },],
670 "onAnyCloseEventFinished": [{ type: Output },],
671 "onOpen": [{ type: Output },],
672 "onEscape": [{ type: Output },],
673 "onDataAdded": [{ type: Output },],
674 "onDataRemoved": [{ type: Output },],
675 "nsmContent": [{ type: ViewChild, args: ['nsmContent',] },],
676 "nsmDialog": [{ type: ViewChild, args: ['nsmDialog',] },],
677 "nsmOverlay": [{ type: ViewChild, args: ['nsmOverlay',] },],
678 "targetPlacement": [{ type: HostListener, args: ['window:resize',] },],
679 };
680 return NgxSmartModalComponent;
681}());
682
683/**
684 * @fileoverview added by tsickle
685 * @suppress {checkTypes} checked by tsc
686 */
687var NgxSmartModalModule = (function () {
688 function NgxSmartModalModule() {
689 }
690 /**
691 * Use in AppModule: new instance of NgxSmartModal.
692 * @return {?}
693 */
694 NgxSmartModalModule.forRoot = /**
695 * Use in AppModule: new instance of NgxSmartModal.
696 * @return {?}
697 */
698 function () {
699 return {
700 ngModule: NgxSmartModalModule,
701 providers: [NgxSmartModalService]
702 };
703 };
704 /**
705 * Use in features modules with lazy loading: new instance of NgxSmartModal.
706 * @return {?}
707 */
708 NgxSmartModalModule.forChild = /**
709 * Use in features modules with lazy loading: new instance of NgxSmartModal.
710 * @return {?}
711 */
712 function () {
713 return {
714 ngModule: NgxSmartModalModule,
715 providers: [NgxSmartModalService]
716 };
717 };
718 NgxSmartModalModule.decorators = [
719 { type: NgModule, args: [{
720 declarations: [NgxSmartModalComponent],
721 exports: [NgxSmartModalComponent],
722 imports: [CommonModule]
723 },] },
724 ];
725 /** @nocollapse */
726 NgxSmartModalModule.ctorParameters = function () { return []; };
727 return NgxSmartModalModule;
728}());
729
730/**
731 * @fileoverview added by tsickle
732 * @suppress {checkTypes} checked by tsc
733 */
734// Public classes.
735
736/**
737 * @fileoverview added by tsickle
738 * @suppress {checkTypes} checked by tsc
739 */
740/**
741 * Entry point for all public APIs of the package.
742 */
743
744/**
745 * @fileoverview added by tsickle
746 * @suppress {checkTypes} checked by tsc
747 */
748/**
749 * Generated bundle index. Do not edit.
750 */
751
752export { NgxSmartModalService, NgxSmartModalComponent, NgxSmartModalModule };
753//# sourceMappingURL=ngx-smart-modal.js.map