@lxlib/chart
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.
16 lines (14 loc) • 3.84 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@lxlib/util"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("@lxlib/chart/custom",["exports","@angular/core","@lxlib/util","rxjs","rxjs/operators","@angular/common"],t):t(((e=e||self).lxlib=e.lxlib||{},e.lxlib.chart=e.lxlib.chart||{},e.lxlib.chart.custom={}),e.ng.core,e.lxlib.util,e.rxjs,e.rxjs.operators,e.ng.common)}(this,(function(e,t,r,n,i,o){"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,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(i=e[u])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function c(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(l(arguments[t]));return e}var a=function(){function e(e){this.el=e,this.resize$=null,this.resizeTime=0,this.render=new t.EventEmitter,this.resize=new t.EventEmitter,this.destroy=new t.EventEmitter}return e.prototype.renderChart=function(){this.el.nativeElement.innerHTML="",this.render.emit(this.el),this.installResizeEvent()},e.prototype.installResizeEvent=function(){var e=this;this.resizeTime<=0||this.resize$||(this.resize$=n.fromEvent(window,"resize").pipe(i.debounceTime(Math.min(200,this.resizeTime))).subscribe((function(){return e.resize.emit(e.el)})))},e.prototype.ngAfterViewInit=function(){this.renderChart()},e.prototype.ngOnDestroy=function(){this.destroy.emit(this.el),this.resize$&&this.resize$.unsubscribe()},e.decorators=[{type:t.Component,args:[{selector:"g2,g2-custom",exportAs:"g2Custom",template:" <ng-content></ng-content> ",host:{"[style.height.px]":"height"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={height:[{type:t.Input}],resizeTime:[{type:t.Input}],render:[{type:t.Output}],resize:[{type:t.Output}],destroy:[{type:t.Output}]},s([r.InputNumber(),u("design:type",Number)],e.prototype,"height",void 0),s([r.InputNumber(),u("design:type",Object)],e.prototype,"resizeTime",void 0),e}();var p=[a],f=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[o.CommonModule,r.LxlibUtilModule],declarations:c(p),exports:c(p)}]}],e}();e.G2CustomComponent=a,e.G2CustomModule=f,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=g2Custom.umd.min.js.map