@progress/kendo-react-charts 5.4.0-dev.202205271059 → 5.4.0-dev.202206061009

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cdn/js/kendo-react-charts.js +1 -1
  2. package/dist/es/BaseChart.d.ts +1 -1
  3. package/dist/es/BaseChart.js +5 -1
  4. package/dist/es/Chart.js +1 -0
  5. package/dist/es/ChartContext.d.ts +1 -1
  6. package/dist/es/DonutCenter.d.ts +3 -1
  7. package/dist/es/DonutCenter.js +3 -1
  8. package/dist/es/Sparkline.js +1 -0
  9. package/dist/es/StockChart.js +1 -0
  10. package/dist/es/components/base/CollectionConfigurationComponent.d.ts +1 -1
  11. package/dist/es/components/base/CollectionConfigurationComponent.js +1 -1
  12. package/dist/es/components/base/ConfigurationComponent.d.ts +1 -1
  13. package/dist/es/package-metadata.js +1 -1
  14. package/dist/es/store/reducer.js +9 -5
  15. package/dist/es/theming/theme-service.js +5 -5
  16. package/dist/es/tooltip/Crosshair.d.ts +3 -1
  17. package/dist/es/tooltip/Crosshair.js +3 -1
  18. package/dist/es/tooltip/CrosshairContainer.d.ts +3 -1
  19. package/dist/es/tooltip/CrosshairContainer.js +3 -1
  20. package/dist/es/tooltip/Popup.d.ts +3 -1
  21. package/dist/es/tooltip/Popup.js +2 -0
  22. package/dist/es/tooltip/Series.d.ts +4 -2
  23. package/dist/es/tooltip/Series.js +2 -0
  24. package/dist/es/utils/main.d.ts +1 -1
  25. package/dist/es/utils/main.js +1 -1
  26. package/dist/npm/BaseChart.d.ts +1 -1
  27. package/dist/npm/BaseChart.js +18 -14
  28. package/dist/npm/Chart.js +2 -1
  29. package/dist/npm/ChartContext.d.ts +1 -1
  30. package/dist/npm/DonutCenter.d.ts +3 -1
  31. package/dist/npm/DonutCenter.js +3 -1
  32. package/dist/npm/Sparkline.js +2 -1
  33. package/dist/npm/StockChart.js +2 -1
  34. package/dist/npm/components/CategoryAxis.js +1 -1
  35. package/dist/npm/components/Panes.js +1 -1
  36. package/dist/npm/components/Series.js +1 -1
  37. package/dist/npm/components/ValueAxis.js +1 -1
  38. package/dist/npm/components/XAxis.js +1 -1
  39. package/dist/npm/components/YAxis.js +1 -1
  40. package/dist/npm/components/base/CollectionConfigurationComponent.d.ts +1 -1
  41. package/dist/npm/components/base/CollectionConfigurationComponent.js +1 -1
  42. package/dist/npm/components/base/ConfigurationComponent.d.ts +1 -1
  43. package/dist/npm/components/base/ConfigurationComponent.js +1 -1
  44. package/dist/npm/components/main.js +5 -1
  45. package/dist/npm/components/navigator/Series.js +1 -1
  46. package/dist/npm/components/navigator/main.js +5 -1
  47. package/dist/npm/main.js +5 -1
  48. package/dist/npm/package-metadata.js +1 -1
  49. package/dist/npm/store/reducer.js +9 -5
  50. package/dist/npm/theming/theme-service.js +7 -7
  51. package/dist/npm/tooltip/Crosshair.d.ts +3 -1
  52. package/dist/npm/tooltip/Crosshair.js +4 -2
  53. package/dist/npm/tooltip/CrosshairContainer.d.ts +3 -1
  54. package/dist/npm/tooltip/CrosshairContainer.js +3 -1
  55. package/dist/npm/tooltip/Popup.d.ts +3 -1
  56. package/dist/npm/tooltip/Popup.js +4 -2
  57. package/dist/npm/tooltip/Series.d.ts +4 -2
  58. package/dist/npm/tooltip/Series.js +3 -1
  59. package/dist/npm/utils/main.d.ts +1 -1
  60. package/dist/npm/utils/main.js +1 -1
  61. package/dist/systemjs/kendo-react-charts.js +1 -1
  62. package/package.json +6 -6
@@ -30,7 +30,7 @@ export declare class BaseChart extends React.Component<BaseChartPrivateProps, {}
30
30
  /**
31
31
  * @hidden
32
32
  */
33
- surface: Surface;
33
+ surface: Surface | null;
34
34
  /**
35
35
  * @hidden
36
36
  */
