@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.
Files changed (53) hide show
  1. package/OrgChart.js +8 -0
  2. package/OrgChart.mjs +83 -0
  3. package/client/ClientOrgChart.js +8 -0
  4. package/client/ClientOrgChart.mjs +236 -0
  5. package/client/ExpandButton.js +8 -0
  6. package/client/ExpandButton.mjs +36 -0
  7. package/client/OrgChartCard.js +8 -0
  8. package/client/OrgChartCard.mjs +59 -0
  9. package/client/OrgChartCardBody.js +8 -0
  10. package/client/OrgChartCardBody.mjs +18 -0
  11. package/client/OrgChartGroupContainer.js +8 -0
  12. package/client/OrgChartGroupContainer.mjs +58 -0
  13. package/dist/cdn/js/kendo-react-orgchart.js +8 -18
  14. package/index.d.mts +520 -5
  15. package/index.d.ts +520 -12
  16. package/index.js +8 -18
  17. package/index.mjs +17 -1146
  18. package/package-metadata.js +8 -0
  19. package/package-metadata.mjs +19 -0
  20. package/package.json +4 -4
  21. package/processOrgChartItems.js +8 -0
  22. package/processOrgChartItems.mjs +84 -0
  23. package/server/ServerGroupedOrgChart.js +8 -0
  24. package/server/ServerGroupedOrgChart.mjs +260 -0
  25. package/server/ServerOrgChart.js +8 -0
  26. package/server/ServerOrgChart.mjs +210 -0
  27. package/server/ServerOrgChartGroup.js +8 -0
  28. package/server/ServerOrgChartGroup.mjs +114 -0
  29. package/server/ServerOrgChartNode.js +8 -0
  30. package/server/ServerOrgChartNode.mjs +95 -0
  31. package/theming/theme-service.js +21 -0
  32. package/theming/theme-service.mjs +60 -0
  33. package/utils/consts.js +8 -0
  34. package/utils/consts.mjs +24 -0
  35. package/OrgChart.d.ts +0 -10
  36. package/OrgChartOperationDescriptors.d.ts +0 -80
  37. package/client/ClientOrgChart.d.ts +0 -98
  38. package/client/ExpandButton.d.ts +0 -17
  39. package/client/OrgChartCard.d.ts +0 -23
  40. package/client/OrgChartCardBody.d.ts +0 -16
  41. package/client/OrgChartGroupContainer.d.ts +0 -23
  42. package/interfaces/ChildGroup.d.ts +0 -20
  43. package/interfaces/OrgChartActionEvent.d.ts +0 -25
  44. package/interfaces/OrgChartExpandChangeEvent.d.ts +0 -25
  45. package/interfaces/SeverOrgChartProps.d.ts +0 -109
  46. package/package-metadata.d.ts +0 -9
  47. package/processOrgChartItems.d.ts +0 -55
  48. package/server/ServerGroupedOrgChart.d.ts +0 -12
  49. package/server/ServerOrgChart.d.ts +0 -12
  50. package/server/ServerOrgChartGroup.d.ts +0 -100
  51. package/server/ServerOrgChartNode.d.ts +0 -79
  52. package/theming/theme-service.d.ts +0 -9
  53. package/utils/consts.d.ts +0 -76
