@progress/kendo-react-charts 9.0.0-develop.2 → 9.0.0-develop.21
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/ChartBreadcrumb.mjs +7 -1
- package/ChartNoDataOverlay.js +8 -0
- package/ChartNoDataOverlay.mjs +20 -0
- package/README.md +54 -52
- package/dist/cdn/js/kendo-react-charts.js +1 -1
- package/index.d.mts +53 -2
- package/index.d.ts +53 -2
- package/index.js +1 -1
- package/index.mjs +213 -211
- package/messages.js +8 -0
- package/messages.mjs +15 -0
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/sankey/Sankey.mjs +56 -33
- package/sankey/SankeyTooltip.mjs +10 -2
- package/sankey/propTypes.mjs +1 -4
- package/store/reducer.js +1 -1
- package/store/reducer.mjs +10 -10
- package/tooltip/Crosshair.mjs +1 -8
- package/tooltip/Popup.mjs +1 -10
- package/tooltip/Series.js +1 -1
- package/tooltip/Series.mjs +9 -16
- package/tooltip/SharedTooltipContent.mjs +1 -7
- package/utils/index.js +1 -1
- package/utils/index.mjs +7 -9
package/sankey/SankeyTooltip.mjs
CHANGED
|
@@ -12,7 +12,12 @@ import { arrowLeftIcon as v, arrowRightIcon as k } from "@progress/kendo-svg-ico
|
|
|
12
12
|
import { useInternationalization as I, useLocalization as b } from "@progress/kendo-react-intl";
|
|
13
13
|
import { tooltipUnitFormat as u, messages as w } from "./messages.mjs";
|
|
14
14
|
const R = (e) => {
|
|
15
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
Content: l,
|
|
17
|
+
dir: o,
|
|
18
|
+
offset: i,
|
|
19
|
+
event: { tooltipData: n, dataItem: E, nodeValue: y }
|
|
20
|
+
} = e, p = t.useRef(null);
|
|
16
21
|
return t.useEffect(() => {
|
|
17
22
|
const r = p.current;
|
|
18
23
|
if (!n || !r)
|
|
@@ -40,7 +45,10 @@ const R = (e) => {
|
|
|
40
45
|
marginLeft: d
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
|
-
), c = (e) => /* @__PURE__ */ t.createElement("span", { style: { margin: z } }, e.children), g = (e) => I().format(
|
|
48
|
+
), c = (e) => /* @__PURE__ */ t.createElement("span", { style: { margin: z } }, e.children), g = (e) => I().format(
|
|
49
|
+
b().toLanguageString(u, w[u]),
|
|
50
|
+
[e || 0]
|
|
51
|
+
), S = (e) => {
|
|
44
52
|
const { color: l, label: o } = e.dataItem;
|
|
45
53
|
return /* @__PURE__ */ t.createElement("div", { style: h, className: "k-tooltip-content" }, /* @__PURE__ */ t.createElement(m, { color: l }), /* @__PURE__ */ t.createElement(c, null, o.text), /* @__PURE__ */ t.createElement(c, null, g(e.nodeValue)));
|
|
46
54
|
}, $ = (e) => {
|
package/sankey/propTypes.mjs
CHANGED
|
@@ -17,10 +17,7 @@ const r = e.exact({
|
|
|
17
17
|
...i,
|
|
18
18
|
top: e.number,
|
|
19
19
|
bottom: e.number
|
|
20
|
-
}, o = e.oneOfType([
|
|
21
|
-
e.number,
|
|
22
|
-
e.exact(l)
|
|
23
|
-
]), t = o, n = e.exact({
|
|
20
|
+
}, o = e.oneOfType([e.number, e.exact(l)]), t = o, n = e.exact({
|
|
24
21
|
width: e.number,
|
|
25
22
|
color: e.string,
|
|
26
23
|
opacity: e.number,
|
package/store/reducer.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(t,e)=>e.chartCollectionIdxKey?
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(t,e)=>e.chartCollectionIdxKey?i.collectionConfigurationItem(t,e):e.chartKey?i.configurationItem(t,e):{},a=(t,e)=>{if(e.type)switch(e.type){case"set":return i.themeItem(t,e);case"push":return Object.assign(t,e.payload);default:return t}else return{}},d=(t,e)=>{if(e.type)switch(e.type){case"add":return[...t,e.payload];case"remove":return t.filter(r=>r!==e.payload);default:return t}else return[]},i={configurationItem(t,e){return Object.assign(t,{[e.chartKey]:e.payload})},collectionConfigurationItem(t,e){let r=!1;const[o,n]=e.chartCollectionIdxKey.split("_"),c=t[o].map((l,s)=>parseInt(n,10)===s?(r=!0,e.payload):l);return r===!1&&c.splice(parseInt(n,10),0,e.payload),Object.assign(t,{[o]:c})},themeItem(t,e){let r={};const o=Object.assign(r,t),{field:n,value:c}=e.payload,l=n.split(".");let s=l.shift();for(;l.length>0;)r=r[s]=r[s]||{},s=l.shift();return r[s]=c,o}};exports.observersReducer=d;exports.optionsReducer=u;exports.themeReducer=a;
|
package/store/reducer.mjs
CHANGED
|
@@ -24,7 +24,7 @@ const u = (t, e) => e.chartCollectionIdxKey ? c.collectionConfigurationItem(t, e
|
|
|
24
24
|
case "add":
|
|
25
25
|
return [...t, e.payload];
|
|
26
26
|
case "remove":
|
|
27
|
-
return t.filter((
|
|
27
|
+
return t.filter((r) => r !== e.payload);
|
|
28
28
|
default:
|
|
29
29
|
return t;
|
|
30
30
|
}
|
|
@@ -37,19 +37,19 @@ const u = (t, e) => e.chartCollectionIdxKey ? c.collectionConfigurationItem(t, e
|
|
|
37
37
|
});
|
|
38
38
|
},
|
|
39
39
|
collectionConfigurationItem(t, e) {
|
|
40
|
-
let
|
|
41
|
-
const [o, n] = e.chartCollectionIdxKey.split("_"), i = t[o].map((
|
|
42
|
-
return
|
|
40
|
+
let r = !1;
|
|
41
|
+
const [o, n] = e.chartCollectionIdxKey.split("_"), i = t[o].map((l, s) => parseInt(n, 10) === s ? (r = !0, e.payload) : l);
|
|
42
|
+
return r === !1 && i.splice(parseInt(n, 10), 0, e.payload), Object.assign(t, {
|
|
43
43
|
[o]: i
|
|
44
44
|
});
|
|
45
45
|
},
|
|
46
46
|
themeItem(t, e) {
|
|
47
|
-
let
|
|
48
|
-
const { field: n, value: i } = e.payload,
|
|
49
|
-
let
|
|
50
|
-
for (;
|
|
51
|
-
|
|
52
|
-
return
|
|
47
|
+
let r = {};
|
|
48
|
+
const o = Object.assign(r, t), { field: n, value: i } = e.payload, l = n.split(".");
|
|
49
|
+
let s = l.shift();
|
|
50
|
+
for (; l.length > 0; )
|
|
51
|
+
r = r[s] = r[s] || {}, s = l.shift();
|
|
52
|
+
return r[s] = i, o;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
export {
|
package/tooltip/Crosshair.mjs
CHANGED
|
@@ -28,14 +28,7 @@ const v = "k-chart-crosshair-tooltip", C = "k-chart-tooltip-inverse", n = class
|
|
|
28
28
|
[v]: !0,
|
|
29
29
|
[C]: !!o
|
|
30
30
|
});
|
|
31
|
-
return /* @__PURE__ */ r.createElement(
|
|
32
|
-
d,
|
|
33
|
-
{
|
|
34
|
-
...e,
|
|
35
|
-
popupContent: p,
|
|
36
|
-
className: s
|
|
37
|
-
}
|
|
38
|
-
);
|
|
31
|
+
return /* @__PURE__ */ r.createElement(d, { ...e, popupContent: p, className: s });
|
|
39
32
|
}
|
|
40
33
|
componentWillUnmount() {
|
|
41
34
|
var t;
|
package/tooltip/Popup.mjs
CHANGED
|
@@ -43,16 +43,7 @@ const v = { horizontal: "fit", vertical: "fit" }, d = "k-chart-tooltip", C = "k-
|
|
|
43
43
|
collision: v,
|
|
44
44
|
className: C
|
|
45
45
|
},
|
|
46
|
-
/* @__PURE__ */ n.createElement(
|
|
47
|
-
"div",
|
|
48
|
-
{
|
|
49
|
-
className: c,
|
|
50
|
-
style: t,
|
|
51
|
-
onMouseLeave: this.onMouseLeave,
|
|
52
|
-
ref: this.popupRef
|
|
53
|
-
},
|
|
54
|
-
a()
|
|
55
|
-
)
|
|
46
|
+
/* @__PURE__ */ n.createElement("div", { className: c, style: t, onMouseLeave: this.onMouseLeave, ref: this.popupRef }, a())
|
|
56
47
|
);
|
|
57
48
|
}
|
|
58
49
|
componentWillUnmount() {
|
package/tooltip/Series.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),m=require("@progress/kendo-react-common"),S=require("@progress/kendo-charts"),h=require("./Point.js"),y=require("./SharedTooltipContent.js"),T=require("./Popup.js"),C=require("../ChartContext.js");function O(p){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const e in p)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(p,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>p[e]})}}return t.default=p,Object.freeze(t)}const a=O(f),x="k-chart-shared-tooltip",g="k-chart-tooltip-inverse",
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),m=require("@progress/kendo-react-common"),S=require("@progress/kendo-charts"),h=require("./Point.js"),y=require("./SharedTooltipContent.js"),T=require("./Popup.js"),C=require("../ChartContext.js");function O(p){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const e in p)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(p,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>p[e]})}}return t.default=p,Object.freeze(t)}const a=O(f),x="k-chart-shared-tooltip",g="k-chart-tooltip-inverse",l=class l extends a.Component{constructor(){super(...arguments),this.context=null,this.state={popupShown:!1},this.chartObserver=null}componentDidMount(){this.chartObserver=new S.InstanceObserver(this,{showTooltip:"onShowTooltip",hideTooltip:"onHideTooltip"}),this.context.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{popupContext:t,shared:e,className:n,...r}=this.state,i=this.state.popupShown?()=>{const o=this.findRenderFunction();if(e)return o!==null?o(t):a.createElement(y.SharedTooltipContent,{...t});const d=t.point,u=this.findRenderFunctionByIndex(d.series.index);return u!==null?u(t):o!==null?o(t):a.createElement("span",{dangerouslySetInnerHTML:{__html:t.point.formattedValue}})}:Function.prototype,s=m.classNames({[x]:e,[g]:!!n});return a.createElement(T.TooltipPopup,{...r,popupContent:i,className:s})}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.chartObserver})}onShowTooltip(t){const{anchor:e,style:n,shared:r,className:i,crosshair:s}=t;let o;s||(r?o=this.createSharedTooltipContext(t):o=this.createTooltipContext(t),this.setState({popupShown:!0,popupAlign:e.align,popupOffset:e.point,popupContext:o,popupStyles:n,className:i,shared:r}))}onHideTooltip(){this.setState({popupShown:!1,popupStyles:{},className:void 0})}createSharedTooltipContext(t){const{points:e,categoryText:n}=t,r=e.filter(o=>typeof o.series.name!="undefined").length>0,i=t.series.length>1;let s=1;return r&&s++,i&&s++,{categoryText:n,colorMarker:i,colspan:s,nameColumn:r,points:t.points.map(o=>new h.TooltipPoint(o,t.format))}}createTooltipContext(t){const{point:e,format:n}=t;return{point:new h.TooltipPoint(e,n)}}findRenderFunctionByIndex(t){const e=this.context.optionsStore.getState().series;return e!==void 0&&Array.isArray(e)&&e[t]!==void 0&&e[t].hasOwnProperty("tooltip")&&e[t].tooltip.hasOwnProperty("render")?e[t].tooltip.render:null}findRenderFunction(){const t=this.context.optionsStore.getState().tooltip;return t!==void 0&&t.hasOwnProperty("render")?t.render:null}};l.contextType=C.ChartContext;let c=l;exports.SeriesTooltip=c;
|
package/tooltip/Series.mjs
CHANGED
|
@@ -33,27 +33,20 @@ const T = "k-chart-shared-tooltip", x = "k-chart-tooltip-inverse", a = class a e
|
|
|
33
33
|
const o = this.findRenderFunction();
|
|
34
34
|
if (e)
|
|
35
35
|
return o !== null ? o(t) : /* @__PURE__ */ p.createElement(f, { ...t });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
|
|
36
|
+
const u = t.point, l = this.findRenderFunctionByIndex(u.series.index);
|
|
37
|
+
return l !== null ? l(t) : o !== null ? o(t) : /* @__PURE__ */ p.createElement(
|
|
38
|
+
"span",
|
|
39
|
+
{
|
|
40
|
+
dangerouslySetInnerHTML: {
|
|
41
|
+
__html: t.point.formattedValue
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
45
|
} : Function.prototype, s = d({
|
|
46
46
|
[T]: e,
|
|
47
47
|
[x]: !!n
|
|
48
48
|
});
|
|
49
|
-
return /* @__PURE__ */ p.createElement(
|
|
50
|
-
S,
|
|
51
|
-
{
|
|
52
|
-
...r,
|
|
53
|
-
popupContent: i,
|
|
54
|
-
className: s
|
|
55
|
-
}
|
|
56
|
-
);
|
|
49
|
+
return /* @__PURE__ */ p.createElement(S, { ...r, popupContent: i, className: s });
|
|
57
50
|
}
|
|
58
51
|
componentWillUnmount() {
|
|
59
52
|
this.context.observersStore.dispatch({
|
|
@@ -8,13 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
const u = "k-chart-shared-tooltip-marker", E = (l) => {
|
|
11
|
-
const { categoryText: r, colorMarker: n, colspan: a, nameColumn: o, points: c } = l, m = (t, s) => /* @__PURE__ */ e.createElement("tr", { key: s }, n && /* @__PURE__ */ e.createElement("td", null, /* @__PURE__ */ e.createElement(
|
|
12
|
-
"span",
|
|
13
|
-
{
|
|
14
|
-
className: u,
|
|
15
|
-
style: { backgroundColor: t.series.color }
|
|
16
|
-
}
|
|
17
|
-
)), o && /* @__PURE__ */ e.createElement("td", null, t.series.name), /* @__PURE__ */ e.createElement("td", { dangerouslySetInnerHTML: { __html: t.formattedValue } }));
|
|
11
|
+
const { categoryText: r, colorMarker: n, colspan: a, nameColumn: o, points: c } = l, m = (t, s) => /* @__PURE__ */ e.createElement("tr", { key: s }, n && /* @__PURE__ */ e.createElement("td", null, /* @__PURE__ */ e.createElement("span", { className: u, style: { backgroundColor: t.series.color } })), o && /* @__PURE__ */ e.createElement("td", null, t.series.name), /* @__PURE__ */ e.createElement("td", { dangerouslySetInnerHTML: { __html: t.formattedValue } }));
|
|
18
12
|
return /* @__PURE__ */ e.createElement("table", null, /* @__PURE__ */ e.createElement("thead", null, /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement("th", { colSpan: a }, r))), /* @__PURE__ */ e.createElement("tbody", null, c.map(m)));
|
|
19
13
|
};
|
|
20
14
|
export {
|
package/utils/index.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function l(r,t){let e=r;for(;e&&e!==t;)e=e.parentNode;return!!e}function i(r,t,e,o){const n=r[t];if(n&&Array.isArray(n)){for(const a of n)if(!a.type||a.type!==o)return new Error(`${e} children should be Array of type ${o.displayName}.`)}return null}const u=r=>r===void 0?!1:!r;exports.hasParent=l;exports.toggle=u;exports.validateChildren=i;
|
package/utils/index.mjs
CHANGED
|
@@ -6,26 +6,24 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
function
|
|
9
|
+
function i(r, t) {
|
|
10
10
|
let e = r;
|
|
11
11
|
for (; e && e !== t; )
|
|
12
12
|
e = e.parentNode;
|
|
13
13
|
return !!e;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function l(r, t, e, o) {
|
|
16
16
|
const n = r[t];
|
|
17
17
|
if (n && Array.isArray(n)) {
|
|
18
|
-
for (
|
|
19
|
-
if (!
|
|
20
|
-
return new Error(
|
|
21
|
-
`${e} children should be Array of type ${o.displayName}.`
|
|
22
|
-
);
|
|
18
|
+
for (const a of n)
|
|
19
|
+
if (!a.type || a.type !== o)
|
|
20
|
+
return new Error(`${e} children should be Array of type ${o.displayName}.`);
|
|
23
21
|
}
|
|
24
22
|
return null;
|
|
25
23
|
}
|
|
26
24
|
const u = (r) => r === void 0 ? !1 : !r;
|
|
27
25
|
export {
|
|
28
|
-
|
|
26
|
+
i as hasParent,
|
|
29
27
|
u as toggle,
|
|
30
|
-
|
|
28
|
+
l as validateChildren
|
|
31
29
|
};
|