@@ -54,6 +54,10 @@ var BaseChart = /** @class */ (function (_super) {
54
54
  * @hidden
55
55
  */
56
56
  _this.chartInstance = null;
57
+ /**
58
+ * @hidden
59
+ */
60
+ _this.surface = null;
57
61
  _this._element = null;
58
62
  _this.optionsStore = {};
59
63
  _this.optionsUnsubscriber = Function.prototype;
@@ -99,7 +103,7 @@ var BaseChart = /** @class */ (function (_super) {
99
103
  payload = Object.assign({}, seriesByIndex);
100
104
  }
101
105
  _this.optionsStore.dispatch({
102
- chartCollectionIdxKey: "series_" + seriesIndex,
106
+ chartCollectionIdxKey: "series_".concat(seriesIndex),
103
107
  payload: payload
104
108
  });
105
109
  _this.suppressTransitions = true;
package/dist/es/Chart.js CHANGED
@@ -99,6 +99,7 @@ var Chart = /** @class */ (function (_super) {
99
99
  __extends(Chart, _super);
100
100
  function Chart() {
101
101
  var _this = _super !== null && _super.apply(this, arguments) || this;
102
+ _this._baseChart = null;
102
103
  _this.getTarget = function () {
103
104
  return _this;
104
105
  };
@@ -12,4 +12,4 @@ export interface ChartContextType {
12
12
  /**
13
13
  * @hidden
14
14
  */
15
- export declare const ChartContext: React.Context<ChartContextType>;
15
+ export declare const ChartContext: React.Context<ChartContextType | null>;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { InstanceObserver } from '@progress/kendo-charts';
3
+ import { ChartContext } from './ChartContext';
3
4
  /**
4
5
  * @hidden
5
6
  */
@@ -25,7 +26,8 @@ export interface DonutCenterState {
25
26
  * @hidden
26
27
  */
27
28
  declare class DonutCenter extends React.Component<DonutCenterProps, DonutCenterState> {
28
- static contextType: React.Context<import("./ChartContext").ChartContextType>;
29
+ static contextType: React.Context<import("./ChartContext").ChartContextType | null>;
30
+ context: React.ContextType<typeof ChartContext>;
29
31
  readonly state: DonutCenterState;
30
32
  chartObserver: InstanceObserver;
31
33
  constructor(props: DonutCenterProps, context: any);
@@ -23,6 +23,7 @@ var DonutCenter = /** @class */ (function (_super) {
23
23
  __extends(DonutCenter, _super);
24
24
  function DonutCenter(props, context) {
25
25
  var _this = _super.call(this, props, context) || this;
26
+ _this.context = null;
26
27
  _this.state = {
27
28
  donutCenterStyles: null
28
29
  };
@@ -45,7 +46,8 @@ var DonutCenter = /** @class */ (function (_super) {
45
46
  return renderer;
46
47
  };
47
48
  DonutCenter.prototype.onRender = function (event) {
48
- var series = this.context.optionsStore.getState().series;
49
+ var _a;
50
+ var series = (_a = this.context) === null || _a === void 0 ? void 0 : _a.optionsStore.getState().series;
49
51
  var firstSeries = Array.isArray(series) ? series[0] : null;
50
52
  var charts = event.sender._plotArea.charts;
51
53
  if (!firstSeries || firstSeries.type !== 'donut' || charts[0].points.length === 0) {
@@ -103,6 +103,7 @@ var Sparkline = /** @class */ (function (_super) {
103
103
  __extends(Sparkline, _super);
104
104
  function Sparkline() {
105
105
  var _this = _super !== null && _super.apply(this, arguments) || this;
106
+ _this._baseChart = null;
106
107
  /**
107
108
  * @hidden
108
109
  */
@@ -58,6 +58,7 @@ var StockChart = /** @class */ (function (_super) {
58
58
  __extends(StockChart, _super);
59
59
  function StockChart() {
60
60
  var _this = _super !== null && _super.apply(this, arguments) || this;
61
+ _this._baseChart = null;
61
62
  /**
62
63
  * @hidden
63
64
  */
@@ -11,7 +11,7 @@ export interface CollectionConfigurationProps {
11
11
  * @hidden
12
12
  */
13
13
  export declare class CollectionConfigurationComponent extends React.Component<CollectionConfigurationProps> {
14
- static contextType: React.Context<import("../../ChartContext").ChartContextType>;
14
+ static contextType: React.Context<import("../../ChartContext").ChartContextType | null>;
15
15
  optionsStore: any;
16
16
  constructor(props: any, context: any);
17
17
  renderChildren(child: any, index: number): React.DetailedReactHTMLElement<any, HTMLElement>;
@@ -39,7 +39,7 @@ var CollectionConfigurationComponent = /** @class */ (function (_super) {
39
39
  CollectionConfigurationComponent.prototype.renderChildren = function (child, index) {
40
40
  var children = child.props.children;
41
41
  var _a = this.props, _chartKey = _a._chartKey, _parentStore = _a._parentStore;
42
- var collectionItemProps = __assign(__assign({}, child.props), { _chartCollectionIdxKey: _chartKey + "_" + index, _parentStore: _parentStore });
42
+ var collectionItemProps = __assign(__assign({}, child.props), { _chartCollectionIdxKey: "".concat(_chartKey, "_").concat(index), _parentStore: _parentStore });
43
43
  return React.cloneElement(child, collectionItemProps, children);
44
44
  };
45
45
  CollectionConfigurationComponent.prototype.render = function () {
@@ -12,7 +12,7 @@ export interface ConfigurationComponentProps {
12
12
  * @hidden
13
13
  */
14
14
  export declare class ConfigurationComponent extends React.Component<ConfigurationComponentProps> {
15
- static contextType: React.Context<import("../../ChartContext").ChartContextType>;
15
+ static contextType: React.Context<import("../../ChartContext").ChartContextType | null>;
16
16
  optionsStore: any;
17
17
  childStore: any;
18
18
  constructor(props: any, context: any);
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-charts',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1653648023,
8
+ publishDate: 1654508921,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
@@ -1,7 +1,11 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
2
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
3
- to[j] = from[i];
4
- return to;
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
5
9
  };
6
10
  /**
7
11
  * @hidden
@@ -42,7 +46,7 @@ var observersReducer = function (currentState, action) {
42
46
  if (action.type) {
43
47
  switch (action.type) {
44
48
  case 'add':
45
- return __spreadArray(__spreadArray([], currentState), [action.payload]);
49
+ return __spreadArray(__spreadArray([], currentState, true), [action.payload], false);
46
50
  case 'remove':
47
51
  return currentState.filter(function (element) { return element !== action.payload; });
48
52
  default:
@@ -1,5 +1,5 @@
1
1
  import { chartBaseTheme } from '@progress/kendo-charts';
2
- var font = function (style) { return style.fontWeight + " " + style.fontSize + " " + style.fontFamily; };
2
+ var font = function (style) { return "".concat(style.fontWeight, " ").concat(style.fontSize, " ").concat(style.fontFamily); };
3
3
  var computedBackgroundColor = function (element) { return window.getComputedStyle(element).backgroundColor; };
4
4
  var letterPos = function (letter) { return letter.toLowerCase().charCodeAt(0) - 'a'.charCodeAt(0); };
5
5
  var seriesPos = function (name) {
@@ -14,11 +14,11 @@ var SERIES_COLORS = 30;
14
14
  var seriesTemplate = function () {
15
15
  var result = "\n <div class=\"k-var--series-a\"></div>\n <div class=\"k-var--series-b\"></div>\n <div class=\"k-var--series-c\"></div>\n <div class=\"k-var--series-d\"></div>\n <div class=\"k-var--series-e\"></div>\n <div class=\"k-var--series-f\"></div>\n";
16
16
  for (var i = 0; i < SERIES_COLORS; i++) {
17
- result += "\n <div class=\"k-var--series-" + (i + 1) + "\"></div>";
17
+ result += "\n <div class=\"k-var--series-".concat(i + 1, "\"></div>");
18
18
  }
19
19
  return result;
20
20
  };
21
- var template = "\n <div class=\"k-var--accent\"></div>\n <div class=\"k-var--base\"></div>\n <div class=\"k-var--background\"></div>\n\n <div class=\"k-var--normal-background\"></div>\n <div class=\"k-var--normal-text-color\"></div>\n <div class=\"k-var--hover-background\"></div>\n <div class=\"k-var--hover-text-color\"></div>\n <div class=\"k-var--selected-background\"></div>\n <div class=\"k-var--selected-text-color\"></div>\n <div class=\"k-var--chart-error-bars-background\"></div>\n <div class=\"k-var--chart-notes-background\"></div>\n <div class=\"k-var--chart-notes-border\"></div>\n <div class=\"k-var--chart-notes-lines\"></div>\n <div class=\"k-var--chart-crosshair-background\"></div>\n\n <div class=\"k-var--chart-inactive\"></div>\n <div class=\"k-var--chart-major-lines\"></div>\n <div class=\"k-var--chart-minor-lines\"></div>\n <div class=\"k-var--chart-area-opacity\"></div>\n <div class=\"k-var--chart-area-inactive-opacity\"></div>\n <div class=\"k-var--chart-line-inactive-opacity\"></div>\n\n <div class=\"k-widget k-chart\">\n <div class=\"k-var--chart-font\"></div>\n <div class=\"k-var--chart-title-font\"></div>\n <div class=\"k-var--chart-pane-title-font\"></div>\n <div class=\"k-var--chart-label-font\"></div>\n </div>\n\n <div class=\"k-var--series-unset\"></div>\n <div class=\"k-var--series\">\n " + seriesTemplate() + "\n </div>\n";
21
+ var template = "\n <div class=\"k-var--accent\"></div>\n <div class=\"k-var--base\"></div>\n <div class=\"k-var--background\"></div>\n\n <div class=\"k-var--normal-background\"></div>\n <div class=\"k-var--normal-text-color\"></div>\n <div class=\"k-var--hover-background\"></div>\n <div class=\"k-var--hover-text-color\"></div>\n <div class=\"k-var--selected-background\"></div>\n <div class=\"k-var--selected-text-color\"></div>\n <div class=\"k-var--chart-error-bars-background\"></div>\n <div class=\"k-var--chart-notes-background\"></div>\n <div class=\"k-var--chart-notes-border\"></div>\n <div class=\"k-var--chart-notes-lines\"></div>\n <div class=\"k-var--chart-crosshair-background\"></div>\n\n <div class=\"k-var--chart-inactive\"></div>\n <div class=\"k-var--chart-major-lines\"></div>\n <div class=\"k-var--chart-minor-lines\"></div>\n <div class=\"k-var--chart-area-opacity\"></div>\n <div class=\"k-var--chart-area-inactive-opacity\"></div>\n <div class=\"k-var--chart-line-inactive-opacity\"></div>\n\n <div class=\"k-widget k-chart\">\n <div class=\"k-var--chart-font\"></div>\n <div class=\"k-var--chart-title-font\"></div>\n <div class=\"k-var--chart-pane-title-font\"></div>\n <div class=\"k-var--chart-label-font\"></div>\n </div>\n\n <div class=\"k-var--series-unset\"></div>\n <div class=\"k-var--series\">\n ".concat(seriesTemplate(), "\n </div>\n");
22
22
  /**
23
23
  * @hidden
24
24
  */
@@ -109,14 +109,14 @@ var ThemeService = /** @class */ (function () {
109
109
  };
110
110
  ThemeService.prototype.queryStyle = function (varName) {
111
111
  var element = this.element;
112
- return window.getComputedStyle(element.querySelector(".k-var--" + varName));
112
+ return window.getComputedStyle(element.querySelector(".k-var--".concat(varName)));
113
113
  };
114
114
  ThemeService.prototype.setInactiveOpacity = function (seriesTypes, selector) {
115
115
  var _this = this;
116
116
  var inactiveOpacity = parseFloat(this.queryStyle(selector).opacity);
117
117
  if (!isNaN(inactiveOpacity) && inactiveOpacity < 1) {
118
118
  seriesTypes.forEach(function (type) {
119
- return _this.setStyle("seriesDefaults." + type + ".highlight.inactiveOpacity", inactiveOpacity);
119
+ return _this.setStyle("seriesDefaults.".concat(type, ".highlight.inactiveOpacity"), inactiveOpacity);
120
120
  });
121
121
  }
122
122
  };
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { InstanceObserver } from '@progress/kendo-charts';
3
3
  import { Align, Offset } from '@progress/kendo-react-popup';
4
+ import { ChartContext } from '../ChartContext';
4
5
  /**
5
6
  * @hidden
6
7
  */
@@ -23,7 +24,8 @@ export interface CrosshairTooltipState {
23
24
  * @hidden
24
25
  */
25
26
  export declare class CrosshairTooltip extends React.Component<CrosshairTooltipProps, CrosshairTooltipState> {
26
- static contextType: React.Context<import("../ChartContext").ChartContextType>;
27
+ static contextType: React.Context<import("../ChartContext").ChartContextType | null>;
28
+ context: React.ContextType<typeof ChartContext>;
27
29
  readonly state: CrosshairTooltipState;
28
30
  chartObserver: InstanceObserver;
29
31
  constructor(props: any, context: any);
@@ -49,6 +49,7 @@ var CrosshairTooltip = /** @class */ (function (_super) {
49
49
  __extends(CrosshairTooltip, _super);
50
50
  function CrosshairTooltip(props, context) {
51
51
  var _this = _super.call(this, props, context) || this;
52
+ _this.context = null;
52
53
  _this.state = {
53
54
  popupShown: false
54
55
  };
@@ -73,7 +74,8 @@ var CrosshairTooltip = /** @class */ (function (_super) {
73
74
  return (React.createElement(TooltipPopup, __assign({}, tooltipProps, { popupContent: tooltipContent, className: popupContainerClassName })));
74
75
  };
75
76
  CrosshairTooltip.prototype.componentWillUnmount = function () {
76
- this.context.observersStore.dispatch({
77
+ var _a;
78
+ (_a = this.context) === null || _a === void 0 ? void 0 : _a.observersStore.dispatch({
77
79
  type: 'remove',
78
80
  payload: this.chartObserver
79
81
  });
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { CrosshairTooltipProps } from './Crosshair';
3
+ import { ChartContext } from '../ChartContext';
3
4
  /**
4
5
  * @hidden
5
6
  */
@@ -16,7 +17,8 @@ export interface CrosshairTooltipContainerState {
16
17
  * @hidden
17
18
  */
18
19
  export declare class CrosshairTooltipContainer extends React.Component<{}, CrosshairTooltipContainerState> {
19
- static contextType: React.Context<import("../ChartContext").ChartContextType>;
20
+ static contextType: React.Context<import("../ChartContext").ChartContextType | null>;
21
+ context: React.ContextType<typeof ChartContext>;
20
22
  readonly state: CrosshairTooltipContainerState;
21
23
  private storeUnsubscriber;
22
24
  componentDidMount(): void;
@@ -63,13 +63,15 @@ var CrosshairTooltipContainer = /** @class */ (function (_super) {
63
63
  __extends(CrosshairTooltipContainer, _super);
64
64
  function CrosshairTooltipContainer() {
65
65
  var _this = _super !== null && _super.apply(this, arguments) || this;
66
+ _this.context = null;
66
67
  _this.state = {
67
68
  tooltips: {}
68
69
  };
69
70
  _this.storeUnsubscriber = Function.prototype;
70
71
  _this.subscriber = function () {
72
+ var _a;
71
73
  _this.setState({
72
- tooltips: mapTooltips(_this.context.optionsStore.getState())
74
+ tooltips: mapTooltips((_a = _this.context) === null || _a === void 0 ? void 0 : _a.optionsStore.getState())
73
75
  });
74
76
  };
75
77
  return _this;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { InstanceObserver } from '@progress/kendo-charts';
3
3
  import { DomEvent } from './../events/dom-event';
4
4
  import { Align, Offset } from '@progress/kendo-react-popup';
5
+ import { ChartContext } from '../ChartContext';
5
6
  /**
6
7
  * @hidden
7
8
  */
@@ -17,7 +18,8 @@ export interface TooltipPopupProps {
17
18
  * @hidden
18
19
  */
19
20
  export declare class TooltipPopup extends React.Component<TooltipPopupProps, {}> {
20
- static contextType: React.Context<import("../ChartContext").ChartContextType>;
21
+ static contextType: React.Context<import("../ChartContext").ChartContextType | null>;
22
+ context: React.ContextType<typeof ChartContext>;
21
23
  chartObserver: InstanceObserver;
22
24
  element: HTMLDivElement | null;
23
25
  constructor(props: TooltipPopupProps, context: any);
@@ -29,6 +29,8 @@ var TooltipPopup = /** @class */ (function (_super) {
29
29
  __extends(TooltipPopup, _super);
30
30
  function TooltipPopup(props, context) {
31
31
  var _this = _super.call(this, props, context) || this;
32
+ _this.context = null;
33
+ _this.element = null;
32
34
  _this.onChartMouseLeave = function (e) {
33
35
  var syntheticEvent = e.syntheticEvent;
34
36
  if (hasParent(syntheticEvent.relatedTarget, _this.element)) {
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { Align, Offset } from '@progress/kendo-react-popup';
3
3
  import { InstanceObserver } from '@progress/kendo-charts';
4
4
  import { SharedTooltipContext, TooltipContext } from './Context';
5
+ import { ChartContext } from '../ChartContext';
5
6
  /**
6
7
  * @hidden
7
8
  */
@@ -18,9 +19,10 @@ export interface SeriesTooltipState {
18
19
  * @hidden
19
20
  */
20
21
  export declare class SeriesTooltip extends React.Component<{}, SeriesTooltipState> {
21
- static contextType: React.Context<import("../ChartContext").ChartContextType>;
22
+ static contextType: React.Context<import("../ChartContext").ChartContextType | null>;
23
+ context: React.ContextType<typeof ChartContext>;
22
24
  readonly state: SeriesTooltipState;
23
- chartObserver: InstanceObserver;
25
+ chartObserver: InstanceObserver | null;
24
26
  componentDidMount(): void;
25
27
  render(): JSX.Element;
26
28
  componentWillUnmount(): void;
@@ -51,9 +51,11 @@ var SeriesTooltip = /** @class */ (function (_super) {
51
51
  __extends(SeriesTooltip, _super);
52
52
  function SeriesTooltip() {
53
53
  var _this = _super !== null && _super.apply(this, arguments) || this;
54
+ _this.context = null;
54
55
  _this.state = {
55
56
  popupShown: false
56
57
  };
58
+ _this.chartObserver = null;
57
59
  return _this;
58
60
  }
59
61
  SeriesTooltip.prototype.componentDidMount = function () {
@@ -6,7 +6,7 @@ declare function hasParent(element: any, parent: any): boolean;
6
6
  /**
7
7
  * @hidden
8
8
  */
9
- declare function validateChildren<P>(props: P, propName: string, componentName: string, childType: React.StatelessComponent): Error;
9
+ declare function validateChildren<P>(props: P, propName: string, componentName: string, childType: React.FunctionComponent): Error | null;
10
10
  /**
11
11
  * @hidden
12
12
  */
@@ -18,7 +18,7 @@ function validateChildren(props, propName, componentName, childType) {
18
18
  for (var _i = 0, prop_1 = prop; _i < prop_1.length; _i++) {
19
19
  var value = prop_1[_i];
20
20
  if (!value.type || value.type !== childType) {
21
- return new Error(componentName + " children should be Array of type " + childType.displayName + ".");
21
+ return new Error("".concat(componentName, " children should be Array of type ").concat(childType.displayName, "."));
22
22
  }
23
23
  }
24
24
  }
@@ -30,7 +30,7 @@ export declare class BaseChart extends React.Component<BaseChartPrivateProps, {}
30
30
  /**
31
31
  * @hidden
32
32
  */
33
- surface: Surface;
33
+ surface: Surface | null;
34
34
  /**
35
35
  * @hidden
36
36
  */
@@ -57,6 +57,10 @@ var BaseChart = /** @class */ (function (_super) {
57
57
  * @hidden
58
58
  */
59
59
  _this.chartInstance = null;
60
+ /**
61
+ * @hidden
62
+ */
63
+ _this.surface = null;
60
64
  _this._element = null;
61
65
  _this.optionsStore = {};
62
66
  _this.optionsUnsubscriber = Function.prototype;
@@ -94,15 +98,15 @@ var BaseChart = /** @class */ (function (_super) {
94
98
  var seriesIndex = e.seriesIndex, pointIndex = e.pointIndex;
95
99
  var seriesByIndex = series[seriesIndex];
96
100
  if (pointIndex === undefined) {
97
- payload = Object.assign({}, seriesByIndex, { visible: main_2.toggle(seriesByIndex.visible) });
101
+ payload = Object.assign({}, seriesByIndex, { visible: (0, main_2.toggle)(seriesByIndex.visible) });
98
102
  }
99
103
  else {
100
104
  var pv = seriesByIndex.pointVisibility = seriesByIndex.pointVisibility || [];
101
- pv[pointIndex] = main_2.toggle(pv[pointIndex]);
105
+ pv[pointIndex] = (0, main_2.toggle)(pv[pointIndex]);
102
106
  payload = Object.assign({}, seriesByIndex);
103
107
  }
104
108
  _this.optionsStore.dispatch({
105
- chartCollectionIdxKey: "series_" + seriesIndex,
109
+ chartCollectionIdxKey: "series_".concat(seriesIndex),
106
110
  payload: payload
107
111
  });
108
112
  _this.suppressTransitions = true;
@@ -122,7 +126,7 @@ var BaseChart = /** @class */ (function (_super) {
122
126
  * @hidden
123
127
  */
124
128
  _this.onChartMouseLeave = function (e) {
125
- var domEvent = dom_event_1.toDomEvent(_this, e);
129
+ var domEvent = (0, dom_event_1.toDomEvent)(_this, e);
126
130
  var isDefaultPrevented = _this.triggerDomEvent('onMouseLeave', domEvent);
127
131
  if (isDefaultPrevented) {
128
132
  e.preventDefault();
@@ -136,21 +140,21 @@ var BaseChart = /** @class */ (function (_super) {
136
140
  */
137
141
  _this.onChildMouseLeave = function (e) {
138
142
  var syntheticEvent = e.syntheticEvent;
139
- if (_this.chartInstance && !main_1.hasParent(syntheticEvent.relatedTarget, _this.element)) {
143
+ if (_this.chartInstance && !(0, main_1.hasParent)(syntheticEvent.relatedTarget, _this.element)) {
140
144
  _this.chartInstance.hideElements();
141
145
  }
142
146
  return false;
143
147
  };
144
- kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
145
- _this.optionsStore = store_1.default(reducer_1.optionsReducer);
146
- _this.observersStore = store_1.default(reducer_1.observersReducer);
148
+ (0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
149
+ _this.optionsStore = (0, store_1.default)(reducer_1.optionsReducer);
150
+ _this.observersStore = (0, store_1.default)(reducer_1.observersReducer);
147
151
  _this.childrenObserver = new kendo_charts_1.InstanceObserver(_this, { onMouseLeave: 'onChildMouseLeave' });
148
152
  _this.contextValue = {
149
153
  optionsStore: _this.optionsStore,
150
154
  observersStore: _this.observersStore,
151
155
  childrenObserver: _this.childrenObserver
152
156
  };
153
- _this.themeStore = store_1.default(reducer_1.themeReducer);
157
+ _this.themeStore = (0, store_1.default)(reducer_1.themeReducer);
154
158
  _this.chartObserver = new kendo_charts_1.InstanceObserver(_this, { render: 'onRender', legendItemClick: 'onLegendItemClick' });
155
159
  return _this;
156
160
  }
@@ -168,7 +172,7 @@ var BaseChart = /** @class */ (function (_super) {
168
172
  * @hidden
169
173
  */
170
174
  BaseChart.prototype.componentDidMount = function () {
171
- theme_service_1.loadTheme(this.themeStore, this.instantiateCoreChart.bind(this));
175
+ (0, theme_service_1.loadTheme)(this.themeStore, this.instantiateCoreChart.bind(this));
172
176
  this.optionsUnsubscriber = this.optionsStore.subscribe(this.refresh.bind(this));
173
177
  this.themeUnsubscriber = this.themeStore.subscribe(this.refresh.bind(this));
174
178
  window.addEventListener('resize', this.onWindowResize);
@@ -191,7 +195,7 @@ var BaseChart = /** @class */ (function (_super) {
191
195
  BaseChart.prototype.componentDidUpdate = function (prevProps) {
192
196
  var _a = this.props, dir = _a.dir, children = _a.children, spreadProps = __rest(_a, ["dir", "children"]);
193
197
  if (this.chartInstance !== null) {
194
- var currentIntlService = kendo_react_intl_1.provideIntlService(this);
198
+ var currentIntlService = (0, kendo_react_intl_1.provideIntlService)(this);
195
199
  var chartService = this.chartInstance.chartService;
196
200
  var localeChanged = currentIntlService.locale !== chartService._intlService.locale;
197
201
  var shouldUpdate = Object.entries(prevProps)
@@ -312,7 +316,7 @@ var BaseChart = /** @class */ (function (_super) {
312
316
  var chartOptions = this.getChartOptions();
313
317
  this.chartInstance = new chartConstructor(this.element, chartOptions, this.themeStore.getState(), {
314
318
  rtl: this.getDirection(dir),
315
- intlService: kendo_react_intl_1.provideIntlService(this),
319
+ intlService: (0, kendo_react_intl_1.provideIntlService)(this),
316
320
  observer: this.chartObserver,
317
321
  sender: this
318
322
  });
@@ -323,7 +327,7 @@ var BaseChart = /** @class */ (function (_super) {
323
327
  */
324
328
  BaseChart.prototype.trigger = function (name, e) {
325
329
  var target = this.props.getTarget();
326
- var eventObject = chart_event_builder_1.create(name, e, target);
330
+ var eventObject = (0, chart_event_builder_1.create)(name, e, target);
327
331
  var handler = 'on' + name.charAt(0).toUpperCase() + name.slice(1);
328
332
  var observers = this.observersStore.getState();
329
333
  var isDefaultPrevented = false;
@@ -385,5 +389,5 @@ var BaseChart = /** @class */ (function (_super) {
385
389
  return BaseChart;
386
390
  }(React.Component));
387
391
  exports.BaseChart = BaseChart;
388
- kendo_react_intl_1.registerForIntl(BaseChart);
392
+ (0, kendo_react_intl_1.registerForIntl)(BaseChart);
389
393
  kendo_charts_1.DomEventsBuilder.register(dom_events_builder_1.DomEventsBuilder);
package/dist/npm/Chart.js CHANGED
@@ -102,6 +102,7 @@ var Chart = /** @class */ (function (_super) {
102
102
  __extends(Chart, _super);
103
103
  function Chart() {
104
104
  var _this = _super !== null && _super.apply(this, arguments) || this;
105
+ _this._baseChart = null;
105
106
  _this.getTarget = function () {
106
107
  return _this;
107
108
  };
@@ -152,7 +153,7 @@ var Chart = /** @class */ (function (_super) {
152
153
  Chart.prototype.render = function () {
153
154
  var _this = this;
154
155
  var _a = this.props, donutCenterRender = _a.donutCenterRender, children = _a.children, className = _a.className, baseChartProps = __rest(_a, ["donutCenterRender", "children", "className"]);
155
- return (React.createElement(BaseChart_1.BaseChart, __assign({}, baseChartProps, { ref: function (baseChart) { return _this._baseChart = baseChart; }, chartConstructor: kendo_charts_1.Chart, getTarget: this.getTarget, wrapper: "div", className: kendo_react_common_1.classNames('k-chart k-widget', className) }),
156
+ return (React.createElement(BaseChart_1.BaseChart, __assign({}, baseChartProps, { ref: function (baseChart) { return _this._baseChart = baseChart; }, chartConstructor: kendo_charts_1.Chart, getTarget: this.getTarget, wrapper: "div", className: (0, kendo_react_common_1.classNames)('k-chart k-widget', className) }),
156
157
  children,
157
158
  React.createElement(DonutCenter_1.DonutCenter, { render: donutCenterRender })));
158
159
  };
@@ -12,4 +12,4 @@ export interface ChartContextType {
12
12
  /**
13
13
  * @hidden
14
14
  */
15
- export declare const ChartContext: React.Context<ChartContextType>;
15
+ export declare const ChartContext: React.Context<ChartContextType | null>;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { InstanceObserver } from '@progress/kendo-charts';
3
+ import { ChartContext } from './ChartContext';
3
4
  /**
4
5
  * @hidden
5
6
  */
@@ -25,7 +26,8 @@ export interface DonutCenterState {
25
26
  * @hidden
26
27
  */
27
28
  declare class DonutCenter extends React.Component<DonutCenterProps, DonutCenterState> {
28
- static contextType: React.Context<import("./ChartContext").ChartContextType>;
29
+ static contextType: React.Context<import("./ChartContext").ChartContextType | null>;
30
+ context: React.ContextType<typeof ChartContext>;
29
31
  readonly state: DonutCenterState;
30
32
  chartObserver: InstanceObserver;
31
33
  constructor(props: DonutCenterProps, context: any);
@@ -26,6 +26,7 @@ var DonutCenter = /** @class */ (function (_super) {
26
26
  __extends(DonutCenter, _super);
27
27
  function DonutCenter(props, context) {
28
28
  var _this = _super.call(this, props, context) || this;
29
+ _this.context = null;
29
30
  _this.state = {
30
31
  donutCenterStyles: null
31
32
  };
@@ -48,7 +49,8 @@ var DonutCenter = /** @class */ (function (_super) {
48
49
  return renderer;
49
50
  };
50
51
  DonutCenter.prototype.onRender = function (event) {
51
- var series = this.context.optionsStore.getState().series;
52
+ var _a;
53
+ var series = (_a = this.context) === null || _a === void 0 ? void 0 : _a.optionsStore.getState().series;
52
54
  var firstSeries = Array.isArray(series) ? series[0] : null;
53
55
  var charts = event.sender._plotArea.charts;
54
56
  if (!firstSeries || firstSeries.type !== 'donut' || charts[0].points.length === 0) {
@@ -106,6 +106,7 @@ var Sparkline = /** @class */ (function (_super) {
106
106
  __extends(Sparkline, _super);
107
107
  function Sparkline() {
108
108
  var _this = _super !== null && _super.apply(this, arguments) || this;
109
+ _this._baseChart = null;
109
110
  /**
110
111
  * @hidden
111
112
  */
@@ -164,7 +165,7 @@ var Sparkline = /** @class */ (function (_super) {
164
165
  Sparkline.prototype.render = function () {
165
166
  var _this = this;
166
167
  var _a = this.props, children = _a.children, type = _a.type, className = _a.className, baseChartProps = __rest(_a, ["children", "type", "className"]);
167
- return (React.createElement(BaseChart_1.BaseChart, __assign({}, baseChartProps, { ref: function (baseChart) { return _this._baseChart = baseChart; }, chartConstructor: kendo_charts_1.Sparkline, getTarget: this.getTarget, wrapper: "span", deriveOptionsFromParent: this.deriveOptionsFromParent, className: kendo_react_common_1.classNames('k-sparkline k-widget', className) }), children));
168
+ return (React.createElement(BaseChart_1.BaseChart, __assign({}, baseChartProps, { ref: function (baseChart) { return _this._baseChart = baseChart; }, chartConstructor: kendo_charts_1.Sparkline, getTarget: this.getTarget, wrapper: "span", deriveOptionsFromParent: this.deriveOptionsFromParent, className: (0, kendo_react_common_1.classNames)('k-sparkline k-widget', className) }), children));
168
169
  };
169
170
  return Sparkline;
170
171
  }(React.Component));
@@ -61,6 +61,7 @@ var StockChart = /** @class */ (function (_super) {
61
61
  __extends(StockChart, _super);
62
62
  function StockChart() {
63
63
  var _this = _super !== null && _super.apply(this, arguments) || this;
64
+ _this._baseChart = null;
64
65
  /**
65
66
  * @hidden
66
67
  */
@@ -131,7 +132,7 @@ var StockChart = /** @class */ (function (_super) {
131
132
  StockChart.prototype.render = function () {
132
133
  var _this = this;
133
134
  var _a = this.props, children = _a.children, className = _a.className, baseChartProps = __rest(_a, ["children", "className"]);
134
- return (React.createElement(BaseChart_1.BaseChart, __assign({}, baseChartProps, { ref: function (baseChart) { return _this._baseChart = baseChart; }, chartConstructor: kendo_charts_1.StockChart, getTarget: this.getTarget, wrapper: "div", deriveOptionsFromParent: this.deriveOptionsFromParent, onRefresh: this.onRefresh, className: kendo_react_common_1.classNames('k-stockchart k-widget', className) }), children));
135
+ return (React.createElement(BaseChart_1.BaseChart, __assign({}, baseChartProps, { ref: function (baseChart) { return _this._baseChart = baseChart; }, chartConstructor: kendo_charts_1.StockChart, getTarget: this.getTarget, wrapper: "div", deriveOptionsFromParent: this.deriveOptionsFromParent, onRefresh: this.onRefresh, className: (0, kendo_react_common_1.classNames)('k-stockchart k-widget', className) }), children));
135
136
  };
136
137
  return StockChart;
137
138
  }(React.Component));
@@ -22,6 +22,6 @@ var ChartCategoryAxis = function (props) {
22
22
  exports.ChartCategoryAxis = ChartCategoryAxis;
23
23
  ChartCategoryAxis.propTypes = {
24
24
  children: function (props, propName, componentName) {
25
- return main_1.validateChildren(props, propName, componentName, CategoryAxisItem_1.ChartCategoryAxisItem);
25
+ return (0, main_1.validateChildren)(props, propName, componentName, CategoryAxisItem_1.ChartCategoryAxisItem);
26
26
  }
27
27
  };
@@ -22,6 +22,6 @@ var ChartPanes = function (props) {
22
22
  exports.ChartPanes = ChartPanes;
23
23
  ChartPanes.propTypes = {
24
24
  children: function (props, propName, componentName) {
25
- return main_1.validateChildren(props, propName, componentName, Pane_1.ChartPane);
25
+ return (0, main_1.validateChildren)(props, propName, componentName, Pane_1.ChartPane);
26
26
  }
27
27
  };
@@ -22,6 +22,6 @@ var ChartSeries = function (props) {
22
22
  exports.ChartSeries = ChartSeries;
23
23
  ChartSeries.propTypes = {
24
24
  children: function (props, propName, componentName) {
25
- return main_1.validateChildren(props, propName, componentName, SeriesItem_1.ChartSeriesItem);
25
+ return (0, main_1.validateChildren)(props, propName, componentName, SeriesItem_1.ChartSeriesItem);
26
26
  }
27
27
  };
@@ -22,6 +22,6 @@ var ChartValueAxis = function (props) {
22
22
  exports.ChartValueAxis = ChartValueAxis;
23
23
  ChartValueAxis.propTypes = {
24
24
  children: function (props, propName, componentName) {
25
- return main_1.validateChildren(props, propName, componentName, ValueAxisItem_1.ChartValueAxisItem);
25
+ return (0, main_1.validateChildren)(props, propName, componentName, ValueAxisItem_1.ChartValueAxisItem);
26
26
  }
27
27
  };