@progress/kendo-vue-treelist 5.3.0-dev.202409130647 → 5.3.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -34
- package/TreeList.js +8 -0
- package/TreeList.mjs +722 -0
- package/TreeListNav.js +8 -0
- package/TreeListNav.mjs +98 -0
- package/cells/EditCells/TreeListBooleanEditor.js +8 -0
- package/cells/EditCells/TreeListBooleanEditor.mjs +154 -0
- package/cells/EditCells/TreeListDateEditor.js +8 -0
- package/cells/EditCells/TreeListDateEditor.mjs +140 -0
- package/cells/EditCells/TreeListNumericEditor.js +8 -0
- package/cells/EditCells/TreeListNumericEditor.mjs +140 -0
- package/cells/EditCells/TreeListTextEditor.js +8 -0
- package/cells/EditCells/TreeListTextEditor.mjs +157 -0
- package/cells/FilterCells/TreeListBooleanFilter.js +8 -0
- package/cells/FilterCells/TreeListBooleanFilter.mjs +54 -0
- package/cells/FilterCells/TreeListDateFilter.js +8 -0
- package/cells/FilterCells/TreeListDateFilter.mjs +54 -0
- package/cells/FilterCells/TreeListNumericFilter.js +8 -0
- package/cells/FilterCells/TreeListNumericFilter.mjs +54 -0
- package/cells/FilterCells/TreeListTextFilter.js +8 -0
- package/cells/FilterCells/TreeListTextFilter.mjs +54 -0
- package/cells/FilterCells/utils.js +8 -0
- package/cells/FilterCells/utils.mjs +59 -0
- package/cells/TreeListCell.js +8 -0
- package/cells/TreeListCell.mjs +184 -0
- package/cells/TreeListSelectionCell.js +8 -0
- package/cells/TreeListSelectionCell.mjs +146 -0
- package/constants/main.js +8 -0
- package/constants/main.mjs +14 -0
- package/dist/cdn/js/kendo-vue-treelist.js +8 -1
- package/index.d.mts +1814 -0
- package/index.d.ts +1814 -0
- package/index.js +8 -0
- package/index.mjs +58 -0
- package/messages/main.js +8 -0
- package/messages/main.mjs +112 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +18 -0
- package/package.json +24 -61
- package/rows/RowDragClue.js +8 -0
- package/rows/RowDragClue.mjs +56 -0
- package/rows/TreeListDraggableRow.js +8 -0
- package/rows/TreeListDraggableRow.mjs +113 -0
- package/rows/TreeListRow.js +8 -0
- package/rows/TreeListRow.mjs +124 -0
- package/utils/data-operations.js +8 -0
- package/utils/data-operations.mjs +103 -0
- package/utils/main.js +8 -0
- package/utils/main.mjs +53 -0
- package/dist/es/ScrollMode.d.ts +0 -1
- package/dist/es/ScrollMode.js +0 -1
- package/dist/es/TreeList.d.ts +0 -56
- package/dist/es/TreeList.js +0 -1289
- package/dist/es/TreeListNav.d.ts +0 -46
- package/dist/es/TreeListNav.js +0 -123
- package/dist/es/additionalTypes.ts +0 -21
- package/dist/es/cells/EditCells/TreeListBooleanEditor.d.ts +0 -49
- package/dist/es/cells/EditCells/TreeListBooleanEditor.js +0 -194
- package/dist/es/cells/EditCells/TreeListDateEditor.d.ts +0 -49
- package/dist/es/cells/EditCells/TreeListDateEditor.js +0 -174
- package/dist/es/cells/EditCells/TreeListNumericEditor.d.ts +0 -49
- package/dist/es/cells/EditCells/TreeListNumericEditor.js +0 -174
- package/dist/es/cells/EditCells/TreeListTextEditor.d.ts +0 -50
- package/dist/es/cells/EditCells/TreeListTextEditor.js +0 -190
- package/dist/es/cells/FilterCells/TreeListBooleanFilter.d.ts +0 -22
- package/dist/es/cells/FilterCells/TreeListBooleanFilter.js +0 -89
- package/dist/es/cells/FilterCells/TreeListDateFilter.d.ts +0 -22
- package/dist/es/cells/FilterCells/TreeListDateFilter.js +0 -89
- package/dist/es/cells/FilterCells/TreeListNumericFilter.d.ts +0 -22
- package/dist/es/cells/FilterCells/TreeListNumericFilter.js +0 -89
- package/dist/es/cells/FilterCells/TreeListTextFilter.d.ts +0 -25
- package/dist/es/cells/FilterCells/TreeListTextFilter.js +0 -89
- package/dist/es/cells/FilterCells/utils.d.ts +0 -38
- package/dist/es/cells/FilterCells/utils.js +0 -66
- package/dist/es/cells/TreeListCell.d.ts +0 -41
- package/dist/es/cells/TreeListCell.js +0 -256
- package/dist/es/cells/TreeListSelectionCell.d.ts +0 -41
- package/dist/es/cells/TreeListSelectionCell.js +0 -181
- package/dist/es/constants/main.d.ts +0 -6
- package/dist/es/constants/main.js +0 -7
- package/dist/es/interfaces/DataItemWrapper.d.ts +0 -10
- package/dist/es/interfaces/DataItemWrapper.js +0 -1
- package/dist/es/interfaces/TreeListCellProps.d.ts +0 -35
- package/dist/es/interfaces/TreeListCellProps.js +0 -1
- package/dist/es/interfaces/TreeListColumnProps.d.ts +0 -33
- package/dist/es/interfaces/TreeListColumnProps.js +0 -1
- package/dist/es/interfaces/TreeListFilterCellProps.d.ts +0 -6
- package/dist/es/interfaces/TreeListFilterCellProps.js +0 -1
- package/dist/es/interfaces/TreeListFilterOperator.d.ts +0 -6
- package/dist/es/interfaces/TreeListFilterOperator.js +0 -1
- package/dist/es/interfaces/TreeListHeaderCellProps.d.ts +0 -6
- package/dist/es/interfaces/TreeListHeaderCellProps.js +0 -1
- package/dist/es/interfaces/TreeListProps.d.ts +0 -345
- package/dist/es/interfaces/TreeListProps.js +0 -1
- package/dist/es/interfaces/TreeListRowProps.d.ts +0 -92
- package/dist/es/interfaces/TreeListRowProps.js +0 -1
- package/dist/es/interfaces/TreeListSelectableSettings.d.ts +0 -18
- package/dist/es/interfaces/TreeListSelectableSettings.js +0 -1
- package/dist/es/interfaces/TreeListSortSettings.d.ts +0 -9
- package/dist/es/interfaces/TreeListSortSettings.js +0 -1
- package/dist/es/interfaces/TreeListToolbarProps.d.ts +0 -5
- package/dist/es/interfaces/TreeListToolbarProps.js +0 -1
- package/dist/es/interfaces/events.d.ts +0 -286
- package/dist/es/interfaces/events.js +0 -1
- package/dist/es/main.d.ts +0 -27
- package/dist/es/main.js +0 -17
- package/dist/es/messages/main.d.ts +0 -239
- package/dist/es/messages/main.js +0 -240
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/rows/RowDragClue.d.ts +0 -40
- package/dist/es/rows/RowDragClue.js +0 -76
- package/dist/es/rows/TreeListDraggableRow.d.ts +0 -38
- package/dist/es/rows/TreeListDraggableRow.js +0 -175
- package/dist/es/rows/TreeListRow.d.ts +0 -36
- package/dist/es/rows/TreeListRow.js +0 -154
- package/dist/es/utils/data-operations.d.ts +0 -115
- package/dist/es/utils/data-operations.js +0 -250
- package/dist/es/utils/main.d.ts +0 -17
- package/dist/es/utils/main.js +0 -68
- package/dist/esm/ScrollMode.d.ts +0 -1
- package/dist/esm/ScrollMode.js +0 -1
- package/dist/esm/TreeList.d.ts +0 -56
- package/dist/esm/TreeList.js +0 -1289
- package/dist/esm/TreeListNav.d.ts +0 -46
- package/dist/esm/TreeListNav.js +0 -123
- package/dist/esm/additionalTypes.ts +0 -21
- package/dist/esm/cells/EditCells/TreeListBooleanEditor.d.ts +0 -49
- package/dist/esm/cells/EditCells/TreeListBooleanEditor.js +0 -194
- package/dist/esm/cells/EditCells/TreeListDateEditor.d.ts +0 -49
- package/dist/esm/cells/EditCells/TreeListDateEditor.js +0 -174
- package/dist/esm/cells/EditCells/TreeListNumericEditor.d.ts +0 -49
- package/dist/esm/cells/EditCells/TreeListNumericEditor.js +0 -174
- package/dist/esm/cells/EditCells/TreeListTextEditor.d.ts +0 -50
- package/dist/esm/cells/EditCells/TreeListTextEditor.js +0 -190
- package/dist/esm/cells/FilterCells/TreeListBooleanFilter.d.ts +0 -22
- package/dist/esm/cells/FilterCells/TreeListBooleanFilter.js +0 -89
- package/dist/esm/cells/FilterCells/TreeListDateFilter.d.ts +0 -22
- package/dist/esm/cells/FilterCells/TreeListDateFilter.js +0 -89
- package/dist/esm/cells/FilterCells/TreeListNumericFilter.d.ts +0 -22
- package/dist/esm/cells/FilterCells/TreeListNumericFilter.js +0 -89
- package/dist/esm/cells/FilterCells/TreeListTextFilter.d.ts +0 -25
- package/dist/esm/cells/FilterCells/TreeListTextFilter.js +0 -89
- package/dist/esm/cells/FilterCells/utils.d.ts +0 -38
- package/dist/esm/cells/FilterCells/utils.js +0 -66
- package/dist/esm/cells/TreeListCell.d.ts +0 -41
- package/dist/esm/cells/TreeListCell.js +0 -256
- package/dist/esm/cells/TreeListSelectionCell.d.ts +0 -41
- package/dist/esm/cells/TreeListSelectionCell.js +0 -181
- package/dist/esm/constants/main.d.ts +0 -6
- package/dist/esm/constants/main.js +0 -7
- package/dist/esm/interfaces/DataItemWrapper.d.ts +0 -10
- package/dist/esm/interfaces/DataItemWrapper.js +0 -1
- package/dist/esm/interfaces/TreeListCellProps.d.ts +0 -35
- package/dist/esm/interfaces/TreeListCellProps.js +0 -1
- package/dist/esm/interfaces/TreeListColumnProps.d.ts +0 -33
- package/dist/esm/interfaces/TreeListColumnProps.js +0 -1
- package/dist/esm/interfaces/TreeListFilterCellProps.d.ts +0 -6
- package/dist/esm/interfaces/TreeListFilterCellProps.js +0 -1
- package/dist/esm/interfaces/TreeListFilterOperator.d.ts +0 -6
- package/dist/esm/interfaces/TreeListFilterOperator.js +0 -1
- package/dist/esm/interfaces/TreeListHeaderCellProps.d.ts +0 -6
- package/dist/esm/interfaces/TreeListHeaderCellProps.js +0 -1
- package/dist/esm/interfaces/TreeListProps.d.ts +0 -345
- package/dist/esm/interfaces/TreeListProps.js +0 -1
- package/dist/esm/interfaces/TreeListRowProps.d.ts +0 -92
- package/dist/esm/interfaces/TreeListRowProps.js +0 -1
- package/dist/esm/interfaces/TreeListSelectableSettings.d.ts +0 -18
- package/dist/esm/interfaces/TreeListSelectableSettings.js +0 -1
- package/dist/esm/interfaces/TreeListSortSettings.d.ts +0 -9
- package/dist/esm/interfaces/TreeListSortSettings.js +0 -1
- package/dist/esm/interfaces/TreeListToolbarProps.d.ts +0 -5
- package/dist/esm/interfaces/TreeListToolbarProps.js +0 -1
- package/dist/esm/interfaces/events.d.ts +0 -286
- package/dist/esm/interfaces/events.js +0 -1
- package/dist/esm/main.d.ts +0 -27
- package/dist/esm/main.js +0 -17
- package/dist/esm/messages/main.d.ts +0 -239
- package/dist/esm/messages/main.js +0 -240
- package/dist/esm/package-metadata.d.ts +0 -5
- package/dist/esm/package-metadata.js +0 -11
- package/dist/esm/package.json +0 -3
- package/dist/esm/rows/RowDragClue.d.ts +0 -40
- package/dist/esm/rows/RowDragClue.js +0 -76
- package/dist/esm/rows/TreeListDraggableRow.d.ts +0 -38
- package/dist/esm/rows/TreeListDraggableRow.js +0 -175
- package/dist/esm/rows/TreeListRow.d.ts +0 -36
- package/dist/esm/rows/TreeListRow.js +0 -154
- package/dist/esm/utils/data-operations.d.ts +0 -115
- package/dist/esm/utils/data-operations.js +0 -250
- package/dist/esm/utils/main.d.ts +0 -17
- package/dist/esm/utils/main.js +0 -68
- package/dist/npm/ScrollMode.d.ts +0 -1
- package/dist/npm/ScrollMode.js +0 -2
- package/dist/npm/TreeList.d.ts +0 -56
- package/dist/npm/TreeList.js +0 -1296
- package/dist/npm/TreeListNav.d.ts +0 -46
- package/dist/npm/TreeListNav.js +0 -130
- package/dist/npm/additionalTypes.ts +0 -21
- package/dist/npm/cells/EditCells/TreeListBooleanEditor.d.ts +0 -49
- package/dist/npm/cells/EditCells/TreeListBooleanEditor.js +0 -201
- package/dist/npm/cells/EditCells/TreeListDateEditor.d.ts +0 -49
- package/dist/npm/cells/EditCells/TreeListDateEditor.js +0 -181
- package/dist/npm/cells/EditCells/TreeListNumericEditor.d.ts +0 -49
- package/dist/npm/cells/EditCells/TreeListNumericEditor.js +0 -181
- package/dist/npm/cells/EditCells/TreeListTextEditor.d.ts +0 -50
- package/dist/npm/cells/EditCells/TreeListTextEditor.js +0 -197
- package/dist/npm/cells/FilterCells/TreeListBooleanFilter.d.ts +0 -22
- package/dist/npm/cells/FilterCells/TreeListBooleanFilter.js +0 -96
- package/dist/npm/cells/FilterCells/TreeListDateFilter.d.ts +0 -22
- package/dist/npm/cells/FilterCells/TreeListDateFilter.js +0 -96
- package/dist/npm/cells/FilterCells/TreeListNumericFilter.d.ts +0 -22
- package/dist/npm/cells/FilterCells/TreeListNumericFilter.js +0 -96
- package/dist/npm/cells/FilterCells/TreeListTextFilter.d.ts +0 -25
- package/dist/npm/cells/FilterCells/TreeListTextFilter.js +0 -96
- package/dist/npm/cells/FilterCells/utils.d.ts +0 -38
- package/dist/npm/cells/FilterCells/utils.js +0 -70
- package/dist/npm/cells/TreeListCell.d.ts +0 -41
- package/dist/npm/cells/TreeListCell.js +0 -263
- package/dist/npm/cells/TreeListSelectionCell.d.ts +0 -41
- package/dist/npm/cells/TreeListSelectionCell.js +0 -188
- package/dist/npm/constants/main.d.ts +0 -6
- package/dist/npm/constants/main.js +0 -10
- package/dist/npm/interfaces/DataItemWrapper.d.ts +0 -10
- package/dist/npm/interfaces/DataItemWrapper.js +0 -2
- package/dist/npm/interfaces/TreeListCellProps.d.ts +0 -35
- package/dist/npm/interfaces/TreeListCellProps.js +0 -2
- package/dist/npm/interfaces/TreeListColumnProps.d.ts +0 -33
- package/dist/npm/interfaces/TreeListColumnProps.js +0 -2
- package/dist/npm/interfaces/TreeListFilterCellProps.d.ts +0 -6
- package/dist/npm/interfaces/TreeListFilterCellProps.js +0 -2
- package/dist/npm/interfaces/TreeListFilterOperator.d.ts +0 -6
- package/dist/npm/interfaces/TreeListFilterOperator.js +0 -2
- package/dist/npm/interfaces/TreeListHeaderCellProps.d.ts +0 -6
- package/dist/npm/interfaces/TreeListHeaderCellProps.js +0 -2
- package/dist/npm/interfaces/TreeListProps.d.ts +0 -345
- package/dist/npm/interfaces/TreeListProps.js +0 -2
- package/dist/npm/interfaces/TreeListRowProps.d.ts +0 -92
- package/dist/npm/interfaces/TreeListRowProps.js +0 -2
- package/dist/npm/interfaces/TreeListSelectableSettings.d.ts +0 -18
- package/dist/npm/interfaces/TreeListSelectableSettings.js +0 -2
- package/dist/npm/interfaces/TreeListSortSettings.d.ts +0 -9
- package/dist/npm/interfaces/TreeListSortSettings.js +0 -2
- package/dist/npm/interfaces/TreeListToolbarProps.d.ts +0 -5
- package/dist/npm/interfaces/TreeListToolbarProps.js +0 -5
- package/dist/npm/interfaces/events.d.ts +0 -286
- package/dist/npm/interfaces/events.js +0 -2
- package/dist/npm/main.d.ts +0 -27
- package/dist/npm/main.js +0 -52
- package/dist/npm/messages/main.d.ts +0 -239
- package/dist/npm/messages/main.js +0 -244
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/rows/RowDragClue.d.ts +0 -40
- package/dist/npm/rows/RowDragClue.js +0 -83
- package/dist/npm/rows/TreeListDraggableRow.d.ts +0 -38
- package/dist/npm/rows/TreeListDraggableRow.js +0 -182
- package/dist/npm/rows/TreeListRow.d.ts +0 -36
- package/dist/npm/rows/TreeListRow.js +0 -161
- package/dist/npm/utils/data-operations.d.ts +0 -115
- package/dist/npm/utils/data-operations.js +0 -265
- package/dist/npm/utils/main.d.ts +0 -17
- package/dist/npm/utils/main.js +0 -74
package/TreeList.mjs
ADDED
|
@@ -0,0 +1,722 @@
|
|
|
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 { defineComponent as me, createVNode as d, h as k, isVNode as be } from "vue";
|
|
9
|
+
import { guid as Ce, validatePackage as we, noop as T, kendoThemeMaps as O, isRtl as $e, getRef as I, getDefaultSlots as Se, templateRendering as R, getListeners as v, getTemplate as D, getter as Re, setRef as E, canUseDOM as M, hasListener as j } from "@progress/kendo-vue-common";
|
|
10
|
+
import { CommonDragLogic as ve, ColumnResize as xe, tableKeyboardNavigationTools as H, readColumns as ye, mapColumns as ke, Header as Ie, HeaderRow as De, operators as B, tableColumnsVirtualization as ze, Pager as Fe, normalize as Le, DropClue as Te, DragClue as Oe, TableKeyboardNavigationProvider as Ee, getSelectionOptions as Me, FilterRow as He } from "@progress/kendo-vue-data-tools";
|
|
11
|
+
import { TreeListNav as Pe } from "./TreeListNav.mjs";
|
|
12
|
+
import { tableRowsVirtualization as Ne, getNestedValue as x, setHeaderRowsTop as Ae } from "./utils/main.mjs";
|
|
13
|
+
import { flatData as Ke } from "./utils/data-operations.mjs";
|
|
14
|
+
import { TreeListCell as je } from "./cells/TreeListCell.mjs";
|
|
15
|
+
import { TreeListDraggableRow as Be } from "./rows/TreeListDraggableRow.mjs";
|
|
16
|
+
import { RowDragClue as Ve } from "./rows/RowDragClue.mjs";
|
|
17
|
+
import { TreeListRow as _e } from "./rows/TreeListRow.mjs";
|
|
18
|
+
import { packageMetadata as We } from "./package-metadata.mjs";
|
|
19
|
+
import { noRecords as V, messages as Ge, pagerMessagesMap as _ } from "./messages/main.mjs";
|
|
20
|
+
import { provideLocalizationService as Ue } from "@progress/kendo-vue-intl";
|
|
21
|
+
import { TreeListSelectionCell as qe } from "./cells/TreeListSelectionCell.mjs";
|
|
22
|
+
function W(e) {
|
|
23
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !be(e);
|
|
24
|
+
}
|
|
25
|
+
const ht = /* @__PURE__ */ me({
|
|
26
|
+
name: "KendoTreeList",
|
|
27
|
+
props: {
|
|
28
|
+
dataItems: Array,
|
|
29
|
+
resizable: Boolean,
|
|
30
|
+
reorderable: Boolean,
|
|
31
|
+
sortable: [Object, Boolean],
|
|
32
|
+
sort: Array,
|
|
33
|
+
columns: Array,
|
|
34
|
+
columnVirtualization: Boolean,
|
|
35
|
+
filter: [Array, Object],
|
|
36
|
+
filterable: Boolean,
|
|
37
|
+
filterOperators: Object,
|
|
38
|
+
filterRow: [String, Function, Object],
|
|
39
|
+
cellRender: [String, Function, Object],
|
|
40
|
+
toolbar: [String, Function, Object],
|
|
41
|
+
noRecords: [String, Function, Object],
|
|
42
|
+
expandField: String,
|
|
43
|
+
subItemsField: String,
|
|
44
|
+
selectedField: String,
|
|
45
|
+
editField: String,
|
|
46
|
+
scrollable: String,
|
|
47
|
+
rowHeight: Number,
|
|
48
|
+
tableProps: Object,
|
|
49
|
+
rowClass: Function,
|
|
50
|
+
pageable: [Boolean, Object],
|
|
51
|
+
pager: [String, Function, Object],
|
|
52
|
+
skip: Number,
|
|
53
|
+
take: Number,
|
|
54
|
+
wrapperStyle: Object,
|
|
55
|
+
dataItemKey: String,
|
|
56
|
+
navigatable: Boolean,
|
|
57
|
+
size: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "medium",
|
|
60
|
+
validator: function(e) {
|
|
61
|
+
return ["small", "medium"].includes(e);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
reordableRows: Boolean,
|
|
65
|
+
onDatastatechange: Function,
|
|
66
|
+
onPagechange: Function,
|
|
67
|
+
onSortchange: Function,
|
|
68
|
+
onFilterchange: Function
|
|
69
|
+
},
|
|
70
|
+
created() {
|
|
71
|
+
this.prevData = [], this.prevColumns = void 0, this.flattedData = [], this.extendedColumn = [], this.columnsMap = [], this.element = null, this._treeListId = Ce(), we(We), this.dragLogic = new ve(this.columnReorder.bind(this), T, T), this.columnResize = new xe(this.onResize.bind(this));
|
|
72
|
+
},
|
|
73
|
+
inject: {
|
|
74
|
+
kendoLocalizationService: {
|
|
75
|
+
default: null
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
computed: {
|
|
79
|
+
wrapperClass() {
|
|
80
|
+
const {
|
|
81
|
+
size: e,
|
|
82
|
+
scrollable: t
|
|
83
|
+
} = this.$props;
|
|
84
|
+
return {
|
|
85
|
+
"k-grid": !0,
|
|
86
|
+
[this.$props.className]: this.$props.className,
|
|
87
|
+
"k-grid-md": !e,
|
|
88
|
+
[`k-grid-${O.sizeMap[e] || e}`]: e,
|
|
89
|
+
"k-treelist": !0,
|
|
90
|
+
"k-treelist-scrollable": t !== "none"
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
toolbarClass() {
|
|
94
|
+
const {
|
|
95
|
+
size: e
|
|
96
|
+
} = this.$props;
|
|
97
|
+
return {
|
|
98
|
+
"k-toolbar": !0,
|
|
99
|
+
"k-grid-toolbar": !0,
|
|
100
|
+
[`k-toolbar-${O.sizeMap[e] || e}`]: e
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
gridTableClass() {
|
|
104
|
+
const {
|
|
105
|
+
size: e
|
|
106
|
+
} = this.$props;
|
|
107
|
+
return {
|
|
108
|
+
"k-table": !0,
|
|
109
|
+
"k-grid-table": !0,
|
|
110
|
+
"k-grid-md": !e,
|
|
111
|
+
[`k-table-${O.sizeMap[e] || e}`]: e
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
data() {
|
|
116
|
+
return {
|
|
117
|
+
wrapperScrollLeft: 0,
|
|
118
|
+
wrapperScrollTop: 0,
|
|
119
|
+
updateOnScroll: !1,
|
|
120
|
+
tbodyOffsetTop: 0,
|
|
121
|
+
isRtl: !1,
|
|
122
|
+
navigation: void 0,
|
|
123
|
+
rowClue: {}
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* @hidden
|
|
128
|
+
*/
|
|
129
|
+
mounted() {
|
|
130
|
+
this.calculateSizes(this.$el);
|
|
131
|
+
const e = $e(this.$el);
|
|
132
|
+
this.isRtl = e;
|
|
133
|
+
let t = "$el";
|
|
134
|
+
const i = I(this, "gridNav"), o = I(this, "dropElementClue"), r = I(this, "dragElementClue");
|
|
135
|
+
this.dragLogic.refDropElementClue(o), this.dragLogic.refDragElementClue(r), this.columnResize.colGroupMain = I(this, "colGroup"), i && (this.element = i[t]);
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* @hidden
|
|
139
|
+
*/
|
|
140
|
+
destroyed() {
|
|
141
|
+
this.columnResize.columns = [], this.dragLogic.columns = [], this.extendedColumn = [], this.columnsMap = [], this.prevData = [], this.flattedData = [], this.updateOnScroll = !1;
|
|
142
|
+
},
|
|
143
|
+
render() {
|
|
144
|
+
Se(this);
|
|
145
|
+
const {
|
|
146
|
+
columns: e = [],
|
|
147
|
+
filterRow: t,
|
|
148
|
+
scrollable: i = "scrollable",
|
|
149
|
+
resizable: o = !1,
|
|
150
|
+
reorderable: r = !1,
|
|
151
|
+
skip: a,
|
|
152
|
+
take: p,
|
|
153
|
+
filterable: n,
|
|
154
|
+
reordableRows: g
|
|
155
|
+
} = this.$props, G = t || He, z = H.getIdPrefix(this.navigation);
|
|
156
|
+
this.prevColumns !== e && (this.extendedColumn = ye(e, {
|
|
157
|
+
prevId: 0,
|
|
158
|
+
idPrefix: z
|
|
159
|
+
}), this.columnsMap = ke(this.extendedColumn)), this.prevColumns = this.$props.columns;
|
|
160
|
+
const C = this.extendedColumn.filter((s) => s.children.length === 0);
|
|
161
|
+
this.columnResize.columns = this.extendedColumn, this.columnResize.resizable = o, this.dragLogic.columns = this.extendedColumn, this.dragLogic.reorderable = r, this.dragLogic.groupable = !1;
|
|
162
|
+
const U = this.$props.filter && this.$props.filter.length === 0 ? void 0 : this.$props.filter && this.$props.filter.length !== void 0 ? {
|
|
163
|
+
logic: "and",
|
|
164
|
+
filters: this.$props.filter
|
|
165
|
+
} : this.$props.filter, q = d(Ie, {
|
|
166
|
+
size: this.$props.size,
|
|
167
|
+
headerRow: d(De, {
|
|
168
|
+
grid: this,
|
|
169
|
+
sort: this.$props.sort,
|
|
170
|
+
filter: U,
|
|
171
|
+
sortable: this.$props.sortable,
|
|
172
|
+
selectedField: this.$props.selectedField,
|
|
173
|
+
reorderable: r,
|
|
174
|
+
filterable: n,
|
|
175
|
+
filterOperators: this.$props.filterOperators || B,
|
|
176
|
+
onSortChange: this.sortChange,
|
|
177
|
+
onSelectionchange: this.onHeaderSelectionChange,
|
|
178
|
+
columns: this.extendedColumn,
|
|
179
|
+
columnsMap: this.columnsMap,
|
|
180
|
+
cellRender: this.$props.headerCellRender,
|
|
181
|
+
columnResize: this.columnResize,
|
|
182
|
+
columnMenu: this.$props.columnMenu,
|
|
183
|
+
onFilterChange: this.columnMenuFilterChange,
|
|
184
|
+
onPressHandler: this.dragLogic.pressHandler,
|
|
185
|
+
onDragHandler: this.dragLogic.dragHandler,
|
|
186
|
+
onReleaseHandler: this.dragLogic.releaseHandler,
|
|
187
|
+
filterRow: n ? d(G, {
|
|
188
|
+
size: this.$props.size,
|
|
189
|
+
columns: C,
|
|
190
|
+
filter: this.$props.filter || [],
|
|
191
|
+
onFilterchange: this.filterChange,
|
|
192
|
+
sort: this.$props.sort,
|
|
193
|
+
ariaRowIndex: this.columnsMap.length + 1,
|
|
194
|
+
grid: this,
|
|
195
|
+
filterOperators: this.$props.filterOperators || B,
|
|
196
|
+
cellRender: this.$props.filterCellRender,
|
|
197
|
+
isRtl: this.isRtl
|
|
198
|
+
}, null) : void 0
|
|
199
|
+
}, null),
|
|
200
|
+
columnResize: this.columnResize
|
|
201
|
+
}, null), F = this.$props.wrapperStyle || {}, {
|
|
202
|
+
colSpans: P,
|
|
203
|
+
hiddenColumns: J
|
|
204
|
+
} = ze({
|
|
205
|
+
enabled: this.$props.columnVirtualization,
|
|
206
|
+
columns: C,
|
|
207
|
+
scrollLeft: this.wrapperScrollLeft,
|
|
208
|
+
tableViewPortWidth: parseFloat((F.width || "").toString())
|
|
209
|
+
}), Q = (s, f, y, $, w, m) => C.map(function(l, c) {
|
|
210
|
+
if (J[c])
|
|
211
|
+
return null;
|
|
212
|
+
const S = l.id ? l.id : c, b = `${l.className ? l.className + " " : ""}${l.locked ? "k-grid-content-sticky" : ""}`, h = R.call(this, this.$props.cellRender || l.cell, v.call(this));
|
|
213
|
+
if (f && l.editCell) {
|
|
214
|
+
const L = R.call(this, l.editCell, v.call(this));
|
|
215
|
+
return D.call(this, {
|
|
216
|
+
h: k,
|
|
217
|
+
template: L,
|
|
218
|
+
additionalProps: {
|
|
219
|
+
id: H.generateNavigatableId(`${y}-${String(c)}`, z),
|
|
220
|
+
colSpan: P[c],
|
|
221
|
+
dataItem: s.dataItem,
|
|
222
|
+
field: l.field,
|
|
223
|
+
format: l.format,
|
|
224
|
+
class: b || void 0,
|
|
225
|
+
render: h,
|
|
226
|
+
level: s.level,
|
|
227
|
+
expandable: l.expandable,
|
|
228
|
+
expanded: $,
|
|
229
|
+
hasChildren: this.hasChildren(s.dataItem),
|
|
230
|
+
colIndex: c,
|
|
231
|
+
ariaColumnIndex: l.ariaColumnIndex,
|
|
232
|
+
style: l.left !== void 0 && {
|
|
233
|
+
left: l.left + "px",
|
|
234
|
+
right: l.right + "px",
|
|
235
|
+
borderRightWidth: l.rightBorder ? "1px" : ""
|
|
236
|
+
} || {},
|
|
237
|
+
isSelected: Array.isArray(m) && m.indexOf(c) > -1
|
|
238
|
+
},
|
|
239
|
+
additionalListeners: {
|
|
240
|
+
change: this.itemChange,
|
|
241
|
+
input: this.itemChange,
|
|
242
|
+
expandchange: this.expandChange,
|
|
243
|
+
selectionchange: (fe) => this.selectionChange(fe, s, c, w)
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
const ue = this.selectedField && l.field === this.selectedField ? qe : je;
|
|
248
|
+
return d(ue, {
|
|
249
|
+
key: S,
|
|
250
|
+
id: H.generateNavigatableId(`${y}-${String(c)}`, z),
|
|
251
|
+
colSpan: P[c],
|
|
252
|
+
dataItem: s.dataItem,
|
|
253
|
+
field: l.field,
|
|
254
|
+
format: l.format,
|
|
255
|
+
class: b || void 0,
|
|
256
|
+
render: h,
|
|
257
|
+
onCellclick: this.cellClick,
|
|
258
|
+
onCellkeydown: this.cellKeydown,
|
|
259
|
+
onChange: this.itemChange,
|
|
260
|
+
onSelectionchange: (L) => this.selectionChange(L, s, c, w),
|
|
261
|
+
level: s.level,
|
|
262
|
+
expandable: l.expandable,
|
|
263
|
+
expanded: $,
|
|
264
|
+
hasChildren: this.hasChildren(s.dataItem),
|
|
265
|
+
onExpandchange: this.expandChange,
|
|
266
|
+
colIndex: c,
|
|
267
|
+
ariaColumnIndex: l.ariaColumnIndex,
|
|
268
|
+
style: l.left !== void 0 && {
|
|
269
|
+
left: l.left + "px",
|
|
270
|
+
right: l.right + "px",
|
|
271
|
+
borderRightWidth: l.rightBorder ? "1px" : ""
|
|
272
|
+
} || {},
|
|
273
|
+
isSelected: Array.isArray(m) && m.indexOf(c) > -1
|
|
274
|
+
}, null);
|
|
275
|
+
}, this);
|
|
276
|
+
let u = this.flatData();
|
|
277
|
+
const N = u.length;
|
|
278
|
+
a !== void 0 && p !== void 0 && (u = u.slice(a, a + p)), i === "virtual" && (u = Ne({
|
|
279
|
+
rows: u,
|
|
280
|
+
tableViewPortHeight: parseFloat((F.height || F.maxHeight || "").toString()),
|
|
281
|
+
scrollTop: this.wrapperScrollTop
|
|
282
|
+
}), this.updateOnScroll = !1);
|
|
283
|
+
const X = R.call(this, this.$props.noRecords, v.call(this)), Y = Ue(this).toLanguageString(V, Ge[V]), Z = D.call(this, {
|
|
284
|
+
h: k,
|
|
285
|
+
template: X
|
|
286
|
+
}), A = u.length ? u.map(function(s) {
|
|
287
|
+
return s.level;
|
|
288
|
+
}) : [], ee = this.columnsMap.length + (n ? 1 : 0) + 1, te = u.length > 0 && u.map(function(s, f) {
|
|
289
|
+
const y = x(this.$props.editField, s.dataItem), $ = this.$props.dataItemKey && Re(this.$props.dataItemKey)(s.dataItem), w = String($ || s.level.join(".")), m = this.expanded(s.dataItem), l = this.$props.selectedField ? x(this.$props.selectedField, s.dataItem) : void 0, c = this.$props.row || _e, S = Q(s, y, w, m, f, l), b = d(c, {
|
|
290
|
+
key: w,
|
|
291
|
+
level: s.level,
|
|
292
|
+
levels: A,
|
|
293
|
+
dataItem: s.dataItem,
|
|
294
|
+
selectedField: this.$props.selectedField,
|
|
295
|
+
rowHeight: i === "virtual" ? s.height : this.$props.rowHeight,
|
|
296
|
+
render: this.$props.rowRender,
|
|
297
|
+
onDrop: this.onRowDrop,
|
|
298
|
+
onDrag: this.onRowDrag,
|
|
299
|
+
onClick: (h) => this.emitRowEvent("rowclick", h, s),
|
|
300
|
+
onDblclick: (h) => this.emitRowEvent("rowdoubleclick", h, s),
|
|
301
|
+
onContextmenu: (h) => this.emitRowEvent("rowcontextmenu", h, s),
|
|
302
|
+
onFocus: (h) => this.emitRowEvent("rowfocus", h, s),
|
|
303
|
+
onBlur: (h) => this.emitRowEvent("rowblur", h, s),
|
|
304
|
+
onMousedown: (h) => this.emitRowEvent("rowmousedown", h, s),
|
|
305
|
+
onMouseup: (h) => this.emitRowEvent("rowmouseup", h, s),
|
|
306
|
+
isAltRow: f % 2 !== 0,
|
|
307
|
+
expanded: m,
|
|
308
|
+
rowIndex: f,
|
|
309
|
+
ariaRowIndex: ee + f,
|
|
310
|
+
ariaSetSize: s.levelCount,
|
|
311
|
+
ariaPosInSet: s.level[s.level.length - 1] + 1,
|
|
312
|
+
isSelected: typeof l == "boolean" && l,
|
|
313
|
+
className: this.$props.rowClass ? this.$props.rowClass(s) : ""
|
|
314
|
+
}, W(S) ? S : {
|
|
315
|
+
default: () => [S]
|
|
316
|
+
});
|
|
317
|
+
return g ? d(Be, {
|
|
318
|
+
key: w,
|
|
319
|
+
level: s.level,
|
|
320
|
+
levels: A,
|
|
321
|
+
dataItem: s.dataItem,
|
|
322
|
+
onDrag: this.onRowDrag,
|
|
323
|
+
onDrop: this.onRowDrop
|
|
324
|
+
}, W(b) ? b : {
|
|
325
|
+
default: () => [b]
|
|
326
|
+
}) : b;
|
|
327
|
+
}, this) || d("tr", {
|
|
328
|
+
class: "k-table-row k-grid-norecords"
|
|
329
|
+
}, [d("td", {
|
|
330
|
+
class: "k-table-td",
|
|
331
|
+
colspan: C.length
|
|
332
|
+
}, [this.$props.noRecords ? Z : Y])]), se = (s) => this.$props.sort && this.$props.sort.some((f) => f.field === s), ie = d("colgroup", {
|
|
333
|
+
ref: E(this, "colGroup")
|
|
334
|
+
}, [C.map(function(s) {
|
|
335
|
+
return d("col", {
|
|
336
|
+
class: se(s.field) ? "k-sorted" : void 0,
|
|
337
|
+
width: s.width !== void 0 ? s.width.toString().indexOf("%") !== -1 ? s.width : Math.floor(parseFloat(s.width.toString())) + "px" : void 0
|
|
338
|
+
}, null);
|
|
339
|
+
}, this)]), oe = this.$props.columnVirtualization || this.$props.scrollable === "virtual", le = this.$props.selectable && this.$props.selectable.drag ? "none" : void 0, re = this.$props.tableProps || {}, ae = R.call(this, this.$props.toolbar, v.call(this)), ne = D.call(this, {
|
|
340
|
+
h: k,
|
|
341
|
+
template: ae
|
|
342
|
+
}), de = R.call(this, this.$props.pager, v.call(this)), he = this.$props.pageable && d(Fe, {
|
|
343
|
+
class: "k-grid-pager",
|
|
344
|
+
size: this.$props.size,
|
|
345
|
+
onPagesizechange: this.pageChangeHandler,
|
|
346
|
+
onPagechange: this.pageChangeHandler,
|
|
347
|
+
total: N,
|
|
348
|
+
skip: this.$props.skip || 0,
|
|
349
|
+
pageSize: this.$props.take || 10,
|
|
350
|
+
messagesMap: _,
|
|
351
|
+
settings: Le(this.$props.pageable || {})
|
|
352
|
+
}, null), ce = D.call(this, {
|
|
353
|
+
h: k,
|
|
354
|
+
template: de,
|
|
355
|
+
defaultRendering: he,
|
|
356
|
+
additionalProps: {
|
|
357
|
+
...this.$props,
|
|
358
|
+
skip: this.skip || 0,
|
|
359
|
+
messagesMap: _
|
|
360
|
+
},
|
|
361
|
+
additionalListeners: {
|
|
362
|
+
pagesizechange: this.pageChangeHandler,
|
|
363
|
+
pagechange: this.pageChangeHandler
|
|
364
|
+
}
|
|
365
|
+
}), K = this.dragLogic.reorderable && M && document && document.body, pe = this.reordableRows && this.rowClue && this.rowClue.visible && M && document && document.body, ge = [K && d(Te, {
|
|
366
|
+
ref: E(this, "dropElementClue")
|
|
367
|
+
}, null), K && d(Oe, {
|
|
368
|
+
ref: E(this, "dragElementClue")
|
|
369
|
+
}, null), pe && d(Ve, {
|
|
370
|
+
visible: this.rowClue.visible,
|
|
371
|
+
top: this.rowClue.top,
|
|
372
|
+
left: this.rowClue.left,
|
|
373
|
+
text: this.rowClue.text,
|
|
374
|
+
allowDrop: this.rowClue.allowDrop
|
|
375
|
+
}, null)];
|
|
376
|
+
return d(Ee, {
|
|
377
|
+
ref: "navRef",
|
|
378
|
+
id: this._treeListId,
|
|
379
|
+
navigatable: this.$props.navigatable
|
|
380
|
+
}, {
|
|
381
|
+
default: () => [d(Pe, {
|
|
382
|
+
style: this.$props.wrapperStyle,
|
|
383
|
+
class: this.wrapperClass,
|
|
384
|
+
currentData: u,
|
|
385
|
+
onScroll: oe ? this.handleOnScroll : T,
|
|
386
|
+
onKeydown: this.onKeyDown,
|
|
387
|
+
onFocus: this.onFocus,
|
|
388
|
+
"aria-rowcount": N,
|
|
389
|
+
"aria-colcount": C.length,
|
|
390
|
+
role: "treegrid",
|
|
391
|
+
ref: (s) => {
|
|
392
|
+
this.treeListNavRef = s;
|
|
393
|
+
}
|
|
394
|
+
}, {
|
|
395
|
+
default: () => [
|
|
396
|
+
this.$props.toolbar && d("div", {
|
|
397
|
+
class: this.toolbarClass
|
|
398
|
+
}, [ne]),
|
|
399
|
+
// // @ts-ignore
|
|
400
|
+
// <TableSelection
|
|
401
|
+
// selectable={this.$props.selectable}
|
|
402
|
+
// onRelease={this.selectionRelease}
|
|
403
|
+
// >
|
|
404
|
+
d("table", {
|
|
405
|
+
class: this.gridTableClass,
|
|
406
|
+
style: {
|
|
407
|
+
...re.style || {},
|
|
408
|
+
userSelect: le
|
|
409
|
+
},
|
|
410
|
+
role: "presentation"
|
|
411
|
+
}, [ie, q, d("tbody", {
|
|
412
|
+
class: "k-table-tbody",
|
|
413
|
+
"data-keyboardnavbody": !0,
|
|
414
|
+
role: "presentation"
|
|
415
|
+
}, [te])]),
|
|
416
|
+
ce,
|
|
417
|
+
ge
|
|
418
|
+
]
|
|
419
|
+
})]
|
|
420
|
+
});
|
|
421
|
+
},
|
|
422
|
+
methods: {
|
|
423
|
+
/**
|
|
424
|
+
* Method to allow the scroll to be set to a specific row index.
|
|
425
|
+
*
|
|
426
|
+
* @param options - Object, containing the rowIndex to which is going to be scrolled.
|
|
427
|
+
*/
|
|
428
|
+
scrollIntoView(e) {
|
|
429
|
+
if (!this.element)
|
|
430
|
+
return;
|
|
431
|
+
const {
|
|
432
|
+
rowIndex: t = 0
|
|
433
|
+
} = e, {
|
|
434
|
+
scrollable: i,
|
|
435
|
+
rowHeight: o = 0
|
|
436
|
+
} = this.$props;
|
|
437
|
+
if (i === "virtual" || o)
|
|
438
|
+
this.element.scroll(0, (t - 1) * o);
|
|
439
|
+
else {
|
|
440
|
+
const r = this.element.querySelector(`tbody > tr:nth-child(${t})`);
|
|
441
|
+
if (r) {
|
|
442
|
+
const a = r.offsetTop - this.tbodyOffsetTop;
|
|
443
|
+
this.element.scroll(0, a);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
getColumns() {
|
|
448
|
+
const e = this.extendedColumn.filter((i) => i.declarationIndex >= 0 && i.parentIndex === -1);
|
|
449
|
+
return ((i) => (i.sort((o, r) => o.declarationIndex - r.declarationIndex), i))(e);
|
|
450
|
+
},
|
|
451
|
+
flatData() {
|
|
452
|
+
const {
|
|
453
|
+
dataItems: e = [],
|
|
454
|
+
rowHeight: t = 0
|
|
455
|
+
} = this.$props;
|
|
456
|
+
let i = 0;
|
|
457
|
+
const o = (a) => {
|
|
458
|
+
const p = {
|
|
459
|
+
height: t,
|
|
460
|
+
offsetTop: i
|
|
461
|
+
};
|
|
462
|
+
return i += p.height, p;
|
|
463
|
+
}, r = this.updateOnScroll && this.prevData === e && this.tbodyOffsetTop > 0 && this.flattedData.length ? this.flattedData : Ke(e, this.expandedSubItems, o);
|
|
464
|
+
return this.prevData = e, this.flattedData = r, r;
|
|
465
|
+
},
|
|
466
|
+
onKeyDown(e) {
|
|
467
|
+
this.$emit("keydown", e);
|
|
468
|
+
},
|
|
469
|
+
onFocus(e) {
|
|
470
|
+
},
|
|
471
|
+
onRowDrag(e) {
|
|
472
|
+
this.rowClue = e.clueProps, this.$emit("rowdrag", {
|
|
473
|
+
...e,
|
|
474
|
+
target: this
|
|
475
|
+
});
|
|
476
|
+
},
|
|
477
|
+
onRowDrop(e) {
|
|
478
|
+
this.rowClue = e.clueProps, e.clueProps.allowDrop && this.$emit("rowdrop", {
|
|
479
|
+
...e,
|
|
480
|
+
target: this
|
|
481
|
+
});
|
|
482
|
+
},
|
|
483
|
+
columnReorder(e, t, i) {
|
|
484
|
+
const o = this.extendedColumn[e].depth, r = (n) => {
|
|
485
|
+
do
|
|
486
|
+
n++;
|
|
487
|
+
while (n < this.extendedColumn.length && this.extendedColumn[n].depth > o);
|
|
488
|
+
return n;
|
|
489
|
+
}, a = this.extendedColumn.splice(e, r(e) - e);
|
|
490
|
+
this.extendedColumn.splice(e < t ? r(t - a.length) : t, 0, ...a), this.extendedColumn.filter((n) => n.declarationIndex >= 0).forEach((n, g) => n.orderIndex = g);
|
|
491
|
+
const p = {
|
|
492
|
+
component: this,
|
|
493
|
+
columns: this.getColumns(),
|
|
494
|
+
prev: e,
|
|
495
|
+
next: t,
|
|
496
|
+
event: i
|
|
497
|
+
};
|
|
498
|
+
this.$emit("columnreorder", p);
|
|
499
|
+
},
|
|
500
|
+
onResize(e, t, i, o, r) {
|
|
501
|
+
const a = this.extendedColumn.filter((n) => n.children.length === 0).reduce((n, g) => n += parseFloat(String(g.width)), 0);
|
|
502
|
+
if (this.extendedColumn && this.columns) {
|
|
503
|
+
const n = this.columns[e].width, g = n && n.toString().indexOf("px") > 0;
|
|
504
|
+
this.extendedColumn[e].width = g ? t + "px" : t;
|
|
505
|
+
}
|
|
506
|
+
const p = {
|
|
507
|
+
columns: this.getColumns(),
|
|
508
|
+
totalWidth: a,
|
|
509
|
+
index: e,
|
|
510
|
+
event: o,
|
|
511
|
+
newWidth: t,
|
|
512
|
+
oldWidth: i,
|
|
513
|
+
end: r,
|
|
514
|
+
component: this
|
|
515
|
+
};
|
|
516
|
+
r && (this.prevColumns = void 0), this.$emit("columnresize", p);
|
|
517
|
+
},
|
|
518
|
+
handleOnScroll(e) {
|
|
519
|
+
const t = e.currentTarget.scrollLeft, i = e.currentTarget.scrollTop, {
|
|
520
|
+
columnVirtualization: o,
|
|
521
|
+
scrollable: r,
|
|
522
|
+
rowHeight: a = 0
|
|
523
|
+
} = this.$props, p = a, n = 0;
|
|
524
|
+
let g = !1;
|
|
525
|
+
o && Math.abs(this.wrapperScrollLeft - t) > n && (this.wrapperScrollLeft = t, g = !0), r === "virtual" && Math.abs(this.wrapperScrollTop - i) > p && (this.wrapperScrollTop = i, g = !0), g && (this.updateOnScroll = !0);
|
|
526
|
+
},
|
|
527
|
+
calculateSizes(e) {
|
|
528
|
+
if (!e || this.$props.scrollable === "none")
|
|
529
|
+
return;
|
|
530
|
+
const t = Array.from(e.childNodes), i = t.find((a) => a.nodeName === "TABLE"), o = this.$props.toolbar && t.find((a) => a.nodeType === 1 && a.classList.contains("k-grid-toolbar"));
|
|
531
|
+
let r = 0;
|
|
532
|
+
if (o && M) {
|
|
533
|
+
const a = o.style.boxSizing;
|
|
534
|
+
o.style.boxSizing = "border-box", r = parseFloat(String(window.getComputedStyle(o).height)) || o.offsetHeight, o.style.boxSizing = a, o.getAttribute("style") || o.removeAttribute("style");
|
|
535
|
+
}
|
|
536
|
+
this.tbodyOffsetTop = i.tBodies[0].offsetTop, Ae(i, r);
|
|
537
|
+
},
|
|
538
|
+
cellClick(e) {
|
|
539
|
+
this.$emit("cellclick", e);
|
|
540
|
+
},
|
|
541
|
+
cellKeydown(e) {
|
|
542
|
+
this.$emit("cellkeydown", e);
|
|
543
|
+
},
|
|
544
|
+
itemChange(e) {
|
|
545
|
+
if (e.field === this.$props.expandField) {
|
|
546
|
+
if (this.$props.onExpandchange) {
|
|
547
|
+
const o = {
|
|
548
|
+
...this.getArguments(e.event),
|
|
549
|
+
dataItem: e.dataItem,
|
|
550
|
+
level: e.level,
|
|
551
|
+
value: e.value
|
|
552
|
+
};
|
|
553
|
+
this.$emit("expandchange", o);
|
|
554
|
+
}
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
const t = {
|
|
558
|
+
...this.getArguments(e.event),
|
|
559
|
+
dataItem: e.dataItem,
|
|
560
|
+
level: e.level,
|
|
561
|
+
field: e.field,
|
|
562
|
+
value: e.value
|
|
563
|
+
};
|
|
564
|
+
e.dataItem && this.$emit("itemchange", t);
|
|
565
|
+
},
|
|
566
|
+
selectionChange(e) {
|
|
567
|
+
const {
|
|
568
|
+
event: t,
|
|
569
|
+
item: i,
|
|
570
|
+
columnIndex: o
|
|
571
|
+
} = e;
|
|
572
|
+
if (!i)
|
|
573
|
+
return;
|
|
574
|
+
const {
|
|
575
|
+
mode: r,
|
|
576
|
+
cell: a
|
|
577
|
+
} = Me(this.$props.selectable), p = {
|
|
578
|
+
...this.getArguments(t),
|
|
579
|
+
dataItem: i.dataItem,
|
|
580
|
+
level: i.level,
|
|
581
|
+
startColIndex: o,
|
|
582
|
+
endColIndex: o,
|
|
583
|
+
// startRowIndex: dataIndex,
|
|
584
|
+
// endRowIndex: dataIndex,
|
|
585
|
+
dataItems: this.getLeafDataItems(),
|
|
586
|
+
altKey: !1,
|
|
587
|
+
ctrlKey: !1,
|
|
588
|
+
shiftKey: !1,
|
|
589
|
+
metaKey: !1,
|
|
590
|
+
mode: r,
|
|
591
|
+
cell: a,
|
|
592
|
+
isDrag: !1,
|
|
593
|
+
componentId: this._treeListId,
|
|
594
|
+
selectedField: this.$props.selectedField || ""
|
|
595
|
+
};
|
|
596
|
+
this.$emit("selectionchange", p);
|
|
597
|
+
},
|
|
598
|
+
onHeaderSelectionChange(e) {
|
|
599
|
+
const t = {
|
|
600
|
+
field: e.field,
|
|
601
|
+
event: e.event,
|
|
602
|
+
component: this,
|
|
603
|
+
dataItems: this.getLeafDataItems()
|
|
604
|
+
};
|
|
605
|
+
this.$emit("headerselectionchange", t);
|
|
606
|
+
},
|
|
607
|
+
selectionRelease(e) {
|
|
608
|
+
if (this.$props.onSelectionchange) {
|
|
609
|
+
const t = {
|
|
610
|
+
event: void 0,
|
|
611
|
+
component: this,
|
|
612
|
+
selectedField: this.$props.selectedField || "",
|
|
613
|
+
componentId: this._treeListId,
|
|
614
|
+
dataItems: this.getLeafDataItems(),
|
|
615
|
+
dataItem: null,
|
|
616
|
+
level: [],
|
|
617
|
+
...e
|
|
618
|
+
};
|
|
619
|
+
this.$emit("selectionchange", t);
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
sortChange(e, t) {
|
|
623
|
+
this.raiseDataEvent("sortchange", {
|
|
624
|
+
sort: e,
|
|
625
|
+
field: t.field
|
|
626
|
+
}, t);
|
|
627
|
+
},
|
|
628
|
+
filterChange(e, t) {
|
|
629
|
+
const i = e ? e.filters : [];
|
|
630
|
+
this.raiseDataEvent("filterchange", {
|
|
631
|
+
filter: i
|
|
632
|
+
}, {
|
|
633
|
+
filter: i,
|
|
634
|
+
skip: 0
|
|
635
|
+
}, t);
|
|
636
|
+
},
|
|
637
|
+
columnMenuFilterChange(e, t) {
|
|
638
|
+
const i = e ? e.filters : [], o = {
|
|
639
|
+
...t,
|
|
640
|
+
filter: i,
|
|
641
|
+
component: this
|
|
642
|
+
};
|
|
643
|
+
this.$emit("columnmenufilterchange", o);
|
|
644
|
+
},
|
|
645
|
+
expandChange(e, t, i) {
|
|
646
|
+
const {
|
|
647
|
+
expandField: o
|
|
648
|
+
} = this.$props;
|
|
649
|
+
if (o) {
|
|
650
|
+
const r = {
|
|
651
|
+
...this.getArguments(e),
|
|
652
|
+
dataItem: t,
|
|
653
|
+
level: i,
|
|
654
|
+
value: this.expanded(t)
|
|
655
|
+
};
|
|
656
|
+
this.$emit("expandchange", r);
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
emitRowEvent(e, t, i) {
|
|
660
|
+
if (t.target.nodeName === "TD") {
|
|
661
|
+
const o = {
|
|
662
|
+
dataItem: i.dataItem,
|
|
663
|
+
level: i.level,
|
|
664
|
+
...this.getArguments(t)
|
|
665
|
+
};
|
|
666
|
+
this.$emit(e, o);
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
pageChangeHandler(e, t) {
|
|
670
|
+
this.raiseDataEvent("pagechange", {
|
|
671
|
+
page: e,
|
|
672
|
+
event: t,
|
|
673
|
+
skip: e.skip,
|
|
674
|
+
take: e.take
|
|
675
|
+
}, {
|
|
676
|
+
skip: e.skip,
|
|
677
|
+
take: e.take
|
|
678
|
+
}, t);
|
|
679
|
+
},
|
|
680
|
+
raiseDataEvent(e, t, i, o) {
|
|
681
|
+
j.call(this, e) ? this.$emit(e, {
|
|
682
|
+
...this.getArguments(o),
|
|
683
|
+
...t
|
|
684
|
+
}) : j.call(this, "datastatechange") && this.$emit("datastatechange", {
|
|
685
|
+
...this.getArguments(o),
|
|
686
|
+
data: {
|
|
687
|
+
...this.getDataState(),
|
|
688
|
+
...t,
|
|
689
|
+
...i
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
},
|
|
693
|
+
getDataState() {
|
|
694
|
+
return {
|
|
695
|
+
filter: this.$props.filter,
|
|
696
|
+
sort: this.$props.sort
|
|
697
|
+
};
|
|
698
|
+
},
|
|
699
|
+
getArguments(e) {
|
|
700
|
+
return {
|
|
701
|
+
event: e,
|
|
702
|
+
component: this
|
|
703
|
+
};
|
|
704
|
+
},
|
|
705
|
+
expandedSubItems(e) {
|
|
706
|
+
const t = [];
|
|
707
|
+
return this.expanded(e) && this.hasChildren(e) && t.push(...x(this.$props.subItemsField, e)), t;
|
|
708
|
+
},
|
|
709
|
+
getLeafDataItems() {
|
|
710
|
+
return this.flatData().map((e) => e.dataItem);
|
|
711
|
+
},
|
|
712
|
+
expanded(e) {
|
|
713
|
+
return !!x(this.$props.expandField, e);
|
|
714
|
+
},
|
|
715
|
+
hasChildren(e) {
|
|
716
|
+
return !!x(this.$props.subItemsField, e);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
export {
|
|
721
|
+
ht as TreeList
|
|
722
|
+
};
|