@progress/kendo-vue-treelist 3.5.4 → 3.6.0-dev.202209130634
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-treelist.js +1 -1
- package/dist/es/TreeList.js +22 -10
- package/dist/es/interfaces/TreeListProps.d.ts +67 -5
- package/dist/es/main.d.ts +1 -3
- package/dist/es/main.js +1 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rows/TreeListDraggableRow.js +2 -2
- package/dist/esm/TreeList.js +22 -10
- package/dist/esm/interfaces/TreeListProps.d.ts +67 -5
- package/dist/esm/main.d.ts +1 -3
- package/dist/esm/main.js +1 -2
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/rows/TreeListDraggableRow.js +2 -2
- package/dist/npm/TreeList.js +21 -7
- package/dist/npm/interfaces/TreeListProps.d.ts +67 -5
- package/dist/npm/main.d.ts +1 -3
- package/dist/npm/main.js +1 -3
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rows/TreeListDraggableRow.js +2 -2
- package/package.json +11 -11
- package/dist/es/TreeListNoRecords.d.ts +0 -15
- package/dist/es/TreeListNoRecords.js +0 -46
- package/dist/es/header/TreeListHeaderCell.d.ts +0 -1
- package/dist/es/header/TreeListHeaderCell.js +0 -4
- package/dist/es/header/TreeListHeaderSelectionCell.d.ts +0 -1
- package/dist/es/header/TreeListHeaderSelectionCell.js +0 -12
- package/dist/es/interfaces/TreeListNoRecordsProps.d.ts +0 -5
- package/dist/es/interfaces/TreeListNoRecordsProps.js +0 -1
- package/dist/esm/TreeListNoRecords.d.ts +0 -15
- package/dist/esm/TreeListNoRecords.js +0 -46
- package/dist/esm/header/TreeListHeaderCell.d.ts +0 -1
- package/dist/esm/header/TreeListHeaderCell.js +0 -4
- package/dist/esm/header/TreeListHeaderSelectionCell.d.ts +0 -1
- package/dist/esm/header/TreeListHeaderSelectionCell.js +0 -12
- package/dist/esm/interfaces/TreeListNoRecordsProps.d.ts +0 -5
- package/dist/esm/interfaces/TreeListNoRecordsProps.js +0 -1
- package/dist/npm/TreeListNoRecords.d.ts +0 -15
- package/dist/npm/TreeListNoRecords.js +0 -58
- package/dist/npm/header/TreeListHeaderCell.d.ts +0 -1
- package/dist/npm/header/TreeListHeaderCell.js +0 -5
- package/dist/npm/header/TreeListHeaderSelectionCell.d.ts +0 -1
- package/dist/npm/header/TreeListHeaderSelectionCell.js +0 -13
- package/dist/npm/interfaces/TreeListNoRecordsProps.d.ts +0 -5
- package/dist/npm/interfaces/TreeListNoRecordsProps.js +0 -2
package/dist/es/TreeList.js
CHANGED
|
@@ -42,22 +42,18 @@ import * as Vue from 'vue';
|
|
|
42
42
|
var allVue = Vue;
|
|
43
43
|
var gh = allVue.h;
|
|
44
44
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
45
|
-
var ref = allVue.ref;
|
|
46
|
-
var markRaw = allVue.markRaw;
|
|
47
45
|
import { classNames, noop, getter, guid, getDefaultSlots, templateRendering, getListeners, getTemplate, isRtl, getRef } from '@progress/kendo-vue-common';
|
|
48
|
-
import { Header, HeaderRow, FilterRow as TreeListFilterRow, ColumnResize, CommonDragLogic, DragClue, DropClue, tableColumnsVirtualization, readColumns, mapColumns,
|
|
49
|
-
// TableKeyboardNavigationContext,
|
|
50
|
-
TableKeyboardNavigationProvider, tableKeyboardNavigationTools as navigationTools, operators, getSelectionOptions, normalize, Pager } from '@progress/kendo-vue-data-tools';
|
|
46
|
+
import { Header, HeaderRow, FilterRow as TreeListFilterRow, ColumnResize, CommonDragLogic, DragClue, DropClue, tableColumnsVirtualization, readColumns, mapColumns, TableKeyboardNavigationProvider, tableKeyboardNavigationTools as navigationTools, operators, getSelectionOptions, normalize, Pager } from '@progress/kendo-vue-data-tools';
|
|
51
47
|
import { TreeListNav } from './TreeListNav';
|
|
52
48
|
import { getNestedValue, setHeaderRowsTop, tableRowsVirtualization } from './utils/main';
|
|
53
49
|
import { flatData as _flatData } from './utils/data-operations';
|
|
54
50
|
import { TreeListCell } from './cells/TreeListCell';
|
|
55
|
-
import { TreeListNoRecords } from './TreeListNoRecords';
|
|
56
51
|
import { TreeListRow } from './rows/TreeListRow';
|
|
57
52
|
import { validatePackage } from '@progress/kendo-vue-common';
|
|
58
53
|
import { packageMetadata } from './package-metadata';
|
|
59
54
|
import { hasListener } from '@progress/kendo-vue-common';
|
|
60
|
-
import { pagerMessagesMap } from './messages/main';
|
|
55
|
+
import { messages, pagerMessagesMap, noRecords } from './messages/main';
|
|
56
|
+
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
61
57
|
/**
|
|
62
58
|
* @hidden
|
|
63
59
|
*/
|
|
@@ -110,6 +106,11 @@ var TreeListVue2 = {
|
|
|
110
106
|
// navigationStateRef: this.navigationStateRef
|
|
111
107
|
// });
|
|
112
108
|
},
|
|
109
|
+
inject: {
|
|
110
|
+
kendoLocalizationService: {
|
|
111
|
+
default: null
|
|
112
|
+
}
|
|
113
|
+
},
|
|
113
114
|
data: function data() {
|
|
114
115
|
return {
|
|
115
116
|
wrapperScrollLeft: 0,
|
|
@@ -238,8 +239,9 @@ var TreeListVue2 = {
|
|
|
238
239
|
h(Header, {
|
|
239
240
|
headerRow: // @ts-ignore
|
|
240
241
|
h(HeaderRow, {
|
|
241
|
-
|
|
242
|
+
grid: this,
|
|
242
243
|
attrs: this.v3 ? undefined : {
|
|
244
|
+
grid: this,
|
|
243
245
|
sort: this.$props.sort,
|
|
244
246
|
sortable: this.$props.sortable,
|
|
245
247
|
filterable: this.$props.filterable,
|
|
@@ -276,6 +278,7 @@ var TreeListVue2 = {
|
|
|
276
278
|
isRtl: this.isRtl
|
|
277
279
|
}) : undefined
|
|
278
280
|
},
|
|
281
|
+
sort: this.$props.sort,
|
|
279
282
|
sortable: this.$props.sortable,
|
|
280
283
|
filterable: this.$props.filterable,
|
|
281
284
|
onSortChange: this.sortChange,
|
|
@@ -324,8 +327,9 @@ var TreeListVue2 = {
|
|
|
324
327
|
}),
|
|
325
328
|
attrs: this.v3 ? undefined : {
|
|
326
329
|
headerRow: h(HeaderRow, {
|
|
327
|
-
|
|
330
|
+
grid: this,
|
|
328
331
|
attrs: this.v3 ? undefined : {
|
|
332
|
+
grid: this,
|
|
329
333
|
sort: this.$props.sort,
|
|
330
334
|
sortable: this.$props.sortable,
|
|
331
335
|
filterable: this.$props.filterable,
|
|
@@ -361,6 +365,7 @@ var TreeListVue2 = {
|
|
|
361
365
|
isRtl: this.isRtl
|
|
362
366
|
}) : undefined
|
|
363
367
|
},
|
|
368
|
+
sort: this.$props.sort,
|
|
364
369
|
sortable: this.$props.sortable,
|
|
365
370
|
filterable: this.$props.filterable,
|
|
366
371
|
onSortChange: this.sortChange,
|
|
@@ -523,6 +528,13 @@ var TreeListVue2 = {
|
|
|
523
528
|
this.updateOnScroll = false;
|
|
524
529
|
}
|
|
525
530
|
|
|
531
|
+
var noRecordsTemplate = templateRendering.call(this, this.$props.noRecords, getListeners.call(this));
|
|
532
|
+
var localizationService = provideLocalizationService(this);
|
|
533
|
+
var noRecordsMessage = localizationService.toLanguageString(noRecords, messages[noRecords]);
|
|
534
|
+
var noRecordsRender = getTemplate.call(this, {
|
|
535
|
+
h: h,
|
|
536
|
+
template: noRecordsTemplate
|
|
537
|
+
});
|
|
526
538
|
var levels = flattedData.length ? flattedData.map(function (i) {
|
|
527
539
|
return i.level;
|
|
528
540
|
}) : [];
|
|
@@ -604,7 +616,7 @@ var TreeListVue2 = {
|
|
|
604
616
|
attrs: this.v3 ? undefined : {
|
|
605
617
|
colSpan: leafColumns.length
|
|
606
618
|
}
|
|
607
|
-
}, [this.$props.noRecords
|
|
619
|
+
}, [this.$props.noRecords ? noRecordsRender : noRecordsMessage])]);
|
|
608
620
|
|
|
609
621
|
var sorted = function sorted(field) {
|
|
610
622
|
return _this.$props.sort && _this.$props.sort.some(function (descriptor) {
|
|
@@ -5,7 +5,7 @@ import { SortSettings as TreeListSortSettings } from '@progress/kendo-vue-data-t
|
|
|
5
5
|
import { TreeListColumnProps } from './TreeListColumnProps';
|
|
6
6
|
import { TreeListSelectableSettings } from './TreeListSelectableSettings';
|
|
7
7
|
/**
|
|
8
|
-
* Represents the props of the [
|
|
8
|
+
* Represents the props of the [Kendo UI for Vue TreeList component]({% slug getstarted_treelist %}).
|
|
9
9
|
*/
|
|
10
10
|
export interface TreeListProps {
|
|
11
11
|
/**
|
|
@@ -13,10 +13,6 @@ export interface TreeListProps {
|
|
|
13
13
|
* If not set, the dataItem index will be used for the row key, which might lead to row not updated during paging or scrolling.
|
|
14
14
|
*/
|
|
15
15
|
dataItemKey?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Sets custom CSS classes to the TreeList DOM element.
|
|
18
|
-
*/
|
|
19
|
-
className?: string;
|
|
20
16
|
/**
|
|
21
17
|
* A collection of `TreeListColumnProps` for creating columns.
|
|
22
18
|
*/
|
|
@@ -51,6 +47,9 @@ export interface TreeListProps {
|
|
|
51
47
|
/**
|
|
52
48
|
* If set and when the data item is in edit mode, the `editRow` value will be rendered.
|
|
53
49
|
*/
|
|
50
|
+
/**
|
|
51
|
+
* @hidden
|
|
52
|
+
*/
|
|
54
53
|
editRow?: any;
|
|
55
54
|
/**
|
|
56
55
|
* Represents the TreeList toolbar component.
|
|
@@ -90,16 +89,25 @@ export interface TreeListProps {
|
|
|
90
89
|
/**
|
|
91
90
|
* The TreeList selectable settings.
|
|
92
91
|
*/
|
|
92
|
+
/**
|
|
93
|
+
* @hidden
|
|
94
|
+
*/
|
|
93
95
|
selectable?: TreeListSelectableSettings;
|
|
94
96
|
/**
|
|
95
97
|
* Specifies the name of the field which will provide a Boolean representation of the selected state of the item
|
|
96
98
|
* ([see example]({% slug selection_treelist %})).
|
|
97
99
|
*/
|
|
100
|
+
/**
|
|
101
|
+
* @hidden
|
|
102
|
+
*/
|
|
98
103
|
selectedField?: string;
|
|
99
104
|
/**
|
|
100
105
|
* Fires when the user tries to select or deselect a row or cell.
|
|
101
106
|
* ([more information and example]({% slug selection_treelist %})).
|
|
102
107
|
*/
|
|
108
|
+
/**
|
|
109
|
+
* @hidden
|
|
110
|
+
*/
|
|
103
111
|
onSelectionChange?: (event: TreeListSelectionChangeEvent) => void;
|
|
104
112
|
/**
|
|
105
113
|
* Fires when the user press keyboard key.
|
|
@@ -109,29 +117,47 @@ export interface TreeListProps {
|
|
|
109
117
|
* Fires when the user clicks the checkbox of a column header whose `field` matches `selectedField`
|
|
110
118
|
* ([more information and example]({% slug selection_treelist %})).
|
|
111
119
|
*/
|
|
120
|
+
/**
|
|
121
|
+
* @hidden
|
|
122
|
+
*/
|
|
112
123
|
onHeaderSelectionChange?: (event: TreeListHeaderSelectionChangeEvent) => void;
|
|
113
124
|
/**
|
|
114
125
|
* Fires when the user changes the values of the item.
|
|
115
126
|
* The event is not debounced and fires on every `onChange` event of the input in the current `EditCell`
|
|
116
127
|
* ([more information and examples]({% slug editing_inline_treelist %})).
|
|
117
128
|
*/
|
|
129
|
+
/**
|
|
130
|
+
* @hidden
|
|
131
|
+
*/
|
|
118
132
|
onItemChange?: (event: TreeListItemChangeEvent) => void;
|
|
119
133
|
/**
|
|
120
134
|
* Fires when the user clicks a row.
|
|
121
135
|
*/
|
|
136
|
+
/**
|
|
137
|
+
* @hidden
|
|
138
|
+
*/
|
|
122
139
|
onRowClick?: (event: TreeListRowClickEvent) => void;
|
|
123
140
|
/**
|
|
124
141
|
* Fires when the user double clicks a row.
|
|
125
142
|
*/
|
|
143
|
+
/**
|
|
144
|
+
* @hidden
|
|
145
|
+
*/
|
|
126
146
|
onRowDoubleClick?: (event: TreeListRowDoubleClickEvent) => void;
|
|
127
147
|
/**
|
|
128
148
|
* Fires when the user trigger the context menu of row.
|
|
129
149
|
*/
|
|
150
|
+
/**
|
|
151
|
+
* @hidden
|
|
152
|
+
*/
|
|
130
153
|
onRowContextMenu?: (event: TreeListRowContextMenuEvent) => void;
|
|
131
154
|
/**
|
|
132
155
|
* Specifies the name of the field which will provide a Boolean representation of the edit state of the current item
|
|
133
156
|
* ([more information and examples]({% slug editing_inline_treelist %})).
|
|
134
157
|
*/
|
|
158
|
+
/**
|
|
159
|
+
* @hidden
|
|
160
|
+
*/
|
|
135
161
|
editField?: string;
|
|
136
162
|
/**
|
|
137
163
|
* Defines the scroll mode of the TreeList.
|
|
@@ -148,14 +174,23 @@ export interface TreeListProps {
|
|
|
148
174
|
/**
|
|
149
175
|
* If set to `true`, the user can resize columns by dragging the edges (resize handles) of their header cells.
|
|
150
176
|
*/
|
|
177
|
+
/**
|
|
178
|
+
* @hidden
|
|
179
|
+
*/
|
|
151
180
|
resizable?: boolean;
|
|
152
181
|
/**
|
|
153
182
|
* If set to `true`, the user can reorder columns by dragging their header cells.
|
|
154
183
|
*/
|
|
184
|
+
/**
|
|
185
|
+
* @hidden
|
|
186
|
+
*/
|
|
155
187
|
reorderable?: boolean;
|
|
156
188
|
/**
|
|
157
189
|
* If set to `true`, the user can drag and drop rows.
|
|
158
190
|
*/
|
|
191
|
+
/**
|
|
192
|
+
* @hidden
|
|
193
|
+
*/
|
|
159
194
|
rowDraggable?: boolean;
|
|
160
195
|
/**
|
|
161
196
|
* Defines the row height and implements equal heights for all rows.
|
|
@@ -182,8 +217,17 @@ export interface TreeListProps {
|
|
|
182
217
|
* @param item - the item for the row.
|
|
183
218
|
*/
|
|
184
219
|
rowClass?: Function;
|
|
220
|
+
/**
|
|
221
|
+
* @hidden
|
|
222
|
+
*/
|
|
185
223
|
columnMenu?: any;
|
|
224
|
+
/**
|
|
225
|
+
* @hidden
|
|
226
|
+
*/
|
|
186
227
|
columnMenuFilter?: CompositeFilterDescriptor[];
|
|
228
|
+
/**
|
|
229
|
+
* @hidden
|
|
230
|
+
*/
|
|
187
231
|
onColumnMenuFilterChange?: (event: TreeListColumnMenuFilterChangeEvent) => void;
|
|
188
232
|
/**
|
|
189
233
|
* The pager component that the TreeList will render.
|
|
@@ -204,6 +248,9 @@ export interface TreeListProps {
|
|
|
204
248
|
/**
|
|
205
249
|
* The TreeList row component.
|
|
206
250
|
*/
|
|
251
|
+
/**
|
|
252
|
+
* @hidden
|
|
253
|
+
*/
|
|
207
254
|
row?: any;
|
|
208
255
|
/**
|
|
209
256
|
* If set to `true`, the user can use dedicated shortcuts to interact with the TreeList.
|
|
@@ -221,22 +268,37 @@ export interface TreeListProps {
|
|
|
221
268
|
/**
|
|
222
269
|
* Fires when a column is resized.
|
|
223
270
|
*/
|
|
271
|
+
/**
|
|
272
|
+
* @hidden
|
|
273
|
+
*/
|
|
224
274
|
onColumnResize?: (event: TreeListColumnResizeEvent) => void;
|
|
225
275
|
/**
|
|
226
276
|
* Fires when the columns are reordered.
|
|
227
277
|
*/
|
|
278
|
+
/**
|
|
279
|
+
* @hidden
|
|
280
|
+
*/
|
|
228
281
|
onColumnReorder?: (event: TreeListColumnReorderEvent) => void;
|
|
229
282
|
/**
|
|
230
283
|
* Fires when a row is dragged.
|
|
231
284
|
*/
|
|
285
|
+
/**
|
|
286
|
+
* @hidden
|
|
287
|
+
*/
|
|
232
288
|
onRowDrag?: (event: TreeListRowDragEvent) => void;
|
|
233
289
|
/**
|
|
234
290
|
* Fires when a row is dragged and dropped.
|
|
235
291
|
*/
|
|
292
|
+
/**
|
|
293
|
+
* @hidden
|
|
294
|
+
*/
|
|
236
295
|
onRowDrop?: (event: TreeListRowDragEvent) => void;
|
|
237
296
|
/**
|
|
238
297
|
* Fires when a row is about to be rendered. Useful for overriding the default rendering of the row.
|
|
239
298
|
*/
|
|
299
|
+
/**
|
|
300
|
+
* @hidden
|
|
301
|
+
*/
|
|
240
302
|
rowRender?: any;
|
|
241
303
|
/**
|
|
242
304
|
* Fires when a cell is about to be rendered. Useful for overriding the default rendering of the cell.
|
package/dist/es/main.d.ts
CHANGED
|
@@ -8,8 +8,6 @@ import { TreeListSelectionCell } from './cells/TreeListSelectionCell';
|
|
|
8
8
|
import { TreeListRow } from './rows/TreeListRow';
|
|
9
9
|
import { TreeListRowProps } from './interfaces/TreeListRowProps';
|
|
10
10
|
import { TreeListToolbarProps } from './interfaces/TreeListToolbarProps';
|
|
11
|
-
import { TreeListNoRecords } from './TreeListNoRecords';
|
|
12
|
-
import { TreeListNoRecordsProps } from './interfaces/TreeListNoRecordsProps';
|
|
13
11
|
import { TreeListDataStateChangeEvent, TreeListFilterChangeEvent, TreeListSortChangeEvent, TreeListExpandChangeEvent, TreeListSelectionChangeEvent, TreeListItemChangeEvent, TreeListRowClickEvent, TreeListColumnResizeEvent, TreeListColumnReorderEvent, TreeListPageChangeEvent, TreeListRowDragEvent, TreeListColumnMenuFilterChangeEvent, TreeListHeaderSelectionChangeEvent, TreeListEvent, TreeListRowDoubleClickEvent, TreeListRowContextMenuEvent, TreeListDragSelectionReleaseEvent, TreeListKeyDownEvent } from './interfaces/events';
|
|
14
12
|
import { TreeListSortSettings, TreeListColumnSortSettings } from './interfaces/TreeListSortSettings';
|
|
15
13
|
import { TreeListTextFilter, TreeListTextFilterProps } from './cells/FilterCells/TreeListTextFilter';
|
|
@@ -26,4 +24,4 @@ import { getNestedValue, setHeaderRowsTop, tableRowsVirtualization } from './uti
|
|
|
26
24
|
import { TREELIST_COL_INDEX_ATTRIBUTE, TREELIST_ROW_INDEX_ATTRIBUTE, TREELIST_PREVENT_SELECTION_ELEMENT } from './constants/main';
|
|
27
25
|
import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-vue-data-tools';
|
|
28
26
|
import { TreeListSelectableMode, TreeListSelectableSettings } from './interfaces/TreeListSelectableSettings';
|
|
29
|
-
export { TreeList, TreeListProps, TreeListColumnProps, TreeListCell, TreeListCellProps, TreeListRow, TreeListRowProps, TreeListHeaderCellProps, TreeListSelectionCell, TreeListToolbarProps,
|
|
27
|
+
export { TreeList, TreeListProps, TreeListColumnProps, TreeListCell, TreeListCellProps, TreeListRow, TreeListRowProps, TreeListHeaderCellProps, TreeListSelectionCell, TreeListToolbarProps, TreeListSortSettings, TreeListColumnSortSettings, TreeListTextFilter, TreeListTextFilterProps, TreeListNumericFilter, TreeListNumericFilterProps, TreeListDateFilter, TreeListDateFilterProps, TreeListBooleanFilter, TreeListBooleanFilterProps, TreeListTextEditor, TreeListTextEditorProps, TreeListNumericEditor, TreeListNumericEditorProps, TreeListBooleanEditor, TreeListBooleanEditorProps, TreeListDateEditor, TreeListDateEditorProps, TreeListDataStateChangeEvent, TreeListFilterChangeEvent, TreeListColumnMenuFilterChangeEvent, TreeListSortChangeEvent, TreeListExpandChangeEvent, TreeListSelectionChangeEvent, TreeListItemChangeEvent, TreeListHeaderSelectionChangeEvent, TreeListRowClickEvent, TreeListColumnResizeEvent, TreeListColumnReorderEvent, TreeListPageChangeEvent, TreeListRowDragEvent, TreeListEvent, TreeListRowDoubleClickEvent, TreeListRowContextMenuEvent, TreeListDragSelectionReleaseEvent, TreeListKeyDownEvent, orderBy, filterBy, mapTree, createDataTree, extendDataItem, mapTreeItem, moveTreeItem, getItemPath, removeItems, modifySubItems, treeToFlat, DataItemWrapper, flatData, getNestedValue, setHeaderRowsTop, tableRowsVirtualization, TREELIST_COL_INDEX_ATTRIBUTE, TREELIST_ROW_INDEX_ATTRIBUTE, TREELIST_PREVENT_SELECTION_ELEMENT, getSelectedState, getSelectedStateFromKeyDown, setSelectedState, TreeListSelectableSettings, TreeListSelectableMode };
|
package/dist/es/main.js
CHANGED
|
@@ -2,7 +2,6 @@ import { TreeList } from './TreeList';
|
|
|
2
2
|
import { TreeListCell } from './cells/TreeListCell';
|
|
3
3
|
import { TreeListSelectionCell } from './cells/TreeListSelectionCell';
|
|
4
4
|
import { TreeListRow } from './rows/TreeListRow';
|
|
5
|
-
import { TreeListNoRecords } from './TreeListNoRecords';
|
|
6
5
|
import { TreeListTextFilter } from './cells/FilterCells/TreeListTextFilter';
|
|
7
6
|
import { TreeListNumericFilter } from './cells/FilterCells/TreeListNumericFilter';
|
|
8
7
|
import { TreeListDateFilter } from './cells/FilterCells/TreeListDateFilter';
|
|
@@ -15,4 +14,4 @@ import { orderBy, filterBy, mapTreeItem, moveTreeItem, getItemPath, mapTree, cre
|
|
|
15
14
|
import { getNestedValue, setHeaderRowsTop, tableRowsVirtualization } from './utils/main';
|
|
16
15
|
import { TREELIST_COL_INDEX_ATTRIBUTE, TREELIST_ROW_INDEX_ATTRIBUTE, TREELIST_PREVENT_SELECTION_ELEMENT } from './constants/main';
|
|
17
16
|
import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-vue-data-tools';
|
|
18
|
-
export { TreeList, TreeListCell, TreeListRow, TreeListSelectionCell,
|
|
17
|
+
export { TreeList, TreeListCell, TreeListRow, TreeListSelectionCell, TreeListTextFilter, TreeListNumericFilter, TreeListDateFilter, TreeListBooleanFilter, TreeListTextEditor, TreeListNumericEditor, TreeListBooleanEditor, TreeListDateEditor, orderBy, filterBy, mapTree, createDataTree, extendDataItem, mapTreeItem, moveTreeItem, getItemPath, removeItems, modifySubItems, treeToFlat, flatData, getNestedValue, setHeaderRowsTop, tableRowsVirtualization, TREELIST_COL_INDEX_ATTRIBUTE, TREELIST_ROW_INDEX_ATTRIBUTE, TREELIST_PREVENT_SELECTION_ELEMENT, getSelectedState, getSelectedStateFromKeyDown, setSelectedState };
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-treelist',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1663050707,
|
|
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
|
};
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
// /**
|
|
37
37
|
// * The TreeList draggable row component.
|
|
38
38
|
// */
|
|
39
|
-
// export class TreeListDraggableRow extends
|
|
39
|
+
// export class TreeListDraggableRow extends Component<TreeListRowProps, TreeListRowState> {
|
|
40
40
|
// /**
|
|
41
41
|
// * @hidden
|
|
42
42
|
// */
|
|
43
43
|
// readonly state: TreeListRowState = {
|
|
44
44
|
// clueProps: { ...defaultClueState }
|
|
45
45
|
// };
|
|
46
|
-
// private draggable =
|
|
46
|
+
// private draggable = createRef<Draggable>();
|
|
47
47
|
// private dragged: number[] | null = null;
|
|
48
48
|
// private draggedOver: number[] | null = null;
|
|
49
49
|
// /**
|
package/dist/esm/TreeList.js
CHANGED
|
@@ -42,22 +42,18 @@ import * as Vue from 'vue';
|
|
|
42
42
|
var allVue = Vue;
|
|
43
43
|
var gh = allVue.h;
|
|
44
44
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
45
|
-
var ref = allVue.ref;
|
|
46
|
-
var markRaw = allVue.markRaw;
|
|
47
45
|
import { classNames, noop, getter, guid, getDefaultSlots, templateRendering, getListeners, getTemplate, isRtl, getRef } from '@progress/kendo-vue-common';
|
|
48
|
-
import { Header, HeaderRow, FilterRow as TreeListFilterRow, ColumnResize, CommonDragLogic, DragClue, DropClue, tableColumnsVirtualization, readColumns, mapColumns,
|
|
49
|
-
// TableKeyboardNavigationContext,
|
|
50
|
-
TableKeyboardNavigationProvider, tableKeyboardNavigationTools as navigationTools, operators, getSelectionOptions, normalize, Pager } from '@progress/kendo-vue-data-tools';
|
|
46
|
+
import { Header, HeaderRow, FilterRow as TreeListFilterRow, ColumnResize, CommonDragLogic, DragClue, DropClue, tableColumnsVirtualization, readColumns, mapColumns, TableKeyboardNavigationProvider, tableKeyboardNavigationTools as navigationTools, operators, getSelectionOptions, normalize, Pager } from '@progress/kendo-vue-data-tools';
|
|
51
47
|
import { TreeListNav } from './TreeListNav.js';
|
|
52
48
|
import { getNestedValue, setHeaderRowsTop, tableRowsVirtualization } from './utils/main.js';
|
|
53
49
|
import { flatData as _flatData } from './utils/data-operations.js';
|
|
54
50
|
import { TreeListCell } from './cells/TreeListCell.js';
|
|
55
|
-
import { TreeListNoRecords } from './TreeListNoRecords.js';
|
|
56
51
|
import { TreeListRow } from './rows/TreeListRow.js';
|
|
57
52
|
import { validatePackage } from '@progress/kendo-vue-common';
|
|
58
53
|
import { packageMetadata } from './package-metadata.js';
|
|
59
54
|
import { hasListener } from '@progress/kendo-vue-common';
|
|
60
|
-
import { pagerMessagesMap } from './messages/main.js';
|
|
55
|
+
import { messages, pagerMessagesMap, noRecords } from './messages/main.js';
|
|
56
|
+
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
61
57
|
/**
|
|
62
58
|
* @hidden
|
|
63
59
|
*/
|
|
@@ -110,6 +106,11 @@ var TreeListVue2 = {
|
|
|
110
106
|
// navigationStateRef: this.navigationStateRef
|
|
111
107
|
// });
|
|
112
108
|
},
|
|
109
|
+
inject: {
|
|
110
|
+
kendoLocalizationService: {
|
|
111
|
+
default: null
|
|
112
|
+
}
|
|
113
|
+
},
|
|
113
114
|
data: function data() {
|
|
114
115
|
return {
|
|
115
116
|
wrapperScrollLeft: 0,
|
|
@@ -238,8 +239,9 @@ var TreeListVue2 = {
|
|
|
238
239
|
h(Header, {
|
|
239
240
|
headerRow: // @ts-ignore
|
|
240
241
|
h(HeaderRow, {
|
|
241
|
-
|
|
242
|
+
grid: this,
|
|
242
243
|
attrs: this.v3 ? undefined : {
|
|
244
|
+
grid: this,
|
|
243
245
|
sort: this.$props.sort,
|
|
244
246
|
sortable: this.$props.sortable,
|
|
245
247
|
filterable: this.$props.filterable,
|
|
@@ -276,6 +278,7 @@ var TreeListVue2 = {
|
|
|
276
278
|
isRtl: this.isRtl
|
|
277
279
|
}) : undefined
|
|
278
280
|
},
|
|
281
|
+
sort: this.$props.sort,
|
|
279
282
|
sortable: this.$props.sortable,
|
|
280
283
|
filterable: this.$props.filterable,
|
|
281
284
|
onSortChange: this.sortChange,
|
|
@@ -324,8 +327,9 @@ var TreeListVue2 = {
|
|
|
324
327
|
}),
|
|
325
328
|
attrs: this.v3 ? undefined : {
|
|
326
329
|
headerRow: h(HeaderRow, {
|
|
327
|
-
|
|
330
|
+
grid: this,
|
|
328
331
|
attrs: this.v3 ? undefined : {
|
|
332
|
+
grid: this,
|
|
329
333
|
sort: this.$props.sort,
|
|
330
334
|
sortable: this.$props.sortable,
|
|
331
335
|
filterable: this.$props.filterable,
|
|
@@ -361,6 +365,7 @@ var TreeListVue2 = {
|
|
|
361
365
|
isRtl: this.isRtl
|
|
362
366
|
}) : undefined
|
|
363
367
|
},
|
|
368
|
+
sort: this.$props.sort,
|
|
364
369
|
sortable: this.$props.sortable,
|
|
365
370
|
filterable: this.$props.filterable,
|
|
366
371
|
onSortChange: this.sortChange,
|
|
@@ -523,6 +528,13 @@ var TreeListVue2 = {
|
|
|
523
528
|
this.updateOnScroll = false;
|
|
524
529
|
}
|
|
525
530
|
|
|
531
|
+
var noRecordsTemplate = templateRendering.call(this, this.$props.noRecords, getListeners.call(this));
|
|
532
|
+
var localizationService = provideLocalizationService(this);
|
|
533
|
+
var noRecordsMessage = localizationService.toLanguageString(noRecords, messages[noRecords]);
|
|
534
|
+
var noRecordsRender = getTemplate.call(this, {
|
|
535
|
+
h: h,
|
|
536
|
+
template: noRecordsTemplate
|
|
537
|
+
});
|
|
526
538
|
var levels = flattedData.length ? flattedData.map(function (i) {
|
|
527
539
|
return i.level;
|
|
528
540
|
}) : [];
|
|
@@ -604,7 +616,7 @@ var TreeListVue2 = {
|
|
|
604
616
|
attrs: this.v3 ? undefined : {
|
|
605
617
|
colSpan: leafColumns.length
|
|
606
618
|
}
|
|
607
|
-
}, [this.$props.noRecords
|
|
619
|
+
}, [this.$props.noRecords ? noRecordsRender : noRecordsMessage])]);
|
|
608
620
|
|
|
609
621
|
var sorted = function sorted(field) {
|
|
610
622
|
return _this.$props.sort && _this.$props.sort.some(function (descriptor) {
|
|
@@ -5,7 +5,7 @@ import { SortSettings as TreeListSortSettings } from '@progress/kendo-vue-data-t
|
|
|
5
5
|
import { TreeListColumnProps } from './TreeListColumnProps';
|
|
6
6
|
import { TreeListSelectableSettings } from './TreeListSelectableSettings';
|
|
7
7
|
/**
|
|
8
|
-
* Represents the props of the [
|
|
8
|
+
* Represents the props of the [Kendo UI for Vue TreeList component]({% slug getstarted_treelist %}).
|
|
9
9
|
*/
|
|
10
10
|
export interface TreeListProps {
|
|
11
11
|
/**
|
|
@@ -13,10 +13,6 @@ export interface TreeListProps {
|
|
|
13
13
|
* If not set, the dataItem index will be used for the row key, which might lead to row not updated during paging or scrolling.
|
|
14
14
|
*/
|
|
15
15
|
dataItemKey?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Sets custom CSS classes to the TreeList DOM element.
|
|
18
|
-
*/
|
|
19
|
-
className?: string;
|
|
20
16
|
/**
|
|
21
17
|
* A collection of `TreeListColumnProps` for creating columns.
|
|
22
18
|
*/
|
|
@@ -51,6 +47,9 @@ export interface TreeListProps {
|
|
|
51
47
|
/**
|
|
52
48
|
* If set and when the data item is in edit mode, the `editRow` value will be rendered.
|
|
53
49
|
*/
|
|
50
|
+
/**
|
|
51
|
+
* @hidden
|
|
52
|
+
*/
|
|
54
53
|
editRow?: any;
|
|
55
54
|
/**
|
|
56
55
|
* Represents the TreeList toolbar component.
|
|
@@ -90,16 +89,25 @@ export interface TreeListProps {
|
|
|
90
89
|
/**
|
|
91
90
|
* The TreeList selectable settings.
|
|
92
91
|
*/
|
|
92
|
+
/**
|
|
93
|
+
* @hidden
|
|
94
|
+
*/
|
|
93
95
|
selectable?: TreeListSelectableSettings;
|
|
94
96
|
/**
|
|
95
97
|
* Specifies the name of the field which will provide a Boolean representation of the selected state of the item
|
|
96
98
|
* ([see example]({% slug selection_treelist %})).
|
|
97
99
|
*/
|
|
100
|
+
/**
|
|
101
|
+
* @hidden
|
|
102
|
+
*/
|
|
98
103
|
selectedField?: string;
|
|
99
104
|
/**
|
|
100
105
|
* Fires when the user tries to select or deselect a row or cell.
|
|
101
106
|
* ([more information and example]({% slug selection_treelist %})).
|
|
102
107
|
*/
|
|
108
|
+
/**
|
|
109
|
+
* @hidden
|
|
110
|
+
*/
|
|
103
111
|
onSelectionChange?: (event: TreeListSelectionChangeEvent) => void;
|
|
104
112
|
/**
|
|
105
113
|
* Fires when the user press keyboard key.
|
|
@@ -109,29 +117,47 @@ export interface TreeListProps {
|
|
|
109
117
|
* Fires when the user clicks the checkbox of a column header whose `field` matches `selectedField`
|
|
110
118
|
* ([more information and example]({% slug selection_treelist %})).
|
|
111
119
|
*/
|
|
120
|
+
/**
|
|
121
|
+
* @hidden
|
|
122
|
+
*/
|
|
112
123
|
onHeaderSelectionChange?: (event: TreeListHeaderSelectionChangeEvent) => void;
|
|
113
124
|
/**
|
|
114
125
|
* Fires when the user changes the values of the item.
|
|
115
126
|
* The event is not debounced and fires on every `onChange` event of the input in the current `EditCell`
|
|
116
127
|
* ([more information and examples]({% slug editing_inline_treelist %})).
|
|
117
128
|
*/
|
|
129
|
+
/**
|
|
130
|
+
* @hidden
|
|
131
|
+
*/
|
|
118
132
|
onItemChange?: (event: TreeListItemChangeEvent) => void;
|
|
119
133
|
/**
|
|
120
134
|
* Fires when the user clicks a row.
|
|
121
135
|
*/
|
|
136
|
+
/**
|
|
137
|
+
* @hidden
|
|
138
|
+
*/
|
|
122
139
|
onRowClick?: (event: TreeListRowClickEvent) => void;
|
|
123
140
|
/**
|
|
124
141
|
* Fires when the user double clicks a row.
|
|
125
142
|
*/
|
|
143
|
+
/**
|
|
144
|
+
* @hidden
|
|
145
|
+
*/
|
|
126
146
|
onRowDoubleClick?: (event: TreeListRowDoubleClickEvent) => void;
|
|
127
147
|
/**
|
|
128
148
|
* Fires when the user trigger the context menu of row.
|
|
129
149
|
*/
|
|
150
|
+
/**
|
|
151
|
+
* @hidden
|
|
152
|
+
*/
|
|
130
153
|
onRowContextMenu?: (event: TreeListRowContextMenuEvent) => void;
|
|
131
154
|
/**
|
|
132
155
|
* Specifies the name of the field which will provide a Boolean representation of the edit state of the current item
|
|
133
156
|
* ([more information and examples]({% slug editing_inline_treelist %})).
|
|
134
157
|
*/
|
|
158
|
+
/**
|
|
159
|
+
* @hidden
|
|
160
|
+
*/
|
|
135
161
|
editField?: string;
|
|
136
162
|
/**
|
|
137
163
|
* Defines the scroll mode of the TreeList.
|
|
@@ -148,14 +174,23 @@ export interface TreeListProps {
|
|
|
148
174
|
/**
|
|
149
175
|
* If set to `true`, the user can resize columns by dragging the edges (resize handles) of their header cells.
|
|
150
176
|
*/
|
|
177
|
+
/**
|
|
178
|
+
* @hidden
|
|
179
|
+
*/
|
|
151
180
|
resizable?: boolean;
|
|
152
181
|
/**
|
|
153
182
|
* If set to `true`, the user can reorder columns by dragging their header cells.
|
|
154
183
|
*/
|
|
184
|
+
/**
|
|
185
|
+
* @hidden
|
|
186
|
+
*/
|
|
155
187
|
reorderable?: boolean;
|
|
156
188
|
/**
|
|
157
189
|
* If set to `true`, the user can drag and drop rows.
|
|
158
190
|
*/
|
|
191
|
+
/**
|
|
192
|
+
* @hidden
|
|
193
|
+
*/
|
|
159
194
|
rowDraggable?: boolean;
|
|
160
195
|
/**
|
|
161
196
|
* Defines the row height and implements equal heights for all rows.
|
|
@@ -182,8 +217,17 @@ export interface TreeListProps {
|
|
|
182
217
|
* @param item - the item for the row.
|
|
183
218
|
*/
|
|
184
219
|
rowClass?: Function;
|
|
220
|
+
/**
|
|
221
|
+
* @hidden
|
|
222
|
+
*/
|
|
185
223
|
columnMenu?: any;
|
|
224
|
+
/**
|
|
225
|
+
* @hidden
|
|
226
|
+
*/
|
|
186
227
|
columnMenuFilter?: CompositeFilterDescriptor[];
|
|
228
|
+
/**
|
|
229
|
+
* @hidden
|
|
230
|
+
*/
|
|
187
231
|
onColumnMenuFilterChange?: (event: TreeListColumnMenuFilterChangeEvent) => void;
|
|
188
232
|
/**
|
|
189
233
|
* The pager component that the TreeList will render.
|
|
@@ -204,6 +248,9 @@ export interface TreeListProps {
|
|
|
204
248
|
/**
|
|
205
249
|
* The TreeList row component.
|
|
206
250
|
*/
|
|
251
|
+
/**
|
|
252
|
+
* @hidden
|
|
253
|
+
*/
|
|
207
254
|
row?: any;
|
|
208
255
|
/**
|
|
209
256
|
* If set to `true`, the user can use dedicated shortcuts to interact with the TreeList.
|
|
@@ -221,22 +268,37 @@ export interface TreeListProps {
|
|
|
221
268
|
/**
|
|
222
269
|
* Fires when a column is resized.
|
|
223
270
|
*/
|
|
271
|
+
/**
|
|
272
|
+
* @hidden
|
|
273
|
+
*/
|
|
224
274
|
onColumnResize?: (event: TreeListColumnResizeEvent) => void;
|
|
225
275
|
/**
|
|
226
276
|
* Fires when the columns are reordered.
|
|
227
277
|
*/
|
|
278
|
+
/**
|
|
279
|
+
* @hidden
|
|
280
|
+
*/
|
|
228
281
|
onColumnReorder?: (event: TreeListColumnReorderEvent) => void;
|
|
229
282
|
/**
|
|
230
283
|
* Fires when a row is dragged.
|
|
231
284
|
*/
|
|
285
|
+
/**
|
|
286
|
+
* @hidden
|
|
287
|
+
*/
|
|
232
288
|
onRowDrag?: (event: TreeListRowDragEvent) => void;
|
|
233
289
|
/**
|
|
234
290
|
* Fires when a row is dragged and dropped.
|
|
235
291
|
*/
|
|
292
|
+
/**
|
|
293
|
+
* @hidden
|
|
294
|
+
*/
|
|
236
295
|
onRowDrop?: (event: TreeListRowDragEvent) => void;
|
|
237
296
|
/**
|
|
238
297
|
* Fires when a row is about to be rendered. Useful for overriding the default rendering of the row.
|
|
239
298
|
*/
|
|
299
|
+
/**
|
|
300
|
+
* @hidden
|
|
301
|
+
*/
|
|
240
302
|
rowRender?: any;
|
|
241
303
|
/**
|
|
242
304
|
* Fires when a cell is about to be rendered. Useful for overriding the default rendering of the cell.
|
package/dist/esm/main.d.ts
CHANGED
|
@@ -8,8 +8,6 @@ import { TreeListSelectionCell } from './cells/TreeListSelectionCell';
|
|
|
8
8
|
import { TreeListRow } from './rows/TreeListRow';
|
|
9
9
|
import { TreeListRowProps } from './interfaces/TreeListRowProps';
|
|
10
10
|
import { TreeListToolbarProps } from './interfaces/TreeListToolbarProps';
|
|
11
|
-
import { TreeListNoRecords } from './TreeListNoRecords';
|
|
12
|
-
import { TreeListNoRecordsProps } from './interfaces/TreeListNoRecordsProps';
|
|
13
11
|
import { TreeListDataStateChangeEvent, TreeListFilterChangeEvent, TreeListSortChangeEvent, TreeListExpandChangeEvent, TreeListSelectionChangeEvent, TreeListItemChangeEvent, TreeListRowClickEvent, TreeListColumnResizeEvent, TreeListColumnReorderEvent, TreeListPageChangeEvent, TreeListRowDragEvent, TreeListColumnMenuFilterChangeEvent, TreeListHeaderSelectionChangeEvent, TreeListEvent, TreeListRowDoubleClickEvent, TreeListRowContextMenuEvent, TreeListDragSelectionReleaseEvent, TreeListKeyDownEvent } from './interfaces/events';
|
|
14
12
|
import { TreeListSortSettings, TreeListColumnSortSettings } from './interfaces/TreeListSortSettings';
|
|
15
13
|
import { TreeListTextFilter, TreeListTextFilterProps } from './cells/FilterCells/TreeListTextFilter';
|
|
@@ -26,4 +24,4 @@ import { getNestedValue, setHeaderRowsTop, tableRowsVirtualization } from './uti
|
|
|
26
24
|
import { TREELIST_COL_INDEX_ATTRIBUTE, TREELIST_ROW_INDEX_ATTRIBUTE, TREELIST_PREVENT_SELECTION_ELEMENT } from './constants/main';
|
|
27
25
|
import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-vue-data-tools';
|
|
28
26
|
import { TreeListSelectableMode, TreeListSelectableSettings } from './interfaces/TreeListSelectableSettings';
|
|
29
|
-
export { TreeList, TreeListProps, TreeListColumnProps, TreeListCell, TreeListCellProps, TreeListRow, TreeListRowProps, TreeListHeaderCellProps, TreeListSelectionCell, TreeListToolbarProps,
|
|
27
|
+
export { TreeList, TreeListProps, TreeListColumnProps, TreeListCell, TreeListCellProps, TreeListRow, TreeListRowProps, TreeListHeaderCellProps, TreeListSelectionCell, TreeListToolbarProps, TreeListSortSettings, TreeListColumnSortSettings, TreeListTextFilter, TreeListTextFilterProps, TreeListNumericFilter, TreeListNumericFilterProps, TreeListDateFilter, TreeListDateFilterProps, TreeListBooleanFilter, TreeListBooleanFilterProps, TreeListTextEditor, TreeListTextEditorProps, TreeListNumericEditor, TreeListNumericEditorProps, TreeListBooleanEditor, TreeListBooleanEditorProps, TreeListDateEditor, TreeListDateEditorProps, TreeListDataStateChangeEvent, TreeListFilterChangeEvent, TreeListColumnMenuFilterChangeEvent, TreeListSortChangeEvent, TreeListExpandChangeEvent, TreeListSelectionChangeEvent, TreeListItemChangeEvent, TreeListHeaderSelectionChangeEvent, TreeListRowClickEvent, TreeListColumnResizeEvent, TreeListColumnReorderEvent, TreeListPageChangeEvent, TreeListRowDragEvent, TreeListEvent, TreeListRowDoubleClickEvent, TreeListRowContextMenuEvent, TreeListDragSelectionReleaseEvent, TreeListKeyDownEvent, orderBy, filterBy, mapTree, createDataTree, extendDataItem, mapTreeItem, moveTreeItem, getItemPath, removeItems, modifySubItems, treeToFlat, DataItemWrapper, flatData, getNestedValue, setHeaderRowsTop, tableRowsVirtualization, TREELIST_COL_INDEX_ATTRIBUTE, TREELIST_ROW_INDEX_ATTRIBUTE, TREELIST_PREVENT_SELECTION_ELEMENT, getSelectedState, getSelectedStateFromKeyDown, setSelectedState, TreeListSelectableSettings, TreeListSelectableMode };
|