@progress/kendo-react-charts 7.5.0-develop.6 → 7.5.0-develop.8

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/sankey/Sankey.mjs CHANGED
@@ -6,60 +6,85 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as n from "react";
10
- import { Sankey as m } from "@progress/kendo-charts";
11
- import { loadTheme as E } from "./theme-service.mjs";
12
- import { validatePackage as y, canUseDOM as v } from "@progress/kendo-react-common";
13
- import { packageMetadata as L } from "../package-metadata.mjs";
14
- import { sankeyPropTypes as R } from "./propTypes.mjs";
15
- const b = ["nodeEnter", "nodeLeave", "linkEnter", "linkLeave"], g = (e, o) => {
16
- e && (e.unbind(), b.forEach((t) => {
17
- o[t] && e.bind(t, o[t]);
9
+ import * as t from "react";
10
+ import { Sankey as O } from "@progress/kendo-charts";
11
+ import { loadTheme as x } from "./theme-service.mjs";
12
+ import { validatePackage as H, canUseDOM as h } from "@progress/kendo-react-common";
13
+ import { packageMetadata as D } from "../package-metadata.mjs";
14
+ import { sankeyPropTypes as I } from "./propTypes.mjs";
15
+ import { TooltipComponent as M, NodeTooltipContent as V, LinkTooltipContent as j } from "./SankeyTooltip.mjs";
16
+ const A = 12, F = ["nodeEnter", "nodeLeave", "linkEnter", "linkLeave", "nodeClick", "linkClick"], K = (e, a) => {
17
+ e && (e.unbind(), F.forEach((o) => {
18
+ a[o] && e.bind(o, a[o]);
18
19
  }));
19
- }, k = n.forwardRef((e, o) => {
20
- y(L);
21
- const t = n.useRef(null), r = n.useRef(null), i = n.useRef(null), { data: l, links: s, nodes: f, labels: d } = e;
22
- n.useEffect(() => (r.current ? r.current.setOptions({
23
- data: l,
24
- links: s,
25
- nodes: f,
26
- labels: d
27
- }) : v && t.current && E(t.current.ownerDocument, (a) => {
28
- r.current = new m(t.current, {
29
- data: l,
30
- links: s,
31
- nodes: f,
32
- labels: d
33
- }, a);
34
- }), () => {
35
- r.current && (r.current.destroy(), r.current = null);
36
- }), [l, s, f, d]), n.useImperativeHandle(i, () => ({
20
+ }, g = t.forwardRef((e, a) => {
21
+ H(D);
22
+ const o = t.useRef(null), r = t.useRef(null), c = t.useRef(null), { data: s, links: u, nodes: d, labels: f, title: k, legend: m, tooltip: p, disableAutoLayout: y } = e, [E, C] = t.useState(null), { followPointer: L, delay: v, offset: b = A } = p || {}, T = t.useRef();
23
+ T.current = p;
24
+ const R = t.useCallback((n) => {
25
+ const {
26
+ visible: l = !0,
27
+ nodeComponent: P = V,
28
+ linkComponent: S = j
29
+ } = T.current || {};
30
+ if (l) {
31
+ const w = {
32
+ event: n,
33
+ offset: b,
34
+ Content: n.targetType === "node" ? P : S
35
+ };
36
+ C(w);
37
+ }
38
+ }, [b]), N = t.useCallback(() => {
39
+ C(null);
40
+ }, []);
41
+ t.useEffect(() => {
42
+ const n = {
43
+ data: s,
44
+ links: u,
45
+ nodes: d,
46
+ labels: f,
47
+ title: k,
48
+ legend: m,
49
+ disableAutoLayout: y,
50
+ tooltip: { delay: v, followPointer: L }
51
+ };
52
+ return r.current ? r.current.setOptions(n) : h && o.current && x(o.current.ownerDocument, (l) => {
53
+ r.current = new O(o.current, n, l);
54
+ }), () => {
55
+ r.current && (r.current.destroy(), r.current = null);
56
+ };
57
+ }, [s, u, d, f, k, m, y, L, v]), t.useImperativeHandle(c, () => ({
37
58
  get element() {
38
- return t.current;
59
+ return o.current;
39
60
  },
61
+ exportVisual: (n) => r.current.exportVisual(n),
40
62
  props: e
41
- }), []), n.useImperativeHandle(o, () => i.current);
42
- const c = n.useCallback((a) => a && ((u) => {
43
- Object.defineProperty(u, "target", { get: () => i.current }), u.nativeEvent = u.originalEvent || null, a.call(void 0, u);
63
+ }), []), t.useImperativeHandle(a, () => c.current);
64
+ const i = t.useCallback((n) => n && ((l) => {
65
+ Object.defineProperty(l, "target", { get: () => c.current }), l.nativeEvent = l.originalEvent || null, n.call(void 0, l);
44
66
  }), []);
45
- return n.useEffect(() => {
46
- g(r.current, {
47
- nodeEnter: c(e.onNodeEnter),
48
- nodeLeave: c(e.onNodeLeave),
49
- linkEnter: c(e.onLinkEnter),
50
- linkLeave: c(e.onLinkLeave)
51
- });
52
- }, [e.onNodeEnter, e.onNodeLeave, e.onLinkEnter, e.onLinkLeave]), /* @__PURE__ */ n.createElement(
67
+ return t.useEffect(() => {
68
+ const n = r.current;
69
+ K(n, {
70
+ nodeEnter: i(e.onNodeEnter),
71
+ nodeLeave: i(e.onNodeLeave),
72
+ linkEnter: i(e.onLinkEnter),
73
+ linkLeave: i(e.onLinkLeave),
74
+ nodeClick: i(e.onNodeClick),
75
+ linkClick: i(e.onLinkClick)
76
+ }), n && (n.bind("tooltipShow", R), n.bind("tooltipHide", N));
77
+ }, [e.onNodeEnter, e.onNodeLeave, e.onLinkEnter, e.onLinkLeave]), /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
53
78
  "div",
54
79
  {
55
- ref: t,
80
+ ref: o,
56
81
  className: e.className,
57
82
  style: e.style
58
83
  }
59
- );
84
+ ), E && /* @__PURE__ */ t.createElement(M, { ...E }));
60
85
  });
61
- k.propTypes = R;
62
- k.displayName = "KendoReactSankey";
86
+ g.propTypes = I;
87
+ g.displayName = "KendoReactSankey";
63
88
  export {
64
- k as Sankey
89
+ g as Sankey
65
90
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),k=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),f=require("@progress/kendo-react-intl"),s=require("./messages.js");function x(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,l.get?l:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const e=x(b),T=t=>{const{Content:n,offset:o,event:{tooltipData:l,dataItem:y,nodeValue:E}}=t,u=e.useRef(null);return e.useEffect(()=>{const i=u.current;if(!l||!i)return;const m={width:i.offsetWidth,height:i.offsetHeight},r={...l.popupOffset},c=l.popupAlign;r.left+=c.horizontal==="left"?o:-1*o,c.horizontal==="right"&&(r.left-=m.width),c.vertical==="bottom"?r.top-=m.height+o:r.top+=o,i.style.left=`${r.left}px`,i.style.top=`${r.top}px`,i.style.visibility=""},[l]),e.createElement("div",{ref:u,style:{visibility:"hidden"},className:"k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip"},e.createElement("div",{className:"k-tooltip-content"},e.createElement(n,{dataItem:y,nodeValue:E})))},d=3,C=`0 ${d}px`,g={display:"flex",alignItems:"center"},p=t=>e.createElement("div",{style:{width:15,height:15,backgroundColor:t.color,display:"inline-flex",marginLeft:d}}),a=t=>e.createElement("span",{style:{margin:C}},t.children),h=t=>f.useInternationalization().format(f.useLocalization().toLanguageString(s.tooltipUnitFormat,s.messages[s.tooltipUnitFormat]),[t||0]),I=t=>{const{color:n,label:o}=t.dataItem;return e.createElement("div",{style:g,className:"k-tooltip-content"},e.createElement(p,{color:n}),e.createElement(a,null,o.text),e.createElement(a,null,h(t.nodeValue)))},O=t=>{const{source:n,target:o,value:l}=t.dataItem;return e.createElement("div",{style:g},e.createElement(p,{color:n.color}),e.createElement(a,null,n.label.text),e.createElement(k.IconWrap,{icon:v.arrowRightIcon,name:"arrow-right"}),e.createElement(p,{color:o.color}),e.createElement(a,null,o.label.text),e.createElement(a,null,h(l)))};exports.LinkTooltipContent=O;exports.NodeTooltipContent=I;exports.TooltipComponent=T;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as t from "react";
10
+ import { IconWrap as y } from "@progress/kendo-react-common";
11
+ import { arrowRightIcon as x } from "@progress/kendo-svg-icons";
12
+ import { useInternationalization as v, useLocalization as k } from "@progress/kendo-react-intl";
13
+ import { tooltipUnitFormat as f, messages as b } from "./messages.mjs";
14
+ const L = (e) => {
15
+ const { Content: l, offset: o, event: { tooltipData: n, dataItem: g, nodeValue: E } } = e, m = t.useRef(null);
16
+ return t.useEffect(() => {
17
+ const i = m.current;
18
+ if (!n || !i)
19
+ return;
20
+ const p = { width: i.offsetWidth, height: i.offsetHeight }, r = { ...n.popupOffset }, c = n.popupAlign;
21
+ r.left += c.horizontal === "left" ? o : -1 * o, c.horizontal === "right" && (r.left -= p.width), c.vertical === "bottom" ? r.top -= p.height + o : r.top += o, i.style.left = `${r.left}px`, i.style.top = `${r.top}px`, i.style.visibility = "";
22
+ }, [n]), /* @__PURE__ */ t.createElement(
23
+ "div",
24
+ {
25
+ ref: m,
26
+ style: { visibility: "hidden" },
27
+ className: "k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip"
28
+ },
29
+ /* @__PURE__ */ t.createElement("div", { className: "k-tooltip-content" }, /* @__PURE__ */ t.createElement(l, { dataItem: g, nodeValue: E }))
30
+ );
31
+ }, u = 3, I = `0 ${u}px`, d = { display: "flex", alignItems: "center" }, s = (e) => /* @__PURE__ */ t.createElement(
32
+ "div",
33
+ {
34
+ style: {
35
+ width: 15,
36
+ height: 15,
37
+ backgroundColor: e.color,
38
+ display: "inline-flex",
39
+ marginLeft: u
40
+ }
41
+ }
42
+ ), a = (e) => /* @__PURE__ */ t.createElement("span", { style: { margin: I } }, e.children), h = (e) => v().format(k().toLanguageString(f, b[f]), [e || 0]), N = (e) => {
43
+ const { color: l, label: o } = e.dataItem;
44
+ return /* @__PURE__ */ t.createElement("div", { style: d, className: "k-tooltip-content" }, /* @__PURE__ */ t.createElement(s, { color: l }), /* @__PURE__ */ t.createElement(a, null, o.text), /* @__PURE__ */ t.createElement(a, null, h(e.nodeValue)));
45
+ }, R = (e) => {
46
+ const { source: l, target: o, value: n } = e.dataItem;
47
+ return /* @__PURE__ */ t.createElement("div", { style: d }, /* @__PURE__ */ t.createElement(s, { color: l.color }), /* @__PURE__ */ t.createElement(a, null, l.label.text), /* @__PURE__ */ t.createElement(y, { icon: x, name: "arrow-right" }), /* @__PURE__ */ t.createElement(s, { color: o.color }), /* @__PURE__ */ t.createElement(a, null, o.label.text), /* @__PURE__ */ t.createElement(a, null, h(n)));
48
+ };
49
+ export {
50
+ R as LinkTooltipContent,
51
+ N as NodeTooltipContent,
52
+ L as TooltipComponent
53
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="sankey.tooltipUnitFormat",o={[t]:"({0} units)"};exports.messages=o;exports.tooltipUnitFormat=t;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ const t = "sankey.tooltipUnitFormat", o = {
10
+ [t]: "({0} units)"
11
+ };
12
+ export {
13
+ o as messages,
14
+ t as tooltipUnitFormat
15
+ };
@@ -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 e=require("prop-types"),n=e.exact({left:e.number,top:e.number}),t={left:e.number,right:e.number},s={...t,top:e.number,bottom:e.number},r={visible:e.bool,font:e.string,color:e.string,opacity:e.number,align:e.oneOf(["left","right","center"]),position:e.oneOf(["inside","before","after"]),padding:e.oneOfType([e.number,e.exact(s)]),margin:e.exact(t),border:e.exact({width:e.number,color:e.string,opacity:e.number,dashType:e.string}),offset:n},o={color:e.string,opacity:e.number,offset:n,padding:e.number,width:e.number},i={colorType:e.oneOf(["static","source","target"]),color:e.string,opacity:e.number,highlight:e.exact({opacity:e.number,inactiveOpacity:e.number})},a=e.exact({text:e.string,...r}),c=e.exact({id:e.oneOfType([e.string,e.number]).isRequired,label:a.isRequired,...o}),u=e.exact({sourceId:e.oneOfType([e.string,e.number]).isRequired,targetId:e.oneOfType([e.string,e.number]).isRequired,value:e.number.isRequired,...i}),p={data:e.exact({nodes:e.arrayOf(c.isRequired).isRequired,links:e.arrayOf(u.isRequired).isRequired}).isRequired,links:e.exact(i),nodes:e.exact(o),labels:e.exact(r),className:e.string,style:e.object,onNodeEnter:e.func,onNodeLeave:e.func,onLinkEnter:e.func,onLinkLeave:e.func};exports.sankeyPropTypes=p;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),r=e.exact({left:e.number,top:e.number}),i={left:e.number,right:e.number},l={...i,top:e.number,bottom:e.number},o=e.oneOfType([e.number,e.exact(l)]),t=o,n=e.exact({width:e.number,color:e.string,opacity:e.number,dashType:e.string}),s={visible:e.bool,font:e.string,color:e.string,opacity:e.number,align:e.oneOf(["left","right","center"]),position:e.oneOf(["inside","before","after"]),padding:t,margin:e.exact(i),border:n,offset:r},a={color:e.string,opacity:e.number,offset:r,padding:e.number,width:e.number},c={colorType:e.oneOf(["static","source","target"]),color:e.string,opacity:e.number,highlight:e.exact({opacity:e.number,inactiveOpacity:e.number})},p=e.exact({text:e.string,...s}),b=e.exact({id:e.oneOfType([e.string,e.number]).isRequired,label:p.isRequired,...a}),u=e.exact({sourceId:e.oneOfType([e.string,e.number]).isRequired,targetId:e.oneOfType([e.string,e.number]).isRequired,value:e.number.isRequired,...c}),d={data:e.exact({nodes:e.arrayOf(b.isRequired).isRequired,links:e.arrayOf(u.isRequired).isRequired}).isRequired,links:e.exact(c),nodes:e.exact(a),labels:e.exact(s),legend:e.exact({align:e.oneOf(["start","center","end"]),background:e.string,border:n,height:e.number,labels:e.object,margin:o,offsetX:e.number,offsetY:e.number,orientation:e.oneOf(["vertical","horizontal"]),padding:t,position:e.oneOf(["top","bottom","left","right","custom"]),reverse:e.bool,visible:e.bool,width:e.number,item:e.object,title:e.object}),title:e.exact({align:e.oneOf(["center","left","right"]),background:e.string,border:n,color:e.string,font:e.string,margin:o,padding:t,position:e.oneOf(["top","bottom"]),text:e.string,visible:e.bool}),tooltip:e.exact({visible:e.bool,offset:e.number,followPointer:e.bool,delay:e.number,linkComponent:e.any,nodeComponent:e.any}),className:e.string,style:e.object,disableAutoLayout:e.bool,onNodeEnter:e.func,onNodeLeave:e.func,onLinkEnter:e.func,onLinkLeave:e.func,onNodeClick:e.func,onLinkClick:e.func};exports.sankeyPropTypes=d;
@@ -7,42 +7,42 @@
7
7
  */
8
8
  "use client";
9
9
  import e from "prop-types";
10
- const n = e.exact({
10
+ const r = e.exact({
11
11
  left: e.number,
12
12
  top: e.number
13
- }), r = {
13
+ }), i = {
14
14
  left: e.number,
15
15
  right: e.number
16
- }, s = {
17
- ...r,
16
+ }, l = {
17
+ ...i,
18
18
  top: e.number,
19
19
  bottom: e.number
20
- }, t = {
20
+ }, o = e.oneOfType([
21
+ e.number,
22
+ e.exact(l)
23
+ ]), t = o, n = e.exact({
24
+ width: e.number,
25
+ color: e.string,
26
+ opacity: e.number,
27
+ dashType: e.string
28
+ }), s = {
21
29
  visible: e.bool,
22
30
  font: e.string,
23
31
  color: e.string,
24
32
  opacity: e.number,
25
33
  align: e.oneOf(["left", "right", "center"]),
26
34
  position: e.oneOf(["inside", "before", "after"]),
27
- padding: e.oneOfType([
28
- e.number,
29
- e.exact(s)
30
- ]),
31
- margin: e.exact(r),
32
- border: e.exact({
33
- width: e.number,
34
- color: e.string,
35
- opacity: e.number,
36
- dashType: e.string
37
- }),
38
- offset: n
39
- }, o = {
35
+ padding: t,
36
+ margin: e.exact(i),
37
+ border: n,
38
+ offset: r
39
+ }, a = {
40
40
  color: e.string,
41
41
  opacity: e.number,
42
- offset: n,
42
+ offset: r,
43
43
  padding: e.number,
44
44
  width: e.number
45
- }, i = {
45
+ }, c = {
46
46
  colorType: e.oneOf(["static", "source", "target"]),
47
47
  color: e.string,
48
48
  opacity: e.number,
@@ -50,33 +50,74 @@ const n = e.exact({
50
50
  opacity: e.number,
51
51
  inactiveOpacity: e.number
52
52
  })
53
- }, a = e.exact({
53
+ }, p = e.exact({
54
54
  text: e.string,
55
- ...t
56
- }), c = e.exact({
55
+ ...s
56
+ }), b = e.exact({
57
57
  id: e.oneOfType([e.string, e.number]).isRequired,
58
- label: a.isRequired,
59
- ...o
60
- }), p = e.exact({
58
+ label: p.isRequired,
59
+ ...a
60
+ }), u = e.exact({
61
61
  sourceId: e.oneOfType([e.string, e.number]).isRequired,
62
62
  targetId: e.oneOfType([e.string, e.number]).isRequired,
63
63
  value: e.number.isRequired,
64
- ...i
65
- }), l = {
64
+ ...c
65
+ }), f = {
66
66
  data: e.exact({
67
- nodes: e.arrayOf(c.isRequired).isRequired,
68
- links: e.arrayOf(p.isRequired).isRequired
67
+ nodes: e.arrayOf(b.isRequired).isRequired,
68
+ links: e.arrayOf(u.isRequired).isRequired
69
69
  }).isRequired,
70
- links: e.exact(i),
71
- nodes: e.exact(o),
72
- labels: e.exact(t),
70
+ links: e.exact(c),
71
+ nodes: e.exact(a),
72
+ labels: e.exact(s),
73
+ legend: e.exact({
74
+ align: e.oneOf(["start", "center", "end"]),
75
+ background: e.string,
76
+ border: n,
77
+ height: e.number,
78
+ labels: e.object,
79
+ margin: o,
80
+ offsetX: e.number,
81
+ offsetY: e.number,
82
+ orientation: e.oneOf(["vertical", "horizontal"]),
83
+ padding: t,
84
+ position: e.oneOf(["top", "bottom", "left", "right", "custom"]),
85
+ reverse: e.bool,
86
+ visible: e.bool,
87
+ width: e.number,
88
+ item: e.object,
89
+ title: e.object
90
+ }),
91
+ title: e.exact({
92
+ align: e.oneOf(["center", "left", "right"]),
93
+ background: e.string,
94
+ border: n,
95
+ color: e.string,
96
+ font: e.string,
97
+ margin: o,
98
+ padding: t,
99
+ position: e.oneOf(["top", "bottom"]),
100
+ text: e.string,
101
+ visible: e.bool
102
+ }),
103
+ tooltip: e.exact({
104
+ visible: e.bool,
105
+ offset: e.number,
106
+ followPointer: e.bool,
107
+ delay: e.number,
108
+ linkComponent: e.any,
109
+ nodeComponent: e.any
110
+ }),
73
111
  className: e.string,
74
112
  style: e.object,
113
+ disableAutoLayout: e.bool,
75
114
  onNodeEnter: e.func,
76
115
  onNodeLeave: e.func,
77
116
  onLinkEnter: e.func,
78
- onLinkLeave: e.func
117
+ onLinkLeave: e.func,
118
+ onNodeClick: e.func,
119
+ onLinkClick: e.func
79
120
  };
80
121
  export {
81
- l as sankeyPropTypes
122
+ f as sankeyPropTypes
82
123
  };
@@ -5,21 +5,25 @@
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 d=s=>`${s.fontWeight} ${s.fontSize} ${s.fontFamily}`,a=s=>window.getComputedStyle(s).backgroundColor,v=s=>s.toLowerCase().charCodeAt(0)-97,u=s=>{const e=s.match(/series-([a-z])$/);if(e!==null)return v(e[1]);const t=s.split("--series-")[1];return parseInt(t,10)-1},h=30,m=()=>{let s=`
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=t=>`${t.fontWeight} ${t.fontSize} ${t.fontFamily}`,d=t=>window.getComputedStyle(t).backgroundColor,v=t=>t.toLowerCase().charCodeAt(0)-97,h=t=>{const e=t.match(/series-([a-z])$/);if(e!==null)return v(e[1]);const s=t.split("--series-")[1];return parseInt(s,10)-1},u=30,m=()=>{let t=`
9
9
  <div class="k-var--series-a"></div>
10
10
  <div class="k-var--series-b"></div>
11
11
  <div class="k-var--series-c"></div>
12
12
  <div class="k-var--series-d"></div>
13
13
  <div class="k-var--series-e"></div>
14
14
  <div class="k-var--series-f"></div>
15
- `;for(let e=0;e<h;e++)s+=`
16
- <div class="k-var--series-${e+1}"></div>`;return s},y=`
15
+ `;for(let e=0;e<u;e++)t+=`
16
+ <div class="k-var--series-${e+1}"></div>`;return t},k=`
17
+ <div class="k-var--background"></div>
17
18
  <div class="k-var--normal-text-color"></div>
19
+ <div class="k-var--chart-major-lines"></div>
20
+
18
21
  <div class="k-widget k-chart">
19
22
  <div class="k-var--chart-font"></div>
23
+ <div class="k-var--chart-title-font"></div>
20
24
  </div>
21
25
  <div class="k-var--series-unset"></div>
22
26
  <div class="k-var--series">
23
27
  ${m()}
24
28
  </div>
25
- `;class C{constructor(e){this.store=e}setStyle(e,t){const o=e.split(".");let r=this.store;o.forEach((i,c,n)=>{c<n.length-1&&(r=r[i]=r[i]||{})});const l=o.pop();l&&(r[l]=t)}setColors(){this.mapColor("labels.color","normal-text-color")}setFonts(){const e=d(this.queryStyle("chart-font"));this.setStyle("labels.font",e)}setSeriesColors(){const e=this.element;if(!e)return;const t=[].slice.call(e.querySelectorAll(".k-var--series div")),o=a(e.querySelector(".k-var--series-unset")),r=t.reduce((l,i)=>{const c=u(i.className),n=a(i);return n!==o&&(l[c]=n),l},[]);this.setStyle("nodesColors",r)}mapColor(e,t){this.setStyle(e,this.queryStyle(t).backgroundColor)}queryStyle(e){const t=this.element;return window.getComputedStyle(t.querySelector(`.k-var--${e}`))}}const k=(s,e)=>{const t={links:{color:"#757575"},nodesColors:[]},o=new C(t),r=o.element=s.createElement("div");r.style.display="none",r.innerHTML=y,s.body.appendChild(r);try{o.setColors(),o.setFonts(),o.setSeriesColors()}finally{s.body.removeChild(o.element),o.element=null,e(t)}};exports.loadTheme=k;
29
+ `;class y{constructor(e){this.store=e}setStyle(e,s){const o=e.split(".");let r=this.store;o.forEach((i,a,n)=>{a<n.length-1&&(r=r[i]=r[i]||{})});const l=o.pop();l&&(r[l]=s)}setColors(){this.mapColor("labels.color","normal-text-color"),this.mapColor("labels.stroke.color","background"),this.mapColor("links.color","chart-major-lines"),this.mapColor("legend.labels.color","normal-text-color"),this.mapColor("title.color","normal-text-color")}setFonts(){const e=c(this.queryStyle("chart-title-font")),s=c(this.queryStyle("chart-font"));this.setStyle("title.font",e),this.setStyle("labels.font",s),this.setStyle("legend.labels.font",s)}setNodeColors(){const e=this.element;if(!e)return;const s=[].slice.call(e.querySelectorAll(".k-var--series div")),o=d(e.querySelector(".k-var--series-unset")),r=s.reduce((l,i)=>{const a=h(i.className),n=d(i);return n!==o&&(l[a]=n),l},[]);this.setStyle("nodeColors",r)}mapColor(e,s){this.setStyle(e,this.queryStyle(s).backgroundColor)}queryStyle(e){const s=this.element;return window.getComputedStyle(s.querySelector(`.k-var--${e}`))}}const C=(t,e)=>{const s={nodeColors:[]},o=new y(s),r=o.element=t.createElement("div");r.style.display="none",r.innerHTML=k,t.body.appendChild(r);try{o.setColors(),o.setFonts(),o.setNodeColors()}finally{t.body.removeChild(o.element),o.element=null,e(s)}};exports.loadTheme=C;
@@ -6,15 +6,15 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- const d = (s) => `${s.fontWeight} ${s.fontSize} ${s.fontFamily}`, a = (s) => window.getComputedStyle(s).backgroundColor, v = (s) => s.toLowerCase().charCodeAt(0) - 97, u = (s) => {
10
- const e = s.match(/series-([a-z])$/);
9
+ const c = (t) => `${t.fontWeight} ${t.fontSize} ${t.fontFamily}`, d = (t) => window.getComputedStyle(t).backgroundColor, v = (t) => t.toLowerCase().charCodeAt(0) - 97, h = (t) => {
10
+ const e = t.match(/series-([a-z])$/);
11
11
  if (e !== null)
12
12
  return v(e[1]);
13
- const t = s.split("--series-")[1];
14
- return parseInt(t, 10) - 1;
13
+ const s = t.split("--series-")[1];
14
+ return parseInt(s, 10) - 1;
15
15
  };
16
- const h = () => {
17
- let s = `
16
+ const u = () => {
17
+ let t = `
18
18
  <div class="k-var--series-a"></div>
19
19
  <div class="k-var--series-b"></div>
20
20
  <div class="k-var--series-c"></div>
@@ -23,74 +23,74 @@ const h = () => {
23
23
  <div class="k-var--series-f"></div>
24
24
  `;
25
25
  for (let e = 0; e < 30; e++)
26
- s += `
26
+ t += `
27
27
  <div class="k-var--series-${e + 1}"></div>`;
28
- return s;
28
+ return t;
29
29
  }, m = `
30
+ <div class="k-var--background"></div>
30
31
  <div class="k-var--normal-text-color"></div>
32
+ <div class="k-var--chart-major-lines"></div>
33
+
31
34
  <div class="k-widget k-chart">
32
35
  <div class="k-var--chart-font"></div>
36
+ <div class="k-var--chart-title-font"></div>
33
37
  </div>
34
38
  <div class="k-var--series-unset"></div>
35
39
  <div class="k-var--series">
36
- ${h()}
40
+ ${u()}
37
41
  </div>
38
42
  `;
39
43
  class C {
40
44
  constructor(e) {
41
45
  this.store = e;
42
46
  }
43
- setStyle(e, t) {
47
+ setStyle(e, s) {
44
48
  const o = e.split(".");
45
49
  let r = this.store;
46
- o.forEach((i, c, n) => {
47
- c < n.length - 1 && (r = r[i] = r[i] || {});
50
+ o.forEach((i, a, n) => {
51
+ a < n.length - 1 && (r = r[i] = r[i] || {});
48
52
  });
49
53
  const l = o.pop();
50
- l && (r[l] = t);
54
+ l && (r[l] = s);
51
55
  }
52
56
  setColors() {
53
- this.mapColor("labels.color", "normal-text-color");
57
+ this.mapColor("labels.color", "normal-text-color"), this.mapColor("labels.stroke.color", "background"), this.mapColor("links.color", "chart-major-lines"), this.mapColor("legend.labels.color", "normal-text-color"), this.mapColor("title.color", "normal-text-color");
54
58
  }
55
59
  setFonts() {
56
- const e = d(this.queryStyle("chart-font"));
57
- this.setStyle("labels.font", e);
60
+ const e = c(this.queryStyle("chart-title-font")), s = c(this.queryStyle("chart-font"));
61
+ this.setStyle("title.font", e), this.setStyle("labels.font", s), this.setStyle("legend.labels.font", s);
58
62
  }
59
- setSeriesColors() {
63
+ setNodeColors() {
60
64
  const e = this.element;
61
65
  if (!e)
62
66
  return;
63
- const t = [].slice.call(e.querySelectorAll(".k-var--series div")), o = a(e.querySelector(".k-var--series-unset")), r = t.reduce(
67
+ const s = [].slice.call(e.querySelectorAll(".k-var--series div")), o = d(e.querySelector(".k-var--series-unset")), r = s.reduce(
64
68
  (l, i) => {
65
- const c = u(i.className), n = a(i);
66
- return n !== o && (l[c] = n), l;
69
+ const a = h(i.className), n = d(i);
70
+ return n !== o && (l[a] = n), l;
67
71
  },
68
72
  []
69
73
  // Will populate the colors in this array
70
74
  );
71
- this.setStyle("nodesColors", r);
75
+ this.setStyle("nodeColors", r);
72
76
  }
73
- mapColor(e, t) {
74
- this.setStyle(e, this.queryStyle(t).backgroundColor);
77
+ mapColor(e, s) {
78
+ this.setStyle(e, this.queryStyle(s).backgroundColor);
75
79
  }
76
80
  queryStyle(e) {
77
- const t = this.element;
78
- return window.getComputedStyle(t.querySelector(`.k-var--${e}`));
81
+ const s = this.element;
82
+ return window.getComputedStyle(s.querySelector(`.k-var--${e}`));
79
83
  }
80
84
  }
81
- const k = (s, e) => {
82
- const t = {
83
- // TODO: Move it to themes
84
- links: {
85
- color: "#757575"
86
- },
87
- nodesColors: []
88
- }, o = new C(t), r = o.element = s.createElement("div");
89
- r.style.display = "none", r.innerHTML = m, s.body.appendChild(r);
85
+ const k = (t, e) => {
86
+ const s = {
87
+ nodeColors: []
88
+ }, o = new C(s), r = o.element = t.createElement("div");
89
+ r.style.display = "none", r.innerHTML = m, t.body.appendChild(r);
90
90
  try {
91
- o.setColors(), o.setFonts(), o.setSeriesColors();
91
+ o.setColors(), o.setFonts(), o.setNodeColors();
92
92
  } finally {
93
- s.body.removeChild(o.element), o.element = null, e(t);
93
+ t.body.removeChild(o.element), o.element = null, e(s);
94
94
  }
95
95
  };
96
96
  export {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@progress/kendo-charts"),t=e.createSankeyData;exports.createSankeyData=t;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import { createSankeyData as a } from "@progress/kendo-charts";
10
+ const t = a;
11
+ export {
12
+ t as createSankeyData
13
+ };