UNPKG

39.2 kBSource Map (JSON)View Raw
1{"version":3,"sources":["ngx-smart-modal.umd.js"],"names":["global","factory","exports","module","require","define","amd","ng","ngxSmartModal","core","common","this","NgxSmartModalService","modalStack","prototype","addModal","modalInstance","force","i","findIndex","o","id","modal","push","getModal","filter","get","open","instance","find","Error","close","toggle","getModalStack","getOpenedModals","modals","forEach","visible","getHigherIndex","index","layerPosition","Math","max","apply","getModalStackCount","length","removeModal","splice","setModalData","data","setData","getModalData","getData","resetModalData","removed","removeData","closeLatestModal","me","clearTimeout","debouncer","setTimeout","tmp","m","decorators","type","Injectable","ctorParameters","NgxSmartModalComponent","_renderer","_changeDetectorRef","_ngxSmartModalService","closable","escapable","dismissable","identifier","customClass","backdrop","hideDelay","autostart","visibleChange","EventEmitter","onClose","onCloseFinished","onDismiss","onDismissFinished","onAnyCloseEvent","onAnyCloseEventFinished","onOpen","onEscape","onDataAdded","onDataRemoved","overlayVisible","openedClass","_data","ngOnInit","ngOnDestroy","top","_this","addClass","document","body","target","targetPlacement","markForCheck","emit","removeClass","dismiss","e","classList","contains","addCustomClass","className","removeCustomClass","replace","trim","isVisible","hasData","escapeKeyboardEvent","event","keyCode","nsmDialog","nsmContent","nsmOverlay","targetElementRect","querySelector","getBoundingClientRect","bodyRect","nativeElement","nsmContentRect","nsmDialogRect","marginLeft","parseInt","getComputedStyle","marginTop","offsetTop","height","offsetLeft","left","width","setStyle","Component","args","selector","template","Renderer2","ChangeDetectorRef","propDecorators","Input","Output","ViewChild","HostListener","NgxSmartModalModule","forRoot","ngModule","providers","forChild","NgModule","declarations","imports","CommonModule","Object","defineProperty","value"],"mappings":"CAAC,SAAUA,OAAQC,SACC,iBAAZC,SAA0C,oBAAXC,OAAyBF,QAAQC,QAASE,QAAQ,iBAAkBA,QAAQ,oBAChG,mBAAXC,QAAyBA,OAAOC,IAAMD,QAAQ,UAAW,gBAAiB,mBAAoBJ,SACpGA,SAASD,OAAOO,GAAKP,OAAOO,OAAUP,OAAOO,GAAGC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AEnD1E,uBAhVkB,GAuVzBoF,oBAAuB,WACvB,SAASA,uBAuCT,OAjCAA,oBAAoBC,QAIpB,WACI,OACIC,SAAUF,oBACVG,WAAY9I,wBAOpB2I,oBAAoBI,SAIpB,WACI,OACIF,SAAUF,oBACVG,WAAY9I,wBAGpB2I,oBAAoBxF,aACdC,KAAMvD,KAAKmJ,SAAUf,OACXgB,cAAe1F,wBACfjE,SAAUiE,wBACV2F,SAAUpJ,OAAOqJ,kBAIjCR,oBAAoBrF,eAAiB,WAAc,UAC5CqF,oBAxCe,GA2C1BrJ,QAAQU,qBAAuBA,qBAC/BV,QAAQiE,uBAAyBA,uBACjCjE,QAAQqJ,oBAAsBA,oBAE9BS,OAAOC,eAAe/J,QAAS,cAAgBgK,OAAO","file":"ngx-smart-modal.umd.min.js.map","sourcesContent":["(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :\n\ttypeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common'], factory) :\n\t(factory((global.ng = global.ng || {}, global.ng.ngxSmartModal = {}),global.ng.core,global.ng.common));\n}(this, (function (exports,core,common) { 'use strict';\n\n/**\n * @license ngx-smart-modal\n * MIT license\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar NgxSmartModalService = (function () {\n function NgxSmartModalService() {\n this.modalStack = [];\n }\n /**\n * Add a new modal instance. This step is essential and allows to retrieve any modal at any time.\n * It stores an object that contains the given modal identifier and the modal itself directly in the `modalStack`.\n *\n * @param {?} modalInstance The object that contains the given modal identifier and the modal itself.\n * @param {?=} force Optional parameter that forces the overriding of modal instance if it already exists.\n * @return {?} nothing special.\n */\n NgxSmartModalService.prototype.addModal = /**\n * Add a new modal instance. This step is essential and allows to retrieve any modal at any time.\n * It stores an object that contains the given modal identifier and the modal itself directly in the `modalStack`.\n *\n * @param {?} modalInstance The object that contains the given modal identifier and the modal itself.\n * @param {?=} force Optional parameter that forces the overriding of modal instance if it already exists.\n * @return {?} nothing special.\n */\n function (modalInstance, force) {\n if (force) {\n var /** @type {?} */ i = this.modalStack.findIndex(function (o) {\n return o.id === modalInstance.id;\n });\n if (i > -1) {\n this.modalStack[i].modal = modalInstance.modal;\n }\n else {\n this.modalStack.push(modalInstance);\n }\n return;\n }\n this.modalStack.push(modalInstance);\n };\n /**\n * Retrieve a modal instance by its identifier.\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?}\n */\n NgxSmartModalService.prototype.getModal = /**\n * Retrieve a modal instance by its identifier.\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?}\n */\n function (id) {\n return this.modalStack.filter(function (o) {\n return o.id === id;\n })[0].modal;\n };\n /**\n * Alias of `getModal` to retrieve a modal instance by its identifier.\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?}\n */\n NgxSmartModalService.prototype.get = /**\n * Alias of `getModal` to retrieve a modal instance by its identifier.\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?}\n */\n function (id) {\n return this.getModal(id);\n };\n /**\n * Open a given modal\n *\n * @param {?} id The modal identifier used at creation time.\n * @param {?=} force Tell the modal to open top of all other opened modals\n * @return {?}\n */\n NgxSmartModalService.prototype.open = /**\n * Open a given modal\n *\n * @param {?} id The modal identifier used at creation time.\n * @param {?=} force Tell the modal to open top of all other opened modals\n * @return {?}\n */\n function (id, force) {\n if (force === void 0) { force = false; }\n var /** @type {?} */ instance = this.modalStack.find(function (o) {\n return o.id === id;\n });\n if (!!instance) {\n instance.modal.open(force);\n }\n else {\n throw new Error('Modal not found');\n }\n };\n /**\n * Close a given modal\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?}\n */\n NgxSmartModalService.prototype.close = /**\n * Close a given modal\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?}\n */\n function (id) {\n var /** @type {?} */ instance = this.modalStack.find(function (o) {\n return o.id === id;\n });\n if (!!instance) {\n instance.modal.close();\n }\n else {\n throw new Error('Modal not found');\n }\n };\n /**\n * Toggles a given modal\n * If the retrieved modal is opened it closes it, else it opens it.\n *\n * @param {?} id The modal identifier used at creation time.\n * @param {?=} force Tell the modal to open top of all other opened modals\n * @return {?}\n */\n NgxSmartModalService.prototype.toggle = /**\n * Toggles a given modal\n * If the retrieved modal is opened it closes it, else it opens it.\n *\n * @param {?} id The modal identifier used at creation time.\n * @param {?=} force Tell the modal to open top of all other opened modals\n * @return {?}\n */\n function (id, force) {\n if (force === void 0) { force = false; }\n var /** @type {?} */ instance = this.modalStack.find(function (o) {\n return o.id === id;\n });\n if (!!instance) {\n instance.modal.toggle(force);\n }\n else {\n throw new Error('Modal not found');\n }\n };\n /**\n * Retrieve all the created modals.\n *\n * @return {?} an array that contains all modal instances.\n */\n NgxSmartModalService.prototype.getModalStack = /**\n * Retrieve all the created modals.\n *\n * @return {?} an array that contains all modal instances.\n */\n function () {\n return this.modalStack;\n };\n /**\n * Retrieve all the opened modals. It looks for all modal instances with their `visible` property set to `true`.\n *\n * @return {?} an array that contains all the opened modals.\n */\n NgxSmartModalService.prototype.getOpenedModals = /**\n * Retrieve all the opened modals. It looks for all modal instances with their `visible` property set to `true`.\n *\n * @return {?} an array that contains all the opened modals.\n */\n function () {\n var /** @type {?} */ modals = [];\n this.modalStack.forEach(function (o) {\n if (o.modal.visible) {\n modals.push(o);\n }\n });\n return modals;\n };\n /**\n * Get the higher `z-index` value between all the modal instances. It iterates over the `ModalStack` array and\n * calculates a higher value (it takes the highest index value between all the modal instances and adds 1).\n * Use it to make a modal appear foreground.\n *\n * @return {?} a higher index from all the existing modal instances.\n */\n NgxSmartModalService.prototype.getHigherIndex = /**\n * Get the higher `z-index` value between all the modal instances. It iterates over the `ModalStack` array and\n * calculates a higher value (it takes the highest index value between all the modal instances and adds 1).\n * Use it to make a modal appear foreground.\n *\n * @return {?} a higher index from all the existing modal instances.\n */\n function () {\n var /** @type {?} */ index = [1041];\n var /** @type {?} */ modals = this.getModalStack();\n modals.forEach(function (o) {\n index.push(o.modal.layerPosition);\n });\n return Math.max.apply(Math, index) + 1;\n };\n /**\n * It gives the number of modal instances. It's helpful to know if the modal stack is empty or not.\n *\n * @return {?} the number of modal instances.\n */\n NgxSmartModalService.prototype.getModalStackCount = /**\n * It gives the number of modal instances. It's helpful to know if the modal stack is empty or not.\n *\n * @return {?} the number of modal instances.\n */\n function () {\n return this.modalStack.length;\n };\n /**\n * Remove a modal instance from the modal stack.\n *\n * @param {?} id The modal identifier.\n * @return {?} the removed modal instance.\n */\n NgxSmartModalService.prototype.removeModal = /**\n * Remove a modal instance from the modal stack.\n *\n * @param {?} id The modal identifier.\n * @return {?} the removed modal instance.\n */\n function (id) {\n var /** @type {?} */ i = this.modalStack.findIndex(function (o) {\n return o.id === id;\n });\n if (i > -1) {\n this.modalStack.splice(i, 1);\n }\n };\n /**\n * Associate data to an identified modal. If the modal isn't already associated to some data, it creates a new\n * entry in the `modalData` array with its `id` and the given `data`. If the modal already has data, it rewrites\n * them with the new ones. Finally if no modal found it returns an error message in the console and false value\n * as method output.\n *\n * @param {?} data The data you want to associate to the modal.\n * @param {?} id The modal identifier.\n * @param {?=} force If true, overrides the previous stored data if there was.\n * @return {?} true if the given modal exists and the process has been tried, either false.\n */\n NgxSmartModalService.prototype.setModalData = /**\n * Associate data to an identified modal. If the modal isn't already associated to some data, it creates a new\n * entry in the `modalData` array with its `id` and the given `data`. If the modal already has data, it rewrites\n * them with the new ones. Finally if no modal found it returns an error message in the console and false value\n * as method output.\n *\n * @param {?} data The data you want to associate to the modal.\n * @param {?} id The modal identifier.\n * @param {?=} force If true, overrides the previous stored data if there was.\n * @return {?} true if the given modal exists and the process has been tried, either false.\n */\n function (data, id, force) {\n if (!!this.modalStack.find(function (o) {\n return o.id === id;\n })) {\n this.getModal(id).setData(data, force);\n return true;\n }\n else {\n return false;\n }\n };\n /**\n * Retrieve modal data by its identifier.\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?} the associated modal data.\n */\n NgxSmartModalService.prototype.getModalData = /**\n * Retrieve modal data by its identifier.\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?} the associated modal data.\n */\n function (id) {\n return this.getModal(id).getData();\n };\n /**\n * Reset the data attached to a given modal.\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?} the removed data or false if modal doesn't exist.\n */\n NgxSmartModalService.prototype.resetModalData = /**\n * Reset the data attached to a given modal.\n *\n * @param {?} id The modal identifier used at creation time.\n * @return {?} the removed data or false if modal doesn't exist.\n */\n function (id) {\n if (!!this.modalStack.find(function (o) {\n return o.id === id;\n })) {\n var /** @type {?} */ removed = this.getModal(id).getData();\n this.getModal(id).removeData();\n return removed;\n }\n else {\n return false;\n }\n };\n /**\n * Close the latest opened modal if it has been declared as escapable\n * Using a debounce system because one or more modals could be listening\n * escape key press event.\n * @return {?}\n */\n NgxSmartModalService.prototype.closeLatestModal = /**\n * Close the latest opened modal if it has been declared as escapable\n * Using a debounce system because one or more modals could be listening\n * escape key press event.\n * @return {?}\n */\n function () {\n var /** @type {?} */ me = this;\n clearTimeout(this.debouncer);\n this.debouncer = setTimeout(function () {\n var /** @type {?} */ tmp;\n me.getOpenedModals().forEach(function (m) {\n if (m.modal.layerPosition > (!!tmp ? tmp.modal.layerPosition : 0 && m.modal.escapable)) {\n tmp = m;\n }\n });\n return !!tmp ? tmp.modal.close() : false;\n }, 100);\n };\n NgxSmartModalService.decorators = [\n { type: core.Injectable },\n ];\n /** @nocollapse */\n NgxSmartModalService.ctorParameters = function () { return []; };\n return NgxSmartModalService;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar NgxSmartModalComponent = (function () {\n function NgxSmartModalComponent(_renderer, _changeDetectorRef, _ngxSmartModalService) {\n this._renderer = _renderer;\n this._changeDetectorRef = _changeDetectorRef;\n this._ngxSmartModalService = _ngxSmartModalService;\n this.closable = true;\n this.escapable = true;\n this.dismissable = true;\n this.identifier = '';\n this.customClass = 'nsm-dialog-animation-fade';\n this.visible = false;\n this.backdrop = true;\n this.force = true;\n this.hideDelay = 500;\n this.autostart = false;\n this.visibleChange = new core.EventEmitter();\n this.onClose = new core.EventEmitter();\n this.onCloseFinished = new core.EventEmitter();\n this.onDismiss = new core.EventEmitter();\n this.onDismissFinished = new core.EventEmitter();\n this.onAnyCloseEvent = new core.EventEmitter();\n this.onAnyCloseEventFinished = new core.EventEmitter();\n this.onOpen = new core.EventEmitter();\n this.onEscape = new core.EventEmitter();\n this.onDataAdded = new core.EventEmitter();\n this.onDataRemoved = new core.EventEmitter();\n this.layerPosition = 1041;\n this.overlayVisible = false;\n this.openedClass = false;\n this._data = null;\n }\n /**\n * @return {?}\n */\n NgxSmartModalComponent.prototype.ngOnInit = /**\n * @return {?}\n */\n function () {\n if (!!this.identifier && this.identifier.length) {\n this.layerPosition += this._ngxSmartModalService.getModalStackCount();\n this._ngxSmartModalService.addModal({ id: this.identifier, modal: this }, this.force);\n if (this.autostart) {\n this._ngxSmartModalService.open(this.identifier);\n }\n }\n else {\n throw new Error('identifier field isn’t set. Please set one before calling <ngx-smart-modal> in a template.');\n }\n };\n /**\n * @return {?}\n */\n NgxSmartModalComponent.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n this._ngxSmartModalService.removeModal(this.identifier);\n };\n /**\n * @param {?=} top\n * @return {?}\n */\n NgxSmartModalComponent.prototype.open = /**\n * @param {?=} top\n * @return {?}\n */\n function (top) {\n var _this = this;\n if (top) {\n this.layerPosition = this._ngxSmartModalService.getHigherIndex();\n }\n this._renderer.addClass(document.body, 'dialog-open');\n this.overlayVisible = true;\n this.visible = true;\n setTimeout(function () {\n _this.openedClass = true;\n if (_this.target) {\n _this.targetPlacement();\n }\n _this._changeDetectorRef.markForCheck();\n });\n this.onOpen.emit(this);\n };\n /**\n * @return {?}\n */\n NgxSmartModalComponent.prototype.close = /**\n * @return {?}\n */\n function () {\n var /** @type {?} */ me = this;\n this.openedClass = false;\n this.onClose.emit(this);\n this.onAnyCloseEvent.emit(this);\n if (this._ngxSmartModalService.getOpenedModals().length < 2) {\n this._renderer.removeClass(document.body, 'dialog-open');\n }\n setTimeout(function () {\n me.visibleChange.emit(me.visible);\n me.visible = false;\n me.overlayVisible = false;\n me._changeDetectorRef.markForCheck();\n me.onCloseFinished.emit(me);\n me.onAnyCloseEventFinished.emit(me);\n }, this.hideDelay);\n };\n /**\n * @param {?} e\n * @return {?}\n */\n NgxSmartModalComponent.prototype.dismiss = /**\n * @param {?} e\n * @return {?}\n */\n function (e) {\n var /** @type {?} */ me = this;\n if (!this.dismissable) {\n return;\n }\n if (e.target.classList.contains('overlay')) {\n this.openedClass = false;\n this.onDismiss.emit(this);\n this.onAnyCloseEvent.emit(this);\n if (this._ngxSmartModalService.getOpenedModals().length < 2) {\n this._renderer.removeClass(document.body, 'dialog-open');\n }\n setTimeout(function () {\n me.visible = false;\n me.visibleChange.emit(me.visible);\n me.overlayVisible = false;\n me._changeDetectorRef.markForCheck();\n me.onDismissFinished.emit(me);\n me.onAnyCloseEventFinished.emit(me);\n }, this.hideDelay);\n }\n };\n /**\n * @param {?=} top\n * @return {?}\n */\n NgxSmartModalComponent.prototype.toggle = /**\n * @param {?=} top\n * @return {?}\n */\n function (top) {\n if (this.visible) {\n this.close();\n }\n else {\n this.open(top);\n }\n };\n /**\n * @param {?} className\n * @return {?}\n */\n NgxSmartModalComponent.prototype.addCustomClass = /**\n * @param {?} className\n * @return {?}\n */\n function (className) {\n if (!this.customClass.length) {\n this.customClass = className;\n }\n else {\n this.customClass += ' ' + className;\n }\n };\n /**\n * @param {?=} className\n * @return {?}\n */\n NgxSmartModalComponent.prototype.removeCustomClass = /**\n * @param {?=} className\n * @return {?}\n */\n function (className) {\n if (className) {\n this.customClass = this.customClass.replace(className, '').trim();\n }\n else {\n this.customClass = '';\n }\n };\n /**\n * @return {?}\n */\n NgxSmartModalComponent.prototype.isVisible = /**\n * @return {?}\n */\n function () {\n return this.visible;\n };\n /**\n * @return {?}\n */\n NgxSmartModalComponent.prototype.hasData = /**\n * @return {?}\n */\n function () {\n return !!this._data;\n };\n /**\n * @param {?} data\n * @param {?=} force\n * @return {?}\n */\n NgxSmartModalComponent.prototype.setData = /**\n * @param {?} data\n * @param {?=} force\n * @return {?}\n */\n function (data, force) {\n var _this = this;\n if (!this._data || (!!this._data && force)) {\n setTimeout(function () {\n _this._data = data;\n _this.onDataAdded.emit(_this._data);\n });\n }\n };\n /**\n * @return {?}\n */\n NgxSmartModalComponent.prototype.getData = /**\n * @return {?}\n */\n function () {\n return this._data;\n };\n /**\n * @return {?}\n */\n NgxSmartModalComponent.prototype.removeData = /**\n * @return {?}\n */\n function () {\n var _this = this;\n setTimeout(function () {\n _this._data = null;\n _this.onDataRemoved.emit(true);\n });\n };\n /**\n * @param {?} event\n * @return {?}\n */\n NgxSmartModalComponent.prototype.escapeKeyboardEvent = /**\n * @param {?} event\n * @return {?}\n */\n function (event) {\n if (event.keyCode === 27 && this.visible) {\n if (!this.escapable) {\n return false;\n }\n else {\n this.onEscape.emit(this);\n this._ngxSmartModalService.closeLatestModal();\n }\n }\n };\n /**\n * @return {?}\n */\n NgxSmartModalComponent.prototype.targetPlacement = /**\n * @return {?}\n */\n function () {\n if (!this.nsmDialog || !this.nsmContent || !this.nsmOverlay || !this.target) {\n return;\n }\n var /** @type {?} */ targetElementRect = document.querySelector(this.target).getBoundingClientRect();\n var /** @type {?} */ bodyRect = this.nsmOverlay.nativeElement.getBoundingClientRect();\n var /** @type {?} */ nsmContentRect = this.nsmContent.nativeElement.getBoundingClientRect();\n var /** @type {?} */ nsmDialogRect = this.nsmDialog.nativeElement.getBoundingClientRect();\n var /** @type {?} */ marginLeft = parseInt(/** @type {?} */ (getComputedStyle(this.nsmContent.nativeElement).marginLeft), 10);\n var /** @type {?} */ marginTop = parseInt(/** @type {?} */ (getComputedStyle(this.nsmContent.nativeElement).marginTop), 10);\n var /** @type {?} */ offsetTop = targetElementRect.top - nsmDialogRect.top - ((nsmContentRect.height - targetElementRect.height) / 2);\n var /** @type {?} */ offsetLeft = targetElementRect.left - nsmDialogRect.left - ((nsmContentRect.width - targetElementRect.width) / 2);\n if (offsetLeft + nsmDialogRect.left + nsmContentRect.width + (marginLeft * 2) > bodyRect.width) {\n offsetLeft = bodyRect.width - (nsmDialogRect.left + nsmContentRect.width) - (marginLeft * 2);\n }\n else if (offsetLeft + nsmDialogRect.left < 0) {\n offsetLeft = -nsmDialogRect.left;\n }\n if (offsetTop + nsmDialogRect.top + nsmContentRect.height + marginTop > bodyRect.height) {\n offsetTop = bodyRect.height - (nsmDialogRect.top + nsmContentRect.height) - marginTop;\n }\n if (offsetTop < 0) {\n offsetTop = 0;\n }\n this._renderer.setStyle(this.nsmContent.nativeElement, 'top', offsetTop + 'px');\n this._renderer.setStyle(this.nsmContent.nativeElement, 'left', offsetLeft + 'px');\n };\n NgxSmartModalComponent.decorators = [\n { type: core.Component, args: [{\n selector: 'ngx-smart-modal',\n 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/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IF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Ny44NjYsNTE0LjAxOCw0ODQuNzcxLDUwNS45NDIsNDc2LjY5NHoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K\\\" />\\n </button>\\n </div>\\n </div>\\n </div>\\n \"\n },] },\n ];\n /** @nocollapse */\n NgxSmartModalComponent.ctorParameters = function () { return [\n { type: core.Renderer2, },\n { type: core.ChangeDetectorRef, },\n { type: NgxSmartModalService, },\n ]; };\n NgxSmartModalComponent.propDecorators = {\n \"closable\": [{ type: core.Input },],\n \"escapable\": [{ type: core.Input },],\n \"dismissable\": [{ type: core.Input },],\n \"identifier\": [{ type: core.Input },],\n \"customClass\": [{ type: core.Input },],\n \"visible\": [{ type: core.Input },],\n \"backdrop\": [{ type: core.Input },],\n \"force\": [{ type: core.Input },],\n \"hideDelay\": [{ type: core.Input },],\n \"autostart\": [{ type: core.Input },],\n \"target\": [{ type: core.Input },],\n \"visibleChange\": [{ type: core.Output },],\n \"onClose\": [{ type: core.Output },],\n \"onCloseFinished\": [{ type: core.Output },],\n \"onDismiss\": [{ type: core.Output },],\n \"onDismissFinished\": [{ type: core.Output },],\n \"onAnyCloseEvent\": [{ type: core.Output },],\n \"onAnyCloseEventFinished\": [{ type: core.Output },],\n \"onOpen\": [{ type: core.Output },],\n \"onEscape\": [{ type: core.Output },],\n \"onDataAdded\": [{ type: core.Output },],\n \"onDataRemoved\": [{ type: core.Output },],\n \"nsmContent\": [{ type: core.ViewChild, args: ['nsmContent',] },],\n \"nsmDialog\": [{ type: core.ViewChild, args: ['nsmDialog',] },],\n \"nsmOverlay\": [{ type: core.ViewChild, args: ['nsmOverlay',] },],\n \"escapeKeyboardEvent\": [{ type: core.HostListener, args: ['document:keyup', ['$event'],] },],\n \"targetPlacement\": [{ type: core.HostListener, args: ['window:resize',] },],\n };\n return NgxSmartModalComponent;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar NgxSmartModalModule = (function () {\n function NgxSmartModalModule() {\n }\n /**\n * Use in AppModule: new instance of NgxSmartModal.\n * @return {?}\n */\n NgxSmartModalModule.forRoot = /**\n * Use in AppModule: new instance of NgxSmartModal.\n * @return {?}\n */\n function () {\n return {\n ngModule: NgxSmartModalModule,\n providers: [NgxSmartModalService]\n };\n };\n /**\n * Use in features modules with lazy loading: new instance of NgxSmartModal.\n * @return {?}\n */\n NgxSmartModalModule.forChild = /**\n * Use in features modules with lazy loading: new instance of NgxSmartModal.\n * @return {?}\n */\n function () {\n return {\n ngModule: NgxSmartModalModule,\n providers: [NgxSmartModalService]\n };\n };\n NgxSmartModalModule.decorators = [\n { type: core.NgModule, args: [{\n declarations: [NgxSmartModalComponent],\n exports: [NgxSmartModalComponent],\n imports: [common.CommonModule]\n },] },\n ];\n /** @nocollapse */\n NgxSmartModalModule.ctorParameters = function () { return []; };\n return NgxSmartModalModule;\n}());\n\nexports.NgxSmartModalService = NgxSmartModalService;\nexports.NgxSmartModalComponent = NgxSmartModalComponent;\nexports.NgxSmartModalModule = NgxSmartModalModule;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=ngx-smart-modal.umd.js.map\n"]}
\No newline at end of file