@syncfusion/ej2-dropdowns 22.2.11 → 23.1.36
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/CHANGELOG.md +2 -201
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +1128 -73
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +1182 -69
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -12
- package/src/auto-complete/auto-complete.js +40 -2
- package/src/combo-box/combo-box.js +9 -3
- package/src/common/index.d.ts +2 -0
- package/src/common/index.js +1 -0
- package/src/common/interface.d.ts +76 -0
- package/src/common/interface.js +1 -0
- package/src/common/virtual-scroll.d.ts +61 -0
- package/src/common/virtual-scroll.js +376 -0
- package/src/drop-down-base/drop-down-base.d.ts +10 -4
- package/src/drop-down-base/drop-down-base.js +72 -8
- package/src/drop-down-list/drop-down-list-model.d.ts +8 -1
- package/src/drop-down-list/drop-down-list.d.ts +55 -1
- package/src/drop-down-list/drop-down-list.js +635 -37
- package/src/drop-down-list/index.d.ts +1 -0
- package/src/drop-down-list/index.js +1 -0
- package/src/drop-down-tree/drop-down-tree.d.ts +1 -1
- package/src/drop-down-tree/drop-down-tree.js +2 -4
- package/src/global.js +3 -0
- package/src/mention/mention.js +8 -1
- package/src/multi-select/checkbox-selection.js +1 -1
- package/src/multi-select/multi-select.d.ts +2 -0
- package/src/multi-select/multi-select.js +43 -12
- package/styles/auto-complete/bootstrap-dark.scss +1 -1
- package/styles/auto-complete/bootstrap.scss +1 -1
- package/styles/auto-complete/bootstrap4.scss +1 -1
- package/styles/auto-complete/bootstrap5-dark.scss +1 -1
- package/styles/auto-complete/bootstrap5.scss +1 -1
- package/styles/auto-complete/fabric-dark.scss +1 -1
- package/styles/auto-complete/fabric.scss +1 -1
- package/styles/auto-complete/fluent-dark.scss +1 -1
- package/styles/auto-complete/fluent.scss +1 -1
- package/styles/auto-complete/highcontrast-light.scss +1 -1
- package/styles/auto-complete/highcontrast.scss +1 -1
- package/styles/auto-complete/material-dark.css +0 -1
- package/styles/auto-complete/material-dark.scss +1 -1
- package/styles/auto-complete/material.css +0 -1
- package/styles/auto-complete/material.scss +1 -1
- package/styles/auto-complete/material3-dark.css +0 -1
- package/styles/auto-complete/material3-dark.scss +1 -1
- package/styles/auto-complete/material3.css +0 -1
- package/styles/auto-complete/material3.scss +1 -1
- package/styles/auto-complete/tailwind-dark.css +0 -1
- package/styles/auto-complete/tailwind-dark.scss +1 -1
- package/styles/auto-complete/tailwind.css +0 -1
- package/styles/auto-complete/tailwind.scss +1 -1
- package/styles/bootstrap-dark.css +0 -8
- package/styles/bootstrap.css +0 -8
- package/styles/bootstrap4.css +4 -12
- package/styles/bootstrap5-dark.css +0 -8
- package/styles/bootstrap5.css +0 -8
- package/styles/combo-box/bootstrap-dark.scss +1 -1
- package/styles/combo-box/bootstrap.scss +1 -1
- package/styles/combo-box/bootstrap4.scss +1 -1
- package/styles/combo-box/bootstrap5-dark.scss +1 -1
- package/styles/combo-box/bootstrap5.scss +1 -1
- package/styles/combo-box/fabric-dark.scss +1 -1
- package/styles/combo-box/fabric.scss +1 -1
- package/styles/combo-box/fluent-dark.scss +1 -1
- package/styles/combo-box/fluent.scss +1 -1
- package/styles/combo-box/highcontrast-light.scss +1 -1
- package/styles/combo-box/highcontrast.scss +1 -1
- package/styles/combo-box/material-dark.css +0 -1
- package/styles/combo-box/material-dark.scss +1 -1
- package/styles/combo-box/material.css +0 -1
- package/styles/combo-box/material.scss +1 -1
- package/styles/combo-box/material3-dark.css +0 -1
- package/styles/combo-box/material3-dark.scss +1 -1
- package/styles/combo-box/material3.css +0 -1
- package/styles/combo-box/material3.scss +1 -1
- package/styles/combo-box/tailwind-dark.css +0 -1
- package/styles/combo-box/tailwind-dark.scss +1 -1
- package/styles/combo-box/tailwind.css +0 -1
- package/styles/combo-box/tailwind.scss +1 -1
- package/styles/drop-down-base/bootstrap-dark.scss +1 -1
- package/styles/drop-down-base/bootstrap.scss +1 -1
- package/styles/drop-down-base/bootstrap4.scss +1 -1
- package/styles/drop-down-base/bootstrap5-dark.scss +1 -1
- package/styles/drop-down-base/bootstrap5.scss +1 -1
- package/styles/drop-down-base/fabric-dark.scss +1 -1
- package/styles/drop-down-base/fabric.scss +1 -1
- package/styles/drop-down-base/fluent-dark.scss +1 -1
- package/styles/drop-down-base/fluent.scss +1 -1
- package/styles/drop-down-base/highcontrast-light.scss +1 -1
- package/styles/drop-down-base/highcontrast.scss +1 -1
- package/styles/drop-down-base/material-dark.css +0 -1
- package/styles/drop-down-base/material-dark.scss +1 -1
- package/styles/drop-down-base/material.css +0 -1
- package/styles/drop-down-base/material.scss +1 -1
- package/styles/drop-down-base/material3-dark.css +0 -1
- package/styles/drop-down-base/material3-dark.scss +1 -1
- package/styles/drop-down-base/material3.css +0 -1
- package/styles/drop-down-base/material3.scss +1 -1
- package/styles/drop-down-base/tailwind-dark.css +0 -1
- package/styles/drop-down-base/tailwind-dark.scss +1 -1
- package/styles/drop-down-base/tailwind.css +0 -1
- package/styles/drop-down-base/tailwind.scss +1 -1
- package/styles/drop-down-list/bootstrap-dark.scss +2 -1
- package/styles/drop-down-list/bootstrap.scss +2 -1
- package/styles/drop-down-list/bootstrap4.scss +2 -1
- package/styles/drop-down-list/bootstrap5-dark.scss +2 -1
- package/styles/drop-down-list/bootstrap5.scss +2 -1
- package/styles/drop-down-list/fabric-dark.scss +2 -1
- package/styles/drop-down-list/fabric.scss +2 -1
- package/styles/drop-down-list/fluent-dark.scss +2 -1
- package/styles/drop-down-list/fluent.scss +2 -1
- package/styles/drop-down-list/highcontrast-light.scss +2 -1
- package/styles/drop-down-list/highcontrast.scss +2 -1
- package/styles/drop-down-list/material-dark.css +0 -1
- package/styles/drop-down-list/material-dark.scss +2 -1
- package/styles/drop-down-list/material.css +0 -1
- package/styles/drop-down-list/material.scss +2 -1
- package/styles/drop-down-list/material3-dark.css +0 -1
- package/styles/drop-down-list/material3-dark.scss +2 -1
- package/styles/drop-down-list/material3.css +0 -1
- package/styles/drop-down-list/material3.scss +2 -1
- package/styles/drop-down-list/tailwind-dark.css +0 -1
- package/styles/drop-down-list/tailwind-dark.scss +2 -1
- package/styles/drop-down-list/tailwind.css +0 -1
- package/styles/drop-down-list/tailwind.scss +2 -1
- package/styles/drop-down-tree/bootstrap-dark.scss +1 -1
- package/styles/drop-down-tree/bootstrap.scss +1 -1
- package/styles/drop-down-tree/bootstrap4.scss +1 -1
- package/styles/drop-down-tree/bootstrap5-dark.scss +1 -1
- package/styles/drop-down-tree/bootstrap5.scss +1 -1
- package/styles/drop-down-tree/fabric-dark.scss +1 -1
- package/styles/drop-down-tree/fabric.scss +1 -1
- package/styles/drop-down-tree/fluent-dark.scss +1 -1
- package/styles/drop-down-tree/fluent.scss +1 -1
- package/styles/drop-down-tree/highcontrast-light.scss +1 -1
- package/styles/drop-down-tree/highcontrast.scss +1 -1
- package/styles/drop-down-tree/material-dark.css +0 -1
- package/styles/drop-down-tree/material-dark.scss +1 -1
- package/styles/drop-down-tree/material.css +0 -1
- package/styles/drop-down-tree/material.scss +1 -1
- package/styles/drop-down-tree/material3-dark.css +0 -1
- package/styles/drop-down-tree/material3-dark.scss +1 -1
- package/styles/drop-down-tree/material3.css +0 -1
- package/styles/drop-down-tree/material3.scss +1 -1
- package/styles/drop-down-tree/tailwind-dark.css +0 -1
- package/styles/drop-down-tree/tailwind-dark.scss +1 -1
- package/styles/drop-down-tree/tailwind.css +0 -1
- package/styles/drop-down-tree/tailwind.scss +1 -1
- package/styles/fabric-dark.css +0 -8
- package/styles/fabric.css +0 -8
- package/styles/fluent-dark.css +4 -12
- package/styles/fluent.css +4 -12
- package/styles/highcontrast-light.css +0 -8
- package/styles/highcontrast.css +0 -8
- package/styles/list-box/_bootstrap4-definition.scss +4 -4
- package/styles/list-box/_fluent-definition.scss +4 -4
- package/styles/list-box/_layout.scss +0 -6
- package/styles/list-box/_material3-definition.scss +4 -4
- package/styles/list-box/_tailwind-definition.scss +3 -3
- package/styles/list-box/bootstrap-dark.css +0 -8
- package/styles/list-box/bootstrap-dark.scss +1 -1
- package/styles/list-box/bootstrap.css +0 -8
- package/styles/list-box/bootstrap.scss +1 -1
- package/styles/list-box/bootstrap4.css +4 -12
- package/styles/list-box/bootstrap4.scss +1 -1
- package/styles/list-box/bootstrap5-dark.css +0 -8
- package/styles/list-box/bootstrap5-dark.scss +1 -1
- package/styles/list-box/bootstrap5.css +0 -8
- package/styles/list-box/bootstrap5.scss +1 -1
- package/styles/list-box/fabric-dark.css +0 -8
- package/styles/list-box/fabric-dark.scss +1 -1
- package/styles/list-box/fabric.css +0 -8
- package/styles/list-box/fabric.scss +1 -1
- package/styles/list-box/fluent-dark.css +4 -12
- package/styles/list-box/fluent-dark.scss +1 -1
- package/styles/list-box/fluent.css +4 -12
- package/styles/list-box/fluent.scss +1 -1
- package/styles/list-box/highcontrast-light.css +0 -8
- package/styles/list-box/highcontrast-light.scss +1 -1
- package/styles/list-box/highcontrast.css +0 -8
- package/styles/list-box/highcontrast.scss +1 -1
- package/styles/list-box/material-dark.css +0 -9
- package/styles/list-box/material-dark.scss +1 -1
- package/styles/list-box/material.css +0 -9
- package/styles/list-box/material.scss +1 -1
- package/styles/list-box/material3-dark.css +4 -13
- package/styles/list-box/material3-dark.scss +1 -1
- package/styles/list-box/material3.css +4 -13
- package/styles/list-box/material3.scss +1 -1
- package/styles/list-box/tailwind-dark.css +3 -12
- package/styles/list-box/tailwind-dark.scss +1 -1
- package/styles/list-box/tailwind.css +3 -12
- package/styles/list-box/tailwind.scss +1 -1
- package/styles/material-dark.css +0 -9
- package/styles/material.css +0 -9
- package/styles/material3-dark.css +4 -13
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +4 -13
- package/styles/material3.scss +1 -1
- package/styles/mention/bootstrap-dark.scss +1 -1
- package/styles/mention/bootstrap.scss +1 -1
- package/styles/mention/bootstrap4.scss +1 -1
- package/styles/mention/bootstrap5-dark.scss +1 -1
- package/styles/mention/bootstrap5.scss +1 -1
- package/styles/mention/fabric-dark.scss +1 -1
- package/styles/mention/fabric.scss +1 -1
- package/styles/mention/fluent-dark.scss +1 -1
- package/styles/mention/fluent.scss +1 -1
- package/styles/mention/highcontrast-light.scss +1 -1
- package/styles/mention/highcontrast.scss +1 -1
- package/styles/mention/material-dark.css +0 -1
- package/styles/mention/material-dark.scss +1 -1
- package/styles/mention/material.css +0 -1
- package/styles/mention/material.scss +1 -1
- package/styles/mention/material3-dark.css +0 -1
- package/styles/mention/material3-dark.scss +1 -1
- package/styles/mention/material3.css +0 -1
- package/styles/mention/material3.scss +1 -1
- package/styles/mention/tailwind-dark.css +0 -1
- package/styles/mention/tailwind-dark.scss +1 -1
- package/styles/mention/tailwind.css +0 -1
- package/styles/mention/tailwind.scss +1 -1
- package/styles/multi-select/bootstrap-dark.scss +1 -1
- package/styles/multi-select/bootstrap.scss +1 -1
- package/styles/multi-select/bootstrap4.scss +1 -1
- package/styles/multi-select/bootstrap5-dark.scss +1 -1
- package/styles/multi-select/bootstrap5.scss +1 -1
- package/styles/multi-select/fabric-dark.scss +1 -1
- package/styles/multi-select/fabric.scss +1 -1
- package/styles/multi-select/fluent-dark.scss +1 -1
- package/styles/multi-select/fluent.scss +1 -1
- package/styles/multi-select/highcontrast-light.scss +1 -1
- package/styles/multi-select/highcontrast.scss +1 -1
- package/styles/multi-select/material-dark.css +0 -1
- package/styles/multi-select/material-dark.scss +1 -1
- package/styles/multi-select/material.css +0 -1
- package/styles/multi-select/material.scss +1 -1
- package/styles/multi-select/material3-dark.css +0 -1
- package/styles/multi-select/material3-dark.scss +1 -1
- package/styles/multi-select/material3.css +0 -1
- package/styles/multi-select/material3.scss +1 -1
- package/styles/multi-select/tailwind-dark.css +0 -1
- package/styles/multi-select/tailwind-dark.scss +1 -1
- package/styles/multi-select/tailwind.css +0 -1
- package/styles/multi-select/tailwind.scss +1 -1
- package/styles/tailwind-dark.css +3 -19
- package/styles/tailwind.css +3 -19
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Animation, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, append, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getComponent, getUniqueID, getValue, isNullOrUndefined, isUndefined, matches, prepend, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Animation, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, attributes, classList, closest, compile, createElement, debounce, detach, extend, formatUnit, getComponent, getUniqueID, getValue, isNullOrUndefined, isUndefined, matches, prepend, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
|
|
2
2
|
import { DataManager, DataUtil, JsonAdaptor, Predicate, Query } from '@syncfusion/ej2-data';
|
|
3
3
|
import { ListBase, Sortable, cssClass, moveTo } from '@syncfusion/ej2-lists';
|
|
4
4
|
import { Popup, createSpinner, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
|
|
5
5
|
import { Input, TextBox } from '@syncfusion/ej2-inputs';
|
|
6
|
+
import { Skeleton } from '@syncfusion/ej2-notifications';
|
|
6
7
|
import { Button, createCheckBox } from '@syncfusion/ej2-buttons';
|
|
7
8
|
import { TreeView } from '@syncfusion/ej2-navigations';
|
|
8
9
|
|
|
@@ -194,6 +195,379 @@ function revertHighlightSearch(content) {
|
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
|
|
198
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
199
|
+
__assign = Object.assign || function(t) {
|
|
200
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
201
|
+
s = arguments[i];
|
|
202
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
203
|
+
t[p] = s[p];
|
|
204
|
+
}
|
|
205
|
+
return t;
|
|
206
|
+
};
|
|
207
|
+
return __assign.apply(this, arguments);
|
|
208
|
+
};
|
|
209
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
210
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
211
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
212
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
213
|
+
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
214
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
218
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
219
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
220
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
221
|
+
function step(op) {
|
|
222
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
223
|
+
while (_) try {
|
|
224
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
225
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
226
|
+
switch (op[0]) {
|
|
227
|
+
case 0: case 1: t = op; break;
|
|
228
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
229
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
230
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
231
|
+
default:
|
|
232
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
233
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
234
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
235
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
236
|
+
if (t[2]) _.ops.pop();
|
|
237
|
+
_.trys.pop(); continue;
|
|
238
|
+
}
|
|
239
|
+
op = body.call(thisArg, _);
|
|
240
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
241
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
245
|
+
function VirtualScroll(parent) {
|
|
246
|
+
var _this = this;
|
|
247
|
+
this.sentinelInfo = {
|
|
248
|
+
'up': {
|
|
249
|
+
check: function (rect, info) {
|
|
250
|
+
var top = rect.top - _this.containerElementRect.top;
|
|
251
|
+
info.entered = top >= 0;
|
|
252
|
+
return top + (_this.parent.listItemHeight * _this.parent.virtualItemCount / 2) >= 0;
|
|
253
|
+
},
|
|
254
|
+
axis: 'Y'
|
|
255
|
+
},
|
|
256
|
+
'down': {
|
|
257
|
+
check: function (rect, info) {
|
|
258
|
+
var cHeight = _this.parent.popupContentElement.clientHeight;
|
|
259
|
+
var top = rect.bottom;
|
|
260
|
+
info.entered = rect.bottom <= _this.containerElementRect.bottom;
|
|
261
|
+
return top - (_this.parent.listItemHeight * _this.parent.virtualItemCount / 2) <= _this.parent.listItemHeight * _this.parent.virtualItemCount / 2;
|
|
262
|
+
}, axis: 'Y'
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
this.parent = parent;
|
|
266
|
+
this.removeEventListener();
|
|
267
|
+
this.addEventListener();
|
|
268
|
+
}
|
|
269
|
+
VirtualScroll.prototype.addEventListener = function () {
|
|
270
|
+
if (this.parent.isDestroyed) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
this.parent.on('observe', this.observe, this);
|
|
274
|
+
this.parent.on('setGeneratedData', this.setGeneratedData, this);
|
|
275
|
+
this.parent.on('dataProcessAsync', this.dataProcessAsync, this);
|
|
276
|
+
this.parent.on('setCurrentViewDataAsync', this.setCurrentViewDataAsync, this);
|
|
277
|
+
this.parent.on('bindScrollEvent', this.bindScrollEvent, this);
|
|
278
|
+
};
|
|
279
|
+
VirtualScroll.prototype.removeEventListener = function () {
|
|
280
|
+
if (this.parent.isDestroyed) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
this.parent.off('observe', this.observe);
|
|
284
|
+
this.parent.off('setGeneratedData', this.setGeneratedData);
|
|
285
|
+
this.parent.off('dataProcessAsync', this.dataProcessAsync);
|
|
286
|
+
this.parent.off('setCurrentViewDataAsync', this.setCurrentViewDataAsync);
|
|
287
|
+
this.parent.off('bindScrollEvent', this.bindScrollEvent);
|
|
288
|
+
};
|
|
289
|
+
VirtualScroll.prototype.bindScrollEvent = function (component) {
|
|
290
|
+
var _this = this;
|
|
291
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
292
|
+
this.component = component.component;
|
|
293
|
+
this.observe(function (scrollArgs) { return _this.scrollListener(scrollArgs); });
|
|
294
|
+
};
|
|
295
|
+
VirtualScroll.prototype.observe = function (callback) {
|
|
296
|
+
this.containerElementRect = this.parent.popupContentElement.getBoundingClientRect();
|
|
297
|
+
EventHandler.add(this.parent.popupContentElement, 'wheel mousedown', this.popupScrollHandler, this);
|
|
298
|
+
this.touchModule = new Touch(this.parent.popupContentElement, {
|
|
299
|
+
scroll: this.popupScrollHandler.bind(this)
|
|
300
|
+
});
|
|
301
|
+
EventHandler.add(this.parent.popupContentElement, 'scroll', this.virtualScrollHandler(callback), this);
|
|
302
|
+
};
|
|
303
|
+
VirtualScroll.prototype.getModuleName = function () {
|
|
304
|
+
return 'VirtualScroll';
|
|
305
|
+
};
|
|
306
|
+
VirtualScroll.prototype.popupScrollHandler = function (e) {
|
|
307
|
+
this.parent.isMouseScrollAction = true;
|
|
308
|
+
this.parent.isPreventScrollAction = false;
|
|
309
|
+
};
|
|
310
|
+
VirtualScroll.prototype.getPageQuery = function (query, virtualStartIndex, virtualEndIndex) {
|
|
311
|
+
if (virtualEndIndex !== 0 && !this.parent.allowFiltering && this.component !== 'autocomplete') {
|
|
312
|
+
query = query.skip(virtualStartIndex);
|
|
313
|
+
}
|
|
314
|
+
return query;
|
|
315
|
+
};
|
|
316
|
+
VirtualScroll.prototype.setGeneratedData = function (qStartIndex, recentlyGeneratedData) {
|
|
317
|
+
var loopIteration = 0;
|
|
318
|
+
var endIndex = this.parent.listData.length + this.parent.virtualItemStartIndex;
|
|
319
|
+
for (var i = this.parent.virtualItemStartIndex; i < endIndex; i++) {
|
|
320
|
+
var alreadyAddedData = this.parent.generatedDataObject[i];
|
|
321
|
+
if (!alreadyAddedData) {
|
|
322
|
+
if (recentlyGeneratedData !== null && this.parent.listData.slice(loopIteration, loopIteration + 1).length > 0) {
|
|
323
|
+
var slicedData = this.parent.listData.slice(loopIteration, loopIteration + 1);
|
|
324
|
+
if (slicedData.length > 0) {
|
|
325
|
+
// Safely assign slicedData to this.parent.generatedDataObject[i]
|
|
326
|
+
this.parent.generatedDataObject[i] = slicedData;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
loopIteration++;
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
VirtualScroll.prototype.generateAndExecuteQueryAsync = function (query, virtualItemStartIndex, virtualItemEndIndex, isQueryGenerated) {
|
|
334
|
+
if (virtualItemStartIndex === void 0) { virtualItemStartIndex = 0; }
|
|
335
|
+
if (virtualItemEndIndex === void 0) { virtualItemEndIndex = 0; }
|
|
336
|
+
if (isQueryGenerated === void 0) { isQueryGenerated = false; }
|
|
337
|
+
var dataSource = this.parent.dataSource;
|
|
338
|
+
if (!isQueryGenerated) {
|
|
339
|
+
query = this.getPageQuery(query, virtualItemStartIndex, virtualItemEndIndex);
|
|
340
|
+
}
|
|
341
|
+
this.parent.resetList(dataSource, this.parent.fields, query);
|
|
342
|
+
};
|
|
343
|
+
VirtualScroll.prototype.setCurrentViewDataAsync = function () {
|
|
344
|
+
// eslint-disable-next-line
|
|
345
|
+
var currentData = [];
|
|
346
|
+
for (var i = this.parent.viewPortInfo.startIndex; i < this.parent.viewPortInfo.endIndex; i++) {
|
|
347
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
348
|
+
var alreadyAddedData = this.parent.generatedDataObject[i];
|
|
349
|
+
if (alreadyAddedData) {
|
|
350
|
+
currentData.push(alreadyAddedData[0]);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
this.parent.renderItems(currentData, this.parent.fields);
|
|
354
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
355
|
+
var virtualTrackElement = this.parent.list.getElementsByClassName('e-virtual-ddl')[0];
|
|
356
|
+
if (virtualTrackElement) {
|
|
357
|
+
(virtualTrackElement).style = this.parent.GetVirtualTrackHeight();
|
|
358
|
+
}
|
|
359
|
+
this.parent.UpdateSkeleton();
|
|
360
|
+
this.parent.liCollections = this.parent.list.querySelectorAll('.e-list-item');
|
|
361
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
362
|
+
var virtualContentElement = this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0];
|
|
363
|
+
if (virtualContentElement) {
|
|
364
|
+
(virtualContentElement).style = this.parent.getTransformValues();
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
VirtualScroll.prototype.generateQueryAndSetQueryIndexAsync = function (query, isPopupOpen) {
|
|
368
|
+
var isStartIndexInitialised = false;
|
|
369
|
+
var queryStartIndex = 0;
|
|
370
|
+
var queryEndIndex = 0;
|
|
371
|
+
var sortedDataStartIndex = 0;
|
|
372
|
+
var vEndIndex = this.parent && this.parent.viewPortInfo.endIndex !== 0 ? this.parent.viewPortInfo.endIndex : sortedDataStartIndex + this.parent.getItems().length;
|
|
373
|
+
if (!isPopupOpen && vEndIndex !== 0) {
|
|
374
|
+
for (var i = this.parent.viewPortInfo.startIndex; i <= vEndIndex; i++) {
|
|
375
|
+
if (!(i in this.parent.generatedDataObject)) {
|
|
376
|
+
if (!isStartIndexInitialised) {
|
|
377
|
+
isStartIndexInitialised = true;
|
|
378
|
+
queryStartIndex = queryEndIndex = i;
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
queryEndIndex = i === vEndIndex ? i : i + 1;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
if (isStartIndexInitialised && !((this.parent.totalItemCount == queryStartIndex) && (this.parent.totalItemCount == queryEndIndex))) {
|
|
387
|
+
this.parent.virtualItemStartIndex = queryStartIndex;
|
|
388
|
+
this.parent.virtualItemEndIndex = queryEndIndex;
|
|
389
|
+
this.generateAndExecuteQueryAsync(query, queryStartIndex, queryEndIndex);
|
|
390
|
+
}
|
|
391
|
+
this.setCurrentViewDataAsync();
|
|
392
|
+
};
|
|
393
|
+
VirtualScroll.prototype.dataProcessAsync = function (isOpenPopup) {
|
|
394
|
+
this.parent.selectedValueInfo = null;
|
|
395
|
+
this.parent.virtualItemStartIndex = this.parent.viewPortInfo.startIndex;
|
|
396
|
+
this.parent.virtualItemEndIndex = this.parent.viewPortInfo.endIndex;
|
|
397
|
+
this.generateQueryAndSetQueryIndexAsync(new Query(), isOpenPopup);
|
|
398
|
+
};
|
|
399
|
+
VirtualScroll.prototype.virtualScrollRefreshAsync = function () {
|
|
400
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
401
|
+
return __generator(this, function (_a) {
|
|
402
|
+
switch (_a.label) {
|
|
403
|
+
case 0:
|
|
404
|
+
this.parent.isCustomFilter = (!(this.parent.isTyped || (this.component === 'combobox' && this.parent.allowFiltering && this.parent.queryString != this.parent.typedString) || (!isNullOrUndefined(this.parent.filterInput) && !isNullOrUndefined(this.parent.filterInput.value) && this.parent.filterInput.value !== '') && this.component !== 'combobox') && !(this.component === 'autocomplete' && this.parent.value != null)) || this.parent.isCustomFilter;
|
|
405
|
+
if (this.parent.allowFiltering || this.component === 'autocomplete') {
|
|
406
|
+
if (!isNullOrUndefined(this.parent.typedString) && !(this.component === 'combobox' && !isNullOrUndefined(this.parent.typedString) && this.parent.allowFiltering)) {
|
|
407
|
+
if (this.parent.viewPortInfo.endIndex >= this.parent.dataCount) {
|
|
408
|
+
this.parent.viewPortInfo.endIndex = this.parent.dataCount;
|
|
409
|
+
}
|
|
410
|
+
if (this.parent.viewPortInfo.startIndex >= this.parent.dataCount) {
|
|
411
|
+
this.parent.viewPortInfo.startIndex = this.parent.dataCount - this.parent.itemCount;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
this.parent.getSkeletonCount(true);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return [4 /*yield*/, this.dataProcessAsync()];
|
|
419
|
+
case 1:
|
|
420
|
+
_a.sent();
|
|
421
|
+
if (this.parent.keyboardEvent != null) {
|
|
422
|
+
this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
|
|
423
|
+
}
|
|
424
|
+
this.parent.isCustomFilter = false;
|
|
425
|
+
return [2 /*return*/];
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
});
|
|
429
|
+
};
|
|
430
|
+
VirtualScroll.prototype.scrollListener = function (scrollArgs) {
|
|
431
|
+
var _this = this;
|
|
432
|
+
if (!this.parent.isPreventScrollAction) {
|
|
433
|
+
var info = scrollArgs.sentinel;
|
|
434
|
+
var pStartIndex = this.parent.previousStartIndex;
|
|
435
|
+
this.parent.viewPortInfo = this.getInfoFromView(scrollArgs.direction, info, scrollArgs.offset, false);
|
|
436
|
+
this.parent.isUpwardScrolling = false;
|
|
437
|
+
if (this.parent.previousStartIndex !== pStartIndex && !this.parent.isKeyBoardAction) {
|
|
438
|
+
this.parent.isScrollActionTriggered = false;
|
|
439
|
+
this.parent.currentPageNumber = this.parent.viewPortInfo.currentPageNumber;
|
|
440
|
+
this.parent.virtualListInfo = __assign({}, this.parent.viewPortInfo);
|
|
441
|
+
this.parent.isPreventKeyAction = true;
|
|
442
|
+
this.parent.isVirtualScrolling = true;
|
|
443
|
+
setTimeout(function () {
|
|
444
|
+
_this.parent.pageCount = _this.parent.getPageCount();
|
|
445
|
+
_this.virtualScrollRefreshAsync().then(function () {
|
|
446
|
+
if (_this.parent.popupObj) {
|
|
447
|
+
_this.parent.list = _this.parent.popupObj.element.querySelector('.' + 'e-content') || select('.' + 'e-content');
|
|
448
|
+
_this.parent.updateSelectionList();
|
|
449
|
+
_this.parent.liCollections = _this.parent.getItems();
|
|
450
|
+
}
|
|
451
|
+
_this.parent.isKeyBoardAction = false;
|
|
452
|
+
_this.parent.isVirtualScrolling = false;
|
|
453
|
+
_this.parent.isPreventKeyAction = false;
|
|
454
|
+
});
|
|
455
|
+
}, 5);
|
|
456
|
+
}
|
|
457
|
+
else if (this.parent.isScrollActionTriggered) {
|
|
458
|
+
this.parent.isPreventKeyAction = false;
|
|
459
|
+
this.parent.isScrollActionTriggered = false;
|
|
460
|
+
var virtualListCount = this.parent.list.querySelectorAll('.e-virtual-list').length;
|
|
461
|
+
var listElement = this.parent.list.querySelector('.' + 'e-list-item');
|
|
462
|
+
var translateY = scrollArgs.offset.top - (listElement.offsetHeight * virtualListCount);
|
|
463
|
+
this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0].style.transform = "translate(0px," + translateY + "px)";
|
|
464
|
+
}
|
|
465
|
+
this.parent.previousInfo = this.parent.viewPortInfo;
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
VirtualScroll.prototype.getPageCount = function (popupElement, returnExactCount) {
|
|
469
|
+
if (returnExactCount === void 0) { returnExactCount = false; }
|
|
470
|
+
var list = popupElement && popupElement.querySelector('.e-content');
|
|
471
|
+
if (list) {
|
|
472
|
+
var liHeight = list.classList.contains('e-nodata') ? null : getComputedStyle(list.querySelectorAll('.e-list-item')[0], null).getPropertyValue('height');
|
|
473
|
+
var pageCount = list.getBoundingClientRect().height / parseInt(liHeight, 10);
|
|
474
|
+
return returnExactCount ? pageCount : Math.round(pageCount);
|
|
475
|
+
}
|
|
476
|
+
return 0;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
VirtualScroll.prototype.getRowHeight = function () {
|
|
480
|
+
return (isNullOrUndefined(this.parent.liCollections) || this.parent.liCollections.length == 0) ? 0 : Math.ceil(this.parent.liCollections[0].getBoundingClientRect().height);
|
|
481
|
+
};
|
|
482
|
+
VirtualScroll.prototype.getInfoFromView = function (direction, info, e, isscrollAction) {
|
|
483
|
+
var infoType = {
|
|
484
|
+
direction: direction, sentinelInfo: info, offsets: e,
|
|
485
|
+
startIndex: this.parent.previousStartIndex, endIndex: this.parent.previousEndIndex
|
|
486
|
+
};
|
|
487
|
+
var vHeight = this.parent.popupContentElement.getBoundingClientRect().height;
|
|
488
|
+
//Row Start and End Index calculation
|
|
489
|
+
var rowHeight = this.parent.listItemHeight;
|
|
490
|
+
var exactTopIndex = e.top / rowHeight;
|
|
491
|
+
var infoViewIndices = vHeight / rowHeight;
|
|
492
|
+
var exactEndIndex = exactTopIndex + infoViewIndices;
|
|
493
|
+
var pageSizeBy4 = this.parent.virtualItemCount / 4;
|
|
494
|
+
var totalItemCount = this.parent.totalItemCount;
|
|
495
|
+
if (infoType.direction === 'down') {
|
|
496
|
+
var sIndex = Math.round(exactEndIndex) - Math.round((pageSizeBy4));
|
|
497
|
+
if (isNullOrUndefined(infoType.startIndex) || (exactEndIndex >
|
|
498
|
+
(infoType.startIndex + Math.round((this.parent.virtualItemCount / 2 + pageSizeBy4)))
|
|
499
|
+
&& infoType.endIndex !== totalItemCount)) {
|
|
500
|
+
infoType.startIndex = sIndex >= 0 ? Math.round(sIndex) : 0;
|
|
501
|
+
infoType.startIndex = infoType.startIndex > exactTopIndex ? Math.floor(exactTopIndex) : infoType.startIndex;
|
|
502
|
+
var eIndex = infoType.startIndex + this.parent.virtualItemCount;
|
|
503
|
+
infoType.startIndex = eIndex < exactEndIndex ? (Math.ceil(exactEndIndex) - this.parent.virtualItemCount)
|
|
504
|
+
: infoType.startIndex;
|
|
505
|
+
infoType.endIndex = eIndex < totalItemCount ? eIndex : totalItemCount;
|
|
506
|
+
infoType.startIndex = eIndex >= totalItemCount ? (infoType.endIndex - this.parent.virtualItemCount > 0 ? infoType.endIndex - this.parent.virtualItemCount : 0) : infoType.startIndex;
|
|
507
|
+
infoType.currentPageNumber = Math.ceil(infoType.endIndex / this.parent.virtualItemCount);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
else if (infoType.direction === 'up') {
|
|
511
|
+
if (infoType.startIndex && infoType.endIndex) {
|
|
512
|
+
var loadAtIndex = Math.round(((infoType.startIndex * rowHeight) + (pageSizeBy4 * rowHeight)) / rowHeight);
|
|
513
|
+
if (exactTopIndex < loadAtIndex) {
|
|
514
|
+
var idxAddedToExactTop = (pageSizeBy4) > infoViewIndices ? pageSizeBy4 :
|
|
515
|
+
(infoViewIndices + infoViewIndices / 4);
|
|
516
|
+
var eIndex = Math.round(exactTopIndex + idxAddedToExactTop);
|
|
517
|
+
infoType.endIndex = eIndex < totalItemCount ? eIndex : totalItemCount;
|
|
518
|
+
var sIndex = infoType.endIndex - this.parent.virtualItemCount;
|
|
519
|
+
infoType.startIndex = sIndex > 0 ? sIndex : 0;
|
|
520
|
+
infoType.endIndex = sIndex < 0 ? this.parent.virtualItemCount : infoType.endIndex;
|
|
521
|
+
infoType.currentPageNumber = Math.ceil(infoType.startIndex / this.parent.virtualItemCount);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (!isscrollAction) {
|
|
526
|
+
this.parent.previousStartIndex = infoType.startIndex;
|
|
527
|
+
this.parent.startIndex = infoType.startIndex;
|
|
528
|
+
this.parent.previousEndIndex = infoType.endIndex;
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
this.parent.scrollPreStartIndex = infoType.startIndex;
|
|
532
|
+
}
|
|
533
|
+
return infoType;
|
|
534
|
+
};
|
|
535
|
+
VirtualScroll.prototype.virtualScrollHandler = function (callback) {
|
|
536
|
+
var _this = this;
|
|
537
|
+
var delay = Browser.info.name === 'chrome' ? 200 : 100;
|
|
538
|
+
var prevTop = 0;
|
|
539
|
+
var debounced100 = debounce(callback, delay);
|
|
540
|
+
var debounced50 = debounce(callback, 50);
|
|
541
|
+
return function (e) {
|
|
542
|
+
var top = e.target.scrollTop;
|
|
543
|
+
var left = e.target.scrollLeft;
|
|
544
|
+
var direction = prevTop < top && !_this.parent.isUpwardScrolling ? 'down' : 'up';
|
|
545
|
+
prevTop = top;
|
|
546
|
+
var current = _this.sentinelInfo[direction];
|
|
547
|
+
var pstartIndex = _this.parent.scrollPreStartIndex;
|
|
548
|
+
var scrollOffsetargs = {
|
|
549
|
+
top: top,
|
|
550
|
+
left: left
|
|
551
|
+
};
|
|
552
|
+
if (_this.parent.list.querySelectorAll('.e-virtual-list').length > 0) {
|
|
553
|
+
var infoview = _this.getInfoFromView(direction, current, scrollOffsetargs, true);
|
|
554
|
+
if (_this.parent.scrollPreStartIndex != pstartIndex && !_this.parent.isPreventScrollAction) {
|
|
555
|
+
_this.parent.isScrollActionTriggered = true;
|
|
556
|
+
var virtualPoup = (_this.parent.list.querySelector('.e-virtual-ddl-content'));
|
|
557
|
+
virtualPoup.style.transform = "translate(0px," + top + "px)";
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
var debounceFunction = debounced100;
|
|
561
|
+
if (current.axis === 'X') {
|
|
562
|
+
debounceFunction = debounced50;
|
|
563
|
+
}
|
|
564
|
+
debounceFunction({ direction: direction, sentinel: current, offset: { top: top, left: left },
|
|
565
|
+
focusElement: document.activeElement });
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
return VirtualScroll;
|
|
569
|
+
}());
|
|
570
|
+
|
|
197
571
|
/**
|
|
198
572
|
* Common source
|
|
199
573
|
*/
|
|
@@ -284,6 +658,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
284
658
|
_this.addedNewItem = false;
|
|
285
659
|
_this.isAddNewItemTemplate = false;
|
|
286
660
|
_this.isRequesting = false;
|
|
661
|
+
_this.isVirtualizationEnabled = false;
|
|
662
|
+
_this.isAllowFiltering = false;
|
|
663
|
+
_this.virtualizedItemsCount = 0;
|
|
664
|
+
_this.totalItemCount = 0;
|
|
665
|
+
_this.dataCount = 0;
|
|
287
666
|
return _this;
|
|
288
667
|
}
|
|
289
668
|
DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
|
|
@@ -688,11 +1067,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
688
1067
|
_this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
|
|
689
1068
|
_this.trigger('actionComplete', e, function (e) {
|
|
690
1069
|
if (!e.cancel) {
|
|
691
|
-
_this.isRequesting = false;
|
|
692
1070
|
var listItems = e.result;
|
|
693
1071
|
if (listItems.length === 0) {
|
|
694
1072
|
_this.isDataFetched = true;
|
|
695
1073
|
}
|
|
1074
|
+
_this.dataCount = e.count;
|
|
1075
|
+
_this.totalItemCount = e.count;
|
|
696
1076
|
ulElement = _this.renderItems(listItems, fields);
|
|
697
1077
|
_this.onActionComplete(ulElement, listItems, e);
|
|
698
1078
|
if (_this.groupTemplate) {
|
|
@@ -701,6 +1081,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
701
1081
|
_this.isRequested = false;
|
|
702
1082
|
_this.bindChildItems(listItems, ulElement, fields, e);
|
|
703
1083
|
}
|
|
1084
|
+
_this.isRequesting = false;
|
|
704
1085
|
});
|
|
705
1086
|
}).catch(function (e) {
|
|
706
1087
|
_this.isRequested = false;
|
|
@@ -710,13 +1091,19 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
710
1091
|
});
|
|
711
1092
|
}
|
|
712
1093
|
else {
|
|
1094
|
+
_this.isRequesting = false;
|
|
713
1095
|
var dataManager = new DataManager(eventArgs.data);
|
|
714
1096
|
var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
|
|
1097
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1098
|
+
_this.dataCount = listItems.count;
|
|
1099
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1100
|
+
_this.totalItemCount = listItems.count;
|
|
1101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1102
|
+
listItems = _this.isVirtualizationEnabled ? listItems.result : listItems;
|
|
715
1103
|
var localDataArgs = { cancel: false, result: listItems };
|
|
716
1104
|
_this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
|
|
717
1105
|
_this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
|
|
718
1106
|
if (!localDataArgs.cancel) {
|
|
719
|
-
_this.isRequesting = false;
|
|
720
1107
|
ulElement = _this.renderItems(localDataArgs.result, fields);
|
|
721
1108
|
_this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
722
1109
|
if (_this.groupTemplate) {
|
|
@@ -810,6 +1197,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
810
1197
|
DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
|
|
811
1198
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
812
1199
|
this.listData = list;
|
|
1200
|
+
if (this.isVirtualizationEnabled) {
|
|
1201
|
+
this.notify("setGeneratedData", {
|
|
1202
|
+
module: "VirtualScroll",
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
813
1205
|
if (this.getModuleName() !== 'listbox') {
|
|
814
1206
|
ulElement.setAttribute('tabindex', '0');
|
|
815
1207
|
}
|
|
@@ -828,11 +1220,13 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
828
1220
|
}
|
|
829
1221
|
}
|
|
830
1222
|
if (!isNullOrUndefined(this.list)) {
|
|
831
|
-
this.
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
1223
|
+
if (!this.isVirtualizationEnabled) {
|
|
1224
|
+
this.list.innerHTML = '';
|
|
1225
|
+
this.list.appendChild(ulElement);
|
|
1226
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1227
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1228
|
+
this.postRender(this.list, list, this.bindEvent);
|
|
1229
|
+
}
|
|
836
1230
|
}
|
|
837
1231
|
};
|
|
838
1232
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -860,6 +1254,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
860
1254
|
DropDownBase.prototype.getQuery = function (query) {
|
|
861
1255
|
return query ? query : this.query ? this.query : new Query();
|
|
862
1256
|
};
|
|
1257
|
+
DropDownBase.prototype.updateVirtualizationProperties = function (itemCount, filtering) {
|
|
1258
|
+
this.isVirtualizationEnabled = true;
|
|
1259
|
+
this.virtualizedItemsCount = itemCount;
|
|
1260
|
+
this.isAllowFiltering = filtering;
|
|
1261
|
+
};
|
|
863
1262
|
/**
|
|
864
1263
|
* To render the template content for group header element.
|
|
865
1264
|
*
|
|
@@ -998,9 +1397,47 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
998
1397
|
new DataManager(dataSource).executeLocal(new Query().take(100))
|
|
999
1398
|
: dataSource;
|
|
1000
1399
|
ulElement = this.templateListItem((this.getModuleName() === 'autocomplete') ? spliceData : dataSource, fields);
|
|
1400
|
+
if (this.isVirtualizationEnabled) {
|
|
1401
|
+
var oldUlElement = this.list.querySelector('.e-list-parent');
|
|
1402
|
+
var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
1403
|
+
if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
|
|
1404
|
+
virtualUlElement.replaceChild(ulElement, oldUlElement);
|
|
1405
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1406
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1407
|
+
this.listData = listData;
|
|
1408
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1409
|
+
}
|
|
1410
|
+
else if ((!virtualUlElement)) {
|
|
1411
|
+
this.list.innerHTML = '';
|
|
1412
|
+
this.list.appendChild(ulElement);
|
|
1413
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1414
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1415
|
+
this.listData = listData;
|
|
1416
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1001
1419
|
}
|
|
1002
1420
|
else {
|
|
1003
1421
|
ulElement = this.createListItems(listData, fields);
|
|
1422
|
+
if (this.isVirtualizationEnabled) {
|
|
1423
|
+
var oldUlElement = this.list.querySelector('.e-list-parent');
|
|
1424
|
+
var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
1425
|
+
if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
|
|
1426
|
+
virtualUlElement.replaceChild(ulElement, oldUlElement);
|
|
1427
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1428
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1429
|
+
this.listData = listData;
|
|
1430
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1431
|
+
}
|
|
1432
|
+
else if ((!virtualUlElement)) {
|
|
1433
|
+
this.list.innerHTML = '';
|
|
1434
|
+
this.list.appendChild(ulElement);
|
|
1435
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1436
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1437
|
+
this.listData = listData;
|
|
1438
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1004
1441
|
}
|
|
1005
1442
|
return ulElement;
|
|
1006
1443
|
};
|
|
@@ -1140,7 +1577,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1140
1577
|
}
|
|
1141
1578
|
};
|
|
1142
1579
|
DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
|
|
1143
|
-
if (isFiltering && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {
|
|
1580
|
+
if ((isFiltering || this.isVirtualizationEnabled) && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {
|
|
1144
1581
|
this.selectData = this.listData;
|
|
1145
1582
|
}
|
|
1146
1583
|
};
|
|
@@ -1154,6 +1591,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1154
1591
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1155
1592
|
DropDownBase.prototype.updateDataSource = function (props) {
|
|
1156
1593
|
this.resetList(this.dataSource);
|
|
1594
|
+
this.totalItemCount = this.dataSource instanceof DataManager ? this.dataSource.dataSource.json.length : 0;
|
|
1157
1595
|
};
|
|
1158
1596
|
DropDownBase.prototype.setUpdateInitial = function (props, newProp) {
|
|
1159
1597
|
this.isDataFetched = false;
|
|
@@ -1587,6 +2025,7 @@ var dropDownListClasses = {
|
|
|
1587
2025
|
disable: dropDownBaseClasses.disabled,
|
|
1588
2026
|
base: dropDownBaseClasses.root,
|
|
1589
2027
|
focus: dropDownBaseClasses.focus,
|
|
2028
|
+
content: dropDownBaseClasses.content,
|
|
1590
2029
|
input: 'e-input-group',
|
|
1591
2030
|
inputFocus: 'e-input-focus',
|
|
1592
2031
|
icon: 'e-input-group-icon e-ddl-icon',
|
|
@@ -1604,7 +2043,8 @@ var dropDownListClasses = {
|
|
|
1604
2043
|
clearIconHide: 'e-clear-icon-hide',
|
|
1605
2044
|
popupFullScreen: 'e-popup-full-page',
|
|
1606
2045
|
disableIcon: 'e-ddl-disable-icon',
|
|
1607
|
-
hiddenElement: 'e-ddl-hidden'
|
|
2046
|
+
hiddenElement: 'e-ddl-hidden',
|
|
2047
|
+
virtualList: 'e-list-item e-virtual-list',
|
|
1608
2048
|
};
|
|
1609
2049
|
var inputObject = {
|
|
1610
2050
|
container: null,
|
|
@@ -1632,9 +2072,52 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1632
2072
|
*/
|
|
1633
2073
|
function DropDownList(options, element) {
|
|
1634
2074
|
var _this = _super.call(this, options, element) || this;
|
|
2075
|
+
_this.skeletonCount = 32;
|
|
1635
2076
|
_this.isListSearched = false;
|
|
1636
2077
|
_this.preventChange = false;
|
|
1637
2078
|
_this.isAngular = false;
|
|
2079
|
+
_this.itemCount = 10;
|
|
2080
|
+
_this.virtualListHeight = 0;
|
|
2081
|
+
_this.isVirtualScrolling = false;
|
|
2082
|
+
_this.isPreventScrollAction = false;
|
|
2083
|
+
_this.scrollPreStartIndex = 0;
|
|
2084
|
+
_this.isScrollActionTriggered = false;
|
|
2085
|
+
_this.previousStartIndex = 0;
|
|
2086
|
+
_this.isMouseScrollAction = false;
|
|
2087
|
+
_this.isKeyBoardAction = false;
|
|
2088
|
+
_this.isUpwardScrolling = false;
|
|
2089
|
+
_this.startIndex = 0;
|
|
2090
|
+
_this.currentPageNumber = 0;
|
|
2091
|
+
_this.pageCount = 0;
|
|
2092
|
+
_this.isPreventKeyAction = false;
|
|
2093
|
+
_this.generatedDataObject = {};
|
|
2094
|
+
_this.virtualListInfo = {
|
|
2095
|
+
currentPageNumber: null,
|
|
2096
|
+
direction: null,
|
|
2097
|
+
sentinelInfo: {},
|
|
2098
|
+
offsets: {},
|
|
2099
|
+
startIndex: 0,
|
|
2100
|
+
endIndex: 0,
|
|
2101
|
+
};
|
|
2102
|
+
_this.viewPortInfo = {
|
|
2103
|
+
currentPageNumber: null,
|
|
2104
|
+
direction: null,
|
|
2105
|
+
sentinelInfo: {},
|
|
2106
|
+
offsets: {},
|
|
2107
|
+
startIndex: 0,
|
|
2108
|
+
endIndex: 0,
|
|
2109
|
+
};
|
|
2110
|
+
_this.selectedValueInfo = {
|
|
2111
|
+
currentPageNumber: null,
|
|
2112
|
+
direction: null,
|
|
2113
|
+
sentinelInfo: {},
|
|
2114
|
+
offsets: {},
|
|
2115
|
+
startIndex: 0,
|
|
2116
|
+
endIndex: 0,
|
|
2117
|
+
};
|
|
2118
|
+
_this.IsScrollerAtEnd = function () {
|
|
2119
|
+
return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
|
|
2120
|
+
};
|
|
1638
2121
|
return _this;
|
|
1639
2122
|
}
|
|
1640
2123
|
/**
|
|
@@ -1693,14 +2176,31 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1693
2176
|
hide: 'alt+38',
|
|
1694
2177
|
space: '32'
|
|
1695
2178
|
};
|
|
2179
|
+
this.viewPortInfo = {
|
|
2180
|
+
currentPageNumber: null,
|
|
2181
|
+
direction: null,
|
|
2182
|
+
sentinelInfo: {},
|
|
2183
|
+
offsets: {},
|
|
2184
|
+
startIndex: 0,
|
|
2185
|
+
endIndex: this.itemCount,
|
|
2186
|
+
};
|
|
1696
2187
|
};
|
|
1697
2188
|
DropDownList.prototype.setZIndex = function () {
|
|
1698
2189
|
if (this.popupObj) {
|
|
1699
2190
|
this.popupObj.setProperties({ 'zIndex': this.zIndex });
|
|
1700
2191
|
}
|
|
1701
2192
|
};
|
|
2193
|
+
DropDownList.prototype.requiredModules = function () {
|
|
2194
|
+
var modules = [];
|
|
2195
|
+
if (this.enableVirtualization) {
|
|
2196
|
+
modules.push({ args: [this], member: 'VirtualScroll' });
|
|
2197
|
+
}
|
|
2198
|
+
return modules;
|
|
2199
|
+
};
|
|
1702
2200
|
DropDownList.prototype.renderList = function (e, isEmptyData) {
|
|
1703
2201
|
_super.prototype.render.call(this, e, isEmptyData);
|
|
2202
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2203
|
+
this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
1704
2204
|
this.unWireListEvents();
|
|
1705
2205
|
this.wireListEvents();
|
|
1706
2206
|
};
|
|
@@ -1718,6 +2218,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1718
2218
|
DropDownList.prototype.resetHandler = function (e) {
|
|
1719
2219
|
e.preventDefault();
|
|
1720
2220
|
this.clearAll(e);
|
|
2221
|
+
if (this.enableVirtualization) {
|
|
2222
|
+
this.list.scrollTop = 0;
|
|
2223
|
+
this.virtualListInfo = null;
|
|
2224
|
+
this.previousStartIndex = 0;
|
|
2225
|
+
this.previousEndIndex = 0;
|
|
2226
|
+
}
|
|
1721
2227
|
};
|
|
1722
2228
|
DropDownList.prototype.resetFocusElement = function () {
|
|
1723
2229
|
this.removeHover();
|
|
@@ -1726,6 +2232,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1726
2232
|
this.list.scrollTop = 0;
|
|
1727
2233
|
if (this.getModuleName() !== 'autocomplete' && !isNullOrUndefined(this.ulElement)) {
|
|
1728
2234
|
var li = this.ulElement.querySelector('.' + dropDownListClasses.li);
|
|
2235
|
+
if (this.enableVirtualization) {
|
|
2236
|
+
li = this.liCollections[this.skeletonCount];
|
|
2237
|
+
}
|
|
1729
2238
|
if (li) {
|
|
1730
2239
|
li.classList.add(dropDownListClasses.focus);
|
|
1731
2240
|
}
|
|
@@ -1744,6 +2253,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1744
2253
|
return;
|
|
1745
2254
|
}
|
|
1746
2255
|
this.onChangeEvent(e);
|
|
2256
|
+
this.checkAndResetCache();
|
|
2257
|
+
if (this.enableVirtualization) {
|
|
2258
|
+
this.updateInitialData();
|
|
2259
|
+
}
|
|
1747
2260
|
};
|
|
1748
2261
|
DropDownList.prototype.resetSelection = function (properties) {
|
|
1749
2262
|
if (this.list) {
|
|
@@ -1810,10 +2323,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1810
2323
|
this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
|
|
1811
2324
|
}
|
|
1812
2325
|
else if (htmlAttr === 'aria-label') {
|
|
1813
|
-
if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
|
|
2326
|
+
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
|
|
1814
2327
|
this.inputElement.setAttribute('aria-label', this.htmlAttributes["" + htmlAttr]);
|
|
1815
2328
|
}
|
|
1816
|
-
else {
|
|
2329
|
+
else if (this.getModuleName() === 'dropdownlist') {
|
|
1817
2330
|
this.inputWrapper.container.setAttribute('aria-label', this.htmlAttributes["" + htmlAttr]);
|
|
1818
2331
|
}
|
|
1819
2332
|
}
|
|
@@ -1913,6 +2426,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1913
2426
|
return item;
|
|
1914
2427
|
};
|
|
1915
2428
|
DropDownList.prototype.initValue = function () {
|
|
2429
|
+
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
2430
|
+
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
|
|
1916
2431
|
this.renderList();
|
|
1917
2432
|
if (this.dataSource instanceof DataManager) {
|
|
1918
2433
|
this.initRemoteRender = true;
|
|
@@ -1922,6 +2437,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1922
2437
|
}
|
|
1923
2438
|
};
|
|
1924
2439
|
DropDownList.prototype.updateValues = function () {
|
|
2440
|
+
this.selectedValueInfo = this.viewPortInfo;
|
|
1925
2441
|
if (!isNullOrUndefined(this.value)) {
|
|
1926
2442
|
this.setSelection(this.getElementByValue(this.value), null);
|
|
1927
2443
|
}
|
|
@@ -2110,6 +2626,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2110
2626
|
};
|
|
2111
2627
|
DropDownList.prototype.onMouseClick = function (e) {
|
|
2112
2628
|
var target = e.target;
|
|
2629
|
+
this.keyboardEvent = null;
|
|
2113
2630
|
var li = closest(target, '.' + dropDownBaseClasses.li);
|
|
2114
2631
|
if (!this.isValidLI(li)) {
|
|
2115
2632
|
return;
|
|
@@ -2190,6 +2707,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2190
2707
|
if (!this.enabled) {
|
|
2191
2708
|
return;
|
|
2192
2709
|
}
|
|
2710
|
+
this.keyboardEvent = e;
|
|
2711
|
+
if (this.isPreventKeyAction && this.enableVirtualization) {
|
|
2712
|
+
e.preventDefault();
|
|
2713
|
+
}
|
|
2193
2714
|
var preventAction = e.action === 'pageUp' || e.action === 'pageDown';
|
|
2194
2715
|
var preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');
|
|
2195
2716
|
this.isEscapeKey = e.action === 'escape';
|
|
@@ -2229,9 +2750,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2229
2750
|
e.preventDefault();
|
|
2230
2751
|
break;
|
|
2231
2752
|
case 'home':
|
|
2753
|
+
this.isMouseScrollAction = true;
|
|
2232
2754
|
this.updateHomeEndAction(e);
|
|
2233
2755
|
break;
|
|
2234
2756
|
case 'end':
|
|
2757
|
+
this.isMouseScrollAction = true;
|
|
2235
2758
|
this.updateHomeEndAction(e);
|
|
2236
2759
|
break;
|
|
2237
2760
|
case 'space':
|
|
@@ -2265,13 +2788,19 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2265
2788
|
}
|
|
2266
2789
|
}
|
|
2267
2790
|
};
|
|
2268
|
-
DropDownList.prototype.updateUpDownAction = function (e) {
|
|
2791
|
+
DropDownList.prototype.updateUpDownAction = function (e, isVirtualKeyAction) {
|
|
2269
2792
|
var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
2270
|
-
if (this.isSelectFocusItem(focusEle)) {
|
|
2793
|
+
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
2271
2794
|
this.setSelection(focusEle, e);
|
|
2795
|
+
if (this.enableVirtualization) {
|
|
2796
|
+
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
2797
|
+
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
2798
|
+
}
|
|
2272
2799
|
}
|
|
2273
2800
|
else if (!isNullOrUndefined(this.liCollections)) {
|
|
2801
|
+
var virtualIndex = this.activeIndex;
|
|
2274
2802
|
var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
|
|
2803
|
+
index = isVirtualKeyAction ? virtualIndex : index;
|
|
2275
2804
|
var startIndex = 0;
|
|
2276
2805
|
if (this.getModuleName() === 'autocomplete') {
|
|
2277
2806
|
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
@@ -2279,8 +2808,26 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2279
2808
|
}
|
|
2280
2809
|
var nextItem = void 0;
|
|
2281
2810
|
if (this.getModuleName() !== 'autocomplete' || this.getModuleName() === 'autocomplete' && this.isPopupOpen) {
|
|
2282
|
-
|
|
2283
|
-
|
|
2811
|
+
if (!this.enableVirtualization) {
|
|
2812
|
+
nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
|
|
2813
|
+
: this.liCollections[index];
|
|
2814
|
+
}
|
|
2815
|
+
else {
|
|
2816
|
+
if (!isVirtualKeyAction) {
|
|
2817
|
+
nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[this.skeletonCount]
|
|
2818
|
+
: this.liCollections[index];
|
|
2819
|
+
nextItem = !isNullOrUndefined(nextItem) && !nextItem.classList.contains('e-virtual-list') ? nextItem : null;
|
|
2820
|
+
}
|
|
2821
|
+
else {
|
|
2822
|
+
if (this.getModuleName() === 'autocomplete') {
|
|
2823
|
+
var value = this.selectedLI.dataset.value;
|
|
2824
|
+
nextItem = this.getElementByValue(value);
|
|
2825
|
+
}
|
|
2826
|
+
else {
|
|
2827
|
+
nextItem = this.getElementByValue(this.getItemData().value);
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2284
2831
|
}
|
|
2285
2832
|
if (!isNullOrUndefined(nextItem)) {
|
|
2286
2833
|
this.setSelection(nextItem, e);
|
|
@@ -2288,17 +2835,23 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2288
2835
|
}
|
|
2289
2836
|
e.preventDefault();
|
|
2290
2837
|
};
|
|
2291
|
-
DropDownList.prototype.updateHomeEndAction = function (e) {
|
|
2838
|
+
DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
|
|
2292
2839
|
if (this.getModuleName() === 'dropdownlist') {
|
|
2293
2840
|
var findLi = 0;
|
|
2294
2841
|
if (e.action === 'home') {
|
|
2295
2842
|
findLi = 0;
|
|
2843
|
+
if (this.enableVirtualization) {
|
|
2844
|
+
findLi = this.skeletonCount;
|
|
2845
|
+
}
|
|
2296
2846
|
}
|
|
2297
2847
|
else {
|
|
2298
2848
|
findLi = this.getItems().length - 1;
|
|
2299
2849
|
}
|
|
2300
2850
|
e.preventDefault();
|
|
2301
2851
|
if (this.activeIndex === findLi) {
|
|
2852
|
+
if (isVirtualKeyAction) {
|
|
2853
|
+
this.setSelection(this.liCollections[findLi], e);
|
|
2854
|
+
}
|
|
2302
2855
|
return;
|
|
2303
2856
|
}
|
|
2304
2857
|
this.setSelection(this.liCollections[findLi], e);
|
|
@@ -2336,6 +2889,36 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2336
2889
|
}
|
|
2337
2890
|
}
|
|
2338
2891
|
};
|
|
2892
|
+
DropDownList.prototype.handleVirtualKeyboardActions = function (e, pageCount) {
|
|
2893
|
+
switch (e.action) {
|
|
2894
|
+
case 'down':
|
|
2895
|
+
case 'up':
|
|
2896
|
+
if (this.itemData != null || this.getModuleName() === 'autocomplete') {
|
|
2897
|
+
this.updateUpDownAction(e, true);
|
|
2898
|
+
}
|
|
2899
|
+
break;
|
|
2900
|
+
case 'pageUp':
|
|
2901
|
+
var count = (pageCount * 2) - 4;
|
|
2902
|
+
this.activeIndex = Math.round(count);
|
|
2903
|
+
this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
|
|
2904
|
+
e.preventDefault();
|
|
2905
|
+
break;
|
|
2906
|
+
case 'pageDown':
|
|
2907
|
+
this.activeIndex = 1;
|
|
2908
|
+
this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
|
|
2909
|
+
e.preventDefault();
|
|
2910
|
+
break;
|
|
2911
|
+
case 'home':
|
|
2912
|
+
this.isMouseScrollAction = true;
|
|
2913
|
+
this.updateHomeEndAction(e, true);
|
|
2914
|
+
break;
|
|
2915
|
+
case 'end':
|
|
2916
|
+
this.isMouseScrollAction = true;
|
|
2917
|
+
this.updateHomeEndAction(e, true);
|
|
2918
|
+
break;
|
|
2919
|
+
}
|
|
2920
|
+
this.keyboardEvent = null;
|
|
2921
|
+
};
|
|
2339
2922
|
DropDownList.prototype.selectCurrentItem = function (e) {
|
|
2340
2923
|
if (this.isPopupOpen) {
|
|
2341
2924
|
var li = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
@@ -2357,18 +2940,28 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2357
2940
|
DropDownList.prototype.isSelectFocusItem = function (element) {
|
|
2358
2941
|
return !isNullOrUndefined(element);
|
|
2359
2942
|
};
|
|
2360
|
-
DropDownList.prototype.getPageCount = function () {
|
|
2943
|
+
DropDownList.prototype.getPageCount = function (returnExactCount) {
|
|
2361
2944
|
var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
|
|
2362
2945
|
getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
|
|
2363
|
-
|
|
2946
|
+
var pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
|
|
2947
|
+
return returnExactCount ? pageCount : Math.round(pageCount);
|
|
2364
2948
|
};
|
|
2365
|
-
DropDownList.prototype.pageUpSelection = function (steps, event) {
|
|
2949
|
+
DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
|
|
2366
2950
|
var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
|
|
2951
|
+
if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
|
|
2952
|
+
previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
|
|
2953
|
+
}
|
|
2954
|
+
if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
|
|
2955
|
+
previousItem = this.liCollections[this.skeletonCount];
|
|
2956
|
+
}
|
|
2367
2957
|
this.setSelection(previousItem, event);
|
|
2368
2958
|
};
|
|
2369
|
-
DropDownList.prototype.pageDownSelection = function (steps, event) {
|
|
2959
|
+
DropDownList.prototype.pageDownSelection = function (steps, event, isVirtualKeyAction) {
|
|
2370
2960
|
var list = this.getItems();
|
|
2371
2961
|
var previousItem = steps <= list.length ? this.liCollections[steps - 1] : this.liCollections[list.length - 1];
|
|
2962
|
+
if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
|
|
2963
|
+
previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
|
|
2964
|
+
}
|
|
2372
2965
|
this.setSelection(previousItem, event);
|
|
2373
2966
|
};
|
|
2374
2967
|
DropDownList.prototype.unWireEvent = function () {
|
|
@@ -2434,6 +3027,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2434
3027
|
if (e.which === 3 || e.button === 2) {
|
|
2435
3028
|
return;
|
|
2436
3029
|
}
|
|
3030
|
+
this.keyboardEvent = null;
|
|
2437
3031
|
if (this.targetElement().classList.contains(dropDownListClasses.disable) || this.inputWrapper.clearButton === e.target) {
|
|
2438
3032
|
return;
|
|
2439
3033
|
}
|
|
@@ -2579,6 +3173,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2579
3173
|
}
|
|
2580
3174
|
else {
|
|
2581
3175
|
this.setSelectOptions(li, e);
|
|
3176
|
+
if (this.enableVirtualization) {
|
|
3177
|
+
var fields = (this.fields.value) ? this.fields.value : '';
|
|
3178
|
+
var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
|
|
3179
|
+
if (getItem && getItem.length > 0) {
|
|
3180
|
+
this.itemData = getItem[0];
|
|
3181
|
+
this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
2582
3184
|
}
|
|
2583
3185
|
};
|
|
2584
3186
|
DropDownList.prototype.setSelectOptions = function (li, e) {
|
|
@@ -2837,6 +3439,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2837
3439
|
this.typedString = this.filterInput.value;
|
|
2838
3440
|
this.preventAutoFill = false;
|
|
2839
3441
|
this.searchLists(e);
|
|
3442
|
+
if (this.enableVirtualization) {
|
|
3443
|
+
this.getFilteringSkeletonCount();
|
|
3444
|
+
}
|
|
2840
3445
|
break;
|
|
2841
3446
|
}
|
|
2842
3447
|
}
|
|
@@ -2844,6 +3449,33 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2844
3449
|
this.isValidKey = false;
|
|
2845
3450
|
}
|
|
2846
3451
|
};
|
|
3452
|
+
DropDownList.prototype.getFilteringSkeletonCount = function () {
|
|
3453
|
+
var difference = this.dataCount - this.viewPortInfo.endIndex;
|
|
3454
|
+
var currentSkeletonCount = this.skeletonCount;
|
|
3455
|
+
this.getSkeletonCount(true);
|
|
3456
|
+
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
|
|
3457
|
+
if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3458
|
+
var isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
|
|
3459
|
+
if (currentSkeletonCount !== this.skeletonCount) {
|
|
3460
|
+
this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
|
|
3461
|
+
}
|
|
3462
|
+
else {
|
|
3463
|
+
this.UpdateSkeleton();
|
|
3464
|
+
}
|
|
3465
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
3466
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3467
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
3468
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3469
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
3470
|
+
}
|
|
3471
|
+
};
|
|
3472
|
+
DropDownList.prototype.getSkeletonCount = function (retainSkeleton) {
|
|
3473
|
+
this.virtualListHeight = this.listHeight != null ? parseInt(this.listHeight, 10) : this.virtualListHeight;
|
|
3474
|
+
var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
|
|
3475
|
+
this.skeletonCount = actualCount * 2 < this.itemCount ? this.itemCount : actualCount * 2;
|
|
3476
|
+
this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
|
|
3477
|
+
this.skeletonCount = Math.floor(this.skeletonCount / 2) + 2;
|
|
3478
|
+
};
|
|
2847
3479
|
DropDownList.prototype.onFilterDown = function (e) {
|
|
2848
3480
|
switch (e.keyCode) {
|
|
2849
3481
|
case 13: //enter
|
|
@@ -2887,6 +3519,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2887
3519
|
else {
|
|
2888
3520
|
filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
2889
3521
|
}
|
|
3522
|
+
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
|
|
3523
|
+
var takeValue = this.getTakeValue();
|
|
3524
|
+
if (this.allowFiltering) {
|
|
3525
|
+
filterQuery.skip(this.virtualItemStartIndex);
|
|
3526
|
+
}
|
|
3527
|
+
filterQuery.take(takeValue);
|
|
3528
|
+
filterQuery.requiresCount();
|
|
3529
|
+
}
|
|
2890
3530
|
return filterQuery;
|
|
2891
3531
|
};
|
|
2892
3532
|
DropDownList.prototype.getSelectionPoints = function () {
|
|
@@ -2904,6 +3544,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2904
3544
|
}
|
|
2905
3545
|
this.isDataFetched = false;
|
|
2906
3546
|
if (this.isFiltering()) {
|
|
3547
|
+
this.checkAndResetCache();
|
|
2907
3548
|
var eventArgs_1 = {
|
|
2908
3549
|
preventDefaultAction: false,
|
|
2909
3550
|
text: this.filterInput.value,
|
|
@@ -2941,10 +3582,30 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2941
3582
|
if (!isNullOrUndefined(this.filterInput)) {
|
|
2942
3583
|
this.beforePopupOpen = (!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') ?
|
|
2943
3584
|
false : true;
|
|
3585
|
+
var isNoData = this.list.classList.contains(dropDownBaseClasses.noData);
|
|
2944
3586
|
if (this.filterInput.value.trim() === '' && !this.itemTemplate) {
|
|
2945
3587
|
this.actionCompleteData.isUpdated = false;
|
|
2946
3588
|
this.isTyped = false;
|
|
2947
3589
|
if (!isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
|
|
3590
|
+
if (this.enableVirtualization) {
|
|
3591
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3592
|
+
this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
3593
|
+
this.resetList(dataSource, fields, query);
|
|
3594
|
+
if (isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3595
|
+
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
3596
|
+
this.list.appendChild(this.createElement('div', {
|
|
3597
|
+
className: 'e-virtual-ddl-content',
|
|
3598
|
+
styles: this.getTransformValues()
|
|
3599
|
+
})).appendChild(this.list.querySelector('.e-list-parent'));
|
|
3600
|
+
}
|
|
3601
|
+
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
3602
|
+
var virualElement = this.createElement('div', {
|
|
3603
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
3604
|
+
});
|
|
3605
|
+
document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
2948
3609
|
this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list);
|
|
2949
3610
|
}
|
|
2950
3611
|
this.isTyped = true;
|
|
@@ -2957,7 +3618,30 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2957
3618
|
else {
|
|
2958
3619
|
this.isNotSearchList = false;
|
|
2959
3620
|
query = (this.filterInput.value.trim() === '') ? null : query;
|
|
3621
|
+
if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
|
|
3622
|
+
this.isPreventScrollAction = true;
|
|
3623
|
+
this.list.scrollTop = 0;
|
|
3624
|
+
this.previousStartIndex = 0;
|
|
3625
|
+
this.virtualListInfo = null;
|
|
3626
|
+
}
|
|
2960
3627
|
this.resetList(dataSource, fields, query);
|
|
3628
|
+
if (this.enableVirtualization && isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3629
|
+
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
3630
|
+
this.list.appendChild(this.createElement('div', {
|
|
3631
|
+
className: 'e-virtual-ddl-content',
|
|
3632
|
+
styles: this.getTransformValues()
|
|
3633
|
+
})).appendChild(this.list.querySelector('.e-list-parent'));
|
|
3634
|
+
}
|
|
3635
|
+
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
3636
|
+
var virualElement = this.createElement('div', {
|
|
3637
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
3638
|
+
});
|
|
3639
|
+
document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
}
|
|
3643
|
+
if (this.enableVirtualization) {
|
|
3644
|
+
this.getFilteringSkeletonCount();
|
|
2961
3645
|
}
|
|
2962
3646
|
this.renderReactTemplates();
|
|
2963
3647
|
}
|
|
@@ -3055,16 +3739,45 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3055
3739
|
this.renderPopup();
|
|
3056
3740
|
}
|
|
3057
3741
|
};
|
|
3742
|
+
DropDownList.prototype.UpdateSkeleton = function (isSkeletonCountChange, skeletonCount) {
|
|
3743
|
+
var isContainSkeleton = this.list.querySelector('.e-virtual-ddl-content');
|
|
3744
|
+
var isContainVirtualList = this.list.querySelector('.e-virtual-list');
|
|
3745
|
+
if (isContainSkeleton && (!isContainVirtualList || isSkeletonCountChange) && this.enableVirtualization) {
|
|
3746
|
+
var totalSkeletonCount = isSkeletonCountChange ? skeletonCount : this.skeletonCount;
|
|
3747
|
+
for (var i = 0; i < totalSkeletonCount; i++) {
|
|
3748
|
+
var liElement = this.createElement('li', { className: dropDownListClasses.virtualList, styles: 'overflow: inherit' });
|
|
3749
|
+
var skeleton = new Skeleton({
|
|
3750
|
+
shape: "Text",
|
|
3751
|
+
height: "10px",
|
|
3752
|
+
width: "95%",
|
|
3753
|
+
cssClass: "e-skeleton-text",
|
|
3754
|
+
});
|
|
3755
|
+
skeleton.appendTo(this.createElement('div'));
|
|
3756
|
+
liElement.appendChild(skeleton.element);
|
|
3757
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3758
|
+
isContainSkeleton.firstChild.insertBefore(liElement, isContainSkeleton.firstChild.children[0]);
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
};
|
|
3762
|
+
DropDownList.prototype.getTakeValue = function () {
|
|
3763
|
+
return this.allowFiltering && this.getModuleName() === 'dropdownlist' && Browser.isDevice ? Math.round(window.outerHeight / this.listItemHeight) : this.itemCount;
|
|
3764
|
+
};
|
|
3058
3765
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3059
3766
|
DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
|
|
3060
3767
|
var _this = this;
|
|
3061
|
-
if (this.
|
|
3768
|
+
if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
|
|
3769
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3770
|
+
this.totalItemCount = e.count;
|
|
3771
|
+
}
|
|
3772
|
+
if (this.isNotSearchList && !this.enableVirtualization) {
|
|
3062
3773
|
this.isNotSearchList = false;
|
|
3063
3774
|
return;
|
|
3064
3775
|
}
|
|
3776
|
+
var tempItemCount = this.itemCount;
|
|
3065
3777
|
if (this.isActive || !isNullOrUndefined(ulElement)) {
|
|
3066
3778
|
var selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
|
|
3067
3779
|
_super.prototype.onActionComplete.call(this, ulElement, list, e);
|
|
3780
|
+
this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
|
|
3068
3781
|
this.updateSelectElementData(this.allowFiltering);
|
|
3069
3782
|
if (this.isRequested && !isNullOrUndefined(this.searchKeyEvent) && this.searchKeyEvent.type === 'keydown') {
|
|
3070
3783
|
this.isRequested = false;
|
|
@@ -3075,7 +3788,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3075
3788
|
this.incrementalSearch(this.searchKeyEvent);
|
|
3076
3789
|
this.searchKeyEvent = null;
|
|
3077
3790
|
}
|
|
3078
|
-
this.
|
|
3791
|
+
if (!this.enableVirtualization) {
|
|
3792
|
+
this.list.scrollTop = 0;
|
|
3793
|
+
}
|
|
3079
3794
|
if (!isNullOrUndefined(ulElement)) {
|
|
3080
3795
|
attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
3081
3796
|
}
|
|
@@ -3129,13 +3844,36 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3129
3844
|
this.updateActionCompleteDataValues(ulElement, list);
|
|
3130
3845
|
}
|
|
3131
3846
|
}
|
|
3132
|
-
this.
|
|
3133
|
-
|
|
3847
|
+
if (!this.enableVirtualization) {
|
|
3848
|
+
this.addNewItem(list, selectedItem);
|
|
3849
|
+
}
|
|
3850
|
+
if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
|
|
3134
3851
|
this.focusIndexItem();
|
|
3135
3852
|
}
|
|
3853
|
+
if (this.enableVirtualization) {
|
|
3854
|
+
this.updateActionCompleteDataValues(ulElement, list);
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
else if (this.enableVirtualization && this.getModuleName() !== 'autocomplete' && !this.isFiltering()) {
|
|
3858
|
+
var value = this.getItemData().value;
|
|
3859
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
3860
|
+
var element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
3861
|
+
this.selectedLI = element;
|
|
3862
|
+
}
|
|
3863
|
+
else if (this.enableVirtualization && this.getModuleName() === 'autocomplete') {
|
|
3864
|
+
this.activeIndex = this.skeletonCount;
|
|
3136
3865
|
}
|
|
3137
3866
|
if (this.beforePopupOpen) {
|
|
3138
3867
|
this.renderPopup(e);
|
|
3868
|
+
if (this.enableVirtualization) {
|
|
3869
|
+
if (!this.list.querySelector('.e-virtual-list')) {
|
|
3870
|
+
this.UpdateSkeleton();
|
|
3871
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
3872
|
+
}
|
|
3873
|
+
}
|
|
3874
|
+
if (this.enableVirtualization && tempItemCount != this.itemCount) {
|
|
3875
|
+
this.resetList(this.dataSource, this.fields);
|
|
3876
|
+
}
|
|
3139
3877
|
}
|
|
3140
3878
|
}
|
|
3141
3879
|
};
|
|
@@ -3198,7 +3936,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3198
3936
|
var element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
3199
3937
|
this.selectedLI = element;
|
|
3200
3938
|
this.activeItem(element);
|
|
3201
|
-
this.
|
|
3939
|
+
if (!(this.enableVirtualization && isNullOrUndefined(element))) {
|
|
3940
|
+
this.removeFocus();
|
|
3941
|
+
}
|
|
3202
3942
|
};
|
|
3203
3943
|
DropDownList.prototype.updateSelection = function () {
|
|
3204
3944
|
var selectedItem = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
@@ -3211,12 +3951,46 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3211
3951
|
this.list.querySelector('.' + dropDownBaseClasses.li).classList.add(dropDownListClasses.focus);
|
|
3212
3952
|
}
|
|
3213
3953
|
};
|
|
3954
|
+
DropDownList.prototype.updateSelectionList = function () {
|
|
3955
|
+
var selectedItem = this.list && this.list.querySelector('.' + 'e-active');
|
|
3956
|
+
if (!selectedItem && !isNullOrUndefined(this.value)) {
|
|
3957
|
+
var findEle = this.findListElement(this.list, 'li', 'data-value', this.value);
|
|
3958
|
+
if (findEle) {
|
|
3959
|
+
findEle.classList.add('e-active');
|
|
3960
|
+
}
|
|
3961
|
+
}
|
|
3962
|
+
};
|
|
3963
|
+
DropDownList.prototype.checkAndResetCache = function () {
|
|
3964
|
+
if (this.enableVirtualization) {
|
|
3965
|
+
this.generatedDataObject = {};
|
|
3966
|
+
this.virtualItemStartIndex = this.virtualItemEndIndex = 0;
|
|
3967
|
+
this.viewPortInfo = { currentPageNumber: null,
|
|
3968
|
+
direction: null,
|
|
3969
|
+
sentinelInfo: {},
|
|
3970
|
+
offsets: {},
|
|
3971
|
+
startIndex: 0,
|
|
3972
|
+
endIndex: this.itemCount, };
|
|
3973
|
+
this.selectedValueInfo = null;
|
|
3974
|
+
}
|
|
3975
|
+
};
|
|
3214
3976
|
DropDownList.prototype.removeFocus = function () {
|
|
3215
3977
|
var highlightedItem = this.list.querySelectorAll('.' + dropDownListClasses.focus);
|
|
3216
3978
|
if (highlightedItem && highlightedItem.length) {
|
|
3217
3979
|
removeClass(highlightedItem, dropDownListClasses.focus);
|
|
3218
3980
|
}
|
|
3219
3981
|
};
|
|
3982
|
+
DropDownList.prototype.getTransformValues = function () {
|
|
3983
|
+
var translateY = this.viewPortInfo.startIndex * this.listItemHeight;
|
|
3984
|
+
translateY = translateY - (this.skeletonCount * this.listItemHeight);
|
|
3985
|
+
translateY = this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0 ? 0 : translateY;
|
|
3986
|
+
var styleText = "transform: translate(0px, " + translateY + "px);";
|
|
3987
|
+
return styleText;
|
|
3988
|
+
};
|
|
3989
|
+
DropDownList.prototype.GetVirtualTrackHeight = function () {
|
|
3990
|
+
var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
|
|
3991
|
+
var heightDimension = "height: " + (height - this.itemCount * this.listItemHeight) + "px;";
|
|
3992
|
+
return heightDimension;
|
|
3993
|
+
};
|
|
3220
3994
|
DropDownList.prototype.renderPopup = function (e) {
|
|
3221
3995
|
var _this = this;
|
|
3222
3996
|
if (this.popupObj && document.body.contains(this.popupObj.element)) {
|
|
@@ -3239,10 +4013,35 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3239
4013
|
_this.setFooterTemplate(popupEle);
|
|
3240
4014
|
}
|
|
3241
4015
|
document.body.appendChild(popupEle);
|
|
4016
|
+
if (_this.enableVirtualization && !_this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
4017
|
+
if (!_this.list.querySelector('.e-virtual-ddl-content')) {
|
|
4018
|
+
_this.list.appendChild(_this.createElement('div', {
|
|
4019
|
+
className: 'e-virtual-ddl-content',
|
|
4020
|
+
styles: _this.getTransformValues()
|
|
4021
|
+
})).appendChild(_this.list.querySelector('.e-list-parent'));
|
|
4022
|
+
}
|
|
4023
|
+
else {
|
|
4024
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4025
|
+
_this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = _this.getTransformValues();
|
|
4026
|
+
}
|
|
4027
|
+
_this.UpdateSkeleton();
|
|
4028
|
+
_this.liCollections = _this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
4029
|
+
_this.virtualItemCount = _this.itemCount;
|
|
4030
|
+
if (!_this.list.querySelector('.e-virtual-ddl')) {
|
|
4031
|
+
var virualElement = _this.createElement('div', {
|
|
4032
|
+
id: _this.element.id + '_popup', className: 'e-virtual-ddl', styles: _this.GetVirtualTrackHeight()
|
|
4033
|
+
});
|
|
4034
|
+
popupEle.querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
4035
|
+
}
|
|
4036
|
+
else {
|
|
4037
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4038
|
+
_this.list.getElementsByClassName('e-virtual-ddl')[0].style = _this.GetVirtualTrackHeight();
|
|
4039
|
+
}
|
|
4040
|
+
}
|
|
3242
4041
|
popupEle.style.visibility = 'hidden';
|
|
3243
4042
|
if (_this.popupHeight !== 'auto') {
|
|
3244
4043
|
_this.searchBoxHeight = 0;
|
|
3245
|
-
if (!isNullOrUndefined(searchBox.container)) {
|
|
4044
|
+
if (!isNullOrUndefined(searchBox.container) && _this.getModuleName() !== 'combobox' && _this.getModuleName() !== 'autocomplete') {
|
|
3246
4045
|
_this.searchBoxHeight = (searchBox.container.parentElement).getBoundingClientRect().height;
|
|
3247
4046
|
_this.listHeight = (parseInt(_this.listHeight, 10) - (_this.searchBoxHeight)).toString() + 'px';
|
|
3248
4047
|
}
|
|
@@ -3264,9 +4063,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3264
4063
|
}
|
|
3265
4064
|
var offsetValue = 0;
|
|
3266
4065
|
var left = void 0;
|
|
4066
|
+
_this.isPreventScrollAction = true;
|
|
3267
4067
|
if (!isNullOrUndefined(_this.selectedLI) && (!isNullOrUndefined(_this.activeIndex) && _this.activeIndex >= 0)) {
|
|
3268
4068
|
_this.setScrollPosition();
|
|
3269
4069
|
}
|
|
4070
|
+
else if (_this.enableVirtualization) {
|
|
4071
|
+
_this.setScrollPosition();
|
|
4072
|
+
}
|
|
3270
4073
|
else {
|
|
3271
4074
|
_this.list.scrollTop = 0;
|
|
3272
4075
|
}
|
|
@@ -3282,6 +4085,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3282
4085
|
}
|
|
3283
4086
|
_this.getFocusElement();
|
|
3284
4087
|
_this.createPopup(popupEle, offsetValue, left);
|
|
4088
|
+
_this.popupContentElement = _this.popupObj.element.querySelector('.e-content');
|
|
3285
4089
|
_this.checkCollision(popupEle);
|
|
3286
4090
|
if (Browser.isDevice) {
|
|
3287
4091
|
_this.popupObj.element.classList.add(dropDownListClasses.device);
|
|
@@ -3314,6 +4118,24 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3314
4118
|
_this.wireListEvents();
|
|
3315
4119
|
}
|
|
3316
4120
|
_this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
|
|
4121
|
+
if (_this.enableVirtualization) {
|
|
4122
|
+
_this.notify("bindScrollEvent", {
|
|
4123
|
+
module: "VirtualScroll",
|
|
4124
|
+
component: _this.getModuleName(),
|
|
4125
|
+
enable: _this.enableVirtualization,
|
|
4126
|
+
});
|
|
4127
|
+
setTimeout(function () {
|
|
4128
|
+
if (_this.value) {
|
|
4129
|
+
_this.updateSelectionList();
|
|
4130
|
+
if (_this.selectedValueInfo && _this.viewPortInfo && _this.viewPortInfo.offsets.top) {
|
|
4131
|
+
_this.list.scrollTop = _this.viewPortInfo.offsets.top;
|
|
4132
|
+
}
|
|
4133
|
+
else {
|
|
4134
|
+
_this.scrollBottom(true, true);
|
|
4135
|
+
}
|
|
4136
|
+
}
|
|
4137
|
+
}, 5);
|
|
4138
|
+
}
|
|
3317
4139
|
attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_options' });
|
|
3318
4140
|
_this.inputElement.setAttribute('aria-expanded', 'true');
|
|
3319
4141
|
var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
|
|
@@ -3448,6 +4270,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3448
4270
|
var firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
3449
4271
|
var lastItem = this.isEmptyList() ? this.list : this.liCollections[this.getItems().length - 1];
|
|
3450
4272
|
var liHeight = firstItem.getBoundingClientRect().height;
|
|
4273
|
+
this.listItemHeight = liHeight;
|
|
3451
4274
|
var listHeight = this.list.offsetHeight / 2;
|
|
3452
4275
|
var height = isNullOrUndefined(selectedLI) ? firstItem.offsetTop : selectedLI.offsetTop;
|
|
3453
4276
|
var lastItemOffsetValue = lastItem.offsetTop;
|
|
@@ -3458,7 +4281,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3458
4281
|
offsetValue = (count - (this.liCollections.length - this.activeIndex)) * liHeight - popupOffset + paddingBottom;
|
|
3459
4282
|
this.list.scrollTop = selectedLI.offsetTop;
|
|
3460
4283
|
}
|
|
3461
|
-
else if (height > listHeight) {
|
|
4284
|
+
else if (height > listHeight && !this.enableVirtualization) {
|
|
3462
4285
|
offsetValue = listHeight - liHeight / 2;
|
|
3463
4286
|
this.list.scrollTop = height - listHeight + liHeight / 2;
|
|
3464
4287
|
}
|
|
@@ -3484,34 +4307,108 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3484
4307
|
}
|
|
3485
4308
|
return width;
|
|
3486
4309
|
};
|
|
3487
|
-
DropDownList.prototype.scrollBottom = function (isInitial) {
|
|
4310
|
+
DropDownList.prototype.scrollBottom = function (isInitial, isInitialSelection, keyAction) {
|
|
4311
|
+
if (isInitialSelection === void 0) { isInitialSelection = false; }
|
|
4312
|
+
if (keyAction === void 0) { keyAction = null; }
|
|
4313
|
+
if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
|
|
4314
|
+
this.selectedLI = this.list.querySelector('.' + dropDownBaseClasses.li);
|
|
4315
|
+
if (!isNullOrUndefined(this.selectedLI) && this.selectedLI.classList.contains('e-virtual-list')) {
|
|
4316
|
+
this.selectedLI = this.liCollections[this.skeletonCount];
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
3488
4319
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
4320
|
+
this.isUpwardScrolling = false;
|
|
4321
|
+
var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
|
|
4322
|
+
var lastElementValue = this.list.querySelector('li:last-of-type') ? this.list.querySelector('li:last-of-type').getAttribute('data-value') : null;
|
|
4323
|
+
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
3489
4324
|
var currentOffset = this.list.offsetHeight;
|
|
3490
|
-
var nextBottom = this.selectedLI.
|
|
4325
|
+
var nextBottom = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
3491
4326
|
var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
|
|
3492
|
-
|
|
3493
|
-
|
|
4327
|
+
var isScrollerCHanged = false;
|
|
4328
|
+
nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10);
|
|
4329
|
+
var boxRange = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
3494
4330
|
boxRange = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
|
|
3495
4331
|
boxRange - this.fixedHeaderElement.offsetHeight : boxRange;
|
|
3496
|
-
if (this.activeIndex === 0) {
|
|
4332
|
+
if (this.activeIndex === 0 && !this.enableVirtualization) {
|
|
3497
4333
|
this.list.scrollTop = 0;
|
|
4334
|
+
isScrollerCHanged = this.isKeyBoardAction;
|
|
3498
4335
|
}
|
|
3499
4336
|
else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
3500
|
-
this.
|
|
4337
|
+
var currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
|
|
4338
|
+
var liCount = keyAction == "pageDown" ? this.getPageCount() - 2 : 1;
|
|
4339
|
+
if (!this.enableVirtualization || this.isKeyBoardAction || isInitialSelection) {
|
|
4340
|
+
if (this.isKeyBoardAction && this.enableVirtualization && lastElementValue && currentElementValue === lastElementValue && keyAction != "end" && !this.isVirtualScrolling) {
|
|
4341
|
+
this.isPreventKeyAction = true;
|
|
4342
|
+
this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
|
|
4343
|
+
this.isPreventKeyAction = this.IsScrollerAtEnd() ? false : this.isPreventKeyAction;
|
|
4344
|
+
this.isKeyBoardAction = false;
|
|
4345
|
+
this.isPreventScrollAction = false;
|
|
4346
|
+
}
|
|
4347
|
+
else if (this.enableVirtualization && keyAction == "end") {
|
|
4348
|
+
this.isPreventKeyAction = false;
|
|
4349
|
+
this.isKeyBoardAction = false;
|
|
4350
|
+
this.isPreventScrollAction = false;
|
|
4351
|
+
this.list.scrollTop = this.list.scrollHeight;
|
|
4352
|
+
}
|
|
4353
|
+
else {
|
|
4354
|
+
if (keyAction == "pageDown" && this.enableVirtualization && !this.isVirtualScrolling) {
|
|
4355
|
+
this.isPreventKeyAction = false;
|
|
4356
|
+
this.isKeyBoardAction = false;
|
|
4357
|
+
this.isPreventScrollAction = false;
|
|
4358
|
+
nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
|
|
4359
|
+
}
|
|
4360
|
+
this.list.scrollTop = nextOffset;
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4363
|
+
else {
|
|
4364
|
+
this.list.scrollTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.virtualListInfo.startIndex * this.listItemHeight : 0;
|
|
4365
|
+
}
|
|
4366
|
+
isScrollerCHanged = this.isKeyBoardAction;
|
|
4367
|
+
|
|
3501
4368
|
}
|
|
4369
|
+
this.isKeyBoardAction = isScrollerCHanged;
|
|
3502
4370
|
}
|
|
3503
4371
|
};
|
|
3504
|
-
DropDownList.prototype.scrollTop = function () {
|
|
4372
|
+
DropDownList.prototype.scrollTop = function (keyAction) {
|
|
4373
|
+
if (keyAction === void 0) { keyAction = null; }
|
|
3505
4374
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
3506
|
-
var
|
|
4375
|
+
var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
|
|
4376
|
+
var selectedLiOffsetTop = (this.virtualListInfo && this.virtualListInfo.startIndex) ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
4377
|
+
var nextOffset = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) - this.list.scrollTop;
|
|
4378
|
+
var firstElementValue = this.list.querySelector('li.e-list-item:not(.e-virtual-list)') ? this.list.querySelector('li.e-list-item:not(.e-virtual-list)').getAttribute('data-value') : null;
|
|
3507
4379
|
nextOffset = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
|
|
3508
4380
|
nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;
|
|
3509
|
-
var boxRange = (this.selectedLI.
|
|
3510
|
-
|
|
4381
|
+
var boxRange = (selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop);
|
|
4382
|
+
var isPageUpKeyAction = this.enableVirtualization && this.getModuleName() === 'autocomplete' && nextOffset <= 0;
|
|
4383
|
+
if (this.activeIndex === 0 && !this.enableVirtualization) {
|
|
3511
4384
|
this.list.scrollTop = 0;
|
|
3512
4385
|
}
|
|
3513
|
-
else if (nextOffset < 0) {
|
|
3514
|
-
this.
|
|
4386
|
+
else if (nextOffset < 0 || isPageUpKeyAction) {
|
|
4387
|
+
var currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
|
|
4388
|
+
var liCount = keyAction == "pageUp" ? this.getPageCount() - 2 : 1;
|
|
4389
|
+
if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyAction != "home" && !this.isVirtualScrolling) {
|
|
4390
|
+
this.isUpwardScrolling = true;
|
|
4391
|
+
this.isPreventKeyAction = true;
|
|
4392
|
+
this.list.scrollTop -= this.selectedLI.offsetHeight * liCount;
|
|
4393
|
+
this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
|
|
4394
|
+
this.isKeyBoardAction = false;
|
|
4395
|
+
this.isPreventScrollAction = false;
|
|
4396
|
+
}
|
|
4397
|
+
else if (this.enableVirtualization && keyAction == "home") {
|
|
4398
|
+
this.isPreventScrollAction = false;
|
|
4399
|
+
this.isPreventKeyAction = true;
|
|
4400
|
+
this.isKeyBoardAction = false;
|
|
4401
|
+
this.list.scrollTo(0, 0);
|
|
4402
|
+
}
|
|
4403
|
+
else {
|
|
4404
|
+
if (keyAction == "pageUp" && this.enableVirtualization && !this.isVirtualScrolling) {
|
|
4405
|
+
this.isPreventKeyAction = false;
|
|
4406
|
+
this.isKeyBoardAction = false;
|
|
4407
|
+
this.isPreventScrollAction = false;
|
|
4408
|
+
nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
|
|
4409
|
+
}
|
|
4410
|
+
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
4411
|
+
}
|
|
3515
4412
|
}
|
|
3516
4413
|
else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
3517
4414
|
this.list.scrollTop = this.selectedLI.offsetTop - (this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
|
|
@@ -3529,25 +4426,47 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3529
4426
|
return true;
|
|
3530
4427
|
};
|
|
3531
4428
|
DropDownList.prototype.setScrollPosition = function (e) {
|
|
4429
|
+
this.isPreventScrollAction = true;
|
|
3532
4430
|
if (!isNullOrUndefined(e)) {
|
|
3533
4431
|
switch (e.action) {
|
|
3534
4432
|
case 'pageDown':
|
|
3535
4433
|
case 'down':
|
|
3536
4434
|
case 'end':
|
|
3537
|
-
this.
|
|
4435
|
+
this.isKeyBoardAction = true;
|
|
4436
|
+
this.scrollBottom(false, false, e.action);
|
|
3538
4437
|
break;
|
|
3539
4438
|
default:
|
|
3540
|
-
this.
|
|
4439
|
+
this.isKeyBoardAction = e.action == 'up' || e.action == 'pageUp' || e.action == 'open';
|
|
4440
|
+
this.scrollTop(e.action);
|
|
3541
4441
|
break;
|
|
3542
4442
|
}
|
|
3543
4443
|
}
|
|
3544
4444
|
else {
|
|
3545
4445
|
this.scrollBottom(true);
|
|
3546
4446
|
}
|
|
4447
|
+
this.isKeyBoardAction = false;
|
|
3547
4448
|
};
|
|
3548
4449
|
DropDownList.prototype.clearText = function () {
|
|
3549
4450
|
this.filterInput.value = this.typedString = '';
|
|
3550
4451
|
this.searchLists(null);
|
|
4452
|
+
if (this.enableVirtualization) {
|
|
4453
|
+
this.list.scrollTop = 0;
|
|
4454
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4455
|
+
this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
4456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4457
|
+
if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
|
|
4458
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4459
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
4460
|
+
}
|
|
4461
|
+
this.getSkeletonCount();
|
|
4462
|
+
this.UpdateSkeleton();
|
|
4463
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
4464
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4465
|
+
if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
|
|
4466
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4467
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
4468
|
+
}
|
|
4469
|
+
}
|
|
3551
4470
|
};
|
|
3552
4471
|
DropDownList.prototype.setEleWidth = function (width) {
|
|
3553
4472
|
if (!isNullOrUndefined(width)) {
|
|
@@ -3561,10 +4480,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3561
4480
|
};
|
|
3562
4481
|
DropDownList.prototype.closePopup = function (delay, e) {
|
|
3563
4482
|
var _this = this;
|
|
4483
|
+
var isFilterValue = !isNullOrUndefined(this.filterInput) && !isNullOrUndefined(this.filterInput.value) && this.filterInput.value !== '';
|
|
4484
|
+
var typedString = this.getModuleName() === 'combobox' ? this.typedString : null;
|
|
3564
4485
|
this.isTyped = false;
|
|
3565
4486
|
if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
|
|
3566
4487
|
return;
|
|
3567
4488
|
}
|
|
4489
|
+
this.keyboardEvent = null;
|
|
3568
4490
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
3569
4491
|
this.isActive = false;
|
|
3570
4492
|
this.filterInputObj = null;
|
|
@@ -3606,6 +4528,20 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3606
4528
|
if (this.isFiltering()) {
|
|
3607
4529
|
this.actionCompleteData.isUpdated = false;
|
|
3608
4530
|
}
|
|
4531
|
+
if (this.enableVirtualization) {
|
|
4532
|
+
if ((this.value == null || this.isTyped)) {
|
|
4533
|
+
this.viewPortInfo.endIndex = this.viewPortInfo && this.viewPortInfo.endIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
|
|
4534
|
+
if (this.getModuleName() === 'autocomplete' || (this.getModuleName() === 'dropdownlist' && !isNullOrUndefined(this.typedString) && this.typedString != "") || (this.getModuleName() === 'combobox' && this.allowFiltering && !isNullOrUndefined(this.typedString) && this.typedString != "")) {
|
|
4535
|
+
this.checkAndResetCache();
|
|
4536
|
+
}
|
|
4537
|
+
}
|
|
4538
|
+
else if (this.getModuleName() === 'autocomplete') {
|
|
4539
|
+
this.checkAndResetCache();
|
|
4540
|
+
}
|
|
4541
|
+
if ((this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox') && !(this.skeletonCount == 0)) {
|
|
4542
|
+
this.getSkeletonCount(true);
|
|
4543
|
+
}
|
|
4544
|
+
}
|
|
3609
4545
|
this.beforePopupOpen = false;
|
|
3610
4546
|
var animModel = {
|
|
3611
4547
|
name: 'FadeOut',
|
|
@@ -3636,6 +4572,46 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3636
4572
|
if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
|
|
3637
4573
|
this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
|
|
3638
4574
|
}
|
|
4575
|
+
var dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
4576
|
+
if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
|
|
4577
|
+
this.updateInitialData();
|
|
4578
|
+
this.checkAndResetCache();
|
|
4579
|
+
}
|
|
4580
|
+
};
|
|
4581
|
+
DropDownList.prototype.updateInitialData = function () {
|
|
4582
|
+
var currentData = this.selectData;
|
|
4583
|
+
var ulElement = this.renderItems(currentData, this.fields);
|
|
4584
|
+
this.list.scrollTop = 0;
|
|
4585
|
+
this.virtualListInfo = {
|
|
4586
|
+
currentPageNumber: null,
|
|
4587
|
+
direction: null,
|
|
4588
|
+
sentinelInfo: {},
|
|
4589
|
+
offsets: {},
|
|
4590
|
+
startIndex: 0,
|
|
4591
|
+
endIndex: 0,
|
|
4592
|
+
};
|
|
4593
|
+
if (this.getModuleName() === 'combobox') {
|
|
4594
|
+
this.typedString = "";
|
|
4595
|
+
}
|
|
4596
|
+
this.previousStartIndex = 0;
|
|
4597
|
+
this.previousEndIndex = 0;
|
|
4598
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4599
|
+
this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
4600
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4601
|
+
if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
|
|
4602
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4603
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
4604
|
+
}
|
|
4605
|
+
this.getSkeletonCount();
|
|
4606
|
+
this.UpdateSkeleton();
|
|
4607
|
+
this.listData = currentData;
|
|
4608
|
+
this.updateActionCompleteDataValues(ulElement, currentData);
|
|
4609
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
4610
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4611
|
+
if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
|
|
4612
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4613
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
4614
|
+
}
|
|
3639
4615
|
};
|
|
3640
4616
|
DropDownList.prototype.destroyPopup = function () {
|
|
3641
4617
|
this.isPopupOpen = false;
|
|
@@ -3722,10 +4698,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3722
4698
|
this.element.id = id;
|
|
3723
4699
|
this.hiddenElement.id = id + '_hidden';
|
|
3724
4700
|
this.targetElement().setAttribute('tabindex', this.tabIndex);
|
|
3725
|
-
if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
|
|
4701
|
+
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
|
|
3726
4702
|
this.inputElement.setAttribute('aria-label', this.getModuleName());
|
|
3727
4703
|
}
|
|
3728
|
-
else {
|
|
4704
|
+
else if (this.getModuleName() === 'dropdownlist') {
|
|
3729
4705
|
attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
|
|
3730
4706
|
}
|
|
3731
4707
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
@@ -3735,7 +4711,16 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3735
4711
|
this.inputElement.removeAttribute('aria-labelledby');
|
|
3736
4712
|
}
|
|
3737
4713
|
if (this.value !== null || this.activeIndex !== null || this.text !== null) {
|
|
4714
|
+
if (this.enableVirtualization) {
|
|
4715
|
+
this.listItemHeight = this.getListHeight();
|
|
4716
|
+
this.getSkeletonCount();
|
|
4717
|
+
this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
|
|
4718
|
+
}
|
|
3738
4719
|
this.initValue();
|
|
4720
|
+
this.selectedValueInfo = this.viewPortInfo;
|
|
4721
|
+
if (this.enableVirtualization) {
|
|
4722
|
+
this.activeIndex = this.activeIndex + this.skeletonCount;
|
|
4723
|
+
}
|
|
3739
4724
|
}
|
|
3740
4725
|
else if (this.element.tagName === 'SELECT' && this.element.options[0]) {
|
|
3741
4726
|
var selectElement = this.element;
|
|
@@ -3771,6 +4756,29 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3771
4756
|
attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
3772
4757
|
}
|
|
3773
4758
|
this.renderComplete();
|
|
4759
|
+
this.listItemHeight = this.getListHeight();
|
|
4760
|
+
this.getSkeletonCount();
|
|
4761
|
+
if (this.enableVirtualization) {
|
|
4762
|
+
this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
|
|
4763
|
+
}
|
|
4764
|
+
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
4765
|
+
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
|
|
4766
|
+
};
|
|
4767
|
+
DropDownList.prototype.getListHeight = function () {
|
|
4768
|
+
var listParent = this.createElement('div', {
|
|
4769
|
+
className: 'e-dropdownbase'
|
|
4770
|
+
});
|
|
4771
|
+
var item = this.createElement('li', {
|
|
4772
|
+
className: 'e-list-item'
|
|
4773
|
+
});
|
|
4774
|
+
var listParentHeight = formatUnit(this.popupHeight);
|
|
4775
|
+
listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
|
|
4776
|
+
listParent.appendChild(item);
|
|
4777
|
+
document.body.appendChild(listParent);
|
|
4778
|
+
this.virtualListHeight = listParent.getBoundingClientRect().height;
|
|
4779
|
+
var listItemHeight = Math.ceil(item.getBoundingClientRect().height);
|
|
4780
|
+
listParent.remove();
|
|
4781
|
+
return listItemHeight;
|
|
3774
4782
|
};
|
|
3775
4783
|
DropDownList.prototype.setFooterTemplate = function (popupEle) {
|
|
3776
4784
|
var compiledString;
|
|
@@ -3914,7 +4922,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3914
4922
|
var _loop_1 = function (prop) {
|
|
3915
4923
|
switch (prop) {
|
|
3916
4924
|
case 'query':
|
|
3917
|
-
case 'dataSource':
|
|
4925
|
+
case 'dataSource':
|
|
4926
|
+
this_1.getSkeletonCount();
|
|
4927
|
+
this_1.checkAndResetCache();
|
|
4928
|
+
break;
|
|
3918
4929
|
case 'htmlAttributes':
|
|
3919
4930
|
this_1.setHTMLAttributes();
|
|
3920
4931
|
break;
|
|
@@ -4208,7 +5219,23 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4208
5219
|
this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
|
|
4209
5220
|
this.renderList(e);
|
|
4210
5221
|
}
|
|
5222
|
+
if (this.enableVirtualization && this.listData && this.listData.length) {
|
|
5223
|
+
if (!isNullOrUndefined(this.value) && (this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox')) {
|
|
5224
|
+
this.removeHover();
|
|
5225
|
+
}
|
|
5226
|
+
if (!this.beforePopupOpen) {
|
|
5227
|
+
this.notify("setCurrentViewDataAsync", {
|
|
5228
|
+
module: "VirtualScroll",
|
|
5229
|
+
});
|
|
5230
|
+
}
|
|
5231
|
+
}
|
|
4211
5232
|
this.invokeRenderPopup(e);
|
|
5233
|
+
if (this.enableVirtualization && !this.allowFiltering && this.selectedValueInfo != null && this.selectedValueInfo.startIndex > 0 && this.value != null) {
|
|
5234
|
+
this.notify("dataProcessAsync", {
|
|
5235
|
+
module: "VirtualScroll",
|
|
5236
|
+
isOpen: true,
|
|
5237
|
+
});
|
|
5238
|
+
}
|
|
4212
5239
|
};
|
|
4213
5240
|
DropDownList.prototype.invokeRenderPopup = function (e) {
|
|
4214
5241
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
@@ -4302,7 +5329,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4302
5329
|
if (!this.enabled) {
|
|
4303
5330
|
return;
|
|
4304
5331
|
}
|
|
4305
|
-
this.
|
|
5332
|
+
if (!this.enableVirtualization && this.getModuleName() === 'combobox') {
|
|
5333
|
+
this.isTyped = true;
|
|
5334
|
+
}
|
|
4306
5335
|
this.hidePopup(e);
|
|
4307
5336
|
if (this.targetElement()) {
|
|
4308
5337
|
this.targetElement().blur();
|
|
@@ -4358,6 +5387,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4358
5387
|
this.ulElement = null;
|
|
4359
5388
|
this.list = null;
|
|
4360
5389
|
this.popupObj = null;
|
|
5390
|
+
this.popupContentElement = null;
|
|
4361
5391
|
this.rippleFun = null;
|
|
4362
5392
|
this.selectedLI = null;
|
|
4363
5393
|
this.liCollections = null;
|
|
@@ -4454,6 +5484,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4454
5484
|
__decorate$1([
|
|
4455
5485
|
Property(false)
|
|
4456
5486
|
], DropDownList.prototype, "readonly", void 0);
|
|
5487
|
+
__decorate$1([
|
|
5488
|
+
Property(false)
|
|
5489
|
+
], DropDownList.prototype, "enableVirtualization", void 0);
|
|
4457
5490
|
__decorate$1([
|
|
4458
5491
|
Property(null)
|
|
4459
5492
|
], DropDownList.prototype, "text", void 0);
|
|
@@ -7094,8 +8127,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7094
8127
|
if (tempArr) {
|
|
7095
8128
|
tempArr = Array.prototype.slice.call(tempArr);
|
|
7096
8129
|
append(tempArr, this.noRecord);
|
|
7097
|
-
addClass([this.noRecord], NODATACONTAINER);
|
|
7098
|
-
prepend([this.noRecord], this.popupDiv);
|
|
7099
8130
|
}
|
|
7100
8131
|
}
|
|
7101
8132
|
else {
|
|
@@ -7104,9 +8135,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7104
8135
|
this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
|
|
7105
8136
|
this.noRecord.innerHTML = actionFailure ?
|
|
7106
8137
|
this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
|
|
7107
|
-
addClass([this.noRecord], NODATACONTAINER);
|
|
7108
|
-
prepend([this.noRecord], this.popupDiv);
|
|
7109
8138
|
}
|
|
8139
|
+
addClass([this.noRecord], NODATACONTAINER);
|
|
8140
|
+
prepend([this.noRecord], this.popupDiv);
|
|
7110
8141
|
};
|
|
7111
8142
|
DropDownTree.prototype.updateRecordTemplate = function (action) {
|
|
7112
8143
|
if (this.treeItems && this.treeItems.length <= 0) {
|
|
@@ -7965,14 +8996,18 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7965
8996
|
if (!isNaN(height) && this.getModuleName() !== 'autocomplete') {
|
|
7966
8997
|
this.removeFocus();
|
|
7967
8998
|
var fixedHead = this.fields.groupBy ? this.liCollections[0].offsetHeight : 0;
|
|
7968
|
-
this.
|
|
8999
|
+
if (!this.enableVirtualization) {
|
|
9000
|
+
this.list.scrollTop = count * height + fixedHead;
|
|
9001
|
+
}
|
|
7969
9002
|
addClass([activeElement], dropDownListClasses.focus);
|
|
7970
9003
|
}
|
|
7971
9004
|
}
|
|
7972
9005
|
else {
|
|
7973
9006
|
if (this.isSelectCustom && this.inputElement.value.trim() !== '') {
|
|
7974
9007
|
this.removeFocus();
|
|
7975
|
-
this.
|
|
9008
|
+
if (!this.enableVirtualization) {
|
|
9009
|
+
this.list.scrollTop = 0;
|
|
9010
|
+
}
|
|
7976
9011
|
}
|
|
7977
9012
|
}
|
|
7978
9013
|
return activeElement;
|
|
@@ -8108,7 +9143,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8108
9143
|
else if (this.inputElement.value === '') {
|
|
8109
9144
|
this.activeIndex = null;
|
|
8110
9145
|
if (!isNullOrUndefined(this.list)) {
|
|
8111
|
-
this.
|
|
9146
|
+
if (!this.enableVirtualization) {
|
|
9147
|
+
this.list.scrollTop = 0;
|
|
9148
|
+
}
|
|
8112
9149
|
var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
|
|
8113
9150
|
this.setHoverList(focusItem);
|
|
8114
9151
|
}
|
|
@@ -8666,7 +9703,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8666
9703
|
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
8667
9704
|
}
|
|
8668
9705
|
}
|
|
8669
|
-
if (!isNullOrUndefined(this.suggestionCount)) {
|
|
9706
|
+
if (!isNullOrUndefined(this.suggestionCount) && !this.enableVirtualization) {
|
|
8670
9707
|
// Since defualt value of suggestioncount is 20, checked the condition
|
|
8671
9708
|
if (this.suggestionCount !== 20) {
|
|
8672
9709
|
for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
@@ -8677,12 +9714,19 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8677
9714
|
}
|
|
8678
9715
|
filterQuery.take(this.suggestionCount);
|
|
8679
9716
|
}
|
|
9717
|
+
if (this.enableVirtualization) {
|
|
9718
|
+
var takeValue = this.getTakeValue();
|
|
9719
|
+
filterQuery.skip(this.virtualItemStartIndex);
|
|
9720
|
+
filterQuery.take(takeValue);
|
|
9721
|
+
filterQuery.requiresCount();
|
|
9722
|
+
}
|
|
8680
9723
|
return filterQuery;
|
|
8681
9724
|
};
|
|
8682
9725
|
AutoComplete.prototype.searchLists = function (e) {
|
|
8683
9726
|
var _this_1 = this;
|
|
8684
9727
|
this.isTyped = true;
|
|
8685
9728
|
this.isDataFetched = this.isSelectCustom = false;
|
|
9729
|
+
this.checkAndResetCache();
|
|
8686
9730
|
if (isNullOrUndefined(this.list)) {
|
|
8687
9731
|
_super.prototype.renderList.call(this, e, true);
|
|
8688
9732
|
}
|
|
@@ -8729,8 +9773,32 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8729
9773
|
};
|
|
8730
9774
|
AutoComplete.prototype.filterAction = function (dataSource, query, fields, e) {
|
|
8731
9775
|
this.beforePopupOpen = true;
|
|
9776
|
+
var isNoDataElement = this.list.classList.contains('e-nodata');
|
|
8732
9777
|
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
9778
|
+
if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
|
|
9779
|
+
this.isPreventScrollAction = true;
|
|
9780
|
+
this.list.scrollTop = 0;
|
|
9781
|
+
this.previousStartIndex = 0;
|
|
9782
|
+
this.virtualListInfo = null;
|
|
9783
|
+
}
|
|
8733
9784
|
this.resetList(dataSource, fields, query, e);
|
|
9785
|
+
if (this.enableVirtualization && isNoDataElement && !this.list.classList.contains('e-nodata')) {
|
|
9786
|
+
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
9787
|
+
this.list.appendChild(this.createElement('div', {
|
|
9788
|
+
className: 'e-virtual-ddl-content',
|
|
9789
|
+
styles: this.getTransformValues()
|
|
9790
|
+
})).appendChild(this.list.querySelector('.e-list-parent'));
|
|
9791
|
+
}
|
|
9792
|
+
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
9793
|
+
var virualElement = this.createElement('div', {
|
|
9794
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
9795
|
+
});
|
|
9796
|
+
document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
9797
|
+
}
|
|
9798
|
+
}
|
|
9799
|
+
if (this.enableVirtualization) {
|
|
9800
|
+
this.getFilteringSkeletonCount();
|
|
9801
|
+
}
|
|
8734
9802
|
}
|
|
8735
9803
|
else {
|
|
8736
9804
|
this.hidePopup(e);
|
|
@@ -8741,6 +9809,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8741
9809
|
AutoComplete.prototype.clearAll = function (e, property) {
|
|
8742
9810
|
if (isNullOrUndefined(property) || (!isNullOrUndefined(property) && isNullOrUndefined(property.dataSource))) {
|
|
8743
9811
|
_super.prototype.clearAll.call(this, e);
|
|
9812
|
+
this.checkAndResetCache();
|
|
8744
9813
|
}
|
|
8745
9814
|
if (this.beforePopupOpen) {
|
|
8746
9815
|
this.hidePopup();
|
|
@@ -8823,7 +9892,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8823
9892
|
return true;
|
|
8824
9893
|
};
|
|
8825
9894
|
AutoComplete.prototype.renderPopup = function (e) {
|
|
8826
|
-
this.
|
|
9895
|
+
if (!this.enableVirtualization) {
|
|
9896
|
+
this.list.scrollTop = 0;
|
|
9897
|
+
}
|
|
8827
9898
|
_super.prototype.renderPopup.call(this, e);
|
|
8828
9899
|
};
|
|
8829
9900
|
AutoComplete.prototype.isEditTextBox = function () {
|
|
@@ -8891,6 +9962,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8891
9962
|
AutoComplete.prototype.hidePopup = function (e) {
|
|
8892
9963
|
_super.prototype.hidePopup.call(this, e);
|
|
8893
9964
|
this.activeIndex = null;
|
|
9965
|
+
this.virtualListInfo = this.viewPortInfo;
|
|
9966
|
+
this.previousStartIndex = this.viewPortInfo.startIndex;
|
|
9967
|
+
this.startIndex = this.viewPortInfo.startIndex;
|
|
9968
|
+
this.previousEndIndex = this.viewPortInfo.endIndex;
|
|
8894
9969
|
};
|
|
8895
9970
|
/**
|
|
8896
9971
|
* Dynamically change the value of properties.
|
|
@@ -9427,6 +10502,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9427
10502
|
if (_this.isFirstClick) {
|
|
9428
10503
|
_this.loadTemplate();
|
|
9429
10504
|
}
|
|
10505
|
+
if (_this.mode === 'CheckBox' && _this.showSelectAll) {
|
|
10506
|
+
EventHandler.add(_this.popupObj.element, 'click', _this.clickHandler, _this);
|
|
10507
|
+
}
|
|
9430
10508
|
}
|
|
9431
10509
|
});
|
|
9432
10510
|
};
|
|
@@ -10433,11 +11511,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10433
11511
|
};
|
|
10434
11512
|
MultiSelect.prototype.spaceKeySelection = function (e) {
|
|
10435
11513
|
if (this.mode === 'CheckBox') {
|
|
10436
|
-
|
|
11514
|
+
var li = this.list.querySelector('li.' + dropDownBaseClasses.focus);
|
|
11515
|
+
var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
11516
|
+
if (!isNullOrUndefined(li) || (selectAllParent && selectAllParent.classList.contains('e-item-focus'))) {
|
|
10437
11517
|
e.preventDefault();
|
|
10438
11518
|
this.keyAction = true;
|
|
10439
11519
|
}
|
|
10440
11520
|
this.selectByKey(e);
|
|
11521
|
+
if (this.keyAction) {
|
|
11522
|
+
var li_1 = this.list.querySelector('li.' + dropDownBaseClasses.focus);
|
|
11523
|
+
if (!isNullOrUndefined(li_1) && selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
11524
|
+
li_1.classList.remove('e-item-focus');
|
|
11525
|
+
}
|
|
11526
|
+
}
|
|
10441
11527
|
}
|
|
10442
11528
|
this.checkPlaceholderSize();
|
|
10443
11529
|
};
|
|
@@ -10593,9 +11679,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10593
11679
|
}
|
|
10594
11680
|
}
|
|
10595
11681
|
var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
10596
|
-
if (selectAllParent && !selectAllParent.classList.contains('e-item-focus')) {
|
|
10597
|
-
e.preventDefault();
|
|
10598
|
-
}
|
|
10599
11682
|
if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
10600
11683
|
var selectAllCheckBox = selectAllParent.childNodes[0];
|
|
10601
11684
|
if (!selectAllCheckBox.classList.contains('e-check')) {
|
|
@@ -10668,6 +11751,14 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10668
11751
|
}
|
|
10669
11752
|
this.updateAriaAttribute();
|
|
10670
11753
|
};
|
|
11754
|
+
MultiSelect.prototype.clickHandler = function (e) {
|
|
11755
|
+
var targetElement = e.target;
|
|
11756
|
+
var filterInputClassName = targetElement.className;
|
|
11757
|
+
var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
11758
|
+
if ((filterInputClassName === 'e-input-filter e-input' || filterInputClassName === 'e-input-group e-control-wrapper e-input-focus') && selectAllParent.classList.contains('e-item-focus')) {
|
|
11759
|
+
selectAllParent.classList.remove('e-item-focus');
|
|
11760
|
+
}
|
|
11761
|
+
};
|
|
10671
11762
|
MultiSelect.prototype.moveByList = function (position) {
|
|
10672
11763
|
if (this.list) {
|
|
10673
11764
|
var elements = this.list.querySelectorAll('li.'
|
|
@@ -10682,12 +11773,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10682
11773
|
var temp = -1;
|
|
10683
11774
|
var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
10684
11775
|
if (this.mode === 'CheckBox' && this.showSelectAll && position == 1 && !isNullOrUndefined(selectAllParent) && !selectAllParent.classList.contains('e-item-focus') && this.list.getElementsByClassName('e-item-focus').length == 0 && this.liCollections.length > 1) {
|
|
10685
|
-
selectAllParent.classList.
|
|
11776
|
+
if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
|
|
11777
|
+
selectAllParent.classList.remove('e-item-focus');
|
|
11778
|
+
}
|
|
11779
|
+
else if (!selectAllParent.classList.contains('e-item-focus')) {
|
|
11780
|
+
selectAllParent.classList.add('e-item-focus');
|
|
11781
|
+
}
|
|
10686
11782
|
}
|
|
10687
11783
|
else if (elements.length) {
|
|
10688
|
-
if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent)) {
|
|
10689
|
-
selectAllParent.classList.
|
|
10690
|
-
|
|
11784
|
+
if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent && position == -1)) {
|
|
11785
|
+
if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
|
|
11786
|
+
selectAllParent.classList.remove('e-item-focus');
|
|
11787
|
+
}
|
|
11788
|
+
else if (this.focusFirstListItem && !selectAllParent.classList.contains('e-item-focus')) {
|
|
10691
11789
|
selectAllParent.classList.add('e-item-focus');
|
|
10692
11790
|
}
|
|
10693
11791
|
}
|
|
@@ -11119,6 +12217,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11119
12217
|
}
|
|
11120
12218
|
return checkTemplate;
|
|
11121
12219
|
};
|
|
12220
|
+
MultiSelect.prototype.encodeHtmlEntities = function (input) {
|
|
12221
|
+
return input.replace(/[\u00A0-\u9999<>&]/g, function (match) {
|
|
12222
|
+
return "&#" + match.charCodeAt(0) + ";";
|
|
12223
|
+
});
|
|
12224
|
+
};
|
|
11122
12225
|
MultiSelect.prototype.getChip = function (data, value, e) {
|
|
11123
12226
|
var _this = this;
|
|
11124
12227
|
var itemData = { text: value, value: value };
|
|
@@ -11151,7 +12254,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11151
12254
|
chipContent.innerText = data;
|
|
11152
12255
|
}
|
|
11153
12256
|
else {
|
|
11154
|
-
chipContent.innerHTML = data;
|
|
12257
|
+
chipContent.innerHTML = this.encodeHtmlEntities(data);
|
|
11155
12258
|
}
|
|
11156
12259
|
chip.appendChild(chipContent);
|
|
11157
12260
|
var eventArgs = {
|
|
@@ -12193,10 +13296,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12193
13296
|
};
|
|
12194
13297
|
MultiSelect.prototype.updateWrapperText = function (wrapperType, wrapperData) {
|
|
12195
13298
|
if (this.valueTemplate || !this.enableHtmlSanitizer) {
|
|
12196
|
-
wrapperType.innerHTML = wrapperData;
|
|
13299
|
+
wrapperType.innerHTML = this.encodeHtmlEntities(wrapperData);
|
|
12197
13300
|
}
|
|
12198
13301
|
else {
|
|
12199
|
-
wrapperType.innerText =
|
|
13302
|
+
wrapperType.innerText = wrapperData;
|
|
12200
13303
|
}
|
|
12201
13304
|
};
|
|
12202
13305
|
MultiSelect.prototype.updateDelimView = function () {
|
|
@@ -12955,6 +14058,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12955
14058
|
_this.popupObj.hide();
|
|
12956
14059
|
removeClass([document.body, _this.popupObj.element], 'e-popup-full-page');
|
|
12957
14060
|
EventHandler.remove(_this.list, 'keydown', _this.onKeyDown);
|
|
14061
|
+
if (_this.mode === 'CheckBox' && _this.showSelectAll) {
|
|
14062
|
+
EventHandler.remove(_this.popupObj.element, 'click', _this.clickHandler);
|
|
14063
|
+
}
|
|
12958
14064
|
}
|
|
12959
14065
|
});
|
|
12960
14066
|
}
|
|
@@ -13718,7 +14824,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13718
14824
|
};
|
|
13719
14825
|
CheckBoxSelection.prototype.clickHandler = function (e) {
|
|
13720
14826
|
var target;
|
|
13721
|
-
if (e.currentTarget.classList.contains(this.checkAllParent.className)) {
|
|
14827
|
+
if (e.currentTarget.classList.contains(this.checkAllParent.className) || (e.currentTarget.classList.value === this.checkAllParent.className)) {
|
|
13722
14828
|
target = e.currentTarget.firstElementChild.lastElementChild;
|
|
13723
14829
|
}
|
|
13724
14830
|
else {
|
|
@@ -17173,7 +18279,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
17173
18279
|
_this.trigger('opened', eventArgs, function (eventArgs) {
|
|
17174
18280
|
if (!eventArgs.cancel) {
|
|
17175
18281
|
_this.renderReactTemplates();
|
|
17176
|
-
|
|
18282
|
+
if (_this.popupObj) {
|
|
18283
|
+
_this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
|
|
18284
|
+
}
|
|
17177
18285
|
if (isNullOrUndefined(_this.getTriggerCharPosition())) {
|
|
17178
18286
|
return;
|
|
17179
18287
|
}
|
|
@@ -17886,6 +18994,11 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
17886
18994
|
if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
|
|
17887
18995
|
return;
|
|
17888
18996
|
}
|
|
18997
|
+
this.previousSelectedLI = null;
|
|
18998
|
+
this.item = null;
|
|
18999
|
+
this.selectedLI = null;
|
|
19000
|
+
this.inputElement.innerText = null;
|
|
19001
|
+
this.popupObj = null;
|
|
17889
19002
|
_super.prototype.destroy.call(this);
|
|
17890
19003
|
};
|
|
17891
19004
|
Mention.prototype.getLocaleName = function () {
|
|
@@ -18016,5 +19129,5 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
18016
19129
|
* export all modules from current location
|
|
18017
19130
|
*/
|
|
18018
19131
|
|
|
18019
|
-
export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox, Mention };
|
|
19132
|
+
export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, VirtualScroll, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox, Mention };
|
|
18020
19133
|
//# sourceMappingURL=ej2-dropdowns.es5.js.map
|