@progress/kendo-vue-grid 3.8.4-dev.202302160938 → 3.8.4-dev.202302221027
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.d.ts +6 -2
- package/dist/es/Grid.js +75 -21
- package/dist/es/VirtualScroll.d.ts +9 -5
- package/dist/es/VirtualScroll.js +12 -3
- package/dist/es/VirtualScrollFixed.d.ts +47 -0
- package/dist/es/VirtualScrollFixed.js +144 -0
- package/dist/es/interfaces/GridProps.d.ts +4 -0
- package/dist/es/interfaces/VirtualScrollInterface.d.ts +26 -0
- package/dist/es/interfaces/VirtualScrollInterface.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/utils/main.d.ts +8 -0
- package/dist/es/utils/main.js +9 -0
- package/dist/esm/Grid.d.ts +6 -2
- package/dist/esm/Grid.js +75 -21
- package/dist/esm/VirtualScroll.d.ts +9 -5
- package/dist/esm/VirtualScroll.js +12 -3
- package/dist/esm/VirtualScrollFixed.d.ts +47 -0
- package/dist/esm/VirtualScrollFixed.js +144 -0
- package/dist/esm/interfaces/GridProps.d.ts +4 -0
- package/dist/esm/interfaces/VirtualScrollInterface.d.ts +26 -0
- package/dist/esm/interfaces/VirtualScrollInterface.js +1 -0
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/utils/main.d.ts +8 -0
- package/dist/esm/utils/main.js +9 -0
- package/dist/npm/Grid.d.ts +6 -2
- package/dist/npm/Grid.js +74 -20
- package/dist/npm/VirtualScroll.d.ts +9 -5
- package/dist/npm/VirtualScroll.js +12 -3
- package/dist/npm/VirtualScrollFixed.d.ts +47 -0
- package/dist/npm/VirtualScrollFixed.js +147 -0
- package/dist/npm/interfaces/GridProps.d.ts +4 -0
- package/dist/npm/interfaces/VirtualScrollInterface.d.ts +26 -0
- package/dist/npm/interfaces/VirtualScrollInterface.js +2 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/utils/main.d.ts +8 -0
- package/dist/npm/utils/main.js +10 -1
- package/package.json +14 -14
package/dist/npm/Grid.js
CHANGED
|
@@ -60,6 +60,7 @@ var FooterRow_1 = require("./footer/FooterRow");
|
|
|
60
60
|
var GridCellValue_1 = require("./GridCellValue");
|
|
61
61
|
var filterCommon_1 = require("./filterCommon");
|
|
62
62
|
var VirtualScroll_1 = require("./VirtualScroll");
|
|
63
|
+
var VirtualScrollFixed_1 = require("./VirtualScrollFixed");
|
|
63
64
|
var ColumnResize_1 = require("./drag/ColumnResize");
|
|
64
65
|
var CommonDragLogic_1 = require("./drag/CommonDragLogic");
|
|
65
66
|
var DragClue_1 = require("./drag/DragClue");
|
|
@@ -132,6 +133,7 @@ var GridVue2 = {
|
|
|
132
133
|
},
|
|
133
134
|
pager: kendo_vue_common_1.templateDefinition,
|
|
134
135
|
rowHeight: Number,
|
|
136
|
+
detailRowHeight: Number,
|
|
135
137
|
detail: kendo_vue_common_1.templateDefinition,
|
|
136
138
|
columnMenu: [Boolean, String, Function, Object],
|
|
137
139
|
columnMenuAnimate: {
|
|
@@ -172,7 +174,8 @@ var GridVue2 = {
|
|
|
172
174
|
this.initialHeight = null;
|
|
173
175
|
this._columns = [];
|
|
174
176
|
var groupable = this.currentGroupable;
|
|
175
|
-
|
|
177
|
+
var VS = this.getVirtualScroll();
|
|
178
|
+
this.vs = new VS(groupable || this.$props.rowHeight === undefined || this.$props.rowHeight === 0, this.$props.topCacheCount);
|
|
176
179
|
this.dragLogic = new CommonDragLogic_1.CommonDragLogic(this.columnReorder.bind(this), this.groupReorder.bind(this), this.columnToGroup.bind(this));
|
|
177
180
|
this.columnResize = new ColumnResize_1.ColumnResize(this.onResize.bind(this));
|
|
178
181
|
this._columnsMap = [[]];
|
|
@@ -181,11 +184,13 @@ var GridVue2 = {
|
|
|
181
184
|
this.forceUpdateTimeout = undefined;
|
|
182
185
|
this._gridId = (0, kendo_vue_common_1.guid)();
|
|
183
186
|
this._gridRoleElementId = (0, kendo_vue_common_1.guid)(); // Needed for aria-control accessibility attribute
|
|
187
|
+
this.slicedCurrentData = undefined;
|
|
188
|
+
this._prevTotal = undefined;
|
|
184
189
|
},
|
|
185
|
-
|
|
186
190
|
mounted: function mounted() {
|
|
187
191
|
this.setRefs();
|
|
188
192
|
var rtl = (0, kendo_vue_common_1.isRtl)(this._element);
|
|
193
|
+
this._prevTotal = this.$props.total;
|
|
189
194
|
this.isRtl = rtl;
|
|
190
195
|
// @ts-ignore
|
|
191
196
|
this.initialHeight = this._element.style ? this._element.style.height : null;
|
|
@@ -194,6 +199,11 @@ var GridVue2 = {
|
|
|
194
199
|
this.setRefs();
|
|
195
200
|
var rtl = (0, kendo_vue_common_1.isRtl)(this._element);
|
|
196
201
|
this.isRtl = rtl;
|
|
202
|
+
this._prevTotal = this.$props.total;
|
|
203
|
+
if (this.vs.tableTransform && this.vs.table) {
|
|
204
|
+
this.vs.table.style.transform = this.vs.tableTransform;
|
|
205
|
+
this.vs.tableTransform = '';
|
|
206
|
+
}
|
|
197
207
|
},
|
|
198
208
|
destroyed: !!isV3 ? undefined : function () {
|
|
199
209
|
this.gridUnmounted();
|
|
@@ -335,10 +345,10 @@ var GridVue2 = {
|
|
|
335
345
|
this.columnResize.colGroupMain = (0, kendo_vue_common_1.getRef)(this, 'colGroup');
|
|
336
346
|
this._header = (0, kendo_vue_common_1.getRef)(this, 'header');
|
|
337
347
|
this._footer = (0, kendo_vue_common_1.getRef)(this, 'footer');
|
|
338
|
-
this.vs.
|
|
348
|
+
this.vs.containerRef = (0, kendo_vue_common_1.getRef)(this, 'scrollContainer');
|
|
339
349
|
this.vs.table = (0, kendo_vue_common_1.getRef)(this, 'scrollTable');
|
|
340
350
|
this.resetTableWidth();
|
|
341
|
-
this.vs.
|
|
351
|
+
this.vs.tableBodyRef = (0, kendo_vue_common_1.getRef)(this, 'scrollTableBody');
|
|
342
352
|
},
|
|
343
353
|
gridUnmounted: function gridUnmounted() {
|
|
344
354
|
clearTimeout(this.forceUpdateTimeout);
|
|
@@ -358,6 +368,62 @@ var GridVue2 = {
|
|
|
358
368
|
this.vs.scrollableVirtual = this.$props.scrollable === 'virtual';
|
|
359
369
|
this.vs.propsSkip = (this.$props.skip || 0) + (this.$props.scrollable === 'virtual' ? this.vs.topCacheCount + (this.vs.attendedSkip - (this.$props.skip || 0)) : 0);
|
|
360
370
|
},
|
|
371
|
+
getVirtualScroll: function getVirtualScroll() {
|
|
372
|
+
return VirtualScroll_1.VirtualScroll;
|
|
373
|
+
},
|
|
374
|
+
isAllData: function isAllData() {
|
|
375
|
+
var _a = this.$props,
|
|
376
|
+
dataItems = _a.dataItems,
|
|
377
|
+
total = _a.total;
|
|
378
|
+
if (Array.isArray(dataItems)) {
|
|
379
|
+
return dataItems.length === total;
|
|
380
|
+
} else if (dataItems) {
|
|
381
|
+
return total === dataItems.total;
|
|
382
|
+
}
|
|
383
|
+
return false;
|
|
384
|
+
},
|
|
385
|
+
initializeVirtualization: function initializeVirtualization(total) {
|
|
386
|
+
if (this.$props.total !== this._prevTotal || this.$props.scrollable === 'virtual' !== this.vs.scrollableVirtual) {
|
|
387
|
+
this.vs.reset();
|
|
388
|
+
}
|
|
389
|
+
this.resetVirtual();
|
|
390
|
+
this.vs.total = total;
|
|
391
|
+
if (this.$props.rowHeight !== undefined && this.$props.rowHeight > 0 && !this.currentGroupable) {
|
|
392
|
+
this.vs.containerHeight = Math.min(1533915, this.$props.rowHeight * (total || 0));
|
|
393
|
+
} else {
|
|
394
|
+
if (this.$props.totalGroupedHeight) {
|
|
395
|
+
this.vs.containerHeight = Math.min(1533915, this.$props.totalGroupedHeight);
|
|
396
|
+
} else if (this.$props.allGroupedItems && this.$props.allGroupedItems.data) {
|
|
397
|
+
var allGroupedTotal = this.totalGroupedRows((0, main_1.applyExpandedState)(this.$props.allGroupedItems, this.computedCollapsed, this.$props.uniqueField).data);
|
|
398
|
+
this.vs.containerHeight = Math.min(1533915, this.$props.rowHeight * allGroupedTotal);
|
|
399
|
+
} else {
|
|
400
|
+
this.vs.containerHeight = 1533915;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
this.vs.containerRef = this.containerRef;
|
|
404
|
+
this.vs.tableBodyRef = this.tableBodyRef;
|
|
405
|
+
this.vs.table = this.tableElement;
|
|
406
|
+
this.slicedCurrentData = undefined;
|
|
407
|
+
if (this.vs instanceof VirtualScrollFixed_1.VirtualScrollFixed) {
|
|
408
|
+
var _a = this.$props,
|
|
409
|
+
_b = _a.rowHeight,
|
|
410
|
+
rowHeight = _b === void 0 ? 0 : _b,
|
|
411
|
+
detail = _a.detail,
|
|
412
|
+
expandField = _a.expandField;
|
|
413
|
+
var _c = this.$props.detailRowHeight,
|
|
414
|
+
detailRowHeight = _c === void 0 ? 0 : _c;
|
|
415
|
+
detailRowHeight = Boolean(detail && expandField) ? detailRowHeight : rowHeight;
|
|
416
|
+
if (this.isAllData()) {
|
|
417
|
+
this.vs.total = this.currentData.length;
|
|
418
|
+
this.slicedCurrentData = this.currentData.slice(this.vs.realSkip, this.vs.realSkip + this.vs.pageSize);
|
|
419
|
+
this.vs.rowHeightService = this.rowHeightService(this.vs, this.currentData.length, rowHeight, detailRowHeight, this.currentData);
|
|
420
|
+
} else {
|
|
421
|
+
this.vs.rowHeightService = new VirtualScrollFixed_1.RowHeightService(total, rowHeight, detailRowHeight);
|
|
422
|
+
}
|
|
423
|
+
var containerHeight = this.vs.rowHeightService.totalHeight();
|
|
424
|
+
this.vs.containerHeight = main_1.firefox ? Math.min(main_1.firefoxMaxHeight, containerHeight) : containerHeight;
|
|
425
|
+
}
|
|
426
|
+
},
|
|
361
427
|
onSkipChanged: function onSkipChanged(value, _oldValue) {
|
|
362
428
|
if (Math.max(0, this.vs.attendedSkip) !== value && value !== undefined) {
|
|
363
429
|
this.vs.attendedSkip = value;
|
|
@@ -843,26 +909,13 @@ var GridVue2 = {
|
|
|
843
909
|
this.columnResize.resizable = this.$props.resizable || false;
|
|
844
910
|
this.dragLogic.reorderable = this.$props.reorderable || false;
|
|
845
911
|
this.dragLogic.groupable = groupable;
|
|
846
|
-
this.
|
|
847
|
-
this.vs.total = total;
|
|
848
|
-
if (this.$props.rowHeight !== undefined && this.$props.rowHeight > 0 && !this.currentGroupable) {
|
|
849
|
-
this.vs.containerHeight = Math.min(1533915, this.$props.rowHeight * (total || 0));
|
|
850
|
-
} else {
|
|
851
|
-
if (this.$props.totalGroupedHeight) {
|
|
852
|
-
this.vs.containerHeight = Math.min(1533915, this.$props.totalGroupedHeight);
|
|
853
|
-
} else if (this.$props.allGroupedItems && this.$props.allGroupedItems.data) {
|
|
854
|
-
var allGroupedTotal = this.totalGroupedRows((0, main_1.applyExpandedState)(this.$props.allGroupedItems, this.computedCollapsed, this.$props.uniqueField).data);
|
|
855
|
-
this.vs.containerHeight = Math.min(1533915, this.$props.rowHeight * allGroupedTotal);
|
|
856
|
-
} else {
|
|
857
|
-
this.vs.containerHeight = 1533915;
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
var children = defaultSlot || [];
|
|
912
|
+
this.initializeVirtualization(total);
|
|
861
913
|
var groupingFooter = (0, kendo_vue_common_1.isObject)(this.$props.groupable) && this.$props.groupable.footer || 'none';
|
|
862
914
|
this.currentData = [];
|
|
863
915
|
var resolvedGroupsCount = (0, main_1.flatData)(this.currentData, gridData, groupingFooter, {
|
|
864
916
|
index: this.$props.skip || 0
|
|
865
917
|
}, this.$props.group !== undefined, this.$props.expandField);
|
|
918
|
+
var children = defaultSlot || [];
|
|
866
919
|
var notHiddenColumns = this.$props.columns ? this.$props.columns.filter(function (column) {
|
|
867
920
|
return !column.hidden;
|
|
868
921
|
}) : this.$props.columns;
|
|
@@ -1704,7 +1757,8 @@ var GridVue2 = {
|
|
|
1704
1757
|
key: detailRowId,
|
|
1705
1758
|
"class": isAlt ? 'k-table-row k-table-alt-row k-detail-row k-alt' : 'k-table-row k-detail-row',
|
|
1706
1759
|
style: {
|
|
1707
|
-
visibility: hidden(rowIndex) ? 'hidden' : ''
|
|
1760
|
+
visibility: hidden(rowIndex) ? 'hidden' : '',
|
|
1761
|
+
height: this.$props.detailRowHeight + 'px'
|
|
1708
1762
|
},
|
|
1709
1763
|
role: "row",
|
|
1710
1764
|
attrs: this.v3 ? undefined : {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Page } from '@progress/kendo-vue-data-tools';
|
|
2
|
+
import { VirtualScrollInterface } from './interfaces/VirtualScrollInterface';
|
|
3
|
+
import { RowHeightService } from './VirtualScrollFixed';
|
|
2
4
|
/**
|
|
3
5
|
* @hidden
|
|
4
6
|
*/
|
|
5
|
-
export declare class VirtualScroll {
|
|
6
|
-
|
|
7
|
-
table: any;
|
|
7
|
+
export declare class VirtualScroll implements VirtualScrollInterface {
|
|
8
|
+
table: HTMLTableElement | null;
|
|
8
9
|
containerHeight: number;
|
|
9
10
|
topCacheCount: number;
|
|
10
11
|
attendedSkip: number;
|
|
@@ -14,10 +15,13 @@ export declare class VirtualScroll {
|
|
|
14
15
|
realSkip: number;
|
|
15
16
|
pageSize: number;
|
|
16
17
|
PageChange: (page: Page, event: any) => void;
|
|
17
|
-
|
|
18
|
-
heightContainer: any;
|
|
18
|
+
tableBodyRef: any;
|
|
19
19
|
fixedScroll: boolean;
|
|
20
20
|
askedSkip: number | undefined;
|
|
21
|
+
containerRef: any;
|
|
22
|
+
tableTransform: string;
|
|
23
|
+
rowHeightService?: RowHeightService;
|
|
24
|
+
get container(): HTMLDivElement | null;
|
|
21
25
|
private prevScrollPos;
|
|
22
26
|
private tableTranslate;
|
|
23
27
|
private scrollSyncing;
|
|
@@ -7,6 +7,7 @@ exports.VirtualScroll = void 0;
|
|
|
7
7
|
var VirtualScroll = /** @class */ (function () {
|
|
8
8
|
function VirtualScroll(cached, topCacheCount) {
|
|
9
9
|
var _this = this;
|
|
10
|
+
this.table = null;
|
|
10
11
|
this.containerHeight = 0;
|
|
11
12
|
this.topCacheCount = 0; // 4;
|
|
12
13
|
this.attendedSkip = 0; // -4;
|
|
@@ -15,9 +16,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
15
16
|
this.scrollableVirtual = false;
|
|
16
17
|
this.realSkip = 0;
|
|
17
18
|
this.pageSize = 0;
|
|
18
|
-
this.heightContainer = null;
|
|
19
19
|
this.fixedScroll = false;
|
|
20
20
|
this.askedSkip = undefined;
|
|
21
|
+
this.tableTransform = '';
|
|
21
22
|
this.prevScrollPos = 0;
|
|
22
23
|
this.tableTranslate = 0;
|
|
23
24
|
this.scrollSyncing = false;
|
|
@@ -26,6 +27,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
26
27
|
return { topItemsCount: 0, topItemsHeight: 0 };
|
|
27
28
|
}
|
|
28
29
|
var screenHeight = _this.container.clientHeight;
|
|
30
|
+
var footerRowsCount = _this.container.querySelectorAll('.k-group-footer').length;
|
|
29
31
|
var itemsOnScreen = Math.ceil(screenHeight / heights[0].line);
|
|
30
32
|
var topItemsCount = Math.ceil((heights.length - itemsOnScreen) / 2);
|
|
31
33
|
var topItemsHeight = 0;
|
|
@@ -35,7 +37,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
35
37
|
return {
|
|
36
38
|
topItemsCount: topItemsCount,
|
|
37
39
|
topItemsHeight: topItemsHeight,
|
|
38
|
-
itemsNeededOnScreen: itemsOnScreen + itemsOnScreen / 2
|
|
40
|
+
itemsNeededOnScreen: itemsOnScreen + itemsOnScreen / 2 + footerRowsCount
|
|
39
41
|
};
|
|
40
42
|
};
|
|
41
43
|
this.horizontalScrollbarHeight = function () {
|
|
@@ -50,13 +52,20 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
50
52
|
}
|
|
51
53
|
this.scrollHandler = this.scrollHandler.bind(this);
|
|
52
54
|
}
|
|
55
|
+
Object.defineProperty(VirtualScroll.prototype, "container", {
|
|
56
|
+
get: function () {
|
|
57
|
+
return this.containerRef;
|
|
58
|
+
},
|
|
59
|
+
enumerable: false,
|
|
60
|
+
configurable: true
|
|
61
|
+
});
|
|
53
62
|
Object.defineProperty(VirtualScroll.prototype, "rowHeights", {
|
|
54
63
|
/**
|
|
55
64
|
* @return - The row heights in an array.
|
|
56
65
|
*/
|
|
57
66
|
get: function () {
|
|
58
67
|
var result = [];
|
|
59
|
-
var allRows = this.
|
|
68
|
+
var allRows = this.tableBodyRef && this.tableBodyRef.children || [];
|
|
60
69
|
var accumulate = 0;
|
|
61
70
|
for (var i = 0; i < allRows.length; i++) {
|
|
62
71
|
if (allRows[i].className.indexOf('k-grouping-row') > -1) {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Page } from '@progress/kendo-vue-data-tools';
|
|
2
|
+
import { VirtualScrollInterface } from './interfaces/VirtualScrollInterface';
|
|
3
|
+
import { DataItemWrapper } from './utils/main';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare class RowHeightService {
|
|
8
|
+
private total;
|
|
9
|
+
private offsets;
|
|
10
|
+
private heights;
|
|
11
|
+
constructor(total: number, rowHeight: number, detailRowHeight: number, data?: DataItemWrapper[]);
|
|
12
|
+
height(rowIndex: number): number;
|
|
13
|
+
index(position: number): number | undefined;
|
|
14
|
+
offset(rowIndex: number): number;
|
|
15
|
+
totalHeight(): number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export declare class VirtualScrollFixed implements VirtualScrollInterface {
|
|
21
|
+
table: HTMLTableElement | null;
|
|
22
|
+
containerHeight: number;
|
|
23
|
+
topCacheCount: number;
|
|
24
|
+
attendedSkip: number;
|
|
25
|
+
propsSkip: number;
|
|
26
|
+
total: number;
|
|
27
|
+
scrollableVirtual: boolean;
|
|
28
|
+
realSkip: number;
|
|
29
|
+
pageSize: number;
|
|
30
|
+
PageChange: ((event: Page, evnet: any) => void) | null;
|
|
31
|
+
tableBodyRef: any;
|
|
32
|
+
fixedScroll: boolean;
|
|
33
|
+
askedSkip: number | undefined;
|
|
34
|
+
containerRef: any;
|
|
35
|
+
tableTransform: string;
|
|
36
|
+
rowHeightService?: RowHeightService;
|
|
37
|
+
private scrollSyncing;
|
|
38
|
+
private lastLoaded;
|
|
39
|
+
private firstLoaded;
|
|
40
|
+
private lastScrollTop;
|
|
41
|
+
get container(): HTMLDivElement | null;
|
|
42
|
+
constructor(_cached: boolean);
|
|
43
|
+
translate(dY: number): void;
|
|
44
|
+
changePage(skip: number, e: any): void;
|
|
45
|
+
reset(): void;
|
|
46
|
+
scrollHandler(e: any): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VirtualScrollFixed = exports.RowHeightService = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
var RowHeightService = /** @class */ (function () {
|
|
8
|
+
function RowHeightService(total, rowHeight, detailRowHeight, data) {
|
|
9
|
+
if (total === void 0) { total = 0; }
|
|
10
|
+
this.total = total;
|
|
11
|
+
this.offsets = [];
|
|
12
|
+
this.heights = [];
|
|
13
|
+
var agg = 0;
|
|
14
|
+
for (var idx = 0; idx < total; idx++) {
|
|
15
|
+
this.offsets.push(agg);
|
|
16
|
+
var currHeight = (data && data[idx].expanded
|
|
17
|
+
&& data[idx].rowType === 'data') ? detailRowHeight : rowHeight;
|
|
18
|
+
agg += currHeight;
|
|
19
|
+
this.heights.push(currHeight);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
RowHeightService.prototype.height = function (rowIndex) {
|
|
23
|
+
return this.heights[rowIndex];
|
|
24
|
+
};
|
|
25
|
+
RowHeightService.prototype.index = function (position) {
|
|
26
|
+
if (position < 0) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
var result = this.offsets.reduce(function (prev, current, idx) {
|
|
30
|
+
if (prev !== undefined) {
|
|
31
|
+
return prev;
|
|
32
|
+
}
|
|
33
|
+
else if (current === position) {
|
|
34
|
+
return idx;
|
|
35
|
+
}
|
|
36
|
+
else if (current > position) {
|
|
37
|
+
return idx - 1;
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}, undefined);
|
|
41
|
+
return result === undefined ? this.total - 1 : result;
|
|
42
|
+
};
|
|
43
|
+
RowHeightService.prototype.offset = function (rowIndex) {
|
|
44
|
+
return this.offsets[rowIndex];
|
|
45
|
+
};
|
|
46
|
+
RowHeightService.prototype.totalHeight = function () {
|
|
47
|
+
var lastOffset = this.offsets[this.offsets.length - 1];
|
|
48
|
+
var lastHeight = this.heights[this.heights.length - 1];
|
|
49
|
+
return lastOffset + lastHeight;
|
|
50
|
+
// return this.heights.reduce((prev, curr) => prev + curr, 0);
|
|
51
|
+
};
|
|
52
|
+
return RowHeightService;
|
|
53
|
+
}());
|
|
54
|
+
exports.RowHeightService = RowHeightService;
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*/
|
|
58
|
+
var VirtualScrollFixed = /** @class */ (function () {
|
|
59
|
+
function VirtualScrollFixed(_cached) {
|
|
60
|
+
this.table = null;
|
|
61
|
+
this.containerHeight = 0;
|
|
62
|
+
this.topCacheCount = 0;
|
|
63
|
+
this.attendedSkip = 0;
|
|
64
|
+
this.propsSkip = 0;
|
|
65
|
+
this.total = 0;
|
|
66
|
+
this.scrollableVirtual = false;
|
|
67
|
+
this.realSkip = 0;
|
|
68
|
+
this.pageSize = 0;
|
|
69
|
+
this.PageChange = null;
|
|
70
|
+
this.fixedScroll = false;
|
|
71
|
+
this.askedSkip = undefined;
|
|
72
|
+
this.tableTransform = '';
|
|
73
|
+
this.scrollSyncing = false;
|
|
74
|
+
this.lastLoaded = 0;
|
|
75
|
+
this.firstLoaded = 0;
|
|
76
|
+
this.lastScrollTop = 0;
|
|
77
|
+
this.firstLoaded = this.pageSize;
|
|
78
|
+
this.lastLoaded = this.realSkip + this.pageSize;
|
|
79
|
+
this.scrollHandler = this.scrollHandler.bind(this);
|
|
80
|
+
}
|
|
81
|
+
Object.defineProperty(VirtualScrollFixed.prototype, "container", {
|
|
82
|
+
get: function () {
|
|
83
|
+
return this.containerRef;
|
|
84
|
+
},
|
|
85
|
+
enumerable: false,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
88
|
+
VirtualScrollFixed.prototype.translate = function (dY) {
|
|
89
|
+
if (this.scrollableVirtual && this.table) {
|
|
90
|
+
this.table.style.transform = 'translateY(' + dY + 'px)';
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
VirtualScrollFixed.prototype.changePage = function (skip, e) {
|
|
94
|
+
if (this.PageChange) {
|
|
95
|
+
this.PageChange({ skip: Math.max(0, skip), take: this.pageSize }, e);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
VirtualScrollFixed.prototype.reset = function () {
|
|
99
|
+
this.scrollSyncing = true;
|
|
100
|
+
if (this.fixedScroll) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (this.container) {
|
|
104
|
+
this.container.scrollTop = 0;
|
|
105
|
+
}
|
|
106
|
+
this.translate(0);
|
|
107
|
+
};
|
|
108
|
+
VirtualScrollFixed.prototype.scrollHandler = function (e) {
|
|
109
|
+
if (!this.scrollableVirtual || !this.container || !this.table ||
|
|
110
|
+
!this.rowHeightService || !this.containerRef) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (this.scrollSyncing) {
|
|
114
|
+
this.scrollSyncing = false;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
var scrollTop = this.container.scrollTop;
|
|
118
|
+
var up = this.lastScrollTop >= scrollTop;
|
|
119
|
+
var down = !up;
|
|
120
|
+
this.lastScrollTop = scrollTop;
|
|
121
|
+
var firstItemIndex = this.rowHeightService.index(scrollTop);
|
|
122
|
+
var firstItemOffset = this.rowHeightService.offset(firstItemIndex);
|
|
123
|
+
var offsetHeight = this.containerRef.offsetHeight;
|
|
124
|
+
var lastItemIndex = this.rowHeightService.index(scrollTop + offsetHeight);
|
|
125
|
+
if (down && lastItemIndex >= this.lastLoaded && this.lastLoaded < this.total) {
|
|
126
|
+
var overflow = (firstItemIndex + this.pageSize) - this.total;
|
|
127
|
+
if (overflow > 0) {
|
|
128
|
+
firstItemIndex = firstItemIndex - overflow;
|
|
129
|
+
firstItemOffset = this.rowHeightService.offset(firstItemIndex);
|
|
130
|
+
}
|
|
131
|
+
this.firstLoaded = firstItemIndex;
|
|
132
|
+
this.translate(firstItemOffset);
|
|
133
|
+
var nextTake = this.firstLoaded + this.pageSize;
|
|
134
|
+
this.lastLoaded = Math.min(nextTake, this.total);
|
|
135
|
+
this.changePage(this.firstLoaded, e);
|
|
136
|
+
}
|
|
137
|
+
else if (up && firstItemIndex < this.firstLoaded) {
|
|
138
|
+
var nonVisibleBuffer = Math.floor(this.pageSize * 0.3);
|
|
139
|
+
this.firstLoaded = Math.max(firstItemIndex - nonVisibleBuffer, 0);
|
|
140
|
+
this.translate(this.rowHeightService.offset(this.firstLoaded));
|
|
141
|
+
this.lastLoaded = Math.min(this.firstLoaded + this.pageSize, this.total);
|
|
142
|
+
this.changePage(this.firstLoaded, e);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
return VirtualScrollFixed;
|
|
146
|
+
}());
|
|
147
|
+
exports.VirtualScrollFixed = VirtualScrollFixed;
|
|
@@ -222,6 +222,10 @@ export interface GridProps {
|
|
|
222
222
|
* ([see example]({% slug scrollmmodes_grid %})).
|
|
223
223
|
*/
|
|
224
224
|
rowHeight?: number;
|
|
225
|
+
/**
|
|
226
|
+
* @hidden
|
|
227
|
+
*/
|
|
228
|
+
detailRowHeight?: number;
|
|
225
229
|
/**
|
|
226
230
|
* Specifies a custom rendering that will be cloned and rendered inside the detail rows
|
|
227
231
|
* of the currently expanded items ([see example]({% slug master_detail_grid %}).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Page } from '@progress/kendo-vue-data-tools';
|
|
2
|
+
import { RowHeightService } from '../VirtualScrollFixed';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export interface VirtualScrollInterface {
|
|
7
|
+
PageChange: ((page: Page, e: any) => void) | null;
|
|
8
|
+
reset: () => void;
|
|
9
|
+
askedSkip: number | undefined;
|
|
10
|
+
total: number;
|
|
11
|
+
table: HTMLTableElement | null;
|
|
12
|
+
tableBodyRef: any;
|
|
13
|
+
fixedScroll: boolean;
|
|
14
|
+
realSkip: number;
|
|
15
|
+
pageSize: number;
|
|
16
|
+
scrollableVirtual: boolean;
|
|
17
|
+
propsSkip: number;
|
|
18
|
+
topCacheCount: number;
|
|
19
|
+
attendedSkip: number;
|
|
20
|
+
containerHeight: number;
|
|
21
|
+
containerRef: any;
|
|
22
|
+
tableTransform: string;
|
|
23
|
+
rowHeightService?: RowHeightService;
|
|
24
|
+
get container(): HTMLDivElement | null;
|
|
25
|
+
scrollHandler(e: any): void;
|
|
26
|
+
}
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-vue-grid',
|
|
9
9
|
productName: 'Kendo UI for Vue',
|
|
10
10
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1677061189,
|
|
12
12
|
version: '',
|
|
13
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
14
14
|
};
|
package/dist/npm/utils/main.d.ts
CHANGED
|
@@ -89,3 +89,11 @@ export declare function applyExpandedState(sdata: DataResult, collapsed: any[],
|
|
|
89
89
|
* @hidden
|
|
90
90
|
*/
|
|
91
91
|
export declare function groupedFirstItemValue(item: any, field: string): any;
|
|
92
|
+
/**
|
|
93
|
+
* @hidden
|
|
94
|
+
*/
|
|
95
|
+
export declare const firefox: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* @hidden
|
|
98
|
+
*/
|
|
99
|
+
export declare const firefoxMaxHeight = 17895697;
|
package/dist/npm/utils/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.groupedFirstItemValue = exports.applyExpandedState = exports.parsers = exports.footerColumns = exports.autoGenerateColumns = exports.readColumns = exports.mapColumns = exports.checkPropCompatibility = exports.getIndex = exports.isRtl = exports.flatData = exports.getNestedValue = void 0;
|
|
3
|
+
exports.firefoxMaxHeight = exports.firefox = exports.groupedFirstItemValue = exports.applyExpandedState = exports.parsers = exports.footerColumns = exports.autoGenerateColumns = exports.readColumns = exports.mapColumns = exports.checkPropCompatibility = exports.getIndex = exports.isRtl = exports.flatData = exports.getNestedValue = void 0;
|
|
4
4
|
var kendo_vue_data_tools_1 = require("@progress/kendo-vue-data-tools");
|
|
5
5
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
6
6
|
var STRING = 'string';
|
|
@@ -405,3 +405,12 @@ function groupedFirstItemValue(item, field) {
|
|
|
405
405
|
return field ? resultItem[field] : item.value;
|
|
406
406
|
}
|
|
407
407
|
exports.groupedFirstItemValue = groupedFirstItemValue;
|
|
408
|
+
/**
|
|
409
|
+
* @hidden
|
|
410
|
+
*/
|
|
411
|
+
exports.firefox = typeof window !== 'undefined' &&
|
|
412
|
+
/Firefox/.test(window.navigator.userAgent);
|
|
413
|
+
/**
|
|
414
|
+
* @hidden
|
|
415
|
+
*/
|
|
416
|
+
exports.firefoxMaxHeight = 17895697;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-grid",
|
|
3
|
-
"version": "3.8.4-dev.
|
|
3
|
+
"version": "3.8.4-dev.202302221027",
|
|
4
4
|
"description": "Kendo UI for Vue Grid package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,25 +42,25 @@
|
|
|
42
42
|
"vue": "^2.6.12 || ^3.0.2"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@progress/kendo-vue-common": "3.8.4-dev.
|
|
45
|
+
"@progress/kendo-vue-common": "3.8.4-dev.202302221027"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@progress/kendo-data-query": "^1.5.4",
|
|
49
49
|
"@progress/kendo-drawing": "^1.9.3",
|
|
50
50
|
"@progress/kendo-licensing": "^1.3.0",
|
|
51
51
|
"@progress/kendo-svg-icons": "^1.0.0",
|
|
52
|
-
"@progress/kendo-vue-animation": "3.8.4-dev.
|
|
53
|
-
"@progress/kendo-vue-buttons": "3.8.4-dev.
|
|
54
|
-
"@progress/kendo-vue-charts": "3.8.4-dev.
|
|
55
|
-
"@progress/kendo-vue-data-tools": "3.8.4-dev.
|
|
56
|
-
"@progress/kendo-vue-dateinputs": "3.8.4-dev.
|
|
57
|
-
"@progress/kendo-vue-dropdowns": "3.8.4-dev.
|
|
58
|
-
"@progress/kendo-vue-excel-export": "3.8.4-dev.
|
|
59
|
-
"@progress/kendo-vue-indicators": "3.8.4-dev.
|
|
60
|
-
"@progress/kendo-vue-inputs": "3.8.4-dev.
|
|
61
|
-
"@progress/kendo-vue-intl": "3.8.4-dev.
|
|
62
|
-
"@progress/kendo-vue-pdf": "3.8.4-dev.
|
|
63
|
-
"@progress/kendo-vue-popup": "3.8.4-dev.
|
|
52
|
+
"@progress/kendo-vue-animation": "3.8.4-dev.202302221027",
|
|
53
|
+
"@progress/kendo-vue-buttons": "3.8.4-dev.202302221027",
|
|
54
|
+
"@progress/kendo-vue-charts": "3.8.4-dev.202302221027",
|
|
55
|
+
"@progress/kendo-vue-data-tools": "3.8.4-dev.202302221027",
|
|
56
|
+
"@progress/kendo-vue-dateinputs": "3.8.4-dev.202302221027",
|
|
57
|
+
"@progress/kendo-vue-dropdowns": "3.8.4-dev.202302221027",
|
|
58
|
+
"@progress/kendo-vue-excel-export": "3.8.4-dev.202302221027",
|
|
59
|
+
"@progress/kendo-vue-indicators": "3.8.4-dev.202302221027",
|
|
60
|
+
"@progress/kendo-vue-inputs": "3.8.4-dev.202302221027",
|
|
61
|
+
"@progress/kendo-vue-intl": "3.8.4-dev.202302221027",
|
|
62
|
+
"@progress/kendo-vue-pdf": "3.8.4-dev.202302221027",
|
|
63
|
+
"@progress/kendo-vue-popup": "3.8.4-dev.202302221027",
|
|
64
64
|
"cldr-core": "^41.0.0",
|
|
65
65
|
"cldr-dates-full": "^41.0.0",
|
|
66
66
|
"cldr-numbers-full": "^41.0.0",
|