mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
13 KiB
2 lines
13 KiB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@abp/ng.core"),require("@angular/core"),require("@ng-bootstrap/ng-bootstrap"),require("@ngx-validate/core"),require("primeng/components/common/messageservice"),require("primeng/toast"),require("rxjs"),require("rxjs/operators"),require("@ngxs/router-plugin"),require("@ngxs/store")):"function"==typeof define&&define.amd?define("@abp/ng.theme.shared",["exports","@abp/ng.core","@angular/core","@ng-bootstrap/ng-bootstrap","@ngx-validate/core","primeng/components/common/messageservice","primeng/toast","rxjs","rxjs/operators","@ngxs/router-plugin","@ngxs/store"],t):t(((e=e||self).abp=e.abp||{},e.abp.ng=e.abp.ng||{},e.abp.ng.theme=e.abp.ng.theme||{},e.abp.ng.theme.shared={}),e.ng_core,e.ng.core,e.ngBootstrap,e.core$1,e.messageservice,e.toast,e.rxjs,e.rxjs.operators,e.routerPlugin,e.store)}(this,function(e,t,n,o,r,i,s,a,c,l,u){"use strict";var d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function p(e,t){function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var m=function(){return(m=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s}var b=function(){function e(e){this.messageService=e,this.key="abpToast",this.sticky=!1}return e.prototype.info=function(e,t,n){return this.show(e,t,"info",n)},e.prototype.success=function(e,t,n){return this.show(e,t,"success",n)},e.prototype.warn=function(e,t,n){return this.show(e,t,"warn",n)},e.prototype.error=function(e,t,n){return this.show(e,t,"error",n)},e.prototype.show=function(e,t,n,o){return this.messageService.clear(this.key),this.messageService.add(m({severity:n,detail:e,summary:t},o,{key:this.key},void 0===(o||{}).sticky&&{sticky:this.sticky})),this.status$=new a.Subject,this.status$},e.prototype.clear=function(e){this.messageService.clear(this.key),this.status$.next(e||"dismiss"),this.status$.complete()},e}(),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.key="abpConfirmation",t.sticky=!0,t}return p(t,e),t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new t(n.ɵɵinject(i.MessageService))},token:t,providedIn:"root"}),t}(b),h=function(){function e(e){this.confirmationService=e,this.confirm="confirm",this.reject="reject",this.dismiss="dismiss"}return e.prototype.close=function(e){this.confirmationService.clear(e)},e.decorators=[{type:n.Component,args:[{selector:"abp-confirmation",template:'\n <p-toast\n position="center"\n key="abpConfirmation"\n (onClose)="close(dismiss)"\n [modal]="true"\n [baseZIndex]="1000"\n styleClass=""\n >\n <ng-template let-message pTemplate="message">\n <div *ngIf="message.summary" class="modal-header">\n <h4 class="modal-title">\n {{ message.summary | abpLocalization: message.titleLocalizationParams }}\n </h4>\n </div>\n <div class="modal-body">\n {{ message.detail | abpLocalization: message.messageLocalizationParams }}\n </div>\n\n <div class="modal-footer justify-content-center">\n <button *ngIf="!message.hideCancelBtn" type="button" class="btn btn-secondary" (click)="close(reject)">\n {{ message.cancelCopy || \'AbpIdentity::Cancel\' | abpLocalization }}\n </button>\n <button *ngIf="!message.hideYesBtn" type="button" class="btn btn-secondary" (click)="close(confirm)">\n <span>{{ message.yesCopy || \'AbpIdentity::Yes\' | abpLocalization }}</span>\n </button>\n </div>\n </ng-template>\n </p-toast>\n '}]}],e.ctorParameters=function(){return[{type:g}]},e}(),y=function(){function e(e,t){this.renderer=e,this.confirmationService=t,this.centered=!0,this.modalClass="",this.size="lg",this.visibleChange=new n.EventEmitter,this._visible=!1,this.closable=!1,this.isOpenConfirmation=!1,this.destroy$=new a.Subject}return Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){var t=this;this.modalContent?e?(this.setVisible(e),this.listen()):(this.closable=!1,this.renderer.addClass(this.modalContent.nativeElement,"fade-out-top"),setTimeout(function(){t.setVisible(e),t.renderer.removeClass(t.modalContent.nativeElement,"fade-out-top"),t.ngOnDestroy()},350)):setTimeout(function(){return t.visible=e},0)},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.destroy$.next()},e.prototype.setVisible=function(e){var t=this;this._visible=e,this.visibleChange.emit(e),e?a.timer(500).pipe(c.take(1)).subscribe(function(e){return t.closable=!0}):this.closable=!1},e.prototype.listen=function(){var e=this;a.fromEvent(document,"click").pipe(c.debounceTime(350),c.takeUntil(this.destroy$),c.filter(function(t){return t&&e.closable&&e.modalContent&&!e.isOpenConfirmation&&!e.modalContent.nativeElement.contains(t.target)})).subscribe(function(t){e.close()}),a.fromEvent(document,"keyup").pipe(c.takeUntil(this.destroy$),c.filter(function(t){return t&&"Escape"===t.code&&e.closable}),c.debounceTime(350)).subscribe(function(t){e.close()}),a.fromEvent(this.abpClose.nativeElement,"click").pipe(c.takeUntil(this.destroy$),c.filter(function(){return!(!e.closable||!e.modalContent)}),c.debounceTime(350)).subscribe(function(){return e.close()})},e.prototype.close=function(){var e=this;if(function(e){return e.findIndex(function(e){return(e.className||"").indexOf("ng-dirty")>-1})>-1}(function(e){return Array.from(e).reduce(function(e,t){return function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}(e,t.childNodes&&t.childNodes.length?Array.from(t.childNodes):[t])},[])}(this.modalContent.nativeElement.querySelector("#abp-modal-body").childNodes))){if(this.isOpenConfirmation)return;this.isOpenConfirmation=!0,this.confirmationService.warn("AbpAccount::AreYouSureYouWantToCancelEditingWarningMessage","AbpAccount::AreYouSure").subscribe(function(t){a.timer(400).subscribe(function(){e.isOpenConfirmation=!1}),"confirm"===t&&(e.visible=!1)})}else this.visible=!1},e.decorators=[{type:n.Component,args:[{selector:"abp-modal",template:'<div\n id="abp-modal"\n tabindex="-1"\n class="modal fade {{ modalClass }}"\n [class.show]="visible"\n [style.display]="visible ? \'block\' : \'none\'"\n [style.padding-right.px]="\'15\'"\n>\n <div\n id="abp-modal-container"\n class="modal-dialog modal-{{ size }} fade-in-top"\n [class.modal-dialog-centered]="centered"\n #abpModalContent\n >\n <div #content id="abp-modal-content" class="modal-content">\n <div id="abp-modal-header" class="modal-header">\n <ng-container *ngTemplateOutlet="abpHeader"></ng-container>\n\n <button id="abp-modal-close-button" type="button" class="close" (click)="close()">\n <span aria-hidden="true">×</span>\n </button>\n </div>\n <div id="abp-modal-body" class="modal-body">\n <ng-container *ngTemplateOutlet="abpBody"></ng-container>\n\n <div id="abp-modal-footer" class="modal-footer">\n <ng-container *ngTemplateOutlet="abpFooter"></ng-container>\n </div>\n </div>\n </div>\n </div>\n\n <ng-content></ng-content>\n</div>\n'}]}],e.ctorParameters=function(){return[{type:n.Renderer2},{type:g}]},e.propDecorators={visible:[{type:n.Input}],centered:[{type:n.Input}],modalClass:[{type:n.Input}],size:[{type:n.Input}],visibleChange:[{type:n.Output}],abpHeader:[{type:n.ContentChild,args:["abpHeader",{static:!1}]}],abpBody:[{type:n.ContentChild,args:["abpBody",{static:!1}]}],abpFooter:[{type:n.ContentChild,args:["abpFooter",{static:!1}]}],abpClose:[{type:n.ContentChild,args:["abpClose",{static:!1,read:n.ElementRef}]}],modalContent:[{type:n.ViewChild,args:["abpModalContent",{static:!1}]}]},e}();var v=function(){function e(){}return e.decorators=[{type:n.Component,args:[{selector:"abp-toast",template:'\n <p-toast position="bottom-right" key="abpToast" [baseZIndex]="1000">\n <ng-template let-message pTemplate="message">\n <span\n class="ui-toast-icon pi"\n [ngClass]="{\n \'pi-info-circle\': message.severity == \'info\',\n \'pi-exclamation-triangle\': message.severity == \'warn\',\n \'pi-times\': message.severity == \'error\',\n \'pi-check\': message.severity == \'success\'\n }"\n ></span>\n <div class="ui-toast-message-text-content">\n <div class="ui-toast-summary">{{ message.summary | abpLocalization: message.titleLocalizationParams }}</div>\n <div class="ui-toast-detail">{{ message.detail | abpLocalization: message.messageLocalizationParams }}</div>\n </div>\n </ng-template>\n </p-toast>\n '}]}],e}(),C="\n.is-invalid .form-control {\n border-color: #dc3545;\n border-style: solid !important;\n}\n\n.is-invalid .invalid-feedback,\n.is-invalid + * .invalid-feedback {\n display: block;\n}\n\n.data-tables-filter {\n text-align: right;\n}\n\n.pointer {\n cursor: pointer;\n}\n\n.navbar .dropdown-submenu a::after {\n transform: rotate(-90deg);\n position: absolute;\n right: 16px;\n top: 18px;\n}\n\n\n/* <animations */\n\n.fade-in-top {\n animation: fadeInTop 0.4s ease-in-out;\n}\n\n.fade-out-top {\n animation: fadeOutTop 0.4s ease-in-out;\n}\n\n\n@keyframes fadeInTop {\n from {\n transform: translateY(-5px);\n opacity: 0;\n }\n\n to {\n transform: translateY(5px);\n opacity: 1;\n }\n}\n\n@keyframes fadeOutTop {\n to {\n transform: translateY(-5px);\n opacity: 0;\n }\n}\n\n/* </animations */\n\n",k={defaultError:{message:"An error has occurred!",details:"Error detail not sent by server."},defaultError401:{message:"You are not authenticated!",details:"You should be authenticated (sign in) in order to perform this operation."},defaultError403:{message:"You are not authorized!",details:"You are not allowed to perform this operation."},defaultError404:{message:"Resource not found!",details:"The resource requested could not found on the server."}},E=function(){function e(e,n,o){var r=this;this.actions=e,this.store=n,this.confirmationService=o,e.pipe(u.ofActionSuccessful(t.RestOccurError)).subscribe(function(e){var t=e.payload,n=void 0===t?{}:t,o=n.error.error;if(n.headers.get("_AbpErrorFormat")){var i=r.showError(null,null,o);401===n.status&&i.subscribe(function(){r.navigateToLogin()})}else switch(n.status){case 401:r.showError(k.defaultError401.details,k.defaultError401.message).subscribe(function(){return r.navigateToLogin()});break;case 403:r.showError(k.defaultError403.details,k.defaultError403.message);break;case 404:r.showError(k.defaultError404.details,k.defaultError404.message);break;default:r.showError(k.defaultError.details,k.defaultError.message)}})}return e.prototype.showError=function(e,t,n){return n&&(n.details?(e=n.details,t=n.message):e=n.message||k.defaultError.message),this.confirmationService.error(e,t,{hideCancelBtn:!0,yesCopy:"OK"})},e.prototype.navigateToLogin=function(){this.store.dispatch(new l.Navigate(["/account/login"],null,{state:{redirectUrl:this.store.selectSnapshot(l.RouterState).state.url}}))},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:u.Actions},{type:u.Store},{type:g}]},e.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new e(n.ɵɵinject(u.Actions),n.ɵɵinject(u.Store),n.ɵɵinject(g))},token:e,providedIn:"root"}),e}();function j(e){return function(){var n=e.get(t.LazyLoadService);return a.forkJoin(n.load(null,"style",C,"head","afterbegin")).pipe(c.take(1))}}var x,I=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[{provide:n.APP_INITIALIZER,multi:!0,deps:[n.Injector,E],useFactory:j},{provide:i.MessageService,useClass:i.MessageService}]}},e.decorators=[{type:n.NgModule,args:[{imports:[t.CoreModule,s.ToastModule,o.NgbModalModule,r.NgxValidateCoreModule.forRoot({targetSelector:".form-group"})],declarations:[h,v,y],exports:[o.NgbModalModule,h,v,y]}]}],e}();!function(e){e.Options=function(){}}(x||(x={})),(e.Toaster||(e.Toaster={})).Options=function(){};var S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.addAll=function(e){var t=this;this.messageService.addAll(e.map(function(e){return m({key:t.key},e)}))},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new t(n.ɵɵinject(i.MessageService))},token:t,providedIn:"root"}),t}(b);e.ConfirmationComponent=h,e.ConfirmationService=g,e.ModalComponent=y,e.ThemeSharedModule=I,e.ToastComponent=v,e.ToasterService=S,e.appendScript=j,e.ɵa=h,e.ɵb=g,e.ɵc=b,e.ɵd=v,e.ɵe=y,e.ɵf=E,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
//# sourceMappingURL=abp-ng.theme.shared.umd.min.js.map
|