16 lines
7.2 KiB
JavaScript
16 lines
7.2 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/animations"),require("primeng/api"),require("primeng/ripple")):"function"==typeof define&&define.amd?define("primeng/messages",["exports","@angular/core","@angular/common","@angular/animations","primeng/api","primeng/ripple"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.messages={}),e.ng.core,e.ng.common,e.ng.animations,e.primeng.api,e.primeng.ripple)}(this,(function(e,t,n,s,i,a){"use strict";
|
|
/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */Object.create;function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var s,i,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(s=a.next()).done;)r.push(s.value)}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return r}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e}Object.create;var l=function(){function e(e,n,s){this.messageService=e,this.el=n,this.cd=s,this.closable=!0,this.enableService=!0,this.escape=!0,this.showTransitionOptions="300ms ease-out",this.hideTransitionOptions="200ms cubic-bezier(0.86, 0, 0.07, 1)",this.valueChange=new t.EventEmitter}return e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach((function(t){switch(t.getType()){case"content":default:e.contentTemplate=t.template}})),this.messageService&&this.enableService&&!this.contentTemplate&&(this.messageSubscription=this.messageService.messageObserver.subscribe((function(t){if(t){if(t instanceof Array){var n=t.filter((function(t){return e.key===t.key}));e.value=e.value?o(e.value,n):o(n)}else e.key===t.key&&(e.value=e.value?o(e.value,[t]):[t]);e.cd.markForCheck()}})),this.clearSubscription=this.messageService.clearObserver.subscribe((function(t){t?e.key===t&&(e.value=null):e.value=null,e.cd.markForCheck()})))},e.prototype.hasMessages=function(){var e=this.el.nativeElement.parentElement;return!(!e||!e.offsetParent)&&(null!=this.contentTemplate||this.value&&this.value.length>0)},e.prototype.clear=function(){this.value=[],this.valueChange.emit(this.value)},e.prototype.removeMessage=function(e){this.value=this.value.filter((function(t,n){return n!==e}))},Object.defineProperty(e.prototype,"icon",{get:function(){var e=this.severity||(this.hasMessages()?this.value[0].severity:null);if(this.hasMessages())switch(e){case"success":return"pi-check";case"info":return"pi-info-circle";case"error":return"pi-times";case"warn":return"pi-exclamation-triangle";default:return"pi-info-circle"}return null},enumerable:!1,configurable:!0}),e.prototype.ngOnDestroy=function(){this.messageSubscription&&this.messageSubscription.unsubscribe(),this.clearSubscription&&this.clearSubscription.unsubscribe()},e}();l.decorators=[{type:t.Component,args:[{selector:"p-messages",template:'\n <div class="p-messages p-component" role="alert" [ngStyle]="style" [class]="styleClass">\n <ng-container *ngIf="!contentTemplate; else staticMessage">\n <div *ngFor="let msg of value; let i=index" [ngClass]="\'p-message p-message-\' + msg.severity" role="alert" \n [@messageAnimation]="{value: \'visible\', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}">\n <div class="p-message-wrapper">\n <span class="p-message-icon pi" [ngClass]="{\'pi-info-circle\': msg.severity === \'info\', \n \'pi-check\': msg.severity === \'success\',\n \'pi-exclamation-triangle\': msg.severity === \'warn\',\n \'pi-times-circle\': msg.severity === \'error\'}"></span>\n <ng-container *ngIf="!escape; else escapeOut">\n <span *ngIf="msg.summary" class="p-message-summary" [innerHTML]="msg.summary"></span>\n <span *ngIf="msg.detail" class="p-message-detail" [innerHTML]="msg.detail"></span>\n </ng-container>\n <ng-template #escapeOut>\n <span *ngIf="msg.summary" class="p-message-summary">{{msg.summary}}</span>\n <span *ngIf="msg.detail" class="p-message-detail">{{msg.detail}}</span>\n </ng-template>\n <button class="p-message-close p-link" (click)="removeMessage(i)" *ngIf="closable" type="button" pRipple>\n <i class="p-message-close-icon pi pi-times"></i>\n </button>\n </div>\n </div>\n </ng-container>\n <ng-template #staticMessage>\n <div [ngClass]="\'p-message p-message-\' + severity" role="alert">\n <div class="p-message-wrapper">\n <ng-container *ngTemplateOutlet="contentTemplate"></ng-container>\n </div>\n </div>\n </ng-template>\n </div>\n ',animations:[s.trigger("messageAnimation",[s.transition(":enter",[s.style({opacity:0,transform:"translateY(-25%)"}),s.animate("{{showTransitionParams}}")]),s.transition(":leave",[s.animate("{{hideTransitionParams}}",s.style({height:0,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,overflow:"hidden",opacity:0}))])])],changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,styles:[".p-message-close,.p-message-wrapper{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}.p-message-close{-ms-flex-pack:center;justify-content:center}.p-message-close.p-link{margin-left:auto;overflow:hidden;position:relative}"]}]}],l.ctorParameters=function(){return[{type:i.MessageService,decorators:[{type:t.Optional}]},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},l.propDecorators={value:[{type:t.Input}],closable:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],enableService:[{type:t.Input}],key:[{type:t.Input}],escape:[{type:t.Input}],severity:[{type:t.Input}],showTransitionOptions:[{type:t.Input}],hideTransitionOptions:[{type:t.Input}],templates:[{type:t.ContentChildren,args:[i.PrimeTemplate]}],valueChange:[{type:t.Output}]};var p=function(){};p.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,a.RippleModule],exports:[l],declarations:[l]}]}],e.Messages=l,e.MessagesModule=p,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
//# sourceMappingURL=primeng-messages.umd.min.js.map
|