@progress/kendo-vue-grid 3.7.4-dev.202301131104 → 3.7.4-dev.202301151601
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 +1 -2
- package/dist/es/VirtualScroll.d.ts +2 -2
- package/dist/es/VirtualScroll.js +43 -39
- package/dist/es/cells/GridFilterCell.js +7 -3
- package/dist/es/drag/CommonDragLogic.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/esm/Grid.js +1 -2
- package/dist/esm/VirtualScroll.d.ts +2 -2
- package/dist/esm/VirtualScroll.js +43 -39
- package/dist/esm/cells/GridFilterCell.js +7 -3
- package/dist/esm/drag/CommonDragLogic.js +1 -1
- package/dist/esm/package-metadata.js +1 -1
- package/dist/npm/Grid.js +1 -2
- package/dist/npm/VirtualScroll.d.ts +2 -2
- package/dist/npm/VirtualScroll.js +43 -39
- package/dist/npm/cells/GridFilterCell.js +6 -2
- package/dist/npm/drag/CommonDragLogic.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/package.json +14 -14
package/dist/es/Grid.js
CHANGED
|
@@ -248,7 +248,7 @@ var GridVue2 = {
|
|
|
248
248
|
// Calculates the value of the ariaRowcount attribute.
|
|
249
249
|
getAriaRowCount: function getAriaRowCount() {
|
|
250
250
|
var dataItems = this.$props.dataItems;
|
|
251
|
-
var totalRecords = this.$props.total !== undefined && this.$props.total || dataItems !== undefined && dataItems.total !== undefined && dataItems.total || dataItems !== undefined && dataItems.length !== undefined && dataItems.length;
|
|
251
|
+
var totalRecords = this.$props.total !== undefined && this.$props.total || dataItems !== undefined && dataItems !== null && dataItems.total !== undefined && dataItems.total || dataItems !== undefined && dataItems !== null && dataItems.length !== undefined && dataItems.length || 0;
|
|
252
252
|
if (this.$props.detail) {
|
|
253
253
|
return this._columnsMap.length + (this.$props.filterable ? 1 : 0) + totalRecords * 2 + (this._columns.some(function (c) {
|
|
254
254
|
return Boolean(c.footerCell);
|
|
@@ -356,7 +356,6 @@ var GridVue2 = {
|
|
|
356
356
|
if (Math.max(0, this.vs.attendedSkip) !== value && value !== undefined) {
|
|
357
357
|
this.vs.attendedSkip = value;
|
|
358
358
|
this.vs.propsSkip = (value || 0) + (this.$props.scrollable === 'virtual' ? this.vs.topCacheCount + (this.vs.attendedSkip - (value || 0)) : 0);
|
|
359
|
-
this.vs.syncScroll();
|
|
360
359
|
}
|
|
361
360
|
},
|
|
362
361
|
onTotalChanged: function onTotalChanged(_value, _oldValue) {
|
|
@@ -19,7 +19,6 @@ export declare class VirtualScroll {
|
|
|
19
19
|
fixedScroll: boolean;
|
|
20
20
|
askedSkip: number | undefined;
|
|
21
21
|
private prevScrollPos;
|
|
22
|
-
private syncTimeout;
|
|
23
22
|
private tableTranslate;
|
|
24
23
|
private scrollSyncing;
|
|
25
24
|
constructor(cached: boolean, topCacheCount: number);
|
|
@@ -32,10 +31,11 @@ export declare class VirtualScroll {
|
|
|
32
31
|
}>;
|
|
33
32
|
changePage(skip: number, e: any): void;
|
|
34
33
|
translate(dY: number): void;
|
|
35
|
-
syncScroll(): void;
|
|
36
34
|
reset(): void;
|
|
37
35
|
localScrollUp(e: any): void;
|
|
38
36
|
localScrollDown(e: any): void;
|
|
39
37
|
scrollNonStrict(e: any): void;
|
|
40
38
|
scrollHandler(e: any): void;
|
|
39
|
+
private topItems;
|
|
40
|
+
private horizontalScrollbarHeight;
|
|
41
41
|
}
|
package/dist/es/VirtualScroll.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { canUseDOM } from '@progress/kendo-vue-common';
|
|
2
1
|
/**
|
|
3
2
|
* @hidden
|
|
4
3
|
*/
|
|
5
4
|
var VirtualScroll = /** @class */ (function () {
|
|
6
5
|
function VirtualScroll(cached, topCacheCount) {
|
|
6
|
+
var _this = this;
|
|
7
7
|
this.containerHeight = 0;
|
|
8
8
|
this.topCacheCount = 0; // 4;
|
|
9
9
|
this.attendedSkip = 0; // -4;
|
|
@@ -18,6 +18,29 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
18
18
|
this.prevScrollPos = 0;
|
|
19
19
|
this.tableTranslate = 0;
|
|
20
20
|
this.scrollSyncing = false;
|
|
21
|
+
this.topItems = function (heights, skipTopBuffer) {
|
|
22
|
+
if (!_this.container || skipTopBuffer) {
|
|
23
|
+
return { topItemsCount: 0, topItemsHeight: 0 };
|
|
24
|
+
}
|
|
25
|
+
var screenHeight = _this.container.clientHeight;
|
|
26
|
+
var itemsOnScreen = Math.ceil(screenHeight / heights[0].line);
|
|
27
|
+
var topItemsCount = Math.ceil((heights.length - itemsOnScreen) / 2);
|
|
28
|
+
var topItemsHeight = 0;
|
|
29
|
+
for (var i = 0; i < topItemsCount; i++) {
|
|
30
|
+
topItemsHeight += heights[i].line + heights[i].acc;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
topItemsCount: topItemsCount,
|
|
34
|
+
topItemsHeight: topItemsHeight,
|
|
35
|
+
itemsNeededOnScreen: itemsOnScreen + itemsOnScreen / 2
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
this.horizontalScrollbarHeight = function () {
|
|
39
|
+
if (!_this.container) {
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
return _this.container.offsetHeight - _this.container.clientHeight;
|
|
43
|
+
};
|
|
21
44
|
if (cached) {
|
|
22
45
|
this.topCacheCount = topCacheCount;
|
|
23
46
|
this.attendedSkip = -this.topCacheCount;
|
|
@@ -48,12 +71,6 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
48
71
|
accumulate = 0;
|
|
49
72
|
}
|
|
50
73
|
}
|
|
51
|
-
if (allRows.length && !result.length) {
|
|
52
|
-
result.push({
|
|
53
|
-
line: allRows[0].scrollHeight,
|
|
54
|
-
acc: accumulate
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
74
|
return result;
|
|
58
75
|
},
|
|
59
76
|
enumerable: false,
|
|
@@ -72,22 +89,6 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
72
89
|
this.table.style.transform = 'translateY(' + dY + 'px)';
|
|
73
90
|
}
|
|
74
91
|
};
|
|
75
|
-
VirtualScroll.prototype.syncScroll = function () {
|
|
76
|
-
if (!this.scrollableVirtual || !this.container) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
this.syncTimeout = null;
|
|
80
|
-
var scrollTop = this.container.scrollTop;
|
|
81
|
-
var containerHeight = this.containerHeight; // = this.container.scrollHeight;
|
|
82
|
-
var rowHeights = this.rowHeights;
|
|
83
|
-
var percentage = (scrollTop - this.tableTranslate) / rowHeights[0].line;
|
|
84
|
-
var targetFloorScrollPosition = Math.floor((containerHeight) * (this.propsSkip + percentage) / this.total);
|
|
85
|
-
if (this.container.scrollTop !== (this.prevScrollPos = targetFloorScrollPosition)) {
|
|
86
|
-
this.scrollSyncing = true;
|
|
87
|
-
this.container.scrollTop = (this.prevScrollPos = targetFloorScrollPosition);
|
|
88
|
-
}
|
|
89
|
-
this.translate(this.tableTranslate + targetFloorScrollPosition - scrollTop);
|
|
90
|
-
};
|
|
91
92
|
VirtualScroll.prototype.reset = function () {
|
|
92
93
|
this.scrollSyncing = true;
|
|
93
94
|
if (this.fixedScroll) {
|
|
@@ -106,11 +107,12 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
106
107
|
var scrollTop = this.container.scrollTop;
|
|
107
108
|
var targetTranslate = this.tableTranslate;
|
|
108
109
|
var rowsCount = 0;
|
|
110
|
+
var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight, itemsNeededOnScreen = _a.itemsNeededOnScreen;
|
|
109
111
|
var additionalOnTop = scrollTop - targetTranslate;
|
|
110
|
-
if (additionalOnTop >
|
|
112
|
+
if ((additionalOnTop > topItemsHeight) || heights.length <= itemsNeededOnScreen) {
|
|
111
113
|
return;
|
|
112
114
|
}
|
|
113
|
-
while ((rowsCount < this.topCacheCount + this.attendedSkip - this.realSkip)
|
|
115
|
+
while ((rowsCount < this.topCacheCount + this.attendedSkip - this.realSkip + topItemsCount)
|
|
114
116
|
&& this.propsSkip - rowsCount > 0 &&
|
|
115
117
|
!(targetTranslate + (heights[heights.length - 1 - rowsCount].line + heights[heights.length - 1 - rowsCount].acc) + additionalOnTop <= scrollTop)) {
|
|
116
118
|
targetTranslate -= heights[heights.length - 1 - rowsCount].line +
|
|
@@ -136,8 +138,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
136
138
|
// floor the translate to beginning of the item in absolute value
|
|
137
139
|
}
|
|
138
140
|
if (targetTranslate !== this.tableTranslate) {
|
|
139
|
-
this.translate(targetTranslate);
|
|
140
|
-
|
|
141
|
+
this.translate(Math.max(0, targetTranslate - topItemsHeight));
|
|
142
|
+
var nextSkip = Math.max(0, this.propsSkip - rowsCount - topItemsCount);
|
|
143
|
+
this.changePage(nextSkip, e);
|
|
141
144
|
}
|
|
142
145
|
};
|
|
143
146
|
VirtualScroll.prototype.localScrollDown = function (e) {
|
|
@@ -148,18 +151,23 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
148
151
|
var scrollTop = this.container.scrollTop;
|
|
149
152
|
var targetTranslate = this.tableTranslate;
|
|
150
153
|
var rowsCount = 0;
|
|
154
|
+
var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight, itemsNeededOnScreen = _a.itemsNeededOnScreen;
|
|
151
155
|
while (rowsCount < heights.length - this.topCacheCount &&
|
|
152
156
|
!(targetTranslate + heights[rowsCount].line + heights[rowsCount].acc > scrollTop)) {
|
|
153
157
|
targetTranslate += heights[rowsCount].line + heights[rowsCount].acc;
|
|
154
158
|
rowsCount++;
|
|
155
159
|
}
|
|
160
|
+
if ((topItemsCount > this.propsSkip + rowsCount) || heights.length <= itemsNeededOnScreen) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
156
163
|
if (rowsCount >= heights.length - this.topCacheCount && this.propsSkip + rowsCount >= this.total) {
|
|
157
|
-
this.translate(targetTranslate);
|
|
158
|
-
this.changePage(this.total - 1, e);
|
|
164
|
+
this.translate(targetTranslate - topItemsHeight);
|
|
165
|
+
this.changePage(this.total - 1 - topItemsCount, e);
|
|
159
166
|
}
|
|
160
|
-
else if (targetTranslate !== this.tableTranslate
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
167
|
+
else if (targetTranslate !== this.tableTranslate
|
|
168
|
+
&& this.propsSkip + rowsCount - topItemsCount !== this.propsSkip) {
|
|
169
|
+
this.translate(targetTranslate - topItemsHeight);
|
|
170
|
+
this.changePage(this.propsSkip + rowsCount - topItemsCount, e);
|
|
163
171
|
}
|
|
164
172
|
};
|
|
165
173
|
VirtualScroll.prototype.scrollNonStrict = function (e) {
|
|
@@ -178,8 +186,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
178
186
|
else if (rowIndexOffset === -1) {
|
|
179
187
|
microAdjust = -((heights[heights.length - 1].line + heights[heights.length - 1].acc) * rowpercentage);
|
|
180
188
|
}
|
|
181
|
-
this.
|
|
182
|
-
this.
|
|
189
|
+
var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight;
|
|
190
|
+
this.translate(Math.max(0, microAdjust - topItemsHeight - this.horizontalScrollbarHeight() + this.containerHeight * floatRowIndex / this.total));
|
|
191
|
+
this.changePage(rowIndex - topItemsCount, e);
|
|
183
192
|
};
|
|
184
193
|
VirtualScroll.prototype.scrollHandler = function (e) {
|
|
185
194
|
if (!this.scrollableVirtual) {
|
|
@@ -189,11 +198,6 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
189
198
|
this.scrollSyncing = false;
|
|
190
199
|
return;
|
|
191
200
|
}
|
|
192
|
-
var grid = this;
|
|
193
|
-
clearTimeout(this.syncTimeout);
|
|
194
|
-
if (canUseDOM) {
|
|
195
|
-
this.syncTimeout = window.setTimeout(function () { grid.syncScroll(); }, 200);
|
|
196
|
-
}
|
|
197
201
|
var scrollTop = this.container.scrollTop;
|
|
198
202
|
var prev = this.prevScrollPos;
|
|
199
203
|
this.prevScrollPos = scrollTop;
|
|
@@ -9,7 +9,7 @@ import { messages, filterClearButton, filterChooseOperator } from '../messages/m
|
|
|
9
9
|
import { DropDownList } from '@progress/kendo-vue-dropdowns';
|
|
10
10
|
import { NumericTextBox, Input } from '@progress/kendo-vue-inputs';
|
|
11
11
|
import { DatePicker } from '@progress/kendo-vue-dateinputs';
|
|
12
|
-
import { filterClearIcon } from '@progress/kendo-svg-icons';
|
|
12
|
+
import { filterIcon, filterClearIcon } from '@progress/kendo-svg-icons';
|
|
13
13
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
14
14
|
import { cellBoolDropdownChange, cellInputChange, cellOperatorChange } from '../filterCommon';
|
|
15
15
|
import { templateRendering, getListeners, getTemplate } from '@progress/kendo-vue-common';
|
|
@@ -103,7 +103,9 @@ var GridFilterCellVue2 = {
|
|
|
103
103
|
attrs: this.v3 ? undefined : {
|
|
104
104
|
value: selectedOperator,
|
|
105
105
|
size: size,
|
|
106
|
-
|
|
106
|
+
icon: 'filter',
|
|
107
|
+
svgIcon: filterIcon,
|
|
108
|
+
iconClassName: "filter k-button-icon",
|
|
107
109
|
"data-items": this.$props.operators,
|
|
108
110
|
textField: "text",
|
|
109
111
|
title: localizationService.toLanguageString(filterChooseOperator, messages[filterChooseOperator]),
|
|
@@ -114,7 +116,9 @@ var GridFilterCellVue2 = {
|
|
|
114
116
|
},
|
|
115
117
|
size: size,
|
|
116
118
|
"class": "k-dropdown-operator",
|
|
117
|
-
|
|
119
|
+
icon: 'filter',
|
|
120
|
+
svgIcon: filterIcon,
|
|
121
|
+
iconClassName: "filter k-button-icon",
|
|
118
122
|
"data-items": this.$props.operators,
|
|
119
123
|
textField: "text",
|
|
120
124
|
title: localizationService.toLanguageString(filterChooseOperator, messages[filterChooseOperator]),
|
|
@@ -55,7 +55,7 @@ var CommonDragLogic = /** @class */ (function () {
|
|
|
55
55
|
var groupPanelChildren = _this.groupPanelDivElement && _this.groupPanelDivElement.children;
|
|
56
56
|
_this.currentGroup = _this.isTargetGroupingContainer(event)
|
|
57
57
|
? groupPanelChildren && groupPanelChildren.length
|
|
58
|
-
? groupPanelChildren.length
|
|
58
|
+
? groupPanelChildren.length
|
|
59
59
|
: 0
|
|
60
60
|
: _this.getGroupIndex(event);
|
|
61
61
|
var invalidIndex = !_this.isValid();
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-grid',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1673797982,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
package/dist/esm/Grid.js
CHANGED
|
@@ -248,7 +248,7 @@ var GridVue2 = {
|
|
|
248
248
|
// Calculates the value of the ariaRowcount attribute.
|
|
249
249
|
getAriaRowCount: function getAriaRowCount() {
|
|
250
250
|
var dataItems = this.$props.dataItems;
|
|
251
|
-
var totalRecords = this.$props.total !== undefined && this.$props.total || dataItems !== undefined && dataItems.total !== undefined && dataItems.total || dataItems !== undefined && dataItems.length !== undefined && dataItems.length;
|
|
251
|
+
var totalRecords = this.$props.total !== undefined && this.$props.total || dataItems !== undefined && dataItems !== null && dataItems.total !== undefined && dataItems.total || dataItems !== undefined && dataItems !== null && dataItems.length !== undefined && dataItems.length || 0;
|
|
252
252
|
if (this.$props.detail) {
|
|
253
253
|
return this._columnsMap.length + (this.$props.filterable ? 1 : 0) + totalRecords * 2 + (this._columns.some(function (c) {
|
|
254
254
|
return Boolean(c.footerCell);
|
|
@@ -356,7 +356,6 @@ var GridVue2 = {
|
|
|
356
356
|
if (Math.max(0, this.vs.attendedSkip) !== value && value !== undefined) {
|
|
357
357
|
this.vs.attendedSkip = value;
|
|
358
358
|
this.vs.propsSkip = (value || 0) + (this.$props.scrollable === 'virtual' ? this.vs.topCacheCount + (this.vs.attendedSkip - (value || 0)) : 0);
|
|
359
|
-
this.vs.syncScroll();
|
|
360
359
|
}
|
|
361
360
|
},
|
|
362
361
|
onTotalChanged: function onTotalChanged(_value, _oldValue) {
|
|
@@ -19,7 +19,6 @@ export declare class VirtualScroll {
|
|
|
19
19
|
fixedScroll: boolean;
|
|
20
20
|
askedSkip: number | undefined;
|
|
21
21
|
private prevScrollPos;
|
|
22
|
-
private syncTimeout;
|
|
23
22
|
private tableTranslate;
|
|
24
23
|
private scrollSyncing;
|
|
25
24
|
constructor(cached: boolean, topCacheCount: number);
|
|
@@ -32,10 +31,11 @@ export declare class VirtualScroll {
|
|
|
32
31
|
}>;
|
|
33
32
|
changePage(skip: number, e: any): void;
|
|
34
33
|
translate(dY: number): void;
|
|
35
|
-
syncScroll(): void;
|
|
36
34
|
reset(): void;
|
|
37
35
|
localScrollUp(e: any): void;
|
|
38
36
|
localScrollDown(e: any): void;
|
|
39
37
|
scrollNonStrict(e: any): void;
|
|
40
38
|
scrollHandler(e: any): void;
|
|
39
|
+
private topItems;
|
|
40
|
+
private horizontalScrollbarHeight;
|
|
41
41
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { canUseDOM } from '@progress/kendo-vue-common';
|
|
2
1
|
/**
|
|
3
2
|
* @hidden
|
|
4
3
|
*/
|
|
5
4
|
var VirtualScroll = /** @class */ (function () {
|
|
6
5
|
function VirtualScroll(cached, topCacheCount) {
|
|
6
|
+
var _this = this;
|
|
7
7
|
this.containerHeight = 0;
|
|
8
8
|
this.topCacheCount = 0; // 4;
|
|
9
9
|
this.attendedSkip = 0; // -4;
|
|
@@ -18,6 +18,29 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
18
18
|
this.prevScrollPos = 0;
|
|
19
19
|
this.tableTranslate = 0;
|
|
20
20
|
this.scrollSyncing = false;
|
|
21
|
+
this.topItems = function (heights, skipTopBuffer) {
|
|
22
|
+
if (!_this.container || skipTopBuffer) {
|
|
23
|
+
return { topItemsCount: 0, topItemsHeight: 0 };
|
|
24
|
+
}
|
|
25
|
+
var screenHeight = _this.container.clientHeight;
|
|
26
|
+
var itemsOnScreen = Math.ceil(screenHeight / heights[0].line);
|
|
27
|
+
var topItemsCount = Math.ceil((heights.length - itemsOnScreen) / 2);
|
|
28
|
+
var topItemsHeight = 0;
|
|
29
|
+
for (var i = 0; i < topItemsCount; i++) {
|
|
30
|
+
topItemsHeight += heights[i].line + heights[i].acc;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
topItemsCount: topItemsCount,
|
|
34
|
+
topItemsHeight: topItemsHeight,
|
|
35
|
+
itemsNeededOnScreen: itemsOnScreen + itemsOnScreen / 2
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
this.horizontalScrollbarHeight = function () {
|
|
39
|
+
if (!_this.container) {
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
return _this.container.offsetHeight - _this.container.clientHeight;
|
|
43
|
+
};
|
|
21
44
|
if (cached) {
|
|
22
45
|
this.topCacheCount = topCacheCount;
|
|
23
46
|
this.attendedSkip = -this.topCacheCount;
|
|
@@ -48,12 +71,6 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
48
71
|
accumulate = 0;
|
|
49
72
|
}
|
|
50
73
|
}
|
|
51
|
-
if (allRows.length && !result.length) {
|
|
52
|
-
result.push({
|
|
53
|
-
line: allRows[0].scrollHeight,
|
|
54
|
-
acc: accumulate
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
74
|
return result;
|
|
58
75
|
},
|
|
59
76
|
enumerable: false,
|
|
@@ -72,22 +89,6 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
72
89
|
this.table.style.transform = 'translateY(' + dY + 'px)';
|
|
73
90
|
}
|
|
74
91
|
};
|
|
75
|
-
VirtualScroll.prototype.syncScroll = function () {
|
|
76
|
-
if (!this.scrollableVirtual || !this.container) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
this.syncTimeout = null;
|
|
80
|
-
var scrollTop = this.container.scrollTop;
|
|
81
|
-
var containerHeight = this.containerHeight; // = this.container.scrollHeight;
|
|
82
|
-
var rowHeights = this.rowHeights;
|
|
83
|
-
var percentage = (scrollTop - this.tableTranslate) / rowHeights[0].line;
|
|
84
|
-
var targetFloorScrollPosition = Math.floor((containerHeight) * (this.propsSkip + percentage) / this.total);
|
|
85
|
-
if (this.container.scrollTop !== (this.prevScrollPos = targetFloorScrollPosition)) {
|
|
86
|
-
this.scrollSyncing = true;
|
|
87
|
-
this.container.scrollTop = (this.prevScrollPos = targetFloorScrollPosition);
|
|
88
|
-
}
|
|
89
|
-
this.translate(this.tableTranslate + targetFloorScrollPosition - scrollTop);
|
|
90
|
-
};
|
|
91
92
|
VirtualScroll.prototype.reset = function () {
|
|
92
93
|
this.scrollSyncing = true;
|
|
93
94
|
if (this.fixedScroll) {
|
|
@@ -106,11 +107,12 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
106
107
|
var scrollTop = this.container.scrollTop;
|
|
107
108
|
var targetTranslate = this.tableTranslate;
|
|
108
109
|
var rowsCount = 0;
|
|
110
|
+
var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight, itemsNeededOnScreen = _a.itemsNeededOnScreen;
|
|
109
111
|
var additionalOnTop = scrollTop - targetTranslate;
|
|
110
|
-
if (additionalOnTop >
|
|
112
|
+
if ((additionalOnTop > topItemsHeight) || heights.length <= itemsNeededOnScreen) {
|
|
111
113
|
return;
|
|
112
114
|
}
|
|
113
|
-
while ((rowsCount < this.topCacheCount + this.attendedSkip - this.realSkip)
|
|
115
|
+
while ((rowsCount < this.topCacheCount + this.attendedSkip - this.realSkip + topItemsCount)
|
|
114
116
|
&& this.propsSkip - rowsCount > 0 &&
|
|
115
117
|
!(targetTranslate + (heights[heights.length - 1 - rowsCount].line + heights[heights.length - 1 - rowsCount].acc) + additionalOnTop <= scrollTop)) {
|
|
116
118
|
targetTranslate -= heights[heights.length - 1 - rowsCount].line +
|
|
@@ -136,8 +138,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
136
138
|
// floor the translate to beginning of the item in absolute value
|
|
137
139
|
}
|
|
138
140
|
if (targetTranslate !== this.tableTranslate) {
|
|
139
|
-
this.translate(targetTranslate);
|
|
140
|
-
|
|
141
|
+
this.translate(Math.max(0, targetTranslate - topItemsHeight));
|
|
142
|
+
var nextSkip = Math.max(0, this.propsSkip - rowsCount - topItemsCount);
|
|
143
|
+
this.changePage(nextSkip, e);
|
|
141
144
|
}
|
|
142
145
|
};
|
|
143
146
|
VirtualScroll.prototype.localScrollDown = function (e) {
|
|
@@ -148,18 +151,23 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
148
151
|
var scrollTop = this.container.scrollTop;
|
|
149
152
|
var targetTranslate = this.tableTranslate;
|
|
150
153
|
var rowsCount = 0;
|
|
154
|
+
var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight, itemsNeededOnScreen = _a.itemsNeededOnScreen;
|
|
151
155
|
while (rowsCount < heights.length - this.topCacheCount &&
|
|
152
156
|
!(targetTranslate + heights[rowsCount].line + heights[rowsCount].acc > scrollTop)) {
|
|
153
157
|
targetTranslate += heights[rowsCount].line + heights[rowsCount].acc;
|
|
154
158
|
rowsCount++;
|
|
155
159
|
}
|
|
160
|
+
if ((topItemsCount > this.propsSkip + rowsCount) || heights.length <= itemsNeededOnScreen) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
156
163
|
if (rowsCount >= heights.length - this.topCacheCount && this.propsSkip + rowsCount >= this.total) {
|
|
157
|
-
this.translate(targetTranslate);
|
|
158
|
-
this.changePage(this.total - 1, e);
|
|
164
|
+
this.translate(targetTranslate - topItemsHeight);
|
|
165
|
+
this.changePage(this.total - 1 - topItemsCount, e);
|
|
159
166
|
}
|
|
160
|
-
else if (targetTranslate !== this.tableTranslate
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
167
|
+
else if (targetTranslate !== this.tableTranslate
|
|
168
|
+
&& this.propsSkip + rowsCount - topItemsCount !== this.propsSkip) {
|
|
169
|
+
this.translate(targetTranslate - topItemsHeight);
|
|
170
|
+
this.changePage(this.propsSkip + rowsCount - topItemsCount, e);
|
|
163
171
|
}
|
|
164
172
|
};
|
|
165
173
|
VirtualScroll.prototype.scrollNonStrict = function (e) {
|
|
@@ -178,8 +186,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
178
186
|
else if (rowIndexOffset === -1) {
|
|
179
187
|
microAdjust = -((heights[heights.length - 1].line + heights[heights.length - 1].acc) * rowpercentage);
|
|
180
188
|
}
|
|
181
|
-
this.
|
|
182
|
-
this.
|
|
189
|
+
var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight;
|
|
190
|
+
this.translate(Math.max(0, microAdjust - topItemsHeight - this.horizontalScrollbarHeight() + this.containerHeight * floatRowIndex / this.total));
|
|
191
|
+
this.changePage(rowIndex - topItemsCount, e);
|
|
183
192
|
};
|
|
184
193
|
VirtualScroll.prototype.scrollHandler = function (e) {
|
|
185
194
|
if (!this.scrollableVirtual) {
|
|
@@ -189,11 +198,6 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
189
198
|
this.scrollSyncing = false;
|
|
190
199
|
return;
|
|
191
200
|
}
|
|
192
|
-
var grid = this;
|
|
193
|
-
clearTimeout(this.syncTimeout);
|
|
194
|
-
if (canUseDOM) {
|
|
195
|
-
this.syncTimeout = window.setTimeout(function () { grid.syncScroll(); }, 200);
|
|
196
|
-
}
|
|
197
201
|
var scrollTop = this.container.scrollTop;
|
|
198
202
|
var prev = this.prevScrollPos;
|
|
199
203
|
this.prevScrollPos = scrollTop;
|
|
@@ -9,7 +9,7 @@ import { messages, filterClearButton, filterChooseOperator } from '../messages/m
|
|
|
9
9
|
import { DropDownList } from '@progress/kendo-vue-dropdowns';
|
|
10
10
|
import { NumericTextBox, Input } from '@progress/kendo-vue-inputs';
|
|
11
11
|
import { DatePicker } from '@progress/kendo-vue-dateinputs';
|
|
12
|
-
import { filterClearIcon } from '@progress/kendo-svg-icons';
|
|
12
|
+
import { filterIcon, filterClearIcon } from '@progress/kendo-svg-icons';
|
|
13
13
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
14
14
|
import { cellBoolDropdownChange, cellInputChange, cellOperatorChange } from '../filterCommon.js';
|
|
15
15
|
import { templateRendering, getListeners, getTemplate } from '@progress/kendo-vue-common';
|
|
@@ -103,7 +103,9 @@ var GridFilterCellVue2 = {
|
|
|
103
103
|
attrs: this.v3 ? undefined : {
|
|
104
104
|
value: selectedOperator,
|
|
105
105
|
size: size,
|
|
106
|
-
|
|
106
|
+
icon: 'filter',
|
|
107
|
+
svgIcon: filterIcon,
|
|
108
|
+
iconClassName: "filter k-button-icon",
|
|
107
109
|
"data-items": this.$props.operators,
|
|
108
110
|
textField: "text",
|
|
109
111
|
title: localizationService.toLanguageString(filterChooseOperator, messages[filterChooseOperator]),
|
|
@@ -114,7 +116,9 @@ var GridFilterCellVue2 = {
|
|
|
114
116
|
},
|
|
115
117
|
size: size,
|
|
116
118
|
"class": "k-dropdown-operator",
|
|
117
|
-
|
|
119
|
+
icon: 'filter',
|
|
120
|
+
svgIcon: filterIcon,
|
|
121
|
+
iconClassName: "filter k-button-icon",
|
|
118
122
|
"data-items": this.$props.operators,
|
|
119
123
|
textField: "text",
|
|
120
124
|
title: localizationService.toLanguageString(filterChooseOperator, messages[filterChooseOperator]),
|
|
@@ -55,7 +55,7 @@ var CommonDragLogic = /** @class */ (function () {
|
|
|
55
55
|
var groupPanelChildren = _this.groupPanelDivElement && _this.groupPanelDivElement.children;
|
|
56
56
|
_this.currentGroup = _this.isTargetGroupingContainer(event)
|
|
57
57
|
? groupPanelChildren && groupPanelChildren.length
|
|
58
|
-
? groupPanelChildren.length
|
|
58
|
+
? groupPanelChildren.length
|
|
59
59
|
: 0
|
|
60
60
|
: _this.getGroupIndex(event);
|
|
61
61
|
var invalidIndex = !_this.isValid();
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-grid',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1673797982,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
package/dist/npm/Grid.js
CHANGED
|
@@ -254,7 +254,7 @@ var GridVue2 = {
|
|
|
254
254
|
// Calculates the value of the ariaRowcount attribute.
|
|
255
255
|
getAriaRowCount: function getAriaRowCount() {
|
|
256
256
|
var dataItems = this.$props.dataItems;
|
|
257
|
-
var totalRecords = this.$props.total !== undefined && this.$props.total || dataItems !== undefined && dataItems.total !== undefined && dataItems.total || dataItems !== undefined && dataItems.length !== undefined && dataItems.length;
|
|
257
|
+
var totalRecords = this.$props.total !== undefined && this.$props.total || dataItems !== undefined && dataItems !== null && dataItems.total !== undefined && dataItems.total || dataItems !== undefined && dataItems !== null && dataItems.length !== undefined && dataItems.length || 0;
|
|
258
258
|
if (this.$props.detail) {
|
|
259
259
|
return this._columnsMap.length + (this.$props.filterable ? 1 : 0) + totalRecords * 2 + (this._columns.some(function (c) {
|
|
260
260
|
return Boolean(c.footerCell);
|
|
@@ -362,7 +362,6 @@ var GridVue2 = {
|
|
|
362
362
|
if (Math.max(0, this.vs.attendedSkip) !== value && value !== undefined) {
|
|
363
363
|
this.vs.attendedSkip = value;
|
|
364
364
|
this.vs.propsSkip = (value || 0) + (this.$props.scrollable === 'virtual' ? this.vs.topCacheCount + (this.vs.attendedSkip - (value || 0)) : 0);
|
|
365
|
-
this.vs.syncScroll();
|
|
366
365
|
}
|
|
367
366
|
},
|
|
368
367
|
onTotalChanged: function onTotalChanged(_value, _oldValue) {
|
|
@@ -19,7 +19,6 @@ export declare class VirtualScroll {
|
|
|
19
19
|
fixedScroll: boolean;
|
|
20
20
|
askedSkip: number | undefined;
|
|
21
21
|
private prevScrollPos;
|
|
22
|
-
private syncTimeout;
|
|
23
22
|
private tableTranslate;
|
|
24
23
|
private scrollSyncing;
|
|
25
24
|
constructor(cached: boolean, topCacheCount: number);
|
|
@@ -32,10 +31,11 @@ export declare class VirtualScroll {
|
|
|
32
31
|
}>;
|
|
33
32
|
changePage(skip: number, e: any): void;
|
|
34
33
|
translate(dY: number): void;
|
|
35
|
-
syncScroll(): void;
|
|
36
34
|
reset(): void;
|
|
37
35
|
localScrollUp(e: any): void;
|
|
38
36
|
localScrollDown(e: any): void;
|
|
39
37
|
scrollNonStrict(e: any): void;
|
|
40
38
|
scrollHandler(e: any): void;
|
|
39
|
+
private topItems;
|
|
40
|
+
private horizontalScrollbarHeight;
|
|
41
41
|
}
|