ag-charts-react
Advanced tools
Comparing version 4.2.0 to 5.0.0
@@ -1,2 +0,2 @@ | ||
// ag-charts-react v4.2.0 | ||
// ag-charts-react v5.0.0 | ||
import { Component, RefObject } from "react"; | ||
@@ -3,0 +3,0 @@ import { AgChartOptions } from "ag-charts-community"; |
@@ -1,41 +0,15 @@ | ||
// ag-charts-react v4.2.0 | ||
// ag-charts-react v5.0.0 | ||
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = require("react"); | ||
var PropTypes = require("prop-types"); | ||
var ag_charts_community_1 = require("ag-charts-community"); | ||
var AgChartsReact = /** @class */ (function (_super) { | ||
__extends(AgChartsReact, _super); | ||
function AgChartsReact(props, state) { | ||
var _this = _super.call(this, props, state) || this; | ||
_this.props = props; | ||
_this.state = state; | ||
_this.chartRef = react_1.createRef(); | ||
return _this; | ||
const react_1 = require("react"); | ||
const PropTypes = require("prop-types"); | ||
const ag_charts_community_1 = require("ag-charts-community"); | ||
class AgChartsReact extends react_1.Component { | ||
constructor(props, state) { | ||
super(props, state); | ||
this.props = props; | ||
this.state = state; | ||
this.chartRef = react_1.createRef(); | ||
} | ||
AgChartsReact.prototype.render = function () { | ||
render() { | ||
return react_1.createElement("div", { | ||
@@ -45,17 +19,17 @@ style: this.createStyleForDiv(), | ||
}); | ||
}; | ||
AgChartsReact.prototype.createStyleForDiv = function () { | ||
return __assign({ height: "100%" }, this.props.containerStyle); | ||
}; | ||
AgChartsReact.prototype.componentDidMount = function () { | ||
var options = this.applyContainerIfNotSet(this.props.options); | ||
} | ||
createStyleForDiv() { | ||
return Object.assign({ height: "100%" }, this.props.containerStyle); | ||
} | ||
componentDidMount() { | ||
const options = this.applyContainerIfNotSet(this.props.options); | ||
this.chart = ag_charts_community_1.AgChart.create(options); | ||
}; | ||
AgChartsReact.prototype.applyContainerIfNotSet = function (propsOptions) { | ||
} | ||
applyContainerIfNotSet(propsOptions) { | ||
if (propsOptions.container) { | ||
return propsOptions; | ||
} | ||
return __assign(__assign({}, propsOptions), { container: this.chartRef.current }); | ||
}; | ||
AgChartsReact.prototype.shouldComponentUpdate = function (nextProps) { | ||
return Object.assign(Object.assign({}, propsOptions), { container: this.chartRef.current }); | ||
} | ||
shouldComponentUpdate(nextProps) { | ||
this.processPropsChanges(this.props, nextProps); | ||
@@ -66,13 +40,12 @@ // we want full control of the dom, as AG Charts doesn't use React internally, | ||
return false; | ||
}; | ||
AgChartsReact.prototype.processPropsChanges = function (prevProps, nextProps) { | ||
} | ||
processPropsChanges(prevProps, nextProps) { | ||
ag_charts_community_1.AgChart.update(this.chart, this.applyContainerIfNotSet(nextProps.options)); | ||
}; | ||
AgChartsReact.prototype.componentWillUnmount = function () { | ||
} | ||
componentWillUnmount() { | ||
if (this.chart) { | ||
this.chart.destroy(); | ||
} | ||
}; | ||
return AgChartsReact; | ||
}(react_1.Component)); | ||
} | ||
} | ||
exports.AgChartsReact = AgChartsReact; | ||
@@ -79,0 +52,0 @@ AgChartsReact.propTypes = { |
@@ -1,2 +0,2 @@ | ||
// ag-charts-react v4.2.0 | ||
// ag-charts-react v5.0.0 | ||
export * from './agChartsReact'; |
@@ -1,2 +0,2 @@ | ||
// ag-charts-react v4.2.0 | ||
// ag-charts-react v5.0.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ function __export(m) { |
{ | ||
"name": "ag-charts-react", | ||
"version": "4.2.0", | ||
"version": "5.0.0", | ||
"description": "AG Charts React Component", | ||
@@ -34,3 +34,3 @@ "main": "main.js", | ||
"devDependencies": { | ||
"ag-charts-community": "~4.2.0", | ||
"ag-charts-community": "~5.0.0", | ||
"@types/jest": "^25.2.1", | ||
@@ -66,3 +66,3 @@ "@types/react": "16.9.2", | ||
"peerDependencies": { | ||
"ag-charts-community": "~4.2.0", | ||
"ag-charts-community": "~5.0.0", | ||
"react": "^16.3.0 || ^17.0.0", | ||
@@ -69,0 +69,0 @@ "react-dom": "^16.3.0 || ^17.0.0" |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("ag-charts-community")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","ag-charts-community"],e):e(t.AgChartsReact={},t.React,t.PropTypes,t.agCharts)}(this,function(t,o,e,r){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var p,i,c,a=function(){return(a=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},s=(p=o.Component,n(i=h,c=p),i.prototype=null===c?Object.create(c):(u.prototype=c.prototype,new u),h.prototype.render=function(){return o.createElement("div",{style:this.createStyleForDiv(),ref:this.chartRef})},h.prototype.createStyleForDiv=function(){return a({height:"100%"},this.props.containerStyle)},h.prototype.componentDidMount=function(){var t=this.applyContainerIfNotSet(this.props.options);this.chart=r.AgChart.create(t)},h.prototype.applyContainerIfNotSet=function(t){return t.container?t:a(a({},t),{container:this.chartRef.current})},h.prototype.shouldComponentUpdate=function(t){return this.processPropsChanges(this.props,t),!1},h.prototype.processPropsChanges=function(t,e){r.AgChart.update(this.chart,this.applyContainerIfNotSet(e.options))},h.prototype.componentWillUnmount=function(){this.chart&&this.chart.destroy()},h);function u(){this.constructor=i}function h(t,e){var r=p.call(this,t,e)||this;return r.props=t,r.state=e,r.chartRef=o.createRef(),r}s.propTypes={options:e.object},t.AgChartsReact=s,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("ag-charts-community")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","ag-charts-community"],e):e(t.AgChartsReact={},t.React,t.PropTypes,t.agCharts)}(this,function(t,r,e,s){"use strict";class o extends r.Component{constructor(t,e){super(t,e),this.props=t,this.state=e,this.chartRef=r.createRef()}render(){return r.createElement("div",{style:this.createStyleForDiv(),ref:this.chartRef})}createStyleForDiv(){return Object.assign({height:"100%"},this.props.containerStyle)}componentDidMount(){var t=this.applyContainerIfNotSet(this.props.options);this.chart=s.AgChart.create(t)}applyContainerIfNotSet(t){return t.container?t:Object.assign(Object.assign({},t),{container:this.chartRef.current})}shouldComponentUpdate(t){return this.processPropsChanges(this.props,t),!1}processPropsChanges(t,e){s.AgChart.update(this.chart,this.applyContainerIfNotSet(e.options))}componentWillUnmount(){this.chart&&this.chart.destroy()}}o.propTypes={options:e.object},t.AgChartsReact=o,Object.defineProperty(t,"__esModule",{value:!0})}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14840
12
92