UNPKG

@progress/kendo-react-gauges

Version:

React Gauges provide a set of React components for building beautiful and customizable gauges. KendoReact Gauges package

9 lines (8 loc) 1.79 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),i=require("./BaseGauge.js"),o=require("@progress/kendo-charts"),g=require("@progress/kendo-drawing"),c=require("@progress/kendo-react-common");function l(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const s=l(u);class p extends s.Component{constructor(){super(...arguments),this._baseGauge=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>{const{pointer:t,scale:n}=this.props;return Object.assign({},e,{pointer:t,scale:n})}}get gaugeInstance(){return this._baseGauge!==null?this._baseGauge.gaugeInstance:null}get surface(){return this._baseGauge!==null?this._baseGauge.surface:null}get element(){return this._baseGauge!==null?this._baseGauge.element:null}render(){const{children:e,className:t,...n}=this.props;return s.createElement(i.BaseGauge,{...n,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:a=>{this._baseGauge=a},gaugeConstructor:o.LinearGauge,getTarget:this.getTarget,className:c.classNames("k-gauge",t)},e)}exportVisual(e){return this.gaugeInstance!==null?Promise.resolve(this.gaugeInstance.exportVisual(e)):Promise.resolve(new g.Group)}}exports.LinearGauge=p;