@progress/kendo-react-charts
Version:
React Chart renders a wide range of high-quality data visualizations. KendoReact Charts package
51 lines (50 loc) • 1.58 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
*-------------------------------------------------------------------------------------------
*/
import * as r from "react";
import { createStore as c } from "../../store/store.mjs";
import { optionsReducer as p } from "../../store/reducer.mjs";
import { ChartContext as h } from "../../ChartContext.mjs";
const s = class s extends r.Component {
get optionsStore() {
var t;
return (t = this.context) == null ? void 0 : t.optionsStore;
}
constructor(t) {
super(t), this.childStore = c(p);
}
render() {
const { children: t } = this.props;
return t !== void 0 ? r.Children.map(t, (e) => r.isValidElement(e) ? this.renderChildren(e) : e) : null;
}
componentDidMount() {
this.dispatch();
}
componentDidUpdate() {
this.dispatch();
}
dispatch() {
const { _chartKey: t, _chartCollectionIdxKey: e, _parentStore: o, children: a, ...i } = this.props;
(o || this.optionsStore).dispatch({
chartKey: t,
chartCollectionIdxKey: e,
payload: Object.assign({}, i, this.childStore.getState())
});
}
renderChildren(t) {
const { children: e } = t.props, o = {
...t.props,
_parentStore: this.childStore
};
return r.cloneElement(t, o, e);
}
};
s.contextType = h;
let n = s;
export {
n as ConfigurationComponent
};