@progress/kendo-react-charts
Version:
React Chart renders a wide range of high-quality data visualizations. KendoReact Charts package
9 lines (8 loc) • 1.66 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),p=require("../../store/store.js"),d=require("../../store/reducer.js"),l=require("../../ChartContext.js");function u(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const n=u(a),c=class c extends n.Component{get optionsStore(){var t;return(t=this.context)==null?void 0:t.optionsStore}constructor(t){super(t),this.childStore=p.createStore(d.optionsReducer)}render(){const{children:t}=this.props;return t!==void 0?n.Children.map(t,e=>n.isValidElement(e)?this.renderChildren(e):e):null}componentDidMount(){this.dispatch()}componentDidUpdate(){this.dispatch()}dispatch(){const{_chartKey:t,_chartCollectionIdxKey:e,_parentStore:r,children:h,...i}=this.props;(r||this.optionsStore).dispatch({chartKey:t,chartCollectionIdxKey:e,payload:Object.assign({},i,this.childStore.getState())})}renderChildren(t){const{children:e}=t.props,r={...t.props,_parentStore:this.childStore};return n.cloneElement(t,r,e)}};c.contextType=l.ChartContext;let s=c;exports.ConfigurationComponent=s;