@progress/kendo-vue-treeview 3.3.4 → 3.3.6-dev.202206170937
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/dist/cdn/js/kendo-vue-treeview.js +1 -1
- package/dist/es/TreeView.d.ts +70 -0
- package/dist/es/TreeView.js +72 -1
- package/dist/es/TreeViewDragAnalyzer.d.ts +15 -2
- package/dist/es/TreeViewDragAnalyzer.js +14 -2
- package/dist/es/TreeViewDragClue.d.ts +33 -90
- package/dist/es/TreeViewDragClue.js +34 -1
- package/dist/es/TreeViewItem.d.ts +6 -0
- package/dist/es/TreeViewItem.js +8 -1
- package/dist/es/TreeViewProps.d.ts +1 -1
- package/dist/es/additionalTypes.ts +11 -0
- package/dist/es/handleTreeViewCheckChange.d.ts +22 -40
- package/dist/es/handleTreeViewCheckChange.js +22 -40
- package/dist/es/main.d.ts +3 -3
- package/dist/es/main.js +3 -3
- package/dist/es/moveTreeViewItem.d.ts +31 -94
- package/dist/es/moveTreeViewItem.js +32 -95
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/processTreeViewItems.d.ts +16 -43
- package/dist/es/processTreeViewItems.js +17 -44
- package/dist/es/utils/SortedPublicItemIds.js +0 -2
- package/dist/npm/TreeView.d.ts +70 -0
- package/dist/npm/TreeView.js +72 -1
- package/dist/npm/TreeViewDragAnalyzer.d.ts +15 -2
- package/dist/npm/TreeViewDragAnalyzer.js +15 -2
- package/dist/npm/TreeViewDragClue.d.ts +33 -90
- package/dist/npm/TreeViewDragClue.js +34 -1
- package/dist/npm/TreeViewItem.d.ts +6 -0
- package/dist/npm/TreeViewItem.js +8 -1
- package/dist/npm/TreeViewProps.d.ts +1 -1
- package/dist/npm/additionalTypes.ts +11 -0
- package/dist/npm/handleTreeViewCheckChange.d.ts +22 -40
- package/dist/npm/handleTreeViewCheckChange.js +22 -40
- package/dist/npm/main.d.ts +3 -3
- package/dist/npm/main.js +3 -3
- package/dist/npm/moveTreeViewItem.d.ts +31 -94
- package/dist/npm/moveTreeViewItem.js +30 -96
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/processTreeViewItems.d.ts +16 -43
- package/dist/npm/processTreeViewItems.js +18 -45
- package/dist/npm/utils/SortedPublicItemIds.js +0 -2
- package/package.json +6 -6
|
@@ -4,109 +4,42 @@ import { CHILDREN_FIELD } from './utils/consts';
|
|
|
4
4
|
/**
|
|
5
5
|
* A helper function which moves a TreeView item in an immutable way.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* {% meta height:400 %}
|
|
8
|
+
* {% embed_file drag/single/main.vue preview %}
|
|
9
|
+
* {% embed_file drag/single/main.js %}
|
|
10
|
+
* {% endmeta %}
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* * `child`—Indicates that the source item will become a child of the target item.
|
|
15
|
-
* @param targetItemHierarchicalIndex - The hierarchical index of the item next to which the source item will be moved.
|
|
16
|
-
* @param targetData - The tree which contains the target item.
|
|
17
|
-
* If the argument is skipped, then the move operation will be executed within the same tree.
|
|
18
|
-
* Setting the `sourceData` and `targetData` arguments to the same tree is also supported.
|
|
19
|
-
* @param childrenField - The field that points to the dataItem sub items. Defaults to `items`.
|
|
20
|
-
* @returns - The updated copies of the `sourceData` and `targetData` input arguments.
|
|
21
|
-
* If `targetData` is not passed, then only the updated copy of the `sourceData` will be returned.
|
|
12
|
+
* #### Parameters
|
|
13
|
+
* ##### sourceItemHierarchicalIndex <span class='code'>string</span>
|
|
14
|
+
* The hierarchical index of the item that will be moved.
|
|
22
15
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* class App extends React.Component {
|
|
26
|
-
* dragClue;
|
|
27
|
-
* state = { tree };
|
|
16
|
+
* ##### sourceData <span class='code'>any[] | null | undefined</span>
|
|
17
|
+
* The tree which contains the item that will be moved.
|
|
28
18
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* <div>
|
|
32
|
-
* <TreeView data={this.state.tree} draggable={true}
|
|
33
|
-
* onItemDragOver={this.onItemDragOver} onItemDragEnd={this.onItemDragEnd} />
|
|
34
|
-
* <TreeViewDragClue ref={dragClue => this.dragClue = dragClue} />
|
|
35
|
-
* </div>
|
|
36
|
-
* );
|
|
37
|
-
* }
|
|
19
|
+
* ##### operation <span class='code'>"before" | "after" | "child"</span>
|
|
20
|
+
* The specific move operation.
|
|
38
21
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* this.dragClue.hide();
|
|
44
|
-
* const eventAnalyzer = new TreeViewDragAnalyzer(event).init();
|
|
22
|
+
* The available options are:
|
|
23
|
+
* * `before`—Indicates that the source item will become the previous sibling of the target item.
|
|
24
|
+
* * `after`—Indicates that the source item will become the next sibling of the target item.
|
|
25
|
+
* * `child`—Indicates that the source item will become a child of the target item.
|
|
45
26
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* event.itemHierarchicalIndex,
|
|
49
|
-
* this.state.tree,
|
|
50
|
-
* eventAnalyzer.getDropOperation(),
|
|
51
|
-
* eventAnalyzer.destinationMeta.itemHierarchicalIndex,
|
|
52
|
-
* );
|
|
27
|
+
* ##### targetItemHierarchicalIndex <span class='code'>string</span>
|
|
28
|
+
* The hierarchical index of the item next to which the source item will be moved.
|
|
53
29
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* const eventAnalyzer = new TreeViewDragAnalyzer(event).init();
|
|
59
|
-
* const itemIndex = eventAnalyzer.destinationMeta.itemHierarchicalIndex;
|
|
30
|
+
* ##### targetData? <span class='code'>any[] | null</span>
|
|
31
|
+
* The tree which contains the target item.
|
|
32
|
+
* If the argument is skipped, then the move operation will be executed within the same tree.
|
|
33
|
+
* Setting the `sourceData` and `targetData` arguments to the same tree is also supported.
|
|
60
34
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* case 'child':
|
|
64
|
-
* return 'k-i-plus';
|
|
65
|
-
* case 'before':
|
|
66
|
-
* return itemIndex === '0' || itemIndex.endsWith(`${SEPARATOR}0`) ?
|
|
67
|
-
* 'k-i-insert-up' : 'k-i-insert-middle';
|
|
68
|
-
* case 'after':
|
|
69
|
-
* const siblings = getSiblings(itemIndex, this.state.tree);
|
|
70
|
-
* const lastIndex = Number(itemIndex.split(SEPARATOR).pop());
|
|
35
|
+
* ##### childrenField? <span class='code'>string</span>
|
|
36
|
+
* The field that points to the dataItem sub items. Defaults to `items`.
|
|
71
37
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* }
|
|
76
|
-
* }
|
|
77
|
-
*
|
|
78
|
-
* return 'k-i-cancel';
|
|
79
|
-
* }
|
|
80
|
-
* }
|
|
81
|
-
*
|
|
82
|
-
* function getSiblings(itemIndex, data) {
|
|
83
|
-
* let result = data;
|
|
84
|
-
*
|
|
85
|
-
* const indices = itemIndex.split(SEPARATOR).map(index => Number(index));
|
|
86
|
-
* for (let i = 0; i < indices.length - 1; i++) {
|
|
87
|
-
* result = result[indices[i]].items;
|
|
88
|
-
* }
|
|
89
|
-
*
|
|
90
|
-
* return result;
|
|
91
|
-
* }
|
|
92
|
-
*
|
|
93
|
-
* const SEPARATOR = '_';
|
|
94
|
-
* const tree = [{
|
|
95
|
-
* text: 'Furniture', expanded: true, items: [
|
|
96
|
-
* { text: 'Tables & Chairs', expanded: true },
|
|
97
|
-
* { text: 'Sofas', expanded: true },
|
|
98
|
-
* { text: 'Occasional Furniture', expanded: true }]
|
|
99
|
-
* }, {
|
|
100
|
-
* text: 'Decor', expanded: true, items: [
|
|
101
|
-
* { text: 'Bed Linen', expanded: true },
|
|
102
|
-
* { text: 'Curtains & Blinds', expanded: true },
|
|
103
|
-
* { text: 'Carpets', expanded: true }]
|
|
104
|
-
* }];
|
|
105
|
-
*
|
|
106
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
107
|
-
* ```
|
|
38
|
+
* #### Returns
|
|
39
|
+
* <span class='code'>any[] | { sourceData: any[]; targetData: any[]; }</span> - The updated copies of the `sourceData` and `targetData` input arguments.
|
|
40
|
+
* If `targetData` is not passed, then only the updated copy of the `sourceData` will be returned.
|
|
108
41
|
*/
|
|
109
|
-
|
|
42
|
+
var moveTreeViewItem = function (sourceItemHierarchicalIndex, sourceData, operation, targetItemHierarchicalIndex, targetData, childrenField) {
|
|
110
43
|
var subItemsField = childrenField || CHILDREN_FIELD;
|
|
111
44
|
if (!validateInput()) {
|
|
112
45
|
return prepareInputDataForReturn();
|
|
@@ -153,4 +86,8 @@ export default function moveTreeViewItem(sourceItemHierarchicalIndex, sourceData
|
|
|
153
86
|
}
|
|
154
87
|
return true;
|
|
155
88
|
}
|
|
156
|
-
}
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* @hidden
|
|
92
|
+
*/
|
|
93
|
+
export { moveTreeViewItem };
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-treeview',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1655458437,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -1,51 +1,24 @@
|
|
|
1
1
|
import { TreeViewOperationDescriptors } from './TreeViewOperationDescriptors';
|
|
2
2
|
/**
|
|
3
3
|
* A helper function which applies the specified operation descriptors to the data.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* [Expanding and collapsing items]({% slug expansion_ways_treeview %}#toc-using-a-helper-function)
|
|
5
|
+
* [Selecting and deselecting items]({% slug selection_ways_treeview %}#toc-using-a-helper-function)
|
|
6
|
+
* [Checking and unchecking items]({% slug check_helper_funcs_treeview %})
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* {% meta height:350 %}
|
|
9
|
+
* {% embed_file select/selection-update-helper-function/main.vue preview %}
|
|
10
|
+
* {% embed_file select/selection-update-helper-function/main.js %}
|
|
11
|
+
* {% endmeta %}
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* state = { items: tree, expand: [], select: [], check: [] };
|
|
16
|
-
* render() {
|
|
17
|
-
* const { expand, select, check } = this.state;
|
|
18
|
-
* return (
|
|
19
|
-
* <TreeView
|
|
20
|
-
* data={processTreeViewItems(this.state.items, { expand, select, check })}
|
|
21
|
-
* expandIcons={true} onExpandChange={this.onExpandChange} checkboxes={true}
|
|
22
|
-
* onCheckChange={event => this.setState({ check: [ event.itemHierarchicalIndex ] })}
|
|
23
|
-
* onItemClick={event => this.setState({ select: [ event.itemHierarchicalIndex ] })}
|
|
24
|
-
* />
|
|
25
|
-
* );
|
|
26
|
-
* }
|
|
27
|
-
* onExpandChange = (event) => {
|
|
28
|
-
* let expand = this.state.expand.slice();
|
|
29
|
-
* const index = expand.indexOf(event.itemHierarchicalIndex);
|
|
30
|
-
* index === -1 ? expand.push(event.itemHierarchicalIndex) : expand.splice(index, 1);
|
|
31
|
-
* this.setState({ expand });
|
|
32
|
-
* }
|
|
33
|
-
* }
|
|
13
|
+
* #### Parameters
|
|
14
|
+
* ##### data <span class='code'>any[] | null | undefined</span>
|
|
15
|
+
* The data that will be processed.
|
|
34
16
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* items: [
|
|
38
|
-
* { text: 'Item1.1' },
|
|
39
|
-
* { text: 'Item1.2' },
|
|
40
|
-
* { text: 'Item1.3', items: [{ text: 'Item1.3.1' }] }]
|
|
41
|
-
* }, {
|
|
42
|
-
* text: 'Item2', disabled: true,
|
|
43
|
-
* items: [{ text: 'Item2.1' }, { text: 'Item2.2' }, { text: 'Item2.3' }]
|
|
44
|
-
* }, {
|
|
45
|
-
* text: 'Item3'
|
|
46
|
-
* }];
|
|
17
|
+
* ##### operations <span class='code'>[TreeViewOperationDescriptors]({% slug api_treeview_treeviewoperationdescriptors %})</span>
|
|
18
|
+
* The operation descriptors that will be applied to the data.
|
|
47
19
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
20
|
+
* #### Returns
|
|
21
|
+
* <span class='code'>any[]</span> - The processed copy of the input data.
|
|
50
22
|
*/
|
|
51
|
-
|
|
23
|
+
declare const processTreeViewItems: (data: any[] | null | undefined, operations: TreeViewOperationDescriptors) => any[];
|
|
24
|
+
export { processTreeViewItems };
|
|
@@ -15,54 +15,26 @@ import { EXPAND_FIELD, SELECT_FIELD, CHECK_FIELD, CHECK_INDETERMINATE_FIELD, CHI
|
|
|
15
15
|
import { getNestedValue, isArray } from './utils/misc';
|
|
16
16
|
/**
|
|
17
17
|
* A helper function which applies the specified operation descriptors to the data.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* [Expanding and collapsing items]({% slug expansion_ways_treeview %}#toc-using-a-helper-function)
|
|
19
|
+
* [Selecting and deselecting items]({% slug selection_ways_treeview %}#toc-using-a-helper-function)
|
|
20
|
+
* [Checking and unchecking items]({% slug check_helper_funcs_treeview %})
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* {% meta height:350 %}
|
|
23
|
+
* {% embed_file select/selection-update-helper-function/main.vue preview %}
|
|
24
|
+
* {% embed_file select/selection-update-helper-function/main.js %}
|
|
25
|
+
* {% endmeta %}
|
|
25
26
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* state = { items: tree, expand: [], select: [], check: [] };
|
|
30
|
-
* render() {
|
|
31
|
-
* const { expand, select, check } = this.state;
|
|
32
|
-
* return (
|
|
33
|
-
* <TreeView
|
|
34
|
-
* data={processTreeViewItems(this.state.items, { expand, select, check })}
|
|
35
|
-
* expandIcons={true} onExpandChange={this.onExpandChange} checkboxes={true}
|
|
36
|
-
* onCheckChange={event => this.setState({ check: [ event.itemHierarchicalIndex ] })}
|
|
37
|
-
* onItemClick={event => this.setState({ select: [ event.itemHierarchicalIndex ] })}
|
|
38
|
-
* />
|
|
39
|
-
* );
|
|
40
|
-
* }
|
|
41
|
-
* onExpandChange = (event) => {
|
|
42
|
-
* let expand = this.state.expand.slice();
|
|
43
|
-
* const index = expand.indexOf(event.itemHierarchicalIndex);
|
|
44
|
-
* index === -1 ? expand.push(event.itemHierarchicalIndex) : expand.splice(index, 1);
|
|
45
|
-
* this.setState({ expand });
|
|
46
|
-
* }
|
|
47
|
-
* }
|
|
27
|
+
* #### Parameters
|
|
28
|
+
* ##### data <span class='code'>any[] | null | undefined</span>
|
|
29
|
+
* The data that will be processed.
|
|
48
30
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* items: [
|
|
52
|
-
* { text: 'Item1.1' },
|
|
53
|
-
* { text: 'Item1.2' },
|
|
54
|
-
* { text: 'Item1.3', items: [{ text: 'Item1.3.1' }] }]
|
|
55
|
-
* }, {
|
|
56
|
-
* text: 'Item2', disabled: true,
|
|
57
|
-
* items: [{ text: 'Item2.1' }, { text: 'Item2.2' }, { text: 'Item2.3' }]
|
|
58
|
-
* }, {
|
|
59
|
-
* text: 'Item3'
|
|
60
|
-
* }];
|
|
31
|
+
* ##### operations <span class='code'>[TreeViewOperationDescriptors]({% slug api_treeview_treeviewoperationdescriptors %})</span>
|
|
32
|
+
* The operation descriptors that will be applied to the data.
|
|
61
33
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
34
|
+
* #### Returns
|
|
35
|
+
* <span class='code'>any[]</span> - The processed copy of the input data.
|
|
64
36
|
*/
|
|
65
|
-
|
|
37
|
+
var processTreeViewItems = function (data, operations) {
|
|
66
38
|
if (!data || !data.length) {
|
|
67
39
|
return [];
|
|
68
40
|
}
|
|
@@ -77,7 +49,7 @@ export default function processTreeViewItems(data, operations) {
|
|
|
77
49
|
result = handleOperation(result, checkField, operations.check, cloneField, childrenField);
|
|
78
50
|
applyCheckIndeterminate(result, childrenField, operations.check);
|
|
79
51
|
return result;
|
|
80
|
-
}
|
|
52
|
+
};
|
|
81
53
|
function handleOperation(items, defaultField, operation, cloneField, childrenField) {
|
|
82
54
|
if (operation) {
|
|
83
55
|
var _a = parseOperation(operation, defaultField), ids = _a.ids, field = _a.field;
|
|
@@ -164,3 +136,4 @@ function applyCheckIndeterminateHelper(data, parents, childrenField, checkField,
|
|
|
164
136
|
}
|
|
165
137
|
}
|
|
166
138
|
}
|
|
139
|
+
export { processTreeViewItems };
|
package/dist/npm/TreeView.d.ts
CHANGED
|
@@ -41,6 +41,76 @@ export interface TreeViewData {
|
|
|
41
41
|
*/
|
|
42
42
|
export interface TreeViewAll extends Vue, TreeViewMethods, TreeViewData, TreeViewComputed, TreeViewState {
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*/
|
|
44
47
|
declare let TreeViewVue2: ComponentOptions<TreeViewAll, DefaultData<TreeViewData>, DefaultMethods<TreeViewAll>, TreeViewComputed, RecordPropsDefinition<TreeViewProps>>;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
*
|
|
51
|
+
* Represents the [Kendo UI for Vue Native TreeView component]({% slug overview_treeview %}).
|
|
52
|
+
*
|
|
53
|
+
* ```jsx
|
|
54
|
+
* <template>
|
|
55
|
+
* <div>
|
|
56
|
+
* <TreeView :dataItems="tree" />
|
|
57
|
+
* </div>
|
|
58
|
+
* </template>
|
|
59
|
+
*
|
|
60
|
+
* <script>
|
|
61
|
+
* import { TreeView } from '@progress/kendo-vue-treeview';
|
|
62
|
+
*
|
|
63
|
+
* export default {
|
|
64
|
+
* components: {
|
|
65
|
+
* TreeView,
|
|
66
|
+
* },
|
|
67
|
+
* data() {
|
|
68
|
+
* return {
|
|
69
|
+
* tree: [
|
|
70
|
+
* {
|
|
71
|
+
* text: 'Furniture',
|
|
72
|
+
* expanded: true,
|
|
73
|
+
* items: [
|
|
74
|
+
* {
|
|
75
|
+
* text: 'Tables & Chairs',
|
|
76
|
+
* },
|
|
77
|
+
* {
|
|
78
|
+
* text: 'Sofas',
|
|
79
|
+
* },
|
|
80
|
+
* {
|
|
81
|
+
* text: 'Occasional Furniture',
|
|
82
|
+
* },
|
|
83
|
+
* ],
|
|
84
|
+
* },
|
|
85
|
+
* {
|
|
86
|
+
* text: 'Decor',
|
|
87
|
+
* expanded: true,
|
|
88
|
+
* items: [
|
|
89
|
+
* {
|
|
90
|
+
* text: 'Bed Linen',
|
|
91
|
+
* },
|
|
92
|
+
* {
|
|
93
|
+
* text: 'Curtains & Blinds',
|
|
94
|
+
* },
|
|
95
|
+
* {
|
|
96
|
+
* text: 'Carpets',
|
|
97
|
+
* },
|
|
98
|
+
* ],
|
|
99
|
+
* },
|
|
100
|
+
* ],
|
|
101
|
+
* };
|
|
102
|
+
* },
|
|
103
|
+
* };
|
|
104
|
+
* </script>
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
*
|
|
108
|
+
*
|
|
109
|
+
* ### props <span class='code'>Readonly<[TreeViewProps]({% slug api_treeview_treeviewprops %})></span>
|
|
110
|
+
* The props of the TreeView component.
|
|
111
|
+
*
|
|
112
|
+
* ### guid <span class='code'>string</span>
|
|
113
|
+
* Returns the `guid` which is associated with the TreeView.
|
|
114
|
+
*/
|
|
45
115
|
declare const TreeView: DefineComponent<TreeViewProps, any, TreeViewData, TreeViewComputed, TreeViewMethods, {}, {}, {}, string, TreeViewProps, TreeViewProps, {}>;
|
|
46
116
|
export { TreeView, TreeViewVue2 };
|
package/dist/npm/TreeView.js
CHANGED
|
@@ -26,7 +26,10 @@ var package_metadata_1 = require("./package-metadata");
|
|
|
26
26
|
|
|
27
27
|
var consts_1 = require("./utils/consts");
|
|
28
28
|
|
|
29
|
-
var sizeMap = kendo_vue_common_1.kendoThemeMaps.sizeMap;
|
|
29
|
+
var sizeMap = kendo_vue_common_1.kendoThemeMaps.sizeMap;
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
30
33
|
|
|
31
34
|
var TreeViewVue2 = {
|
|
32
35
|
name: 'KendoTreeView',
|
|
@@ -376,5 +379,73 @@ var TreeViewVue2 = {
|
|
|
376
379
|
}
|
|
377
380
|
};
|
|
378
381
|
exports.TreeViewVue2 = TreeViewVue2;
|
|
382
|
+
/**
|
|
383
|
+
*
|
|
384
|
+
*
|
|
385
|
+
* Represents the [Kendo UI for Vue Native TreeView component]({% slug overview_treeview %}).
|
|
386
|
+
*
|
|
387
|
+
* ```jsx
|
|
388
|
+
* <template>
|
|
389
|
+
* <div>
|
|
390
|
+
* <TreeView :dataItems="tree" />
|
|
391
|
+
* </div>
|
|
392
|
+
* </template>
|
|
393
|
+
*
|
|
394
|
+
* <script>
|
|
395
|
+
* import { TreeView } from '@progress/kendo-vue-treeview';
|
|
396
|
+
*
|
|
397
|
+
* export default {
|
|
398
|
+
* components: {
|
|
399
|
+
* TreeView,
|
|
400
|
+
* },
|
|
401
|
+
* data() {
|
|
402
|
+
* return {
|
|
403
|
+
* tree: [
|
|
404
|
+
* {
|
|
405
|
+
* text: 'Furniture',
|
|
406
|
+
* expanded: true,
|
|
407
|
+
* items: [
|
|
408
|
+
* {
|
|
409
|
+
* text: 'Tables & Chairs',
|
|
410
|
+
* },
|
|
411
|
+
* {
|
|
412
|
+
* text: 'Sofas',
|
|
413
|
+
* },
|
|
414
|
+
* {
|
|
415
|
+
* text: 'Occasional Furniture',
|
|
416
|
+
* },
|
|
417
|
+
* ],
|
|
418
|
+
* },
|
|
419
|
+
* {
|
|
420
|
+
* text: 'Decor',
|
|
421
|
+
* expanded: true,
|
|
422
|
+
* items: [
|
|
423
|
+
* {
|
|
424
|
+
* text: 'Bed Linen',
|
|
425
|
+
* },
|
|
426
|
+
* {
|
|
427
|
+
* text: 'Curtains & Blinds',
|
|
428
|
+
* },
|
|
429
|
+
* {
|
|
430
|
+
* text: 'Carpets',
|
|
431
|
+
* },
|
|
432
|
+
* ],
|
|
433
|
+
* },
|
|
434
|
+
* ],
|
|
435
|
+
* };
|
|
436
|
+
* },
|
|
437
|
+
* };
|
|
438
|
+
* </script>
|
|
439
|
+
* ```
|
|
440
|
+
*
|
|
441
|
+
*
|
|
442
|
+
*
|
|
443
|
+
* ### props <span class='code'>Readonly<[TreeViewProps]({% slug api_treeview_treeviewprops %})></span>
|
|
444
|
+
* The props of the TreeView component.
|
|
445
|
+
*
|
|
446
|
+
* ### guid <span class='code'>string</span>
|
|
447
|
+
* Returns the `guid` which is associated with the TreeView.
|
|
448
|
+
*/
|
|
449
|
+
|
|
379
450
|
var TreeView = TreeViewVue2;
|
|
380
451
|
exports.TreeView = TreeView;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { TreeViewItemDragOverEvent, TreeViewItemDragEndEvent } from './events';
|
|
2
2
|
/**
|
|
3
3
|
* A class which provides an API for analyzing the `drag` events
|
|
4
|
-
*
|
|
4
|
+
* of the TreeView.
|
|
5
5
|
*
|
|
6
|
+
* {% meta height:400 %}
|
|
7
|
+
* {% embed_file drag/single/main.vue preview %}
|
|
8
|
+
* {% embed_file drag/single/main.js %}
|
|
9
|
+
* {% endmeta %}
|
|
10
|
+
*
|
|
11
|
+
* ### destinationMeta <span class='code'>{ itemHierarchicalIndex: string; treeViewGuid: string; }</span>
|
|
12
|
+
* Returns an object which contains:
|
|
13
|
+
* * The `itemHierarchicalIndex` of the destination item (the item below the dragged item) and
|
|
14
|
+
* * The `guid` of the destination TreeView (the TreeView which renders the destination item).
|
|
15
|
+
*
|
|
16
|
+
* ### isDropAllowed <span class='code'>boolean</span>
|
|
17
|
+
* Returns `true` if dropping is allowed. Otherwise, returns `false`.
|
|
6
18
|
*/
|
|
7
|
-
|
|
19
|
+
declare class TreeViewDragAnalyzer {
|
|
8
20
|
private event;
|
|
9
21
|
private itemId;
|
|
10
22
|
private treeViewGuid;
|
|
@@ -48,3 +60,4 @@ export default class TreeViewDragAnalyzer {
|
|
|
48
60
|
getDropOperation(): "before" | "after" | "child";
|
|
49
61
|
private setDestimationMeta;
|
|
50
62
|
}
|
|
63
|
+
export { TreeViewDragAnalyzer };
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TreeViewDragAnalyzer = void 0;
|
|
3
4
|
var consts_1 = require("./utils/consts");
|
|
4
5
|
var DROPZONE_BOUNDARY_DELTA = 6;
|
|
5
6
|
/**
|
|
6
7
|
* A class which provides an API for analyzing the `drag` events
|
|
7
|
-
*
|
|
8
|
+
* of the TreeView.
|
|
8
9
|
*
|
|
10
|
+
* {% meta height:400 %}
|
|
11
|
+
* {% embed_file drag/single/main.vue preview %}
|
|
12
|
+
* {% embed_file drag/single/main.js %}
|
|
13
|
+
* {% endmeta %}
|
|
14
|
+
*
|
|
15
|
+
* ### destinationMeta <span class='code'>{ itemHierarchicalIndex: string; treeViewGuid: string; }</span>
|
|
16
|
+
* Returns an object which contains:
|
|
17
|
+
* * The `itemHierarchicalIndex` of the destination item (the item below the dragged item) and
|
|
18
|
+
* * The `guid` of the destination TreeView (the TreeView which renders the destination item).
|
|
19
|
+
*
|
|
20
|
+
* ### isDropAllowed <span class='code'>boolean</span>
|
|
21
|
+
* Returns `true` if dropping is allowed. Otherwise, returns `false`.
|
|
9
22
|
*/
|
|
10
23
|
var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
11
24
|
/**
|
|
@@ -98,4 +111,4 @@ var TreeViewDragAnalyzer = /** @class */ (function () {
|
|
|
98
111
|
};
|
|
99
112
|
return TreeViewDragAnalyzer;
|
|
100
113
|
}());
|
|
101
|
-
exports.
|
|
114
|
+
exports.TreeViewDragAnalyzer = TreeViewDragAnalyzer;
|