@progress/kendo-vue-grid 3.5.0 → 3.5.1-dev.202208100944
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-grid.js +1 -1
- package/dist/es/Grid.js +20 -24
- package/dist/es/ScrollMode.js +1 -0
- package/dist/es/columnMenu/ColumnMenu.js +2 -2
- package/dist/es/columnMenu/GridColumnMenuCheckboxFilter.js +9 -13
- package/dist/es/columnMenu/GridColumnMenuFilter.js +423 -107
- package/dist/es/columnMenu/GridColumnMenuFilterCell.js +74 -97
- package/dist/es/columnMenu/GridColumnMenuFilterOperators.d.ts +36 -0
- package/dist/es/columnMenu/GridColumnMenuFilterOperators.js +68 -0
- package/dist/es/columnMenu/GridColumnMenuItem.js +2 -2
- package/dist/es/filterCommon.d.ts +1 -1
- package/dist/es/footer/Footer.js +1 -1
- package/dist/es/footer/FooterRow.js +1 -1
- package/dist/es/header/FilterRow.js +1 -1
- package/dist/es/header/Header.js +1 -1
- package/dist/es/header/HeaderRow.js +1 -1
- package/dist/es/interfaces/ExtendedColumnProps.js +1 -0
- package/dist/es/interfaces/GridCellProps.js +1 -0
- package/dist/es/interfaces/GridColumnMenuColumnProps.js +1 -0
- package/dist/es/interfaces/GridColumnMenuExtendedFilterProps.js +1 -0
- package/dist/es/interfaces/GridColumnMenuFilterBaseProps.js +1 -0
- package/dist/es/interfaces/GridColumnMenuFilterProps.js +1 -0
- package/dist/es/interfaces/GridColumnMenuFilterUIProps.js +1 -0
- package/dist/es/interfaces/GridColumnMenuProps.js +1 -0
- package/dist/es/interfaces/GridColumnMenuSortBaseProps.js +1 -0
- package/dist/es/interfaces/GridColumnProps.js +1 -0
- package/dist/es/interfaces/GridDetailRowProps.js +1 -0
- package/dist/es/interfaces/GridFilterCellProps.js +1 -0
- package/dist/es/interfaces/GridFilterOperator.js +1 -0
- package/dist/es/interfaces/GridFilterOperators.js +1 -0
- package/dist/es/interfaces/GridFooterCellProps.js +1 -0
- package/dist/es/interfaces/GridGroupableSettings.js +1 -0
- package/dist/es/interfaces/GridHeaderCellProps.js +1 -0
- package/dist/es/interfaces/GridHeaderSelectionCellProps.js +1 -0
- package/dist/es/interfaces/GridNoRecordsProps.js +1 -0
- package/dist/es/interfaces/GridProps.js +1 -0
- package/dist/es/interfaces/GridRowProps.js +1 -0
- package/dist/es/interfaces/GridRowType.js +1 -0
- package/dist/es/interfaces/GridSortSettings.js +9 -7
- package/dist/es/interfaces/GridToolbarProps.js +1 -0
- package/dist/es/interfaces/events.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rows/GridDetailRow.d.ts +2 -1
- package/dist/es/utils/index.js +4 -4
- package/dist/esm/Grid.d.ts +180 -0
- package/dist/esm/Grid.js +2086 -0
- package/dist/esm/GridNav.d.ts +46 -0
- package/dist/esm/GridNav.js +112 -0
- package/dist/esm/GridNoRecords.d.ts +51 -0
- package/dist/esm/GridNoRecords.js +83 -0
- package/dist/esm/GridToolbar.d.ts +58 -0
- package/dist/esm/GridToolbar.js +77 -0
- package/dist/esm/ScrollMode.d.ts +1 -0
- package/dist/esm/ScrollMode.js +1 -0
- package/dist/esm/VirtualScroll.d.ts +41 -0
- package/dist/esm/VirtualScroll.js +217 -0
- package/dist/esm/additionalTypes.ts +21 -0
- package/dist/esm/cells/GridCell.d.ts +30 -0
- package/dist/esm/cells/GridCell.js +161 -0
- package/dist/esm/cells/GridDetailCell.d.ts +29 -0
- package/dist/esm/cells/GridDetailCell.js +82 -0
- package/dist/esm/cells/GridDetailHierarchyCell.d.ts +24 -0
- package/dist/esm/cells/GridDetailHierarchyCell.js +53 -0
- package/dist/esm/cells/GridEditCell.d.ts +40 -0
- package/dist/esm/cells/GridEditCell.js +312 -0
- package/dist/esm/cells/GridFilterCell.d.ts +26 -0
- package/dist/esm/cells/GridFilterCell.js +259 -0
- package/dist/esm/cells/GridGroupCell.d.ts +23 -0
- package/dist/esm/cells/GridGroupCell.js +179 -0
- package/dist/esm/cells/GridHierarchyCell.d.ts +23 -0
- package/dist/esm/cells/GridHierarchyCell.js +162 -0
- package/dist/esm/cells/GridSelectionCell.d.ts +34 -0
- package/dist/esm/cells/GridSelectionCell.js +138 -0
- package/dist/esm/columnMenu/ColumnMenu.d.ts +56 -0
- package/dist/esm/columnMenu/ColumnMenu.js +252 -0
- package/dist/esm/columnMenu/ColumnMenuContent.d.ts +33 -0
- package/dist/esm/columnMenu/ColumnMenuContent.js +123 -0
- package/dist/esm/columnMenu/GridColumnMenuCheckboxFilter.d.ts +86 -0
- package/dist/esm/columnMenu/GridColumnMenuCheckboxFilter.js +709 -0
- package/dist/esm/columnMenu/GridColumnMenuFilter.d.ts +339 -0
- package/dist/esm/columnMenu/GridColumnMenuFilter.js +1079 -0
- package/dist/esm/columnMenu/GridColumnMenuFilterCell.d.ts +45 -0
- package/dist/esm/columnMenu/GridColumnMenuFilterCell.js +152 -0
- package/dist/esm/columnMenu/GridColumnMenuFilterOperators.d.ts +36 -0
- package/dist/esm/columnMenu/GridColumnMenuFilterOperators.js +68 -0
- package/dist/esm/columnMenu/GridColumnMenuFilterUI.d.ts +24 -0
- package/dist/esm/columnMenu/GridColumnMenuFilterUI.js +155 -0
- package/dist/esm/columnMenu/GridColumnMenuItem.d.ts +42 -0
- package/dist/esm/columnMenu/GridColumnMenuItem.js +63 -0
- package/dist/esm/columnMenu/GridColumnMenuItemContent.d.ts +34 -0
- package/dist/esm/columnMenu/GridColumnMenuItemContent.js +51 -0
- package/dist/esm/columnMenu/GridColumnMenuItemGroup.d.ts +19 -0
- package/dist/esm/columnMenu/GridColumnMenuItemGroup.js +33 -0
- package/dist/esm/columnMenu/GridColumnMenuSort.d.ts +283 -0
- package/dist/esm/columnMenu/GridColumnMenuSort.js +375 -0
- package/dist/esm/drag/ColumnDraggable.d.ts +43 -0
- package/dist/esm/drag/ColumnDraggable.js +73 -0
- package/dist/esm/drag/ColumnResize.d.ts +31 -0
- package/dist/esm/drag/ColumnResize.js +126 -0
- package/dist/esm/drag/ColumnResizer.d.ts +40 -0
- package/dist/esm/drag/ColumnResizer.js +89 -0
- package/dist/esm/drag/CommonDragLogic.d.ts +35 -0
- package/dist/esm/drag/CommonDragLogic.js +177 -0
- package/dist/esm/drag/DragClue.d.ts +25 -0
- package/dist/esm/drag/DragClue.js +52 -0
- package/dist/esm/drag/DropClue.d.ts +24 -0
- package/dist/esm/drag/DropClue.js +46 -0
- package/dist/esm/drag/GroupingIndicator.d.ts +51 -0
- package/dist/esm/drag/GroupingIndicator.js +153 -0
- package/dist/esm/filterCommon.d.ts +75 -0
- package/dist/esm/filterCommon.js +156 -0
- package/dist/esm/footer/Footer.d.ts +52 -0
- package/dist/esm/footer/Footer.js +103 -0
- package/dist/esm/footer/FooterRow.d.ts +30 -0
- package/dist/esm/footer/FooterRow.js +73 -0
- package/dist/esm/header/FilterRow.d.ts +36 -0
- package/dist/esm/header/FilterRow.js +203 -0
- package/dist/esm/header/GridHeaderCell.d.ts +21 -0
- package/dist/esm/header/GridHeaderCell.js +60 -0
- package/dist/esm/header/GridHeaderSelectionCell.d.ts +32 -0
- package/dist/esm/header/GridHeaderSelectionCell.js +81 -0
- package/dist/esm/header/GroupPanel.d.ts +38 -0
- package/dist/esm/header/GroupPanel.js +108 -0
- package/dist/esm/header/Header.d.ts +64 -0
- package/dist/esm/header/Header.js +123 -0
- package/dist/esm/header/HeaderRow.d.ts +86 -0
- package/dist/esm/header/HeaderRow.js +517 -0
- package/dist/esm/interfaces/ExtendedColumnProps.d.ts +20 -0
- package/dist/esm/interfaces/ExtendedColumnProps.js +1 -0
- package/dist/esm/interfaces/GridCellProps.d.ts +156 -0
- package/dist/esm/interfaces/GridCellProps.js +1 -0
- package/dist/esm/interfaces/GridColumnMenuColumnProps.d.ts +13 -0
- package/dist/esm/interfaces/GridColumnMenuColumnProps.js +1 -0
- package/dist/esm/interfaces/GridColumnMenuExtendedFilterProps.d.ts +42 -0
- package/dist/esm/interfaces/GridColumnMenuExtendedFilterProps.js +1 -0
- package/dist/esm/interfaces/GridColumnMenuFilterBaseProps.d.ts +49 -0
- package/dist/esm/interfaces/GridColumnMenuFilterBaseProps.js +1 -0
- package/dist/esm/interfaces/GridColumnMenuFilterProps.d.ts +27 -0
- package/dist/esm/interfaces/GridColumnMenuFilterProps.js +1 -0
- package/dist/esm/interfaces/GridColumnMenuFilterUIProps.d.ts +55 -0
- package/dist/esm/interfaces/GridColumnMenuFilterUIProps.js +1 -0
- package/dist/esm/interfaces/GridColumnMenuProps.d.ts +19 -0
- package/dist/esm/interfaces/GridColumnMenuProps.js +1 -0
- package/dist/esm/interfaces/GridColumnMenuSortBaseProps.d.ts +28 -0
- package/dist/esm/interfaces/GridColumnMenuSortBaseProps.js +1 -0
- package/dist/esm/interfaces/GridColumnProps.d.ts +147 -0
- package/dist/esm/interfaces/GridColumnProps.js +1 -0
- package/dist/esm/interfaces/GridDetailRowProps.d.ts +9 -0
- package/dist/esm/interfaces/GridDetailRowProps.js +1 -0
- package/dist/esm/interfaces/GridFilterCellProps.d.ts +64 -0
- package/dist/esm/interfaces/GridFilterCellProps.js +1 -0
- package/dist/esm/interfaces/GridFilterOperator.d.ts +7 -0
- package/dist/esm/interfaces/GridFilterOperator.js +1 -0
- package/dist/esm/interfaces/GridFilterOperators.d.ts +49 -0
- package/dist/esm/interfaces/GridFilterOperators.js +1 -0
- package/dist/esm/interfaces/GridFooterCellProps.d.ts +7 -0
- package/dist/esm/interfaces/GridFooterCellProps.js +1 -0
- package/dist/esm/interfaces/GridGroupableSettings.d.ts +15 -0
- package/dist/esm/interfaces/GridGroupableSettings.js +1 -0
- package/dist/esm/interfaces/GridHeaderCellProps.d.ts +37 -0
- package/dist/esm/interfaces/GridHeaderCellProps.js +1 -0
- package/dist/esm/interfaces/GridHeaderSelectionCellProps.d.ts +17 -0
- package/dist/esm/interfaces/GridHeaderSelectionCellProps.js +1 -0
- package/dist/esm/interfaces/GridNoRecordsProps.d.ts +9 -0
- package/dist/esm/interfaces/GridNoRecordsProps.js +1 -0
- package/dist/esm/interfaces/GridProps.d.ts +311 -0
- package/dist/esm/interfaces/GridProps.js +1 -0
- package/dist/esm/interfaces/GridRowProps.d.ts +55 -0
- package/dist/esm/interfaces/GridRowProps.js +1 -0
- package/dist/esm/interfaces/GridRowType.d.ts +9 -0
- package/dist/esm/interfaces/GridRowType.js +1 -0
- package/dist/esm/interfaces/GridSortSettings.d.ts +26 -0
- package/dist/esm/interfaces/GridSortSettings.js +20 -0
- package/dist/esm/interfaces/GridToolbarProps.d.ts +9 -0
- package/dist/esm/interfaces/GridToolbarProps.js +1 -0
- package/dist/esm/interfaces/events.d.ts +248 -0
- package/dist/esm/interfaces/events.js +1 -0
- package/dist/esm/main.d.ts +38 -0
- package/dist/esm/main.js +31 -0
- package/dist/esm/messages/index.d.ts +150 -0
- package/dist/esm/messages/index.js +151 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/rows/GridDetailRow.d.ts +16 -0
- package/dist/esm/rows/GridDetailRow.js +29 -0
- package/dist/esm/rows/GridRow.d.ts +28 -0
- package/dist/esm/rows/GridRow.js +84 -0
- package/dist/esm/utils/browser-support.service.d.ts +7 -0
- package/dist/esm/utils/browser-support.service.js +26 -0
- package/dist/esm/utils/index.d.ts +91 -0
- package/dist/esm/utils/index.js +393 -0
- package/dist/npm/Grid.js +66 -70
- package/dist/npm/GridNav.js +1 -1
- package/dist/npm/GridNoRecords.js +2 -2
- package/dist/npm/GridToolbar.js +1 -1
- package/dist/npm/cells/GridCell.js +2 -2
- package/dist/npm/cells/GridEditCell.js +2 -2
- package/dist/npm/cells/GridFilterCell.js +4 -4
- package/dist/npm/cells/GridHierarchyCell.js +1 -1
- package/dist/npm/cells/GridSelectionCell.js +2 -2
- package/dist/npm/columnMenu/ColumnMenu.js +5 -5
- package/dist/npm/columnMenu/GridColumnMenuCheckboxFilter.js +14 -18
- package/dist/npm/columnMenu/GridColumnMenuFilter.js +445 -125
- package/dist/npm/columnMenu/GridColumnMenuFilterCell.js +79 -102
- package/dist/npm/columnMenu/GridColumnMenuFilterOperators.d.ts +36 -0
- package/dist/npm/columnMenu/GridColumnMenuFilterOperators.js +79 -0
- package/dist/npm/columnMenu/GridColumnMenuItem.js +2 -2
- package/dist/npm/columnMenu/GridColumnMenuItemContent.js +1 -1
- package/dist/npm/columnMenu/GridColumnMenuItemGroup.js +1 -1
- package/dist/npm/columnMenu/GridColumnMenuSort.js +5 -4
- package/dist/npm/drag/ColumnDraggable.js +1 -1
- package/dist/npm/drag/CommonDragLogic.js +2 -2
- package/dist/npm/drag/GroupingIndicator.js +3 -3
- package/dist/npm/filterCommon.d.ts +1 -1
- package/dist/npm/filterCommon.js +19 -12
- package/dist/npm/footer/Footer.js +6 -6
- package/dist/npm/footer/FooterRow.js +2 -2
- package/dist/npm/header/FilterRow.js +7 -7
- package/dist/npm/header/GridHeaderCell.js +1 -1
- package/dist/npm/header/GridHeaderSelectionCell.js +1 -1
- package/dist/npm/header/GroupPanel.js +1 -1
- package/dist/npm/header/Header.js +8 -8
- package/dist/npm/header/HeaderRow.js +2 -2
- package/dist/npm/interfaces/GridSortSettings.js +11 -8
- package/dist/npm/main.js +6 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rows/GridDetailRow.d.ts +2 -1
- package/dist/npm/rows/GridRow.js +2 -2
- package/dist/npm/utils/index.js +6 -5
- package/package.json +14 -14
package/dist/esm/Grid.js
ADDED
|
@@ -0,0 +1,2086 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
18
|
+
var t = {};
|
|
19
|
+
|
|
20
|
+
for (var p in s) {
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
31
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
32
|
+
if (ar || !(i in from)) {
|
|
33
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
34
|
+
ar[i] = from[i];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38
|
+
}; // @ts-ignore
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
import * as Vue from 'vue';
|
|
42
|
+
var allVue = Vue;
|
|
43
|
+
var gh = allVue.h;
|
|
44
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
45
|
+
var ref = allVue.ref;
|
|
46
|
+
var markRaw = allVue.markRaw;
|
|
47
|
+
import { templateRendering, hasListener, getListeners, getDefaultSlots, guid, getter, isRtl, validatePackage, getTemplate, canUseDOM, templateDefinition, isObject, setRef, getRef } from '@progress/kendo-vue-common';
|
|
48
|
+
import { tableColumnsVirtualization, Pager, normalize, tableKeyboardNavigationTools as navigationTools, TableKeyboardNavigationProvider } from '@progress/kendo-vue-data-tools';
|
|
49
|
+
import { Loader } from '@progress/kendo-vue-indicators';
|
|
50
|
+
import { GridNav } from './GridNav.js';
|
|
51
|
+
import { GridSelectionCell } from './cells/GridSelectionCell.js';
|
|
52
|
+
import { GridHierarchyCell } from './cells/GridHierarchyCell.js';
|
|
53
|
+
import { GridDetailHierarchyCell } from './cells/GridDetailHierarchyCell.js';
|
|
54
|
+
import { GridDetailCell } from './cells/GridDetailCell.js';
|
|
55
|
+
import { GridEditCell } from './cells/GridEditCell.js';
|
|
56
|
+
import { Header } from './header/Header.js';
|
|
57
|
+
import { HeaderRow } from './header/HeaderRow.js';
|
|
58
|
+
import { FilterRow } from './header/FilterRow.js';
|
|
59
|
+
import { GroupPanel } from './header/GroupPanel.js';
|
|
60
|
+
import { Footer } from './footer/Footer.js';
|
|
61
|
+
import { FooterRow } from './footer/FooterRow.js';
|
|
62
|
+
import { operators } from './filterCommon.js';
|
|
63
|
+
import { VirtualScroll } from './VirtualScroll.js';
|
|
64
|
+
import { ColumnResize } from './drag/ColumnResize.js';
|
|
65
|
+
import { CommonDragLogic } from './drag/CommonDragLogic.js';
|
|
66
|
+
import { DragClue } from './drag/DragClue.js';
|
|
67
|
+
import { DropClue } from './drag/DropClue.js';
|
|
68
|
+
import { getNestedValue, flatData, mapColumns, readColumns, autoGenerateColumns, applyExpandedState, groupedFirstItemValue } from './utils/index.js';
|
|
69
|
+
import { GridCell } from './cells/GridCell.js';
|
|
70
|
+
import { GridGroupCell } from './cells/GridGroupCell.js';
|
|
71
|
+
import { GridRow } from './rows/GridRow.js';
|
|
72
|
+
import { GridHeaderSelectionCell } from './header/GridHeaderSelectionCell.js';
|
|
73
|
+
import { GridNoRecords } from './GridNoRecords.js';
|
|
74
|
+
import { packageMetadata } from './package-metadata.js';
|
|
75
|
+
import { pagerMessagesMap } from './messages.js';
|
|
76
|
+
/**
|
|
77
|
+
* @hidden
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
var GridVue2 = {
|
|
81
|
+
name: 'KendoGrid',
|
|
82
|
+
props: {
|
|
83
|
+
topCacheCount: {
|
|
84
|
+
type: Number,
|
|
85
|
+
default: 0
|
|
86
|
+
},
|
|
87
|
+
collapsedGroups: {
|
|
88
|
+
type: Array,
|
|
89
|
+
default: function _default() {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
uniqueField: String,
|
|
94
|
+
totalGroupedHeight: Number,
|
|
95
|
+
allGroupedItems: Object,
|
|
96
|
+
alternatePerGroup: Boolean,
|
|
97
|
+
columns: Array,
|
|
98
|
+
columnVirtualization: Boolean,
|
|
99
|
+
dataItems: [Array, Object],
|
|
100
|
+
sortable: [Boolean, Object],
|
|
101
|
+
sort: Array,
|
|
102
|
+
filterable: Boolean,
|
|
103
|
+
filterOperators: Object,
|
|
104
|
+
filterCellRender: templateDefinition,
|
|
105
|
+
headerCellRender: templateDefinition,
|
|
106
|
+
loader: [String, Function, Object, Boolean],
|
|
107
|
+
filter: Object,
|
|
108
|
+
pageable: [Boolean, Object],
|
|
109
|
+
pageSize: Number,
|
|
110
|
+
total: Number,
|
|
111
|
+
skip: Number,
|
|
112
|
+
take: Number,
|
|
113
|
+
expandField: String,
|
|
114
|
+
selectedField: String,
|
|
115
|
+
cellRender: templateDefinition,
|
|
116
|
+
rowRender: templateDefinition,
|
|
117
|
+
resizable: Boolean,
|
|
118
|
+
reorderable: Boolean,
|
|
119
|
+
group: Array,
|
|
120
|
+
groupable: [Boolean, Object],
|
|
121
|
+
editField: String,
|
|
122
|
+
scrollable: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: 'scrollable'
|
|
125
|
+
},
|
|
126
|
+
pager: templateDefinition,
|
|
127
|
+
rowHeight: Number,
|
|
128
|
+
detail: templateDefinition,
|
|
129
|
+
columnMenu: [Boolean, String, Function, Object],
|
|
130
|
+
columnMenuAnimate: {
|
|
131
|
+
type: [Boolean, Object],
|
|
132
|
+
default: function _default() {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
dataItemKey: String,
|
|
137
|
+
navigatable: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
default: false
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
data: function data() {
|
|
143
|
+
return {
|
|
144
|
+
isRtl: false,
|
|
145
|
+
context: undefined,
|
|
146
|
+
navigation: undefined
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
watch: {
|
|
150
|
+
skip: function skip(value, oldValue) {
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
this.onSkipChanged(value, oldValue);
|
|
153
|
+
},
|
|
154
|
+
total: function total(value, oldValue) {
|
|
155
|
+
// @ts-ignore
|
|
156
|
+
this.onTotalChanged(value, oldValue);
|
|
157
|
+
},
|
|
158
|
+
rowHeight: function rowHeight(value, oldValue) {
|
|
159
|
+
// @ts-ignore
|
|
160
|
+
this.onRowHeightChanged(value, oldValue);
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
created: function created() {
|
|
164
|
+
validatePackage(packageMetadata);
|
|
165
|
+
this.initialHeight = null;
|
|
166
|
+
this._columns = [];
|
|
167
|
+
var groupable = this.currentGroupable;
|
|
168
|
+
this.vs = new VirtualScroll(groupable || this.$props.rowHeight === undefined || this.$props.rowHeight === 0, this.$props.topCacheCount);
|
|
169
|
+
this.dragLogic = new CommonDragLogic(this.columnReorder.bind(this), this.groupReorder.bind(this), this.columnToGroup.bind(this));
|
|
170
|
+
this.columnResize = new ColumnResize(this.onResize.bind(this));
|
|
171
|
+
this._columnsMap = [[]];
|
|
172
|
+
this._header = null;
|
|
173
|
+
this._footer = null;
|
|
174
|
+
this.forceUpdateTimeout = undefined;
|
|
175
|
+
this._gridId = guid();
|
|
176
|
+
},
|
|
177
|
+
mounted: function mounted() {
|
|
178
|
+
this.setRefs();
|
|
179
|
+
var rtl = isRtl(this._element);
|
|
180
|
+
this.isRtl = rtl; // @ts-ignore
|
|
181
|
+
|
|
182
|
+
this.initialHeight = this._element.style ? this._element.style.height : null;
|
|
183
|
+
},
|
|
184
|
+
updated: function updated() {
|
|
185
|
+
this.setRefs();
|
|
186
|
+
var rtl = isRtl(this._element);
|
|
187
|
+
this.isRtl = rtl;
|
|
188
|
+
},
|
|
189
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
190
|
+
this.gridUnmounted();
|
|
191
|
+
},
|
|
192
|
+
// @ts-ignore
|
|
193
|
+
unmounted: function unmounted() {
|
|
194
|
+
this.gridUnmounted();
|
|
195
|
+
},
|
|
196
|
+
computed: {
|
|
197
|
+
getCorrectHeight: {
|
|
198
|
+
get: function get() {
|
|
199
|
+
if (this.$props.scrollable === 'virtual') {
|
|
200
|
+
return this.initialHeight || '450px';
|
|
201
|
+
} else {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
currentGroupable: function currentGroupable() {
|
|
207
|
+
return this.$props.groupable === true && this.$props.group && this.$props.group.length || isObject(this.$props.groupable) && this.$props.groupable.enabled !== false;
|
|
208
|
+
},
|
|
209
|
+
computedCollapsed: function computedCollapsed() {
|
|
210
|
+
var newCollapsed = [];
|
|
211
|
+
|
|
212
|
+
if (this.$props.group) {
|
|
213
|
+
for (var i = 0; i < this.$props.group.length; i++) {
|
|
214
|
+
if (this.$props.collapsedGroups[i]) {
|
|
215
|
+
newCollapsed.push(this.$props.collapsedGroups[i]);
|
|
216
|
+
} else {
|
|
217
|
+
newCollapsed.push([]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return newCollapsed;
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
methods: {
|
|
226
|
+
/**
|
|
227
|
+
* A getter of the current columns. Gets the current column width or current columns,
|
|
228
|
+
* or any other [`GridColumnProps`]({% slug api_grid_gridcolumnprops %}) for each defined column.
|
|
229
|
+
* Can be used on each Grid instance. To obtain the instance of the rendered Grid, use the `ref`
|
|
230
|
+
* callback. The following example demonstrates how to reorder the columns by dragging their handlers
|
|
231
|
+
* and check the properties afterwards. You can check the result in the browser console.
|
|
232
|
+
*/
|
|
233
|
+
getColumns: function getColumns() {
|
|
234
|
+
var shuffledColumns = this._columns.filter(function (q) {
|
|
235
|
+
return q.declarationIndex >= 0 && q.parentIndex === -1;
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
var sanitize = function sanitize(columns) {
|
|
239
|
+
columns.sort(function (a, b) {
|
|
240
|
+
return a.declarationIndex - b.declarationIndex;
|
|
241
|
+
});
|
|
242
|
+
return columns.map(function (column) {
|
|
243
|
+
var declarationIndex = column.declarationIndex,
|
|
244
|
+
parentIndex = column.parentIndex,
|
|
245
|
+
depth = column.depth,
|
|
246
|
+
colSpan = column.colSpan,
|
|
247
|
+
rowSpan = column.rowSpan,
|
|
248
|
+
index = column.index,
|
|
249
|
+
kFirst = column.kFirst,
|
|
250
|
+
children = column.children,
|
|
251
|
+
props = __rest(column, ["declarationIndex", "parentIndex", "depth", "colSpan", "rowSpan", "index", "kFirst", "children"]);
|
|
252
|
+
|
|
253
|
+
return children.length ? __assign({
|
|
254
|
+
children: sanitize(children)
|
|
255
|
+
}, props) : props;
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
return sanitize(shuffledColumns);
|
|
260
|
+
},
|
|
261
|
+
setRefs: function setRefs() {
|
|
262
|
+
var elementString = '$el';
|
|
263
|
+
var element = getRef(this, 'gridNav');
|
|
264
|
+
|
|
265
|
+
if (element) {
|
|
266
|
+
this._element = element[elementString];
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
var groupPanelDiv = getRef(this, 'groupPanelDiv');
|
|
270
|
+
|
|
271
|
+
if (groupPanelDiv) {
|
|
272
|
+
var groupPanelDivElement = groupPanelDiv[elementString] || null;
|
|
273
|
+
this.dragLogic.refGroupPanelDiv(groupPanelDivElement);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
var dropElementClue = getRef(this, 'dropElementClue');
|
|
277
|
+
var dragElementClue = getRef(this, 'dragElementClue');
|
|
278
|
+
this.dragLogic.refDropElementClue(dropElementClue);
|
|
279
|
+
this.dragLogic.refDragElementClue(dragElementClue);
|
|
280
|
+
this.columnResize.colGroupMain = getRef(this, 'colGroup');
|
|
281
|
+
this._header = getRef(this, 'header');
|
|
282
|
+
this._footer = getRef(this, 'footer');
|
|
283
|
+
this.vs.container = getRef(this, 'scrollContainer');
|
|
284
|
+
this.vs.table = getRef(this, 'scrollTable');
|
|
285
|
+
this.resetTableWidth();
|
|
286
|
+
this.vs.tableBody = getRef(this, 'scrollTableBody');
|
|
287
|
+
},
|
|
288
|
+
gridUnmounted: function gridUnmounted() {
|
|
289
|
+
clearTimeout(this.forceUpdateTimeout);
|
|
290
|
+
this.columnResize.columns = [];
|
|
291
|
+
this.dragLogic.columns = [];
|
|
292
|
+
|
|
293
|
+
if (this.dragLogic && this.dragLogic.dragElementClue) {
|
|
294
|
+
this.dragLogic.dragElementClue.$el.remove();
|
|
295
|
+
this.dragLogic.dropElementClue.$el.remove();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
this.currentData = [];
|
|
299
|
+
this._columns = [];
|
|
300
|
+
},
|
|
301
|
+
resetVirtual: function resetVirtual() {
|
|
302
|
+
this.vs.PageChange = this.pageChangeHandler;
|
|
303
|
+
this.vs.realSkip = this.$props.skip || 0;
|
|
304
|
+
this.vs.pageSize = (this.$props.take !== undefined ? this.$props.take : this.$props.pageSize) || 0;
|
|
305
|
+
this.vs.scrollableVirtual = this.$props.scrollable === 'virtual';
|
|
306
|
+
this.vs.propsSkip = (this.$props.skip || 0) + (this.$props.scrollable === 'virtual' ? this.vs.topCacheCount + (this.vs.attendedSkip - (this.$props.skip || 0)) : 0);
|
|
307
|
+
},
|
|
308
|
+
onSkipChanged: function onSkipChanged(value, _oldValue) {
|
|
309
|
+
if (Math.max(0, this.vs.attendedSkip) !== value && value !== undefined) {
|
|
310
|
+
this.vs.attendedSkip = value;
|
|
311
|
+
this.vs.propsSkip = (value || 0) + (this.$props.scrollable === 'virtual' ? this.vs.topCacheCount + (this.vs.attendedSkip - (value || 0)) : 0);
|
|
312
|
+
this.vs.syncScroll();
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
onTotalChanged: function onTotalChanged(_value, _oldValue) {
|
|
316
|
+
var groupable = this.currentGroupable;
|
|
317
|
+
this.vs.reset();
|
|
318
|
+
this.vs = new VirtualScroll(groupable || this.$props.rowHeight === undefined || this.$props.rowHeight === 0, this.$props.topCacheCount);
|
|
319
|
+
this.resetVirtual();
|
|
320
|
+
this.setRefs();
|
|
321
|
+
},
|
|
322
|
+
onRowHeightChanged: function onRowHeightChanged(_value, _oldValue) {
|
|
323
|
+
var groupable = this.currentGroupable;
|
|
324
|
+
this.vs.reset();
|
|
325
|
+
this.vs = new VirtualScroll(groupable || this.$props.rowHeight === undefined || this.$props.rowHeight === 0, this.$props.topCacheCount);
|
|
326
|
+
this.resetVirtual();
|
|
327
|
+
this.setRefs();
|
|
328
|
+
},
|
|
329
|
+
scrollHandler: function scrollHandler(event) {
|
|
330
|
+
var _this = this;
|
|
331
|
+
|
|
332
|
+
clearTimeout(this.forceUpdateTimeout);
|
|
333
|
+
|
|
334
|
+
if (this.$props.columnVirtualization && !this.vs.scrollableVirtual) {
|
|
335
|
+
this.forceUpdateTimeout = setTimeout(function () {
|
|
336
|
+
_this.$forceUpdate();
|
|
337
|
+
}, 0);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (this._header) {
|
|
341
|
+
this._header.setScrollLeft(event.currentTarget.scrollLeft);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (this._footer) {
|
|
345
|
+
this._footer.setScrollLeft(event.currentTarget.scrollLeft);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (this.vs) {
|
|
349
|
+
this.vs.scrollHandler(event);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
this.$emit('scroll', event);
|
|
353
|
+
},
|
|
354
|
+
rowClick: function rowClick(e, item) {
|
|
355
|
+
if (e.target.type !== 'checkbox') {
|
|
356
|
+
this.$emit('rowclick', __assign({
|
|
357
|
+
dataItem: item.dataItem
|
|
358
|
+
}, this.getArguments(e)));
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
rowDoubleClick: function rowDoubleClick(e, item) {
|
|
362
|
+
if (e.target.type !== 'checkbox') {
|
|
363
|
+
this.$emit('rowdblclick', __assign({
|
|
364
|
+
dataItem: item.dataItem
|
|
365
|
+
}, this.getArguments(e)));
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
loopGroupedItems: function loopGroupedItems(dataItems, func, level, item) {
|
|
369
|
+
var _this = this;
|
|
370
|
+
|
|
371
|
+
if (level === void 0) {
|
|
372
|
+
level = 0;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (item === void 0) {
|
|
376
|
+
item = null;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
dataItems.forEach(function (di) {
|
|
380
|
+
if (!item && func(di, level)) {
|
|
381
|
+
item = di;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (di.items && di.items.length && !item) {
|
|
385
|
+
item = _this.loopGroupedItems(di.items, func, level + 1, item);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
return item;
|
|
389
|
+
},
|
|
390
|
+
updateGroupCollapsed: function updateGroupCollapsed(event) {
|
|
391
|
+
var collapsed = this.computedCollapsed;
|
|
392
|
+
var collapsedLevel = collapsed[event.level];
|
|
393
|
+
var uniqueField = this.$props.uniqueField;
|
|
394
|
+
|
|
395
|
+
var allItemsItem = function allItemsItem(item, level) {
|
|
396
|
+
return item.value === event.dataItem.value && level === event.level;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
var dataItem = this.allGroupedItems ? this.loopGroupedItems(this.allGroupedItems.data, allItemsItem, 0, null) : event.dataItem;
|
|
400
|
+
var uniqueItemValue = groupedFirstItemValue(dataItem || event.dataItem, uniqueField);
|
|
401
|
+
|
|
402
|
+
if (event.value) {
|
|
403
|
+
if (collapsedLevel && collapsedLevel.length) {
|
|
404
|
+
var expandedIndex = collapsedLevel.indexOf(uniqueItemValue);
|
|
405
|
+
|
|
406
|
+
if (expandedIndex > -1) {
|
|
407
|
+
collapsedLevel.splice(expandedIndex, 1);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
} else {
|
|
411
|
+
if (collapsedLevel) {
|
|
412
|
+
if (!collapsedLevel.includes(uniqueItemValue)) {
|
|
413
|
+
collapsedLevel.push(uniqueItemValue);
|
|
414
|
+
}
|
|
415
|
+
} else {
|
|
416
|
+
collapsedLevel = [uniqueItemValue];
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return collapsed;
|
|
421
|
+
},
|
|
422
|
+
itemChange: function itemChange(event) {
|
|
423
|
+
var itemChange = hasListener.call(this, 'itemchange');
|
|
424
|
+
|
|
425
|
+
if (event.field === this.$props.expandField || (this.$props.group || this.$props.detail) && event.field === undefined) {
|
|
426
|
+
var expandChange = hasListener.call(this, 'expandchange');
|
|
427
|
+
|
|
428
|
+
if (expandChange && event.dataItem) {
|
|
429
|
+
this.$emit('expandchange', __assign(__assign({}, this.getArguments(event.event)), {
|
|
430
|
+
collapsedGroups: this.updateGroupCollapsed(event),
|
|
431
|
+
dataItem: event.dataItem,
|
|
432
|
+
value: event.value
|
|
433
|
+
}));
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
if (itemChange) {
|
|
440
|
+
this.$emit('itemchange', __assign(__assign({}, this.getArguments(event.event)), {
|
|
441
|
+
dataItem: event.dataItem,
|
|
442
|
+
field: event.field,
|
|
443
|
+
value: event.value
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
cellClickHandler: function cellClickHandler(event) {
|
|
448
|
+
this.$emit('cellclick', {
|
|
449
|
+
dataItem: event.dataItem,
|
|
450
|
+
field: event.field
|
|
451
|
+
});
|
|
452
|
+
},
|
|
453
|
+
cellKeydownHandler: function cellKeydownHandler(event) {
|
|
454
|
+
this.$emit('cellkeydown', event);
|
|
455
|
+
},
|
|
456
|
+
editHandler: function editHandler(dataItem) {
|
|
457
|
+
this.$emit('edit', {
|
|
458
|
+
dataItem: dataItem
|
|
459
|
+
});
|
|
460
|
+
},
|
|
461
|
+
removeHandler: function removeHandler(dataItem) {
|
|
462
|
+
this.$emit('remove', {
|
|
463
|
+
dataItem: dataItem
|
|
464
|
+
});
|
|
465
|
+
},
|
|
466
|
+
saveHandler: function saveHandler(dataItem) {
|
|
467
|
+
this.$emit('save', {
|
|
468
|
+
dataItem: dataItem
|
|
469
|
+
});
|
|
470
|
+
},
|
|
471
|
+
cancelHandler: function cancelHandler(dataItem) {
|
|
472
|
+
this.$emit('cancel', {
|
|
473
|
+
dataItem: dataItem
|
|
474
|
+
});
|
|
475
|
+
},
|
|
476
|
+
selectionChangeHandler: function selectionChangeHandler(options) {
|
|
477
|
+
var event = options.event,
|
|
478
|
+
dataItem = options.dataItem,
|
|
479
|
+
dataIndex = options.dataIndex,
|
|
480
|
+
columnIndex = options.columnIndex;
|
|
481
|
+
this.$emit('selectionchange', __assign(__assign({}, this.getArguments(event.event)), {
|
|
482
|
+
dataItem: dataItem,
|
|
483
|
+
startColIndex: columnIndex,
|
|
484
|
+
endColIndex: columnIndex,
|
|
485
|
+
startRowIndex: dataIndex,
|
|
486
|
+
endRowIndex: dataIndex,
|
|
487
|
+
dataItems: this.getLeafDataItems(),
|
|
488
|
+
altKey: false,
|
|
489
|
+
ctrlKey: false,
|
|
490
|
+
shiftKey: false,
|
|
491
|
+
metaKey: false,
|
|
492
|
+
isDrag: false,
|
|
493
|
+
componentId: this._gridId,
|
|
494
|
+
selectedField: this.$props.selectedField || ''
|
|
495
|
+
}));
|
|
496
|
+
},
|
|
497
|
+
onHeaderSelectionChangeHandler: function onHeaderSelectionChangeHandler(event) {
|
|
498
|
+
this.$emit('headerselectionchange', {
|
|
499
|
+
field: event.field,
|
|
500
|
+
event: event.event,
|
|
501
|
+
target: this
|
|
502
|
+
});
|
|
503
|
+
},
|
|
504
|
+
pageChangeHandler: function pageChangeHandler(page, event) {
|
|
505
|
+
this.raiseDataEvent('pagechange', {
|
|
506
|
+
page: page,
|
|
507
|
+
event: event
|
|
508
|
+
}, {
|
|
509
|
+
skip: page.skip,
|
|
510
|
+
take: page.take
|
|
511
|
+
}, event);
|
|
512
|
+
},
|
|
513
|
+
sortChangeHandler: function sortChangeHandler(sort, event) {
|
|
514
|
+
this.raiseDataEvent('sortchange', {
|
|
515
|
+
sort: sort
|
|
516
|
+
}, {
|
|
517
|
+
sort: sort
|
|
518
|
+
}, event);
|
|
519
|
+
},
|
|
520
|
+
filterChangeHandler: function filterChangeHandler(filter, event) {
|
|
521
|
+
this.raiseDataEvent('filterchange', {
|
|
522
|
+
filter: filter
|
|
523
|
+
}, {
|
|
524
|
+
filter: filter,
|
|
525
|
+
skip: 0
|
|
526
|
+
}, event);
|
|
527
|
+
},
|
|
528
|
+
groupChangeHandler: function groupChangeHandler(groups, event) {
|
|
529
|
+
this.raiseDataEvent('groupchange', {
|
|
530
|
+
group: groups
|
|
531
|
+
}, {
|
|
532
|
+
group: groups,
|
|
533
|
+
skip: 0
|
|
534
|
+
}, event);
|
|
535
|
+
},
|
|
536
|
+
raiseDataEvent: function raiseDataEvent(handler, data, moreData, event) {
|
|
537
|
+
if (hasListener.call(this, handler)) {
|
|
538
|
+
this.$emit(handler, __assign(__assign({}, this.getArguments(event)), data));
|
|
539
|
+
} else if (hasListener.call(this, 'datastatechange')) {
|
|
540
|
+
this.$emit('datastatechange', __assign(__assign({}, this.getArguments(event)), {
|
|
541
|
+
data: __assign(__assign({}, this.getDataState()), moreData)
|
|
542
|
+
}));
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
columnReorder: function columnReorder(prev, next, event) {
|
|
546
|
+
var _a;
|
|
547
|
+
|
|
548
|
+
var _this = this;
|
|
549
|
+
|
|
550
|
+
var depth = this._columns[prev].depth;
|
|
551
|
+
|
|
552
|
+
var end = function end(index) {
|
|
553
|
+
do {
|
|
554
|
+
index++;
|
|
555
|
+
} while (index < _this._columns.length && _this._columns[index].depth > depth);
|
|
556
|
+
|
|
557
|
+
return index;
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
var spliced = this._columns.splice(prev, end(prev) - prev);
|
|
561
|
+
|
|
562
|
+
(_a = this._columns).splice.apply(_a, __spreadArray([prev < next ? end(next - spliced.length) : next, 0], spliced, false));
|
|
563
|
+
|
|
564
|
+
this._columns.filter(function (q) {
|
|
565
|
+
return q.declarationIndex >= 0;
|
|
566
|
+
}).forEach(function (c, i) {
|
|
567
|
+
return c.orderIndex = i;
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
var eventColumnProps = this.getColumns();
|
|
571
|
+
this.$emit('columnreorder', {
|
|
572
|
+
target: this,
|
|
573
|
+
columns: eventColumnProps,
|
|
574
|
+
event: event
|
|
575
|
+
});
|
|
576
|
+
},
|
|
577
|
+
groupReorder: function groupReorder(prevIndex, nextIndex, event) {
|
|
578
|
+
if (this.$props.group === undefined) {
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
var group = this.$props.group.slice();
|
|
583
|
+
group.splice.apply(group, __spreadArray([nextIndex, 0], group.splice(prevIndex, 1), false));
|
|
584
|
+
this.groupChangeHandler(group, event);
|
|
585
|
+
},
|
|
586
|
+
columnToGroup: function columnToGroup(columnIndex, groupIndex, event) {
|
|
587
|
+
var field = this._columns[columnIndex].field;
|
|
588
|
+
|
|
589
|
+
if (!field) {
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
var group = (this.$props.group || []).slice();
|
|
594
|
+
group.splice(groupIndex, 0, {
|
|
595
|
+
field: field
|
|
596
|
+
});
|
|
597
|
+
this.groupChangeHandler(group, event);
|
|
598
|
+
},
|
|
599
|
+
resetTableWidth: function resetTableWidth() {
|
|
600
|
+
var totalWidth = 0;
|
|
601
|
+
|
|
602
|
+
if (!this.columnResize.colGroupMain) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
var colElements = this.columnResize.colGroupMain.children;
|
|
607
|
+
|
|
608
|
+
for (var i = 0; i < colElements.length; i++) {
|
|
609
|
+
var width = colElements[i].width;
|
|
610
|
+
|
|
611
|
+
if (!width) {
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
totalWidth += parseFloat(width.toString());
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
totalWidth = Math.round(totalWidth);
|
|
619
|
+
|
|
620
|
+
if (this._header) {
|
|
621
|
+
this._header.setWidth(totalWidth);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
if (this._footer) {
|
|
625
|
+
this._footer.setWidth(totalWidth);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (this.vs.table) {
|
|
629
|
+
this.vs.table.style.width = totalWidth + 'px';
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
onResize: function onResize(index, newWidth, oldWidth, event, end) {
|
|
633
|
+
this.resetTableWidth();
|
|
634
|
+
this.$emit('columnresize', {
|
|
635
|
+
columns: this.getColumns(),
|
|
636
|
+
index: index,
|
|
637
|
+
event: event,
|
|
638
|
+
newWidth: newWidth,
|
|
639
|
+
oldWidth: oldWidth,
|
|
640
|
+
end: end,
|
|
641
|
+
target: this
|
|
642
|
+
});
|
|
643
|
+
},
|
|
644
|
+
initColumns: function initColumns(columnElements, groupCount) {
|
|
645
|
+
var _this = this;
|
|
646
|
+
|
|
647
|
+
var idPrefix = navigationTools.getIdPrefix(this.navigation);
|
|
648
|
+
this._columns = readColumns(columnElements, this.getColumns(), {
|
|
649
|
+
prevId: 0,
|
|
650
|
+
idPrefix: idPrefix
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
if (this._columns.length === 0) {
|
|
654
|
+
var currentColumns = autoGenerateColumns(this.$props.dataItems, this.$props.group, this.$props.expandField, {
|
|
655
|
+
prevId: 0,
|
|
656
|
+
idPrefix: idPrefix
|
|
657
|
+
});
|
|
658
|
+
this._columns = currentColumns;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
if (this.$props.selectedField) {
|
|
662
|
+
var that_1 = this;
|
|
663
|
+
|
|
664
|
+
this._columns.filter(function (c) {
|
|
665
|
+
return c.field === _this.$props.selectedField;
|
|
666
|
+
}).forEach(function (c) {
|
|
667
|
+
c.width = c.width || '50px';
|
|
668
|
+
c.internalCell = that_1.v3 ? markRaw(GridSelectionCell) : GridSelectionCell;
|
|
669
|
+
c.internalHeaderCell = that_1.v3 ? markRaw(GridHeaderSelectionCell) : GridHeaderSelectionCell;
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
var defaultServiceProps = {
|
|
674
|
+
id: '',
|
|
675
|
+
resizable: true,
|
|
676
|
+
width: '32px',
|
|
677
|
+
title: ' ',
|
|
678
|
+
declarationIndex: -1,
|
|
679
|
+
orderIndex: -1,
|
|
680
|
+
children: [],
|
|
681
|
+
parentIndex: -1,
|
|
682
|
+
depth: 0,
|
|
683
|
+
colSpan: 0,
|
|
684
|
+
rowSpan: 0,
|
|
685
|
+
left: 0,
|
|
686
|
+
right: 0,
|
|
687
|
+
// position: 'sticky',
|
|
688
|
+
index: 0,
|
|
689
|
+
rightBorder: false,
|
|
690
|
+
ariaColumnIndex: 0,
|
|
691
|
+
isAccessible: true
|
|
692
|
+
};
|
|
693
|
+
var columnIndexOffset = 0;
|
|
694
|
+
|
|
695
|
+
if (this.$props.expandField && hasListener.call(this, 'expandchange') && this.$props.detail) {
|
|
696
|
+
this._columns.unshift(__assign(__assign({}, defaultServiceProps), {
|
|
697
|
+
internalCell: this.v3 ? markRaw(GridHierarchyCell) : GridHierarchyCell,
|
|
698
|
+
field: this.$props.expandField,
|
|
699
|
+
headerClassName: 'k-hierarchy-cell k-header',
|
|
700
|
+
id: navigationTools.generateNavigatableId("".concat(this._columns.length), idPrefix, 'column')
|
|
701
|
+
}));
|
|
702
|
+
|
|
703
|
+
columnIndexOffset++;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
for (var i = 0; i < groupCount; i++) {
|
|
707
|
+
this._columns.unshift(__assign(__assign({}, defaultServiceProps), {
|
|
708
|
+
isAccessible: false,
|
|
709
|
+
internalCell: this.v3 ? markRaw(GridGroupCell) : GridGroupCell,
|
|
710
|
+
field: 'value'
|
|
711
|
+
}));
|
|
712
|
+
|
|
713
|
+
columnIndexOffset++;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
this._columns.slice(columnIndexOffset).forEach(function (c) {
|
|
717
|
+
return c.parentIndex >= 0 && (c.parentIndex += columnIndexOffset);
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
this._columnsMap = mapColumns(this._columns);
|
|
721
|
+
this.columnResize.columns = this._columns;
|
|
722
|
+
this.dragLogic.columns = this._columns;
|
|
723
|
+
},
|
|
724
|
+
resolveTitle: function resolveTitle(field) {
|
|
725
|
+
var column = this.findColumnByField(field);
|
|
726
|
+
var title = column && (column.title || column.field);
|
|
727
|
+
return title === undefined ? field : title;
|
|
728
|
+
},
|
|
729
|
+
findColumnByField: function findColumnByField(field) {
|
|
730
|
+
var _this = this;
|
|
731
|
+
|
|
732
|
+
var column;
|
|
733
|
+
this.$props.columns.forEach(function (c) {
|
|
734
|
+
var columnFound = _this.searchColumn(c, field);
|
|
735
|
+
|
|
736
|
+
if (columnFound) {
|
|
737
|
+
column = columnFound;
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
return column;
|
|
741
|
+
},
|
|
742
|
+
searchColumn: function searchColumn(column, field) {
|
|
743
|
+
if (column.field === field) {
|
|
744
|
+
return column;
|
|
745
|
+
} else if (column.children) {
|
|
746
|
+
var i = void 0,
|
|
747
|
+
result = null;
|
|
748
|
+
|
|
749
|
+
for (i = 0; result == null && i < column.children.length; i++) {
|
|
750
|
+
result = this.searchColumn(column.children[i], field);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
return result;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
return null;
|
|
757
|
+
},
|
|
758
|
+
getDataState: function getDataState() {
|
|
759
|
+
return {
|
|
760
|
+
filter: this.$props.filter,
|
|
761
|
+
sort: this.$props.sort,
|
|
762
|
+
skip: this.$props.skip,
|
|
763
|
+
take: this.$props.take !== undefined ? this.$props.take : this.$props.pageSize,
|
|
764
|
+
group: this.$props.group
|
|
765
|
+
};
|
|
766
|
+
},
|
|
767
|
+
getArguments: function getArguments(event) {
|
|
768
|
+
return {
|
|
769
|
+
event: event,
|
|
770
|
+
target: this
|
|
771
|
+
};
|
|
772
|
+
},
|
|
773
|
+
getLeafDataItems: function getLeafDataItems() {
|
|
774
|
+
return this.currentData.filter(function (item) {
|
|
775
|
+
return item.rowType === 'data';
|
|
776
|
+
}).map(function (item) {
|
|
777
|
+
return item.dataItem;
|
|
778
|
+
});
|
|
779
|
+
},
|
|
780
|
+
totalGroupedRows: function totalGroupedRows(gridData) {
|
|
781
|
+
var allRowsCount = 0;
|
|
782
|
+
|
|
783
|
+
if (gridData) {
|
|
784
|
+
allRowsCount = this.addSubItems(gridData, allRowsCount);
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
return allRowsCount;
|
|
788
|
+
},
|
|
789
|
+
addSubItems: function addSubItems(gridData, allRowsCount) {
|
|
790
|
+
var _this = this;
|
|
791
|
+
|
|
792
|
+
gridData.forEach(function (item) {
|
|
793
|
+
allRowsCount++;
|
|
794
|
+
|
|
795
|
+
if (item.expanded !== false && item.items) {
|
|
796
|
+
allRowsCount = _this.addSubItems(item.items, allRowsCount);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
if (_this.$props.groupable.footer === 'always' || item.expanded !== false && _this.$props.groupable.footer === 'visible') {
|
|
800
|
+
allRowsCount++;
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
return allRowsCount;
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
// @ts-ignore
|
|
807
|
+
setup: !isV3 ? undefined : function () {
|
|
808
|
+
var v3 = !!isV3;
|
|
809
|
+
var groupPanelDivRef = ref(null);
|
|
810
|
+
var dropElementClueRef = ref(null);
|
|
811
|
+
var dragElementClueRef = ref(null);
|
|
812
|
+
var headerRef = ref(null);
|
|
813
|
+
var footerRef = ref(null);
|
|
814
|
+
var gridNavRef = ref(null);
|
|
815
|
+
var colGroupRef = ref(null);
|
|
816
|
+
var scrollContainerRef = ref(null);
|
|
817
|
+
var scrollTableRef = ref(null);
|
|
818
|
+
var scrollTableBodyRef = ref(null);
|
|
819
|
+
return {
|
|
820
|
+
v3: v3,
|
|
821
|
+
groupPanelDivRef: groupPanelDivRef,
|
|
822
|
+
dropElementClueRef: dropElementClueRef,
|
|
823
|
+
dragElementClueRef: dragElementClueRef,
|
|
824
|
+
headerRef: headerRef,
|
|
825
|
+
footerRef: footerRef,
|
|
826
|
+
gridNavRef: gridNavRef,
|
|
827
|
+
colGroupRef: colGroupRef,
|
|
828
|
+
scrollContainerRef: scrollContainerRef,
|
|
829
|
+
scrollTableRef: scrollTableRef,
|
|
830
|
+
scrollTableBodyRef: scrollTableBodyRef
|
|
831
|
+
};
|
|
832
|
+
},
|
|
833
|
+
// @ts-ignore
|
|
834
|
+
render: function render(createElement) {
|
|
835
|
+
var _this3 = this;
|
|
836
|
+
|
|
837
|
+
var _this = this;
|
|
838
|
+
|
|
839
|
+
var h = gh || createElement;
|
|
840
|
+
var defaultSlot = getDefaultSlots(this);
|
|
841
|
+
var total = this.$props.total || 0;
|
|
842
|
+
var idPrefix = navigationTools.getIdPrefix(this.navigation);
|
|
843
|
+
var gridData = [];
|
|
844
|
+
|
|
845
|
+
if (Array.isArray(this.$props.dataItems)) {
|
|
846
|
+
gridData = this.$props.dataItems;
|
|
847
|
+
} else if (this.$props.dataItems) {
|
|
848
|
+
gridData = applyExpandedState(this.$props.dataItems, this.$props.collapsedGroups.length ? this.computedCollapsed : [], this.$props.uniqueField).data;
|
|
849
|
+
total = total || this.$props.dataItems.total;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
var groupable = this.$props.groupable === true || isObject(this.$props.groupable) && this.$props.groupable.enabled !== false;
|
|
853
|
+
this.columnResize.resizable = this.$props.resizable || false;
|
|
854
|
+
this.dragLogic.reorderable = this.$props.reorderable || false;
|
|
855
|
+
this.dragLogic.groupable = groupable;
|
|
856
|
+
this.resetVirtual();
|
|
857
|
+
this.vs.total = total;
|
|
858
|
+
|
|
859
|
+
if (this.$props.rowHeight !== undefined && this.$props.rowHeight > 0 && !this.currentGroupable) {
|
|
860
|
+
this.vs.containerHeight = Math.min(1533915, this.$props.rowHeight * (total || 0));
|
|
861
|
+
} else {
|
|
862
|
+
if (this.$props.totalGroupedHeight) {
|
|
863
|
+
this.vs.containerHeight = Math.min(1533915, this.$props.totalGroupedHeight);
|
|
864
|
+
} else if (this.$props.allGroupedItems && this.$props.allGroupedItems.data) {
|
|
865
|
+
var allGroupedTotal = this.totalGroupedRows(applyExpandedState(this.$props.allGroupedItems, this.computedCollapsed, this.$props.uniqueField).data);
|
|
866
|
+
this.vs.containerHeight = Math.min(1533915, this.$props.rowHeight * allGroupedTotal);
|
|
867
|
+
} else {
|
|
868
|
+
this.vs.containerHeight = 1533915;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
var children = defaultSlot || [];
|
|
873
|
+
var groupingFooter = isObject(this.$props.groupable) && this.$props.groupable.footer || 'none';
|
|
874
|
+
this.currentData = [];
|
|
875
|
+
var resolvedGroupsCount = flatData(this.currentData, gridData, groupingFooter, {
|
|
876
|
+
index: this.$props.skip || 0
|
|
877
|
+
}, this.$props.group !== undefined, this.$props.expandField);
|
|
878
|
+
var notHiddenColumns = this.$props.columns ? this.$props.columns.filter(function (column) {
|
|
879
|
+
return !column.hidden;
|
|
880
|
+
}) : this.$props.columns;
|
|
881
|
+
this.initColumns(notHiddenColumns, resolvedGroupsCount);
|
|
882
|
+
var toolbar = children.filter(function (child) {
|
|
883
|
+
return child && child.tag && child.tag.toLowerCase().indexOf('toolbar') !== -1 || child.componentOptions && child.componentOptions.tag && child.componentOptions.tag.toLowerCase().indexOf('toolbar') !== -1 || child.type && child.type.name && child.type.name.toLowerCase().indexOf('toolbar') !== -1;
|
|
884
|
+
});
|
|
885
|
+
var noRecords = children.filter(function (child) {
|
|
886
|
+
return child && child.tag && child.tag.toLowerCase().indexOf('records') !== -1 || child.componentOptions && child.componentOptions.tag && child.componentOptions.tag.toLowerCase().indexOf('records') !== -1 || child.type && child.type.name && child.type.name.toLowerCase().indexOf('records') !== -1;
|
|
887
|
+
});
|
|
888
|
+
|
|
889
|
+
var columnsWithColGroup = this._columns.filter(function (c) {
|
|
890
|
+
return c.children.length === 0;
|
|
891
|
+
}); // @ts-ignore
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
var groupingPanel = groupable && h(GroupPanel, {
|
|
895
|
+
ref: this.v3 ? function (el) {
|
|
896
|
+
_this.groupPanelDivRef = el;
|
|
897
|
+
} : 'groupPanelDiv',
|
|
898
|
+
group: this.$props.group || [],
|
|
899
|
+
attrs: this.v3 ? undefined : {
|
|
900
|
+
group: this.$props.group || [],
|
|
901
|
+
resolveTitle: this.resolveTitle
|
|
902
|
+
},
|
|
903
|
+
onGroupChange: this.groupChangeHandler,
|
|
904
|
+
on: this.v3 ? undefined : {
|
|
905
|
+
"groupChange": this.groupChangeHandler,
|
|
906
|
+
"pressHandler": this.dragLogic.pressHandler,
|
|
907
|
+
"dragHandler": this.dragLogic.dragHandler,
|
|
908
|
+
"releaseHandler": this.dragLogic.releaseHandler
|
|
909
|
+
},
|
|
910
|
+
onPressHandler: this.dragLogic.pressHandler,
|
|
911
|
+
onDragHandler: this.dragLogic.dragHandler,
|
|
912
|
+
onReleaseHandler: this.dragLogic.releaseHandler,
|
|
913
|
+
resolveTitle: this.resolveTitle
|
|
914
|
+
});
|
|
915
|
+
var clues = (this.dragLogic.reorderable || this.dragLogic.groupable) && canUseDOM && document && document.body // @ts-ignore
|
|
916
|
+
&& [h(DropClue, {
|
|
917
|
+
ref: this.v3 ? function (el) {
|
|
918
|
+
_this.dropElementClueRef = el;
|
|
919
|
+
} : 'dropElementClue'
|
|
920
|
+
}), // @ts-ignore
|
|
921
|
+
h(DragClue, {
|
|
922
|
+
ref: this.v3 ? function (el) {
|
|
923
|
+
_this.dragElementClueRef = el;
|
|
924
|
+
} : 'dragElementClue'
|
|
925
|
+
})]; // @ts-ignore
|
|
926
|
+
|
|
927
|
+
var header = h(Header, {
|
|
928
|
+
columnResize: this.columnResize,
|
|
929
|
+
attrs: this.v3 ? undefined : {
|
|
930
|
+
columnResize: this.columnResize,
|
|
931
|
+
staticHeaders: this.$props.scrollable !== 'none',
|
|
932
|
+
// @ts-ignore
|
|
933
|
+
headerRow: h(HeaderRow, {
|
|
934
|
+
grid: this,
|
|
935
|
+
attrs: this.v3 ? undefined : {
|
|
936
|
+
grid: this,
|
|
937
|
+
sort: this.$props.sort,
|
|
938
|
+
groupable: this.$props.groupable,
|
|
939
|
+
reorderable: this.$props.reorderable,
|
|
940
|
+
sortable: this.$props.sortable,
|
|
941
|
+
filter: this.$props.filter,
|
|
942
|
+
filterable: this.$props.filterable,
|
|
943
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
944
|
+
columnMenu: this.$props.columnMenu,
|
|
945
|
+
columnMenuAnimate: this.$props.columnMenuAnimate,
|
|
946
|
+
columns: this._columns,
|
|
947
|
+
columnResize: this.columnResize,
|
|
948
|
+
columnsMap: this._columnsMap,
|
|
949
|
+
cellRender: this.$props.headerCellRender,
|
|
950
|
+
isRtl: this.isRtl,
|
|
951
|
+
filterRow: this.$props.filterable // @ts-ignore
|
|
952
|
+
&& h(FilterRow, {
|
|
953
|
+
grid: this,
|
|
954
|
+
attrs: this.v3 ? undefined : {
|
|
955
|
+
grid: this,
|
|
956
|
+
columns: this._columns,
|
|
957
|
+
filter: this.$props.filter,
|
|
958
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
959
|
+
sort: this.$props.sort,
|
|
960
|
+
cellRender: this.$props.filterCellRender,
|
|
961
|
+
isRtl: this.isRtl,
|
|
962
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
963
|
+
},
|
|
964
|
+
columns: this._columns,
|
|
965
|
+
filter: this.$props.filter,
|
|
966
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
967
|
+
onFilterchange: this.filterChangeHandler,
|
|
968
|
+
on: this.v3 ? undefined : {
|
|
969
|
+
"filterchange": this.filterChangeHandler
|
|
970
|
+
},
|
|
971
|
+
sort: this.$props.sort,
|
|
972
|
+
cellRender: this.$props.filterCellRender,
|
|
973
|
+
isRtl: this.isRtl,
|
|
974
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
975
|
+
}) || undefined
|
|
976
|
+
},
|
|
977
|
+
sort: this.$props.sort,
|
|
978
|
+
groupable: this.$props.groupable,
|
|
979
|
+
reorderable: this.$props.reorderable,
|
|
980
|
+
sortable: this.$props.sortable,
|
|
981
|
+
onSortChange: this.sortChangeHandler,
|
|
982
|
+
on: this.v3 ? undefined : {
|
|
983
|
+
"sortChange": this.sortChangeHandler,
|
|
984
|
+
"filterChange": this.filterChangeHandler,
|
|
985
|
+
"selectionchange": this.onHeaderSelectionChangeHandler,
|
|
986
|
+
"pressHandler": this.dragLogic.pressHandler,
|
|
987
|
+
"dragHandler": this.dragLogic.dragHandler,
|
|
988
|
+
"releaseHandler": this.dragLogic.releaseHandler
|
|
989
|
+
},
|
|
990
|
+
filter: this.$props.filter,
|
|
991
|
+
filterable: this.$props.filterable,
|
|
992
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
993
|
+
onFilterChange: this.filterChangeHandler,
|
|
994
|
+
columnMenu: this.$props.columnMenu,
|
|
995
|
+
columnMenuAnimate: this.$props.columnMenuAnimate,
|
|
996
|
+
onSelectionchange: this.onHeaderSelectionChangeHandler,
|
|
997
|
+
columns: this._columns,
|
|
998
|
+
columnResize: this.columnResize,
|
|
999
|
+
onPressHandler: this.dragLogic.pressHandler,
|
|
1000
|
+
onDragHandler: this.dragLogic.dragHandler,
|
|
1001
|
+
onReleaseHandler: this.dragLogic.releaseHandler,
|
|
1002
|
+
columnsMap: this._columnsMap,
|
|
1003
|
+
cellRender: this.$props.headerCellRender,
|
|
1004
|
+
isRtl: this.isRtl,
|
|
1005
|
+
filterRow: this.$props.filterable && h(FilterRow, {
|
|
1006
|
+
grid: this,
|
|
1007
|
+
attrs: this.v3 ? undefined : {
|
|
1008
|
+
grid: this,
|
|
1009
|
+
columns: this._columns,
|
|
1010
|
+
filter: this.$props.filter,
|
|
1011
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
1012
|
+
sort: this.$props.sort,
|
|
1013
|
+
cellRender: this.$props.filterCellRender,
|
|
1014
|
+
isRtl: this.isRtl,
|
|
1015
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
1016
|
+
},
|
|
1017
|
+
columns: this._columns,
|
|
1018
|
+
filter: this.$props.filter,
|
|
1019
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
1020
|
+
onFilterchange: this.filterChangeHandler,
|
|
1021
|
+
on: this.v3 ? undefined : {
|
|
1022
|
+
"filterchange": this.filterChangeHandler
|
|
1023
|
+
},
|
|
1024
|
+
sort: this.$props.sort,
|
|
1025
|
+
cellRender: this.$props.filterCellRender,
|
|
1026
|
+
isRtl: this.isRtl,
|
|
1027
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
1028
|
+
}) || undefined
|
|
1029
|
+
}),
|
|
1030
|
+
cols: columnsWithColGroup.map(function (column, index) {
|
|
1031
|
+
return h("col", {
|
|
1032
|
+
key: index.toString(),
|
|
1033
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined,
|
|
1034
|
+
attrs: this.v3 ? undefined : {
|
|
1035
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined
|
|
1036
|
+
}
|
|
1037
|
+
});
|
|
1038
|
+
}, this)
|
|
1039
|
+
},
|
|
1040
|
+
staticHeaders: this.$props.scrollable !== 'none',
|
|
1041
|
+
ref: this.v3 ? function (el) {
|
|
1042
|
+
_this.headerRef = el;
|
|
1043
|
+
} : 'header',
|
|
1044
|
+
headerRow: h(HeaderRow, {
|
|
1045
|
+
grid: this,
|
|
1046
|
+
attrs: this.v3 ? undefined : {
|
|
1047
|
+
grid: this,
|
|
1048
|
+
sort: this.$props.sort,
|
|
1049
|
+
groupable: this.$props.groupable,
|
|
1050
|
+
reorderable: this.$props.reorderable,
|
|
1051
|
+
sortable: this.$props.sortable,
|
|
1052
|
+
filter: this.$props.filter,
|
|
1053
|
+
filterable: this.$props.filterable,
|
|
1054
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
1055
|
+
columnMenu: this.$props.columnMenu,
|
|
1056
|
+
columnMenuAnimate: this.$props.columnMenuAnimate,
|
|
1057
|
+
columns: this._columns,
|
|
1058
|
+
columnResize: this.columnResize,
|
|
1059
|
+
columnsMap: this._columnsMap,
|
|
1060
|
+
cellRender: this.$props.headerCellRender,
|
|
1061
|
+
isRtl: this.isRtl,
|
|
1062
|
+
filterRow: this.$props.filterable && h(FilterRow, {
|
|
1063
|
+
grid: this,
|
|
1064
|
+
attrs: this.v3 ? undefined : {
|
|
1065
|
+
grid: this,
|
|
1066
|
+
columns: this._columns,
|
|
1067
|
+
filter: this.$props.filter,
|
|
1068
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
1069
|
+
sort: this.$props.sort,
|
|
1070
|
+
cellRender: this.$props.filterCellRender,
|
|
1071
|
+
isRtl: this.isRtl,
|
|
1072
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
1073
|
+
},
|
|
1074
|
+
columns: this._columns,
|
|
1075
|
+
filter: this.$props.filter,
|
|
1076
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
1077
|
+
onFilterchange: this.filterChangeHandler,
|
|
1078
|
+
on: this.v3 ? undefined : {
|
|
1079
|
+
"filterchange": this.filterChangeHandler
|
|
1080
|
+
},
|
|
1081
|
+
sort: this.$props.sort,
|
|
1082
|
+
cellRender: this.$props.filterCellRender,
|
|
1083
|
+
isRtl: this.isRtl,
|
|
1084
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
1085
|
+
}) || undefined
|
|
1086
|
+
},
|
|
1087
|
+
sort: this.$props.sort,
|
|
1088
|
+
groupable: this.$props.groupable,
|
|
1089
|
+
reorderable: this.$props.reorderable,
|
|
1090
|
+
sortable: this.$props.sortable,
|
|
1091
|
+
onSortChange: this.sortChangeHandler,
|
|
1092
|
+
on: this.v3 ? undefined : {
|
|
1093
|
+
"sortChange": this.sortChangeHandler,
|
|
1094
|
+
"filterChange": this.filterChangeHandler,
|
|
1095
|
+
"selectionchange": this.onHeaderSelectionChangeHandler,
|
|
1096
|
+
"pressHandler": this.dragLogic.pressHandler,
|
|
1097
|
+
"dragHandler": this.dragLogic.dragHandler,
|
|
1098
|
+
"releaseHandler": this.dragLogic.releaseHandler
|
|
1099
|
+
},
|
|
1100
|
+
filter: this.$props.filter,
|
|
1101
|
+
filterable: this.$props.filterable,
|
|
1102
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
1103
|
+
onFilterChange: this.filterChangeHandler,
|
|
1104
|
+
columnMenu: this.$props.columnMenu,
|
|
1105
|
+
columnMenuAnimate: this.$props.columnMenuAnimate,
|
|
1106
|
+
onSelectionchange: this.onHeaderSelectionChangeHandler,
|
|
1107
|
+
columns: this._columns,
|
|
1108
|
+
columnResize: this.columnResize,
|
|
1109
|
+
onPressHandler: this.dragLogic.pressHandler,
|
|
1110
|
+
onDragHandler: this.dragLogic.dragHandler,
|
|
1111
|
+
onReleaseHandler: this.dragLogic.releaseHandler,
|
|
1112
|
+
columnsMap: this._columnsMap,
|
|
1113
|
+
cellRender: this.$props.headerCellRender,
|
|
1114
|
+
isRtl: this.isRtl,
|
|
1115
|
+
filterRow: this.$props.filterable && h(FilterRow, {
|
|
1116
|
+
grid: this,
|
|
1117
|
+
attrs: this.v3 ? undefined : {
|
|
1118
|
+
grid: this,
|
|
1119
|
+
columns: this._columns,
|
|
1120
|
+
filter: this.$props.filter,
|
|
1121
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
1122
|
+
sort: this.$props.sort,
|
|
1123
|
+
cellRender: this.$props.filterCellRender,
|
|
1124
|
+
isRtl: this.isRtl,
|
|
1125
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
1126
|
+
},
|
|
1127
|
+
columns: this._columns,
|
|
1128
|
+
filter: this.$props.filter,
|
|
1129
|
+
filterOperators: this.$props.filterOperators || operators,
|
|
1130
|
+
onFilterchange: this.filterChangeHandler,
|
|
1131
|
+
on: this.v3 ? undefined : {
|
|
1132
|
+
"filterchange": this.filterChangeHandler
|
|
1133
|
+
},
|
|
1134
|
+
sort: this.$props.sort,
|
|
1135
|
+
cellRender: this.$props.filterCellRender,
|
|
1136
|
+
isRtl: this.isRtl,
|
|
1137
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
1138
|
+
}) || undefined
|
|
1139
|
+
}),
|
|
1140
|
+
cols: columnsWithColGroup.map(function (column, index) {
|
|
1141
|
+
return h("col", {
|
|
1142
|
+
key: index.toString(),
|
|
1143
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined,
|
|
1144
|
+
attrs: this.v3 ? undefined : {
|
|
1145
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined
|
|
1146
|
+
}
|
|
1147
|
+
});
|
|
1148
|
+
}, this)
|
|
1149
|
+
});
|
|
1150
|
+
var footer = this._columns.some(function (c) {
|
|
1151
|
+
return Boolean(c.footerCell);
|
|
1152
|
+
}) ? // @ts-ignore
|
|
1153
|
+
h(Footer, {
|
|
1154
|
+
columnResize: this.columnResize,
|
|
1155
|
+
attrs: this.v3 ? undefined : {
|
|
1156
|
+
columnResize: this.columnResize,
|
|
1157
|
+
staticHeaders: this.$props.scrollable !== 'none',
|
|
1158
|
+
row: // @ts-ignore
|
|
1159
|
+
h(FooterRow, {
|
|
1160
|
+
isRtl: this.isRtl,
|
|
1161
|
+
attrs: this.v3 ? undefined : {
|
|
1162
|
+
isRtl: this.isRtl,
|
|
1163
|
+
columns: this._columns.map(function (col) {
|
|
1164
|
+
return __assign(__assign({}, col), {
|
|
1165
|
+
footerCell: templateRendering.call(this, col.footerCell, getListeners.call(this))
|
|
1166
|
+
});
|
|
1167
|
+
}, this)
|
|
1168
|
+
},
|
|
1169
|
+
columns: this._columns.map(function (col) {
|
|
1170
|
+
return __assign(__assign({}, col), {
|
|
1171
|
+
footerCell: templateRendering.call(this, col.footerCell, getListeners.call(this))
|
|
1172
|
+
});
|
|
1173
|
+
}, this)
|
|
1174
|
+
}),
|
|
1175
|
+
cols: columnsWithColGroup.map(function (column, index) {
|
|
1176
|
+
return h("col", {
|
|
1177
|
+
key: index.toString(),
|
|
1178
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined,
|
|
1179
|
+
attrs: this.v3 ? undefined : {
|
|
1180
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined
|
|
1181
|
+
}
|
|
1182
|
+
});
|
|
1183
|
+
}, this)
|
|
1184
|
+
},
|
|
1185
|
+
staticHeaders: this.$props.scrollable !== 'none',
|
|
1186
|
+
ref: this.v3 ? function (el) {
|
|
1187
|
+
_this.footerRef = el;
|
|
1188
|
+
} : 'footer',
|
|
1189
|
+
row: h(FooterRow, {
|
|
1190
|
+
isRtl: this.isRtl,
|
|
1191
|
+
attrs: this.v3 ? undefined : {
|
|
1192
|
+
isRtl: this.isRtl,
|
|
1193
|
+
columns: this._columns.map(function (col) {
|
|
1194
|
+
return __assign(__assign({}, col), {
|
|
1195
|
+
footerCell: templateRendering.call(this, col.footerCell, getListeners.call(this))
|
|
1196
|
+
});
|
|
1197
|
+
}, this)
|
|
1198
|
+
},
|
|
1199
|
+
columns: this._columns.map(function (col) {
|
|
1200
|
+
return __assign(__assign({}, col), {
|
|
1201
|
+
footerCell: templateRendering.call(this, col.footerCell, getListeners.call(this))
|
|
1202
|
+
});
|
|
1203
|
+
}, this)
|
|
1204
|
+
}),
|
|
1205
|
+
cols: columnsWithColGroup.map(function (column, index) {
|
|
1206
|
+
return h("col", {
|
|
1207
|
+
key: index.toString(),
|
|
1208
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined,
|
|
1209
|
+
attrs: this.v3 ? undefined : {
|
|
1210
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1213
|
+
}, this)
|
|
1214
|
+
}) : h("span");
|
|
1215
|
+
var cellRenderFunction = templateRendering.call(this, this.$props.cellRender, getListeners.call(this));
|
|
1216
|
+
var leftWidth = 0;
|
|
1217
|
+
var vnodeDataStyle = this.v3 ? this.$attrs.style : this.$vnode && this.$vnode.data ? this.$vnode.data.style : null;
|
|
1218
|
+
var widthProp = 'width';
|
|
1219
|
+
var elementInlineStyleWidth = vnodeDataStyle && isObject(vnodeDataStyle) ? vnodeDataStyle[widthProp] || '' : '';
|
|
1220
|
+
var tableWidth = parseFloat(elementInlineStyleWidth.toString());
|
|
1221
|
+
var scrollLeft = this.vs && this.vs.container && this.vs.container.scrollLeft || 0;
|
|
1222
|
+
|
|
1223
|
+
var _a = tableColumnsVirtualization({
|
|
1224
|
+
enabled: this.$props.columnVirtualization,
|
|
1225
|
+
columns: this._columns,
|
|
1226
|
+
tableViewPortWidth: tableWidth,
|
|
1227
|
+
scrollLeft: scrollLeft
|
|
1228
|
+
}),
|
|
1229
|
+
colSpans = _a.colSpans,
|
|
1230
|
+
isColHidden = _a.hiddenColumns;
|
|
1231
|
+
|
|
1232
|
+
var dataRow = function dataRow(item, rowId, rowDataIndex) {
|
|
1233
|
+
var isInEdit = false;
|
|
1234
|
+
var selectedValue = this.$props.selectedField ? getNestedValue(this.$props.selectedField, item.dataItem) : undefined;
|
|
1235
|
+
return {
|
|
1236
|
+
row: this._columns.map(function (column, index) {
|
|
1237
|
+
var _this = this;
|
|
1238
|
+
|
|
1239
|
+
if (isColHidden[index]) {
|
|
1240
|
+
return null;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
var className = "".concat(column.className ? column.className + ' ' : '') + "".concat(column.locked ? 'k-grid-content-sticky' : '');
|
|
1244
|
+
var style = column.left !== undefined ? !this.isRtl ? {
|
|
1245
|
+
left: column.left + 'px',
|
|
1246
|
+
right: column.right + 'px'
|
|
1247
|
+
} : {
|
|
1248
|
+
left: column.right + 'px',
|
|
1249
|
+
right: column.left + 'px'
|
|
1250
|
+
} : {};
|
|
1251
|
+
var currentColumnIsInEdit = false;
|
|
1252
|
+
|
|
1253
|
+
if (column.editable && this.$props.editField) {
|
|
1254
|
+
var inEdit = getNestedValue(this.$props.editField, item.dataItem);
|
|
1255
|
+
|
|
1256
|
+
if (inEdit === true || inEdit === column.field) {
|
|
1257
|
+
isInEdit = true;
|
|
1258
|
+
currentColumnIsInEdit = true;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
var columnCellRenderFunction;
|
|
1263
|
+
|
|
1264
|
+
if (column.cell) {
|
|
1265
|
+
columnCellRenderFunction = templateRendering.call(this, column.cell, getListeners.call(this));
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
var isCollapsed = this.computedCollapsed && this.computedCollapsed[item.level] && this.computedCollapsed[item.level].some(function (c) {
|
|
1269
|
+
return c === groupedFirstItemValue(item.dataItem, _this.$props.uniqueField);
|
|
1270
|
+
});
|
|
1271
|
+
var isExpanded = isCollapsed ? !isCollapsed : item.expanded;
|
|
1272
|
+
|
|
1273
|
+
if (column.internalCell) {
|
|
1274
|
+
return h(column.internalCell, {
|
|
1275
|
+
key: index,
|
|
1276
|
+
id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
|
|
1277
|
+
attrs: this.v3 ? undefined : {
|
|
1278
|
+
id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
|
|
1279
|
+
colSpan: colSpans[index],
|
|
1280
|
+
dataItem: item.dataItem,
|
|
1281
|
+
field: column.field || '',
|
|
1282
|
+
editor: column.editor,
|
|
1283
|
+
format: column.format,
|
|
1284
|
+
readFormat: column.readFormat,
|
|
1285
|
+
type: column.type,
|
|
1286
|
+
className: className,
|
|
1287
|
+
render: columnCellRenderFunction || cellRenderFunction,
|
|
1288
|
+
columnIndex: index,
|
|
1289
|
+
columnsCount: this._columns.filter(function (c) {
|
|
1290
|
+
return !c.children.length;
|
|
1291
|
+
}).length,
|
|
1292
|
+
rowType: item.rowType,
|
|
1293
|
+
level: item.level,
|
|
1294
|
+
expanded: isExpanded,
|
|
1295
|
+
dataIndex: item.dataIndex,
|
|
1296
|
+
ariaColumnIndex: column.ariaColumnIndex,
|
|
1297
|
+
isSelected: Array.isArray(selectedValue) && selectedValue.indexOf(index) > -1
|
|
1298
|
+
},
|
|
1299
|
+
colSpan: colSpans[index],
|
|
1300
|
+
dataItem: item.dataItem,
|
|
1301
|
+
field: column.field || '',
|
|
1302
|
+
editor: column.editor,
|
|
1303
|
+
format: column.format,
|
|
1304
|
+
readFormat: column.readFormat,
|
|
1305
|
+
type: column.type,
|
|
1306
|
+
className: className,
|
|
1307
|
+
render: columnCellRenderFunction || cellRenderFunction,
|
|
1308
|
+
onChange: this.itemChange,
|
|
1309
|
+
on: this.v3 ? undefined : {
|
|
1310
|
+
"change": this.itemChange,
|
|
1311
|
+
"selectionchange": function selectionchange(e) {
|
|
1312
|
+
return _this.selectionChangeHandler({
|
|
1313
|
+
event: e,
|
|
1314
|
+
dataItem: item.dataItem,
|
|
1315
|
+
dataIndex: rowDataIndex,
|
|
1316
|
+
columnIndex: index
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
onSelectionchange: function selectionchange(e) {
|
|
1321
|
+
return _this.selectionChangeHandler({
|
|
1322
|
+
event: e,
|
|
1323
|
+
dataItem: item.dataItem,
|
|
1324
|
+
dataIndex: rowDataIndex,
|
|
1325
|
+
columnIndex: index
|
|
1326
|
+
});
|
|
1327
|
+
},
|
|
1328
|
+
columnIndex: index,
|
|
1329
|
+
columnsCount: this._columns.filter(function (c) {
|
|
1330
|
+
return !c.children.length;
|
|
1331
|
+
}).length,
|
|
1332
|
+
rowType: item.rowType,
|
|
1333
|
+
level: item.level,
|
|
1334
|
+
expanded: isExpanded,
|
|
1335
|
+
dataIndex: item.dataIndex,
|
|
1336
|
+
style: style,
|
|
1337
|
+
ariaColumnIndex: column.ariaColumnIndex,
|
|
1338
|
+
isSelected: Array.isArray(selectedValue) && selectedValue.indexOf(index) > -1
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
if (currentColumnIsInEdit) {
|
|
1343
|
+
// @ts-ignore
|
|
1344
|
+
return h(GridEditCell, {
|
|
1345
|
+
id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
|
|
1346
|
+
attrs: this.v3 ? undefined : {
|
|
1347
|
+
id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
|
|
1348
|
+
colSpan: colSpans[index],
|
|
1349
|
+
dataItem: item.dataItem,
|
|
1350
|
+
field: column.field || '' // todo
|
|
1351
|
+
,
|
|
1352
|
+
editor: column.editor,
|
|
1353
|
+
format: column.format,
|
|
1354
|
+
readFormat: column.readFormat,
|
|
1355
|
+
type: column.type,
|
|
1356
|
+
className: className,
|
|
1357
|
+
render: columnCellRenderFunction || cellRenderFunction,
|
|
1358
|
+
columnIndex: index,
|
|
1359
|
+
columnsCount: this._columns.filter(function (c) {
|
|
1360
|
+
return !c.children.length;
|
|
1361
|
+
}).length,
|
|
1362
|
+
rowType: item.rowType,
|
|
1363
|
+
level: item.level,
|
|
1364
|
+
expanded: isExpanded,
|
|
1365
|
+
dataIndex: item.dataIndex
|
|
1366
|
+
},
|
|
1367
|
+
key: index,
|
|
1368
|
+
colSpan: colSpans[index],
|
|
1369
|
+
dataItem: item.dataItem,
|
|
1370
|
+
field: column.field || '',
|
|
1371
|
+
editor: column.editor,
|
|
1372
|
+
format: column.format,
|
|
1373
|
+
readFormat: column.readFormat,
|
|
1374
|
+
type: column.type,
|
|
1375
|
+
className: className,
|
|
1376
|
+
render: columnCellRenderFunction || cellRenderFunction,
|
|
1377
|
+
onEdit: this.editHandler,
|
|
1378
|
+
on: this.v3 ? undefined : {
|
|
1379
|
+
"edit": this.editHandler,
|
|
1380
|
+
"remove": this.removeHandler,
|
|
1381
|
+
"save": this.saveHandler,
|
|
1382
|
+
"cancel": this.cancelHandler,
|
|
1383
|
+
"change": this.itemChange
|
|
1384
|
+
},
|
|
1385
|
+
onRemove: this.removeHandler,
|
|
1386
|
+
onSave: this.saveHandler,
|
|
1387
|
+
onCancel: this.cancelHandler,
|
|
1388
|
+
onChange: this.itemChange,
|
|
1389
|
+
columnIndex: index,
|
|
1390
|
+
columnsCount: this._columns.filter(function (c) {
|
|
1391
|
+
return !c.children.length;
|
|
1392
|
+
}).length,
|
|
1393
|
+
rowType: item.rowType,
|
|
1394
|
+
level: item.level,
|
|
1395
|
+
expanded: isExpanded,
|
|
1396
|
+
dataIndex: item.dataIndex,
|
|
1397
|
+
style: style
|
|
1398
|
+
});
|
|
1399
|
+
} // @ts-ignore
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
var inbuiltSlot = h(GridCell, {
|
|
1403
|
+
key: index,
|
|
1404
|
+
id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
|
|
1405
|
+
attrs: this.v3 ? undefined : {
|
|
1406
|
+
id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
|
|
1407
|
+
colSpan: colSpans[index],
|
|
1408
|
+
dataItem: item.dataItem,
|
|
1409
|
+
field: column.field || '' // todo
|
|
1410
|
+
,
|
|
1411
|
+
editor: column.editor,
|
|
1412
|
+
format: column.format,
|
|
1413
|
+
readFormat: column.readFormat,
|
|
1414
|
+
type: column.type,
|
|
1415
|
+
className: className,
|
|
1416
|
+
render: columnCellRenderFunction || cellRenderFunction,
|
|
1417
|
+
columnIndex: index,
|
|
1418
|
+
columnsCount: this._columns.filter(function (c) {
|
|
1419
|
+
return !c.children.length;
|
|
1420
|
+
}).length,
|
|
1421
|
+
rowType: item.rowType,
|
|
1422
|
+
level: item.level,
|
|
1423
|
+
expanded: isExpanded,
|
|
1424
|
+
dataIndex: item.dataIndex
|
|
1425
|
+
},
|
|
1426
|
+
colSpan: colSpans[index],
|
|
1427
|
+
dataItem: item.dataItem,
|
|
1428
|
+
field: column.field || '',
|
|
1429
|
+
editor: column.editor,
|
|
1430
|
+
format: column.format,
|
|
1431
|
+
readFormat: column.readFormat,
|
|
1432
|
+
type: column.type,
|
|
1433
|
+
className: className,
|
|
1434
|
+
render: columnCellRenderFunction || cellRenderFunction,
|
|
1435
|
+
onCellclick: this.cellClickHandler,
|
|
1436
|
+
on: this.v3 ? undefined : {
|
|
1437
|
+
"cellclick": this.cellClickHandler,
|
|
1438
|
+
"cellkeydown": this.cellKeydownHandler,
|
|
1439
|
+
"edit": this.editHandler,
|
|
1440
|
+
"remove": this.removeHandler,
|
|
1441
|
+
"save": this.saveHandler,
|
|
1442
|
+
"cancel": this.cancelHandler,
|
|
1443
|
+
"change": this.itemChange,
|
|
1444
|
+
"selectionchange": function selectionchange(e) {
|
|
1445
|
+
return _this.selectionChangeHandler({
|
|
1446
|
+
event: e,
|
|
1447
|
+
dataItem: item.dataItem,
|
|
1448
|
+
dataIndex: rowDataIndex,
|
|
1449
|
+
columnIndex: index
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
},
|
|
1453
|
+
onCellkeydown: this.cellKeydownHandler,
|
|
1454
|
+
onEdit: this.editHandler,
|
|
1455
|
+
onRemove: this.removeHandler,
|
|
1456
|
+
onSave: this.saveHandler,
|
|
1457
|
+
onCancel: this.cancelHandler,
|
|
1458
|
+
onChange: this.itemChange,
|
|
1459
|
+
onSelectionchange: function selectionchange(e) {
|
|
1460
|
+
return _this.selectionChangeHandler({
|
|
1461
|
+
event: e,
|
|
1462
|
+
dataItem: item.dataItem,
|
|
1463
|
+
dataIndex: rowDataIndex,
|
|
1464
|
+
columnIndex: index
|
|
1465
|
+
});
|
|
1466
|
+
},
|
|
1467
|
+
columnIndex: index,
|
|
1468
|
+
columnsCount: this._columns.filter(function (c) {
|
|
1469
|
+
return !c.children.length;
|
|
1470
|
+
}).length,
|
|
1471
|
+
rowType: item.rowType,
|
|
1472
|
+
level: item.level,
|
|
1473
|
+
expanded: isExpanded,
|
|
1474
|
+
dataIndex: item.dataIndex,
|
|
1475
|
+
style: style
|
|
1476
|
+
});
|
|
1477
|
+
return inbuiltSlot;
|
|
1478
|
+
}, this),
|
|
1479
|
+
isInEdit: isInEdit,
|
|
1480
|
+
isSelected: typeof selectedValue === 'boolean' && selectedValue
|
|
1481
|
+
};
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1484
|
+
var hiddenRows = 0;
|
|
1485
|
+
|
|
1486
|
+
if (this.$props.scrollable === 'virtual' && this.totalGroupedRows(this.currentData) / 2 > this.$props.take) {
|
|
1487
|
+
var topIndex = this.vs.topCacheCount + this.vs.attendedSkip - (this.$props.skip || 0);
|
|
1488
|
+
|
|
1489
|
+
for (var i = 0; i < topIndex; i++) {
|
|
1490
|
+
var item = this.currentData.shift();
|
|
1491
|
+
|
|
1492
|
+
if (item) {
|
|
1493
|
+
this.currentData.push(item);
|
|
1494
|
+
hiddenRows++;
|
|
1495
|
+
|
|
1496
|
+
if (item.rowType === 'groupHeader') {
|
|
1497
|
+
i--;
|
|
1498
|
+
}
|
|
1499
|
+
} else {
|
|
1500
|
+
break;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
var hidden = function hidden(index) {
|
|
1506
|
+
return index >= _this.currentData.length - hiddenRows;
|
|
1507
|
+
};
|
|
1508
|
+
|
|
1509
|
+
var detailRenderFunction = templateRendering.call(this, this.$props.detail, getListeners.call(this));
|
|
1510
|
+
var absoluteDataIndex = this.vs.propsSkip || 0;
|
|
1511
|
+
var rowIndexStart = this._columnsMap.length + (this.$props.filterable ? 1 : 0) + 1;
|
|
1512
|
+
var currentAriaRowIndex;
|
|
1513
|
+
var dataIndex = -1;
|
|
1514
|
+
var detailRowCount = 0; // @ts-ignore
|
|
1515
|
+
|
|
1516
|
+
var body = this.currentData.length && this.currentData.map(function (item, rowIndex) {
|
|
1517
|
+
var _this2 = this;
|
|
1518
|
+
|
|
1519
|
+
var _this = this;
|
|
1520
|
+
|
|
1521
|
+
if (item.rowType === 'data') {
|
|
1522
|
+
absoluteDataIndex++;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
if (this.$props.alternatePerGroup && item.rowType === 'groupHeader') {
|
|
1526
|
+
absoluteDataIndex = 0;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
var isAlt = absoluteDataIndex % 2 === 0;
|
|
1530
|
+
var dataItemKey = this.$props.dataItemKey && getter(this.$props.dataItemKey)(item.dataItem);
|
|
1531
|
+
var absoluteIndex = rowIndex + (this.vs.propsSkip || 0);
|
|
1532
|
+
var rowId = dataItemKey ? dataItemKey : 'ai' + absoluteIndex;
|
|
1533
|
+
var detailRowId = rowId + '_1';
|
|
1534
|
+
currentAriaRowIndex = absoluteIndex + rowIndexStart + detailRowCount;
|
|
1535
|
+
leftWidth = 0;
|
|
1536
|
+
var rowRenderFunction = templateRendering.call(this, this.$props.rowRender, getListeners.call(this));
|
|
1537
|
+
var detailColspan;
|
|
1538
|
+
|
|
1539
|
+
if (this.$props.detail && item.rowType === 'data' && item.expanded) {
|
|
1540
|
+
detailColspan = columnsWithColGroup.length - (this.$props.expandField ? 1 : 0) - (this.$props.group ? this.$props.group.length : 0) || 1;
|
|
1541
|
+
detailRowCount++;
|
|
1542
|
+
currentAriaRowIndex = absoluteIndex + rowIndexStart + detailRowCount;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
return [// @ts-ignore function children
|
|
1546
|
+
h(GridRow, {
|
|
1547
|
+
key: rowId,
|
|
1548
|
+
dataItem: item.dataItem,
|
|
1549
|
+
attrs: this.v3 ? undefined : {
|
|
1550
|
+
dataItem: item.dataItem,
|
|
1551
|
+
isAltRow: isAlt,
|
|
1552
|
+
isInEdit: dataRow.isInEdit,
|
|
1553
|
+
rowType: item.rowType,
|
|
1554
|
+
isHidden: hidden(rowIndex),
|
|
1555
|
+
selectedField: this.$props.selectedField,
|
|
1556
|
+
rowHeight: this.$props.rowHeight,
|
|
1557
|
+
render: rowRenderFunction,
|
|
1558
|
+
ariaRowIndex: currentAriaRowIndex,
|
|
1559
|
+
dataIndex: dataIndex,
|
|
1560
|
+
isSelected: dataRow.isSelected
|
|
1561
|
+
},
|
|
1562
|
+
isAltRow: isAlt,
|
|
1563
|
+
isInEdit: dataRow.isInEdit,
|
|
1564
|
+
rowType: item.rowType,
|
|
1565
|
+
isHidden: hidden(rowIndex),
|
|
1566
|
+
onRowclick: function onRowclick(e) {
|
|
1567
|
+
return _this.rowClick(e, item);
|
|
1568
|
+
},
|
|
1569
|
+
on: this.v3 ? undefined : {
|
|
1570
|
+
"rowclick": function onRowclick(e) {
|
|
1571
|
+
return _this.rowClick(e, item);
|
|
1572
|
+
},
|
|
1573
|
+
"rowdblclick": function rowdblclick(e) {
|
|
1574
|
+
return _this.rowDoubleClick(e, item);
|
|
1575
|
+
}
|
|
1576
|
+
},
|
|
1577
|
+
onRowdblclick: function rowdblclick(e) {
|
|
1578
|
+
return _this.rowDoubleClick(e, item);
|
|
1579
|
+
},
|
|
1580
|
+
selectedField: this.$props.selectedField,
|
|
1581
|
+
rowHeight: this.$props.rowHeight,
|
|
1582
|
+
render: rowRenderFunction,
|
|
1583
|
+
ariaRowIndex: currentAriaRowIndex,
|
|
1584
|
+
dataIndex: dataIndex,
|
|
1585
|
+
isSelected: dataRow.isSelected
|
|
1586
|
+
}, this.v3 ? function () {
|
|
1587
|
+
return [dataRow.call(_this2, item, rowId, dataIndex).row];
|
|
1588
|
+
} : [dataRow.call(_this2, item, rowId, dataIndex).row]), this.$props.detail && item.rowType === 'data' && item.expanded && h("tr", {
|
|
1589
|
+
key: detailRowId,
|
|
1590
|
+
"class": isAlt ? 'k-detail-row k-alt' : 'k-detail-row',
|
|
1591
|
+
style: {
|
|
1592
|
+
visibility: hidden(rowIndex) ? 'hidden' : ''
|
|
1593
|
+
},
|
|
1594
|
+
role: "row",
|
|
1595
|
+
attrs: this.v3 ? undefined : {
|
|
1596
|
+
role: "row",
|
|
1597
|
+
"aria-rowindex": currentAriaRowIndex
|
|
1598
|
+
},
|
|
1599
|
+
"aria-rowindex": currentAriaRowIndex
|
|
1600
|
+
}, [this.$props.group && this.$props.group.map(function (group, idx) {
|
|
1601
|
+
// @ts-ignore
|
|
1602
|
+
return h(GridGroupCell, {
|
|
1603
|
+
id: '',
|
|
1604
|
+
attrs: this.v3 ? undefined : {
|
|
1605
|
+
id: '',
|
|
1606
|
+
dataIndex: item.dataIndex,
|
|
1607
|
+
field: group.field,
|
|
1608
|
+
dataItem: item.dataItem
|
|
1609
|
+
},
|
|
1610
|
+
dataIndex: item.dataIndex,
|
|
1611
|
+
field: group.field,
|
|
1612
|
+
dataItem: item.dataItem,
|
|
1613
|
+
key: idx
|
|
1614
|
+
});
|
|
1615
|
+
}, this), this.$props.expandField && // @ts-ignore function children
|
|
1616
|
+
h(GridDetailHierarchyCell, {
|
|
1617
|
+
id: navigationTools.generateNavigatableId("".concat(detailRowId, "-dhcell"), idPrefix),
|
|
1618
|
+
attrs: this.v3 ? undefined : {
|
|
1619
|
+
id: navigationTools.generateNavigatableId("".concat(detailRowId, "-dhcell"), idPrefix)
|
|
1620
|
+
}
|
|
1621
|
+
}), // @ts-ignore function children
|
|
1622
|
+
h(GridDetailCell, {
|
|
1623
|
+
dataItem: item.dataItem,
|
|
1624
|
+
attrs: this.v3 ? undefined : {
|
|
1625
|
+
dataItem: item.dataItem,
|
|
1626
|
+
dataIndex: item.dataIndex,
|
|
1627
|
+
colSpan: detailColspan,
|
|
1628
|
+
ariaColIndex: 2 + (this.$props.group ? this.$props.group.length : 0),
|
|
1629
|
+
detail: this.$props.detail ? detailRenderFunction : undefined,
|
|
1630
|
+
id: navigationTools.generateNavigatableId("".concat(detailRowId, "-dcell"), idPrefix)
|
|
1631
|
+
},
|
|
1632
|
+
dataIndex: item.dataIndex,
|
|
1633
|
+
colSpan: detailColspan,
|
|
1634
|
+
ariaColIndex: 2 + (this.$props.group ? this.$props.group.length : 0),
|
|
1635
|
+
detail: this.$props.detail ? detailRenderFunction : undefined,
|
|
1636
|
+
id: navigationTools.generateNavigatableId("".concat(detailRowId, "-dcell"), idPrefix)
|
|
1637
|
+
})])];
|
|
1638
|
+
}, this) || h("tr", {
|
|
1639
|
+
"class": "k-grid-norecords"
|
|
1640
|
+
}, [h("td", {
|
|
1641
|
+
colspan: this._columns.filter(function (c) {
|
|
1642
|
+
return !c.children.length;
|
|
1643
|
+
}).length,
|
|
1644
|
+
attrs: this.v3 ? undefined : {
|
|
1645
|
+
colspan: this._columns.filter(function (c) {
|
|
1646
|
+
return !c.children.length;
|
|
1647
|
+
}).length
|
|
1648
|
+
}
|
|
1649
|
+
}, [// @ts-ignore
|
|
1650
|
+
noRecords.length ? noRecords : h(GridNoRecords)])]);
|
|
1651
|
+
var pagerTemplate = templateRendering.call(this, this.$props.pager, getListeners.call(this)); // @ts-ignore
|
|
1652
|
+
|
|
1653
|
+
var defaultPagerRendering = this.$props.pageable && h(Pager, {
|
|
1654
|
+
"class": 'k-grid-pager',
|
|
1655
|
+
onPagesizechange: this.pageChangeHandler,
|
|
1656
|
+
on: this.v3 ? undefined : {
|
|
1657
|
+
"pagesizechange": this.pageChangeHandler,
|
|
1658
|
+
"pagechange": this.pageChangeHandler
|
|
1659
|
+
},
|
|
1660
|
+
onPagechange: this.pageChangeHandler,
|
|
1661
|
+
total: total,
|
|
1662
|
+
attrs: this.v3 ? undefined : {
|
|
1663
|
+
total: total,
|
|
1664
|
+
skip: this.vs.propsSkip || 0,
|
|
1665
|
+
pageSize: (this.$props.take !== undefined ? this.$props.take : this.$props.pageSize) || 10,
|
|
1666
|
+
messagesMap: pagerMessagesMap,
|
|
1667
|
+
settings: normalize(this.$props.pageable || {})
|
|
1668
|
+
},
|
|
1669
|
+
skip: this.vs.propsSkip || 0,
|
|
1670
|
+
pageSize: (this.$props.take !== undefined ? this.$props.take : this.$props.pageSize) || 10,
|
|
1671
|
+
messagesMap: pagerMessagesMap,
|
|
1672
|
+
settings: normalize(this.$props.pageable || {})
|
|
1673
|
+
});
|
|
1674
|
+
var pager = getTemplate.call(this, {
|
|
1675
|
+
h: h,
|
|
1676
|
+
template: pagerTemplate,
|
|
1677
|
+
defaultRendering: defaultPagerRendering,
|
|
1678
|
+
additionalProps: __assign(__assign({}, this.$props), {
|
|
1679
|
+
skip: this.vs.propsSkip || 0,
|
|
1680
|
+
messagesMap: pagerMessagesMap
|
|
1681
|
+
}),
|
|
1682
|
+
additionalListeners: {
|
|
1683
|
+
pagesizechange: this.pageChangeHandler,
|
|
1684
|
+
pagechange: this.pageChangeHandler
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
|
|
1688
|
+
var sorted = function sorted(field) {
|
|
1689
|
+
return _this.$props.sort && _this.$props.sort.filter(function (descriptor) {
|
|
1690
|
+
return descriptor.field === field;
|
|
1691
|
+
}).length > 0;
|
|
1692
|
+
};
|
|
1693
|
+
|
|
1694
|
+
var colGroups = h("colgroup", {
|
|
1695
|
+
role: "presentation",
|
|
1696
|
+
attrs: this.v3 ? undefined : {
|
|
1697
|
+
role: "presentation"
|
|
1698
|
+
},
|
|
1699
|
+
ref: setRef(this, 'colGroup')
|
|
1700
|
+
}, [columnsWithColGroup.map(function (column, index) {
|
|
1701
|
+
return h("col", {
|
|
1702
|
+
key: index.toString(),
|
|
1703
|
+
"class": sorted(column.field) ? 'k-sorted' : undefined,
|
|
1704
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined,
|
|
1705
|
+
attrs: this.v3 ? undefined : {
|
|
1706
|
+
width: column.width !== undefined ? Math.floor(parseFloat(column.width.toString())) + 'px' : undefined
|
|
1707
|
+
}
|
|
1708
|
+
});
|
|
1709
|
+
}, this)]);
|
|
1710
|
+
var wrapperStyle = {
|
|
1711
|
+
height: this.getCorrectHeight
|
|
1712
|
+
};
|
|
1713
|
+
var loaderTemplate = templateRendering.call(this, this.$props.loader, getListeners.call(this));
|
|
1714
|
+
var defaultLoaderRendering = this.$props.loader && h("div", {
|
|
1715
|
+
"class": "k-loader-container k-loader-container-md k-loader-top"
|
|
1716
|
+
}, [h("div", {
|
|
1717
|
+
"class": "k-loader-container-overlay k-overlay-light"
|
|
1718
|
+
}), h("div", {
|
|
1719
|
+
"class": "k-loader-container-inner"
|
|
1720
|
+
}, [h(Loader, {
|
|
1721
|
+
size: 'large',
|
|
1722
|
+
attrs: this.v3 ? undefined : {
|
|
1723
|
+
size: 'large',
|
|
1724
|
+
type: 'infinite-spinner'
|
|
1725
|
+
},
|
|
1726
|
+
type: 'infinite-spinner'
|
|
1727
|
+
})])]);
|
|
1728
|
+
var loader = getTemplate.call(this, {
|
|
1729
|
+
h: h,
|
|
1730
|
+
template: loaderTemplate,
|
|
1731
|
+
defaultRendering: defaultLoaderRendering
|
|
1732
|
+
});
|
|
1733
|
+
|
|
1734
|
+
if (this.$props.scrollable === 'none') {
|
|
1735
|
+
return (// @ts-ignore function children
|
|
1736
|
+
h(TableKeyboardNavigationProvider, {
|
|
1737
|
+
ref: 'navRef',
|
|
1738
|
+
id: this._gridId,
|
|
1739
|
+
attrs: this.v3 ? undefined : {
|
|
1740
|
+
id: this._gridId,
|
|
1741
|
+
navigatable: this.$props.navigatable
|
|
1742
|
+
},
|
|
1743
|
+
navigatable: this.$props.navigatable
|
|
1744
|
+
}, this.v3 ? function () {
|
|
1745
|
+
return [// @ts-ignore function children
|
|
1746
|
+
h(GridNav, {
|
|
1747
|
+
ref: _this3.v3 ? function (el) {
|
|
1748
|
+
_this.gridNavRef = el;
|
|
1749
|
+
} : 'gridNav',
|
|
1750
|
+
currentData: _this3.currentData,
|
|
1751
|
+
attrs: _this3.v3 ? undefined : {
|
|
1752
|
+
currentData: _this3.currentData,
|
|
1753
|
+
role: "grid"
|
|
1754
|
+
},
|
|
1755
|
+
style: wrapperStyle,
|
|
1756
|
+
role: "grid",
|
|
1757
|
+
"class": "k-widget k-grid"
|
|
1758
|
+
}, _this3.v3 ? function () {
|
|
1759
|
+
return [toolbar, groupingPanel, h("table", {
|
|
1760
|
+
style: {
|
|
1761
|
+
tableLayout: 'fixed'
|
|
1762
|
+
}
|
|
1763
|
+
}, [colGroups, header, h("tbody", {
|
|
1764
|
+
"data-keyboardnavbody": true,
|
|
1765
|
+
attrs: _this3.v3 ? undefined : {
|
|
1766
|
+
"data-keyboardnavbody": true
|
|
1767
|
+
}
|
|
1768
|
+
}, [body, loader]), footer]), pager, clues];
|
|
1769
|
+
} : [toolbar, groupingPanel, h("table", {
|
|
1770
|
+
style: {
|
|
1771
|
+
tableLayout: 'fixed'
|
|
1772
|
+
}
|
|
1773
|
+
}, [colGroups, header, h("tbody", {
|
|
1774
|
+
"data-keyboardnavbody": true,
|
|
1775
|
+
attrs: _this3.v3 ? undefined : {
|
|
1776
|
+
"data-keyboardnavbody": true
|
|
1777
|
+
}
|
|
1778
|
+
}, [body, loader]), footer]), pager, clues])];
|
|
1779
|
+
} : [h(GridNav, {
|
|
1780
|
+
ref: _this3.v3 ? function (el) {
|
|
1781
|
+
_this.gridNavRef = el;
|
|
1782
|
+
} : 'gridNav',
|
|
1783
|
+
currentData: _this3.currentData,
|
|
1784
|
+
attrs: _this3.v3 ? undefined : {
|
|
1785
|
+
currentData: _this3.currentData,
|
|
1786
|
+
role: "grid"
|
|
1787
|
+
},
|
|
1788
|
+
style: wrapperStyle,
|
|
1789
|
+
role: "grid",
|
|
1790
|
+
"class": "k-widget k-grid"
|
|
1791
|
+
}, _this3.v3 ? function () {
|
|
1792
|
+
return [toolbar, groupingPanel, h("table", {
|
|
1793
|
+
style: {
|
|
1794
|
+
tableLayout: 'fixed'
|
|
1795
|
+
}
|
|
1796
|
+
}, [colGroups, header, h("tbody", {
|
|
1797
|
+
"data-keyboardnavbody": true,
|
|
1798
|
+
attrs: _this3.v3 ? undefined : {
|
|
1799
|
+
"data-keyboardnavbody": true
|
|
1800
|
+
}
|
|
1801
|
+
}, [body, loader]), footer]), pager, clues];
|
|
1802
|
+
} : [toolbar, groupingPanel, h("table", {
|
|
1803
|
+
style: {
|
|
1804
|
+
tableLayout: 'fixed'
|
|
1805
|
+
}
|
|
1806
|
+
}, [colGroups, header, h("tbody", {
|
|
1807
|
+
"data-keyboardnavbody": true,
|
|
1808
|
+
attrs: _this3.v3 ? undefined : {
|
|
1809
|
+
"data-keyboardnavbody": true
|
|
1810
|
+
}
|
|
1811
|
+
}, [body, loader]), footer]), pager, clues])])
|
|
1812
|
+
);
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
return (// @ts-ignore function children
|
|
1816
|
+
h(TableKeyboardNavigationProvider, {
|
|
1817
|
+
ref: 'navRef',
|
|
1818
|
+
id: this._gridId,
|
|
1819
|
+
attrs: this.v3 ? undefined : {
|
|
1820
|
+
id: this._gridId,
|
|
1821
|
+
navigatable: this.$props.navigatable
|
|
1822
|
+
},
|
|
1823
|
+
navigatable: this.$props.navigatable
|
|
1824
|
+
}, this.v3 ? function () {
|
|
1825
|
+
return [// @ts-ignore function children
|
|
1826
|
+
h(GridNav, {
|
|
1827
|
+
ref: _this3.v3 ? function (el) {
|
|
1828
|
+
_this.gridNavRef = el;
|
|
1829
|
+
} : 'gridNav',
|
|
1830
|
+
currentData: _this3.currentData,
|
|
1831
|
+
attrs: _this3.v3 ? undefined : {
|
|
1832
|
+
currentData: _this3.currentData,
|
|
1833
|
+
role: "grid"
|
|
1834
|
+
},
|
|
1835
|
+
style: wrapperStyle,
|
|
1836
|
+
role: "grid",
|
|
1837
|
+
"class": 'k-widget k-grid' + (_this3.$props.scrollable === 'virtual' ? ' k-grid-virtual' : '')
|
|
1838
|
+
}, _this3.v3 ? function () {
|
|
1839
|
+
return [toolbar, groupingPanel, header, h("div", {
|
|
1840
|
+
"class": "k-grid-container",
|
|
1841
|
+
role: "presentation",
|
|
1842
|
+
attrs: _this3.v3 ? undefined : {
|
|
1843
|
+
role: "presentation"
|
|
1844
|
+
}
|
|
1845
|
+
}, [h("div", {
|
|
1846
|
+
role: "presentation",
|
|
1847
|
+
attrs: _this3.v3 ? undefined : {
|
|
1848
|
+
role: "presentation"
|
|
1849
|
+
},
|
|
1850
|
+
ref: setRef(_this3, 'scrollContainer'),
|
|
1851
|
+
"class": "k-grid-content k-virtual-content",
|
|
1852
|
+
onScroll: _this3.scrollHandler,
|
|
1853
|
+
on: _this3.v3 ? undefined : {
|
|
1854
|
+
"scroll": _this3.scrollHandler
|
|
1855
|
+
}
|
|
1856
|
+
}, [h("div", {
|
|
1857
|
+
style: {
|
|
1858
|
+
'position': 'relative'
|
|
1859
|
+
}
|
|
1860
|
+
}, [h("table", {
|
|
1861
|
+
role: "presentation",
|
|
1862
|
+
attrs: _this3.v3 ? undefined : {
|
|
1863
|
+
role: "presentation",
|
|
1864
|
+
tabindex: -1
|
|
1865
|
+
},
|
|
1866
|
+
tabindex: -1,
|
|
1867
|
+
"class": 'k-grid-table',
|
|
1868
|
+
ref: setRef(_this3, 'scrollTable')
|
|
1869
|
+
}, [colGroups, h("tbody", {
|
|
1870
|
+
role: "presentation",
|
|
1871
|
+
attrs: _this3.v3 ? undefined : {
|
|
1872
|
+
role: "presentation",
|
|
1873
|
+
"data-keyboardnavbody": true
|
|
1874
|
+
},
|
|
1875
|
+
"data-keyboardnavbody": true,
|
|
1876
|
+
ref: setRef(_this3, 'scrollTableBody')
|
|
1877
|
+
}, [body])])]), h("div", {
|
|
1878
|
+
"class": "k-height-container",
|
|
1879
|
+
role: "presentation",
|
|
1880
|
+
attrs: _this3.v3 ? undefined : {
|
|
1881
|
+
role: "presentation"
|
|
1882
|
+
}
|
|
1883
|
+
}, [h("div", {
|
|
1884
|
+
style: _this3.$props.scrollable === 'virtual' ? {
|
|
1885
|
+
'height': _this3.vs.containerHeight + 'px'
|
|
1886
|
+
} : {}
|
|
1887
|
+
})])]), loader]), footer, pager, clues];
|
|
1888
|
+
} : [toolbar, groupingPanel, header, h("div", {
|
|
1889
|
+
"class": "k-grid-container",
|
|
1890
|
+
role: "presentation",
|
|
1891
|
+
attrs: _this3.v3 ? undefined : {
|
|
1892
|
+
role: "presentation"
|
|
1893
|
+
}
|
|
1894
|
+
}, [h("div", {
|
|
1895
|
+
role: "presentation",
|
|
1896
|
+
attrs: _this3.v3 ? undefined : {
|
|
1897
|
+
role: "presentation"
|
|
1898
|
+
},
|
|
1899
|
+
ref: setRef(_this3, 'scrollContainer'),
|
|
1900
|
+
"class": "k-grid-content k-virtual-content",
|
|
1901
|
+
onScroll: _this3.scrollHandler,
|
|
1902
|
+
on: _this3.v3 ? undefined : {
|
|
1903
|
+
"scroll": _this3.scrollHandler
|
|
1904
|
+
}
|
|
1905
|
+
}, [h("div", {
|
|
1906
|
+
style: {
|
|
1907
|
+
'position': 'relative'
|
|
1908
|
+
}
|
|
1909
|
+
}, [h("table", {
|
|
1910
|
+
role: "presentation",
|
|
1911
|
+
attrs: _this3.v3 ? undefined : {
|
|
1912
|
+
role: "presentation",
|
|
1913
|
+
tabindex: -1
|
|
1914
|
+
},
|
|
1915
|
+
tabindex: -1,
|
|
1916
|
+
"class": 'k-grid-table',
|
|
1917
|
+
ref: setRef(_this3, 'scrollTable')
|
|
1918
|
+
}, [colGroups, h("tbody", {
|
|
1919
|
+
role: "presentation",
|
|
1920
|
+
attrs: _this3.v3 ? undefined : {
|
|
1921
|
+
role: "presentation",
|
|
1922
|
+
"data-keyboardnavbody": true
|
|
1923
|
+
},
|
|
1924
|
+
"data-keyboardnavbody": true,
|
|
1925
|
+
ref: setRef(_this3, 'scrollTableBody')
|
|
1926
|
+
}, [body])])]), h("div", {
|
|
1927
|
+
"class": "k-height-container",
|
|
1928
|
+
role: "presentation",
|
|
1929
|
+
attrs: _this3.v3 ? undefined : {
|
|
1930
|
+
role: "presentation"
|
|
1931
|
+
}
|
|
1932
|
+
}, [h("div", {
|
|
1933
|
+
style: _this3.$props.scrollable === 'virtual' ? {
|
|
1934
|
+
'height': _this3.vs.containerHeight + 'px'
|
|
1935
|
+
} : {}
|
|
1936
|
+
})])]), loader]), footer, pager, clues])];
|
|
1937
|
+
} : [h(GridNav, {
|
|
1938
|
+
ref: _this3.v3 ? function (el) {
|
|
1939
|
+
_this.gridNavRef = el;
|
|
1940
|
+
} : 'gridNav',
|
|
1941
|
+
currentData: _this3.currentData,
|
|
1942
|
+
attrs: _this3.v3 ? undefined : {
|
|
1943
|
+
currentData: _this3.currentData,
|
|
1944
|
+
role: "grid"
|
|
1945
|
+
},
|
|
1946
|
+
style: wrapperStyle,
|
|
1947
|
+
role: "grid",
|
|
1948
|
+
"class": 'k-widget k-grid' + (_this3.$props.scrollable === 'virtual' ? ' k-grid-virtual' : '')
|
|
1949
|
+
}, _this3.v3 ? function () {
|
|
1950
|
+
return [toolbar, groupingPanel, header, h("div", {
|
|
1951
|
+
"class": "k-grid-container",
|
|
1952
|
+
role: "presentation",
|
|
1953
|
+
attrs: _this3.v3 ? undefined : {
|
|
1954
|
+
role: "presentation"
|
|
1955
|
+
}
|
|
1956
|
+
}, [h("div", {
|
|
1957
|
+
role: "presentation",
|
|
1958
|
+
attrs: _this3.v3 ? undefined : {
|
|
1959
|
+
role: "presentation"
|
|
1960
|
+
},
|
|
1961
|
+
ref: setRef(_this3, 'scrollContainer'),
|
|
1962
|
+
"class": "k-grid-content k-virtual-content",
|
|
1963
|
+
onScroll: _this3.scrollHandler,
|
|
1964
|
+
on: _this3.v3 ? undefined : {
|
|
1965
|
+
"scroll": _this3.scrollHandler
|
|
1966
|
+
}
|
|
1967
|
+
}, [h("div", {
|
|
1968
|
+
style: {
|
|
1969
|
+
'position': 'relative'
|
|
1970
|
+
}
|
|
1971
|
+
}, [h("table", {
|
|
1972
|
+
role: "presentation",
|
|
1973
|
+
attrs: _this3.v3 ? undefined : {
|
|
1974
|
+
role: "presentation",
|
|
1975
|
+
tabindex: -1
|
|
1976
|
+
},
|
|
1977
|
+
tabindex: -1,
|
|
1978
|
+
"class": 'k-grid-table',
|
|
1979
|
+
ref: setRef(_this3, 'scrollTable')
|
|
1980
|
+
}, [colGroups, h("tbody", {
|
|
1981
|
+
role: "presentation",
|
|
1982
|
+
attrs: _this3.v3 ? undefined : {
|
|
1983
|
+
role: "presentation",
|
|
1984
|
+
"data-keyboardnavbody": true
|
|
1985
|
+
},
|
|
1986
|
+
"data-keyboardnavbody": true,
|
|
1987
|
+
ref: setRef(_this3, 'scrollTableBody')
|
|
1988
|
+
}, [body])])]), h("div", {
|
|
1989
|
+
"class": "k-height-container",
|
|
1990
|
+
role: "presentation",
|
|
1991
|
+
attrs: _this3.v3 ? undefined : {
|
|
1992
|
+
role: "presentation"
|
|
1993
|
+
}
|
|
1994
|
+
}, [h("div", {
|
|
1995
|
+
style: _this3.$props.scrollable === 'virtual' ? {
|
|
1996
|
+
'height': _this3.vs.containerHeight + 'px'
|
|
1997
|
+
} : {}
|
|
1998
|
+
})])]), loader]), footer, pager, clues];
|
|
1999
|
+
} : [toolbar, groupingPanel, header, h("div", {
|
|
2000
|
+
"class": "k-grid-container",
|
|
2001
|
+
role: "presentation",
|
|
2002
|
+
attrs: _this3.v3 ? undefined : {
|
|
2003
|
+
role: "presentation"
|
|
2004
|
+
}
|
|
2005
|
+
}, [h("div", {
|
|
2006
|
+
role: "presentation",
|
|
2007
|
+
attrs: _this3.v3 ? undefined : {
|
|
2008
|
+
role: "presentation"
|
|
2009
|
+
},
|
|
2010
|
+
ref: setRef(_this3, 'scrollContainer'),
|
|
2011
|
+
"class": "k-grid-content k-virtual-content",
|
|
2012
|
+
onScroll: _this3.scrollHandler,
|
|
2013
|
+
on: _this3.v3 ? undefined : {
|
|
2014
|
+
"scroll": _this3.scrollHandler
|
|
2015
|
+
}
|
|
2016
|
+
}, [h("div", {
|
|
2017
|
+
style: {
|
|
2018
|
+
'position': 'relative'
|
|
2019
|
+
}
|
|
2020
|
+
}, [h("table", {
|
|
2021
|
+
role: "presentation",
|
|
2022
|
+
attrs: _this3.v3 ? undefined : {
|
|
2023
|
+
role: "presentation",
|
|
2024
|
+
tabindex: -1
|
|
2025
|
+
},
|
|
2026
|
+
tabindex: -1,
|
|
2027
|
+
"class": 'k-grid-table',
|
|
2028
|
+
ref: setRef(_this3, 'scrollTable')
|
|
2029
|
+
}, [colGroups, h("tbody", {
|
|
2030
|
+
role: "presentation",
|
|
2031
|
+
attrs: _this3.v3 ? undefined : {
|
|
2032
|
+
role: "presentation",
|
|
2033
|
+
"data-keyboardnavbody": true
|
|
2034
|
+
},
|
|
2035
|
+
"data-keyboardnavbody": true,
|
|
2036
|
+
ref: setRef(_this3, 'scrollTableBody')
|
|
2037
|
+
}, [body])])]), h("div", {
|
|
2038
|
+
"class": "k-height-container",
|
|
2039
|
+
role: "presentation",
|
|
2040
|
+
attrs: _this3.v3 ? undefined : {
|
|
2041
|
+
role: "presentation"
|
|
2042
|
+
}
|
|
2043
|
+
}, [h("div", {
|
|
2044
|
+
style: _this3.$props.scrollable === 'virtual' ? {
|
|
2045
|
+
'height': _this3.vs.containerHeight + 'px'
|
|
2046
|
+
} : {}
|
|
2047
|
+
})])]), loader]), footer, pager, clues])])
|
|
2048
|
+
);
|
|
2049
|
+
}
|
|
2050
|
+
};
|
|
2051
|
+
/**
|
|
2052
|
+
* Represents the native Vue Grid component by Kendo UI.
|
|
2053
|
+
*
|
|
2054
|
+
* ```tsx-no-run
|
|
2055
|
+
* <div id="app">
|
|
2056
|
+
* <Grid
|
|
2057
|
+
* :data-items="products"
|
|
2058
|
+
* :columns="columns">
|
|
2059
|
+
* </Grid>
|
|
2060
|
+
* </div>
|
|
2061
|
+
* <script>
|
|
2062
|
+
* Vue.component('Grid', Grid);
|
|
2063
|
+
* new Vue({
|
|
2064
|
+
* el: '#app',
|
|
2065
|
+
* data: function () {
|
|
2066
|
+
* return {
|
|
2067
|
+
* products: [
|
|
2068
|
+
* { 'foo': 'A1', 'bar': 'B1' },
|
|
2069
|
+
* { 'foo': 'A2', 'bar': 'B2' },
|
|
2070
|
+
* { 'foo': 'A3', 'bar': 'B2' }
|
|
2071
|
+
* ],
|
|
2072
|
+
* columns: [
|
|
2073
|
+
* { field: 'foo'},
|
|
2074
|
+
* { field: 'bar'}
|
|
2075
|
+
* ]
|
|
2076
|
+
* };
|
|
2077
|
+
* }
|
|
2078
|
+
* });
|
|
2079
|
+
* </script>
|
|
2080
|
+
* ```
|
|
2081
|
+
*
|
|
2082
|
+
* ### props <span class='code'>[GridProps]({% slug api_grid_gridprops %})</span>
|
|
2083
|
+
*/
|
|
2084
|
+
|
|
2085
|
+
var Grid = GridVue2;
|
|
2086
|
+
export { Grid, GridVue2 };
|