@progress/kendo-react-treeview 13.3.0 → 13.4.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.
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ /**
9
+ * A helper function which moves a TreeView item in an immutable way.
10
+ *
11
+ * @param sourceItemHierarchicalIndex - The hierarchical index of the item that will be moved.
12
+ * @param sourceData - The tree which contains the item that will be moved.
13
+ * @param operation - The specific move operation.
14
+ *
15
+ * The available options are:
16
+ * * `before`—Indicates that the source item will become the previous sibling of the target item.
17
+ * * `after`—Indicates that the source item will become the next sibling of the target item.
18
+ * * `child`—Indicates that the source item will become a child of the target item.
19
+ * @param targetItemHierarchicalIndex - The hierarchical index of the item next to which the source item will be moved.
20
+ * @param targetData - The tree which contains the target item.
21
+ * If the argument is skipped, then the move operation will be executed within the same tree.
22
+ * Setting the `sourceData` and `targetData` arguments to the same tree is also supported.
23
+ * @param childrenField - The field that points to the dataItem sub items. Defaults to `items`.
24
+ * @returns - The updated copies of the `sourceData` and `targetData` input arguments.
25
+ * If `targetData` is not passed, then only the updated copy of the `sourceData` will be returned.
26
+ *
27
+ * @example
28
+ * ```jsx
29
+ * const App = () => {
30
+ * const dragClueRef = React.useRef(null);
31
+ * const [tree, setTree] = React.useState([{
32
+ * text: 'Furniture', expanded: true, items: [
33
+ * { text: 'Tables & Chairs', expanded: true },
34
+ * { text: 'Sofas', expanded: true },
35
+ * { text: 'Occasional Furniture', expanded: true }]
36
+ * }, {
37
+ * text: 'Decor', expanded: true, items: [
38
+ * { text: 'Bed Linen', expanded: true },
39
+ * { text: 'Curtains & Blinds', expanded: true },
40
+ * { text: 'Carpets', expanded: true }]
41
+ * }]);
42
+ *
43
+ * const SEPARATOR = '_';
44
+ *
45
+ * const getSiblings = (itemIndex, data) => {
46
+ * let result = data;
47
+ * const indices = itemIndex.split(SEPARATOR).map(index => Number(index));
48
+ * for (let i = 0; i < indices.length - 1; i++) {
49
+ * result = result[indices[i]].items;
50
+ * }
51
+ * return result;
52
+ * };
53
+ *
54
+ * const getClueClassName = (event) => {
55
+ * const eventAnalyzer = new TreeViewDragAnalyzer(event).init();
56
+ * const itemIndex = eventAnalyzer.destinationMeta.itemHierarchicalIndex;
57
+ *
58
+ * if (eventAnalyzer.isDropAllowed) {
59
+ * switch (eventAnalyzer.getDropOperation()) {
60
+ * case 'child':
61
+ * return 'k-i-plus';
62
+ * case 'before':
63
+ * return itemIndex === '0' || itemIndex.endsWith(`${SEPARATOR}0`) ?
64
+ * 'k-i-insert-up' : 'k-i-insert-middle';
65
+ * case 'after':
66
+ * const siblings = getSiblings(itemIndex, tree);
67
+ * const lastIndex = Number(itemIndex.split(SEPARATOR).pop());
68
+ *
69
+ * return lastIndex < siblings.length - 1 ? 'k-i-insert-middle' : 'k-i-insert-down';
70
+ * default:
71
+ * break;
72
+ * }
73
+ * }
74
+ *
75
+ * return 'k-i-cancel';
76
+ * };
77
+ *
78
+ * const onItemDragOver = (event) => {
79
+ * dragClueRef.current.show(event.pageY + 10, event.pageX, event.item.text, getClueClassName(event));
80
+ * };
81
+ *
82
+ * const onItemDragEnd = (event) => {
83
+ * dragClueRef.current.hide();
84
+ * const eventAnalyzer = new TreeViewDragAnalyzer(event).init();
85
+ *
86
+ * if (eventAnalyzer.isDropAllowed) {
87
+ * const updatedTree = moveTreeViewItem(
88
+ * event.itemHierarchicalIndex,
89
+ * tree,
90
+ * eventAnalyzer.getDropOperation(),
91
+ * eventAnalyzer.destinationMeta.itemHierarchicalIndex,
92
+ * );
93
+ *
94
+ * setTree(updatedTree);
95
+ * }
96
+ * };
97
+ *
98
+ * return (
99
+ * <div>
100
+ * <TreeView data={tree} draggable={true}
101
+ * onItemDragOver={onItemDragOver} onItemDragEnd={onItemDragEnd} />
102
+ * <TreeViewDragClue ref={dragClueRef} />
103
+ * </div>
104
+ * );
105
+ * }
106
+ * ```
107
+ */
108
+ export declare function moveTreeViewItem(sourceItemHierarchicalIndex: string, sourceData: any[] | null | undefined, operation: 'before' | 'after' | 'child', targetItemHierarchicalIndex: string, targetData?: any[] | null, childrenField?: string): any[] | {
109
+ sourceData: any[] | null | undefined;
110
+ targetData: any[];
111
+ } | null | undefined;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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 { PackageMetadata } from '@progress/kendo-licensing';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare const packageMetadata: PackageMetadata;
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-treeview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1768549938,version:"13.3.0",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-treeview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1770218797,version:"13.4.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
@@ -1,19 +1,13 @@
1
+ // Generated file. DO NOT EDIT.
1
2
  /**
2
- * @license
3
- *-------------------------------------------------------------------------------------------
4
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
- * Licensed under commercial license. See LICENSE.md in the package root for more information
6
- *-------------------------------------------------------------------------------------------
3
+ * @hidden
7
4
  */
