@progress/kendo-vue-grid 3.7.4-dev.202301120847 → 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.
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VirtualScroll = void 0;
4
- var kendo_vue_common_1 = require("@progress/kendo-vue-common");
5
4
  /**
6
5
  * @hidden
7
6
  */
8
7
  var VirtualScroll = /** @class */ (function () {
9
8
  function VirtualScroll(cached, topCacheCount) {
9
+ var _this = this;
10
10
  this.containerHeight = 0;
11
11
  this.topCacheCount = 0; // 4;
12
12
  this.attendedSkip = 0; // -4;
@@ -21,6 +21,29 @@ var VirtualScroll = /** @class */ (function () {
21
21
  this.prevScrollPos = 0;
22
22
  this.tableTranslate = 0;
23
23
  this.scrollSyncing = false;
24
+ this.topItems = function (heights, skipTopBuffer) {
25
+ if (!_this.container || skipTopBuffer) {
26
+ return { topItemsCount: 0, topItemsHeight: 0 };
27
+ }
28
+ var screenHeight = _this.container.clientHeight;
29
+ var itemsOnScreen = Math.ceil(screenHeight / heights[0].line);
30
+ var topItemsCount = Math.ceil((heights.length - itemsOnScreen) / 2);
31
+ var topItemsHeight = 0;
32
+ for (var i = 0; i < topItemsCount; i++) {
33
+ topItemsHeight += heights[i].line + heights[i].acc;
34
+ }
35
+ return {
36
+ topItemsCount: topItemsCount,
37
+ topItemsHeight: topItemsHeight,
38
+ itemsNeededOnScreen: itemsOnScreen + itemsOnScreen / 2
39
+ };
40
+ };
41
+ this.horizontalScrollbarHeight = function () {
42
+ if (!_this.container) {
43
+ return 0;
44
+ }
45
+ return _this.container.offsetHeight - _this.container.clientHeight;
46
+ };
24
47
  if (cached) {
25
48
  this.topCacheCount = topCacheCount;
26
49
  this.attendedSkip = -this.topCacheCount;
@@ -51,12 +74,6 @@ var VirtualScroll = /** @class */ (function () {
51
74
  accumulate = 0;
52
75
  }
53
76
  }
54
- if (allRows.length && !result.length) {
55
- result.push({
56
- line: allRows[0].scrollHeight,
57
- acc: accumulate
58
- });
59
- }
60
77
  return result;
61
78
  },
62
79
  enumerable: false,
@@ -75,22 +92,6 @@ var VirtualScroll = /** @class */ (function () {
75
92
  this.table.style.transform = 'translateY(' + dY + 'px)';
76
93
  }
77
94
  };
78
- VirtualScroll.prototype.syncScroll = function () {
79
- if (!this.scrollableVirtual || !this.container) {
80
- return;
81
- }
82
- this.syncTimeout = null;
83
- var scrollTop = this.container.scrollTop;
84
- var containerHeight = this.containerHeight; // = this.container.scrollHeight;
85
- var rowHeights = this.rowHeights;
86
- var percentage = (scrollTop - this.tableTranslate) / rowHeights[0].line;
87
- var targetFloorScrollPosition = Math.floor((containerHeight) * (this.propsSkip + percentage) / this.total);
88
- if (this.container.scrollTop !== (this.prevScrollPos = targetFloorScrollPosition)) {
89
- this.scrollSyncing = true;
90
- this.container.scrollTop = (this.prevScrollPos = targetFloorScrollPosition);
91
- }
92
- this.translate(this.tableTranslate + targetFloorScrollPosition - scrollTop);
93
- };
94
95
  VirtualScroll.prototype.reset = function () {
95
96
  this.scrollSyncing = true;
96
97
  if (this.fixedScroll) {
@@ -109,11 +110,12 @@ var VirtualScroll = /** @class */ (function () {
109
110
  var scrollTop = this.container.scrollTop;
110
111
  var targetTranslate = this.tableTranslate;
111
112
  var rowsCount = 0;
113
+ var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight, itemsNeededOnScreen = _a.itemsNeededOnScreen;
112
114
  var additionalOnTop = scrollTop - targetTranslate;
113
- if (additionalOnTop > 0) {
115
+ if ((additionalOnTop > topItemsHeight) || heights.length <= itemsNeededOnScreen) {
114
116
  return;
115
117
  }
116
- while ((rowsCount < this.topCacheCount + this.attendedSkip - this.realSkip)
118
+ while ((rowsCount < this.topCacheCount + this.attendedSkip - this.realSkip + topItemsCount)
117
119
  && this.propsSkip - rowsCount > 0 &&
118
120
  !(targetTranslate + (heights[heights.length - 1 - rowsCount].line + heights[heights.length - 1 - rowsCount].acc) + additionalOnTop <= scrollTop)) {
119
121
  targetTranslate -= heights[heights.length - 1 - rowsCount].line +
@@ -139,8 +141,9 @@ var VirtualScroll = /** @class */ (function () {
139
141
  // floor the translate to beginning of the item in absolute value
140
142
  }
141
143
  if (targetTranslate !== this.tableTranslate) {
142
- this.translate(targetTranslate);
143
- this.changePage(this.propsSkip - rowsCount, e);
144
+ this.translate(Math.max(0, targetTranslate - topItemsHeight));
145
+ var nextSkip = Math.max(0, this.propsSkip - rowsCount - topItemsCount);
146
+ this.changePage(nextSkip, e);
144
147
  }
145
148
  };
146
149
  VirtualScroll.prototype.localScrollDown = function (e) {
@@ -151,18 +154,23 @@ var VirtualScroll = /** @class */ (function () {
151
154
  var scrollTop = this.container.scrollTop;
152
155
  var targetTranslate = this.tableTranslate;
153
156
  var rowsCount = 0;
157
+ var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight, itemsNeededOnScreen = _a.itemsNeededOnScreen;
154
158
  while (rowsCount < heights.length - this.topCacheCount &&
155
159
  !(targetTranslate + heights[rowsCount].line + heights[rowsCount].acc > scrollTop)) {
156
160
  targetTranslate += heights[rowsCount].line + heights[rowsCount].acc;
157
161
  rowsCount++;
158
162
  }
163
+ if ((topItemsCount > this.propsSkip + rowsCount) || heights.length <= itemsNeededOnScreen) {
164
+ return;
165
+ }
159
166
  if (rowsCount >= heights.length - this.topCacheCount && this.propsSkip + rowsCount >= this.total) {
160
- this.translate(targetTranslate);
161
- this.changePage(this.total - 1, e);
167
+ this.translate(targetTranslate - topItemsHeight);
168
+ this.changePage(this.total - 1 - topItemsCount, e);
162
169
  }
163
- else if (targetTranslate !== this.tableTranslate) {
164
- this.translate(targetTranslate);
165
- this.changePage(this.propsSkip + rowsCount, e);
170
+ else if (targetTranslate !== this.tableTranslate
171
+ && this.propsSkip + rowsCount - topItemsCount !== this.propsSkip) {
172
+ this.translate(targetTranslate - topItemsHeight);
173
+ this.changePage(this.propsSkip + rowsCount - topItemsCount, e);
166
174
  }
167
175
  };
168
176
  VirtualScroll.prototype.scrollNonStrict = function (e) {
@@ -181,8 +189,9 @@ var VirtualScroll = /** @class */ (function () {
181
189
  else if (rowIndexOffset === -1) {
182
190
  microAdjust = -((heights[heights.length - 1].line + heights[heights.length - 1].acc) * rowpercentage);
183
191
  }
184
- this.translate(microAdjust + this.containerHeight * floatRowIndex / this.total);
185
- this.changePage(rowIndex, e);
192
+ var _a = this.topItems(heights, Boolean(this.topCacheCount)), topItemsCount = _a.topItemsCount, topItemsHeight = _a.topItemsHeight;
193
+ this.translate(Math.max(0, microAdjust - topItemsHeight - this.horizontalScrollbarHeight() + this.containerHeight * floatRowIndex / this.total));
194
+ this.changePage(rowIndex - topItemsCount, e);
186
195
  };
187
196
  VirtualScroll.prototype.scrollHandler = function (e) {
188
197
  if (!this.scrollableVirtual) {
@@ -192,11 +201,6 @@ var VirtualScroll = /** @class */ (function () {
192
201
  this.scrollSyncing = false;
193
202
  return;
194
203
  }
195
- var grid = this;
196
- clearTimeout(this.syncTimeout);
197
- if (kendo_vue_common_1.canUseDOM) {
198
- this.syncTimeout = window.setTimeout(function () { grid.syncScroll(); }, 200);
199
- }
200
204
  var scrollTop = this.container.scrollTop;
201
205
  var prev = this.prevScrollPos;
202
206
  this.prevScrollPos = scrollTop;
@@ -109,7 +109,9 @@ var GridFilterCellVue2 = {
109
109
  attrs: this.v3 ? undefined : {
110
110
  value: selectedOperator,
111
111
  size: size,
112
- iconClassName: "k-i-filter k-button-icon",
112
+ icon: 'filter',
113
+ svgIcon: kendo_svg_icons_1.filterIcon,
114
+ iconClassName: "filter k-button-icon",
113
115
  "data-items": this.$props.operators,
114
116
  textField: "text",
115
117
  title: localizationService.toLanguageString(main_1.filterChooseOperator, main_1.messages[main_1.filterChooseOperator]),
@@ -120,7 +122,9 @@ var GridFilterCellVue2 = {
120
122
  },
121
123
  size: size,
122
124
  "class": "k-dropdown-operator",
123
- iconClassName: "k-i-filter k-button-icon",
125
+ icon: 'filter',
126
+ svgIcon: kendo_svg_icons_1.filterIcon,
127
+ iconClassName: "filter k-button-icon",
124
128
  "data-items": this.$props.operators,
125
129
  textField: "text",
126
130
  title: localizationService.toLanguageString(main_1.filterChooseOperator, main_1.messages[main_1.filterChooseOperator]),
@@ -55,10 +55,10 @@ var CommonDragLogic = /** @class */ (function () {
55
55
  return;
56
56
  }
57
57
  _this.currentColumn = _this.getColumnIndex(event, element);
58
- var groupPanelChildren = _this.groupPanelDivElement.children;
58
+ var groupPanelChildren = _this.groupPanelDivElement && _this.groupPanelDivElement.children;
59
59
  _this.currentGroup = _this.isTargetGroupingContainer(event)
60
60
  ? groupPanelChildren && groupPanelChildren.length
61
- ? groupPanelChildren.length - 1
61
+ ? groupPanelChildren.length
62
62
  : 0
63
63
  : _this.getGroupIndex(event);
64
64
  var invalidIndex = !_this.isValid();
@@ -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: 1673512622,
11
+ publishDate: 1673797982,
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-grid",
3
- "version": "3.7.4-dev.202301120847",
3
+ "version": "3.7.4-dev.202301151601",
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.7.4-dev.202301120847"
45
+ "@progress/kendo-vue-common": "3.7.4-dev.202301151601"
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.7.4-dev.202301120847",
53
- "@progress/kendo-vue-buttons": "3.7.4-dev.202301120847",
54
- "@progress/kendo-vue-charts": "3.7.4-dev.202301120847",
55
- "@progress/kendo-vue-data-tools": "3.7.4-dev.202301120847",
56
- "@progress/kendo-vue-dateinputs": "3.7.4-dev.202301120847",
57
- "@progress/kendo-vue-dropdowns": "3.7.4-dev.202301120847",
58
- "@progress/kendo-vue-excel-export": "3.7.4-dev.202301120847",
59
- "@progress/kendo-vue-indicators": "3.7.4-dev.202301120847",
60
- "@progress/kendo-vue-inputs": "3.7.4-dev.202301120847",
61
- "@progress/kendo-vue-intl": "3.7.4-dev.202301120847",
62
- "@progress/kendo-vue-pdf": "3.7.4-dev.202301120847",
63
- "@progress/kendo-vue-popup": "3.7.4-dev.202301120847",
52
+ "@progress/kendo-vue-animation": "3.7.4-dev.202301151601",
53
+ "@progress/kendo-vue-buttons": "3.7.4-dev.202301151601",
54
+ "@progress/kendo-vue-charts": "3.7.4-dev.202301151601",
55
+ "@progress/kendo-vue-data-tools": "3.7.4-dev.202301151601",
56
+ "@progress/kendo-vue-dateinputs": "3.7.4-dev.202301151601",
57
+ "@progress/kendo-vue-dropdowns": "3.7.4-dev.202301151601",
58
+ "@progress/kendo-vue-excel-export": "3.7.4-dev.202301151601",
59
+ "@progress/kendo-vue-indicators": "3.7.4-dev.202301151601",
60
+ "@progress/kendo-vue-inputs": "3.7.4-dev.202301151601",
61
+ "@progress/kendo-vue-intl": "3.7.4-dev.202301151601",
62
+ "@progress/kendo-vue-pdf": "3.7.4-dev.202301151601",
63
+ "@progress/kendo-vue-popup": "3.7.4-dev.202301151601",
64
64
  "cldr-core": "^41.0.0",
65
65
  "cldr-dates-full": "^41.0.0",
66
66
  "cldr-numbers-full": "^41.0.0",