@lxlib/seed
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.
16 lines (14 loc) • 4.81 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/platform-browser"),require("@lxlib/theme"),require("@lxlib/util"),require("@angular/common"),require("@angular/router"),require("ng-zorro-antd/button")):"function"==typeof define&&define.amd?define("@lxlib/seed/exception",["exports","@angular/core","@angular/platform-browser","@lxlib/theme","@lxlib/util","@angular/common","@angular/router","ng-zorro-antd/button"],t):t(((e=e||self).lxlib=e.lxlib||{},e.lxlib.seed=e.lxlib.seed||{},e.lxlib.seed.exception={}),e.ng.core,e.ng.platformBrowser,e.lxlib.theme,e.lxlib.util,e.ng.common,e.ng.router,e["ng-zorro-antd/button"])}(this,(function(e,t,n,o,i,r,c,l){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,r=n.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(o=r.next()).done;)c.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return c}function a(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}var u=function(){function e(e,t){this.i18n=e,this.dom=t,this.locale={},this.hasCon=!1,this._img="",this._title="",this._desc=""}return Object.defineProperty(e.prototype,"type",{set:function(e){var t={403:{img:"https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg",title:"403"},404:{img:"https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg",title:"404"},500:{img:"https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg",title:"500"}}[e];t&&(this.fixImg(t.img),this._type=e,this._title=t.title,this._desc="")},enumerable:!0,configurable:!0}),e.prototype.fixImg=function(e){this._img=this.dom.bypassSecurityTrustStyle("url('"+e+"')")},Object.defineProperty(e.prototype,"img",{set:function(e){this.fixImg(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{set:function(e){this._title=this.dom.bypassSecurityTrustHtml(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desc",{set:function(e){this._desc=this.dom.bypassSecurityTrustHtml(e)},enumerable:!0,configurable:!0}),e.prototype.checkContent=function(){this.hasCon=!i.isEmpty(this.conTpl.nativeElement)},e.prototype.ngOnInit=function(){var e=this;this.i18n$=this.i18n.change.subscribe((function(){return e.locale=e.i18n.getData("exception")})),this.checkContent()},e.prototype.ngOnDestroy=function(){this.i18n$.unsubscribe()},e.decorators=[{type:t.Component,args:[{selector:"exception",exportAs:"exception",template:'<div class="exception__img-block">\n <div class="exception__img" [style.backgroundImage]="_img"></div>\n</div>\n<div class="exception__cont">\n <h1 class="exception__cont-title"\n [innerHTML]="_title"></h1>\n <div class="exception__cont-desc"\n [innerHTML]="_desc || locale[_type]"></div>\n <div class="exception__cont-actions">\n <div (cdkObserveContent)="checkContent()"\n #conTpl>\n <ng-content></ng-content>\n </div>\n <button *ngIf="!hasCon"\n nz-button\n [routerLink]="[\'/\']"\n [nzType]="\'primary\'">{{locale.backToHome}}</button>\n </div>\n</div>\n',host:{"[class.exception]":"true"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],e.ctorParameters=function(){return[{type:o.LxlibLocaleService},{type:n.DomSanitizer}]},e.propDecorators={conTpl:[{type:t.ViewChild,args:["conTpl",{static:!0}]}],type:[{type:t.Input}],img:[{type:t.Input}],title:[{type:t.Input}],desc:[{type:t.Input}]},e}();var p=[u],d=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[r.CommonModule,c.RouterModule,i.LxlibUtilModule,o.LxlibLocaleModule,l.NzButtonModule],declarations:a(p),exports:a(p)}]}],e}();e.ExceptionComponent=u,e.ExceptionModule=d,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=exception.umd.min.js.map