@progress/kendo-react-orgchart 9.0.0-develop.2 → 9.0.0-develop.4
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.mjs +1 -15
- package/README.md +21 -20
- package/client/ClientOrgChart.mjs +27 -27
- package/client/OrgChartCard.mjs +1 -4
- package/client/OrgChartGroupContainer.mjs +1 -5
- package/package-metadata.mjs +1 -1
- package/package.json +4 -4
- package/processOrgChartItems.js +1 -1
- package/processOrgChartItems.mjs +9 -3
- package/server/ServerGroupedOrgChart.mjs +48 -33
- package/server/ServerOrgChart.mjs +29 -23
- package/server/ServerOrgChartGroup.mjs +5 -19
- package/server/ServerOrgChartNode.mjs +3 -20
package/OrgChart.mjs
CHANGED
|
@@ -37,21 +37,7 @@ const d = (r) => {
|
|
|
37
37
|
id: a,
|
|
38
38
|
...n
|
|
39
39
|
} = i, o = t.useRef(c());
|
|
40
|
-
return g(l), /* @__PURE__ */ t.createElement(m, { ...i }, r.groupField ? /* @__PURE__ */ t.createElement(
|
|
41
|
-
u,
|
|
42
|
-
{
|
|
43
|
-
id: a || o.current,
|
|
44
|
-
...n
|
|
45
|
-
},
|
|
46
|
-
r.children
|
|
47
|
-
) : /* @__PURE__ */ t.createElement(
|
|
48
|
-
s,
|
|
49
|
-
{
|
|
50
|
-
id: a || o.current,
|
|
51
|
-
...n
|
|
52
|
-
},
|
|
53
|
-
r.children
|
|
54
|
-
));
|
|
40
|
+
return g(l), /* @__PURE__ */ t.createElement(m, { ...i }, r.groupField ? /* @__PURE__ */ t.createElement(u, { id: a || o.current, ...n }, r.children) : /* @__PURE__ */ t.createElement(s, { id: a || o.current, ...n }, r.children));
|
|
55
41
|
};
|
|
56
42
|
d.propTypes = {
|
|
57
43
|
className: e.string,
|
package/README.md
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
# KendoReact OrgChart Component for React
|
|
6
6
|
|
|
7
7
|
> **Important**
|
|
8
|
-
>
|
|
9
|
-
>
|
|
10
|
-
>
|
|
11
|
-
>
|
|
8
|
+
>
|
|
9
|
+
> - This package is а part of [KendoReact](https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)—a commercial UI library.
|
|
10
|
+
> - You will need to install a license key when adding the package to your project. For more information, please refer to the [KendoReact My License page](https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart).
|
|
11
|
+
> - To receive a license key, you need to either [purchase a license](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart) or register for a [free trial](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart). Doing so indicates that you [accept the KendoReact License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart).
|
|
12
|
+
> - The 30-day free trial gives you access to all the KendoReact components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the KendoReact dev team!
|
|
12
13
|
>
|
|
13
14
|
> [Start using KendoReact](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart) and speed up your development process!
|
|
14
15
|
|
|
@@ -18,33 +19,33 @@ The [React OrgChart](https://www.telerik.com/kendo-react-ui/orgchart), part of K
|
|
|
18
19
|
|
|
19
20
|
Among the features which the KendoReact OrgChart component delivers are:
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
- [OrgChart types](https://www.telerik.com/kendo-react-ui/components/orgchart/types/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)—Depending on the outcome of application operations and processes, the OrgChart enables you to display different types of orgcharts, like `info`, `error`, `warning`, and more.
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
- [Theme support](https://www.telerik.com/kendo-react-ui/components/styling/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)—The KendoReact OrgChart, as well as all 100+ components in the KendoReact suite, are styled in three polished themes (Bootstrap, Material, and Default) and can be further customized to match your specific design guidelines.
|
|
24
25
|
|
|
25
26
|
## Support Options
|
|
26
27
|
|
|
27
28
|
For any issues you might encounter while working with the KendoReact OrgChart, use any of the available support channels:
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
- Industry-leading technical support—KendoReact paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use [the dedicated KendoReact support system](https://www.telerik.com/account/support-tickets?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart).
|
|
31
|
+
- Product forums—The [KendoReact forums](https://www.telerik.com/forums/kendo-ui-react?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart) are part of the free support you can get from the community and from the KendoReact team.
|
|
32
|
+
- Feedback portal—The [KendoReact feedback portal](https://feedback.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart) is where you can request and vote for new features to be added.
|
|
32
33
|
|
|
33
34
|
## Resources
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
- [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)
|
|
37
|
+
- [Get Started with the KendoReact OrgChart](https://www.telerik.com/kendo-react-ui/components/orgchart/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)
|
|
38
|
+
- [API Reference of the KendoReact OrgChart](https://www.telerik.com/kendo-react-ui/components/orgchart/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)
|
|
39
|
+
- [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)
|
|
40
|
+
- [Blogs](https://www.telerik.com/blogs/tag/kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)
|
|
41
|
+
- [Demos, documentation, and component reference](https://www.telerik.com/kendo-react-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)
|
|
42
|
+
- [KendoReact pricing and licensing](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)
|
|
43
|
+
- [Changelog](https://www.telerik.com/kendo-react-ui/components/changelogs/ui-for-react/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-orgchart)
|
|
43
44
|
|
|
44
45
|
High-level component overview pages
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
- [React OrgChart Component](https://www.telerik.com/kendo-react-ui/orgchart)
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
_Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved._
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
_Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries._
|
|
@@ -69,12 +69,14 @@ const Q = s.createContext({
|
|
|
69
69
|
height: xe,
|
|
70
70
|
children: Ee,
|
|
71
71
|
...D
|
|
72
|
-
} = n, F = s.useRef(null), c = s.useRef(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
} = n, F = s.useRef(null), c = s.useRef(
|
|
73
|
+
new k({
|
|
74
|
+
tabIndex: f,
|
|
75
|
+
root: F,
|
|
76
|
+
selectors: [n.groupField ? ".k-orgchart-node-group-container" : ".k-orgchart-card"],
|
|
77
|
+
focusOptions: {}
|
|
78
|
+
})
|
|
79
|
+
), [w, G] = s.useState([]), d = s.useRef(null), N = (e, t, i) => {
|
|
78
80
|
i.preventDefault(), t.focusNext(e);
|
|
79
81
|
}, R = (e, t, i) => {
|
|
80
82
|
i.preventDefault(), t.focusPrevious(e);
|
|
@@ -127,7 +129,9 @@ const Q = s.createContext({
|
|
|
127
129
|
}, [v, f]);
|
|
128
130
|
const M = (e) => {
|
|
129
131
|
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(
|
|
132
|
+
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(
|
|
133
|
+
r.selectors.join(",")
|
|
134
|
+
);
|
|
131
135
|
switch (i) {
|
|
132
136
|
case "ArrowUp":
|
|
133
137
|
S(a, r, t, e);
|
|
@@ -179,28 +183,24 @@ const Q = s.createContext({
|
|
|
179
183
|
focusOptions: {}
|
|
180
184
|
});
|
|
181
185
|
};
|
|
182
|
-
return /* @__PURE__ */ s.createElement(
|
|
183
|
-
|
|
186
|
+
return /* @__PURE__ */ s.createElement("div", { style: y, ref: F, className: $(I, J) }, /* @__PURE__ */ s.createElement(
|
|
187
|
+
Q.Provider,
|
|
184
188
|
{
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
value: {
|
|
190
|
+
cardColors: x || w,
|
|
191
|
+
onExpandChange: g.onExpandChange,
|
|
192
|
+
onKeyDown: M,
|
|
193
|
+
onItemAction: B,
|
|
194
|
+
onItemDoubleClick: _,
|
|
195
|
+
onItemContextMenu: K,
|
|
196
|
+
onGroupAction: j,
|
|
197
|
+
onGroupBlur: q,
|
|
198
|
+
onGroupFocus: U
|
|
199
|
+
},
|
|
200
|
+
...D
|
|
191
201
|
},
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
);
|
|
202
|
+
g.children
|
|
203
|
+
));
|
|
204
204
|
};
|
|
205
205
|
A.propTypes = {
|
|
206
206
|
className: o.string,
|
package/client/OrgChartCard.mjs
CHANGED
|
@@ -38,11 +38,7 @@ const x = (l) => {
|
|
|
38
38
|
role: "treeitem",
|
|
39
39
|
"aria-selected": r,
|
|
40
40
|
ref: c,
|
|
41
|
-
className: h(
|
|
42
|
-
"k-orgchart-node-group-container",
|
|
43
|
-
"k-vstack",
|
|
44
|
-
{ "k-focus": r }
|
|
45
|
-
),
|
|
41
|
+
className: h("k-orgchart-node-group-container", "k-vstack", { "k-focus": r }),
|
|
46
42
|
style: a,
|
|
47
43
|
onKeyDown: m,
|
|
48
44
|
onClick: f,
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-orgchart",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1729499710,
|
|
14
14
|
version: "",
|
|
15
15
|
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"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-orgchart",
|
|
3
|
-
"version": "9.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.4",
|
|
4
4
|
"description": "React OrgChart renders a message to the user with information about the status of an app process. KendoReact OrgChart package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-data-query": "^1.0.0",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
|
-
"@progress/kendo-react-buttons": "9.0.0-develop.
|
|
28
|
-
"@progress/kendo-react-common": "9.0.0-develop.
|
|
29
|
-
"@progress/kendo-react-layout": "9.0.0-develop.
|
|
27
|
+
"@progress/kendo-react-buttons": "9.0.0-develop.4",
|
|
28
|
+
"@progress/kendo-react-common": "9.0.0-develop.4",
|
|
29
|
+
"@progress/kendo-react-layout": "9.0.0-develop.4",
|
|
30
30
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
31
31
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
32
32
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
package/processOrgChartItems.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("@progress/kendo-react-common"),d=require("./utils/consts.js");function C(n,t){if(!n||!n.length)return[];let e=n;const l=t.cloneField||"cloned",i=t.expandField||d.EXPAND_FIELD,s=t.selectField||d.SELECT_FIELD,r=t.checkField||d.CHECK_FIELD,c=t.childrenField||d.CHILDREN_FIELD;return e=o(e,i,t.expand,l,c),e=o(e,s,t.select,l,c),e=o(e,r,t.check,l,c),a(e,c,t.check),e}function o(n,t,e,l,i){if(e){const{ids:s,field:r}=E(e,t),c=!f.isArray(e)&&e.idField?f.resolveItemsIds(s,e.idField,n,i):s;return F(n,c,r,l,i)}
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@progress/kendo-react-common"),d=require("./utils/consts.js");function C(n,t){if(!n||!n.length)return[];let e=n;const l=t.cloneField||"cloned",i=t.expandField||d.EXPAND_FIELD,s=t.selectField||d.SELECT_FIELD,r=t.checkField||d.CHECK_FIELD,c=t.childrenField||d.CHILDREN_FIELD;return e=o(e,i,t.expand,l,c),e=o(e,s,t.select,l,c),e=o(e,r,t.check,l,c),a(e,c,t.check),e}function o(n,t,e,l,i){if(e){const{ids:s,field:r}=E(e,t),c=!f.isArray(e)&&e.idField?f.resolveItemsIds(s,e.idField,n,i):s;return F(n,c,r,l,i)}return n}function E(n,t){let e,l;return f.isArray(n)?(e=n,l=t):(e=n.ids||[],l=n.operationField||t),{ids:e,field:l}}function F(n,t,e,l,i){let s=n;return t.forEach(r=>{s=f.updateItem(s,r,c=>g(e,c),l,i)}),s}function g(n,t){const e=(n||"").split(".");let l=t;for(let i=0;i<e.length;i++){const s=e[i];if(i===e.length-1)l[s]=!0;else if(l[s]!==void 0)l[s]={...l[s]},l=l[s];else return}}function a(n,t,e){if(e&&!f.isArray(e)&&e.applyCheckIndeterminate){const{field:l}=E(e,d.CHECK_FIELD),i=e.checkIndeterminateField||d.CHECK_INDETERMINATE_FIELD;for(let s=0;s<n.length;s++){const r=n[s],c=r[t];c&&I(c,f.getNestedValue(l,r)?[]:[r],t,l,i)}}}function I(n,t,e,l,i){let s=!1;for(let r=0;r<n.length;r++){const c=n[r];if(f.getNestedValue(l,c)){if(!s)for(let u=0;u<t.length;u++)g(i,t[u]);s=!0,c[e]&&I(c[e],[],e,l,i)}else c[e]&&I(c[e],s?[c]:t.concat([c]),e,l,i)}}exports.processOrgChartItems=C;
|
package/processOrgChartItems.mjs
CHANGED
|
@@ -19,8 +19,8 @@ function d(n, t, e, l, f) {
|
|
|
19
19
|
if (e) {
|
|
20
20
|
const { ids: s, field: c } = m(e, t), i = !I(e) && e.idField ? g(s, e.idField, n, f) : s;
|
|
21
21
|
return _(n, i, c, l, f);
|
|
22
|
-
}
|
|
23
|
-
|
|
22
|
+
}
|
|
23
|
+
return n;
|
|
24
24
|
}
|
|
25
25
|
function m(n, t) {
|
|
26
26
|
let e, l;
|
|
@@ -68,7 +68,13 @@ function u(n, t, e, l, f) {
|
|
|
68
68
|
if (!s)
|
|
69
69
|
for (let r = 0; r < t.length; r++)
|
|
70
70
|
F(f, t[r]);
|
|
71
|
-
s = !0, i[e] && u(
|
|
71
|
+
s = !0, i[e] && u(
|
|
72
|
+
i[e],
|
|
73
|
+
[],
|
|
74
|
+
e,
|
|
75
|
+
l,
|
|
76
|
+
f
|
|
77
|
+
);
|
|
72
78
|
} else
|
|
73
79
|
i[e] && u(
|
|
74
80
|
i[e],
|
|
@@ -27,7 +27,9 @@ const P = ({
|
|
|
27
27
|
u.forEach((n) => {
|
|
28
28
|
const h = n[e];
|
|
29
29
|
if (n[s] && h && h.length) {
|
|
30
|
-
const I = h.some(
|
|
30
|
+
const I = h.some(
|
|
31
|
+
(g) => g[e] && g[e].length || i && g[i]
|
|
32
|
+
), x = I ? "horizontal" : "vertical", E = I ? null : r + 2 * v, L = m.find((g) => g.parentId === a), C = m.find((g) => g.ids.includes(a));
|
|
31
33
|
let T = !1;
|
|
32
34
|
if (L) {
|
|
33
35
|
const g = L.ids[0], k = C.items.find((W) => W[t] === g), _ = C.items.find((W) => W[t] === n[t]);
|
|
@@ -59,18 +61,26 @@ const P = ({
|
|
|
59
61
|
const r = u || tt, e = m.sort((t, s) => s.level - t.level);
|
|
60
62
|
e.forEach((t) => {
|
|
61
63
|
if (!t.width) {
|
|
62
|
-
const s = e.filter(
|
|
64
|
+
const s = e.filter(
|
|
65
|
+
(i) => t.ids.includes(i.parentId)
|
|
66
|
+
);
|
|
63
67
|
if (s.length) {
|
|
64
|
-
const i = Math.max(...s.map((n) => n.width || 0)), d = Math.max(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
const i = Math.max(...s.map((n) => n.width || 0)), d = Math.max(
|
|
69
|
+
...s.map((n) => n.groupedItems.length || 0)
|
|
70
|
+
), o = Math.max(
|
|
71
|
+
...t.groupedItems.map((n) => {
|
|
72
|
+
const h = t.orientation === "horizontal" ? n.items.length : 1;
|
|
73
|
+
return h * (r + 2 * v) + v * (h - 1);
|
|
74
|
+
})
|
|
75
|
+
), a = i * d + v * (d - 1);
|
|
68
76
|
t.width = Math.max(a, o);
|
|
69
77
|
} else {
|
|
70
|
-
const i = Math.max(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
const i = Math.max(
|
|
79
|
+
...t.groupedItems.map((d) => {
|
|
80
|
+
const o = t.orientation === "horizontal" ? d.items.length : 1;
|
|
81
|
+
return o * (r + 2 * v) + v * (o - 1);
|
|
82
|
+
})
|
|
83
|
+
);
|
|
74
84
|
t.width = i;
|
|
75
85
|
}
|
|
76
86
|
}
|
|
@@ -81,7 +91,11 @@ const P = ({
|
|
|
81
91
|
var h;
|
|
82
92
|
if (e.level === 0)
|
|
83
93
|
return;
|
|
84
|
-
const t = r.find(
|
|
94
|
+
const t = r.find(
|
|
95
|
+
(l) => l.ids.includes(e.parentId)
|
|
96
|
+
), s = (t == null ? void 0 : t.groupedItems.findIndex(
|
|
97
|
+
(l) => l.items.some((I) => e.ids.includes(I[u]))
|
|
98
|
+
)) || 0, i = (t == null ? void 0 : t.groupedItems) || [], d = t.width ? (t.width - (i.length - 1) * v) / i.length : 0;
|
|
85
99
|
if (!e.left) {
|
|
86
100
|
let l = (t == null ? void 0 : t.left) || 0;
|
|
87
101
|
i.forEach((I, x) => {
|
|
@@ -102,10 +116,12 @@ const P = ({
|
|
|
102
116
|
});
|
|
103
117
|
}, st = (m, u, r, e, t) => {
|
|
104
118
|
const s = u || S, i = r || b, o = (e || z) + A + D;
|
|
105
|
-
return Math.max(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
119
|
+
return Math.max(
|
|
120
|
+
...m.map((n) => {
|
|
121
|
+
const h = n.top || 0, l = Math.max(...n.groupedItems.map((E) => E.items.length)), I = n.hasChildren ? b : 0, x = n.orientation === "horizontal" ? s + i + o + i + I : l * (s + i) + o + i;
|
|
122
|
+
return h + x;
|
|
123
|
+
})
|
|
124
|
+
);
|
|
109
125
|
}, ot = (m) => {
|
|
110
126
|
const u = {
|
|
111
127
|
width: "100%",
|
|
@@ -144,15 +160,17 @@ const P = ({
|
|
|
144
160
|
height: N,
|
|
145
161
|
avatarType: U,
|
|
146
162
|
showAvatar: B
|
|
147
|
-
} = { ...u, ...m }, H = [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
} = { ...u, ...m }, H = [
|
|
164
|
+
{
|
|
165
|
+
items: t,
|
|
166
|
+
level: 0,
|
|
167
|
+
hasChildren: !0,
|
|
168
|
+
orientation: "horizontal",
|
|
169
|
+
ids: [0],
|
|
170
|
+
parentId: null,
|
|
171
|
+
width: null
|
|
172
|
+
}
|
|
173
|
+
];
|
|
156
174
|
P({
|
|
157
175
|
dataByGroups: H,
|
|
158
176
|
data: t,
|
|
@@ -193,14 +211,9 @@ const P = ({
|
|
|
193
211
|
"aria-label": w === 0 ? g : void 0,
|
|
194
212
|
"aria-orientation": w === 0 ? y : void 0,
|
|
195
213
|
key: c.ids[0] + "_" + w,
|
|
196
|
-
className: q(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
"k-pos-absolute",
|
|
200
|
-
{
|
|
201
|
-
[`k-${J.orientationMap[y]}`]: y
|
|
202
|
-
}
|
|
203
|
-
),
|
|
214
|
+
className: q("k-orgchart-group", `k-orgchart-level-${w}`, "k-pos-absolute", {
|
|
215
|
+
[`k-${J.orientationMap[y]}`]: y
|
|
216
|
+
}),
|
|
204
217
|
style: {
|
|
205
218
|
width: c.width || "100%",
|
|
206
219
|
left: c.left,
|
|
@@ -208,7 +221,9 @@ const P = ({
|
|
|
208
221
|
}
|
|
209
222
|
},
|
|
210
223
|
t.length > 0 && O.map((f, M) => {
|
|
211
|
-
const G = f.items.some(
|
|
224
|
+
const G = f.items.some(
|
|
225
|
+
(p) => p[l] && p[l].length || x && p[x]
|
|
226
|
+
), V = c.width ? (c.width - (O.length - 1) * v) / O.length : void 0, Z = F.findIndex((p) => p === f);
|
|
212
227
|
return /* @__PURE__ */ R.createElement(
|
|
213
228
|
X,
|
|
214
229
|
{
|
|
@@ -25,7 +25,9 @@ const R = ({
|
|
|
25
25
|
r.forEach((c) => {
|
|
26
26
|
const f = c[n];
|
|
27
27
|
if (c[t] && f && f.length) {
|
|
28
|
-
const s = f.some(
|
|
28
|
+
const s = f.some(
|
|
29
|
+
(g) => g[n] && g[n].length || i && g[i]
|
|
30
|
+
), L = s ? "horizontal" : "vertical", v = s ? null : l;
|
|
29
31
|
d.push({
|
|
30
32
|
ids: [c[e]],
|
|
31
33
|
items: f,
|
|
@@ -52,7 +54,9 @@ const R = ({
|
|
|
52
54
|
const l = r || V, n = d.sort((e, t) => t.level - e.level);
|
|
53
55
|
n.forEach((e) => {
|
|
54
56
|
if (!e.width) {
|
|
55
|
-
const t = n.filter(
|
|
57
|
+
const t = n.filter(
|
|
58
|
+
(h) => e.ids.includes(h.parentId)
|
|
59
|
+
), i = t.length ? Math.max(...t.map((h) => h.width || 0)) : l, a = e.orientation === "horizontal" ? e.items.length : 1, m = i * a + x * (a - 1);
|
|
56
60
|
e.width = m;
|
|
57
61
|
}
|
|
58
62
|
});
|
|
@@ -61,7 +65,9 @@ const R = ({
|
|
|
61
65
|
n.forEach((e) => {
|
|
62
66
|
if (e.level === 0)
|
|
63
67
|
return;
|
|
64
|
-
const t = n.find(
|
|
68
|
+
const t = n.find(
|
|
69
|
+
(s) => s.ids.includes(e.parentId)
|
|
70
|
+
), i = (t == null ? void 0 : t.items.findIndex((s) => e.ids.includes(s[l]))) || 0, a = (t == null ? void 0 : t.items) || [], m = t.width ? (t.width - (a.length - 1) * x) / a.length : 0;
|
|
65
71
|
if (!e.left) {
|
|
66
72
|
let s = (t == null ? void 0 : t.left) || 0;
|
|
67
73
|
a.forEach((L, v) => {
|
|
@@ -84,10 +90,12 @@ const R = ({
|
|
|
84
90
|
});
|
|
85
91
|
}, K = (d, r, l) => {
|
|
86
92
|
const n = r || M, e = l || H;
|
|
87
|
-
return Math.max(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
return Math.max(
|
|
94
|
+
...d.map((i) => {
|
|
95
|
+
const a = i.top || 0, m = i.items.length, h = i.orientation === "horizontal" ? n + e + e : m * (n + e);
|
|
96
|
+
return a + h;
|
|
97
|
+
})
|
|
98
|
+
);
|
|
91
99
|
}, Z = (d) => {
|
|
92
100
|
const r = {
|
|
93
101
|
width: "100%",
|
|
@@ -121,15 +129,17 @@ const R = ({
|
|
|
121
129
|
height: _,
|
|
122
130
|
avatarType: z,
|
|
123
131
|
showAvatar: A
|
|
124
|
-
} = { ...r, ...d }, E = [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
} = { ...r, ...d }, E = [
|
|
133
|
+
{
|
|
134
|
+
items: e,
|
|
135
|
+
level: 0,
|
|
136
|
+
hasChildren: !0,
|
|
137
|
+
orientation: "horizontal",
|
|
138
|
+
ids: [0],
|
|
139
|
+
parentId: null,
|
|
140
|
+
width: null
|
|
141
|
+
}
|
|
142
|
+
];
|
|
133
143
|
R({
|
|
134
144
|
dataByGroups: E,
|
|
135
145
|
data: e,
|
|
@@ -171,13 +181,9 @@ const R = ({
|
|
|
171
181
|
{
|
|
172
182
|
role: "group",
|
|
173
183
|
style: { width: "100%" },
|
|
174
|
-
className: O(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
{
|
|
178
|
-
[`k-${b.orientationMap[o.orientation]}`]: o.orientation
|
|
179
|
-
}
|
|
180
|
-
)
|
|
184
|
+
className: O("k-orgchart-node-container", "k-justify-content-around", {
|
|
185
|
+
[`k-${b.orientationMap[o.orientation]}`]: o.orientation
|
|
186
|
+
})
|
|
181
187
|
},
|
|
182
188
|
y.map((w, I) => {
|
|
183
189
|
const p = w[c] && w[c].length || f && w[f], F = p || o.orientation === "vertical" && I !== y.length - 1, S = o.orientation === "vertical" && I !== 0 ? 0 : m || H, $ = o.childLineWidths ? Math.max(...o.childLineWidths) : void 0, C = w[k];
|
|
@@ -37,12 +37,7 @@ const f = "k-orgchart-node-group", u = "k-orgchart-node-group-title", p = "k-org
|
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
39
|
...O,
|
|
40
|
-
className: E(
|
|
41
|
-
i.className,
|
|
42
|
-
f,
|
|
43
|
-
"k-vstack",
|
|
44
|
-
"k-align-items-center"
|
|
45
|
-
)
|
|
40
|
+
className: E(i.className, f, "k-vstack", "k-align-items-center")
|
|
46
41
|
},
|
|
47
42
|
t !== 0 && /* @__PURE__ */ e.createElement(
|
|
48
43
|
"div",
|
|
@@ -87,25 +82,16 @@ const f = "k-orgchart-node-group", u = "k-orgchart-node-group-title", p = "k-org
|
|
|
87
82
|
{
|
|
88
83
|
role: "group",
|
|
89
84
|
style: { width: "100%" },
|
|
90
|
-
className: E(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
[`k-${y.orientationMap[o] || o}`]: o
|
|
94
|
-
}
|
|
95
|
-
)
|
|
85
|
+
className: E("k-orgchart-node-container", {
|
|
86
|
+
[`k-${y.orientationMap[o] || o}`]: o
|
|
87
|
+
})
|
|
96
88
|
},
|
|
97
89
|
i.children
|
|
98
90
|
)
|
|
99
91
|
),
|
|
100
92
|
N && /* @__PURE__ */ e.createElement("div", { className: "k-orgchart-line k-orgchart-line-v" }),
|
|
101
93
|
s && /* @__PURE__ */ e.createElement(A, { expanded: r, nodes: a }),
|
|
102
|
-
s && !!c && /* @__PURE__ */ e.createElement(
|
|
103
|
-
"div",
|
|
104
|
-
{
|
|
105
|
-
className: "k-orgchart-line k-orgchart-line-h",
|
|
106
|
-
style: { width: c, marginTop: -15 }
|
|
107
|
-
}
|
|
108
|
-
)
|
|
94
|
+
s && !!c && /* @__PURE__ */ e.createElement("div", { className: "k-orgchart-line k-orgchart-line-h", style: { width: c, marginTop: -15 } })
|
|
109
95
|
);
|
|
110
96
|
};
|
|
111
97
|
export {
|
|
@@ -39,12 +39,7 @@ const S = "k-orgchart-node", D = (l) => {
|
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
41
|
...y,
|
|
42
|
-
className: f(
|
|
43
|
-
l.className,
|
|
44
|
-
S,
|
|
45
|
-
"k-vstack",
|
|
46
|
-
"k-align-items-center"
|
|
47
|
-
)
|
|
42
|
+
className: f(l.className, S, "k-vstack", "k-align-items-center")
|
|
48
43
|
},
|
|
49
44
|
t !== 0 && /* @__PURE__ */ e.createElement(
|
|
50
45
|
"div",
|
|
@@ -72,23 +67,11 @@ const S = "k-orgchart-node", D = (l) => {
|
|
|
72
67
|
expanded: a,
|
|
73
68
|
color: k
|
|
74
69
|
}
|
|
75
|
-
) : /* @__PURE__ */ e.createElement(e.Fragment, null, u && /* @__PURE__ */ e.createElement(x, { type: o, themeColor: "secondary" }, o === "image" ? /* @__PURE__ */ e.createElement(
|
|
76
|
-
"img",
|
|
77
|
-
{
|
|
78
|
-
src: m,
|
|
79
|
-
alt: "KendoReact Avatar Customer"
|
|
80
|
-
}
|
|
81
|
-
) : m), /* @__PURE__ */ e.createElement("div", { className: "k-card-title-wrap k-vstack" }, /* @__PURE__ */ e.createElement(A, { className: "k-text-ellipsis" }, c), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ e.createElement(R, { className: "k-text-ellipsis" }, i)), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" })))
|
|
70
|
+
) : /* @__PURE__ */ e.createElement(e.Fragment, null, u && /* @__PURE__ */ e.createElement(x, { type: o, themeColor: "secondary" }, o === "image" ? /* @__PURE__ */ e.createElement("img", { src: m, alt: "KendoReact Avatar Customer" }) : m), /* @__PURE__ */ e.createElement("div", { className: "k-card-title-wrap k-vstack" }, /* @__PURE__ */ e.createElement(A, { className: "k-text-ellipsis" }, c), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ e.createElement(R, { className: "k-text-ellipsis" }, i)), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" })))
|
|
82
71
|
),
|
|
83
72
|
N && /* @__PURE__ */ e.createElement("div", { className: "k-orgchart-line k-orgchart-line-v" }),
|
|
84
73
|
s && /* @__PURE__ */ e.createElement(w, { expanded: a, node: r }),
|
|
85
|
-
s && !!n && /* @__PURE__ */ e.createElement(
|
|
86
|
-
"div",
|
|
87
|
-
{
|
|
88
|
-
className: "k-orgchart-line k-orgchart-line-h",
|
|
89
|
-
style: { width: n, marginTop: -15 }
|
|
90
|
-
}
|
|
91
|
-
)
|
|
74
|
+
s && !!n && /* @__PURE__ */ e.createElement("div", { className: "k-orgchart-line k-orgchart-line-h", style: { width: n, marginTop: -15 } })
|
|
92
75
|
);
|
|
93
76
|
};
|
|
94
77
|
export {
|