package/index.d.ts CHANGED
@@ -1,12 +1,520 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export { ServerOrgChart } from './server/ServerOrgChart';
6
- export { type ServerOrgChartProps } from './interfaces/SeverOrgChartProps';
7
- export * from './OrgChart';
8
- export { type OrgChartExpandChangeEvent } from './interfaces/OrgChartExpandChangeEvent';
9
- export { type OrgChartActionEvent } from './interfaces/OrgChartActionEvent';
10
- export * from './processOrgChartItems';
11
- export * from './server/ServerOrgChartNode';
12
- export * from './server/ServerOrgChartGroup';
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
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
9
+ import * as React_2 from 'react';
10
+
11
+ /**
12
+ * Represents the OrgChart component.
13
+ */
14
+ export declare const OrgChart: React_2.FunctionComponent<OrgChartProps>;
15
+
16
+ /**
17
+ * Represents the OrgChartActionEvent event argument.
18
+ */
19
+ export declare interface OrgChartActionEvent {
20
+ /**
21
+ * Represents the triggered React event.
22
+ */
23
+ event: React.KeyboardEvent | React.MouseEvent | React.FocusEvent;
24
+ /**
25
+ * Item that triggers the event.
26
+ */
27
+ item?: any;
28
+ /**
29
+ * Items that belong to the group that triggers the event.
30
+ */
31
+ items?: any;
32
+ /**
33
+ * @hidden
34
+ */
35
+ containerRef?: React.RefObject<HTMLDivElement>;
36
+ }
37
+
38
+ /**
39
+ * The descriptor which is used for checking.
40
+ */
41
+ declare interface OrgChartCheckDescriptor extends OrgChartOperationDescriptor {
42
+ /**
43
+ * Determines if a parent item will have an indeterminate state when not all its children are checked.
44
+ */
45
+ applyCheckIndeterminate?: boolean;
46
+ /**
47
+ * The name of the field which will provide a Boolean representation for the indeterminate state of a parent item.
48
+ * Defaults to `checkIndeterminate`.
49
+ */
50
+ checkIndeterminateField?: string;
51
+ }
52
+
53
+ /**
54
+ * Represents the OrgChartExpandChangeEvent event argument.
55
+ */
56
+ export declare interface OrgChartExpandChangeEvent {
57
+ /**
58
+ * Represents the triggered React event.
59
+ */
60
+ event: React.MouseEvent | React.KeyboardEvent;
61
+ /**
62
+ * Represents expand value of the item or group.
63
+ */
64
+ expand: boolean;
65
+ /**
66
+ * Item that triggers the event.
67
+ */
68
+ item?: any;
69
+ /**
70
+ * Items that belong to the group that triggers the event.
71
+ */
72
+ items?: any[];
73
+ }
74
+
75
+ /**
76
+ * @hidden
77
+ */
78
+ export declare interface OrgChartGroupSubtitleProps {
79
+ /**
80
+ * The styles that are applied to the OrgChart.
81
+ */
82
+ style?: React_2.CSSProperties;
83
+ /**
84
+ * The default class that is applied to the OrgChart group title.
85
+ */
86
+ className?: string;
87
+ /**
88
+ * The default subtitle that are passed to the OrgChart group.
89
+ */
90
+ subtitle?: string;
91
+ /**
92
+ * The collection of inner items of the group.
93
+ */
94
+ items?: any[];
95
+ /**
96
+ * The level of the group.
97
+ */
98
+ level?: number;
99
+ /**
100
+ * The expanded state of the group.
101
+ */
102
+ expanded?: boolean;
103
+ }
104
+
105
+ /**
106
+ * @hidden
107
+ */
108
+ export declare interface OrgChartGroupTitleProps {
109
+ /**
110
+ * The styles that are applied to the OrgChart group title.
111
+ */
112
+ style?: React_2.CSSProperties;
113
+ /**
114
+ * The default class that is applied to the OrgChart group title.
115
+ */
116
+ className?: string;
117
+ /**
118
+ * The default title that are passed to the OrgChart group.
119
+ */
120
+ title?: string;
121
+ /**
122
+ * The collection of inner items of the group.
123
+ */
124
+ items?: any[];
125
+ /**
126
+ * The level of the group.
127
+ */
128
+ level?: number;
129
+ /**
130
+ * The expanded state of the group.
131
+ */
132
+ expanded?: boolean;
133
+ }
134
+
135
+ /**
136
+ * The props that are passed to the itemRender component.
137
+ */
138
+ export declare interface OrgChartItemRenderProps {
139
+ /**
140
+ * The item passed to the ItemRender.
141
+ */
142
+ item?: any;
143
+ /**
144
+ * The title of the item.
145
+ */
146
+ title?: string;
147
+ /**
148
+ * The subtitle of the item.
149
+ */
150
+ subtitle?: string;
151
+ /**
152
+ * The level of the item.
153
+ */
154
+ level?: number;
155
+ /**
156
+ * The expanded state of the item.
157
+ */
158
+ expanded?: boolean;
159
+ /**
160
+ * The color of the item.
161
+ */
162
+ color?: string;
163
+ }
164
+
165
+ /**
166
+ * The descriptor which is used for expanding, selecting, and checking.
167
+ */
168
+ declare interface OrgChartOperationDescriptor {
169
+ /**
170
+ * The IDs of the items to which the operation will be applied. By default, the OrgChart applies the hierarchical indices of the items. These indices are zero-based. The first root item has a `0` (zero) index. If the first root item has children, the first child acquires a `0_0` index and the second acquires a `0_1` index.
171
+ */
172
+ ids?: any[];
173
+ /**
174
+ * The name of the field which will provide a Boolean representation for the operation state of the item.
175
+ *
176
+ * The default fields are:
177
+ * * `expanded`&mdash;Indicates that an item is expanded.
178
+ * * `selected`&mdash;Indicates that an item is selected.
179
+ * * `checked`&mdash;Indicates that an item is checked.
180
+ */
181
+ operationField?: string;
182
+ /**
183
+ * The name of the field which will uniquely describe an item as an alternative to its hierarchical index.
184
+ */
185
+ idField?: string;
186
+ }
187
+
188
+ /**
189
+ * The descriptors of the data operations which are applied to the OrgChart component.
190
+ */
191
+ declare interface OrgChartOperationDescriptors {
192
+ /**
193
+ * The hierarchical indices of the items to which the expand operation will be applied, or the descriptor of the operation.
194
+ */
195
+ expand?: string[] | OrgChartOperationDescriptor;
196
+ /**
197
+ * The hierarchical indices of the items to which the select operation will be applied, or the descriptor of the operation.
198
+ */
199
+ select?: string[] | OrgChartOperationDescriptor;
200
+ /**
201
+ * The hierarchical indices of the items to which the check operation will be applied, or the descriptor of the operation.
202
+ */
203
+ check?: string[] | OrgChartCheckDescriptor;
204
+ /**
205
+ * When the operations are applied, the corresponding items and their parents are cloned.
206
+ * For performance reasons, OrgChart items are cloned only once.
207
+ * The name of the field which provides a Boolean representation of whether an item is already cloned.
208
+ * Defaults to `cloned`.
209
+ */
210
+ cloneField?: string;
211
+ /**
212
+ * The expand field of the item.
213
+ */
214
+ expandField?: string;
215
+ /**
216
+ * The select field of the item.
217
+ */
218
+ selectField?: string;
219
+ /**
220
+ * The check field of the item.
221
+ */
222
+ checkField?: string;
223
+ /**
224
+ * The children field of the item.
225
+ */
226
+ childrenField?: string;
227
+ }
228
+
229
+ /**
230
+ * Represents the props of the [KendoReact OrgChart component]({% slug overview_orgchart %}).
231
+ */
232
+ declare interface OrgChartProps extends ServerOrgChartProps {
233
+ /**
234
+ * Specifies if the OrgChart can be navigatable with keyboard.
235
+ * Defaults to `true`.
236
+ */
237
+ navigatable?: boolean;
238
+ /**
239
+ * Fires when a node or group is expanded.
240
+ */
241
+ onExpandChange?: (ev: OrgChartExpandChangeEvent) => void;
242
+ /**
243
+ * @hidden
244
+ */
245
+ onKeyDown?: (ev: OrgChartActionEvent) => void;
246
+ /**
247
+ * Triggers the item action event.
248
+ */
249
+ onItemAction?: (ev: OrgChartActionEvent) => void;
250
+ /**
251
+ * Triggers the item double click action event.
252
+ */
253
+ onItemDoubleClick?: (ev: OrgChartActionEvent) => void;
254
+ /**
255
+ * Triggers the item contextmenu action event.
256
+ */
257
+ onItemContextMenu?: (ev: OrgChartActionEvent) => void;
258
+ /**
259
+ * Triggers the group action event.
260
+ */
261
+ onGroupAction?: (ev: OrgChartActionEvent) => void;
262
+ /**
263
+ * @hidden
264
+ */
265
+ onGroupBlur?: (ev: OrgChartActionEvent) => void;
266
+ /**
267
+ * @hidden
268
+ */
269
+ onGroupFocus?: (ev: OrgChartActionEvent) => void;
270
+ }
271
+
272
+ /**
273
+ * A helper function which applies the specified operation descriptors to the data.
274
+ * * [Expanding and collapsing items]({% slug expansion_ways_treeview %}#toc-using-a-helper-function)
275
+ * * [Selecting and deselecting items]({% slug selection_ways_treeview %}#toc-using-a-helper-function)
276
+ * * [Checking and unchecking items]({% slug check_helper_funcs_treeview %})
277
+ *
278
+ * @param data - The data that will be processed.
279
+ * @param operations - The operation descriptors that will be applied to the data.
280
+ * @returns - The processed copy of the input data.
281
+ *
282
+ * @example
283
+ * ```jsx
284
+ * class App extends React.Component {
285
+ * state = { items: tree, expand: [], select: [], check: [] };
286
+ * render() {
287
+ * const { expand, select, check } = this.state;
288
+ * return (
289
+ * <OrgChart
290
+ * data={processOrgChartItems(this.state.items, { expand, select, check })}
291
+ * expandIcons={true} onExpandChange={this.onExpandChange} checkboxes={true}
292
+ * onCheckChange={event => this.setState({ check: [ event.itemHierarchicalIndex ] })}
293
+ * onItemClick={event => this.setState({ select: [ event.itemHierarchicalIndex ] })}
294
+ * />
295
+ * );
296
+ * }
297
+ * onExpandChange = (event) => {
298
+ * let expand = this.state.expand.slice();
299
+ * const index = expand.indexOf(event.itemHierarchicalIndex);
300
+ * index === -1 ? expand.push(event.itemHierarchicalIndex) : expand.splice(index, 1);
301
+ * this.setState({ expand });
302
+ * }
303
+ * }
304
+ *
305
+ * const tree = [{
306
+ * text: 'Item1',
307
+ * items: [
308
+ * { text: 'Item1.1' },
309
+ * { text: 'Item1.2' },
310
+ * { text: 'Item1.3', items: [{ text: 'Item1.3.1' }] }]
311
+ * }, {
312
+ * text: 'Item2', disabled: true,
313
+ * items: [{ text: 'Item2.1' }, { text: 'Item2.2' }, { text: 'Item2.3' }]
314
+ * }, {
315
+ * text: 'Item3'
316
+ * }];
317
+ *
318
+ * ReactDOM.render(<App />, document.querySelector('my-app'));
319
+ * ```
320
+ */
321
+ export declare function processOrgChartItems(data: any[] | null | undefined, operations: OrgChartOperationDescriptors): any[];
322
+
323
+ /**
324
+ * @hidden
325
+ */
326
+ export declare const ServerOrgChart: {
327
+ (props: ServerOrgChartProps): JSX_2.Element;
328
+ displayName: string;
329
+ };
330
+
331
+ /**
332
+ * @hidden
333
+ */
334
+ export declare const ServerOrgChartGroup: React_2.FunctionComponent<ServerOrgChartGroupProps>;
335
+
336
+ /**
337
+ * @hidden
338
+ */
339
+ export declare interface ServerOrgChartGroupProps {
340
+ /**
341
+ * @hidden
342
+ */
343
+ children?: React_2.ReactNode;
344
+ /**
345
+ * Sets additional classes to the OrgChart.
346
+ */
347
+ className?: string;
348
+ id?: string;
349
+ /**
350
+ * The styles that are applied to the OrgChart.
351
+ */
352
+ style?: React_2.CSSProperties;
353
+ title?: string;
354
+ subtitle?: string;
355
+ line?: boolean;
356
+ plus?: boolean;
357
+ focus?: boolean;
358
+ expanded?: boolean;
359
+ nodes?: any[];
360
+ level: number;
361
+ groupTitleHeight?: number;
362
+ groupSubtitleHeight?: number;
363
+ childLineWidth?: number;
364
+ verticalLine?: number;
365
+ orientation?: 'horizontal' | 'vertical';
366
+ groupTitleRender?: React_2.ComponentType<OrgChartGroupTitleProps>;
367
+ groupSubtitleRender?: React_2.ComponentType<OrgChartGroupSubtitleProps>;
368
+ }
369
+
370
+ /**
371
+ * @hidden
372
+ */
373
+ export declare const ServerOrgChartNode: React_2.FunctionComponent<ServerOrgChartNodeProps>;
374
+
375
+ /**
376
+ * @hidden
377
+ */
378
+ export declare interface ServerOrgChartNodeProps {
379
+ /**
380
+ * @hidden
381
+ */
382
+ children?: React_2.ReactNode;
383
+ /**
384
+ * Sets additional classes to the OrgChart.
385
+ */
386
+ className?: string;
387
+ /**
388
+ * Passes the OrgChart id to the node.
389
+ */
390
+ id?: string;
391
+ /**
392
+ * The styles that are applied to the OrgChart.
393
+ */
394
+ style?: React_2.CSSProperties;
395
+ level: number;
396
+ childLineWidth?: number;
397
+ title?: string;
398
+ subtitle?: string;
399
+ details?: boolean;
400
+ color?: string;
401
+ line?: boolean;
402
+ plus?: boolean;
403
+ expanded?: boolean;
404
+ avatar?: string;
405
+ avatarType?: string;
406
+ cardHeight?: number;
407
+ cardWidth?: number;
408
+ verticalLine?: number;
409
+ itemRender?: React_2.ComponentType<OrgChartItemRenderProps>;
410
+ onExpandChange?: (ev: OrgChartExpandChangeEvent) => void;
411
+ onItemAction?: (ev: OrgChartActionEvent) => void;
412
+ onItemKeyDown?: (ev: OrgChartActionEvent) => void;
413
+ node?: any;
414
+ }
415
+
416
+ /**
417
+ * @hidden
418
+ */
419
+ export declare interface ServerOrgChartProps {
420
+ /**
421
+ * @hidden
422
+ */
423
+ children?: React.ReactNode;
424
+ /**
425
+ * Sets additional classes to the OrgChart.
426
+ */
427
+ className?: string;
428
+ /**
429
+ * Sets custom id to the OrgChart.
430
+ */
431
+ id?: string;
432
+ /**
433
+ * Sets custom aria-label to the OrgChart. The default value is "Org Chart"
434
+ */
435
+ ariaLabel?: string;
436
+ /**
437
+ * Specifies the name of the field which will provide a id for the item. Defaults to `id`.
438
+ */
439
+ idField?: string;
440
+ /**
441
+ * Specifies the name of the field which will provide an array representation of the item children.
442
+ */
443
+ childrenField?: string;
444
+ /**
445
+ * Specifies the name of the field which will provide a Boolean representation for the expanded state of the item. Defaults to `expanded`.
446
+ */
447
+ expandField?: string;
448
+ /**
449
+ * Specifies the name of the field which will provide a title representation for the item. Defaults to `text`.
450
+ */
451
+ titleField?: string;
452
+ /**
453
+ * Specifies the name of the field which indicates to the OrgChart that an item has
454
+ * children even if the children are not initially passed. Used for implementing the load-on-demand feature.
455
+ * Defaults to `undefined`.
456
+ */
457
+ hasChildrenField?: string;
458
+ /**
459
+ * Specifies the name of the field which will provide a subtitle representation for the item. Defaults to `text`.
460
+ */
461
+ subtitleField?: string;
462
+ /**
463
+ * Specifies the avatar of the field which will provide a avatar representation for the item. Defaults to `text`.
464
+ */
465
+ avatarField?: string;
466
+ /**
467
+ * Specifies a string array with the colors applied to the items. By default the colors come from the Kendo Theme that is used.
468
+ */
469
+ cardsColors?: string[];
470
+ /**
471
+ * The styles that are applied to the OrgChart.
472
+ */
473
+ style?: React.CSSProperties;
474
+ /**
475
+ * Sets the data of the OrgChart.
476
+ */
477
+ data?: any[];
478
+ /**
479
+ * Specifies the field by which the OrgChart data is grouped.
480
+ */
481
+ groupField?: string;
482
+ /**
483
+ * Specifies the height of the card of the OrgChart.
484
+ */
485
+ cardHeight?: number;
486
+ /**
487
+ * Specifies the width of the card of the OrgChart.
488
+ */
489
+ cardWidth?: number;
490
+ /**
491
+ * Specifies the height of the title of the grouped OrgChart.
492
+ */
493
+ groupTitleHeight?: number;
494
+ /**
495
+ * Specifies the height of the subtitle of the grouped OrgChart.
496
+ */
497
+ groupSubtitleHeight?: number;
498
+ /**
499
+ * Defines the component that will be used for rendering each of the OrgChart items.
500
+ */
501
+ itemRender?: React.ComponentType<OrgChartItemRenderProps>;
502
+ /**
503
+ * Defines the component that will be used for rendering each of the grouped OrgChart title.
504
+ */
505
+ groupTitleRender?: React.ComponentType<OrgChartGroupTitleProps>;
506
+ /**
507
+ * Defines the component that will be used for rendering each of the grouped OrgChart subtitle.
508
+ */
509
+ groupSubtitleRender?: React.ComponentType<OrgChartGroupSubtitleProps>;
510
+ /**
511
+ * Specifies the height of the vertical line of the OrgChart.
512
+ */
513
+ verticalLine?: number;
514
+ /**
515
+ * Specifies the width the OrgChart.
516
+ */
517
+ height?: string | number;
518
+ }
519
+
520
+ export { }
package/index.js CHANGED
@@ -1,18 +1,8 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $e=require("react"),w=require("@progress/kendo-react-common"),Y=require("@progress/kendo-react-layout"),Ue=require("@progress/kendo-react-buttons"),ge=require("@progress/kendo-svg-icons"),h=require("prop-types"),qe=require("@progress/kendo-data-query");function Ve(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>s[o]})}}return t.default=s,Object.freeze(t)}const l=Ve($e),ve=s=>window.getComputedStyle(s).backgroundColor,Qe=s=>s.toLowerCase().charCodeAt(0)-"a".charCodeAt(0),Xe=s=>{const t=s.match(/series-([a-z])$/);if(t!==null)return Qe(t[1]);const o=s.split("--series-")[1];return parseInt(o,10)-1},Ze=30,Je=()=>{let s=`
6
- <div class="k-var--series-a"></div>
7
- <div class="k-var--series-b"></div>
8
- <div class="k-var--series-c"></div>
9
- <div class="k-var--series-d"></div>
10
- <div class="k-var--series-e"></div>
11
- <div class="k-var--series-f"></div>
12
- `;for(let t=0;t<Ze;t++)s+=`
13
- <div class="k-var--series-${t+1}"></div>`;return s},Ye=`
14
- <div class="k-var--series-unset"></div>
15
- <div class="k-var--series">
16
- ${Je()}
17
- </div>
18
- `;class et{getSeriesColors(){const t=this.element,o=[].slice.call(t.querySelectorAll(".k-var--series div")),i=ve(t.querySelector(".k-var--series-unset"));return o.reduce((n,r)=>{const a=Xe(r.className),c=ve(r);return c!==i&&(n[a]=c),n},[])}}const tt=(s,t)=>{const o=new et,i=o.element=t.createElement("div");i.style.display="none",i.innerHTML=Ye,t.body.appendChild(i);let e;try{e=o.getSeriesColors()}finally{t.body.removeChild(o.element),delete o.element,s(e)}},nt="expanded",it="items",ot="selected",Ce="checked",st="checkIndeterminate",rt="k-orgchart",q=80,ke=300,S=25,G=40,ne=20,ie=20,Ee=82,ee=l.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}),ce=s=>{const t={tabIndex:0,navigatable:!0,expandField:"expanded",ariaLabel:"Org Chart",idField:"id",childrenField:"items",avatarField:"avatar",titleField:"title",subtitleField:"subtitle",...s},{navigatable:o,id:i,tabIndex:e,className:n,style:r,data:a,groupField:c,cardWidth:m,cardHeight:d,groupTitleHeight:g,groupSubtitleHeight:v,verticalLine:u,idField:k,childrenField:x,expandField:I,hasChildrenField:A,avatarField:R,titleField:E,subtitleField:_,onExpandChange:y,onItemAction:b,onItemDoubleClick:B,onItemContextMenu:H,onKeyDown:z,onGroupAction:C,onGroupBlur:N,onGroupFocus:M,cardsColors:j,ariaLabel:V,itemRender:$,groupTitleRender:Q,groupSubtitleRender:T,height:te,children:U,...oe}=t,X=l.useRef(null),L=l.useRef(new w.Navigation({tabIndex:e,root:X,selectors:[t.groupField?".k-orgchart-node-group-container":".k-orgchart-card"],focusOptions:{}})),[se,Ne]=l.useState([]),P=l.useRef(null),Oe=(f,p,O)=>{O.preventDefault(),p.focusNext(f)},Se=(f,p,O)=>{O.preventDefault(),p.focusPrevious(f)},Te=(f,p,O,F)=>{var W;if(O.preventDefault(),(t.groupField?F.items.some(Z=>Z[t.expandField]):F.item[t.expandField])&&t.onExpandChange)t.onExpandChange.call(void 0,F);else{const Z=".k-orgchart-group",re=(W=f.closest(Z))==null?void 0:W.getAttribute("id"),J=document.querySelector(`[aria-owns="${re}"]`);J?p.focusElement(J,f):p.focusPrevious(f)}},Ae=(f,p,O,F)=>{var J;O.preventDefault();const D=t.groupField?F.items.some(K=>K[t.expandField]):F.item[t.expandField],W=t.groupField?F.items.find(K=>K[t.childrenField]):F.item[t.childrenField],Z=t.groupField?F.items.some(K=>t.hasChildrenField&&K[t.hasChildrenField]):t.hasChildrenField&&F.item[t.hasChildrenField],re=t.groupField?W&&W[t.childrenField]&&W[t.childrenField].length:W&&W.length;if((Z||re)&&!D&&t.onExpandChange)t.onExpandChange.call(void 0,F);else{const K=t.groupField?".k-orgchart-node-group-container":".k-orgchart-card",je=f.getAttribute("aria-owns"),me=(J=document.getElementById(je))==null?void 0:J.querySelector(K);me?p.focusElement(me,f):p.focusNext(f)}},De=(f,p,O)=>{O.preventDefault(),p.focusElement(p.first,null)},Re=(f,p,O)=>{O.preventDefault(),p.focusElement(p.last,null)},He=(f,p,O,F)=>{O.stopPropagation();const D=f.className.indexOf("k-orgchart-node-group-container")!==-1;if(s.groupField&&D){P.current&&P.current.first&&P.current.focusElement(P.current.first,null);return}t.onItemAction&&t.onItemAction({event:O,item:F.item})},Ge=f=>{if(s.groupField){const p=f.closest(".k-orgchart-node-group-container");p&&L.current.focusElement(p,null)}};l.useEffect(()=>{if(o&&L.current.first&&L.current.first.setAttribute("tabindex",String(e)),!j){const f=X.current.ownerDocument||document;tt(p=>{Ne(p)},f)}},[o,e]);const _e=f=>{if(t.navigatable){const p=f.event,O=p.key===" "?"Space":p.key,F=s.groupField&&p.target.className.indexOf("k-orgchart-card")!==-1&&P.current||L.current,D=p.target.closest(F.selectors.join(","));switch(O){case"ArrowUp":Te(D,F,p,f);break;case"ArrowDown":Ae(D,F,p,f);break;case"ArrowLeft":Se(D,F,p);break;case"ArrowRight":Oe(D,F,p);break;case"End":Re(D,F,p);break;case"Home":De(D,F,p);break;case"Enter":He(D,F,p,f);break;case"Escape":Ge(D);break}}},Me=f=>{if(f.event.stopPropagation(),b&&b.call(void 0,f),t.navigatable){const p=f.event.target.closest(".k-orgchart-card");p&&L.current.focusElement(p,null)}},We=f=>{f.event.stopPropagation(),b&&b.call(void 0,f)},Pe=f=>{f.event.stopPropagation(),b&&b.call(void 0,f)},Ke=f=>{if(C&&C.call(void 0,f),t.navigatable){const p=f.event.target.closest(".k-orgchart-node-group-container");p&&L.current.focusElement(p,null)}},Be=f=>{P.current=null},ze=f=>{P.current=new w.Navigation({tabIndex:0,root:f.containerRef,selectors:[".k-orgchart-card"],focusOptions:{}})};return l.createElement("div",{style:r,ref:X,className:w.classNames(n,rt)},l.createElement(ee.Provider,{value:{cardColors:j||se,onExpandChange:s.onExpandChange,onKeyDown:_e,onItemAction:Me,onItemDoubleClick:Pe,onItemContextMenu:We,onGroupAction:Ke,onGroupBlur:Be,onGroupFocus:ze},...oe},s.children))};ce.propTypes={className:h.string,style:h.object,id:h.string,ariaLabel:h.string,idField:h.string,childrenField:h.string,expandField:h.string,titleField:h.string,hasChildrenField:h.string,subtitleField:h.string,avatarField:h.string,cardsColors:h.array,data:h.array,groupField:h.string,cardHeight:h.number,cardWidth:h.number,groupTitleHeight:h.number,groupSubtitleHeight:h.number,verticalLine:h.number,height:h.oneOfType([h.string,h.number]),onExpandChange:h.func,onItemAction:h.func,onItemDoubleClick:h.func,onItemContextMenu:h.func,onGroupAction:h.func};ce.displayName="KendoClientOrgChart";const be=s=>{const{expanded:t,node:o,nodes:i}=s,e=l.useContext(ee),n=r=>{e.onExpandChange&&e.onExpandChange.call(void 0,{event:r,expand:!t,item:o,items:i})};return l.createElement(Ue.Button,{className:"k-orgchart-button",icon:t?"minus":"plus",tabIndex:-1,svgIcon:t?ge.minusIcon:ge.plusIcon,"aria-label":t?"collapse":"expand",onClick:n})},at=s=>{const{node:t,children:o,style:i,...e}=s,[n,r]=l.useState(!1),a=l.useContext(ee),c=v=>{a.onKeyDown&&a.onKeyDown.call(void 0,{event:v,item:t})},m=v=>{a.onItemAction&&a.onItemAction.call(void 0,{event:v,item:t})},d=v=>{a.onItemContextMenu&&a.onItemContextMenu.call(void 0,{event:v,item:t})},g=v=>{a.onItemDoubleClick&&a.onItemDoubleClick.call(void 0,{event:v,item:t})};return l.createElement(Y.Card,{role:"treeitem",className:w.classNames("k-orgchart-card",{"k-focus":n}),onClick:m,onKeyDown:c,onContextMenu:d,onDoubleClick:g,style:i,"aria-selected":n,"aria-keyshortcuts":"Enter",onFocus:()=>r(!0),onBlur:()=>r(!1),...e},o)},lt=s=>{const{level:t,children:o}=s,i=l.useContext(ee),e=i.cardColors&&i.cardColors[t]||"green";return l.createElement(Y.CardBody,{className:"k-hstack",style:{borderTopColor:e}},o)},ct="k-orgchart-node",de=s=>{const t={avatarType:"image"},{id:o,title:i,subtitle:e,level:n,childLineWidth:r,cardWidth:a,cardHeight:c,verticalLine:m,color:d,line:g,plus:v,expanded:u,node:k,avatar:x,avatarType:I,itemRender:A,...R}={...s,...t},E=A;return l.createElement("div",{...R,className:w.classNames(s.className,ct,"k-vstack","k-align-items-center")},n!==0&&l.createElement("div",{className:"k-orgchart-line k-orgchart-line-v k-orgchart-line-v-top",style:{height:m}}),l.createElement(at,{node:k,style:{width:a,height:c},"aria-level":n+1,"aria-expanded":!!u,"aria-owns":o},l.createElement(lt,{level:n},E?l.createElement(E,{item:k,title:i,subtitle:e,level:n,expanded:u,color:d}):l.createElement(l.Fragment,null,l.createElement(Y.Avatar,{type:I,themeColor:"secondary"},I==="image"?l.createElement("img",{src:x,alt:"KendoReact Avatar Customer Image"}):x),l.createElement("div",{className:"k-card-title-wrap k-vstack"},l.createElement(Y.CardTitle,{className:"k-text-ellipsis"},i),l.createElement("span",{className:"k-spacer"}),l.createElement(Y.CardSubtitle,{className:"k-text-ellipsis"},e)),l.createElement("span",{className:"k-spacer"})))),g&&l.createElement("div",{className:"k-orgchart-line k-orgchart-line-v"}),v&&l.createElement(be,{expanded:u,node:k}),v&&!!r&&l.createElement("div",{className:"k-orgchart-line k-orgchart-line-h",style:{width:r,marginTop:-15}}))},xe=({dataByGroups:s,data:t=[],cardWidth:o,childrenField:i,idField:e,expandField:n,hasChildrenField:r,groupField:a,level:c=1,parentId:m=0})=>{t.forEach(d=>{const g=d[i];if(d[n]&&g&&g.length){const u=g.some(I=>I[i]&&I[i].length||r&&I[r]),k=u?"horizontal":"vertical",x=u?null:o;s.push({ids:[d[e]],items:g,level:c,parentId:m,hasChildren:u,orientation:k,width:x}),xe({dataByGroups:s,data:d[i],childrenField:i,cardWidth:o,idField:e,expandField:n,hasChildrenField:r,groupField:a,level:c+1,parentId:d[e]})}})},dt=(s,t)=>{const o=t||ke,i=s.sort((e,n)=>n.level-e.level);i.forEach(e=>{if(!e.width){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+S*(a-1);e.width=c}})},ht=(s,t,o)=>{const i=s.sort((e,n)=>e.level-n.level);i.forEach(e=>{if(e.level===0)return;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)*S)/a.length:0;if(!e.left){let u=(n==null?void 0:n.left)||0;a.forEach((k,x)=>{x<r&&(u+=c+S)}),e.left=u}const m=(n==null?void 0:n.width)||0,d=(n==null?void 0:n.items.length)||1,g=(m-(d-1)*S)/d;e.width=g;const v=n==null?void 0:n.items.map(u=>{const k=u[t]?u[t].length:0,x=i.find(A=>A.ids.includes(u[o])),I=(x==null?void 0:x.width)||0;return(x==null?void 0:x.orientation)==="vertical"||k===0||!u.expanded?0:I-(I-(k-1)*S)/k});n&&(n.childLineWidths=v)})},ut=(s,t,o)=>{const i=t||q,e=o||G;s.forEach(n=>{const r=n.level,a=(i+e)*r+G*(r?r-1:0)-(e-G)*(r?1:0);n.top=a})},mt=(s,t,o)=>{const i=t||q,e=o||G;return Math.max(...s.map(r=>{const a=r.top||0,c=r.items.length,m=r.orientation==="horizontal"?i+e+e:c*(i+e);return a+m}))},he=s=>{const t={width:"100%",data:[],ariaLabel:"Org Chart",idField:"id",childrenField:"items",avatarField:"avatar",titleField:"title",subtitleField:"subtitle",expandField:"expanded"},{id:o,width:i,data:e,groupField:n,cardWidth:r,cardHeight:a,verticalLine:c,idField:m,childrenField:d,hasChildrenField:g,expandField:v,avatarField:u,titleField:k,subtitleField:x,ariaLabel:I,itemRender:A,height:R}={...t,...s},E=[{items:e,level:0,hasChildren:!0,orientation:"horizontal",ids:[0],parentId:null,width:null}];xe({dataByGroups:E,data:e,cardWidth:r,expandField:v,hasChildrenField:g,childrenField:d,idField:m,groupField:n}),dt(E,r),ht(E,d,m),ut(E,a,c);const _=mt(E,a,c);return l.createElement("div",{className:"k-orgchart-container",style:{width:i,height:R||_}},E.map(y=>{const b=y.level,B=y.items,H=b===0?"center":"around",z=y.orientation;return l.createElement("div",{role:b===0?"tree":"group",id:o+"-"+b+"-"+y.ids[0],"aria-label":b===0?I:void 0,"aria-orientation":b===0?z:void 0,key:y.ids[0]+"_"+b,className:w.classNames("k-orgchart-group",`k-orgchart-level-${b}`,"k-pos-absolute",{[`k-${w.kendoThemeMaps.orientationMap[z]}`]:z,[`k-justify-content-${H}`]:H}),style:{width:y.width||"100%",left:y.left,top:y.top}},B.length>0&&l.createElement("div",{role:"group",style:{width:"100%"},className:w.classNames("k-orgchart-node-container","k-justify-content-around",{[`k-${w.kendoThemeMaps.orientationMap[y.orientation]}`]:y.orientation})},B.map((C,N)=>{const M=C[d]&&C[d].length||g&&C[g],j=M||y.orientation==="vertical"&&N!==B.length-1,V=y.orientation==="vertical"&&N!==0?0:c||G,$=y.childLineWidths?Math.max(...y.childLineWidths):void 0,Q=C[v];return l.createElement(de,{id:o+"-"+(b+1)+"-"+C[m],style:{width:$},itemRender:A,cardHeight:a,cardWidth:r,verticalLine:V,key:N,level:b,avatar:C[u],title:C[k],subtitle:C[x],line:j,expanded:Q,node:C,childLineWidth:M&&Q&&y.orientation==="horizontal"?y.childLineWidths[N]:0,plus:M},C.text)})))}))};he.displayName="KendoServerOrgChart";const gt={name:"@progress/kendo-react-orgchart",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",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"},vt=s=>{const{nodes:t,children:o,style:i,...e}=s,[n,r]=l.useState(!1),a=l.useContext(ee),c=l.useRef(null),m=u=>{a.onKeyDown&&a.onKeyDown({event:u,items:t})},d=u=>{a.onGroupAction&&a.onGroupAction({event:u,items:t})},g=u=>{r(!0),a.onGroupFocus&&a.onGroupFocus({event:u,items:t,containerRef:c})},v=u=>{r(!1),a.onGroupBlur&&a.onGroupBlur({event:u,items:t})};return l.createElement("div",{role:"treeitem","aria-selected":n,ref:c,className:w.classNames("k-orgchart-node-group-container","k-vstack",{"k-focus":n}),style:i,onKeyDown:m,onClick:d,onFocus:g,onBlur:v,...e},o)},ft="k-orgchart-node-group",fe="k-orgchart-node-group-title",pe="k-orgchart-node-group-subtitle",Ie=s=>{const t={orientation:"horizontal"},{id:o,title:i,subtitle:e,line:n,plus:r,focus:a,level:c,verticalLine:m,childLineWidth:d,orientation:g,expanded:v,nodes:u,groupTitleHeight:k,groupSubtitleHeight:x,groupTitleRender:I,groupSubtitleRender:A,...R}={...t,...s},E=I,_=A,y={height:k||ne},b={height:x||ie};return l.createElement("div",{...R,className:w.classNames(s.className,ft,"k-vstack","k-align-items-center")},c!==0&&l.createElement("div",{className:"k-orgchart-line k-orgchart-line-v k-orgchart-line-v-top",style:{height:m}}),l.createElement(vt,{nodes:u,"aria-expanded":!!v,"aria-keyshortcuts":"Enter","aria-level":c+1,"aria-owns":o},E?l.createElement(E,{style:y,className:fe,title:i,items:u,level:c,expanded:v}):l.createElement("div",{className:fe,style:y},i),_?l.createElement(_,{style:b,className:pe,subtitle:e,items:u,level:c,expanded:v}):l.createElement("div",{className:pe,style:b},e),l.createElement("div",{role:"group",style:{width:"100%"},className:w.classNames("k-orgchart-node-container","k-justify-content-around",{[`k-${w.kendoThemeMaps.orientationMap[g]||g}`]:g})},s.children)),n&&l.createElement("div",{className:"k-orgchart-line k-orgchart-line-v"}),r&&l.createElement(be,{expanded:v,nodes:u}),r&&!!d&&l.createElement("div",{className:"k-orgchart-line k-orgchart-line-h",style:{width:d,marginTop:-15}}))},ye=({dataByGroups:s,data:t=[],cardWidth:o,childrenField:i,idField:e,expandField:n,hasChildrenField:r,groupField:a,level:c=1,parentId:m=0})=>{t.forEach(d=>{const g=d[i];if(d[n]&&g&&g.length){const u=g.some(E=>E[i]&&E[i].length||r&&E[r]),k=u?"horizontal":"vertical",x=u?null:o+2*S,I=s.find(E=>E.parentId===m),A=s.find(E=>E.ids.includes(m));let R=!1;if(I){const E=I.ids[0],_=A.items.find(b=>b[e]===E),y=A.items.find(b=>b[e]===d[e]);R=_[a]===y[a]}I&&R?(I.ids.push(d[e]),I.items=I.items.concat(g)):s.push({ids:[d[e]],items:g,level:c,parentId:m,hasChildren:u,orientation:k,width:x}),ye({dataByGroups:s,data:d[i],childrenField:i,cardWidth:o,idField:e,expandField:n,hasChildrenField:r,groupField:a,level:c+1,parentId:d[e]})}})},pt=(s,t)=>{const o=t||ke,i=s.sort((e,n)=>n.level-e.level);i.forEach(e=>{if(!e.width){const n=i.filter(r=>e.ids.includes(r.parentId));if(n.length){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=>{const g=e.orientation==="horizontal"?d.items.length:1;return g*(o+2*S)+S*(g-1)})),m=r*a+S*(a-1);e.width=Math.max(m,c)}else{const r=Math.max(...e.groupedItems.map(a=>{const c=e.orientation==="horizontal"?a.items.length:1;return c*(o+2*S)+S*(c-1)}));e.width=r}}})},Ct=(s,t)=>{const o=s.sort((i,e)=>i.level-e.level);o.forEach(i=>{var g;if(i.level===0)return;const e=o.find(v=>v.ids.includes(i.parentId)),n=(e==null?void 0:e.groupedItems.findIndex(v=>v.items.some(u=>i.ids.includes(u[t]))))||0,r=(e==null?void 0:e.groupedItems)||[],a=e.width?(e.width-(r.length-1)*S)/r.length:0;if(!i.left){let v=(e==null?void 0:e.left)||0;r.forEach((u,k)=>{k<n&&(v+=a+S)}),i.left=v}const c=(e==null?void 0:e.width)||0,m=(e==null?void 0:e.groupedItems.length)||1,d=(c-(m-1)*S)/m;if(i.width=d,e){const v=i.width-(i.width-(i.groupedItems.length-1)*S)/i.groupedItems.length;e.childLineWidths?(g=e.childLineWidths)==null||g.push(v):e.childLineWidths=[v]}})},kt=(s,t,o,i,e)=>{const n=t||q,r=e||G,a=o+i+Ee;s.forEach(c=>{const m=c.level,d=(n+r+a)*m+G*(m?m-1:0)-(r-G)*(m?1:0);c.top=d})},Et=(s,t,o,i,e)=>{const n=t||q,r=o||G,c=(i||ne)+(e||ie)+Ee;return Math.max(...s.map(d=>{const g=d.top||0,v=Math.max(...d.groupedItems.map(x=>x.items.length)),u=d.hasChildren?G:0,k=d.orientation==="horizontal"?n+r+c+r+u:v*(n+r)+c+r;return g+k}))},we=s=>{const t={width:"100%",data:[],ariaLabel:"Org Chart",idField:"id",childrenField:"items",avatarField:"avatar",titleField:"title",subtitleField:"subtitle",expandField:"expanded",orientation:"horizontal"},{id:o,width:i,data:e,groupField:n,cardWidth:r,cardHeight:a,groupTitleHeight:c,groupSubtitleHeight:m,verticalLine:d,idField:g,childrenField:v,expandField:u,hasChildrenField:k,avatarField:x,titleField:I,subtitleField:A,cardsColors:R,ariaLabel:E,itemRender:_,groupTitleRender:y,groupSubtitleRender:b,height:B}={...t,...s},H=[{items:e,level:0,hasChildren:!0,orientation:"horizontal",ids:[0],parentId:null,width:null}];ye({dataByGroups:H,data:e,cardWidth:r,expandField:u,hasChildrenField:k,childrenField:v,idField:g,groupField:n}),H.map(C=>{C.groupedItems=qe.groupBy(C.items,[{field:n}])}),pt(H,r),Ct(H,g),kt(H,a||q,c||ne,m||ie,d);const z=Et(H,a||q,c||ne,m||ie);return l.createElement("div",{className:"k-orgchart-container",style:{width:i,height:B||z}},H.map(C=>{const N=C.level,M=C.groupedItems.map(T=>{const te=T.items.some(U=>U[u]);return{...T,expanded:te}}),j=M.filter(T=>T.expanded),V=N===0?"center":"around",$="horizontal",Q=R&&R[N]||"green";return l.createElement("div",{role:N===0?"tree":"group",id:o+"-"+N+"-"+C.ids[0],"aria-label":N===0?E:void 0,"aria-orientation":N===0?$:void 0,key:C.ids[0]+"_"+N,className:w.classNames("k-orgchart-group",`k-orgchart-level-${N}`,"k-pos-absolute",{[`k-${w.kendoThemeMaps.orientationMap[$]}`]:$,[`k-justify-content-${V}`]:V,"k-orgchart-group-h":s.groupField}),style:{width:C.width||"100%",left:C.left,top:C.top}},e.length>0&&M.map((T,te)=>{const U=T.items.some(L=>L[v]&&L[v].length||k&&L[k]),oe=C.width?(C.width-(M.length-1)*S)/M.length:void 0,X=j.findIndex(L=>L===T);return l.createElement(Ie,{id:o+"-"+(N+1)+"-"+T.items[0][g],style:{width:oe},groupTitleHeight:c,groupSubtitleHeight:m,groupTitleRender:y,groupSubtitleRender:b,key:te,level:N,verticalLine:d||G,title:T.items[0][n||I],subtitle:n,orientation:C.orientation,childLineWidth:U&&T.expanded&&C.orientation==="horizontal"?C.childLineWidths[X]:0,line:U,nodes:T.items,expanded:T.expanded,plus:U},T.items.map((L,se)=>l.createElement(de,{cardHeight:a,cardWidth:r,itemRender:_,color:Q,key:se,level:N,avatar:L[x],title:L[I],subtitle:L[A],verticalLine:0,line:!1,node:L,childLineWidth:0,plus:!1},L.text)))}))}))};we.displayName="KendoServerGroupedOrgChart";const ue=s=>{const t={tabIndex:0,navigatable:!0,expandField:"expanded",ariaLabel:"Org Chart",idField:"id",childrenField:"items",avatarField:"avatar",titleField:"title",subtitleField:"subtitle",...s},{cardsColors:o,onExpandChange:i,onKeyDown:e,onItemAction:n,onGroupAction:r,onGroupBlur:a,onGroupFocus:c,id:m,...d}=t,g=l.useRef(w.useId());return w.validatePackage(gt),l.createElement(ce,{...t},s.groupField?l.createElement(we,{id:m||g.current,...d},s.children):l.createElement(he,{id:m||g.current,...d},s.children))};ue.propTypes={className:h.string,style:h.object,id:h.string,ariaLabel:h.string,idField:h.string,childrenField:h.string,expandField:h.string,titleField:h.string,hasChildrenField:h.string,subtitleField:h.string,avatarField:h.string,cardsColors:h.array,data:h.array,groupField:h.string,cardHeight:h.number,cardWidth:h.number,groupTitleHeight:h.number,groupSubtitleHeight:h.number,verticalLine:h.number,height:h.oneOfType([h.string,h.number]),onExpandChange:h.func,onItemAction:h.func,onGroupAction:h.func};ue.displayName="KendoOrgChart";function bt(s,t){if(!s||!s.length)return[];let o=s;const i=t.cloneField||"cloned",e=t.expandField||nt,n=t.selectField||ot,r=t.checkField||Ce,a=t.childrenField||it;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),It(o,a,t.check),o}function ae(s,t,o,i,e){if(o){const{ids:n,field:r}=Fe(o,t),a=!w.isArray(o)&&o.idField?w.resolveItemsIds(n,o.idField,s,e):n;return xt(s,a,r,i,e)}else return s}function Fe(s,t){let o,i;return w.isArray(s)?(o=s,i=t):(o=s.ids||[],i=s.operationField||t),{ids:o,field:i}}function xt(s,t,o,i,e){let n=s;return t.forEach(r=>{n=w.updateItem(n,r,a=>Le(o,a),i,e)}),n}function Le(s,t){const o=(s||"").split(".");let i=t;for(let e=0;e<o.length;e++){const n=o[e];if(e===o.length-1)i[n]=!0;else if(i[n]!==void 0)i[n]={...i[n]},i=i[n];else return}}function It(s,t,o){if(o&&!w.isArray(o)&&o.applyCheckIndeterminate){const{field:i}=Fe(o,Ce),e=o.checkIndeterminateField||st;for(let n=0;n<s.length;n++){const r=s[n],a=r[t];a&&le(a,w.getNestedValue(i,r)?[]:[r],t,i,e)}}}function le(s,t,o,i,e){let n=!1;for(let r=0;r<s.length;r++){const a=s[r];if(w.getNestedValue(i,a)){if(!n)for(let c=0;c<t.length;c++)Le(e,t[c]);n=!0,a[o]&&le(a[o],[],o,i,e)}else a[o]&&le(a[o],n?[a]:t.concat([a]),o,i,e)}}exports.OrgChart=ue;exports.ServerOrgChart=he;exports.ServerOrgChartGroup=Ie;exports.ServerOrgChartNode=de;exports.processOrgChartItems=bt;
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 r=require("./server/ServerOrgChart.js"),e=require("./OrgChart.js"),t=require("./processOrgChartItems.js"),o=require("./server/ServerOrgChartNode.js"),a=require("./server/ServerOrgChartGroup.js");exports.ServerOrgChart=r.ServerOrgChart;exports.OrgChart=e.OrgChart;exports.processOrgChartItems=t.processOrgChartItems;exports.ServerOrgChartNode=o.ServerOrgChartNode;exports.ServerOrgChartGroup=a.ServerOrgChartGroup;