@progress/kendo-react-orgchart 7.2.4-develop.3 → 7.3.0-develop.1
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/OrgChart.js +8 -0
- package/OrgChart.mjs +83 -0
- package/client/ClientOrgChart.js +8 -0
- package/client/ClientOrgChart.mjs +236 -0
- package/client/ExpandButton.js +8 -0
- package/client/ExpandButton.mjs +36 -0
- package/client/OrgChartCard.js +8 -0
- package/client/OrgChartCard.mjs +59 -0
- package/client/OrgChartCardBody.js +8 -0
- package/client/OrgChartCardBody.mjs +18 -0
- package/client/OrgChartGroupContainer.js +8 -0
- package/client/OrgChartGroupContainer.mjs +58 -0
- package/dist/cdn/js/kendo-react-orgchart.js +8 -18
- package/index.d.mts +520 -5
- package/index.d.ts +520 -12
- package/index.js +8 -18
- package/index.mjs +17 -1146
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +4 -4
- package/processOrgChartItems.js +8 -0
- package/processOrgChartItems.mjs +84 -0
- package/server/ServerGroupedOrgChart.js +8 -0
- package/server/ServerGroupedOrgChart.mjs +260 -0
- package/server/ServerOrgChart.js +8 -0
- package/server/ServerOrgChart.mjs +210 -0
- package/server/ServerOrgChartGroup.js +8 -0
- package/server/ServerOrgChartGroup.mjs +114 -0
- package/server/ServerOrgChartNode.js +8 -0
- package/server/ServerOrgChartNode.mjs +95 -0
- package/theming/theme-service.js +21 -0
- package/theming/theme-service.mjs +60 -0
- package/utils/consts.js +8 -0
- package/utils/consts.mjs +24 -0
- package/OrgChart.d.ts +0 -10
- package/OrgChartOperationDescriptors.d.ts +0 -80
- package/client/ClientOrgChart.d.ts +0 -98
- package/client/ExpandButton.d.ts +0 -17
- package/client/OrgChartCard.d.ts +0 -23
- package/client/OrgChartCardBody.d.ts +0 -16
- package/client/OrgChartGroupContainer.d.ts +0 -23
- package/interfaces/ChildGroup.d.ts +0 -20
- package/interfaces/OrgChartActionEvent.d.ts +0 -25
- package/interfaces/OrgChartExpandChangeEvent.d.ts +0 -25
- package/interfaces/SeverOrgChartProps.d.ts +0 -109
- package/package-metadata.d.ts +0 -9
- package/processOrgChartItems.d.ts +0 -55
- package/server/ServerGroupedOrgChart.d.ts +0 -12
- package/server/ServerOrgChart.d.ts +0 -12
- package/server/ServerOrgChartGroup.d.ts +0 -100
- package/server/ServerOrgChartNode.d.ts +0 -79
- package/theming/theme-service.d.ts +0 -9
- package/utils/consts.d.ts +0 -76
package/OrgChart.js
ADDED
|
@@ -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 s=require("react"),e=require("prop-types"),g=require("./package-metadata.js"),p=require("./server/ServerOrgChart.js"),u=require("@progress/kendo-react-common"),h=require("./server/ServerGroupedOrgChart.js"),b=require("./client/ClientOrgChart.js");function m(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}return t.default=r,Object.freeze(t)}const a=m(s),o=r=>{const t={tabIndex:0,navigatable:!0,expandField:"expanded",ariaLabel:"Org Chart",idField:"id",childrenField:"items",avatarField:"avatar",titleField:"title",subtitleField:"subtitle",...r},{cardsColors:n,onExpandChange:i,onKeyDown:C,onItemAction:O,onGroupAction:F,onGroupBlur:f,onGroupFocus:y,id:c,...d}=t,l=a.useRef(u.useId());return u.validatePackage(g.packageMetadata),a.createElement(b.ClientOrgChart,{...t},r.groupField?a.createElement(h.ServerGroupedOrgChart,{id:c||l.current,...d},r.children):a.createElement(p.ServerOrgChart,{id:c||l.current,...d},r.children))};o.propTypes={className:e.string,style:e.object,id:e.string,ariaLabel:e.string,idField:e.string,childrenField:e.string,expandField:e.string,titleField:e.string,hasChildrenField:e.string,subtitleField:e.string,avatarField:e.string,cardsColors:e.array,data:e.array,groupField:e.string,cardHeight:e.number,cardWidth:e.number,groupTitleHeight:e.number,groupSubtitleHeight:e.number,verticalLine:e.number,height:e.oneOfType([e.string,e.number]),onExpandChange:e.func,onItemAction:e.func,onGroupAction:e.func};o.displayName="KendoOrgChart";exports.OrgChart=o;
|
package/OrgChart.mjs
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
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 e from "prop-types";
|
|
11
|
+
import { packageMetadata as l } from "./package-metadata.mjs";
|
|
12
|
+
import { ServerOrgChart as s } from "./server/ServerOrgChart.mjs";
|
|
13
|
+
import { useId as c, validatePackage as g } from "@progress/kendo-react-common";
|
|
14
|
+
import { ServerGroupedOrgChart as u } from "./server/ServerGroupedOrgChart.mjs";
|
|
15
|
+
import { ClientOrgChart as m } from "./client/ClientOrgChart.mjs";
|
|
16
|
+
const d = (r) => {
|
|
17
|
+
const i = {
|
|
18
|
+
tabIndex: 0,
|
|
19
|
+
navigatable: !0,
|
|
20
|
+
expandField: "expanded",
|
|
21
|
+
ariaLabel: "Org Chart",
|
|
22
|
+
idField: "id",
|
|
23
|
+
childrenField: "items",
|
|
24
|
+
avatarField: "avatar",
|
|
25
|
+
titleField: "title",
|
|
26
|
+
subtitleField: "subtitle",
|
|
27
|
+
...r
|
|
28
|
+
}, {
|
|
29
|
+
cardsColors: p,
|
|
30
|
+
onExpandChange: h,
|
|
31
|
+
onKeyDown: b,
|
|
32
|
+
onItemAction: F,
|
|
33
|
+
onGroupAction: f,
|
|
34
|
+
onGroupBlur: C,
|
|
35
|
+
onGroupFocus: v,
|
|
36
|
+
id: n,
|
|
37
|
+
...a
|
|
38
|
+
} = i, o = t.useRef(c());
|
|
39
|
+
return g(l), /* @__PURE__ */ t.createElement(m, { ...i }, r.groupField ? /* @__PURE__ */ t.createElement(
|
|
40
|
+
u,
|
|
41
|
+
{
|
|
42
|
+
id: n || o.current,
|
|
43
|
+
...a
|
|
44
|
+
},
|
|
45
|
+
r.children
|
|
46
|
+
) : /* @__PURE__ */ t.createElement(
|
|
47
|
+
s,
|
|
48
|
+
{
|
|
49
|
+
id: n || o.current,
|
|
50
|
+
...a
|
|
51
|
+
},
|
|
52
|
+
r.children
|
|
53
|
+
));
|
|
54
|
+
};
|
|
55
|
+
d.propTypes = {
|
|
56
|
+
className: e.string,
|
|
57
|
+
style: e.object,
|
|
58
|
+
id: e.string,
|
|
59
|
+
ariaLabel: e.string,
|
|
60
|
+
idField: e.string,
|
|
61
|
+
childrenField: e.string,
|
|
62
|
+
expandField: e.string,
|
|
63
|
+
titleField: e.string,
|
|
64
|
+
hasChildrenField: e.string,
|
|
65
|
+
subtitleField: e.string,
|
|
66
|
+
avatarField: e.string,
|
|
67
|
+
cardsColors: e.array,
|
|
68
|
+
data: e.array,
|
|
69
|
+
groupField: e.string,
|
|
70
|
+
cardHeight: e.number,
|
|
71
|
+
cardWidth: e.number,
|
|
72
|
+
groupTitleHeight: e.number,
|
|
73
|
+
groupSubtitleHeight: e.number,
|
|
74
|
+
verticalLine: e.number,
|
|
75
|
+
height: e.oneOfType([e.string, e.number]),
|
|
76
|
+
onExpandChange: e.func,
|
|
77
|
+
onItemAction: e.func,
|
|
78
|
+
onGroupAction: e.func
|
|
79
|
+
};
|
|
80
|
+
d.displayName = "KendoOrgChart";
|
|
81
|
+
export {
|
|
82
|
+
d as OrgChart
|
|
83
|
+
};
|
|
@@ -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 J=require("react"),o=require("prop-types"),x=require("@progress/kendo-react-common"),Q=require("../theming/theme-service.js"),V=require("../utils/consts.js");function X(c){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const u in c)if(u!=="default"){const C=Object.getOwnPropertyDescriptor(c,u);Object.defineProperty(n,u,C.get?C:{enumerable:!0,get:()=>c[u]})}}return n.default=c,Object.freeze(n)}const d=X(J),I=d.createContext({cardColors:void 0,onExpandChange:void 0,onKeyDown:void 0,onItemAction:void 0,onItemContextMenu:void 0,onItemDoubleClick:void 0,onGroupAction:void 0,onGroupBlur:void 0,onGroupFocus:void 0}),E=c=>{const n={tabIndex:0,navigatable:!0,expandField:"expanded",ariaLabel:"Org Chart",idField:"id",childrenField:"items",avatarField:"avatar",titleField:"title",subtitleField:"subtitle",...c},{navigatable:u,id:C,tabIndex:b,className:D,style:O,data:Y,groupField:Z,cardWidth:ee,cardHeight:te,groupTitleHeight:ne,groupSubtitleHeight:oe,verticalLine:re,idField:ie,childrenField:ae,expandField:ce,hasChildrenField:le,avatarField:se,titleField:de,subtitleField:ue,onExpandChange:ge,onItemAction:p,onItemDoubleClick:he,onItemContextMenu:pe,onKeyDown:me,onGroupAction:k,onGroupBlur:fe,onGroupFocus:Ce,cardsColors:y,ariaLabel:be,itemRender:ve,groupTitleRender:Fe,groupSubtitleRender:xe,height:Ee,children:ke,...S}=n,v=d.useRef(null),l=d.useRef(new x.Navigation({tabIndex:b,root:v,selectors:[n.groupField?".k-orgchart-node-group-container":".k-orgchart-card"],focusOptions:{}})),[w,G]=d.useState([]),g=d.useRef(null),N=(e,t,i)=>{i.preventDefault(),t.focusNext(e)},R=(e,t,i)=>{i.preventDefault(),t.focusPrevious(e)},P=(e,t,i,r)=>{var s;if(i.preventDefault(),(n.groupField?r.items.some(f=>f[n.expandField]):r.item[n.expandField])&&n.onExpandChange)n.onExpandChange.call(void 0,r);else{const F=(s=e.closest(".k-orgchart-group"))==null?void 0:s.getAttribute("id"),m=document.querySelector(`[aria-owns="${F}"]`);m?t.focusElement(m,e):t.focusPrevious(e)}},T=(e,t,i,r)=>{var m;i.preventDefault();const a=n.groupField?r.items.some(h=>h[n.expandField]):r.item[n.expandField],s=n.groupField?r.items.find(h=>h[n.childrenField]):r.item[n.childrenField],f=n.groupField?r.items.some(h=>n.hasChildrenField&&h[n.hasChildrenField]):n.hasChildrenField&&r.item[n.hasChildrenField],F=n.groupField?s&&s[n.childrenField]&&s[n.childrenField].length:s&&s.length;if((f||F)&&!a&&n.onExpandChange)n.onExpandChange.call(void 0,r);else{const h=n.groupField?".k-orgchart-node-group-container":".k-orgchart-card",$=e.getAttribute("aria-owns"),A=(m=document.getElementById($))==null?void 0:m.querySelector(h);A?t.focusElement(A,e):t.focusNext(e)}},H=(e,t,i)=>{i.preventDefault(),t.focusElement(t.first,null)},L=(e,t,i)=>{i.preventDefault(),t.focusElement(t.last,null)},M=(e,t,i,r)=>{i.stopPropagation();const a=e.className.indexOf("k-orgchart-node-group-container")!==-1;if(c.groupField&&a){g.current&&g.current.first&&g.current.focusElement(g.current.first,null);return}n.onItemAction&&n.onItemAction({event:i,item:r.item})},_=e=>{if(c.groupField){const t=e.closest(".k-orgchart-node-group-container");t&&l.current.focusElement(t,null)}};d.useEffect(()=>{if(u&&l.current.first&&l.current.first.setAttribute("tabindex",String(b)),!y){const e=v.current.ownerDocument||document;Q.loadTheme(t=>{G(t)},e)}},[u,b]);const j=e=>{if(n.navigatable){const t=e.event,i=t.key===" "?"Space":t.key,r=c.groupField&&t.target.className.indexOf("k-orgchart-card")!==-1&&g.current||l.current,a=t.target.closest(r.selectors.join(","));switch(i){case"ArrowUp":P(a,r,t,e);break;case"ArrowDown":T(a,r,t,e);break;case"ArrowLeft":R(a,r,t);break;case"ArrowRight":N(a,r,t);break;case"End":L(a,r,t);break;case"Home":H(a,r,t);break;case"Enter":M(a,r,t,e);break;case"Escape":_(a);break}}},q=e=>{if(e.event.stopPropagation(),p&&p.call(void 0,e),n.navigatable){const t=e.event.target.closest(".k-orgchart-card");t&&l.current.focusElement(t,null)}},B=e=>{e.event.stopPropagation(),p&&p.call(void 0,e)},K=e=>{e.event.stopPropagation(),p&&p.call(void 0,e)},U=e=>{if(k&&k.call(void 0,e),n.navigatable){const t=e.event.target.closest(".k-orgchart-node-group-container");t&&l.current.focusElement(t,null)}},W=e=>{g.current=null},z=e=>{g.current=new x.Navigation({tabIndex:0,root:e.containerRef,selectors:[".k-orgchart-card"],focusOptions:{}})};return d.createElement("div",{style:O,ref:v,className:x.classNames(D,V.ORGCHART_CLASSNAME)},d.createElement(I.Provider,{value:{cardColors:y||w,onExpandChange:c.onExpandChange,onKeyDown:j,onItemAction:q,onItemDoubleClick:K,onItemContextMenu:B,onGroupAction:U,onGroupBlur:W,onGroupFocus:z},...S},c.children))};E.propTypes={className:o.string,style:o.object,id:o.string,ariaLabel:o.string,idField:o.string,childrenField:o.string,expandField:o.string,titleField:o.string,hasChildrenField:o.string,subtitleField:o.string,avatarField:o.string,cardsColors:o.array,data:o.array,groupField:o.string,cardHeight:o.number,cardWidth:o.number,groupTitleHeight:o.number,groupSubtitleHeight:o.number,verticalLine:o.number,height:o.oneOfType([o.string,o.number]),onExpandChange:o.func,onItemAction:o.func,onItemDoubleClick:o.func,onItemContextMenu:o.func,onGroupAction:o.func};E.displayName="KendoClientOrgChart";exports.ClientOrgChart=E;exports.OrgChartEventsContextContext=I;
|
|
@@ -0,0 +1,236 @@
|
|
|
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 s from "react";
|
|
10
|
+
import o from "prop-types";
|
|
11
|
+
import { Navigation as k, classNames as $ } from "@progress/kendo-react-common";
|
|
12
|
+
import { loadTheme as z } from "../theming/theme-service.mjs";
|
|
13
|
+
import { ORGCHART_CLASSNAME as J } from "../utils/consts.mjs";
|
|
14
|
+
const Q = s.createContext({
|
|
15
|
+
cardColors: void 0,
|
|
16
|
+
onExpandChange: void 0,
|
|
17
|
+
onKeyDown: void 0,
|
|
18
|
+
onItemAction: void 0,
|
|
19
|
+
onItemContextMenu: void 0,
|
|
20
|
+
onItemDoubleClick: void 0,
|
|
21
|
+
onGroupAction: void 0,
|
|
22
|
+
onGroupBlur: void 0,
|
|
23
|
+
onGroupFocus: void 0
|
|
24
|
+
}), A = (g) => {
|
|
25
|
+
const n = {
|
|
26
|
+
tabIndex: 0,
|
|
27
|
+
navigatable: !0,
|
|
28
|
+
expandField: "expanded",
|
|
29
|
+
ariaLabel: "Org Chart",
|
|
30
|
+
idField: "id",
|
|
31
|
+
childrenField: "items",
|
|
32
|
+
avatarField: "avatar",
|
|
33
|
+
titleField: "title",
|
|
34
|
+
subtitleField: "subtitle",
|
|
35
|
+
...g
|
|
36
|
+
}, {
|
|
37
|
+
navigatable: v,
|
|
38
|
+
id: V,
|
|
39
|
+
tabIndex: f,
|
|
40
|
+
className: I,
|
|
41
|
+
style: y,
|
|
42
|
+
data: X,
|
|
43
|
+
groupField: Y,
|
|
44
|
+
cardWidth: Z,
|
|
45
|
+
cardHeight: ee,
|
|
46
|
+
groupTitleHeight: te,
|
|
47
|
+
groupSubtitleHeight: ne,
|
|
48
|
+
verticalLine: oe,
|
|
49
|
+
idField: re,
|
|
50
|
+
childrenField: ie,
|
|
51
|
+
expandField: ae,
|
|
52
|
+
hasChildrenField: ce,
|
|
53
|
+
avatarField: le,
|
|
54
|
+
titleField: se,
|
|
55
|
+
subtitleField: de,
|
|
56
|
+
onExpandChange: ue,
|
|
57
|
+
onItemAction: h,
|
|
58
|
+
onItemDoubleClick: ge,
|
|
59
|
+
onItemContextMenu: he,
|
|
60
|
+
onKeyDown: pe,
|
|
61
|
+
onGroupAction: b,
|
|
62
|
+
onGroupBlur: me,
|
|
63
|
+
onGroupFocus: fe,
|
|
64
|
+
cardsColors: x,
|
|
65
|
+
ariaLabel: Fe,
|
|
66
|
+
itemRender: Ce,
|
|
67
|
+
groupTitleRender: ve,
|
|
68
|
+
groupSubtitleRender: be,
|
|
69
|
+
height: xe,
|
|
70
|
+
children: Ee,
|
|
71
|
+
...D
|
|
72
|
+
} = n, F = s.useRef(null), c = s.useRef(new k({
|
|
73
|
+
tabIndex: f,
|
|
74
|
+
root: F,
|
|
75
|
+
selectors: [n.groupField ? ".k-orgchart-node-group-container" : ".k-orgchart-card"],
|
|
76
|
+
focusOptions: {}
|
|
77
|
+
})), [w, G] = s.useState([]), d = s.useRef(null), N = (e, t, i) => {
|
|
78
|
+
i.preventDefault(), t.focusNext(e);
|
|
79
|
+
}, R = (e, t, i) => {
|
|
80
|
+
i.preventDefault(), t.focusPrevious(e);
|
|
81
|
+
}, S = (e, t, i, r) => {
|
|
82
|
+
var l;
|
|
83
|
+
if (i.preventDefault(), (n.groupField ? r.items.some((m) => m[n.expandField]) : r.item[n.expandField]) && n.onExpandChange)
|
|
84
|
+
n.onExpandChange.call(void 0, r);
|
|
85
|
+
else {
|
|
86
|
+
const C = (l = e.closest(".k-orgchart-group")) == null ? void 0 : l.getAttribute("id"), p = document.querySelector(`[aria-owns="${C}"]`);
|
|
87
|
+
p ? t.focusElement(p, e) : t.focusPrevious(e);
|
|
88
|
+
}
|
|
89
|
+
}, O = (e, t, i, r) => {
|
|
90
|
+
var p;
|
|
91
|
+
i.preventDefault();
|
|
92
|
+
const a = n.groupField ? r.items.some((u) => u[n.expandField]) : r.item[n.expandField], l = n.groupField ? r.items.find((u) => u[n.childrenField]) : r.item[n.childrenField], m = n.groupField ? r.items.some((u) => n.hasChildrenField && u[n.hasChildrenField]) : n.hasChildrenField && r.item[n.hasChildrenField], C = n.groupField ? l && l[n.childrenField] && l[n.childrenField].length : l && l.length;
|
|
93
|
+
if ((m || C) && !a && n.onExpandChange)
|
|
94
|
+
n.onExpandChange.call(void 0, r);
|
|
95
|
+
else {
|
|
96
|
+
const u = n.groupField ? ".k-orgchart-node-group-container" : ".k-orgchart-card", W = e.getAttribute("aria-owns"), E = (p = document.getElementById(W)) == null ? void 0 : p.querySelector(u);
|
|
97
|
+
E ? t.focusElement(E, e) : t.focusNext(e);
|
|
98
|
+
}
|
|
99
|
+
}, T = (e, t, i) => {
|
|
100
|
+
i.preventDefault(), t.focusElement(t.first, null);
|
|
101
|
+
}, H = (e, t, i) => {
|
|
102
|
+
i.preventDefault(), t.focusElement(t.last, null);
|
|
103
|
+
}, P = (e, t, i, r) => {
|
|
104
|
+
i.stopPropagation();
|
|
105
|
+
const a = e.className.indexOf("k-orgchart-node-group-container") !== -1;
|
|
106
|
+
if (g.groupField && a) {
|
|
107
|
+
d.current && d.current.first && d.current.focusElement(d.current.first, null);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
n.onItemAction && n.onItemAction({
|
|
111
|
+
event: i,
|
|
112
|
+
item: r.item
|
|
113
|
+
});
|
|
114
|
+
}, L = (e) => {
|
|
115
|
+
if (g.groupField) {
|
|
116
|
+
const t = e.closest(".k-orgchart-node-group-container");
|
|
117
|
+
t && c.current.focusElement(t, null);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
s.useEffect(() => {
|
|
121
|
+
if (v && c.current.first && c.current.first.setAttribute("tabindex", String(f)), !x) {
|
|
122
|
+
const e = F.current.ownerDocument || document;
|
|
123
|
+
z((t) => {
|
|
124
|
+
G(t);
|
|
125
|
+
}, e);
|
|
126
|
+
}
|
|
127
|
+
}, [v, f]);
|
|
128
|
+
const M = (e) => {
|
|
129
|
+
if (n.navigatable) {
|
|
130
|
+
const t = e.event, i = t.key === " " ? "Space" : t.key, r = g.groupField && t.target.className.indexOf("k-orgchart-card") !== -1 && d.current || c.current, a = t.target.closest(r.selectors.join(","));
|
|
131
|
+
switch (i) {
|
|
132
|
+
case "ArrowUp":
|
|
133
|
+
S(a, r, t, e);
|
|
134
|
+
break;
|
|
135
|
+
case "ArrowDown":
|
|
136
|
+
O(a, r, t, e);
|
|
137
|
+
break;
|
|
138
|
+
case "ArrowLeft":
|
|
139
|
+
R(a, r, t);
|
|
140
|
+
break;
|
|
141
|
+
case "ArrowRight":
|
|
142
|
+
N(a, r, t);
|
|
143
|
+
break;
|
|
144
|
+
case "End":
|
|
145
|
+
H(a, r, t);
|
|
146
|
+
break;
|
|
147
|
+
case "Home":
|
|
148
|
+
T(a, r, t);
|
|
149
|
+
break;
|
|
150
|
+
case "Enter":
|
|
151
|
+
P(a, r, t, e);
|
|
152
|
+
break;
|
|
153
|
+
case "Escape":
|
|
154
|
+
L(a);
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}, B = (e) => {
|
|
159
|
+
if (e.event.stopPropagation(), h && h.call(void 0, e), n.navigatable) {
|
|
160
|
+
const t = e.event.target.closest(".k-orgchart-card");
|
|
161
|
+
t && c.current.focusElement(t, null);
|
|
162
|
+
}
|
|
163
|
+
}, K = (e) => {
|
|
164
|
+
e.event.stopPropagation(), h && h.call(void 0, e);
|
|
165
|
+
}, _ = (e) => {
|
|
166
|
+
e.event.stopPropagation(), h && h.call(void 0, e);
|
|
167
|
+
}, j = (e) => {
|
|
168
|
+
if (b && b.call(void 0, e), n.navigatable) {
|
|
169
|
+
const t = e.event.target.closest(".k-orgchart-node-group-container");
|
|
170
|
+
t && c.current.focusElement(t, null);
|
|
171
|
+
}
|
|
172
|
+
}, q = (e) => {
|
|
173
|
+
d.current = null;
|
|
174
|
+
}, U = (e) => {
|
|
175
|
+
d.current = new k({
|
|
176
|
+
tabIndex: 0,
|
|
177
|
+
root: e.containerRef,
|
|
178
|
+
selectors: [".k-orgchart-card"],
|
|
179
|
+
focusOptions: {}
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
return /* @__PURE__ */ s.createElement(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
style: y,
|
|
186
|
+
ref: F,
|
|
187
|
+
className: $(
|
|
188
|
+
I,
|
|
189
|
+
J
|
|
190
|
+
)
|
|
191
|
+
},
|
|
192
|
+
/* @__PURE__ */ s.createElement(Q.Provider, { value: {
|
|
193
|
+
cardColors: x || w,
|
|
194
|
+
onExpandChange: g.onExpandChange,
|
|
195
|
+
onKeyDown: M,
|
|
196
|
+
onItemAction: B,
|
|
197
|
+
onItemDoubleClick: _,
|
|
198
|
+
onItemContextMenu: K,
|
|
199
|
+
onGroupAction: j,
|
|
200
|
+
onGroupBlur: q,
|
|
201
|
+
onGroupFocus: U
|
|
202
|
+
}, ...D }, g.children)
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
A.propTypes = {
|
|
206
|
+
className: o.string,
|
|
207
|
+
style: o.object,
|
|
208
|
+
id: o.string,
|
|
209
|
+
ariaLabel: o.string,
|
|
210
|
+
idField: o.string,
|
|
211
|
+
childrenField: o.string,
|
|
212
|
+
expandField: o.string,
|
|
213
|
+
titleField: o.string,
|
|
214
|
+
hasChildrenField: o.string,
|
|
215
|
+
subtitleField: o.string,
|
|
216
|
+
avatarField: o.string,
|
|
217
|
+
cardsColors: o.array,
|
|
218
|
+
data: o.array,
|
|
219
|
+
groupField: o.string,
|
|
220
|
+
cardHeight: o.number,
|
|
221
|
+
cardWidth: o.number,
|
|
222
|
+
groupTitleHeight: o.number,
|
|
223
|
+
groupSubtitleHeight: o.number,
|
|
224
|
+
verticalLine: o.number,
|
|
225
|
+
height: o.oneOfType([o.string, o.number]),
|
|
226
|
+
onExpandChange: o.func,
|
|
227
|
+
onItemAction: o.func,
|
|
228
|
+
onItemDoubleClick: o.func,
|
|
229
|
+
onItemContextMenu: o.func,
|
|
230
|
+
onGroupAction: o.func
|
|
231
|
+
};
|
|
232
|
+
A.displayName = "KendoClientOrgChart";
|
|
233
|
+
export {
|
|
234
|
+
A as ClientOrgChart,
|
|
235
|
+
Q as OrgChartEventsContextContext
|
|
236
|
+
};
|
|
@@ -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 i=require("react"),l=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-svg-icons"),d=require("./ClientOrgChart.js");function p(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const r=p(i),g=t=>{const{expanded:e,node:n,nodes:o}=t,c=r.useContext(d.OrgChartEventsContextContext),s=u=>{c.onExpandChange&&c.onExpandChange.call(void 0,{event:u,expand:!e,item:n,items:o})};return r.createElement(l.Button,{className:"k-orgchart-button",icon:e?"minus":"plus",tabIndex:-1,svgIcon:e?a.minusIcon:a.plusIcon,"aria-label":e?"collapse":"expand",onClick:s})};exports.ExpandButton=g;
|
|
@@ -0,0 +1,36 @@
|
|
|
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 o from "react";
|
|
10
|
+
import { Button as i } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { minusIcon as m, plusIcon as p } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { OrgChartEventsContextContext as l } from "./ClientOrgChart.mjs";
|
|
13
|
+
const C = (e) => {
|
|
14
|
+
const { expanded: n, node: a, nodes: s } = e, t = o.useContext(l), c = (r) => {
|
|
15
|
+
t.onExpandChange && t.onExpandChange.call(void 0, {
|
|
16
|
+
event: r,
|
|
17
|
+
expand: !n,
|
|
18
|
+
item: a,
|
|
19
|
+
items: s
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ o.createElement(
|
|
23
|
+
i,
|
|
24
|
+
{
|
|
25
|
+
className: "k-orgchart-button",
|
|
26
|
+
icon: n ? "minus" : "plus",
|
|
27
|
+
tabIndex: -1,
|
|
28
|
+
svgIcon: n ? m : p,
|
|
29
|
+
"aria-label": n ? "collapse" : "expand",
|
|
30
|
+
onClick: c
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
C as ExpandButton
|
|
36
|
+
};
|
|
@@ -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 f=require("react"),b=require("@progress/kendo-react-layout"),g=require("@progress/kendo-react-common"),h=require("./ClientOrgChart.js");function k(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const r=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(e,c,r.get?r:{enumerable:!0,get:()=>n[c]})}}return e.default=n,Object.freeze(e)}const l=k(f),y=n=>{const{node:e,children:c,style:r,...s}=n,[a,i]=l.useState(!1),t=l.useContext(h.OrgChartEventsContextContext),u=o=>{t.onKeyDown&&t.onKeyDown.call(void 0,{event:o,item:e})},d=o=>{t.onItemAction&&t.onItemAction.call(void 0,{event:o,item:e})},C=o=>{t.onItemContextMenu&&t.onItemContextMenu.call(void 0,{event:o,item:e})},m=o=>{t.onItemDoubleClick&&t.onItemDoubleClick.call(void 0,{event:o,item:e})};return l.createElement(b.Card,{role:"treeitem",className:g.classNames("k-orgchart-card",{"k-focus":a}),onClick:d,onKeyDown:u,onContextMenu:C,onDoubleClick:m,style:r,"aria-selected":a,"aria-keyshortcuts":"Enter",onFocus:()=>i(!0),onBlur:()=>i(!1),...s},c)};exports.OrgChartCard=y;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 n from "react";
|
|
10
|
+
import { Card as f } from "@progress/kendo-react-layout";
|
|
11
|
+
import { classNames as h } from "@progress/kendo-react-common";
|
|
12
|
+
import { OrgChartEventsContextContext as k } from "./ClientOrgChart.mjs";
|
|
13
|
+
const I = (r) => {
|
|
14
|
+
const { node: o, children: i, style: s, ...a } = r, [c, l] = n.useState(!1), e = n.useContext(k), m = (t) => {
|
|
15
|
+
e.onKeyDown && e.onKeyDown.call(void 0, {
|
|
16
|
+
event: t,
|
|
17
|
+
item: o
|
|
18
|
+
});
|
|
19
|
+
}, u = (t) => {
|
|
20
|
+
e.onItemAction && e.onItemAction.call(void 0, {
|
|
21
|
+
event: t,
|
|
22
|
+
item: o
|
|
23
|
+
});
|
|
24
|
+
}, C = (t) => {
|
|
25
|
+
e.onItemContextMenu && e.onItemContextMenu.call(void 0, {
|
|
26
|
+
event: t,
|
|
27
|
+
item: o
|
|
28
|
+
});
|
|
29
|
+
}, d = (t) => {
|
|
30
|
+
e.onItemDoubleClick && e.onItemDoubleClick.call(void 0, {
|
|
31
|
+
event: t,
|
|
32
|
+
item: o
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ n.createElement(
|
|
36
|
+
f,
|
|
37
|
+
{
|
|
38
|
+
role: "treeitem",
|
|
39
|
+
className: h(
|
|
40
|
+
"k-orgchart-card",
|
|
41
|
+
{ "k-focus": c }
|
|
42
|
+
),
|
|
43
|
+
onClick: u,
|
|
44
|
+
onKeyDown: m,
|
|
45
|
+
onContextMenu: C,
|
|
46
|
+
onDoubleClick: d,
|
|
47
|
+
style: s,
|
|
48
|
+
"aria-selected": c,
|
|
49
|
+
"aria-keyshortcuts": "Enter",
|
|
50
|
+
onFocus: () => l(!0),
|
|
51
|
+
onBlur: () => l(!1),
|
|
52
|
+
...a
|
|
53
|
+
},
|
|
54
|
+
i
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
I as OrgChartCard
|
|
59
|
+
};
|
|
@@ -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 a=require("react"),s=require("./ClientOrgChart.js"),l=require("@progress/kendo-react-layout");function u(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=u(a),d=e=>{const{level:r,children:t}=e,o=n.useContext(s.OrgChartEventsContextContext),c=o.cardColors&&o.cardColors[r]||"green";return n.createElement(l.CardBody,{className:"k-hstack",style:{borderTopColor:c}},t)};exports.OrgChartCardBody=d;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 o from "react";
|
|
10
|
+
import { OrgChartEventsContextContext as s } from "./ClientOrgChart.mjs";
|
|
11
|
+
import { CardBody as a } from "@progress/kendo-react-layout";
|
|
12
|
+
const d = (t) => {
|
|
13
|
+
const { level: e, children: n } = t, r = o.useContext(s), c = r.cardColors && r.cardColors[e] || "green";
|
|
14
|
+
return /* @__PURE__ */ o.createElement(a, { className: "k-hstack", style: { borderTopColor: c } }, n);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
d as OrgChartCardBody
|
|
18
|
+
};
|
|
@@ -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 g=require("react"),C=require("@progress/kendo-react-common"),h=require("./ClientOrgChart.js");function y(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>o[r]})}}return e.default=o,Object.freeze(e)}const s=y(g),O=o=>{const{nodes:e,children:r,style:c,...i}=o,[u,a]=s.useState(!1),t=s.useContext(h.OrgChartEventsContextContext),l=s.useRef(null),f=n=>{t.onKeyDown&&t.onKeyDown({event:n,items:e})},d=n=>{t.onGroupAction&&t.onGroupAction({event:n,items:e})},p=n=>{a(!0),t.onGroupFocus&&t.onGroupFocus({event:n,items:e,containerRef:l})},m=n=>{a(!1),t.onGroupBlur&&t.onGroupBlur({event:n,items:e})};return s.createElement("div",{role:"treeitem","aria-selected":u,ref:l,className:C.classNames("k-orgchart-node-group-container","k-vstack",{"k-focus":u}),style:c,onKeyDown:f,onClick:d,onFocus:p,onBlur:m,...i},r)};exports.OrgChartGroupContainer=O;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 n from "react";
|
|
10
|
+
import { classNames as h } from "@progress/kendo-react-common";
|
|
11
|
+
import { OrgChartEventsContextContext as C } from "./ClientOrgChart.mjs";
|
|
12
|
+
const x = (l) => {
|
|
13
|
+
const { nodes: t, children: u, style: a, ...i } = l, [r, s] = n.useState(!1), e = n.useContext(C), c = n.useRef(null), m = (o) => {
|
|
14
|
+
e.onKeyDown && e.onKeyDown({
|
|
15
|
+
event: o,
|
|
16
|
+
items: t
|
|
17
|
+
});
|
|
18
|
+
}, f = (o) => {
|
|
19
|
+
e.onGroupAction && e.onGroupAction({
|
|
20
|
+
event: o,
|
|
21
|
+
items: t
|
|
22
|
+
});
|
|
23
|
+
}, p = (o) => {
|
|
24
|
+
s(!0), e.onGroupFocus && e.onGroupFocus({
|
|
25
|
+
event: o,
|
|
26
|
+
items: t,
|
|
27
|
+
containerRef: c
|
|
28
|
+
});
|
|
29
|
+
}, d = (o) => {
|
|
30
|
+
s(!1), e.onGroupBlur && e.onGroupBlur({
|
|
31
|
+
event: o,
|
|
32
|
+
items: t
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ n.createElement(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
role: "treeitem",
|
|
39
|
+
"aria-selected": r,
|
|
40
|
+
ref: c,
|
|
41
|
+
className: h(
|
|
42
|
+
"k-orgchart-node-group-container",
|
|
43
|
+
"k-vstack",
|
|
44
|
+
{ "k-focus": r }
|
|
45
|
+
),
|
|
46
|
+
style: a,
|
|
47
|
+
onKeyDown: m,
|
|
48
|
+
onClick: f,
|
|
49
|
+
onFocus: p,
|
|
50
|
+
onBlur: d,
|
|
51
|
+
...i
|
|
52
|
+
},
|
|
53
|
+
u
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
x as OrgChartGroupContainer
|
|
58
|
+
};
|