@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.
- package/dist/cdn/js/kendo-react-charts.js +1 -1
- package/dist/es/BaseChart.d.ts +1 -1
- package/dist/es/BaseChart.js +5 -1
- package/dist/es/Chart.js +1 -0
- package/dist/es/ChartContext.d.ts +1 -1
- package/dist/es/DonutCenter.d.ts +3 -1
- package/dist/es/DonutCenter.js +3 -1
- package/dist/es/Sparkline.js +1 -0
- package/dist/es/StockChart.js +1 -0
- package/dist/es/components/base/CollectionConfigurationComponent.d.ts +1 -1
- package/dist/es/components/base/CollectionConfigurationComponent.js +1 -1
- package/dist/es/components/base/ConfigurationComponent.d.ts +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/store/reducer.js +9 -5
- package/dist/es/theming/theme-service.js +5 -5
- package/dist/es/tooltip/Crosshair.d.ts +3 -1
- package/dist/es/tooltip/Crosshair.js +3 -1
- package/dist/es/tooltip/CrosshairContainer.d.ts +3 -1
- package/dist/es/tooltip/CrosshairContainer.js +3 -1
- package/dist/es/tooltip/Popup.d.ts +3 -1
- package/dist/es/tooltip/Popup.js +2 -0
- package/dist/es/tooltip/Series.d.ts +4 -2
- package/dist/es/tooltip/Series.js +2 -0
- package/dist/es/utils/main.d.ts +1 -1
- package/dist/es/utils/main.js +1 -1
- package/dist/npm/BaseChart.d.ts +1 -1
- package/dist/npm/BaseChart.js +18 -14
- package/dist/npm/Chart.js +2 -1
- package/dist/npm/ChartContext.d.ts +1 -1
- package/dist/npm/DonutCenter.d.ts +3 -1
- package/dist/npm/DonutCenter.js +3 -1
- package/dist/npm/Sparkline.js +2 -1
- package/dist/npm/StockChart.js +2 -1
- package/dist/npm/components/CategoryAxis.js +1 -1
- package/dist/npm/components/Panes.js +1 -1
- package/dist/npm/components/Series.js +1 -1
- package/dist/npm/components/ValueAxis.js +1 -1
- package/dist/npm/components/XAxis.js +1 -1
- package/dist/npm/components/YAxis.js +1 -1
- package/dist/npm/components/base/CollectionConfigurationComponent.d.ts +1 -1
- package/dist/npm/components/base/CollectionConfigurationComponent.js +1 -1
- package/dist/npm/components/base/ConfigurationComponent.d.ts +1 -1
- package/dist/npm/components/base/ConfigurationComponent.js +1 -1
- package/dist/npm/components/main.js +5 -1
- package/dist/npm/components/navigator/Series.js +1 -1
- package/dist/npm/components/navigator/main.js +5 -1
- package/dist/npm/main.js +5 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/store/reducer.js +9 -5
- package/dist/npm/theming/theme-service.js +7 -7
- package/dist/npm/tooltip/Crosshair.d.ts +3 -1
- package/dist/npm/tooltip/Crosshair.js +4 -2
- package/dist/npm/tooltip/CrosshairContainer.d.ts +3 -1
- package/dist/npm/tooltip/CrosshairContainer.js +3 -1
- package/dist/npm/tooltip/Popup.d.ts +3 -1
- package/dist/npm/tooltip/Popup.js +4 -2
- package/dist/npm/tooltip/Series.d.ts +4 -2
- package/dist/npm/tooltip/Series.js +3 -1
- package/dist/npm/utils/main.d.ts +1 -1
- package/dist/npm/utils/main.js +1 -1
- package/dist/systemjs/kendo-react-charts.js +1 -1
- package/package.json +6 -6
|
@@ -22,6 +22,6 @@ var ChartXAxis = function (props) {
|
|
|
22
22
|
exports.ChartXAxis = ChartXAxis;
|
|
23
23
|
ChartXAxis.prototype = {
|
|
24
24
|
children: function (props, propName, componentName) {
|
|
25
|
-
return main_1.validateChildren(props, propName, componentName, XAxisItem_1.ChartXAxisItem);
|
|
25
|
+
return (0, main_1.validateChildren)(props, propName, componentName, XAxisItem_1.ChartXAxisItem);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
@@ -22,6 +22,6 @@ var ChartYAxis = function (props) {
|
|
|
22
22
|
exports.ChartYAxis = ChartYAxis;
|
|
23
23
|
ChartYAxis.propTypes = {
|
|
24
24
|
children: function (props, propName, componentName) {
|
|
25
|
-
return main_1.validateChildren(props, propName, componentName, YAxisItem_1.ChartYAxisItem);
|
|
25
|
+
return (0, main_1.validateChildren)(props, propName, componentName, YAxisItem_1.ChartYAxisItem);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
@@ -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>;
|
|
@@ -42,7 +42,7 @@ var CollectionConfigurationComponent = /** @class */ (function (_super) {
|
|
|
42
42
|
CollectionConfigurationComponent.prototype.renderChildren = function (child, index) {
|
|
43
43
|
var children = child.props.children;
|
|
44
44
|
var _a = this.props, _chartKey = _a._chartKey, _parentStore = _a._parentStore;
|
|
45
|
-
var collectionItemProps = __assign(__assign({}, child.props), { _chartCollectionIdxKey: _chartKey
|
|
45
|
+
var collectionItemProps = __assign(__assign({}, child.props), { _chartCollectionIdxKey: "".concat(_chartKey, "_").concat(index), _parentStore: _parentStore });
|
|
46
46
|
return React.cloneElement(child, collectionItemProps, children);
|
|
47
47
|
};
|
|
48
48
|
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);
|
|
@@ -50,7 +50,7 @@ var ConfigurationComponent = /** @class */ (function (_super) {
|
|
|
50
50
|
function ConfigurationComponent(props, context) {
|
|
51
51
|
var _this = _super.call(this, props, context) || this;
|
|
52
52
|
_this.optionsStore = context.optionsStore;
|
|
53
|
-
_this.childStore = store_1.default(reducer_1.optionsReducer);
|
|
53
|
+
_this.childStore = (0, store_1.default)(reducer_1.optionsReducer);
|
|
54
54
|
return _this;
|
|
55
55
|
}
|
|
56
56
|
ConfigurationComponent.prototype.render = function () {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -22,6 +22,6 @@ var ChartNavigatorSeries = function (props) {
|
|
|
22
22
|
exports.ChartNavigatorSeries = ChartNavigatorSeries;
|
|
23
23
|
ChartNavigatorSeries.propTypes = {
|
|
24
24
|
children: function (props, propName, componentName) {
|
|
25
|
-
return main_1.validateChildren(props, propName, componentName, SeriesItem_1.ChartNavigatorSeriesItem);
|
|
25
|
+
return (0, main_1.validateChildren)(props, propName, componentName, SeriesItem_1.ChartNavigatorSeriesItem);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/npm/main.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-react-charts',
|
|
9
9
|
productName: 'KendoReact',
|
|
10
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1654508921,
|
|
12
12
|
version: '',
|
|
13
13
|
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'
|
|
14
14
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3
|
-
for (var i = 0,
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
6
10
|
};
|
|
7
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
12
|
exports.observersReducer = exports.themeReducer = exports.optionsReducer = void 0;
|
|
@@ -47,7 +51,7 @@ var observersReducer = function (currentState, action) {
|
|
|
47
51
|
if (action.type) {
|
|
48
52
|
switch (action.type) {
|
|
49
53
|
case 'add':
|
|
50
|
-
return __spreadArray(__spreadArray([], currentState), [action.payload]);
|
|
54
|
+
return __spreadArray(__spreadArray([], currentState, true), [action.payload], false);
|
|
51
55
|
case 'remove':
|
|
52
56
|
return currentState.filter(function (element) { return element !== action.payload; });
|
|
53
57
|
default:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadTheme = void 0;
|
|
4
4
|
var kendo_charts_1 = require("@progress/kendo-charts");
|
|
5
|
-
var font = function (style) { return style.fontWeight
|
|
5
|
+
var font = function (style) { return "".concat(style.fontWeight, " ").concat(style.fontSize, " ").concat(style.fontFamily); };
|
|
6
6
|
var computedBackgroundColor = function (element) { return window.getComputedStyle(element).backgroundColor; };
|
|
7
7
|
var letterPos = function (letter) { return letter.toLowerCase().charCodeAt(0) - 'a'.charCodeAt(0); };
|
|
8
8
|
var seriesPos = function (name) {
|
|
@@ -17,11 +17,11 @@ var SERIES_COLORS = 30;
|
|
|
17
17
|
var seriesTemplate = function () {
|
|
18
18
|
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";
|
|
19
19
|
for (var i = 0; i < SERIES_COLORS; i++) {
|
|
20
|
-
result += "\n <div class=\"k-var--series-"
|
|
20
|
+
result += "\n <div class=\"k-var--series-".concat(i + 1, "\"></div>");
|
|
21
21
|
}
|
|
22
22
|
return result;
|
|
23
23
|
};
|
|
24
|
-
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 "
|
|
24
|
+
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");
|
|
25
25
|
/**
|
|
26
26
|
* @hidden
|
|
27
27
|
*/
|
|
@@ -112,14 +112,14 @@ var ThemeService = /** @class */ (function () {
|
|
|
112
112
|
};
|
|
113
113
|
ThemeService.prototype.queryStyle = function (varName) {
|
|
114
114
|
var element = this.element;
|
|
115
|
-
return window.getComputedStyle(element.querySelector(".k-var--"
|
|
115
|
+
return window.getComputedStyle(element.querySelector(".k-var--".concat(varName)));
|
|
116
116
|
};
|
|
117
117
|
ThemeService.prototype.setInactiveOpacity = function (seriesTypes, selector) {
|
|
118
118
|
var _this = this;
|
|
119
119
|
var inactiveOpacity = parseFloat(this.queryStyle(selector).opacity);
|
|
120
120
|
if (!isNaN(inactiveOpacity) && inactiveOpacity < 1) {
|
|
121
121
|
seriesTypes.forEach(function (type) {
|
|
122
|
-
return _this.setStyle("seriesDefaults."
|
|
122
|
+
return _this.setStyle("seriesDefaults.".concat(type, ".highlight.inactiveOpacity"), inactiveOpacity);
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
};
|
|
@@ -128,7 +128,7 @@ var ThemeService = /** @class */ (function () {
|
|
|
128
128
|
var loadTheme = function (store, done) {
|
|
129
129
|
var service = new ThemeService(store);
|
|
130
130
|
if (typeof document === 'undefined') {
|
|
131
|
-
store.dispatch({ type: 'push', payload: kendo_charts_1.chartBaseTheme() });
|
|
131
|
+
store.dispatch({ type: 'push', payload: (0, kendo_charts_1.chartBaseTheme)() });
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
var container = service.element = document.createElement('div');
|
|
@@ -136,7 +136,7 @@ var loadTheme = function (store, done) {
|
|
|
136
136
|
container.innerHTML = template;
|
|
137
137
|
document.body.appendChild(container);
|
|
138
138
|
try {
|
|
139
|
-
store.dispatch({ type: 'push', payload: kendo_charts_1.chartBaseTheme() });
|
|
139
|
+
store.dispatch({ type: 'push', payload: (0, kendo_charts_1.chartBaseTheme)() });
|
|
140
140
|
service.setColors();
|
|
141
141
|
service.setFonts();
|
|
142
142
|
service.setSeriesColors();
|
|
@@ -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);
|
|
@@ -52,6 +52,7 @@ var CrosshairTooltip = /** @class */ (function (_super) {
|
|
|
52
52
|
__extends(CrosshairTooltip, _super);
|
|
53
53
|
function CrosshairTooltip(props, context) {
|
|
54
54
|
var _this = _super.call(this, props, context) || this;
|
|
55
|
+
_this.context = null;
|
|
55
56
|
_this.state = {
|
|
56
57
|
popupShown: false
|
|
57
58
|
};
|
|
@@ -69,14 +70,15 @@ var CrosshairTooltip = /** @class */ (function (_super) {
|
|
|
69
70
|
var _a;
|
|
70
71
|
var _b = this.state, popupContend = _b.popupContend, className = _b.className, tooltipProps = __rest(_b, ["popupContend", "className"]);
|
|
71
72
|
var tooltipContent = this.state.popupShown ? function () { return popupContend; } : Function.prototype;
|
|
72
|
-
var popupContainerClassName = kendo_react_common_1.classNames((_a = {},
|
|
73
|
+
var popupContainerClassName = (0, kendo_react_common_1.classNames)((_a = {},
|
|
73
74
|
_a[CROSSHAIR_TOOLTIP_CLASS] = true,
|
|
74
75
|
_a[INVERSE_TOOLTIP_CLASS] = !!className,
|
|
75
76
|
_a));
|
|
76
77
|
return (React.createElement(Popup_1.TooltipPopup, __assign({}, tooltipProps, { popupContent: tooltipContent, className: popupContainerClassName })));
|
|
77
78
|
};
|
|
78
79
|
CrosshairTooltip.prototype.componentWillUnmount = function () {
|
|
79
|
-
|
|
80
|
+
var _a;
|
|
81
|
+
(_a = this.context) === null || _a === void 0 ? void 0 : _a.observersStore.dispatch({
|
|
80
82
|
type: 'remove',
|
|
81
83
|
payload: this.chartObserver
|
|
82
84
|
});
|
|
@@ -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;
|
|
@@ -66,13 +66,15 @@ var CrosshairTooltipContainer = /** @class */ (function (_super) {
|
|
|
66
66
|
__extends(CrosshairTooltipContainer, _super);
|
|
67
67
|
function CrosshairTooltipContainer() {
|
|
68
68
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
69
|
+
_this.context = null;
|
|
69
70
|
_this.state = {
|
|
70
71
|
tooltips: {}
|
|
71
72
|
};
|
|
72
73
|
_this.storeUnsubscriber = Function.prototype;
|
|
73
74
|
_this.subscriber = function () {
|
|
75
|
+
var _a;
|
|
74
76
|
_this.setState({
|
|
75
|
-
tooltips: mapTooltips(_this.context.optionsStore.getState())
|
|
77
|
+
tooltips: mapTooltips((_a = _this.context) === null || _a === void 0 ? void 0 : _a.optionsStore.getState())
|
|
76
78
|
});
|
|
77
79
|
};
|
|
78
80
|
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);
|
|
@@ -32,16 +32,18 @@ var TooltipPopup = /** @class */ (function (_super) {
|
|
|
32
32
|
__extends(TooltipPopup, _super);
|
|
33
33
|
function TooltipPopup(props, context) {
|
|
34
34
|
var _this = _super.call(this, props, context) || this;
|
|
35
|
+
_this.context = null;
|
|
36
|
+
_this.element = null;
|
|
35
37
|
_this.onChartMouseLeave = function (e) {
|
|
36
38
|
var syntheticEvent = e.syntheticEvent;
|
|
37
|
-
if (main_1.hasParent(syntheticEvent.relatedTarget, _this.element)) {
|
|
39
|
+
if ((0, main_1.hasParent)(syntheticEvent.relatedTarget, _this.element)) {
|
|
38
40
|
/* prevent default behavior so that the tooltip won't be hidden */
|
|
39
41
|
return true;
|
|
40
42
|
}
|
|
41
43
|
return false;
|
|
42
44
|
};
|
|
43
45
|
_this.onMouseLeave = function (e) {
|
|
44
|
-
var domEvent = dom_event_1.toDomEvent(_this, e);
|
|
46
|
+
var domEvent = (0, dom_event_1.toDomEvent)(_this, e);
|
|
45
47
|
var isDefaultPrevented = _this.context.childrenObserver.trigger('onMouseLeave', domEvent);
|
|
46
48
|
if (isDefaultPrevented) {
|
|
47
49
|
e.preventDefault();
|
|
@@ -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;
|
|
@@ -54,9 +54,11 @@ var SeriesTooltip = /** @class */ (function (_super) {
|
|
|
54
54
|
__extends(SeriesTooltip, _super);
|
|
55
55
|
function SeriesTooltip() {
|
|
56
56
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
57
|
+
_this.context = null;
|
|
57
58
|
_this.state = {
|
|
58
59
|
popupShown: false
|
|
59
60
|
};
|
|
61
|
+
_this.chartObserver = null;
|
|
60
62
|
return _this;
|
|
61
63
|
}
|
|
62
64
|
SeriesTooltip.prototype.componentDidMount = function () {
|
|
@@ -94,7 +96,7 @@ var SeriesTooltip = /** @class */ (function (_super) {
|
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
} : Function.prototype;
|
|
97
|
-
var popupContainerClassName = kendo_react_common_1.classNames((_a = {},
|
|
99
|
+
var popupContainerClassName = (0, kendo_react_common_1.classNames)((_a = {},
|
|
98
100
|
_a[SHARED_TOOLTIP_CLASS] = shared,
|
|
99
101
|
_a[INVERSE_TOOLTIP_CLASS] = !!className,
|
|
100
102
|
_a));
|
package/dist/npm/utils/main.d.ts
CHANGED
|
@@ -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.
|
|
9
|
+
declare function validateChildren<P>(props: P, propName: string, componentName: string, childType: React.FunctionComponent): Error | null;
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
package/dist/npm/utils/main.js
CHANGED
|
@@ -22,7 +22,7 @@ function validateChildren(props, propName, componentName, childType) {
|
|
|
22
22
|
for (var _i = 0, prop_1 = prop; _i < prop_1.length; _i++) {
|
|
23
23
|
var value = prop_1[_i];
|
|
24
24
|
if (!value.type || value.type !== childType) {
|
|
25
|
-
return new Error(componentName
|
|
25
|
+
return new Error("".concat(componentName, " children should be Array of type ").concat(childType.displayName, "."));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|