UNPKG

39.4 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","_this","closable","escapable","dismissable","identifier","customClass","backdrop","hideDelay","autostart","visibleChange","EventEmitter","onClose","onCloseFinished","onDismiss","onDismissFinished","onAnyCloseEvent","onAnyCloseEventFinished","onOpen","onEscape","onDataAdded","onDataRemoved","overlayVisible","openedClass","escapeKeyboardEvent","event","keyCode","emit","ngOnInit","ngOnDestroy","window","removeEventListener","removeClass","document","body","top","addClass","target","targetPlacement","markForCheck","addEventListener","dismiss","e","classList","contains","addCustomClass","className","removeCustomClass","replace","trim","isVisible","hasData","undefined","_data","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,OAAO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YAAgB5D,KAAMvD,KAAKgJ,UAAWR,MAAO,eAC7CnB,aAAiB9D,KAAMvD,KAAKgJ,UAAWR,MAAO,gBAC9CrC,kBAAsB5C,KAAMvD,KAAKiJ,aAAcT,MAAO,oBAEnD9E,uBAvUkB,GA8UzBwF,oBAAuB,WACvB,SAASA,uBAuCT,OAjCAA,oBAAoBC,QAIpB,WACI,OACIC,SAAUF,oBACVG,WAAYlJ,wBAOpB+I,oBAAoBI,SAIpB,WACI,OACIF,SAAUF,oBACVG,WAAYlJ,wBAGpB+I,oBAAoB5F,aACdC,KAAMvD,KAAKuJ,SAAUf,OACXgB,cAAe9F,wBACfjE,SAAUiE,wBACV+F,SAAUxJ,OAAOyJ,kBAIjCR,oBAAoBzF,eAAiB,WAAc,UAC5CyF,oBAxCe,GA2C1BzJ,QAAQU,qBAAuBA,qBAC/BV,QAAQiE,uBAAyBA,uBACjCjE,QAAQyJ,oBAAsBA,oBAE9BS,OAAOC,eAAenK,QAAS,cAAgBoK,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 var _this = this;\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.escapeKeyboardEvent = function (event) {\n if (event.keyCode === 27) {\n _this.onEscape.emit(_this);\n _this._ngxSmartModalService.closeLatestModal();\n }\n };\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 window.removeEventListener('keyup', this.escapeKeyboardEvent);\n if (!this._ngxSmartModalService.getModalStack.length) {\n this._renderer.removeClass(document.body, 'dialog-open');\n }\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 if (this.escapable) {\n window.addEventListener('keyup', this.escapeKeyboardEvent);\n }\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 window.removeEventListener('keyup', this.escapeKeyboardEvent);\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 window.removeEventListener('keyup', this.escapeKeyboardEvent);\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 !== undefined;\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 if (!this.hasData() || (this.hasData() && force)) {\n this._data = data;\n this.onDataAdded.emit(this._data);\n this._changeDetectorRef.markForCheck();\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 this._data = undefined;\n this.onDataRemoved.emit(true);\n this._changeDetectorRef.markForCheck();\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\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LTIxLjE3Mi04LjA3Ny0yOS4yNDgsMGMtOC4wNzcsOC4wNzYtOC4wNzcsMjEuMTcxLDAsMjkuMjQ4bDQ3MC42MzYsNDcwLjYzNiAgICBjNC4wMzgsNC4wMzksOS4zMzIsNi4wNTgsMTQuNjI1LDYuMDU4YzUuMjkzLDAsMTAuNTg3LTIuMDE5LDE0LjYyNC02LjA1N0M1MTQuMDE4LDQ5Ny44NjYsNTE0LjAxOCw0ODQuNzcxLDUwNS45NDIsNDc2LjY5NHoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K\\\" />\\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 \"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