8
- const e = Object.freeze({
9
- name: "@progress/kendo-react-treeview",
10
- productName: "KendoReact",
11
- productCode: "KENDOUIREACT",
12
- productCodes: ["KENDOUIREACT"],
13
- publishDate: 1768549938,
14
- version: "13.3.0",
15
- licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
5
+ export const packageMetadata = Object.freeze({
6
+ name: '@progress/kendo-react-treeview',
7
+ productName: 'KendoReact',
8
+ productCode: 'KENDOUIREACT',
9
+ productCodes: ['KENDOUIREACT'],
10
+ publishDate: 0,
11
+ version: '13.4.0-develop.1',
12
+ licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
16
13
  });
17
- export {
18
- e as packageMetadata
19
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-treeview",
3
- "version": "13.3.0",
3
+ "version": "13.4.0-develop.1",
4
4
  "description": "React TreeView displays hierarchical data in a traditional tree structure, supports user interaction. KendoReact TreeView package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,8 +26,8 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.7.2",
29
- "@progress/kendo-react-animation": "13.3.0",
30
- "@progress/kendo-react-common": "13.3.0",
29
+ "@progress/kendo-react-animation": "13.4.0-develop.1",
30
+ "@progress/kendo-react-common": "13.4.0-develop.1",
31
31
  "@progress/kendo-svg-icons": "^4.0.0",
32
32
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
33
33
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
@@ -53,7 +53,7 @@
53
53
  "package": {
54
54
  "productName": "KendoReact",
55
55
  "productCode": "KENDOUIREACT",
56
- "publishDate": 1768549938,
56
+ "publishDate": 1770218797,
57
57
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
58
58
  }
59
59
  },
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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 { TreeViewOperationDescriptors } from './TreeViewOperationDescriptors.js';
9
+ /**
10
+ * A helper function which applies the specified operation descriptors to the data.
11
+ * * [Expanding and collapsing items](https://www.telerik.com/kendo-react-ui/components/treeview/expansion/update-expanded-items#toc-using-a-helper-function)
12
+ * * [Selecting and deselecting items](https://www.telerik.com/kendo-react-ui/components/treeview/selection/update-selected-items#toc-using-a-helper-function)
13
+ * * [Checking and unchecking items](https://www.telerik.com/kendo-react-ui/components/treeview/checkboxes/helper-functions)
14
+ *
15
+ * @param data - The data that will be processed.
16
+ * @param operations - The operation descriptors that will be applied to the data.
17
+ * @returns - The processed copy of the input data.
18
+ *
19
+ * @example
20
+ * ```jsx
21
+ * const App = () => {
22
+ * const [items] = React.useState(tree);
23
+ * const [expand, setExpand] = React.useState([]);
24
+ * const [select, setSelect] = React.useState([]);
25
+ * const [check, setCheck] = React.useState([]);
26
+ *
27
+ * const onExpandChange = (event) => {
28
+ * let newExpand = expand.slice();
29
+ * const index = newExpand.indexOf(event.itemHierarchicalIndex);
30
+ * index === -1 ? newExpand.push(event.itemHierarchicalIndex) : newExpand.splice(index, 1);
31
+ * setExpand(newExpand);
32
+ * }
33
+ *
34
+ * return (
35
+ * <TreeView
36
+ * data={processTreeViewItems(items, { expand, select, check })}
37
+ * expandIcons={true} onExpandChange={onExpandChange} checkboxes={true}
38
+ * onCheckChange={event => setCheck([ event.itemHierarchicalIndex ])}
39
+ * onItemClick={event => setSelect([ event.itemHierarchicalIndex ])}
40
+ * />
41
+ * );
42
+ * }
43
+ *
44
+ * const tree = [{
45
+ * text: 'Item1',
46
+ * items: [
47
+ * { text: 'Item1.1' },
48
+ * { text: 'Item1.2' },
49
+ * { text: 'Item1.3', items: [{ text: 'Item1.3.1' }] }]
50
+ * }, {
51
+ * text: 'Item2', disabled: true,
52
+ * items: [{ text: 'Item2.1' }, { text: 'Item2.2' }, { text: 'Item2.3' }]
53
+ * }, {
54
+ * text: 'Item3'
55
+ * }];
56
+ * ```
57
+ */
58
+ export declare function processTreeViewItems(data: any[] | null | undefined, operations: TreeViewOperationDescriptors): any[];
@@ -5,7 +5,7 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { isArray as I, resolveItemsIds as g, updateItem as C, getNestedValue as E } from "@progress/kendo-react-common";
8
+ import { isArray as I, resolveItemsIds as g, getNestedValue as E, updateItem as C } from "@progress/kendo-react-common";
9
9
  import { EXPAND_FIELD as D, SELECT_FIELD as L, CHECK_FIELD as o, CHILDREN_FIELD as N, CHECK_INDETERMINATE_FIELD as _ } from "./utils/consts.mjs";
10
10
  function A(n, t) {
11
11
  if (!n || !n.length)
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ /**
9
+ * @hidden
10
+ */
11
+ export declare const EXPAND_FIELD = "expanded";
12
+ /**
13
+ * @hidden
14
+ */
15
+ export declare const TEXT_FIELD = "text";
16
+ /**
17
+ * @hidden
18
+ */
19
+ export declare const DISABLED_FIELD = "disabled";
20
+ /**
21
+ * @hidden
22
+ */
23
+ export declare const CHILDREN_FIELD = "items";
24
+ /**
25
+ * @hidden
26
+ */
27
+ export declare const HAS_CHILDREN_FIELD = "hasChildren";
28
+ /**
29
+ * @hidden
30
+ */
31
+ export declare const SELECT_FIELD = "selected";
32
+ /**
33
+ * @hidden
34
+ */
35
+ export declare const ICON_FIELD = "svgIcon";
36
+ /**
37
+ * @hidden
38
+ */
39
+ export declare const CHECK_FIELD = "checked";
40
+ /**
41
+ * @hidden
42
+ */
43
+ export declare const CHECK_INDETERMINATE_FIELD = "checkIndeterminate";
44
+ /**
45
+ * @hidden
46
+ */
47
+ export declare const DOM_KENDO_ITEM_ID_FIELD = "_kendoItemId";
48
+ /**
49
+ * @hidden
50
+ */
51
+ export declare const DOM_KENDO_TREEVIEW_GUID_FIELD = "_kendoTreeViewGuid";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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 { TreeFieldsService } from '@progress/kendo-react-common';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export default function getItemIdUponKeyboardNavigation(item: any, itemId: string, items: any[], keyCode: number, fieldsSvc: TreeFieldsService): any;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ /**
9
+ * @hidden
10
+ * Calculate the position of the node in the TreeView. The result is used in the node rendering classes.
11
+ */
12
+ declare const getNodePosition: (index: number, data: object[]) => "top" | "mid" | "bot";
13
+ export { getNodePosition };