@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/index.mjs
CHANGED
|
@@ -1,1149 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
*/
|
|
5
8
|
"use client";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import h from "prop-types";
|
|
12
|
-
import { groupBy as ot } from "@progress/kendo-data-query";
|
|
13
|
-
const me = (s) => window.getComputedStyle(s).backgroundColor, st = (s) => s.toLowerCase().charCodeAt(0) - "a".charCodeAt(0), rt = (s) => {
|
|
14
|
-
const t = s.match(/series-([a-z])$/);
|
|
15
|
-
if (t !== null)
|
|
16
|
-
return st(t[1]);
|
|
17
|
-
const o = s.split("--series-")[1];
|
|
18
|
-
return parseInt(o, 10) - 1;
|
|
19
|
-
}, at = 30, lt = () => {
|
|
20
|
-
let s = `
|
|
21
|
-
<div class="k-var--series-a"></div>
|
|
22
|
-
<div class="k-var--series-b"></div>
|
|
23
|
-
<div class="k-var--series-c"></div>
|
|
24
|
-
<div class="k-var--series-d"></div>
|
|
25
|
-
<div class="k-var--series-e"></div>
|
|
26
|
-
<div class="k-var--series-f"></div>
|
|
27
|
-
`;
|
|
28
|
-
for (let t = 0; t < at; t++)
|
|
29
|
-
s += `
|
|
30
|
-
<div class="k-var--series-${t + 1}"></div>`;
|
|
31
|
-
return s;
|
|
32
|
-
}, ct = `
|
|
33
|
-
<div class="k-var--series-unset"></div>
|
|
34
|
-
<div class="k-var--series">
|
|
35
|
-
${lt()}
|
|
36
|
-
</div>
|
|
37
|
-
`;
|
|
38
|
-
class dt {
|
|
39
|
-
getSeriesColors() {
|
|
40
|
-
const t = this.element, o = [].slice.call(t.querySelectorAll(".k-var--series div")), i = me(t.querySelector(".k-var--series-unset"));
|
|
41
|
-
return o.reduce(
|
|
42
|
-
(n, r) => {
|
|
43
|
-
const a = rt(r.className), c = me(r);
|
|
44
|
-
return c !== i && (n[a] = c), n;
|
|
45
|
-
},
|
|
46
|
-
[]
|
|
47
|
-
// Will populate the series colors in this array
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
const ht = (s, t) => {
|
|
52
|
-
const o = new dt(), i = o.element = t.createElement("div");
|
|
53
|
-
i.style.display = "none", i.innerHTML = ct, t.body.appendChild(i);
|
|
54
|
-
let e;
|
|
55
|
-
try {
|
|
56
|
-
e = o.getSeriesColors();
|
|
57
|
-
} finally {
|
|
58
|
-
t.body.removeChild(o.element), delete o.element, s(e);
|
|
59
|
-
}
|
|
60
|
-
}, ut = "expanded", mt = "items", gt = "selected", pe = "checked", ft = "checkIndeterminate", vt = "k-orgchart", q = 80, Ce = 300, T = 25, R = 40, ne = 20, ie = 20, ke = 82, Y = l.createContext({
|
|
61
|
-
cardColors: void 0,
|
|
62
|
-
onExpandChange: void 0,
|
|
63
|
-
onKeyDown: void 0,
|
|
64
|
-
onItemAction: void 0,
|
|
65
|
-
onItemContextMenu: void 0,
|
|
66
|
-
onItemDoubleClick: void 0,
|
|
67
|
-
onGroupAction: void 0,
|
|
68
|
-
onGroupBlur: void 0,
|
|
69
|
-
onGroupFocus: void 0
|
|
70
|
-
}), de = (s) => {
|
|
71
|
-
const t = {
|
|
72
|
-
tabIndex: 0,
|
|
73
|
-
navigatable: !0,
|
|
74
|
-
expandField: "expanded",
|
|
75
|
-
ariaLabel: "Org Chart",
|
|
76
|
-
idField: "id",
|
|
77
|
-
childrenField: "items",
|
|
78
|
-
avatarField: "avatar",
|
|
79
|
-
titleField: "title",
|
|
80
|
-
subtitleField: "subtitle",
|
|
81
|
-
...s
|
|
82
|
-
}, {
|
|
83
|
-
navigatable: o,
|
|
84
|
-
id: i,
|
|
85
|
-
tabIndex: e,
|
|
86
|
-
className: n,
|
|
87
|
-
style: r,
|
|
88
|
-
data: a,
|
|
89
|
-
groupField: c,
|
|
90
|
-
cardWidth: m,
|
|
91
|
-
cardHeight: d,
|
|
92
|
-
groupTitleHeight: g,
|
|
93
|
-
groupSubtitleHeight: f,
|
|
94
|
-
verticalLine: u,
|
|
95
|
-
idField: k,
|
|
96
|
-
childrenField: b,
|
|
97
|
-
expandField: I,
|
|
98
|
-
hasChildrenField: H,
|
|
99
|
-
avatarField: D,
|
|
100
|
-
titleField: E,
|
|
101
|
-
subtitleField: G,
|
|
102
|
-
onExpandChange: y,
|
|
103
|
-
onItemAction: x,
|
|
104
|
-
onItemDoubleClick: B,
|
|
105
|
-
onItemContextMenu: O,
|
|
106
|
-
onKeyDown: z,
|
|
107
|
-
onGroupAction: C,
|
|
108
|
-
onGroupBlur: L,
|
|
109
|
-
onGroupFocus: W,
|
|
110
|
-
cardsColors: $,
|
|
111
|
-
ariaLabel: V,
|
|
112
|
-
itemRender: U,
|
|
113
|
-
groupTitleRender: X,
|
|
114
|
-
groupSubtitleRender: A,
|
|
115
|
-
height: ee,
|
|
116
|
-
children: j,
|
|
117
|
-
...oe
|
|
118
|
-
} = t, Z = l.useRef(null), w = l.useRef(new ue({
|
|
119
|
-
tabIndex: e,
|
|
120
|
-
root: Z,
|
|
121
|
-
selectors: [t.groupField ? ".k-orgchart-node-group-container" : ".k-orgchart-card"],
|
|
122
|
-
focusOptions: {}
|
|
123
|
-
})), [se, Te] = l.useState([]), P = l.useRef(null), Ae = (v, p, N) => {
|
|
124
|
-
N.preventDefault(), p.focusNext(v);
|
|
125
|
-
}, He = (v, p, N) => {
|
|
126
|
-
N.preventDefault(), p.focusPrevious(v);
|
|
127
|
-
}, Se = (v, p, N, F) => {
|
|
128
|
-
var M;
|
|
129
|
-
if (N.preventDefault(), (t.groupField ? F.items.some((J) => J[t.expandField]) : F.item[t.expandField]) && t.onExpandChange)
|
|
130
|
-
t.onExpandChange.call(void 0, F);
|
|
131
|
-
else {
|
|
132
|
-
const J = ".k-orgchart-group", re = (M = v.closest(J)) == null ? void 0 : M.getAttribute("id"), Q = document.querySelector(`[aria-owns="${re}"]`);
|
|
133
|
-
Q ? p.focusElement(Q, v) : p.focusPrevious(v);
|
|
134
|
-
}
|
|
135
|
-
}, De = (v, p, N, F) => {
|
|
136
|
-
var Q;
|
|
137
|
-
N.preventDefault();
|
|
138
|
-
const S = t.groupField ? F.items.some((K) => K[t.expandField]) : F.item[t.expandField], M = t.groupField ? F.items.find((K) => K[t.childrenField]) : F.item[t.childrenField], J = t.groupField ? F.items.some((K) => t.hasChildrenField && K[t.hasChildrenField]) : t.hasChildrenField && F.item[t.hasChildrenField], re = t.groupField ? M && M[t.childrenField] && M[t.childrenField].length : M && M.length;
|
|
139
|
-
if ((J || re) && !S && t.onExpandChange)
|
|
140
|
-
t.onExpandChange.call(void 0, F);
|
|
141
|
-
else {
|
|
142
|
-
const K = t.groupField ? ".k-orgchart-node-group-container" : ".k-orgchart-card", Ue = v.getAttribute("aria-owns"), he = (Q = document.getElementById(Ue)) == null ? void 0 : Q.querySelector(K);
|
|
143
|
-
he ? p.focusElement(he, v) : p.focusNext(v);
|
|
144
|
-
}
|
|
145
|
-
}, Oe = (v, p, N) => {
|
|
146
|
-
N.preventDefault(), p.focusElement(p.first, null);
|
|
147
|
-
}, Re = (v, p, N) => {
|
|
148
|
-
N.preventDefault(), p.focusElement(p.last, null);
|
|
149
|
-
}, Ge = (v, p, N, F) => {
|
|
150
|
-
N.stopPropagation();
|
|
151
|
-
const S = v.className.indexOf("k-orgchart-node-group-container") !== -1;
|
|
152
|
-
if (s.groupField && S) {
|
|
153
|
-
P.current && P.current.first && P.current.focusElement(P.current.first, null);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
t.onItemAction && t.onItemAction({
|
|
157
|
-
event: N,
|
|
158
|
-
item: F.item
|
|
159
|
-
});
|
|
160
|
-
}, We = (v) => {
|
|
161
|
-
if (s.groupField) {
|
|
162
|
-
const p = v.closest(".k-orgchart-node-group-container");
|
|
163
|
-
p && w.current.focusElement(p, null);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
l.useEffect(() => {
|
|
167
|
-
if (o && w.current.first && w.current.first.setAttribute("tabindex", String(e)), !$) {
|
|
168
|
-
const v = Z.current.ownerDocument || document;
|
|
169
|
-
ht((p) => {
|
|
170
|
-
Te(p);
|
|
171
|
-
}, v);
|
|
172
|
-
}
|
|
173
|
-
}, [o, e]);
|
|
174
|
-
const _e = (v) => {
|
|
175
|
-
if (t.navigatable) {
|
|
176
|
-
const p = v.event, N = p.key === " " ? "Space" : p.key, F = s.groupField && p.target.className.indexOf("k-orgchart-card") !== -1 && P.current || w.current, S = p.target.closest(F.selectors.join(","));
|
|
177
|
-
switch (N) {
|
|
178
|
-
case "ArrowUp":
|
|
179
|
-
Se(S, F, p, v);
|
|
180
|
-
break;
|
|
181
|
-
case "ArrowDown":
|
|
182
|
-
De(S, F, p, v);
|
|
183
|
-
break;
|
|
184
|
-
case "ArrowLeft":
|
|
185
|
-
He(S, F, p);
|
|
186
|
-
break;
|
|
187
|
-
case "ArrowRight":
|
|
188
|
-
Ae(S, F, p);
|
|
189
|
-
break;
|
|
190
|
-
case "End":
|
|
191
|
-
Re(S, F, p);
|
|
192
|
-
break;
|
|
193
|
-
case "Home":
|
|
194
|
-
Oe(S, F, p);
|
|
195
|
-
break;
|
|
196
|
-
case "Enter":
|
|
197
|
-
Ge(S, F, p, v);
|
|
198
|
-
break;
|
|
199
|
-
case "Escape":
|
|
200
|
-
We(S);
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}, Me = (v) => {
|
|
205
|
-
if (v.event.stopPropagation(), x && x.call(void 0, v), t.navigatable) {
|
|
206
|
-
const p = v.event.target.closest(".k-orgchart-card");
|
|
207
|
-
p && w.current.focusElement(p, null);
|
|
208
|
-
}
|
|
209
|
-
}, Pe = (v) => {
|
|
210
|
-
v.event.stopPropagation(), x && x.call(void 0, v);
|
|
211
|
-
}, Ke = (v) => {
|
|
212
|
-
v.event.stopPropagation(), x && x.call(void 0, v);
|
|
213
|
-
}, Be = (v) => {
|
|
214
|
-
if (C && C.call(void 0, v), t.navigatable) {
|
|
215
|
-
const p = v.event.target.closest(".k-orgchart-node-group-container");
|
|
216
|
-
p && w.current.focusElement(p, null);
|
|
217
|
-
}
|
|
218
|
-
}, ze = (v) => {
|
|
219
|
-
P.current = null;
|
|
220
|
-
}, $e = (v) => {
|
|
221
|
-
P.current = new ue({
|
|
222
|
-
tabIndex: 0,
|
|
223
|
-
root: v.containerRef,
|
|
224
|
-
selectors: [".k-orgchart-card"],
|
|
225
|
-
focusOptions: {}
|
|
226
|
-
});
|
|
227
|
-
};
|
|
228
|
-
return /* @__PURE__ */ l.createElement(
|
|
229
|
-
"div",
|
|
230
|
-
{
|
|
231
|
-
style: r,
|
|
232
|
-
ref: Z,
|
|
233
|
-
className: _(
|
|
234
|
-
n,
|
|
235
|
-
vt
|
|
236
|
-
)
|
|
237
|
-
},
|
|
238
|
-
/* @__PURE__ */ l.createElement(Y.Provider, { value: {
|
|
239
|
-
cardColors: $ || se,
|
|
240
|
-
onExpandChange: s.onExpandChange,
|
|
241
|
-
onKeyDown: _e,
|
|
242
|
-
onItemAction: Me,
|
|
243
|
-
onItemDoubleClick: Ke,
|
|
244
|
-
onItemContextMenu: Pe,
|
|
245
|
-
onGroupAction: Be,
|
|
246
|
-
onGroupBlur: ze,
|
|
247
|
-
onGroupFocus: $e
|
|
248
|
-
}, ...oe }, s.children)
|
|
249
|
-
);
|
|
250
|
-
};
|
|
251
|
-
de.propTypes = {
|
|
252
|
-
className: h.string,
|
|
253
|
-
style: h.object,
|
|
254
|
-
id: h.string,
|
|
255
|
-
ariaLabel: h.string,
|
|
256
|
-
idField: h.string,
|
|
257
|
-
childrenField: h.string,
|
|
258
|
-
expandField: h.string,
|
|
259
|
-
titleField: h.string,
|
|
260
|
-
hasChildrenField: h.string,
|
|
261
|
-
subtitleField: h.string,
|
|
262
|
-
avatarField: h.string,
|
|
263
|
-
cardsColors: h.array,
|
|
264
|
-
data: h.array,
|
|
265
|
-
groupField: h.string,
|
|
266
|
-
cardHeight: h.number,
|
|
267
|
-
cardWidth: h.number,
|
|
268
|
-
groupTitleHeight: h.number,
|
|
269
|
-
groupSubtitleHeight: h.number,
|
|
270
|
-
verticalLine: h.number,
|
|
271
|
-
height: h.oneOfType([h.string, h.number]),
|
|
272
|
-
onExpandChange: h.func,
|
|
273
|
-
onItemAction: h.func,
|
|
274
|
-
onItemDoubleClick: h.func,
|
|
275
|
-
onItemContextMenu: h.func,
|
|
276
|
-
onGroupAction: h.func
|
|
277
|
-
};
|
|
278
|
-
de.displayName = "KendoClientOrgChart";
|
|
279
|
-
const Ee = (s) => {
|
|
280
|
-
const { expanded: t, node: o, nodes: i } = s, e = l.useContext(Y), n = (r) => {
|
|
281
|
-
e.onExpandChange && e.onExpandChange.call(void 0, {
|
|
282
|
-
event: r,
|
|
283
|
-
expand: !t,
|
|
284
|
-
item: o,
|
|
285
|
-
items: i
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
|
-
return /* @__PURE__ */ l.createElement(
|
|
289
|
-
tt,
|
|
290
|
-
{
|
|
291
|
-
className: "k-orgchart-button",
|
|
292
|
-
icon: t ? "minus" : "plus",
|
|
293
|
-
tabIndex: -1,
|
|
294
|
-
svgIcon: t ? nt : it,
|
|
295
|
-
"aria-label": t ? "collapse" : "expand",
|
|
296
|
-
onClick: n
|
|
297
|
-
}
|
|
298
|
-
);
|
|
299
|
-
}, pt = (s) => {
|
|
300
|
-
const { node: t, children: o, style: i, ...e } = s, [n, r] = l.useState(!1), a = l.useContext(Y), c = (f) => {
|
|
301
|
-
a.onKeyDown && a.onKeyDown.call(void 0, {
|
|
302
|
-
event: f,
|
|
303
|
-
item: t
|
|
304
|
-
});
|
|
305
|
-
}, m = (f) => {
|
|
306
|
-
a.onItemAction && a.onItemAction.call(void 0, {
|
|
307
|
-
event: f,
|
|
308
|
-
item: t
|
|
309
|
-
});
|
|
310
|
-
}, d = (f) => {
|
|
311
|
-
a.onItemContextMenu && a.onItemContextMenu.call(void 0, {
|
|
312
|
-
event: f,
|
|
313
|
-
item: t
|
|
314
|
-
});
|
|
315
|
-
}, g = (f) => {
|
|
316
|
-
a.onItemDoubleClick && a.onItemDoubleClick.call(void 0, {
|
|
317
|
-
event: f,
|
|
318
|
-
item: t
|
|
319
|
-
});
|
|
320
|
-
};
|
|
321
|
-
return /* @__PURE__ */ l.createElement(
|
|
322
|
-
Ze,
|
|
323
|
-
{
|
|
324
|
-
role: "treeitem",
|
|
325
|
-
className: _(
|
|
326
|
-
"k-orgchart-card",
|
|
327
|
-
{ "k-focus": n }
|
|
328
|
-
),
|
|
329
|
-
onClick: m,
|
|
330
|
-
onKeyDown: c,
|
|
331
|
-
onContextMenu: d,
|
|
332
|
-
onDoubleClick: g,
|
|
333
|
-
style: i,
|
|
334
|
-
"aria-selected": n,
|
|
335
|
-
"aria-keyshortcuts": "Enter",
|
|
336
|
-
onFocus: () => r(!0),
|
|
337
|
-
onBlur: () => r(!1),
|
|
338
|
-
...e
|
|
339
|
-
},
|
|
340
|
-
o
|
|
341
|
-
);
|
|
342
|
-
}, Ct = (s) => {
|
|
343
|
-
const { level: t, children: o } = s, i = l.useContext(Y), e = i.cardColors && i.cardColors[t] || "green";
|
|
344
|
-
return /* @__PURE__ */ l.createElement(Je, { className: "k-hstack", style: { borderTopColor: e } }, o);
|
|
345
|
-
}, kt = "k-orgchart-node", xe = (s) => {
|
|
346
|
-
const t = {
|
|
347
|
-
avatarType: "image"
|
|
348
|
-
}, {
|
|
349
|
-
id: o,
|
|
350
|
-
title: i,
|
|
351
|
-
subtitle: e,
|
|
352
|
-
level: n,
|
|
353
|
-
childLineWidth: r,
|
|
354
|
-
cardWidth: a,
|
|
355
|
-
cardHeight: c,
|
|
356
|
-
verticalLine: m,
|
|
357
|
-
color: d,
|
|
358
|
-
line: g,
|
|
359
|
-
plus: f,
|
|
360
|
-
expanded: u,
|
|
361
|
-
node: k,
|
|
362
|
-
avatar: b,
|
|
363
|
-
avatarType: I,
|
|
364
|
-
itemRender: H,
|
|
365
|
-
...D
|
|
366
|
-
} = { ...s, ...t }, E = H;
|
|
367
|
-
return /* @__PURE__ */ l.createElement(
|
|
368
|
-
"div",
|
|
369
|
-
{
|
|
370
|
-
...D,
|
|
371
|
-
className: _(
|
|
372
|
-
s.className,
|
|
373
|
-
kt,
|
|
374
|
-
"k-vstack",
|
|
375
|
-
"k-align-items-center"
|
|
376
|
-
)
|
|
377
|
-
},
|
|
378
|
-
n !== 0 && /* @__PURE__ */ l.createElement(
|
|
379
|
-
"div",
|
|
380
|
-
{
|
|
381
|
-
className: "k-orgchart-line k-orgchart-line-v k-orgchart-line-v-top",
|
|
382
|
-
style: { height: m }
|
|
383
|
-
}
|
|
384
|
-
),
|
|
385
|
-
/* @__PURE__ */ l.createElement(
|
|
386
|
-
pt,
|
|
387
|
-
{
|
|
388
|
-
node: k,
|
|
389
|
-
style: { width: a, height: c },
|
|
390
|
-
"aria-level": n + 1,
|
|
391
|
-
"aria-expanded": !!u,
|
|
392
|
-
"aria-owns": o
|
|
393
|
-
},
|
|
394
|
-
/* @__PURE__ */ l.createElement(Ct, { level: n }, E ? /* @__PURE__ */ l.createElement(
|
|
395
|
-
E,
|
|
396
|
-
{
|
|
397
|
-
item: k,
|
|
398
|
-
title: i,
|
|
399
|
-
subtitle: e,
|
|
400
|
-
level: n,
|
|
401
|
-
expanded: u,
|
|
402
|
-
color: d
|
|
403
|
-
}
|
|
404
|
-
) : /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(Qe, { type: I, themeColor: "secondary" }, I === "image" ? /* @__PURE__ */ l.createElement(
|
|
405
|
-
"img",
|
|
406
|
-
{
|
|
407
|
-
src: b,
|
|
408
|
-
alt: "KendoReact Avatar Customer Image"
|
|
409
|
-
}
|
|
410
|
-
) : b), /* @__PURE__ */ l.createElement("div", { className: "k-card-title-wrap k-vstack" }, /* @__PURE__ */ l.createElement(Ye, { className: "k-text-ellipsis" }, i), /* @__PURE__ */ l.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ l.createElement(et, { className: "k-text-ellipsis" }, e)), /* @__PURE__ */ l.createElement("span", { className: "k-spacer" })))
|
|
411
|
-
),
|
|
412
|
-
g && /* @__PURE__ */ l.createElement("div", { className: "k-orgchart-line k-orgchart-line-v" }),
|
|
413
|
-
f && /* @__PURE__ */ l.createElement(Ee, { expanded: u, node: k }),
|
|
414
|
-
f && !!r && /* @__PURE__ */ l.createElement(
|
|
415
|
-
"div",
|
|
416
|
-
{
|
|
417
|
-
className: "k-orgchart-line k-orgchart-line-h",
|
|
418
|
-
style: { width: r, marginTop: -15 }
|
|
419
|
-
}
|
|
420
|
-
)
|
|
421
|
-
);
|
|
422
|
-
}, be = ({
|
|
423
|
-
dataByGroups: s,
|
|
424
|
-
data: t = [],
|
|
425
|
-
cardWidth: o,
|
|
426
|
-
childrenField: i,
|
|
427
|
-
idField: e,
|
|
428
|
-
expandField: n,
|
|
429
|
-
hasChildrenField: r,
|
|
430
|
-
groupField: a,
|
|
431
|
-
level: c = 1,
|
|
432
|
-
parentId: m = 0
|
|
433
|
-
}) => {
|
|
434
|
-
t.forEach((d) => {
|
|
435
|
-
const g = d[i];
|
|
436
|
-
if (d[n] && g && g.length) {
|
|
437
|
-
const u = g.some((I) => I[i] && I[i].length || r && I[r]), k = u ? "horizontal" : "vertical", b = u ? null : o;
|
|
438
|
-
s.push({
|
|
439
|
-
ids: [d[e]],
|
|
440
|
-
items: g,
|
|
441
|
-
level: c,
|
|
442
|
-
parentId: m,
|
|
443
|
-
hasChildren: u,
|
|
444
|
-
orientation: k,
|
|
445
|
-
width: b
|
|
446
|
-
}), be({
|
|
447
|
-
dataByGroups: s,
|
|
448
|
-
data: d[i],
|
|
449
|
-
childrenField: i,
|
|
450
|
-
cardWidth: o,
|
|
451
|
-
idField: e,
|
|
452
|
-
expandField: n,
|
|
453
|
-
hasChildrenField: r,
|
|
454
|
-
groupField: a,
|
|
455
|
-
level: c + 1,
|
|
456
|
-
parentId: d[e]
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
}, Et = (s, t) => {
|
|
461
|
-
const o = t || Ce, i = s.sort((e, n) => n.level - e.level);
|
|
462
|
-
i.forEach((e) => {
|
|
463
|
-
if (!e.width) {
|
|
464
|
-
const n = i.filter((m) => e.ids.includes(m.parentId)), r = n.length ? Math.max(...n.map((m) => m.width || 0)) : o, a = e.orientation === "horizontal" ? e.items.length : 1, c = r * a + T * (a - 1);
|
|
465
|
-
e.width = c;
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
}, xt = (s, t, o) => {
|
|
469
|
-
const i = s.sort((e, n) => e.level - n.level);
|
|
470
|
-
i.forEach((e) => {
|
|
471
|
-
if (e.level === 0)
|
|
472
|
-
return;
|
|
473
|
-
const n = i.find((u) => u.ids.includes(e.parentId)), r = (n == null ? void 0 : n.items.findIndex((u) => e.ids.includes(u[o]))) || 0, a = (n == null ? void 0 : n.items) || [], c = n.width ? (n.width - (a.length - 1) * T) / a.length : 0;
|
|
474
|
-
if (!e.left) {
|
|
475
|
-
let u = (n == null ? void 0 : n.left) || 0;
|
|
476
|
-
a.forEach((k, b) => {
|
|
477
|
-
b < r && (u += c + T);
|
|
478
|
-
}), e.left = u;
|
|
479
|
-
}
|
|
480
|
-
const m = (n == null ? void 0 : n.width) || 0, d = (n == null ? void 0 : n.items.length) || 1, g = (m - (d - 1) * T) / d;
|
|
481
|
-
e.width = g;
|
|
482
|
-
const f = n == null ? void 0 : n.items.map((u) => {
|
|
483
|
-
const k = u[t] ? u[t].length : 0, b = i.find((H) => H.ids.includes(u[o])), I = (b == null ? void 0 : b.width) || 0;
|
|
484
|
-
return (b == null ? void 0 : b.orientation) === "vertical" || k === 0 || !u.expanded ? 0 : I - (I - (k - 1) * T) / k;
|
|
485
|
-
});
|
|
486
|
-
n && (n.childLineWidths = f);
|
|
487
|
-
});
|
|
488
|
-
}, bt = (s, t, o) => {
|
|
489
|
-
const i = t || q, e = o || R;
|
|
490
|
-
s.forEach((n) => {
|
|
491
|
-
const r = n.level, a = (i + e) * r + R * (r ? r - 1 : 0) - (e - R) * (r ? 1 : 0);
|
|
492
|
-
n.top = a;
|
|
493
|
-
});
|
|
494
|
-
}, It = (s, t, o) => {
|
|
495
|
-
const i = t || q, e = o || R;
|
|
496
|
-
return Math.max(...s.map((r) => {
|
|
497
|
-
const a = r.top || 0, c = r.items.length, m = r.orientation === "horizontal" ? i + e + e : c * (i + e);
|
|
498
|
-
return a + m;
|
|
499
|
-
}));
|
|
500
|
-
}, Ie = (s) => {
|
|
501
|
-
const t = {
|
|
502
|
-
width: "100%",
|
|
503
|
-
data: [],
|
|
504
|
-
ariaLabel: "Org Chart",
|
|
505
|
-
idField: "id",
|
|
506
|
-
childrenField: "items",
|
|
507
|
-
avatarField: "avatar",
|
|
508
|
-
titleField: "title",
|
|
509
|
-
subtitleField: "subtitle",
|
|
510
|
-
expandField: "expanded"
|
|
511
|
-
}, {
|
|
512
|
-
id: o,
|
|
513
|
-
width: i,
|
|
514
|
-
data: e,
|
|
515
|
-
groupField: n,
|
|
516
|
-
cardWidth: r,
|
|
517
|
-
cardHeight: a,
|
|
518
|
-
verticalLine: c,
|
|
519
|
-
idField: m,
|
|
520
|
-
childrenField: d,
|
|
521
|
-
hasChildrenField: g,
|
|
522
|
-
expandField: f,
|
|
523
|
-
avatarField: u,
|
|
524
|
-
titleField: k,
|
|
525
|
-
subtitleField: b,
|
|
526
|
-
ariaLabel: I,
|
|
527
|
-
itemRender: H,
|
|
528
|
-
height: D
|
|
529
|
-
} = { ...t, ...s }, E = [{
|
|
530
|
-
items: e,
|
|
531
|
-
level: 0,
|
|
532
|
-
hasChildren: !0,
|
|
533
|
-
orientation: "horizontal",
|
|
534
|
-
ids: [0],
|
|
535
|
-
parentId: null,
|
|
536
|
-
width: null
|
|
537
|
-
}];
|
|
538
|
-
be({
|
|
539
|
-
dataByGroups: E,
|
|
540
|
-
data: e,
|
|
541
|
-
cardWidth: r,
|
|
542
|
-
expandField: f,
|
|
543
|
-
hasChildrenField: g,
|
|
544
|
-
childrenField: d,
|
|
545
|
-
idField: m,
|
|
546
|
-
groupField: n
|
|
547
|
-
}), Et(E, r), xt(E, d, m), bt(E, a, c);
|
|
548
|
-
const G = It(E, a, c);
|
|
549
|
-
return /* @__PURE__ */ l.createElement("div", { className: "k-orgchart-container", style: { width: i, height: D || G } }, E.map((y) => {
|
|
550
|
-
const x = y.level, B = y.items, O = x === 0 ? "center" : "around", z = y.orientation;
|
|
551
|
-
return /* @__PURE__ */ l.createElement(
|
|
552
|
-
"div",
|
|
553
|
-
{
|
|
554
|
-
role: x === 0 ? "tree" : "group",
|
|
555
|
-
id: o + "-" + x + "-" + y.ids[0],
|
|
556
|
-
"aria-label": x === 0 ? I : void 0,
|
|
557
|
-
"aria-orientation": x === 0 ? z : void 0,
|
|
558
|
-
key: y.ids[0] + "_" + x,
|
|
559
|
-
className: _(
|
|
560
|
-
"k-orgchart-group",
|
|
561
|
-
`k-orgchart-level-${x}`,
|
|
562
|
-
"k-pos-absolute",
|
|
563
|
-
{
|
|
564
|
-
[`k-${te.orientationMap[z]}`]: z,
|
|
565
|
-
[`k-justify-content-${O}`]: O
|
|
566
|
-
}
|
|
567
|
-
),
|
|
568
|
-
style: {
|
|
569
|
-
width: y.width || "100%",
|
|
570
|
-
left: y.left,
|
|
571
|
-
top: y.top
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
B.length > 0 && /* @__PURE__ */ l.createElement(
|
|
575
|
-
"div",
|
|
576
|
-
{
|
|
577
|
-
role: "group",
|
|
578
|
-
style: { width: "100%" },
|
|
579
|
-
className: _(
|
|
580
|
-
"k-orgchart-node-container",
|
|
581
|
-
"k-justify-content-around",
|
|
582
|
-
{
|
|
583
|
-
[`k-${te.orientationMap[y.orientation]}`]: y.orientation
|
|
584
|
-
}
|
|
585
|
-
)
|
|
586
|
-
},
|
|
587
|
-
B.map((C, L) => {
|
|
588
|
-
const W = C[d] && C[d].length || g && C[g], $ = W || y.orientation === "vertical" && L !== B.length - 1, V = y.orientation === "vertical" && L !== 0 ? 0 : c || R, U = y.childLineWidths ? Math.max(...y.childLineWidths) : void 0, X = C[f];
|
|
589
|
-
return /* @__PURE__ */ l.createElement(
|
|
590
|
-
xe,
|
|
591
|
-
{
|
|
592
|
-
id: o + "-" + (x + 1) + "-" + C[m],
|
|
593
|
-
style: { width: U },
|
|
594
|
-
itemRender: H,
|
|
595
|
-
cardHeight: a,
|
|
596
|
-
cardWidth: r,
|
|
597
|
-
verticalLine: V,
|
|
598
|
-
key: L,
|
|
599
|
-
level: x,
|
|
600
|
-
avatar: C[u],
|
|
601
|
-
title: C[k],
|
|
602
|
-
subtitle: C[b],
|
|
603
|
-
line: $,
|
|
604
|
-
expanded: X,
|
|
605
|
-
node: C,
|
|
606
|
-
childLineWidth: W && X && y.orientation === "horizontal" ? y.childLineWidths[L] : 0,
|
|
607
|
-
plus: W
|
|
608
|
-
},
|
|
609
|
-
C.text
|
|
610
|
-
);
|
|
611
|
-
})
|
|
612
|
-
)
|
|
613
|
-
);
|
|
614
|
-
}));
|
|
615
|
-
};
|
|
616
|
-
Ie.displayName = "KendoServerOrgChart";
|
|
617
|
-
const yt = {
|
|
618
|
-
name: "@progress/kendo-react-orgchart",
|
|
619
|
-
productName: "KendoReact",
|
|
620
|
-
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
621
|
-
publishDate: 1709632292,
|
|
622
|
-
version: "",
|
|
623
|
-
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"
|
|
624
|
-
}, Ft = (s) => {
|
|
625
|
-
const { nodes: t, children: o, style: i, ...e } = s, [n, r] = l.useState(!1), a = l.useContext(Y), c = l.useRef(null), m = (u) => {
|
|
626
|
-
a.onKeyDown && a.onKeyDown({
|
|
627
|
-
event: u,
|
|
628
|
-
items: t
|
|
629
|
-
});
|
|
630
|
-
}, d = (u) => {
|
|
631
|
-
a.onGroupAction && a.onGroupAction({
|
|
632
|
-
event: u,
|
|
633
|
-
items: t
|
|
634
|
-
});
|
|
635
|
-
}, g = (u) => {
|
|
636
|
-
r(!0), a.onGroupFocus && a.onGroupFocus({
|
|
637
|
-
event: u,
|
|
638
|
-
items: t,
|
|
639
|
-
containerRef: c
|
|
640
|
-
});
|
|
641
|
-
}, f = (u) => {
|
|
642
|
-
r(!1), a.onGroupBlur && a.onGroupBlur({
|
|
643
|
-
event: u,
|
|
644
|
-
items: t
|
|
645
|
-
});
|
|
646
|
-
};
|
|
647
|
-
return /* @__PURE__ */ l.createElement(
|
|
648
|
-
"div",
|
|
649
|
-
{
|
|
650
|
-
role: "treeitem",
|
|
651
|
-
"aria-selected": n,
|
|
652
|
-
ref: c,
|
|
653
|
-
className: _(
|
|
654
|
-
"k-orgchart-node-group-container",
|
|
655
|
-
"k-vstack",
|
|
656
|
-
{ "k-focus": n }
|
|
657
|
-
),
|
|
658
|
-
style: i,
|
|
659
|
-
onKeyDown: m,
|
|
660
|
-
onClick: d,
|
|
661
|
-
onFocus: g,
|
|
662
|
-
onBlur: f,
|
|
663
|
-
...e
|
|
664
|
-
},
|
|
665
|
-
o
|
|
666
|
-
);
|
|
667
|
-
}, wt = "k-orgchart-node-group", ge = "k-orgchart-node-group-title", fe = "k-orgchart-node-group-subtitle", Lt = (s) => {
|
|
668
|
-
const t = {
|
|
669
|
-
orientation: "horizontal"
|
|
670
|
-
}, {
|
|
671
|
-
id: o,
|
|
672
|
-
title: i,
|
|
673
|
-
subtitle: e,
|
|
674
|
-
line: n,
|
|
675
|
-
plus: r,
|
|
676
|
-
focus: a,
|
|
677
|
-
level: c,
|
|
678
|
-
verticalLine: m,
|
|
679
|
-
childLineWidth: d,
|
|
680
|
-
orientation: g,
|
|
681
|
-
expanded: f,
|
|
682
|
-
nodes: u,
|
|
683
|
-
groupTitleHeight: k,
|
|
684
|
-
groupSubtitleHeight: b,
|
|
685
|
-
groupTitleRender: I,
|
|
686
|
-
groupSubtitleRender: H,
|
|
687
|
-
...D
|
|
688
|
-
} = { ...t, ...s }, E = I, G = H, y = { height: k || ne }, x = { height: b || ie };
|
|
689
|
-
return /* @__PURE__ */ l.createElement(
|
|
690
|
-
"div",
|
|
691
|
-
{
|
|
692
|
-
...D,
|
|
693
|
-
className: _(
|
|
694
|
-
s.className,
|
|
695
|
-
wt,
|
|
696
|
-
"k-vstack",
|
|
697
|
-
"k-align-items-center"
|
|
698
|
-
)
|
|
699
|
-
},
|
|
700
|
-
c !== 0 && /* @__PURE__ */ l.createElement(
|
|
701
|
-
"div",
|
|
702
|
-
{
|
|
703
|
-
className: "k-orgchart-line k-orgchart-line-v k-orgchart-line-v-top",
|
|
704
|
-
style: { height: m }
|
|
705
|
-
}
|
|
706
|
-
),
|
|
707
|
-
/* @__PURE__ */ l.createElement(
|
|
708
|
-
Ft,
|
|
709
|
-
{
|
|
710
|
-
nodes: u,
|
|
711
|
-
"aria-expanded": !!f,
|
|
712
|
-
"aria-keyshortcuts": "Enter",
|
|
713
|
-
"aria-level": c + 1,
|
|
714
|
-
"aria-owns": o
|
|
715
|
-
},
|
|
716
|
-
E ? /* @__PURE__ */ l.createElement(
|
|
717
|
-
E,
|
|
718
|
-
{
|
|
719
|
-
style: y,
|
|
720
|
-
className: ge,
|
|
721
|
-
title: i,
|
|
722
|
-
items: u,
|
|
723
|
-
level: c,
|
|
724
|
-
expanded: f
|
|
725
|
-
}
|
|
726
|
-
) : /* @__PURE__ */ l.createElement("div", { className: ge, style: y }, i),
|
|
727
|
-
G ? /* @__PURE__ */ l.createElement(
|
|
728
|
-
G,
|
|
729
|
-
{
|
|
730
|
-
style: x,
|
|
731
|
-
className: fe,
|
|
732
|
-
subtitle: e,
|
|
733
|
-
items: u,
|
|
734
|
-
level: c,
|
|
735
|
-
expanded: f
|
|
736
|
-
}
|
|
737
|
-
) : /* @__PURE__ */ l.createElement("div", { className: fe, style: x }, e),
|
|
738
|
-
/* @__PURE__ */ l.createElement(
|
|
739
|
-
"div",
|
|
740
|
-
{
|
|
741
|
-
role: "group",
|
|
742
|
-
style: { width: "100%" },
|
|
743
|
-
className: _(
|
|
744
|
-
"k-orgchart-node-container",
|
|
745
|
-
"k-justify-content-around",
|
|
746
|
-
{
|
|
747
|
-
[`k-${te.orientationMap[g] || g}`]: g
|
|
748
|
-
}
|
|
749
|
-
)
|
|
750
|
-
},
|
|
751
|
-
s.children
|
|
752
|
-
)
|
|
753
|
-
),
|
|
754
|
-
n && /* @__PURE__ */ l.createElement("div", { className: "k-orgchart-line k-orgchart-line-v" }),
|
|
755
|
-
r && /* @__PURE__ */ l.createElement(Ee, { expanded: f, nodes: u }),
|
|
756
|
-
r && !!d && /* @__PURE__ */ l.createElement(
|
|
757
|
-
"div",
|
|
758
|
-
{
|
|
759
|
-
className: "k-orgchart-line k-orgchart-line-h",
|
|
760
|
-
style: { width: d, marginTop: -15 }
|
|
761
|
-
}
|
|
762
|
-
)
|
|
763
|
-
);
|
|
764
|
-
}, ye = ({
|
|
765
|
-
dataByGroups: s,
|
|
766
|
-
data: t = [],
|
|
767
|
-
cardWidth: o,
|
|
768
|
-
childrenField: i,
|
|
769
|
-
idField: e,
|
|
770
|
-
expandField: n,
|
|
771
|
-
hasChildrenField: r,
|
|
772
|
-
groupField: a,
|
|
773
|
-
level: c = 1,
|
|
774
|
-
parentId: m = 0
|
|
775
|
-
}) => {
|
|
776
|
-
t.forEach((d) => {
|
|
777
|
-
const g = d[i];
|
|
778
|
-
if (d[n] && g && g.length) {
|
|
779
|
-
const u = g.some((E) => E[i] && E[i].length || r && E[r]), k = u ? "horizontal" : "vertical", b = u ? null : o + 2 * T, I = s.find((E) => E.parentId === m), H = s.find((E) => E.ids.includes(m));
|
|
780
|
-
let D = !1;
|
|
781
|
-
if (I) {
|
|
782
|
-
const E = I.ids[0], G = H.items.find((x) => x[e] === E), y = H.items.find((x) => x[e] === d[e]);
|
|
783
|
-
D = G[a] === y[a];
|
|
784
|
-
}
|
|
785
|
-
I && D ? (I.ids.push(d[e]), I.items = I.items.concat(g)) : s.push({
|
|
786
|
-
ids: [d[e]],
|
|
787
|
-
items: g,
|
|
788
|
-
level: c,
|
|
789
|
-
parentId: m,
|
|
790
|
-
hasChildren: u,
|
|
791
|
-
orientation: k,
|
|
792
|
-
width: b
|
|
793
|
-
}), ye({
|
|
794
|
-
dataByGroups: s,
|
|
795
|
-
data: d[i],
|
|
796
|
-
childrenField: i,
|
|
797
|
-
cardWidth: o,
|
|
798
|
-
idField: e,
|
|
799
|
-
expandField: n,
|
|
800
|
-
hasChildrenField: r,
|
|
801
|
-
groupField: a,
|
|
802
|
-
level: c + 1,
|
|
803
|
-
parentId: d[e]
|
|
804
|
-
});
|
|
805
|
-
}
|
|
806
|
-
});
|
|
807
|
-
}, Nt = (s, t) => {
|
|
808
|
-
const o = t || Ce, i = s.sort((e, n) => n.level - e.level);
|
|
809
|
-
i.forEach((e) => {
|
|
810
|
-
if (!e.width) {
|
|
811
|
-
const n = i.filter((r) => e.ids.includes(r.parentId));
|
|
812
|
-
if (n.length) {
|
|
813
|
-
const r = Math.max(...n.map((d) => d.width || 0)), a = Math.max(...n.map((d) => d.groupedItems.length || 0)), c = Math.max(...e.groupedItems.map((d) => {
|
|
814
|
-
const g = e.orientation === "horizontal" ? d.items.length : 1;
|
|
815
|
-
return g * (o + 2 * T) + T * (g - 1);
|
|
816
|
-
})), m = r * a + T * (a - 1);
|
|
817
|
-
e.width = Math.max(m, c);
|
|
818
|
-
} else {
|
|
819
|
-
const r = Math.max(...e.groupedItems.map((a) => {
|
|
820
|
-
const c = e.orientation === "horizontal" ? a.items.length : 1;
|
|
821
|
-
return c * (o + 2 * T) + T * (c - 1);
|
|
822
|
-
}));
|
|
823
|
-
e.width = r;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
});
|
|
827
|
-
}, Tt = (s, t) => {
|
|
828
|
-
const o = s.sort((i, e) => i.level - e.level);
|
|
829
|
-
o.forEach((i) => {
|
|
830
|
-
var g;
|
|
831
|
-
if (i.level === 0)
|
|
832
|
-
return;
|
|
833
|
-
const e = o.find((f) => f.ids.includes(i.parentId)), n = (e == null ? void 0 : e.groupedItems.findIndex((f) => f.items.some((u) => i.ids.includes(u[t])))) || 0, r = (e == null ? void 0 : e.groupedItems) || [], a = e.width ? (e.width - (r.length - 1) * T) / r.length : 0;
|
|
834
|
-
if (!i.left) {
|
|
835
|
-
let f = (e == null ? void 0 : e.left) || 0;
|
|
836
|
-
r.forEach((u, k) => {
|
|
837
|
-
k < n && (f += a + T);
|
|
838
|
-
}), i.left = f;
|
|
839
|
-
}
|
|
840
|
-
const c = (e == null ? void 0 : e.width) || 0, m = (e == null ? void 0 : e.groupedItems.length) || 1, d = (c - (m - 1) * T) / m;
|
|
841
|
-
if (i.width = d, e) {
|
|
842
|
-
const f = i.width - (i.width - (i.groupedItems.length - 1) * T) / i.groupedItems.length;
|
|
843
|
-
e.childLineWidths ? (g = e.childLineWidths) == null || g.push(f) : e.childLineWidths = [f];
|
|
844
|
-
}
|
|
845
|
-
});
|
|
846
|
-
}, At = (s, t, o, i, e) => {
|
|
847
|
-
const n = t || q, r = e || R, a = o + i + ke;
|
|
848
|
-
s.forEach((c) => {
|
|
849
|
-
const m = c.level, d = (n + r + a) * m + R * (m ? m - 1 : 0) - (r - R) * (m ? 1 : 0);
|
|
850
|
-
c.top = d;
|
|
851
|
-
});
|
|
852
|
-
}, Ht = (s, t, o, i, e) => {
|
|
853
|
-
const n = t || q, r = o || R, c = (i || ne) + (e || ie) + ke;
|
|
854
|
-
return Math.max(...s.map((d) => {
|
|
855
|
-
const g = d.top || 0, f = Math.max(...d.groupedItems.map((b) => b.items.length)), u = d.hasChildren ? R : 0, k = d.orientation === "horizontal" ? n + r + c + r + u : f * (n + r) + c + r;
|
|
856
|
-
return g + k;
|
|
857
|
-
}));
|
|
858
|
-
}, Fe = (s) => {
|
|
859
|
-
const t = {
|
|
860
|
-
width: "100%",
|
|
861
|
-
data: [],
|
|
862
|
-
ariaLabel: "Org Chart",
|
|
863
|
-
idField: "id",
|
|
864
|
-
childrenField: "items",
|
|
865
|
-
avatarField: "avatar",
|
|
866
|
-
titleField: "title",
|
|
867
|
-
subtitleField: "subtitle",
|
|
868
|
-
expandField: "expanded",
|
|
869
|
-
orientation: "horizontal"
|
|
870
|
-
}, {
|
|
871
|
-
id: o,
|
|
872
|
-
width: i,
|
|
873
|
-
data: e,
|
|
874
|
-
groupField: n,
|
|
875
|
-
cardWidth: r,
|
|
876
|
-
cardHeight: a,
|
|
877
|
-
groupTitleHeight: c,
|
|
878
|
-
groupSubtitleHeight: m,
|
|
879
|
-
verticalLine: d,
|
|
880
|
-
idField: g,
|
|
881
|
-
childrenField: f,
|
|
882
|
-
expandField: u,
|
|
883
|
-
hasChildrenField: k,
|
|
884
|
-
avatarField: b,
|
|
885
|
-
titleField: I,
|
|
886
|
-
subtitleField: H,
|
|
887
|
-
cardsColors: D,
|
|
888
|
-
ariaLabel: E,
|
|
889
|
-
itemRender: G,
|
|
890
|
-
groupTitleRender: y,
|
|
891
|
-
groupSubtitleRender: x,
|
|
892
|
-
height: B
|
|
893
|
-
} = { ...t, ...s }, O = [{
|
|
894
|
-
items: e,
|
|
895
|
-
level: 0,
|
|
896
|
-
hasChildren: !0,
|
|
897
|
-
orientation: "horizontal",
|
|
898
|
-
ids: [0],
|
|
899
|
-
parentId: null,
|
|
900
|
-
width: null
|
|
901
|
-
}];
|
|
902
|
-
ye({
|
|
903
|
-
dataByGroups: O,
|
|
904
|
-
data: e,
|
|
905
|
-
cardWidth: r,
|
|
906
|
-
expandField: u,
|
|
907
|
-
hasChildrenField: k,
|
|
908
|
-
childrenField: f,
|
|
909
|
-
idField: g,
|
|
910
|
-
groupField: n
|
|
911
|
-
}), O.map((C) => {
|
|
912
|
-
C.groupedItems = ot(C.items, [{ field: n }]);
|
|
913
|
-
}), Nt(O, r), Tt(O, g), At(
|
|
914
|
-
O,
|
|
915
|
-
a || q,
|
|
916
|
-
c || ne,
|
|
917
|
-
m || ie,
|
|
918
|
-
d
|
|
919
|
-
);
|
|
920
|
-
const z = Ht(
|
|
921
|
-
O,
|
|
922
|
-
a || q,
|
|
923
|
-
c || ne,
|
|
924
|
-
m || ie
|
|
925
|
-
);
|
|
926
|
-
return /* @__PURE__ */ l.createElement("div", { className: "k-orgchart-container", style: { width: i, height: B || z } }, O.map((C) => {
|
|
927
|
-
const L = C.level, W = C.groupedItems.map((A) => {
|
|
928
|
-
const ee = A.items.some((j) => j[u]);
|
|
929
|
-
return {
|
|
930
|
-
...A,
|
|
931
|
-
expanded: ee
|
|
932
|
-
};
|
|
933
|
-
}), $ = W.filter((A) => A.expanded), V = L === 0 ? "center" : "around", U = "horizontal", X = D && D[L] || "green";
|
|
934
|
-
return /* @__PURE__ */ l.createElement(
|
|
935
|
-
"div",
|
|
936
|
-
{
|
|
937
|
-
role: L === 0 ? "tree" : "group",
|
|
938
|
-
id: o + "-" + L + "-" + C.ids[0],
|
|
939
|
-
"aria-label": L === 0 ? E : void 0,
|
|
940
|
-
"aria-orientation": L === 0 ? U : void 0,
|
|
941
|
-
key: C.ids[0] + "_" + L,
|
|
942
|
-
className: _(
|
|
943
|
-
"k-orgchart-group",
|
|
944
|
-
`k-orgchart-level-${L}`,
|
|
945
|
-
"k-pos-absolute",
|
|
946
|
-
{
|
|
947
|
-
[`k-${te.orientationMap[U]}`]: U,
|
|
948
|
-
[`k-justify-content-${V}`]: V,
|
|
949
|
-
"k-orgchart-group-h": s.groupField
|
|
950
|
-
}
|
|
951
|
-
),
|
|
952
|
-
style: {
|
|
953
|
-
width: C.width || "100%",
|
|
954
|
-
left: C.left,
|
|
955
|
-
top: C.top
|
|
956
|
-
}
|
|
957
|
-
},
|
|
958
|
-
e.length > 0 && W.map((A, ee) => {
|
|
959
|
-
const j = A.items.some((w) => w[f] && w[f].length || k && w[k]), oe = C.width ? (C.width - (W.length - 1) * T) / W.length : void 0, Z = $.findIndex((w) => w === A);
|
|
960
|
-
return /* @__PURE__ */ l.createElement(
|
|
961
|
-
Lt,
|
|
962
|
-
{
|
|
963
|
-
id: o + "-" + (L + 1) + "-" + A.items[0][g],
|
|
964
|
-
style: { width: oe },
|
|
965
|
-
groupTitleHeight: c,
|
|
966
|
-
groupSubtitleHeight: m,
|
|
967
|
-
groupTitleRender: y,
|
|
968
|
-
groupSubtitleRender: x,
|
|
969
|
-
key: ee,
|
|
970
|
-
level: L,
|
|
971
|
-
verticalLine: d || R,
|
|
972
|
-
title: A.items[0][n || I],
|
|
973
|
-
subtitle: n,
|
|
974
|
-
orientation: C.orientation,
|
|
975
|
-
childLineWidth: j && A.expanded && C.orientation === "horizontal" ? C.childLineWidths[Z] : 0,
|
|
976
|
-
line: j,
|
|
977
|
-
nodes: A.items,
|
|
978
|
-
expanded: A.expanded,
|
|
979
|
-
plus: j
|
|
980
|
-
},
|
|
981
|
-
A.items.map((w, se) => /* @__PURE__ */ l.createElement(
|
|
982
|
-
xe,
|
|
983
|
-
{
|
|
984
|
-
cardHeight: a,
|
|
985
|
-
cardWidth: r,
|
|
986
|
-
itemRender: G,
|
|
987
|
-
color: X,
|
|
988
|
-
key: se,
|
|
989
|
-
level: L,
|
|
990
|
-
avatar: w[b],
|
|
991
|
-
title: w[I],
|
|
992
|
-
subtitle: w[H],
|
|
993
|
-
verticalLine: 0,
|
|
994
|
-
line: !1,
|
|
995
|
-
node: w,
|
|
996
|
-
childLineWidth: 0,
|
|
997
|
-
plus: !1
|
|
998
|
-
},
|
|
999
|
-
w.text
|
|
1000
|
-
))
|
|
1001
|
-
);
|
|
1002
|
-
})
|
|
1003
|
-
);
|
|
1004
|
-
}));
|
|
1005
|
-
};
|
|
1006
|
-
Fe.displayName = "KendoServerGroupedOrgChart";
|
|
1007
|
-
const we = (s) => {
|
|
1008
|
-
const t = {
|
|
1009
|
-
tabIndex: 0,
|
|
1010
|
-
navigatable: !0,
|
|
1011
|
-
expandField: "expanded",
|
|
1012
|
-
ariaLabel: "Org Chart",
|
|
1013
|
-
idField: "id",
|
|
1014
|
-
childrenField: "items",
|
|
1015
|
-
avatarField: "avatar",
|
|
1016
|
-
titleField: "title",
|
|
1017
|
-
subtitleField: "subtitle",
|
|
1018
|
-
...s
|
|
1019
|
-
}, {
|
|
1020
|
-
cardsColors: o,
|
|
1021
|
-
onExpandChange: i,
|
|
1022
|
-
onKeyDown: e,
|
|
1023
|
-
onItemAction: n,
|
|
1024
|
-
onGroupAction: r,
|
|
1025
|
-
onGroupBlur: a,
|
|
1026
|
-
onGroupFocus: c,
|
|
1027
|
-
id: m,
|
|
1028
|
-
...d
|
|
1029
|
-
} = t, g = l.useRef(je());
|
|
1030
|
-
return qe(yt), /* @__PURE__ */ l.createElement(de, { ...t }, s.groupField ? /* @__PURE__ */ l.createElement(
|
|
1031
|
-
Fe,
|
|
1032
|
-
{
|
|
1033
|
-
id: m || g.current,
|
|
1034
|
-
...d
|
|
1035
|
-
},
|
|
1036
|
-
s.children
|
|
1037
|
-
) : /* @__PURE__ */ l.createElement(
|
|
1038
|
-
Ie,
|
|
1039
|
-
{
|
|
1040
|
-
id: m || g.current,
|
|
1041
|
-
...d
|
|
1042
|
-
},
|
|
1043
|
-
s.children
|
|
1044
|
-
));
|
|
1045
|
-
};
|
|
1046
|
-
we.propTypes = {
|
|
1047
|
-
className: h.string,
|
|
1048
|
-
style: h.object,
|
|
1049
|
-
id: h.string,
|
|
1050
|
-
ariaLabel: h.string,
|
|
1051
|
-
idField: h.string,
|
|
1052
|
-
childrenField: h.string,
|
|
1053
|
-
expandField: h.string,
|
|
1054
|
-
titleField: h.string,
|
|
1055
|
-
hasChildrenField: h.string,
|
|
1056
|
-
subtitleField: h.string,
|
|
1057
|
-
avatarField: h.string,
|
|
1058
|
-
cardsColors: h.array,
|
|
1059
|
-
data: h.array,
|
|
1060
|
-
groupField: h.string,
|
|
1061
|
-
cardHeight: h.number,
|
|
1062
|
-
cardWidth: h.number,
|
|
1063
|
-
groupTitleHeight: h.number,
|
|
1064
|
-
groupSubtitleHeight: h.number,
|
|
1065
|
-
verticalLine: h.number,
|
|
1066
|
-
height: h.oneOfType([h.string, h.number]),
|
|
1067
|
-
onExpandChange: h.func,
|
|
1068
|
-
onItemAction: h.func,
|
|
1069
|
-
onGroupAction: h.func
|
|
1070
|
-
};
|
|
1071
|
-
we.displayName = "KendoOrgChart";
|
|
1072
|
-
function Pt(s, t) {
|
|
1073
|
-
if (!s || !s.length)
|
|
1074
|
-
return [];
|
|
1075
|
-
let o = s;
|
|
1076
|
-
const i = t.cloneField || "cloned", e = t.expandField || ut, n = t.selectField || gt, r = t.checkField || pe, a = t.childrenField || mt;
|
|
1077
|
-
return o = ae(o, e, t.expand, i, a), o = ae(o, n, t.select, i, a), o = ae(o, r, t.check, i, a), Dt(o, a, t.check), o;
|
|
1078
|
-
}
|
|
1079
|
-
function ae(s, t, o, i, e) {
|
|
1080
|
-
if (o) {
|
|
1081
|
-
const { ids: n, field: r } = Le(o, t), a = !ce(o) && o.idField ? Ve(n, o.idField, s, e) : n;
|
|
1082
|
-
return St(s, a, r, i, e);
|
|
1083
|
-
} else
|
|
1084
|
-
return s;
|
|
1085
|
-
}
|
|
1086
|
-
function Le(s, t) {
|
|
1087
|
-
let o, i;
|
|
1088
|
-
return ce(s) ? (o = s, i = t) : (o = s.ids || [], i = s.operationField || t), { ids: o, field: i };
|
|
1089
|
-
}
|
|
1090
|
-
function St(s, t, o, i, e) {
|
|
1091
|
-
let n = s;
|
|
1092
|
-
return t.forEach((r) => {
|
|
1093
|
-
n = Xe(n, r, (a) => Ne(o, a), i, e);
|
|
1094
|
-
}), n;
|
|
1095
|
-
}
|
|
1096
|
-
function Ne(s, t) {
|
|
1097
|
-
const o = (s || "").split(".");
|
|
1098
|
-
let i = t;
|
|
1099
|
-
for (let e = 0; e < o.length; e++) {
|
|
1100
|
-
const n = o[e];
|
|
1101
|
-
if (e === o.length - 1)
|
|
1102
|
-
i[n] = !0;
|
|
1103
|
-
else if (i[n] !== void 0)
|
|
1104
|
-
i[n] = { ...i[n] }, i = i[n];
|
|
1105
|
-
else
|
|
1106
|
-
return;
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
function Dt(s, t, o) {
|
|
1110
|
-
if (o && !ce(o) && o.applyCheckIndeterminate) {
|
|
1111
|
-
const { field: i } = Le(o, pe), e = o.checkIndeterminateField || ft;
|
|
1112
|
-
for (let n = 0; n < s.length; n++) {
|
|
1113
|
-
const r = s[n], a = r[t];
|
|
1114
|
-
a && le(
|
|
1115
|
-
a,
|
|
1116
|
-
ve(i, r) ? [] : [r],
|
|
1117
|
-
t,
|
|
1118
|
-
i,
|
|
1119
|
-
e
|
|
1120
|
-
);
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
function le(s, t, o, i, e) {
|
|
1125
|
-
let n = !1;
|
|
1126
|
-
for (let r = 0; r < s.length; r++) {
|
|
1127
|
-
const a = s[r];
|
|
1128
|
-
if (ve(i, a)) {
|
|
1129
|
-
if (!n)
|
|
1130
|
-
for (let c = 0; c < t.length; c++)
|
|
1131
|
-
Ne(e, t[c]);
|
|
1132
|
-
n = !0, a[o] && le(a[o], [], o, i, e);
|
|
1133
|
-
} else
|
|
1134
|
-
a[o] && le(
|
|
1135
|
-
a[o],
|
|
1136
|
-
n ? [a] : t.concat([a]),
|
|
1137
|
-
o,
|
|
1138
|
-
i,
|
|
1139
|
-
e
|
|
1140
|
-
);
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
9
|
+
import { ServerOrgChart as o } from "./server/ServerOrgChart.mjs";
|
|
10
|
+
import { OrgChart as p } from "./OrgChart.mjs";
|
|
11
|
+
import { processOrgChartItems as a } from "./processOrgChartItems.mjs";
|
|
12
|
+
import { ServerOrgChartNode as g } from "./server/ServerOrgChartNode.mjs";
|
|
13
|
+
import { ServerOrgChartGroup as x } from "./server/ServerOrgChartGroup.mjs";
|
|
1143
14
|
export {
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
15
|
+
p as OrgChart,
|
|
16
|
+
o as ServerOrgChart,
|
|
17
|
+
x as ServerOrgChartGroup,
|
|
18
|
+
g as ServerOrgChartNode,
|
|
19
|
+
a as processOrgChartItems
|
|
1149
20
|
};
|