@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
|
|
|
@@ -189,6 +190,324 @@ function revertHighlightSearch(content) {
|
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
|
|
193
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
194
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
195
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
196
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
197
|
+
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
198
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
class VirtualScroll {
|
|
202
|
+
constructor(parent) {
|
|
203
|
+
this.sentinelInfo = {
|
|
204
|
+
'up': {
|
|
205
|
+
check: (rect, info) => {
|
|
206
|
+
let top = rect.top - this.containerElementRect.top;
|
|
207
|
+
info.entered = top >= 0;
|
|
208
|
+
return top + (this.parent.listItemHeight * this.parent.virtualItemCount / 2) >= 0;
|
|
209
|
+
},
|
|
210
|
+
axis: 'Y'
|
|
211
|
+
},
|
|
212
|
+
'down': {
|
|
213
|
+
check: (rect, info) => {
|
|
214
|
+
let cHeight = this.parent.popupContentElement.clientHeight;
|
|
215
|
+
let top = rect.bottom;
|
|
216
|
+
info.entered = rect.bottom <= this.containerElementRect.bottom;
|
|
217
|
+
return top - (this.parent.listItemHeight * this.parent.virtualItemCount / 2) <= this.parent.listItemHeight * this.parent.virtualItemCount / 2;
|
|
218
|
+
}, axis: 'Y'
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
this.parent = parent;
|
|
222
|
+
this.removeEventListener();
|
|
223
|
+
this.addEventListener();
|
|
224
|
+
}
|
|
225
|
+
addEventListener() {
|
|
226
|
+
if (this.parent.isDestroyed) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
this.parent.on('observe', this.observe, this);
|
|
230
|
+
this.parent.on('setGeneratedData', this.setGeneratedData, this);
|
|
231
|
+
this.parent.on('dataProcessAsync', this.dataProcessAsync, this);
|
|
232
|
+
this.parent.on('setCurrentViewDataAsync', this.setCurrentViewDataAsync, this);
|
|
233
|
+
this.parent.on('bindScrollEvent', this.bindScrollEvent, this);
|
|
234
|
+
}
|
|
235
|
+
removeEventListener() {
|
|
236
|
+
if (this.parent.isDestroyed) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this.parent.off('observe', this.observe);
|
|
240
|
+
this.parent.off('setGeneratedData', this.setGeneratedData);
|
|
241
|
+
this.parent.off('dataProcessAsync', this.dataProcessAsync);
|
|
242
|
+
this.parent.off('setCurrentViewDataAsync', this.setCurrentViewDataAsync);
|
|
243
|
+
this.parent.off('bindScrollEvent', this.bindScrollEvent);
|
|
244
|
+
}
|
|
245
|
+
bindScrollEvent(component) {
|
|
246
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
247
|
+
this.component = component.component;
|
|
248
|
+
this.observe((scrollArgs) => this.scrollListener(scrollArgs));
|
|
249
|
+
}
|
|
250
|
+
observe(callback) {
|
|
251
|
+
this.containerElementRect = this.parent.popupContentElement.getBoundingClientRect();
|
|
252
|
+
EventHandler.add(this.parent.popupContentElement, 'wheel mousedown', this.popupScrollHandler, this);
|
|
253
|
+
this.touchModule = new Touch(this.parent.popupContentElement, {
|
|
254
|
+
scroll: this.popupScrollHandler.bind(this)
|
|
255
|
+
});
|
|
256
|
+
EventHandler.add(this.parent.popupContentElement, 'scroll', this.virtualScrollHandler(callback), this);
|
|
257
|
+
}
|
|
258
|
+
getModuleName() {
|
|
259
|
+
return 'VirtualScroll';
|
|
260
|
+
}
|
|
261
|
+
popupScrollHandler(e) {
|
|
262
|
+
this.parent.isMouseScrollAction = true;
|
|
263
|
+
this.parent.isPreventScrollAction = false;
|
|
264
|
+
}
|
|
265
|
+
getPageQuery(query, virtualStartIndex, virtualEndIndex) {
|
|
266
|
+
if (virtualEndIndex !== 0 && !this.parent.allowFiltering && this.component !== 'autocomplete') {
|
|
267
|
+
query = query.skip(virtualStartIndex);
|
|
268
|
+
}
|
|
269
|
+
return query;
|
|
270
|
+
}
|
|
271
|
+
setGeneratedData(qStartIndex, recentlyGeneratedData) {
|
|
272
|
+
let loopIteration = 0;
|
|
273
|
+
let endIndex = this.parent.listData.length + this.parent.virtualItemStartIndex;
|
|
274
|
+
for (let i = this.parent.virtualItemStartIndex; i < endIndex; i++) {
|
|
275
|
+
const alreadyAddedData = this.parent.generatedDataObject[i];
|
|
276
|
+
if (!alreadyAddedData) {
|
|
277
|
+
if (recentlyGeneratedData !== null && this.parent.listData.slice(loopIteration, loopIteration + 1).length > 0) {
|
|
278
|
+
const slicedData = this.parent.listData.slice(loopIteration, loopIteration + 1);
|
|
279
|
+
if (slicedData.length > 0) {
|
|
280
|
+
// Safely assign slicedData to this.parent.generatedDataObject[i]
|
|
281
|
+
this.parent.generatedDataObject[i] = slicedData;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
loopIteration++;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
generateAndExecuteQueryAsync(query, virtualItemStartIndex = 0, virtualItemEndIndex = 0, isQueryGenerated = false) {
|
|
289
|
+
let dataSource = this.parent.dataSource;
|
|
290
|
+
if (!isQueryGenerated) {
|
|
291
|
+
query = this.getPageQuery(query, virtualItemStartIndex, virtualItemEndIndex);
|
|
292
|
+
}
|
|
293
|
+
this.parent.resetList(dataSource, this.parent.fields, query);
|
|
294
|
+
}
|
|
295
|
+
setCurrentViewDataAsync() {
|
|
296
|
+
// eslint-disable-next-line
|
|
297
|
+
let currentData = [];
|
|
298
|
+
for (let i = this.parent.viewPortInfo.startIndex; i < this.parent.viewPortInfo.endIndex; i++) {
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
300
|
+
const alreadyAddedData = this.parent.generatedDataObject[i];
|
|
301
|
+
if (alreadyAddedData) {
|
|
302
|
+
currentData.push(alreadyAddedData[0]);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
this.parent.renderItems(currentData, this.parent.fields);
|
|
306
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
307
|
+
const virtualTrackElement = this.parent.list.getElementsByClassName('e-virtual-ddl')[0];
|
|
308
|
+
if (virtualTrackElement) {
|
|
309
|
+
(virtualTrackElement).style = this.parent.GetVirtualTrackHeight();
|
|
310
|
+
}
|
|
311
|
+
this.parent.UpdateSkeleton();
|
|
312
|
+
this.parent.liCollections = this.parent.list.querySelectorAll('.e-list-item');
|
|
313
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
314
|
+
const virtualContentElement = this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0];
|
|
315
|
+
if (virtualContentElement) {
|
|
316
|
+
(virtualContentElement).style = this.parent.getTransformValues();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
generateQueryAndSetQueryIndexAsync(query, isPopupOpen) {
|
|
320
|
+
let isStartIndexInitialised = false;
|
|
321
|
+
let queryStartIndex = 0;
|
|
322
|
+
let queryEndIndex = 0;
|
|
323
|
+
let sortedDataStartIndex = 0;
|
|
324
|
+
let vEndIndex = this.parent && this.parent.viewPortInfo.endIndex !== 0 ? this.parent.viewPortInfo.endIndex : sortedDataStartIndex + this.parent.getItems().length;
|
|
325
|
+
if (!isPopupOpen && vEndIndex !== 0) {
|
|
326
|
+
for (let i = this.parent.viewPortInfo.startIndex; i <= vEndIndex; i++) {
|
|
327
|
+
if (!(i in this.parent.generatedDataObject)) {
|
|
328
|
+
if (!isStartIndexInitialised) {
|
|
329
|
+
isStartIndexInitialised = true;
|
|
330
|
+
queryStartIndex = queryEndIndex = i;
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
queryEndIndex = i === vEndIndex ? i : i + 1;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (isStartIndexInitialised && !((this.parent.totalItemCount == queryStartIndex) && (this.parent.totalItemCount == queryEndIndex))) {
|
|
339
|
+
this.parent.virtualItemStartIndex = queryStartIndex;
|
|
340
|
+
this.parent.virtualItemEndIndex = queryEndIndex;
|
|
341
|
+
this.generateAndExecuteQueryAsync(query, queryStartIndex, queryEndIndex);
|
|
342
|
+
}
|
|
343
|
+
this.setCurrentViewDataAsync();
|
|
344
|
+
}
|
|
345
|
+
dataProcessAsync(isOpenPopup) {
|
|
346
|
+
this.parent.selectedValueInfo = null;
|
|
347
|
+
this.parent.virtualItemStartIndex = this.parent.viewPortInfo.startIndex;
|
|
348
|
+
this.parent.virtualItemEndIndex = this.parent.viewPortInfo.endIndex;
|
|
349
|
+
this.generateQueryAndSetQueryIndexAsync(new Query(), isOpenPopup);
|
|
350
|
+
}
|
|
351
|
+
virtualScrollRefreshAsync() {
|
|
352
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
353
|
+
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;
|
|
354
|
+
if (this.parent.allowFiltering || this.component === 'autocomplete') {
|
|
355
|
+
if (!isNullOrUndefined(this.parent.typedString) && !(this.component === 'combobox' && !isNullOrUndefined(this.parent.typedString) && this.parent.allowFiltering)) {
|
|
356
|
+
if (this.parent.viewPortInfo.endIndex >= this.parent.dataCount) {
|
|
357
|
+
this.parent.viewPortInfo.endIndex = this.parent.dataCount;
|
|
358
|
+
}
|
|
359
|
+
if (this.parent.viewPortInfo.startIndex >= this.parent.dataCount) {
|
|
360
|
+
this.parent.viewPortInfo.startIndex = this.parent.dataCount - this.parent.itemCount;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
this.parent.getSkeletonCount(true);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
yield this.dataProcessAsync();
|
|
368
|
+
if (this.parent.keyboardEvent != null) {
|
|
369
|
+
this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
|
|
370
|
+
}
|
|
371
|
+
this.parent.isCustomFilter = false;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
scrollListener(scrollArgs) {
|
|
375
|
+
if (!this.parent.isPreventScrollAction) {
|
|
376
|
+
let info = scrollArgs.sentinel;
|
|
377
|
+
let pStartIndex = this.parent.previousStartIndex;
|
|
378
|
+
this.parent.viewPortInfo = this.getInfoFromView(scrollArgs.direction, info, scrollArgs.offset, false);
|
|
379
|
+
this.parent.isUpwardScrolling = false;
|
|
380
|
+
if (this.parent.previousStartIndex !== pStartIndex && !this.parent.isKeyBoardAction) {
|
|
381
|
+
this.parent.isScrollActionTriggered = false;
|
|
382
|
+
this.parent.currentPageNumber = this.parent.viewPortInfo.currentPageNumber;
|
|
383
|
+
this.parent.virtualListInfo = Object.assign({}, this.parent.viewPortInfo);
|
|
384
|
+
this.parent.isPreventKeyAction = true;
|
|
385
|
+
this.parent.isVirtualScrolling = true;
|
|
386
|
+
setTimeout(() => {
|
|
387
|
+
this.parent.pageCount = this.parent.getPageCount();
|
|
388
|
+
this.virtualScrollRefreshAsync().then(() => {
|
|
389
|
+
if (this.parent.popupObj) {
|
|
390
|
+
this.parent.list = this.parent.popupObj.element.querySelector('.' + 'e-content') || select('.' + 'e-content');
|
|
391
|
+
this.parent.updateSelectionList();
|
|
392
|
+
this.parent.liCollections = this.parent.getItems();
|
|
393
|
+
}
|
|
394
|
+
this.parent.isKeyBoardAction = false;
|
|
395
|
+
this.parent.isVirtualScrolling = false;
|
|
396
|
+
this.parent.isPreventKeyAction = false;
|
|
397
|
+
});
|
|
398
|
+
}, 5);
|
|
399
|
+
}
|
|
400
|
+
else if (this.parent.isScrollActionTriggered) {
|
|
401
|
+
this.parent.isPreventKeyAction = false;
|
|
402
|
+
this.parent.isScrollActionTriggered = false;
|
|
403
|
+
let virtualListCount = this.parent.list.querySelectorAll('.e-virtual-list').length;
|
|
404
|
+
let listElement = this.parent.list.querySelector('.' + 'e-list-item');
|
|
405
|
+
let translateY = scrollArgs.offset.top - (listElement.offsetHeight * virtualListCount);
|
|
406
|
+
this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0].style.transform = "translate(0px," + translateY + "px)";
|
|
407
|
+
}
|
|
408
|
+
this.parent.previousInfo = this.parent.viewPortInfo;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
getPageCount(popupElement, returnExactCount = false) {
|
|
412
|
+
var list = popupElement && popupElement.querySelector('.e-content');
|
|
413
|
+
if (list) {
|
|
414
|
+
var liHeight = list.classList.contains('e-nodata') ? null : getComputedStyle(list.querySelectorAll('.e-list-item')[0], null).getPropertyValue('height');
|
|
415
|
+
var pageCount = list.getBoundingClientRect().height / parseInt(liHeight, 10);
|
|
416
|
+
return returnExactCount ? pageCount : Math.round(pageCount);
|
|
417
|
+
}
|
|
418
|
+
return 0;
|
|
419
|
+
}
|
|
420
|
+
;
|
|
421
|
+
getRowHeight() {
|
|
422
|
+
return (isNullOrUndefined(this.parent.liCollections) || this.parent.liCollections.length == 0) ? 0 : Math.ceil(this.parent.liCollections[0].getBoundingClientRect().height);
|
|
423
|
+
}
|
|
424
|
+
getInfoFromView(direction, info, e, isscrollAction) {
|
|
425
|
+
let infoType = {
|
|
426
|
+
direction: direction, sentinelInfo: info, offsets: e,
|
|
427
|
+
startIndex: this.parent.previousStartIndex, endIndex: this.parent.previousEndIndex
|
|
428
|
+
};
|
|
429
|
+
let vHeight = this.parent.popupContentElement.getBoundingClientRect().height;
|
|
430
|
+
//Row Start and End Index calculation
|
|
431
|
+
let rowHeight = this.parent.listItemHeight;
|
|
432
|
+
let exactTopIndex = e.top / rowHeight;
|
|
433
|
+
let infoViewIndices = vHeight / rowHeight;
|
|
434
|
+
let exactEndIndex = exactTopIndex + infoViewIndices;
|
|
435
|
+
let pageSizeBy4 = this.parent.virtualItemCount / 4;
|
|
436
|
+
let totalItemCount = this.parent.totalItemCount;
|
|
437
|
+
if (infoType.direction === 'down') {
|
|
438
|
+
let sIndex = Math.round(exactEndIndex) - Math.round((pageSizeBy4));
|
|
439
|
+
if (isNullOrUndefined(infoType.startIndex) || (exactEndIndex >
|
|
440
|
+
(infoType.startIndex + Math.round((this.parent.virtualItemCount / 2 + pageSizeBy4)))
|
|
441
|
+
&& infoType.endIndex !== totalItemCount)) {
|
|
442
|
+
infoType.startIndex = sIndex >= 0 ? Math.round(sIndex) : 0;
|
|
443
|
+
infoType.startIndex = infoType.startIndex > exactTopIndex ? Math.floor(exactTopIndex) : infoType.startIndex;
|
|
444
|
+
let eIndex = infoType.startIndex + this.parent.virtualItemCount;
|
|
445
|
+
infoType.startIndex = eIndex < exactEndIndex ? (Math.ceil(exactEndIndex) - this.parent.virtualItemCount)
|
|
446
|
+
: infoType.startIndex;
|
|
447
|
+
infoType.endIndex = eIndex < totalItemCount ? eIndex : totalItemCount;
|
|
448
|
+
infoType.startIndex = eIndex >= totalItemCount ? (infoType.endIndex - this.parent.virtualItemCount > 0 ? infoType.endIndex - this.parent.virtualItemCount : 0) : infoType.startIndex;
|
|
449
|
+
infoType.currentPageNumber = Math.ceil(infoType.endIndex / this.parent.virtualItemCount);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
else if (infoType.direction === 'up') {
|
|
453
|
+
if (infoType.startIndex && infoType.endIndex) {
|
|
454
|
+
let loadAtIndex = Math.round(((infoType.startIndex * rowHeight) + (pageSizeBy4 * rowHeight)) / rowHeight);
|
|
455
|
+
if (exactTopIndex < loadAtIndex) {
|
|
456
|
+
let idxAddedToExactTop = (pageSizeBy4) > infoViewIndices ? pageSizeBy4 :
|
|
457
|
+
(infoViewIndices + infoViewIndices / 4);
|
|
458
|
+
let eIndex = Math.round(exactTopIndex + idxAddedToExactTop);
|
|
459
|
+
infoType.endIndex = eIndex < totalItemCount ? eIndex : totalItemCount;
|
|
460
|
+
let sIndex = infoType.endIndex - this.parent.virtualItemCount;
|
|
461
|
+
infoType.startIndex = sIndex > 0 ? sIndex : 0;
|
|
462
|
+
infoType.endIndex = sIndex < 0 ? this.parent.virtualItemCount : infoType.endIndex;
|
|
463
|
+
infoType.currentPageNumber = Math.ceil(infoType.startIndex / this.parent.virtualItemCount);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
if (!isscrollAction) {
|
|
468
|
+
this.parent.previousStartIndex = infoType.startIndex;
|
|
469
|
+
this.parent.startIndex = infoType.startIndex;
|
|
470
|
+
this.parent.previousEndIndex = infoType.endIndex;
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
this.parent.scrollPreStartIndex = infoType.startIndex;
|
|
474
|
+
}
|
|
475
|
+
return infoType;
|
|
476
|
+
}
|
|
477
|
+
virtualScrollHandler(callback) {
|
|
478
|
+
let delay = Browser.info.name === 'chrome' ? 200 : 100;
|
|
479
|
+
let prevTop = 0;
|
|
480
|
+
let debounced100 = debounce(callback, delay);
|
|
481
|
+
let debounced50 = debounce(callback, 50);
|
|
482
|
+
return (e) => {
|
|
483
|
+
let top = e.target.scrollTop;
|
|
484
|
+
let left = e.target.scrollLeft;
|
|
485
|
+
let direction = prevTop < top && !this.parent.isUpwardScrolling ? 'down' : 'up';
|
|
486
|
+
prevTop = top;
|
|
487
|
+
let current = this.sentinelInfo[direction];
|
|
488
|
+
var pstartIndex = this.parent.scrollPreStartIndex;
|
|
489
|
+
var scrollOffsetargs = {
|
|
490
|
+
top: top,
|
|
491
|
+
left: left
|
|
492
|
+
};
|
|
493
|
+
if (this.parent.list.querySelectorAll('.e-virtual-list').length > 0) {
|
|
494
|
+
var infoview = this.getInfoFromView(direction, current, scrollOffsetargs, true);
|
|
495
|
+
if (this.parent.scrollPreStartIndex != pstartIndex && !this.parent.isPreventScrollAction) {
|
|
496
|
+
this.parent.isScrollActionTriggered = true;
|
|
497
|
+
let virtualPoup = (this.parent.list.querySelector('.e-virtual-ddl-content'));
|
|
498
|
+
virtualPoup.style.transform = "translate(0px," + top + "px)";
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
let debounceFunction = debounced100;
|
|
502
|
+
if (current.axis === 'X') {
|
|
503
|
+
debounceFunction = debounced50;
|
|
504
|
+
}
|
|
505
|
+
debounceFunction({ direction: direction, sentinel: current, offset: { top: top, left: left },
|
|
506
|
+
focusElement: document.activeElement });
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
192
511
|
/**
|
|
193
512
|
* Common source
|
|
194
513
|
*/
|
|
@@ -260,6 +579,11 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
260
579
|
this.addedNewItem = false;
|
|
261
580
|
this.isAddNewItemTemplate = false;
|
|
262
581
|
this.isRequesting = false;
|
|
582
|
+
this.isVirtualizationEnabled = false;
|
|
583
|
+
this.isAllowFiltering = false;
|
|
584
|
+
this.virtualizedItemsCount = 0;
|
|
585
|
+
this.totalItemCount = 0;
|
|
586
|
+
this.dataCount = 0;
|
|
263
587
|
}
|
|
264
588
|
getPropObject(prop, newProp, oldProp) {
|
|
265
589
|
const newProperty = new Object();
|
|
@@ -659,11 +983,12 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
659
983
|
this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
|
|
660
984
|
this.trigger('actionComplete', e, (e) => {
|
|
661
985
|
if (!e.cancel) {
|
|
662
|
-
this.isRequesting = false;
|
|
663
986
|
const listItems = e.result;
|
|
664
987
|
if (listItems.length === 0) {
|
|
665
988
|
this.isDataFetched = true;
|
|
666
989
|
}
|
|
990
|
+
this.dataCount = e.count;
|
|
991
|
+
this.totalItemCount = e.count;
|
|
667
992
|
ulElement = this.renderItems(listItems, fields);
|
|
668
993
|
this.onActionComplete(ulElement, listItems, e);
|
|
669
994
|
if (this.groupTemplate) {
|
|
@@ -672,6 +997,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
672
997
|
this.isRequested = false;
|
|
673
998
|
this.bindChildItems(listItems, ulElement, fields, e);
|
|
674
999
|
}
|
|
1000
|
+
this.isRequesting = false;
|
|
675
1001
|
});
|
|
676
1002
|
}).catch((e) => {
|
|
677
1003
|
this.isRequested = false;
|
|
@@ -681,13 +1007,19 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
681
1007
|
});
|
|
682
1008
|
}
|
|
683
1009
|
else {
|
|
1010
|
+
this.isRequesting = false;
|
|
684
1011
|
const dataManager = new DataManager(eventArgs.data);
|
|
685
|
-
|
|
1012
|
+
let listItems = (this.getQuery(eventArgs.query)).executeLocal(dataManager);
|
|
1013
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1014
|
+
this.dataCount = listItems.count;
|
|
1015
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1016
|
+
this.totalItemCount = listItems.count;
|
|
1017
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1018
|
+
listItems = this.isVirtualizationEnabled ? listItems.result : listItems;
|
|
686
1019
|
const localDataArgs = { cancel: false, result: listItems };
|
|
687
1020
|
this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
|
|
688
1021
|
this.trigger('actionComplete', localDataArgs, (localDataArgs) => {
|
|
689
1022
|
if (!localDataArgs.cancel) {
|
|
690
|
-
this.isRequesting = false;
|
|
691
1023
|
ulElement = this.renderItems(localDataArgs.result, fields);
|
|
692
1024
|
this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
693
1025
|
if (this.groupTemplate) {
|
|
@@ -780,6 +1112,11 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
780
1112
|
onActionComplete(ulElement, list, e) {
|
|
781
1113
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
782
1114
|
this.listData = list;
|
|
1115
|
+
if (this.isVirtualizationEnabled) {
|
|
1116
|
+
this.notify("setGeneratedData", {
|
|
1117
|
+
module: "VirtualScroll",
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
783
1120
|
if (this.getModuleName() !== 'listbox') {
|
|
784
1121
|
ulElement.setAttribute('tabindex', '0');
|
|
785
1122
|
}
|
|
@@ -798,11 +1135,13 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
798
1135
|
}
|
|
799
1136
|
}
|
|
800
1137
|
if (!isNullOrUndefined(this.list)) {
|
|
801
|
-
this.
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
1138
|
+
if (!this.isVirtualizationEnabled) {
|
|
1139
|
+
this.list.innerHTML = '';
|
|
1140
|
+
this.list.appendChild(ulElement);
|
|
1141
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1142
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1143
|
+
this.postRender(this.list, list, this.bindEvent);
|
|
1144
|
+
}
|
|
806
1145
|
}
|
|
807
1146
|
}
|
|
808
1147
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -830,6 +1169,11 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
830
1169
|
getQuery(query) {
|
|
831
1170
|
return query ? query : this.query ? this.query : new Query();
|
|
832
1171
|
}
|
|
1172
|
+
updateVirtualizationProperties(itemCount, filtering) {
|
|
1173
|
+
this.isVirtualizationEnabled = true;
|
|
1174
|
+
this.virtualizedItemsCount = itemCount;
|
|
1175
|
+
this.isAllowFiltering = filtering;
|
|
1176
|
+
}
|
|
833
1177
|
/**
|
|
834
1178
|
* To render the template content for group header element.
|
|
835
1179
|
*
|
|
@@ -968,9 +1312,47 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
968
1312
|
new DataManager(dataSource).executeLocal(new Query().take(100))
|
|
969
1313
|
: dataSource;
|
|
970
1314
|
ulElement = this.templateListItem((this.getModuleName() === 'autocomplete') ? spliceData : dataSource, fields);
|
|
1315
|
+
if (this.isVirtualizationEnabled) {
|
|
1316
|
+
var oldUlElement = this.list.querySelector('.e-list-parent');
|
|
1317
|
+
var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
1318
|
+
if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
|
|
1319
|
+
virtualUlElement.replaceChild(ulElement, oldUlElement);
|
|
1320
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1321
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1322
|
+
this.listData = listData;
|
|
1323
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1324
|
+
}
|
|
1325
|
+
else if ((!virtualUlElement)) {
|
|
1326
|
+
this.list.innerHTML = '';
|
|
1327
|
+
this.list.appendChild(ulElement);
|
|
1328
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1329
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1330
|
+
this.listData = listData;
|
|
1331
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
971
1334
|
}
|
|
972
1335
|
else {
|
|
973
1336
|
ulElement = this.createListItems(listData, fields);
|
|
1337
|
+
if (this.isVirtualizationEnabled) {
|
|
1338
|
+
var oldUlElement = this.list.querySelector('.e-list-parent');
|
|
1339
|
+
var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
1340
|
+
if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
|
|
1341
|
+
virtualUlElement.replaceChild(ulElement, oldUlElement);
|
|
1342
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1343
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1344
|
+
this.listData = listData;
|
|
1345
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1346
|
+
}
|
|
1347
|
+
else if ((!virtualUlElement)) {
|
|
1348
|
+
this.list.innerHTML = '';
|
|
1349
|
+
this.list.appendChild(ulElement);
|
|
1350
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1351
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1352
|
+
this.listData = listData;
|
|
1353
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
974
1356
|
}
|
|
975
1357
|
return ulElement;
|
|
976
1358
|
}
|
|
@@ -1110,7 +1492,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1110
1492
|
}
|
|
1111
1493
|
}
|
|
1112
1494
|
updateSelectElementData(isFiltering) {
|
|
1113
|
-
if (isFiltering && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {
|
|
1495
|
+
if ((isFiltering || this.isVirtualizationEnabled) && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {
|
|
1114
1496
|
this.selectData = this.listData;
|
|
1115
1497
|
}
|
|
1116
1498
|
}
|
|
@@ -1124,6 +1506,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1124
1506
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1125
1507
|
updateDataSource(props) {
|
|
1126
1508
|
this.resetList(this.dataSource);
|
|
1509
|
+
this.totalItemCount = this.dataSource instanceof DataManager ? this.dataSource.dataSource.json.length : 0;
|
|
1127
1510
|
}
|
|
1128
1511
|
setUpdateInitial(props, newProp) {
|
|
1129
1512
|
this.isDataFetched = false;
|
|
@@ -1540,6 +1923,7 @@ const dropDownListClasses = {
|
|
|
1540
1923
|
disable: dropDownBaseClasses.disabled,
|
|
1541
1924
|
base: dropDownBaseClasses.root,
|
|
1542
1925
|
focus: dropDownBaseClasses.focus,
|
|
1926
|
+
content: dropDownBaseClasses.content,
|
|
1543
1927
|
input: 'e-input-group',
|
|
1544
1928
|
inputFocus: 'e-input-focus',
|
|
1545
1929
|
icon: 'e-input-group-icon e-ddl-icon',
|
|
@@ -1557,7 +1941,8 @@ const dropDownListClasses = {
|
|
|
1557
1941
|
clearIconHide: 'e-clear-icon-hide',
|
|
1558
1942
|
popupFullScreen: 'e-popup-full-page',
|
|
1559
1943
|
disableIcon: 'e-ddl-disable-icon',
|
|
1560
|
-
hiddenElement: 'e-ddl-hidden'
|
|
1944
|
+
hiddenElement: 'e-ddl-hidden',
|
|
1945
|
+
virtualList: 'e-list-item e-virtual-list',
|
|
1561
1946
|
};
|
|
1562
1947
|
const inputObject = {
|
|
1563
1948
|
container: null,
|
|
@@ -1584,9 +1969,52 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1584
1969
|
*/
|
|
1585
1970
|
constructor(options, element) {
|
|
1586
1971
|
super(options, element);
|
|
1972
|
+
this.skeletonCount = 32;
|
|
1587
1973
|
this.isListSearched = false;
|
|
1588
1974
|
this.preventChange = false;
|
|
1589
1975
|
this.isAngular = false;
|
|
1976
|
+
this.itemCount = 10;
|
|
1977
|
+
this.virtualListHeight = 0;
|
|
1978
|
+
this.isVirtualScrolling = false;
|
|
1979
|
+
this.isPreventScrollAction = false;
|
|
1980
|
+
this.scrollPreStartIndex = 0;
|
|
1981
|
+
this.isScrollActionTriggered = false;
|
|
1982
|
+
this.previousStartIndex = 0;
|
|
1983
|
+
this.isMouseScrollAction = false;
|
|
1984
|
+
this.isKeyBoardAction = false;
|
|
1985
|
+
this.isUpwardScrolling = false;
|
|
1986
|
+
this.startIndex = 0;
|
|
1987
|
+
this.currentPageNumber = 0;
|
|
1988
|
+
this.pageCount = 0;
|
|
1989
|
+
this.isPreventKeyAction = false;
|
|
1990
|
+
this.generatedDataObject = {};
|
|
1991
|
+
this.virtualListInfo = {
|
|
1992
|
+
currentPageNumber: null,
|
|
1993
|
+
direction: null,
|
|
1994
|
+
sentinelInfo: {},
|
|
1995
|
+
offsets: {},
|
|
1996
|
+
startIndex: 0,
|
|
1997
|
+
endIndex: 0,
|
|
1998
|
+
};
|
|
1999
|
+
this.viewPortInfo = {
|
|
2000
|
+
currentPageNumber: null,
|
|
2001
|
+
direction: null,
|
|
2002
|
+
sentinelInfo: {},
|
|
2003
|
+
offsets: {},
|
|
2004
|
+
startIndex: 0,
|
|
2005
|
+
endIndex: 0,
|
|
2006
|
+
};
|
|
2007
|
+
this.selectedValueInfo = {
|
|
2008
|
+
currentPageNumber: null,
|
|
2009
|
+
direction: null,
|
|
2010
|
+
sentinelInfo: {},
|
|
2011
|
+
offsets: {},
|
|
2012
|
+
startIndex: 0,
|
|
2013
|
+
endIndex: 0,
|
|
2014
|
+
};
|
|
2015
|
+
this.IsScrollerAtEnd = function () {
|
|
2016
|
+
return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
|
|
2017
|
+
};
|
|
1590
2018
|
}
|
|
1591
2019
|
/**
|
|
1592
2020
|
* Initialize the event handler.
|
|
@@ -1644,14 +2072,31 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1644
2072
|
hide: 'alt+38',
|
|
1645
2073
|
space: '32'
|
|
1646
2074
|
};
|
|
2075
|
+
this.viewPortInfo = {
|
|
2076
|
+
currentPageNumber: null,
|
|
2077
|
+
direction: null,
|
|
2078
|
+
sentinelInfo: {},
|
|
2079
|
+
offsets: {},
|
|
2080
|
+
startIndex: 0,
|
|
2081
|
+
endIndex: this.itemCount,
|
|
2082
|
+
};
|
|
1647
2083
|
}
|
|
1648
2084
|
setZIndex() {
|
|
1649
2085
|
if (this.popupObj) {
|
|
1650
2086
|
this.popupObj.setProperties({ 'zIndex': this.zIndex });
|
|
1651
2087
|
}
|
|
1652
2088
|
}
|
|
2089
|
+
requiredModules() {
|
|
2090
|
+
const modules = [];
|
|
2091
|
+
if (this.enableVirtualization) {
|
|
2092
|
+
modules.push({ args: [this], member: 'VirtualScroll' });
|
|
2093
|
+
}
|
|
2094
|
+
return modules;
|
|
2095
|
+
}
|
|
1653
2096
|
renderList(e, isEmptyData) {
|
|
1654
2097
|
super.render(e, isEmptyData);
|
|
2098
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2099
|
+
this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
1655
2100
|
this.unWireListEvents();
|
|
1656
2101
|
this.wireListEvents();
|
|
1657
2102
|
}
|
|
@@ -1669,6 +2114,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1669
2114
|
resetHandler(e) {
|
|
1670
2115
|
e.preventDefault();
|
|
1671
2116
|
this.clearAll(e);
|
|
2117
|
+
if (this.enableVirtualization) {
|
|
2118
|
+
this.list.scrollTop = 0;
|
|
2119
|
+
this.virtualListInfo = null;
|
|
2120
|
+
this.previousStartIndex = 0;
|
|
2121
|
+
this.previousEndIndex = 0;
|
|
2122
|
+
}
|
|
1672
2123
|
}
|
|
1673
2124
|
resetFocusElement() {
|
|
1674
2125
|
this.removeHover();
|
|
@@ -1676,7 +2127,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1676
2127
|
this.removeFocus();
|
|
1677
2128
|
this.list.scrollTop = 0;
|
|
1678
2129
|
if (this.getModuleName() !== 'autocomplete' && !isNullOrUndefined(this.ulElement)) {
|
|
1679
|
-
|
|
2130
|
+
let li = this.ulElement.querySelector('.' + dropDownListClasses.li);
|
|
2131
|
+
if (this.enableVirtualization) {
|
|
2132
|
+
li = this.liCollections[this.skeletonCount];
|
|
2133
|
+
}
|
|
1680
2134
|
if (li) {
|
|
1681
2135
|
li.classList.add(dropDownListClasses.focus);
|
|
1682
2136
|
}
|
|
@@ -1695,6 +2149,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1695
2149
|
return;
|
|
1696
2150
|
}
|
|
1697
2151
|
this.onChangeEvent(e);
|
|
2152
|
+
this.checkAndResetCache();
|
|
2153
|
+
if (this.enableVirtualization) {
|
|
2154
|
+
this.updateInitialData();
|
|
2155
|
+
}
|
|
1698
2156
|
}
|
|
1699
2157
|
resetSelection(properties) {
|
|
1700
2158
|
if (this.list) {
|
|
@@ -1760,10 +2218,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1760
2218
|
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[`${htmlAttr}`]);
|
|
1761
2219
|
}
|
|
1762
2220
|
else if (htmlAttr === 'aria-label') {
|
|
1763
|
-
if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
|
|
2221
|
+
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
|
|
1764
2222
|
this.inputElement.setAttribute('aria-label', this.htmlAttributes[`${htmlAttr}`]);
|
|
1765
2223
|
}
|
|
1766
|
-
else {
|
|
2224
|
+
else if (this.getModuleName() === 'dropdownlist') {
|
|
1767
2225
|
this.inputWrapper.container.setAttribute('aria-label', this.htmlAttributes[`${htmlAttr}`]);
|
|
1768
2226
|
}
|
|
1769
2227
|
}
|
|
@@ -1862,6 +2320,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1862
2320
|
return item;
|
|
1863
2321
|
}
|
|
1864
2322
|
initValue() {
|
|
2323
|
+
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
2324
|
+
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
|
|
1865
2325
|
this.renderList();
|
|
1866
2326
|
if (this.dataSource instanceof DataManager) {
|
|
1867
2327
|
this.initRemoteRender = true;
|
|
@@ -1871,6 +2331,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1871
2331
|
}
|
|
1872
2332
|
}
|
|
1873
2333
|
updateValues() {
|
|
2334
|
+
this.selectedValueInfo = this.viewPortInfo;
|
|
1874
2335
|
if (!isNullOrUndefined(this.value)) {
|
|
1875
2336
|
this.setSelection(this.getElementByValue(this.value), null);
|
|
1876
2337
|
}
|
|
@@ -2059,6 +2520,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2059
2520
|
}
|
|
2060
2521
|
onMouseClick(e) {
|
|
2061
2522
|
const target = e.target;
|
|
2523
|
+
this.keyboardEvent = null;
|
|
2062
2524
|
const li = closest(target, '.' + dropDownBaseClasses.li);
|
|
2063
2525
|
if (!this.isValidLI(li)) {
|
|
2064
2526
|
return;
|
|
@@ -2139,6 +2601,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2139
2601
|
if (!this.enabled) {
|
|
2140
2602
|
return;
|
|
2141
2603
|
}
|
|
2604
|
+
this.keyboardEvent = e;
|
|
2605
|
+
if (this.isPreventKeyAction && this.enableVirtualization) {
|
|
2606
|
+
e.preventDefault();
|
|
2607
|
+
}
|
|
2142
2608
|
const preventAction = e.action === 'pageUp' || e.action === 'pageDown';
|
|
2143
2609
|
const preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');
|
|
2144
2610
|
this.isEscapeKey = e.action === 'escape';
|
|
@@ -2178,9 +2644,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2178
2644
|
e.preventDefault();
|
|
2179
2645
|
break;
|
|
2180
2646
|
case 'home':
|
|
2647
|
+
this.isMouseScrollAction = true;
|
|
2181
2648
|
this.updateHomeEndAction(e);
|
|
2182
2649
|
break;
|
|
2183
2650
|
case 'end':
|
|
2651
|
+
this.isMouseScrollAction = true;
|
|
2184
2652
|
this.updateHomeEndAction(e);
|
|
2185
2653
|
break;
|
|
2186
2654
|
case 'space':
|
|
@@ -2214,13 +2682,19 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2214
2682
|
}
|
|
2215
2683
|
}
|
|
2216
2684
|
}
|
|
2217
|
-
updateUpDownAction(e) {
|
|
2685
|
+
updateUpDownAction(e, isVirtualKeyAction) {
|
|
2218
2686
|
const focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
2219
|
-
if (this.isSelectFocusItem(focusEle)) {
|
|
2687
|
+
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
2220
2688
|
this.setSelection(focusEle, e);
|
|
2689
|
+
if (this.enableVirtualization) {
|
|
2690
|
+
let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
2691
|
+
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
2692
|
+
}
|
|
2221
2693
|
}
|
|
2222
2694
|
else if (!isNullOrUndefined(this.liCollections)) {
|
|
2695
|
+
let virtualIndex = this.activeIndex;
|
|
2223
2696
|
let index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
|
|
2697
|
+
index = isVirtualKeyAction ? virtualIndex : index;
|
|
2224
2698
|
let startIndex = 0;
|
|
2225
2699
|
if (this.getModuleName() === 'autocomplete') {
|
|
2226
2700
|
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
@@ -2228,8 +2702,26 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2228
2702
|
}
|
|
2229
2703
|
let nextItem;
|
|
2230
2704
|
if (this.getModuleName() !== 'autocomplete' || this.getModuleName() === 'autocomplete' && this.isPopupOpen) {
|
|
2231
|
-
|
|
2232
|
-
|
|
2705
|
+
if (!this.enableVirtualization) {
|
|
2706
|
+
nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
|
|
2707
|
+
: this.liCollections[index];
|
|
2708
|
+
}
|
|
2709
|
+
else {
|
|
2710
|
+
if (!isVirtualKeyAction) {
|
|
2711
|
+
nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[this.skeletonCount]
|
|
2712
|
+
: this.liCollections[index];
|
|
2713
|
+
nextItem = !isNullOrUndefined(nextItem) && !nextItem.classList.contains('e-virtual-list') ? nextItem : null;
|
|
2714
|
+
}
|
|
2715
|
+
else {
|
|
2716
|
+
if (this.getModuleName() === 'autocomplete') {
|
|
2717
|
+
var value = this.selectedLI.dataset.value;
|
|
2718
|
+
nextItem = this.getElementByValue(value);
|
|
2719
|
+
}
|
|
2720
|
+
else {
|
|
2721
|
+
nextItem = this.getElementByValue(this.getItemData().value);
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2233
2725
|
}
|
|
2234
2726
|
if (!isNullOrUndefined(nextItem)) {
|
|
2235
2727
|
this.setSelection(nextItem, e);
|
|
@@ -2237,17 +2729,23 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2237
2729
|
}
|
|
2238
2730
|
e.preventDefault();
|
|
2239
2731
|
}
|
|
2240
|
-
updateHomeEndAction(e) {
|
|
2732
|
+
updateHomeEndAction(e, isVirtualKeyAction) {
|
|
2241
2733
|
if (this.getModuleName() === 'dropdownlist') {
|
|
2242
2734
|
let findLi = 0;
|
|
2243
2735
|
if (e.action === 'home') {
|
|
2244
2736
|
findLi = 0;
|
|
2737
|
+
if (this.enableVirtualization) {
|
|
2738
|
+
findLi = this.skeletonCount;
|
|
2739
|
+
}
|
|
2245
2740
|
}
|
|
2246
2741
|
else {
|
|
2247
2742
|
findLi = this.getItems().length - 1;
|
|
2248
2743
|
}
|
|
2249
2744
|
e.preventDefault();
|
|
2250
2745
|
if (this.activeIndex === findLi) {
|
|
2746
|
+
if (isVirtualKeyAction) {
|
|
2747
|
+
this.setSelection(this.liCollections[findLi], e);
|
|
2748
|
+
}
|
|
2251
2749
|
return;
|
|
2252
2750
|
}
|
|
2253
2751
|
this.setSelection(this.liCollections[findLi], e);
|
|
@@ -2285,6 +2783,36 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2285
2783
|
}
|
|
2286
2784
|
}
|
|
2287
2785
|
}
|
|
2786
|
+
handleVirtualKeyboardActions(e, pageCount) {
|
|
2787
|
+
switch (e.action) {
|
|
2788
|
+
case 'down':
|
|
2789
|
+
case 'up':
|
|
2790
|
+
if (this.itemData != null || this.getModuleName() === 'autocomplete') {
|
|
2791
|
+
this.updateUpDownAction(e, true);
|
|
2792
|
+
}
|
|
2793
|
+
break;
|
|
2794
|
+
case 'pageUp':
|
|
2795
|
+
let count = (pageCount * 2) - 4;
|
|
2796
|
+
this.activeIndex = Math.round(count);
|
|
2797
|
+
this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
|
|
2798
|
+
e.preventDefault();
|
|
2799
|
+
break;
|
|
2800
|
+
case 'pageDown':
|
|
2801
|
+
this.activeIndex = 1;
|
|
2802
|
+
this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
|
|
2803
|
+
e.preventDefault();
|
|
2804
|
+
break;
|
|
2805
|
+
case 'home':
|
|
2806
|
+
this.isMouseScrollAction = true;
|
|
2807
|
+
this.updateHomeEndAction(e, true);
|
|
2808
|
+
break;
|
|
2809
|
+
case 'end':
|
|
2810
|
+
this.isMouseScrollAction = true;
|
|
2811
|
+
this.updateHomeEndAction(e, true);
|
|
2812
|
+
break;
|
|
2813
|
+
}
|
|
2814
|
+
this.keyboardEvent = null;
|
|
2815
|
+
}
|
|
2288
2816
|
selectCurrentItem(e) {
|
|
2289
2817
|
if (this.isPopupOpen) {
|
|
2290
2818
|
const li = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
@@ -2306,18 +2834,28 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2306
2834
|
isSelectFocusItem(element) {
|
|
2307
2835
|
return !isNullOrUndefined(element);
|
|
2308
2836
|
}
|
|
2309
|
-
getPageCount() {
|
|
2837
|
+
getPageCount(returnExactCount) {
|
|
2310
2838
|
const liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
|
|
2311
2839
|
getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
|
|
2312
|
-
|
|
2840
|
+
let pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
|
|
2841
|
+
return returnExactCount ? pageCount : Math.round(pageCount);
|
|
2313
2842
|
}
|
|
2314
|
-
pageUpSelection(steps, event) {
|
|
2315
|
-
|
|
2843
|
+
pageUpSelection(steps, event, isVirtualKeyAction) {
|
|
2844
|
+
let previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
|
|
2845
|
+
if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
|
|
2846
|
+
previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
|
|
2847
|
+
}
|
|
2848
|
+
if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
|
|
2849
|
+
previousItem = this.liCollections[this.skeletonCount];
|
|
2850
|
+
}
|
|
2316
2851
|
this.setSelection(previousItem, event);
|
|
2317
2852
|
}
|
|
2318
|
-
pageDownSelection(steps, event) {
|
|
2853
|
+
pageDownSelection(steps, event, isVirtualKeyAction) {
|
|
2319
2854
|
const list = this.getItems();
|
|
2320
|
-
|
|
2855
|
+
let previousItem = steps <= list.length ? this.liCollections[steps - 1] : this.liCollections[list.length - 1];
|
|
2856
|
+
if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
|
|
2857
|
+
previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
|
|
2858
|
+
}
|
|
2321
2859
|
this.setSelection(previousItem, event);
|
|
2322
2860
|
}
|
|
2323
2861
|
unWireEvent() {
|
|
@@ -2383,6 +2921,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2383
2921
|
if (e.which === 3 || e.button === 2) {
|
|
2384
2922
|
return;
|
|
2385
2923
|
}
|
|
2924
|
+
this.keyboardEvent = null;
|
|
2386
2925
|
if (this.targetElement().classList.contains(dropDownListClasses.disable) || this.inputWrapper.clearButton === e.target) {
|
|
2387
2926
|
return;
|
|
2388
2927
|
}
|
|
@@ -2527,6 +3066,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2527
3066
|
}
|
|
2528
3067
|
else {
|
|
2529
3068
|
this.setSelectOptions(li, e);
|
|
3069
|
+
if (this.enableVirtualization) {
|
|
3070
|
+
const fields = (this.fields.value) ? this.fields.value : '';
|
|
3071
|
+
const getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
|
|
3072
|
+
if (getItem && getItem.length > 0) {
|
|
3073
|
+
this.itemData = getItem[0];
|
|
3074
|
+
this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
2530
3077
|
}
|
|
2531
3078
|
}
|
|
2532
3079
|
setSelectOptions(li, e) {
|
|
@@ -2785,6 +3332,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2785
3332
|
this.typedString = this.filterInput.value;
|
|
2786
3333
|
this.preventAutoFill = false;
|
|
2787
3334
|
this.searchLists(e);
|
|
3335
|
+
if (this.enableVirtualization) {
|
|
3336
|
+
this.getFilteringSkeletonCount();
|
|
3337
|
+
}
|
|
2788
3338
|
break;
|
|
2789
3339
|
}
|
|
2790
3340
|
}
|
|
@@ -2792,6 +3342,33 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2792
3342
|
this.isValidKey = false;
|
|
2793
3343
|
}
|
|
2794
3344
|
}
|
|
3345
|
+
getFilteringSkeletonCount() {
|
|
3346
|
+
const difference = this.dataCount - this.viewPortInfo.endIndex;
|
|
3347
|
+
const currentSkeletonCount = this.skeletonCount;
|
|
3348
|
+
this.getSkeletonCount(true);
|
|
3349
|
+
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
|
|
3350
|
+
if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3351
|
+
const isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
|
|
3352
|
+
if (currentSkeletonCount !== this.skeletonCount) {
|
|
3353
|
+
this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
|
|
3354
|
+
}
|
|
3355
|
+
else {
|
|
3356
|
+
this.UpdateSkeleton();
|
|
3357
|
+
}
|
|
3358
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
3359
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3360
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
3361
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3362
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
getSkeletonCount(retainSkeleton) {
|
|
3366
|
+
this.virtualListHeight = this.listHeight != null ? parseInt(this.listHeight, 10) : this.virtualListHeight;
|
|
3367
|
+
const actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
|
|
3368
|
+
this.skeletonCount = actualCount * 2 < this.itemCount ? this.itemCount : actualCount * 2;
|
|
3369
|
+
this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
|
|
3370
|
+
this.skeletonCount = Math.floor(this.skeletonCount / 2) + 2;
|
|
3371
|
+
}
|
|
2795
3372
|
onFilterDown(e) {
|
|
2796
3373
|
switch (e.keyCode) {
|
|
2797
3374
|
case 13: //enter
|
|
@@ -2835,6 +3412,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2835
3412
|
else {
|
|
2836
3413
|
filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
2837
3414
|
}
|
|
3415
|
+
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
|
|
3416
|
+
var takeValue = this.getTakeValue();
|
|
3417
|
+
if (this.allowFiltering) {
|
|
3418
|
+
filterQuery.skip(this.virtualItemStartIndex);
|
|
3419
|
+
}
|
|
3420
|
+
filterQuery.take(takeValue);
|
|
3421
|
+
filterQuery.requiresCount();
|
|
3422
|
+
}
|
|
2838
3423
|
return filterQuery;
|
|
2839
3424
|
}
|
|
2840
3425
|
getSelectionPoints() {
|
|
@@ -2851,6 +3436,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2851
3436
|
}
|
|
2852
3437
|
this.isDataFetched = false;
|
|
2853
3438
|
if (this.isFiltering()) {
|
|
3439
|
+
this.checkAndResetCache();
|
|
2854
3440
|
const eventArgs = {
|
|
2855
3441
|
preventDefaultAction: false,
|
|
2856
3442
|
text: this.filterInput.value,
|
|
@@ -2888,10 +3474,30 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2888
3474
|
if (!isNullOrUndefined(this.filterInput)) {
|
|
2889
3475
|
this.beforePopupOpen = (!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') ?
|
|
2890
3476
|
false : true;
|
|
3477
|
+
let isNoData = this.list.classList.contains(dropDownBaseClasses.noData);
|
|
2891
3478
|
if (this.filterInput.value.trim() === '' && !this.itemTemplate) {
|
|
2892
3479
|
this.actionCompleteData.isUpdated = false;
|
|
2893
3480
|
this.isTyped = false;
|
|
2894
3481
|
if (!isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
|
|
3482
|
+
if (this.enableVirtualization) {
|
|
3483
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3484
|
+
this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
3485
|
+
this.resetList(dataSource, fields, query);
|
|
3486
|
+
if (isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3487
|
+
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
3488
|
+
this.list.appendChild(this.createElement('div', {
|
|
3489
|
+
className: 'e-virtual-ddl-content',
|
|
3490
|
+
styles: this.getTransformValues()
|
|
3491
|
+
})).appendChild(this.list.querySelector('.e-list-parent'));
|
|
3492
|
+
}
|
|
3493
|
+
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
3494
|
+
var virualElement = this.createElement('div', {
|
|
3495
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
3496
|
+
});
|
|
3497
|
+
document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
2895
3501
|
this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list);
|
|
2896
3502
|
}
|
|
2897
3503
|
this.isTyped = true;
|
|
@@ -2904,7 +3510,30 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2904
3510
|
else {
|
|
2905
3511
|
this.isNotSearchList = false;
|
|
2906
3512
|
query = (this.filterInput.value.trim() === '') ? null : query;
|
|
3513
|
+
if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
|
|
3514
|
+
this.isPreventScrollAction = true;
|
|
3515
|
+
this.list.scrollTop = 0;
|
|
3516
|
+
this.previousStartIndex = 0;
|
|
3517
|
+
this.virtualListInfo = null;
|
|
3518
|
+
}
|
|
2907
3519
|
this.resetList(dataSource, fields, query);
|
|
3520
|
+
if (this.enableVirtualization && isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3521
|
+
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
3522
|
+
this.list.appendChild(this.createElement('div', {
|
|
3523
|
+
className: 'e-virtual-ddl-content',
|
|
3524
|
+
styles: this.getTransformValues()
|
|
3525
|
+
})).appendChild(this.list.querySelector('.e-list-parent'));
|
|
3526
|
+
}
|
|
3527
|
+
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
3528
|
+
var virualElement = this.createElement('div', {
|
|
3529
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
3530
|
+
});
|
|
3531
|
+
document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
if (this.enableVirtualization) {
|
|
3536
|
+
this.getFilteringSkeletonCount();
|
|
2908
3537
|
}
|
|
2909
3538
|
this.renderReactTemplates();
|
|
2910
3539
|
}
|
|
@@ -3001,15 +3630,44 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3001
3630
|
this.renderPopup();
|
|
3002
3631
|
}
|
|
3003
3632
|
}
|
|
3633
|
+
UpdateSkeleton(isSkeletonCountChange, skeletonCount) {
|
|
3634
|
+
let isContainSkeleton = this.list.querySelector('.e-virtual-ddl-content');
|
|
3635
|
+
let isContainVirtualList = this.list.querySelector('.e-virtual-list');
|
|
3636
|
+
if (isContainSkeleton && (!isContainVirtualList || isSkeletonCountChange) && this.enableVirtualization) {
|
|
3637
|
+
const totalSkeletonCount = isSkeletonCountChange ? skeletonCount : this.skeletonCount;
|
|
3638
|
+
for (let i = 0; i < totalSkeletonCount; i++) {
|
|
3639
|
+
const liElement = this.createElement('li', { className: dropDownListClasses.virtualList, styles: 'overflow: inherit' });
|
|
3640
|
+
let skeleton = new Skeleton({
|
|
3641
|
+
shape: "Text",
|
|
3642
|
+
height: "10px",
|
|
3643
|
+
width: "95%",
|
|
3644
|
+
cssClass: "e-skeleton-text",
|
|
3645
|
+
});
|
|
3646
|
+
skeleton.appendTo(this.createElement('div'));
|
|
3647
|
+
liElement.appendChild(skeleton.element);
|
|
3648
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3649
|
+
isContainSkeleton.firstChild.insertBefore(liElement, isContainSkeleton.firstChild.children[0]);
|
|
3650
|
+
}
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
getTakeValue() {
|
|
3654
|
+
return this.allowFiltering && this.getModuleName() === 'dropdownlist' && Browser.isDevice ? Math.round(window.outerHeight / this.listItemHeight) : this.itemCount;
|
|
3655
|
+
}
|
|
3004
3656
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3005
3657
|
onActionComplete(ulElement, list, e, isUpdated) {
|
|
3006
|
-
if (this.
|
|
3658
|
+
if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
|
|
3659
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3660
|
+
this.totalItemCount = e.count;
|
|
3661
|
+
}
|
|
3662
|
+
if (this.isNotSearchList && !this.enableVirtualization) {
|
|
3007
3663
|
this.isNotSearchList = false;
|
|
3008
3664
|
return;
|
|
3009
3665
|
}
|
|
3666
|
+
let tempItemCount = this.itemCount;
|
|
3010
3667
|
if (this.isActive || !isNullOrUndefined(ulElement)) {
|
|
3011
3668
|
const selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
|
|
3012
3669
|
super.onActionComplete(ulElement, list, e);
|
|
3670
|
+
this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
|
|
3013
3671
|
this.updateSelectElementData(this.allowFiltering);
|
|
3014
3672
|
if (this.isRequested && !isNullOrUndefined(this.searchKeyEvent) && this.searchKeyEvent.type === 'keydown') {
|
|
3015
3673
|
this.isRequested = false;
|
|
@@ -3020,7 +3678,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3020
3678
|
this.incrementalSearch(this.searchKeyEvent);
|
|
3021
3679
|
this.searchKeyEvent = null;
|
|
3022
3680
|
}
|
|
3023
|
-
this.
|
|
3681
|
+
if (!this.enableVirtualization) {
|
|
3682
|
+
this.list.scrollTop = 0;
|
|
3683
|
+
}
|
|
3024
3684
|
if (!isNullOrUndefined(ulElement)) {
|
|
3025
3685
|
attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
3026
3686
|
}
|
|
@@ -3072,13 +3732,36 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3072
3732
|
this.updateActionCompleteDataValues(ulElement, list);
|
|
3073
3733
|
}
|
|
3074
3734
|
}
|
|
3075
|
-
this.
|
|
3076
|
-
|
|
3735
|
+
if (!this.enableVirtualization) {
|
|
3736
|
+
this.addNewItem(list, selectedItem);
|
|
3737
|
+
}
|
|
3738
|
+
if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
|
|
3077
3739
|
this.focusIndexItem();
|
|
3078
3740
|
}
|
|
3741
|
+
if (this.enableVirtualization) {
|
|
3742
|
+
this.updateActionCompleteDataValues(ulElement, list);
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
else if (this.enableVirtualization && this.getModuleName() !== 'autocomplete' && !this.isFiltering()) {
|
|
3746
|
+
const value = this.getItemData().value;
|
|
3747
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
3748
|
+
const element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
3749
|
+
this.selectedLI = element;
|
|
3750
|
+
}
|
|
3751
|
+
else if (this.enableVirtualization && this.getModuleName() === 'autocomplete') {
|
|
3752
|
+
this.activeIndex = this.skeletonCount;
|
|
3079
3753
|
}
|
|
3080
3754
|
if (this.beforePopupOpen) {
|
|
3081
3755
|
this.renderPopup(e);
|
|
3756
|
+
if (this.enableVirtualization) {
|
|
3757
|
+
if (!this.list.querySelector('.e-virtual-list')) {
|
|
3758
|
+
this.UpdateSkeleton();
|
|
3759
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
3760
|
+
}
|
|
3761
|
+
}
|
|
3762
|
+
if (this.enableVirtualization && tempItemCount != this.itemCount) {
|
|
3763
|
+
this.resetList(this.dataSource, this.fields);
|
|
3764
|
+
}
|
|
3082
3765
|
}
|
|
3083
3766
|
}
|
|
3084
3767
|
}
|
|
@@ -3139,7 +3822,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3139
3822
|
const element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
3140
3823
|
this.selectedLI = element;
|
|
3141
3824
|
this.activeItem(element);
|
|
3142
|
-
this.
|
|
3825
|
+
if (!(this.enableVirtualization && isNullOrUndefined(element))) {
|
|
3826
|
+
this.removeFocus();
|
|
3827
|
+
}
|
|
3143
3828
|
}
|
|
3144
3829
|
updateSelection() {
|
|
3145
3830
|
const selectedItem = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
@@ -3152,12 +3837,46 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3152
3837
|
this.list.querySelector('.' + dropDownBaseClasses.li).classList.add(dropDownListClasses.focus);
|
|
3153
3838
|
}
|
|
3154
3839
|
}
|
|
3840
|
+
updateSelectionList() {
|
|
3841
|
+
let selectedItem = this.list && this.list.querySelector('.' + 'e-active');
|
|
3842
|
+
if (!selectedItem && !isNullOrUndefined(this.value)) {
|
|
3843
|
+
var findEle = this.findListElement(this.list, 'li', 'data-value', this.value);
|
|
3844
|
+
if (findEle) {
|
|
3845
|
+
findEle.classList.add('e-active');
|
|
3846
|
+
}
|
|
3847
|
+
}
|
|
3848
|
+
}
|
|
3849
|
+
checkAndResetCache() {
|
|
3850
|
+
if (this.enableVirtualization) {
|
|
3851
|
+
this.generatedDataObject = {};
|
|
3852
|
+
this.virtualItemStartIndex = this.virtualItemEndIndex = 0;
|
|
3853
|
+
this.viewPortInfo = { currentPageNumber: null,
|
|
3854
|
+
direction: null,
|
|
3855
|
+
sentinelInfo: {},
|
|
3856
|
+
offsets: {},
|
|
3857
|
+
startIndex: 0,
|
|
3858
|
+
endIndex: this.itemCount, };
|
|
3859
|
+
this.selectedValueInfo = null;
|
|
3860
|
+
}
|
|
3861
|
+
}
|
|
3155
3862
|
removeFocus() {
|
|
3156
3863
|
const highlightedItem = this.list.querySelectorAll('.' + dropDownListClasses.focus);
|
|
3157
3864
|
if (highlightedItem && highlightedItem.length) {
|
|
3158
3865
|
removeClass(highlightedItem, dropDownListClasses.focus);
|
|
3159
3866
|
}
|
|
3160
3867
|
}
|
|
3868
|
+
getTransformValues() {
|
|
3869
|
+
let translateY = this.viewPortInfo.startIndex * this.listItemHeight;
|
|
3870
|
+
translateY = translateY - (this.skeletonCount * this.listItemHeight);
|
|
3871
|
+
translateY = this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0 ? 0 : translateY;
|
|
3872
|
+
const styleText = `transform: translate(0px, ${translateY}px);`;
|
|
3873
|
+
return styleText;
|
|
3874
|
+
}
|
|
3875
|
+
GetVirtualTrackHeight() {
|
|
3876
|
+
const height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
|
|
3877
|
+
const heightDimension = `height: ${height - this.itemCount * this.listItemHeight}px;`;
|
|
3878
|
+
return heightDimension;
|
|
3879
|
+
}
|
|
3161
3880
|
renderPopup(e) {
|
|
3162
3881
|
if (this.popupObj && document.body.contains(this.popupObj.element)) {
|
|
3163
3882
|
this.refreshPopup();
|
|
@@ -3179,10 +3898,35 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3179
3898
|
this.setFooterTemplate(popupEle);
|
|
3180
3899
|
}
|
|
3181
3900
|
document.body.appendChild(popupEle);
|
|
3901
|
+
if (this.enableVirtualization && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3902
|
+
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
3903
|
+
this.list.appendChild(this.createElement('div', {
|
|
3904
|
+
className: 'e-virtual-ddl-content',
|
|
3905
|
+
styles: this.getTransformValues()
|
|
3906
|
+
})).appendChild(this.list.querySelector('.e-list-parent'));
|
|
3907
|
+
}
|
|
3908
|
+
else {
|
|
3909
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3910
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
3911
|
+
}
|
|
3912
|
+
this.UpdateSkeleton();
|
|
3913
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
3914
|
+
this.virtualItemCount = this.itemCount;
|
|
3915
|
+
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
3916
|
+
var virualElement = this.createElement('div', {
|
|
3917
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
3918
|
+
});
|
|
3919
|
+
popupEle.querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
3920
|
+
}
|
|
3921
|
+
else {
|
|
3922
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3923
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3182
3926
|
popupEle.style.visibility = 'hidden';
|
|
3183
3927
|
if (this.popupHeight !== 'auto') {
|
|
3184
3928
|
this.searchBoxHeight = 0;
|
|
3185
|
-
if (!isNullOrUndefined(searchBox.container)) {
|
|
3929
|
+
if (!isNullOrUndefined(searchBox.container) && this.getModuleName() !== 'combobox' && this.getModuleName() !== 'autocomplete') {
|
|
3186
3930
|
this.searchBoxHeight = (searchBox.container.parentElement).getBoundingClientRect().height;
|
|
3187
3931
|
this.listHeight = (parseInt(this.listHeight, 10) - (this.searchBoxHeight)).toString() + 'px';
|
|
3188
3932
|
}
|
|
@@ -3204,9 +3948,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3204
3948
|
}
|
|
3205
3949
|
let offsetValue = 0;
|
|
3206
3950
|
let left;
|
|
3951
|
+
this.isPreventScrollAction = true;
|
|
3207
3952
|
if (!isNullOrUndefined(this.selectedLI) && (!isNullOrUndefined(this.activeIndex) && this.activeIndex >= 0)) {
|
|
3208
3953
|
this.setScrollPosition();
|
|
3209
3954
|
}
|
|
3955
|
+
else if (this.enableVirtualization) {
|
|
3956
|
+
this.setScrollPosition();
|
|
3957
|
+
}
|
|
3210
3958
|
else {
|
|
3211
3959
|
this.list.scrollTop = 0;
|
|
3212
3960
|
}
|
|
@@ -3222,6 +3970,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3222
3970
|
}
|
|
3223
3971
|
this.getFocusElement();
|
|
3224
3972
|
this.createPopup(popupEle, offsetValue, left);
|
|
3973
|
+
this.popupContentElement = this.popupObj.element.querySelector('.e-content');
|
|
3225
3974
|
this.checkCollision(popupEle);
|
|
3226
3975
|
if (Browser.isDevice) {
|
|
3227
3976
|
this.popupObj.element.classList.add(dropDownListClasses.device);
|
|
@@ -3253,6 +4002,24 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3253
4002
|
this.wireListEvents();
|
|
3254
4003
|
}
|
|
3255
4004
|
this.selectedElementID = this.selectedLI ? this.selectedLI.id : null;
|
|
4005
|
+
if (this.enableVirtualization) {
|
|
4006
|
+
this.notify("bindScrollEvent", {
|
|
4007
|
+
module: "VirtualScroll",
|
|
4008
|
+
component: this.getModuleName(),
|
|
4009
|
+
enable: this.enableVirtualization,
|
|
4010
|
+
});
|
|
4011
|
+
setTimeout(() => {
|
|
4012
|
+
if (this.value) {
|
|
4013
|
+
this.updateSelectionList();
|
|
4014
|
+
if (this.selectedValueInfo && this.viewPortInfo && this.viewPortInfo.offsets.top) {
|
|
4015
|
+
this.list.scrollTop = this.viewPortInfo.offsets.top;
|
|
4016
|
+
}
|
|
4017
|
+
else {
|
|
4018
|
+
this.scrollBottom(true, true);
|
|
4019
|
+
}
|
|
4020
|
+
}
|
|
4021
|
+
}, 5);
|
|
4022
|
+
}
|
|
3256
4023
|
attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_options' });
|
|
3257
4024
|
this.inputElement.setAttribute('aria-expanded', 'true');
|
|
3258
4025
|
const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
|
|
@@ -3386,6 +4153,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3386
4153
|
const firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
3387
4154
|
const lastItem = this.isEmptyList() ? this.list : this.liCollections[this.getItems().length - 1];
|
|
3388
4155
|
const liHeight = firstItem.getBoundingClientRect().height;
|
|
4156
|
+
this.listItemHeight = liHeight;
|
|
3389
4157
|
const listHeight = this.list.offsetHeight / 2;
|
|
3390
4158
|
const height = isNullOrUndefined(selectedLI) ? firstItem.offsetTop : selectedLI.offsetTop;
|
|
3391
4159
|
const lastItemOffsetValue = lastItem.offsetTop;
|
|
@@ -3396,7 +4164,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3396
4164
|
offsetValue = (count - (this.liCollections.length - this.activeIndex)) * liHeight - popupOffset + paddingBottom;
|
|
3397
4165
|
this.list.scrollTop = selectedLI.offsetTop;
|
|
3398
4166
|
}
|
|
3399
|
-
else if (height > listHeight) {
|
|
4167
|
+
else if (height > listHeight && !this.enableVirtualization) {
|
|
3400
4168
|
offsetValue = listHeight - liHeight / 2;
|
|
3401
4169
|
this.list.scrollTop = height - listHeight + liHeight / 2;
|
|
3402
4170
|
}
|
|
@@ -3422,34 +4190,105 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3422
4190
|
}
|
|
3423
4191
|
return width;
|
|
3424
4192
|
}
|
|
3425
|
-
scrollBottom(isInitial) {
|
|
4193
|
+
scrollBottom(isInitial, isInitialSelection = false, keyAction = null) {
|
|
4194
|
+
if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
|
|
4195
|
+
this.selectedLI = this.list.querySelector('.' + dropDownBaseClasses.li);
|
|
4196
|
+
if (!isNullOrUndefined(this.selectedLI) && this.selectedLI.classList.contains('e-virtual-list')) {
|
|
4197
|
+
this.selectedLI = this.liCollections[this.skeletonCount];
|
|
4198
|
+
}
|
|
4199
|
+
}
|
|
3426
4200
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
4201
|
+
this.isUpwardScrolling = false;
|
|
4202
|
+
let virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
|
|
4203
|
+
let lastElementValue = this.list.querySelector('li:last-of-type') ? this.list.querySelector('li:last-of-type').getAttribute('data-value') : null;
|
|
4204
|
+
let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
3427
4205
|
const currentOffset = this.list.offsetHeight;
|
|
3428
|
-
|
|
4206
|
+
let nextBottom = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
3429
4207
|
let nextOffset = this.list.scrollTop + nextBottom - currentOffset;
|
|
3430
|
-
|
|
3431
|
-
|
|
4208
|
+
let isScrollerCHanged = false;
|
|
4209
|
+
nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10);
|
|
4210
|
+
let boxRange = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
3432
4211
|
boxRange = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
|
|
3433
4212
|
boxRange - this.fixedHeaderElement.offsetHeight : boxRange;
|
|
3434
|
-
if (this.activeIndex === 0) {
|
|
4213
|
+
if (this.activeIndex === 0 && !this.enableVirtualization) {
|
|
3435
4214
|
this.list.scrollTop = 0;
|
|
4215
|
+
isScrollerCHanged = this.isKeyBoardAction;
|
|
3436
4216
|
}
|
|
3437
4217
|
else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
3438
|
-
this.
|
|
4218
|
+
let currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
|
|
4219
|
+
var liCount = keyAction == "pageDown" ? this.getPageCount() - 2 : 1;
|
|
4220
|
+
if (!this.enableVirtualization || this.isKeyBoardAction || isInitialSelection) {
|
|
4221
|
+
if (this.isKeyBoardAction && this.enableVirtualization && lastElementValue && currentElementValue === lastElementValue && keyAction != "end" && !this.isVirtualScrolling) {
|
|
4222
|
+
this.isPreventKeyAction = true;
|
|
4223
|
+
this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
|
|
4224
|
+
this.isPreventKeyAction = this.IsScrollerAtEnd() ? false : this.isPreventKeyAction;
|
|
4225
|
+
this.isKeyBoardAction = false;
|
|
4226
|
+
this.isPreventScrollAction = false;
|
|
4227
|
+
}
|
|
4228
|
+
else if (this.enableVirtualization && keyAction == "end") {
|
|
4229
|
+
this.isPreventKeyAction = false;
|
|
4230
|
+
this.isKeyBoardAction = false;
|
|
4231
|
+
this.isPreventScrollAction = false;
|
|
4232
|
+
this.list.scrollTop = this.list.scrollHeight;
|
|
4233
|
+
}
|
|
4234
|
+
else {
|
|
4235
|
+
if (keyAction == "pageDown" && this.enableVirtualization && !this.isVirtualScrolling) {
|
|
4236
|
+
this.isPreventKeyAction = false;
|
|
4237
|
+
this.isKeyBoardAction = false;
|
|
4238
|
+
this.isPreventScrollAction = false;
|
|
4239
|
+
nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
|
|
4240
|
+
}
|
|
4241
|
+
this.list.scrollTop = nextOffset;
|
|
4242
|
+
}
|
|
4243
|
+
}
|
|
4244
|
+
else {
|
|
4245
|
+
this.list.scrollTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.virtualListInfo.startIndex * this.listItemHeight : 0;
|
|
4246
|
+
}
|
|
4247
|
+
isScrollerCHanged = this.isKeyBoardAction;
|
|
4248
|
+
|
|
3439
4249
|
}
|
|
4250
|
+
this.isKeyBoardAction = isScrollerCHanged;
|
|
3440
4251
|
}
|
|
3441
4252
|
}
|
|
3442
|
-
scrollTop() {
|
|
4253
|
+
scrollTop(keyAction = null) {
|
|
3443
4254
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
3444
|
-
let
|
|
4255
|
+
let virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
|
|
4256
|
+
let selectedLiOffsetTop = (this.virtualListInfo && this.virtualListInfo.startIndex) ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
4257
|
+
let nextOffset = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) - this.list.scrollTop;
|
|
4258
|
+
let 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;
|
|
3445
4259
|
nextOffset = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
|
|
3446
4260
|
nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;
|
|
3447
|
-
|
|
3448
|
-
|
|
4261
|
+
let boxRange = (selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop);
|
|
4262
|
+
let isPageUpKeyAction = this.enableVirtualization && this.getModuleName() === 'autocomplete' && nextOffset <= 0;
|
|
4263
|
+
if (this.activeIndex === 0 && !this.enableVirtualization) {
|
|
3449
4264
|
this.list.scrollTop = 0;
|
|
3450
4265
|
}
|
|
3451
|
-
else if (nextOffset < 0) {
|
|
3452
|
-
this.
|
|
4266
|
+
else if (nextOffset < 0 || isPageUpKeyAction) {
|
|
4267
|
+
var currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
|
|
4268
|
+
var liCount = keyAction == "pageUp" ? this.getPageCount() - 2 : 1;
|
|
4269
|
+
if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyAction != "home" && !this.isVirtualScrolling) {
|
|
4270
|
+
this.isUpwardScrolling = true;
|
|
4271
|
+
this.isPreventKeyAction = true;
|
|
4272
|
+
this.list.scrollTop -= this.selectedLI.offsetHeight * liCount;
|
|
4273
|
+
this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
|
|
4274
|
+
this.isKeyBoardAction = false;
|
|
4275
|
+
this.isPreventScrollAction = false;
|
|
4276
|
+
}
|
|
4277
|
+
else if (this.enableVirtualization && keyAction == "home") {
|
|
4278
|
+
this.isPreventScrollAction = false;
|
|
4279
|
+
this.isPreventKeyAction = true;
|
|
4280
|
+
this.isKeyBoardAction = false;
|
|
4281
|
+
this.list.scrollTo(0, 0);
|
|
4282
|
+
}
|
|
4283
|
+
else {
|
|
4284
|
+
if (keyAction == "pageUp" && this.enableVirtualization && !this.isVirtualScrolling) {
|
|
4285
|
+
this.isPreventKeyAction = false;
|
|
4286
|
+
this.isKeyBoardAction = false;
|
|
4287
|
+
this.isPreventScrollAction = false;
|
|
4288
|
+
nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
|
|
4289
|
+
}
|
|
4290
|
+
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
4291
|
+
}
|
|
3453
4292
|
}
|
|
3454
4293
|
else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
3455
4294
|
this.list.scrollTop = this.selectedLI.offsetTop - (this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
|
|
@@ -3467,25 +4306,47 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3467
4306
|
return true;
|
|
3468
4307
|
}
|
|
3469
4308
|
setScrollPosition(e) {
|
|
4309
|
+
this.isPreventScrollAction = true;
|
|
3470
4310
|
if (!isNullOrUndefined(e)) {
|
|
3471
4311
|
switch (e.action) {
|
|
3472
4312
|
case 'pageDown':
|
|
3473
4313
|
case 'down':
|
|
3474
4314
|
case 'end':
|
|
3475
|
-
this.
|
|
4315
|
+
this.isKeyBoardAction = true;
|
|
4316
|
+
this.scrollBottom(false, false, e.action);
|
|
3476
4317
|
break;
|
|
3477
4318
|
default:
|
|
3478
|
-
this.
|
|
4319
|
+
this.isKeyBoardAction = e.action == 'up' || e.action == 'pageUp' || e.action == 'open';
|
|
4320
|
+
this.scrollTop(e.action);
|
|
3479
4321
|
break;
|
|
3480
4322
|
}
|
|
3481
4323
|
}
|
|
3482
4324
|
else {
|
|
3483
4325
|
this.scrollBottom(true);
|
|
3484
4326
|
}
|
|
4327
|
+
this.isKeyBoardAction = false;
|
|
3485
4328
|
}
|
|
3486
4329
|
clearText() {
|
|
3487
4330
|
this.filterInput.value = this.typedString = '';
|
|
3488
4331
|
this.searchLists(null);
|
|
4332
|
+
if (this.enableVirtualization) {
|
|
4333
|
+
this.list.scrollTop = 0;
|
|
4334
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4335
|
+
this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
4336
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4337
|
+
if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
|
|
4338
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4339
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
4340
|
+
}
|
|
4341
|
+
this.getSkeletonCount();
|
|
4342
|
+
this.UpdateSkeleton();
|
|
4343
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
4344
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4345
|
+
if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
|
|
4346
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4347
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
3489
4350
|
}
|
|
3490
4351
|
setEleWidth(width) {
|
|
3491
4352
|
if (!isNullOrUndefined(width)) {
|
|
@@ -3498,10 +4359,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3498
4359
|
}
|
|
3499
4360
|
}
|
|
3500
4361
|
closePopup(delay, e) {
|
|
4362
|
+
let isFilterValue = !isNullOrUndefined(this.filterInput) && !isNullOrUndefined(this.filterInput.value) && this.filterInput.value !== '';
|
|
4363
|
+
const typedString = this.getModuleName() === 'combobox' ? this.typedString : null;
|
|
3501
4364
|
this.isTyped = false;
|
|
3502
4365
|
if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
|
|
3503
4366
|
return;
|
|
3504
4367
|
}
|
|
4368
|
+
this.keyboardEvent = null;
|
|
3505
4369
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
3506
4370
|
this.isActive = false;
|
|
3507
4371
|
this.filterInputObj = null;
|
|
@@ -3542,6 +4406,20 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3542
4406
|
if (this.isFiltering()) {
|
|
3543
4407
|
this.actionCompleteData.isUpdated = false;
|
|
3544
4408
|
}
|
|
4409
|
+
if (this.enableVirtualization) {
|
|
4410
|
+
if ((this.value == null || this.isTyped)) {
|
|
4411
|
+
this.viewPortInfo.endIndex = this.viewPortInfo && this.viewPortInfo.endIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
|
|
4412
|
+
if (this.getModuleName() === 'autocomplete' || (this.getModuleName() === 'dropdownlist' && !isNullOrUndefined(this.typedString) && this.typedString != "") || (this.getModuleName() === 'combobox' && this.allowFiltering && !isNullOrUndefined(this.typedString) && this.typedString != "")) {
|
|
4413
|
+
this.checkAndResetCache();
|
|
4414
|
+
}
|
|
4415
|
+
}
|
|
4416
|
+
else if (this.getModuleName() === 'autocomplete') {
|
|
4417
|
+
this.checkAndResetCache();
|
|
4418
|
+
}
|
|
4419
|
+
if ((this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox') && !(this.skeletonCount == 0)) {
|
|
4420
|
+
this.getSkeletonCount(true);
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
3545
4423
|
this.beforePopupOpen = false;
|
|
3546
4424
|
const animModel = {
|
|
3547
4425
|
name: 'FadeOut',
|
|
@@ -3572,6 +4450,46 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3572
4450
|
if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
|
|
3573
4451
|
this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
|
|
3574
4452
|
}
|
|
4453
|
+
const dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
4454
|
+
if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
|
|
4455
|
+
this.updateInitialData();
|
|
4456
|
+
this.checkAndResetCache();
|
|
4457
|
+
}
|
|
4458
|
+
}
|
|
4459
|
+
updateInitialData() {
|
|
4460
|
+
let currentData = this.selectData;
|
|
4461
|
+
let ulElement = this.renderItems(currentData, this.fields);
|
|
4462
|
+
this.list.scrollTop = 0;
|
|
4463
|
+
this.virtualListInfo = {
|
|
4464
|
+
currentPageNumber: null,
|
|
4465
|
+
direction: null,
|
|
4466
|
+
sentinelInfo: {},
|
|
4467
|
+
offsets: {},
|
|
4468
|
+
startIndex: 0,
|
|
4469
|
+
endIndex: 0,
|
|
4470
|
+
};
|
|
4471
|
+
if (this.getModuleName() === 'combobox') {
|
|
4472
|
+
this.typedString = "";
|
|
4473
|
+
}
|
|
4474
|
+
this.previousStartIndex = 0;
|
|
4475
|
+
this.previousEndIndex = 0;
|
|
4476
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4477
|
+
this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
4478
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4479
|
+
if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
|
|
4480
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4481
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
4482
|
+
}
|
|
4483
|
+
this.getSkeletonCount();
|
|
4484
|
+
this.UpdateSkeleton();
|
|
4485
|
+
this.listData = currentData;
|
|
4486
|
+
this.updateActionCompleteDataValues(ulElement, currentData);
|
|
4487
|
+
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
4488
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4489
|
+
if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
|
|
4490
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4491
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
4492
|
+
}
|
|
3575
4493
|
}
|
|
3576
4494
|
destroyPopup() {
|
|
3577
4495
|
this.isPopupOpen = false;
|
|
@@ -3658,10 +4576,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3658
4576
|
this.element.id = id;
|
|
3659
4577
|
this.hiddenElement.id = id + '_hidden';
|
|
3660
4578
|
this.targetElement().setAttribute('tabindex', this.tabIndex);
|
|
3661
|
-
if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
|
|
4579
|
+
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
|
|
3662
4580
|
this.inputElement.setAttribute('aria-label', this.getModuleName());
|
|
3663
4581
|
}
|
|
3664
|
-
else {
|
|
4582
|
+
else if (this.getModuleName() === 'dropdownlist') {
|
|
3665
4583
|
attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
|
|
3666
4584
|
}
|
|
3667
4585
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
@@ -3671,7 +4589,16 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3671
4589
|
this.inputElement.removeAttribute('aria-labelledby');
|
|
3672
4590
|
}
|
|
3673
4591
|
if (this.value !== null || this.activeIndex !== null || this.text !== null) {
|
|
4592
|
+
if (this.enableVirtualization) {
|
|
4593
|
+
this.listItemHeight = this.getListHeight();
|
|
4594
|
+
this.getSkeletonCount();
|
|
4595
|
+
this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
|
|
4596
|
+
}
|
|
3674
4597
|
this.initValue();
|
|
4598
|
+
this.selectedValueInfo = this.viewPortInfo;
|
|
4599
|
+
if (this.enableVirtualization) {
|
|
4600
|
+
this.activeIndex = this.activeIndex + this.skeletonCount;
|
|
4601
|
+
}
|
|
3675
4602
|
}
|
|
3676
4603
|
else if (this.element.tagName === 'SELECT' && this.element.options[0]) {
|
|
3677
4604
|
const selectElement = this.element;
|
|
@@ -3707,6 +4634,29 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3707
4634
|
attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
3708
4635
|
}
|
|
3709
4636
|
this.renderComplete();
|
|
4637
|
+
this.listItemHeight = this.getListHeight();
|
|
4638
|
+
this.getSkeletonCount();
|
|
4639
|
+
if (this.enableVirtualization) {
|
|
4640
|
+
this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
|
|
4641
|
+
}
|
|
4642
|
+
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
4643
|
+
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
|
|
4644
|
+
}
|
|
4645
|
+
getListHeight() {
|
|
4646
|
+
let listParent = this.createElement('div', {
|
|
4647
|
+
className: 'e-dropdownbase'
|
|
4648
|
+
});
|
|
4649
|
+
let item = this.createElement('li', {
|
|
4650
|
+
className: 'e-list-item'
|
|
4651
|
+
});
|
|
4652
|
+
let listParentHeight = formatUnit(this.popupHeight);
|
|
4653
|
+
listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
|
|
4654
|
+
listParent.appendChild(item);
|
|
4655
|
+
document.body.appendChild(listParent);
|
|
4656
|
+
this.virtualListHeight = listParent.getBoundingClientRect().height;
|
|
4657
|
+
let listItemHeight = Math.ceil(item.getBoundingClientRect().height);
|
|
4658
|
+
listParent.remove();
|
|
4659
|
+
return listItemHeight;
|
|
3710
4660
|
}
|
|
3711
4661
|
setFooterTemplate(popupEle) {
|
|
3712
4662
|
let compiledString;
|
|
@@ -3849,7 +4799,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3849
4799
|
for (const prop of Object.keys(newProp)) {
|
|
3850
4800
|
switch (prop) {
|
|
3851
4801
|
case 'query':
|
|
3852
|
-
case 'dataSource':
|
|
4802
|
+
case 'dataSource':
|
|
4803
|
+
this.getSkeletonCount();
|
|
4804
|
+
this.checkAndResetCache();
|
|
4805
|
+
break;
|
|
3853
4806
|
case 'htmlAttributes':
|
|
3854
4807
|
this.setHTMLAttributes();
|
|
3855
4808
|
break;
|
|
@@ -4137,7 +5090,23 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4137
5090
|
this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
|
|
4138
5091
|
this.renderList(e);
|
|
4139
5092
|
}
|
|
5093
|
+
if (this.enableVirtualization && this.listData && this.listData.length) {
|
|
5094
|
+
if (!isNullOrUndefined(this.value) && (this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox')) {
|
|
5095
|
+
this.removeHover();
|
|
5096
|
+
}
|
|
5097
|
+
if (!this.beforePopupOpen) {
|
|
5098
|
+
this.notify("setCurrentViewDataAsync", {
|
|
5099
|
+
module: "VirtualScroll",
|
|
5100
|
+
});
|
|
5101
|
+
}
|
|
5102
|
+
}
|
|
4140
5103
|
this.invokeRenderPopup(e);
|
|
5104
|
+
if (this.enableVirtualization && !this.allowFiltering && this.selectedValueInfo != null && this.selectedValueInfo.startIndex > 0 && this.value != null) {
|
|
5105
|
+
this.notify("dataProcessAsync", {
|
|
5106
|
+
module: "VirtualScroll",
|
|
5107
|
+
isOpen: true,
|
|
5108
|
+
});
|
|
5109
|
+
}
|
|
4141
5110
|
}
|
|
4142
5111
|
invokeRenderPopup(e) {
|
|
4143
5112
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
@@ -4231,7 +5200,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4231
5200
|
if (!this.enabled) {
|
|
4232
5201
|
return;
|
|
4233
5202
|
}
|
|
4234
|
-
this.
|
|
5203
|
+
if (!this.enableVirtualization && this.getModuleName() === 'combobox') {
|
|
5204
|
+
this.isTyped = true;
|
|
5205
|
+
}
|
|
4235
5206
|
this.hidePopup(e);
|
|
4236
5207
|
if (this.targetElement()) {
|
|
4237
5208
|
this.targetElement().blur();
|
|
@@ -4287,6 +5258,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4287
5258
|
this.ulElement = null;
|
|
4288
5259
|
this.list = null;
|
|
4289
5260
|
this.popupObj = null;
|
|
5261
|
+
this.popupContentElement = null;
|
|
4290
5262
|
this.rippleFun = null;
|
|
4291
5263
|
this.selectedLI = null;
|
|
4292
5264
|
this.liCollections = null;
|
|
@@ -4384,6 +5356,9 @@ __decorate$1([
|
|
|
4384
5356
|
__decorate$1([
|
|
4385
5357
|
Property(false)
|
|
4386
5358
|
], DropDownList.prototype, "readonly", void 0);
|
|
5359
|
+
__decorate$1([
|
|
5360
|
+
Property(false)
|
|
5361
|
+
], DropDownList.prototype, "enableVirtualization", void 0);
|
|
4387
5362
|
__decorate$1([
|
|
4388
5363
|
Property(null)
|
|
4389
5364
|
], DropDownList.prototype, "text", void 0);
|
|
@@ -6987,8 +7962,6 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6987
7962
|
if (tempArr) {
|
|
6988
7963
|
tempArr = Array.prototype.slice.call(tempArr);
|
|
6989
7964
|
append(tempArr, this.noRecord);
|
|
6990
|
-
addClass([this.noRecord], NODATACONTAINER);
|
|
6991
|
-
prepend([this.noRecord], this.popupDiv);
|
|
6992
7965
|
}
|
|
6993
7966
|
}
|
|
6994
7967
|
else {
|
|
@@ -6997,9 +7970,9 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6997
7970
|
this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
|
|
6998
7971
|
this.noRecord.innerHTML = actionFailure ?
|
|
6999
7972
|
this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
|
|
7000
|
-
addClass([this.noRecord], NODATACONTAINER);
|
|
7001
|
-
prepend([this.noRecord], this.popupDiv);
|
|
7002
7973
|
}
|
|
7974
|
+
addClass([this.noRecord], NODATACONTAINER);
|
|
7975
|
+
prepend([this.noRecord], this.popupDiv);
|
|
7003
7976
|
}
|
|
7004
7977
|
updateRecordTemplate(action) {
|
|
7005
7978
|
if (this.treeItems && this.treeItems.length <= 0) {
|
|
@@ -7841,14 +8814,18 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7841
8814
|
if (!isNaN(height) && this.getModuleName() !== 'autocomplete') {
|
|
7842
8815
|
this.removeFocus();
|
|
7843
8816
|
const fixedHead = this.fields.groupBy ? this.liCollections[0].offsetHeight : 0;
|
|
7844
|
-
this.
|
|
8817
|
+
if (!this.enableVirtualization) {
|
|
8818
|
+
this.list.scrollTop = count * height + fixedHead;
|
|
8819
|
+
}
|
|
7845
8820
|
addClass([activeElement], dropDownListClasses.focus);
|
|
7846
8821
|
}
|
|
7847
8822
|
}
|
|
7848
8823
|
else {
|
|
7849
8824
|
if (this.isSelectCustom && this.inputElement.value.trim() !== '') {
|
|
7850
8825
|
this.removeFocus();
|
|
7851
|
-
this.
|
|
8826
|
+
if (!this.enableVirtualization) {
|
|
8827
|
+
this.list.scrollTop = 0;
|
|
8828
|
+
}
|
|
7852
8829
|
}
|
|
7853
8830
|
}
|
|
7854
8831
|
return activeElement;
|
|
@@ -7984,7 +8961,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7984
8961
|
else if (this.inputElement.value === '') {
|
|
7985
8962
|
this.activeIndex = null;
|
|
7986
8963
|
if (!isNullOrUndefined(this.list)) {
|
|
7987
|
-
this.
|
|
8964
|
+
if (!this.enableVirtualization) {
|
|
8965
|
+
this.list.scrollTop = 0;
|
|
8966
|
+
}
|
|
7988
8967
|
const focusItem = this.list.querySelector('.' + dropDownListClasses.li);
|
|
7989
8968
|
this.setHoverList(focusItem);
|
|
7990
8969
|
}
|
|
@@ -8523,7 +9502,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8523
9502
|
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
8524
9503
|
}
|
|
8525
9504
|
}
|
|
8526
|
-
if (!isNullOrUndefined(this.suggestionCount)) {
|
|
9505
|
+
if (!isNullOrUndefined(this.suggestionCount) && !this.enableVirtualization) {
|
|
8527
9506
|
// Since defualt value of suggestioncount is 20, checked the condition
|
|
8528
9507
|
if (this.suggestionCount !== 20) {
|
|
8529
9508
|
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
@@ -8534,11 +9513,18 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8534
9513
|
}
|
|
8535
9514
|
filterQuery.take(this.suggestionCount);
|
|
8536
9515
|
}
|
|
9516
|
+
if (this.enableVirtualization) {
|
|
9517
|
+
var takeValue = this.getTakeValue();
|
|
9518
|
+
filterQuery.skip(this.virtualItemStartIndex);
|
|
9519
|
+
filterQuery.take(takeValue);
|
|
9520
|
+
filterQuery.requiresCount();
|
|
9521
|
+
}
|
|
8537
9522
|
return filterQuery;
|
|
8538
9523
|
}
|
|
8539
9524
|
searchLists(e) {
|
|
8540
9525
|
this.isTyped = true;
|
|
8541
9526
|
this.isDataFetched = this.isSelectCustom = false;
|
|
9527
|
+
this.checkAndResetCache();
|
|
8542
9528
|
if (isNullOrUndefined(this.list)) {
|
|
8543
9529
|
super.renderList(e, true);
|
|
8544
9530
|
}
|
|
@@ -8585,8 +9571,32 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8585
9571
|
}
|
|
8586
9572
|
filterAction(dataSource, query, fields, e) {
|
|
8587
9573
|
this.beforePopupOpen = true;
|
|
9574
|
+
let isNoDataElement = this.list.classList.contains('e-nodata');
|
|
8588
9575
|
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
9576
|
+
if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
|
|
9577
|
+
this.isPreventScrollAction = true;
|
|
9578
|
+
this.list.scrollTop = 0;
|
|
9579
|
+
this.previousStartIndex = 0;
|
|
9580
|
+
this.virtualListInfo = null;
|
|
9581
|
+
}
|
|
8589
9582
|
this.resetList(dataSource, fields, query, e);
|
|
9583
|
+
if (this.enableVirtualization && isNoDataElement && !this.list.classList.contains('e-nodata')) {
|
|
9584
|
+
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
9585
|
+
this.list.appendChild(this.createElement('div', {
|
|
9586
|
+
className: 'e-virtual-ddl-content',
|
|
9587
|
+
styles: this.getTransformValues()
|
|
9588
|
+
})).appendChild(this.list.querySelector('.e-list-parent'));
|
|
9589
|
+
}
|
|
9590
|
+
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
9591
|
+
var virualElement = this.createElement('div', {
|
|
9592
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
9593
|
+
});
|
|
9594
|
+
document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
9595
|
+
}
|
|
9596
|
+
}
|
|
9597
|
+
if (this.enableVirtualization) {
|
|
9598
|
+
this.getFilteringSkeletonCount();
|
|
9599
|
+
}
|
|
8590
9600
|
}
|
|
8591
9601
|
else {
|
|
8592
9602
|
this.hidePopup(e);
|
|
@@ -8597,6 +9607,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8597
9607
|
clearAll(e, property) {
|
|
8598
9608
|
if (isNullOrUndefined(property) || (!isNullOrUndefined(property) && isNullOrUndefined(property.dataSource))) {
|
|
8599
9609
|
super.clearAll(e);
|
|
9610
|
+
this.checkAndResetCache();
|
|
8600
9611
|
}
|
|
8601
9612
|
if (this.beforePopupOpen) {
|
|
8602
9613
|
this.hidePopup();
|
|
@@ -8678,7 +9689,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8678
9689
|
return true;
|
|
8679
9690
|
}
|
|
8680
9691
|
renderPopup(e) {
|
|
8681
|
-
this.
|
|
9692
|
+
if (!this.enableVirtualization) {
|
|
9693
|
+
this.list.scrollTop = 0;
|
|
9694
|
+
}
|
|
8682
9695
|
super.renderPopup(e);
|
|
8683
9696
|
}
|
|
8684
9697
|
isEditTextBox() {
|
|
@@ -8746,6 +9759,10 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8746
9759
|
hidePopup(e) {
|
|
8747
9760
|
super.hidePopup(e);
|
|
8748
9761
|
this.activeIndex = null;
|
|
9762
|
+
this.virtualListInfo = this.viewPortInfo;
|
|
9763
|
+
this.previousStartIndex = this.viewPortInfo.startIndex;
|
|
9764
|
+
this.startIndex = this.viewPortInfo.startIndex;
|
|
9765
|
+
this.previousEndIndex = this.viewPortInfo.endIndex;
|
|
8749
9766
|
}
|
|
8750
9767
|
/**
|
|
8751
9768
|
* Dynamically change the value of properties.
|
|
@@ -9263,6 +10280,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9263
10280
|
if (this.isFirstClick) {
|
|
9264
10281
|
this.loadTemplate();
|
|
9265
10282
|
}
|
|
10283
|
+
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
10284
|
+
EventHandler.add(this.popupObj.element, 'click', this.clickHandler, this);
|
|
10285
|
+
}
|
|
9266
10286
|
}
|
|
9267
10287
|
});
|
|
9268
10288
|
}
|
|
@@ -10268,11 +11288,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10268
11288
|
}
|
|
10269
11289
|
spaceKeySelection(e) {
|
|
10270
11290
|
if (this.mode === 'CheckBox') {
|
|
10271
|
-
|
|
11291
|
+
const li = this.list.querySelector('li.' + dropDownBaseClasses.focus);
|
|
11292
|
+
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
11293
|
+
if (!isNullOrUndefined(li) || (selectAllParent && selectAllParent.classList.contains('e-item-focus'))) {
|
|
10272
11294
|
e.preventDefault();
|
|
10273
11295
|
this.keyAction = true;
|
|
10274
11296
|
}
|
|
10275
11297
|
this.selectByKey(e);
|
|
11298
|
+
if (this.keyAction) {
|
|
11299
|
+
const li = this.list.querySelector('li.' + dropDownBaseClasses.focus);
|
|
11300
|
+
if (!isNullOrUndefined(li) && selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
11301
|
+
li.classList.remove('e-item-focus');
|
|
11302
|
+
}
|
|
11303
|
+
}
|
|
10276
11304
|
}
|
|
10277
11305
|
this.checkPlaceholderSize();
|
|
10278
11306
|
}
|
|
@@ -10428,9 +11456,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10428
11456
|
}
|
|
10429
11457
|
}
|
|
10430
11458
|
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
10431
|
-
if (selectAllParent && !selectAllParent.classList.contains('e-item-focus')) {
|
|
10432
|
-
e.preventDefault();
|
|
10433
|
-
}
|
|
10434
11459
|
if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
10435
11460
|
const selectAllCheckBox = selectAllParent.childNodes[0];
|
|
10436
11461
|
if (!selectAllCheckBox.classList.contains('e-check')) {
|
|
@@ -10503,6 +11528,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10503
11528
|
}
|
|
10504
11529
|
this.updateAriaAttribute();
|
|
10505
11530
|
}
|
|
11531
|
+
clickHandler(e) {
|
|
11532
|
+
const targetElement = e.target;
|
|
11533
|
+
const filterInputClassName = targetElement.className;
|
|
11534
|
+
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
11535
|
+
if ((filterInputClassName === 'e-input-filter e-input' || filterInputClassName === 'e-input-group e-control-wrapper e-input-focus') && selectAllParent.classList.contains('e-item-focus')) {
|
|
11536
|
+
selectAllParent.classList.remove('e-item-focus');
|
|
11537
|
+
}
|
|
11538
|
+
}
|
|
10506
11539
|
moveByList(position) {
|
|
10507
11540
|
if (this.list) {
|
|
10508
11541
|
let elements = this.list.querySelectorAll('li.'
|
|
@@ -10517,12 +11550,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10517
11550
|
let temp = -1;
|
|
10518
11551
|
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
10519
11552
|
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) {
|
|
10520
|
-
selectAllParent.classList.
|
|
11553
|
+
if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
|
|
11554
|
+
selectAllParent.classList.remove('e-item-focus');
|
|
11555
|
+
}
|
|
11556
|
+
else if (!selectAllParent.classList.contains('e-item-focus')) {
|
|
11557
|
+
selectAllParent.classList.add('e-item-focus');
|
|
11558
|
+
}
|
|
10521
11559
|
}
|
|
10522
11560
|
else if (elements.length) {
|
|
10523
|
-
if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent)) {
|
|
10524
|
-
selectAllParent.classList.
|
|
10525
|
-
|
|
11561
|
+
if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent && position == -1)) {
|
|
11562
|
+
if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
|
|
11563
|
+
selectAllParent.classList.remove('e-item-focus');
|
|
11564
|
+
}
|
|
11565
|
+
else if (this.focusFirstListItem && !selectAllParent.classList.contains('e-item-focus')) {
|
|
10526
11566
|
selectAllParent.classList.add('e-item-focus');
|
|
10527
11567
|
}
|
|
10528
11568
|
}
|
|
@@ -10952,6 +11992,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10952
11992
|
}
|
|
10953
11993
|
return checkTemplate;
|
|
10954
11994
|
}
|
|
11995
|
+
encodeHtmlEntities(input) {
|
|
11996
|
+
return input.replace(/[\u00A0-\u9999<>&]/g, function (match) {
|
|
11997
|
+
return `&#${match.charCodeAt(0)};`;
|
|
11998
|
+
});
|
|
11999
|
+
}
|
|
10955
12000
|
getChip(data, value, e) {
|
|
10956
12001
|
let itemData = { text: value, value: value };
|
|
10957
12002
|
const chip = this.createElement('span', {
|
|
@@ -10983,7 +12028,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10983
12028
|
chipContent.innerText = data;
|
|
10984
12029
|
}
|
|
10985
12030
|
else {
|
|
10986
|
-
chipContent.innerHTML = data;
|
|
12031
|
+
chipContent.innerHTML = this.encodeHtmlEntities(data);
|
|
10987
12032
|
}
|
|
10988
12033
|
chip.appendChild(chipContent);
|
|
10989
12034
|
const eventArgs = {
|
|
@@ -12020,10 +13065,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12020
13065
|
}
|
|
12021
13066
|
updateWrapperText(wrapperType, wrapperData) {
|
|
12022
13067
|
if (this.valueTemplate || !this.enableHtmlSanitizer) {
|
|
12023
|
-
wrapperType.innerHTML = wrapperData;
|
|
13068
|
+
wrapperType.innerHTML = this.encodeHtmlEntities(wrapperData);
|
|
12024
13069
|
}
|
|
12025
13070
|
else {
|
|
12026
|
-
wrapperType.innerText =
|
|
13071
|
+
wrapperType.innerText = wrapperData;
|
|
12027
13072
|
}
|
|
12028
13073
|
}
|
|
12029
13074
|
updateDelimView() {
|
|
@@ -12776,6 +13821,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12776
13821
|
this.popupObj.hide();
|
|
12777
13822
|
removeClass([document.body, this.popupObj.element], 'e-popup-full-page');
|
|
12778
13823
|
EventHandler.remove(this.list, 'keydown', this.onKeyDown);
|
|
13824
|
+
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
13825
|
+
EventHandler.remove(this.popupObj.element, 'click', this.clickHandler);
|
|
13826
|
+
}
|
|
12779
13827
|
}
|
|
12780
13828
|
});
|
|
12781
13829
|
}
|
|
@@ -13534,7 +14582,7 @@ class CheckBoxSelection {
|
|
|
13534
14582
|
}
|
|
13535
14583
|
clickHandler(e) {
|
|
13536
14584
|
let target;
|
|
13537
|
-
if (e.currentTarget.classList.contains(this.checkAllParent.className)) {
|
|
14585
|
+
if (e.currentTarget.classList.contains(this.checkAllParent.className) || (e.currentTarget.classList.value === this.checkAllParent.className)) {
|
|
13538
14586
|
target = e.currentTarget.firstElementChild.lastElementChild;
|
|
13539
14587
|
}
|
|
13540
14588
|
else {
|
|
@@ -16908,7 +17956,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16908
17956
|
this.trigger('opened', eventArgs, (eventArgs) => {
|
|
16909
17957
|
if (!eventArgs.cancel) {
|
|
16910
17958
|
this.renderReactTemplates();
|
|
16911
|
-
|
|
17959
|
+
if (this.popupObj) {
|
|
17960
|
+
this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
|
|
17961
|
+
}
|
|
16912
17962
|
if (isNullOrUndefined(this.getTriggerCharPosition())) {
|
|
16913
17963
|
return;
|
|
16914
17964
|
}
|
|
@@ -17617,6 +18667,11 @@ let Mention = class Mention extends DropDownBase {
|
|
|
17617
18667
|
if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
|
|
17618
18668
|
return;
|
|
17619
18669
|
}
|
|
18670
|
+
this.previousSelectedLI = null;
|
|
18671
|
+
this.item = null;
|
|
18672
|
+
this.selectedLI = null;
|
|
18673
|
+
this.inputElement.innerText = null;
|
|
18674
|
+
this.popupObj = null;
|
|
17620
18675
|
super.destroy();
|
|
17621
18676
|
}
|
|
17622
18677
|
getLocaleName() {
|
|
@@ -17746,5 +18801,5 @@ Mention = __decorate$7([
|
|
|
17746
18801
|
* export all modules from current location
|
|
17747
18802
|
*/
|
|
17748
18803
|
|
|
17749
|
-
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 };
|
|
18804
|
+
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 };
|
|
17750
18805
|
//# sourceMappingURL=ej2-dropdowns.es2015.js.map
|