@syncfusion/ej2-filemanager 20.4.43 → 20.4.51

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/GitLeaksReport.json +1 -0
  3. package/dist/ej2-filemanager.min.js +2 -2
  4. package/dist/ej2-filemanager.umd.min.js +2 -2
  5. package/dist/ej2-filemanager.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-filemanager.es2015.js +326 -207
  7. package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
  8. package/dist/es6/ej2-filemanager.es5.js +332 -230
  9. package/dist/es6/ej2-filemanager.es5.js.map +1 -1
  10. package/dist/global/ej2-filemanager.min.js +2 -2
  11. package/dist/global/ej2-filemanager.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/gitleaks-ci/gitleaks +0 -0
  14. package/gitleaks-ci.tar.gz +0 -0
  15. package/package.json +15 -15
  16. package/src/file-manager/actions/toolbar.js +1 -1
  17. package/src/file-manager/actions/virtualization.d.ts +40 -5
  18. package/src/file-manager/actions/virtualization.js +131 -59
  19. package/src/file-manager/base/file-manager-model.d.ts +10 -14
  20. package/src/file-manager/base/file-manager.d.ts +8 -12
  21. package/src/file-manager/base/file-manager.js +5 -5
  22. package/src/file-manager/base/interface.d.ts +1 -0
  23. package/src/file-manager/layout/details-view.d.ts +6 -0
  24. package/src/file-manager/layout/details-view.js +43 -20
  25. package/src/file-manager/layout/large-icons-view.js +41 -10
  26. package/src/file-manager/layout/navigation-pane.js +14 -5
  27. package/src/file-manager/models/column-model.d.ts +7 -0
  28. package/src/file-manager/models/column.d.ts +6 -0
  29. package/src/file-manager/models/column.js +3 -0
  30. package/src/file-manager/models/details-view-settings.js +1 -1
  31. package/src/file-manager/models/index.d.ts +0 -2
  32. package/src/file-manager/models/index.js +0 -1
  33. package/src/file-manager/pop-up/context-menu.js +3 -0
@@ -155,7 +155,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
155
155
  */
156
156
  var columnArray = [
157
157
  {
158
- field: 'name', headerText: 'Name', minWidth: 120,
158
+ field: 'name', headerText: 'Name', minWidth: 120, isPrimaryKey: true,
159
159
  template: '<span class="e-fe-text">${name}</span>', customAttributes: { class: 'e-fe-grid-name' }
160
160
  },
161
161
  {
@@ -202,45 +202,6 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
202
202
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
203
203
  return c > 3 && r && Object.defineProperty(target, key, r), r;
204
204
  };
205
- /**
206
- * Specifies the virtualization settings of the File Manager.
207
- */
208
- var VirtualizationSettings = /** @__PURE__ @class */ (function (_super) {
209
- __extends$4(VirtualizationSettings, _super);
210
- function VirtualizationSettings() {
211
- return _super !== null && _super.apply(this, arguments) || this;
212
- }
213
- __decorate$4([
214
- Property(false)
215
- ], VirtualizationSettings.prototype, "enable", void 0);
216
- __decorate$4([
217
- Property(20)
218
- ], VirtualizationSettings.prototype, "detailsViewItemsCount", void 0);
219
- __decorate$4([
220
- Property(40)
221
- ], VirtualizationSettings.prototype, "largeIconsViewItemsCount", void 0);
222
- return VirtualizationSettings;
223
- }(ChildProperty));
224
-
225
- var __extends$5 = (undefined && undefined.__extends) || (function () {
226
- var extendStatics = function (d, b) {
227
- extendStatics = Object.setPrototypeOf ||
228
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
229
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
230
- return extendStatics(d, b);
231
- };
232
- return function (d, b) {
233
- extendStatics(d, b);
234
- function __() { this.constructor = d; }
235
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
236
- };
237
- })();
238
- var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
239
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
240
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
241
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
242
- return c > 3 && r && Object.defineProperty(target, key, r), r;
243
- };
244
205
  var fileItems = ['Open', '|', 'Cut', 'Copy', '|', 'Delete', 'Download', 'Rename', '|', 'Details'];
245
206
  var folderItems = ['Open', '|', 'Cut', 'Copy', 'Paste', '|', 'Delete', 'Rename', 'Download', '|', 'Details'];
246
207
  var layoutItems = [
@@ -250,26 +211,26 @@ var layoutItems = [
250
211
  * Specifies the ContextMenu settings of the File Manager.
251
212
  */
252
213
  var ContextMenuSettings = /** @__PURE__ @class */ (function (_super) {
253
- __extends$5(ContextMenuSettings, _super);
214
+ __extends$4(ContextMenuSettings, _super);
254
215
  function ContextMenuSettings() {
255
216
  return _super !== null && _super.apply(this, arguments) || this;
256
217
  }
257
- __decorate$5([
218
+ __decorate$4([
258
219
  Property(fileItems)
259
220
  ], ContextMenuSettings.prototype, "file", void 0);
260
- __decorate$5([
221
+ __decorate$4([
261
222
  Property(folderItems)
262
223
  ], ContextMenuSettings.prototype, "folder", void 0);
263
- __decorate$5([
224
+ __decorate$4([
264
225
  Property(layoutItems)
265
226
  ], ContextMenuSettings.prototype, "layout", void 0);
266
- __decorate$5([
227
+ __decorate$4([
267
228
  Property(true)
268
229
  ], ContextMenuSettings.prototype, "visible", void 0);
269
230
  return ContextMenuSettings;
270
231
  }(ChildProperty));
271
232
 
272
- var __extends$6 = (undefined && undefined.__extends) || (function () {
233
+ var __extends$5 = (undefined && undefined.__extends) || (function () {
273
234
  var extendStatics = function (d, b) {
274
235
  extendStatics = Object.setPrototypeOf ||
275
236
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -282,7 +243,7 @@ var __extends$6 = (undefined && undefined.__extends) || (function () {
282
243
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
283
244
  };
284
245
  })();
285
- var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
246
+ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
286
247
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
287
248
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
288
249
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -292,26 +253,26 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
292
253
  * Specifies the navigationpane settings of the File Manager.
293
254
  */
294
255
  var NavigationPaneSettings = /** @__PURE__ @class */ (function (_super) {
295
- __extends$6(NavigationPaneSettings, _super);
256
+ __extends$5(NavigationPaneSettings, _super);
296
257
  function NavigationPaneSettings() {
297
258
  return _super !== null && _super.apply(this, arguments) || this;
298
259
  }
299
- __decorate$6([
260
+ __decorate$5([
300
261
  Property('650px')
301
262
  ], NavigationPaneSettings.prototype, "maxWidth", void 0);
302
- __decorate$6([
263
+ __decorate$5([
303
264
  Property('240px')
304
265
  ], NavigationPaneSettings.prototype, "minWidth", void 0);
305
- __decorate$6([
266
+ __decorate$5([
306
267
  Property(true)
307
268
  ], NavigationPaneSettings.prototype, "visible", void 0);
308
- __decorate$6([
269
+ __decorate$5([
309
270
  Property('None')
310
271
  ], NavigationPaneSettings.prototype, "sortOrder", void 0);
311
272
  return NavigationPaneSettings;
312
273
  }(ChildProperty));
313
274
 
314
- var __extends$7 = (undefined && undefined.__extends) || (function () {
275
+ var __extends$6 = (undefined && undefined.__extends) || (function () {
315
276
  var extendStatics = function (d, b) {
316
277
  extendStatics = Object.setPrototypeOf ||
317
278
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -324,7 +285,7 @@ var __extends$7 = (undefined && undefined.__extends) || (function () {
324
285
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
325
286
  };
326
287
  })();
327
- var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
288
+ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
328
289
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
329
290
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
330
291
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -334,32 +295,32 @@ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators,
334
295
  * Specifies the Ajax settings of the File Manager.
335
296
  */
336
297
  var UploadSettings = /** @__PURE__ @class */ (function (_super) {
337
- __extends$7(UploadSettings, _super);
298
+ __extends$6(UploadSettings, _super);
338
299
  function UploadSettings() {
339
300
  return _super !== null && _super.apply(this, arguments) || this;
340
301
  }
341
- __decorate$7([
302
+ __decorate$6([
342
303
  Property('')
343
304
  ], UploadSettings.prototype, "allowedExtensions", void 0);
344
- __decorate$7([
305
+ __decorate$6([
345
306
  Property(true)
346
307
  ], UploadSettings.prototype, "autoUpload", void 0);
347
- __decorate$7([
308
+ __decorate$6([
348
309
  Property(false)
349
310
  ], UploadSettings.prototype, "autoClose", void 0);
350
- __decorate$7([
311
+ __decorate$6([
351
312
  Property(false)
352
313
  ], UploadSettings.prototype, "directoryUpload", void 0);
353
- __decorate$7([
314
+ __decorate$6([
354
315
  Property(0)
355
316
  ], UploadSettings.prototype, "minFileSize", void 0);
356
- __decorate$7([
317
+ __decorate$6([
357
318
  Property(30000000)
358
319
  ], UploadSettings.prototype, "maxFileSize", void 0);
359
320
  return UploadSettings;
360
321
  }(ChildProperty));
361
322
 
362
- var __extends$8 = (undefined && undefined.__extends) || (function () {
323
+ var __extends$7 = (undefined && undefined.__extends) || (function () {
363
324
  var extendStatics = function (d, b) {
364
325
  extendStatics = Object.setPrototypeOf ||
365
326
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -372,7 +333,7 @@ var __extends$8 = (undefined && undefined.__extends) || (function () {
372
333
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
373
334
  };
374
335
  })();
375
- var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
336
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
376
337
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
377
338
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
378
339
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -383,58 +344,61 @@ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators,
383
344
  */
384
345
  /* istanbul ignore next */
385
346
  var Column = /** @__PURE__ @class */ (function (_super) {
386
- __extends$8(Column, _super);
347
+ __extends$7(Column, _super);
387
348
  function Column() {
388
349
  return _super !== null && _super.apply(this, arguments) || this;
389
350
  }
390
- __decorate$8([
351
+ __decorate$7([
391
352
  Property('')
392
353
  ], Column.prototype, "field", void 0);
393
- __decorate$8([
354
+ __decorate$7([
394
355
  Property('')
395
356
  ], Column.prototype, "headerText", void 0);
396
- __decorate$8([
357
+ __decorate$7([
397
358
  Property('')
398
359
  ], Column.prototype, "width", void 0);
399
- __decorate$8([
360
+ __decorate$7([
400
361
  Property('')
401
362
  ], Column.prototype, "minWidth", void 0);
402
- __decorate$8([
363
+ __decorate$7([
403
364
  Property('')
404
365
  ], Column.prototype, "maxWidth", void 0);
405
- __decorate$8([
366
+ __decorate$7([
406
367
  Property('Left')
407
368
  ], Column.prototype, "textAlign", void 0);
408
- __decorate$8([
369
+ __decorate$7([
409
370
  Property(null)
410
371
  ], Column.prototype, "headerTextAlign", void 0);
411
- __decorate$8([
372
+ __decorate$7([
412
373
  Property(null)
413
374
  ], Column.prototype, "type", void 0);
414
- __decorate$8([
375
+ __decorate$7([
415
376
  Property(null)
416
377
  ], Column.prototype, "format", void 0);
417
- __decorate$8([
378
+ __decorate$7([
418
379
  Property(null)
419
380
  ], Column.prototype, "template", void 0);
420
- __decorate$8([
381
+ __decorate$7([
421
382
  Property(null)
422
383
  ], Column.prototype, "headerTemplate", void 0);
423
- __decorate$8([
384
+ __decorate$7([
424
385
  Property(true)
425
386
  ], Column.prototype, "allowSorting", void 0);
426
- __decorate$8([
387
+ __decorate$7([
427
388
  Property(true)
428
389
  ], Column.prototype, "allowResizing", void 0);
429
- __decorate$8([
390
+ __decorate$7([
430
391
  Property(null)
431
392
  ], Column.prototype, "customAttributes", void 0);
432
- __decorate$8([
393
+ __decorate$7([
433
394
  Property('')
434
395
  ], Column.prototype, "hideAtMedia", void 0);
435
- __decorate$8([
396
+ __decorate$7([
436
397
  Property(null)
437
398
  ], Column.prototype, "customFormat", void 0);
399
+ __decorate$7([
400
+ Property(false)
401
+ ], Column.prototype, "isPrimaryKey", void 0);
438
402
  return Column;
439
403
  }(ChildProperty));
440
404
 
@@ -4026,16 +3990,19 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
4026
3990
  this.items = [];
4027
3991
  this.items = this.renderList(args);
4028
3992
  this.items = this.allItems = getSortedData(this.parent, this.items);
4029
- // if (this.parent.virtualizationSettings.enable) {
4030
- // this.items = this.allItems.slice(0, this.parent.virtualizationSettings.largeIconsViewItemsCount);
4031
- // }
3993
+ iconsView.classList.remove(DISPLAY_NONE);
3994
+ if (this.parent.enableVirtualization && this.allItems.length > 0) {
3995
+ if (!this.element.style.height) {
3996
+ this.adjustHeight();
3997
+ }
3998
+ this.parent.virtualizationModule.setUIVirtualization();
3999
+ }
4032
4000
  // eslint-disable-next-line
4033
4001
  this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
4034
4002
  this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.listElements));
4035
4003
  this.element.appendChild(this.listElements);
4036
4004
  this.preventImgDrag();
4037
4005
  this.createDragObj();
4038
- iconsView.classList.remove(DISPLAY_NONE);
4039
4006
  if (this.itemList.length === 0) {
4040
4007
  var emptyList = this.element.querySelector('.' + LIST_PARENT);
4041
4008
  this.element.removeChild(emptyList);
@@ -4070,10 +4037,10 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
4070
4037
  this.getItemCount();
4071
4038
  this.addEventListener();
4072
4039
  this.wireEvents();
4073
- // if (this.parent.virtualizationSettings.enable && this.allItems.length > 0) {
4074
- // this.parent.virtualizationModule.setUlElementHeight();
4075
- // this.parent.virtualizationModule.wireScrollEvent(false);
4076
- // }
4040
+ if (this.parent.enableVirtualization && this.allItems.length > 0) {
4041
+ this.parent.virtualizationModule.setUlElementHeight();
4042
+ this.parent.virtualizationModule.wireScrollEvent(false);
4043
+ }
4077
4044
  this.isRendered = true;
4078
4045
  hideSpinner(this.parent.element);
4079
4046
  if (this.parent.selectedItems.length) {
@@ -4203,6 +4170,9 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
4203
4170
  LargeIconsView.prototype.onLayoutChange = function (args) {
4204
4171
  if (this.parent.view === 'LargeIcons') {
4205
4172
  this.destroy();
4173
+ if (this.parent.enableVirtualization) {
4174
+ this.parent.setProperties({ selectedItems: [] }, true);
4175
+ }
4206
4176
  this.render(args);
4207
4177
  /* istanbul ignore next */
4208
4178
  if (getValue('name', args) === 'layout-change' && this.parent.fileAction === 'move' &&
@@ -4857,6 +4827,7 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
4857
4827
  /* istanbul ignore next */
4858
4828
  // eslint:disable-next-line
4859
4829
  LargeIconsView.prototype.keyActionHandler = function (e) {
4830
+ var _this = this;
4860
4831
  if (!this.isRendered) {
4861
4832
  return;
4862
4833
  }
@@ -4865,10 +4836,28 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
4865
4836
  var lastItem = this.getLastItem();
4866
4837
  switch (e.action) {
4867
4838
  case 'end':
4868
- this.navigateItem(lastItem);
4839
+ if (this.parent.enableVirtualization) {
4840
+ this.clearSelect();
4841
+ this.element.firstElementChild.scrollTo(0, this.element.firstElementChild.scrollHeight);
4842
+ setTimeout(function () {
4843
+ _this.navigateItem(_this.itemList[_this.itemList.length - 1]);
4844
+ }, 10);
4845
+ }
4846
+ else {
4847
+ this.navigateItem(lastItem);
4848
+ }
4869
4849
  break;
4870
4850
  case 'home':
4871
- this.navigateItem(firstItem);
4851
+ if (this.parent.enableVirtualization) {
4852
+ this.clearSelect();
4853
+ this.element.firstElementChild.scrollTop = 0;
4854
+ setTimeout(function () {
4855
+ _this.navigateItem(_this.itemList[0]);
4856
+ }, 10);
4857
+ }
4858
+ else {
4859
+ this.navigateItem(firstItem);
4860
+ }
4872
4861
  break;
4873
4862
  case 'tab':
4874
4863
  if (!isNullOrUndefined(fItem)) {
@@ -5037,6 +5026,12 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
5037
5026
  index = perRow ? index - perRow : index - 1;
5038
5027
  }
5039
5028
  nextItem = this.itemList[index];
5029
+ if (this.parent.enableVirtualization && isNullOrUndefined(nextItem)) {
5030
+ var marginValue = parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-top'), 10) +
5031
+ parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-bottom'), 10);
5032
+ var scrollHeight = this.itemList[0].getBoundingClientRect().height + marginValue;
5033
+ this.element.firstElementChild.scrollTo(this.element.firstElementChild.scrollTop, this.element.firstElementChild.scrollTop + scrollHeight);
5034
+ }
5040
5035
  if (isNullOrUndefined(nextItem)) {
5041
5036
  return li;
5042
5037
  }
@@ -5950,6 +5945,9 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
5950
5945
  this.menuTarget = this.targetNodeElement = target;
5951
5946
  }
5952
5947
  this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr.e-row') : target;
5948
+ if (this.parent.enableVirtualization && (target.classList.contains('e-virtual-bottom') || target.classList.contains('e-virtualtable'))) {
5949
+ target = target.parentElement.closest("div");
5950
+ }
5953
5951
  var view = this.getTargetView(target);
5954
5952
  this.updateActiveModule();
5955
5953
  /* istanbul ignore next */
@@ -6578,7 +6576,7 @@ var defaultLocale = {
6578
6576
  'Server-Error': 'ServerError: Invalid response from'
6579
6577
  };
6580
6578
 
6581
- var __extends$9 = (undefined && undefined.__extends) || (function () {
6579
+ var __extends$8 = (undefined && undefined.__extends) || (function () {
6582
6580
  var extendStatics = function (d, b) {
6583
6581
  extendStatics = Object.setPrototypeOf ||
6584
6582
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -6591,7 +6589,7 @@ var __extends$9 = (undefined && undefined.__extends) || (function () {
6591
6589
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6592
6590
  };
6593
6591
  })();
6594
- var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
6592
+ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
6595
6593
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6596
6594
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6597
6595
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -6610,7 +6608,7 @@ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators,
6610
6608
  * ```
6611
6609
  */
6612
6610
  var FileManager = /** @__PURE__ @class */ (function (_super) {
6613
- __extends$9(FileManager, _super);
6611
+ __extends$8(FileManager, _super);
6614
6612
  function FileManager(options, element) {
6615
6613
  var _this = _super.call(this, options, element) || this;
6616
6614
  // eslint-disable-next-line
@@ -6757,7 +6755,7 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
6757
6755
  args: [this]
6758
6756
  });
6759
6757
  }
6760
- if (this.virtualizationSettings.enable) {
6758
+ if (this.enableVirtualization) {
6761
6759
  modules.push({
6762
6760
  member: 'virtualization',
6763
6761
  args: [this]
@@ -7690,154 +7688,154 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
7690
7688
  }
7691
7689
  };
7692
7690
  var FileManager_1;
7693
- __decorate$9([
7691
+ __decorate$8([
7694
7692
  Complex({}, AjaxSettings)
7695
7693
  ], FileManager.prototype, "ajaxSettings", void 0);
7696
- __decorate$9([
7694
+ __decorate$8([
7697
7695
  Property(false)
7698
7696
  ], FileManager.prototype, "allowDragAndDrop", void 0);
7699
- __decorate$9([
7697
+ __decorate$8([
7700
7698
  Property(true)
7701
7699
  ], FileManager.prototype, "allowMultiSelection", void 0);
7702
- __decorate$9([
7700
+ __decorate$8([
7703
7701
  Complex({}, ContextMenuSettings)
7704
7702
  ], FileManager.prototype, "contextMenuSettings", void 0);
7705
- __decorate$9([
7703
+ __decorate$8([
7706
7704
  Property('')
7707
7705
  ], FileManager.prototype, "cssClass", void 0);
7708
- __decorate$9([
7706
+ __decorate$8([
7709
7707
  Complex({}, DetailsViewSettings)
7710
7708
  ], FileManager.prototype, "detailsViewSettings", void 0);
7711
- __decorate$9([
7712
- Complex({}, VirtualizationSettings)
7713
- ], FileManager.prototype, "virtualizationSettings", void 0);
7714
- __decorate$9([
7709
+ __decorate$8([
7715
7710
  Property(true)
7716
7711
  ], FileManager.prototype, "enableHtmlSanitizer", void 0);
7717
- __decorate$9([
7712
+ __decorate$8([
7718
7713
  Property(false)
7719
7714
  ], FileManager.prototype, "enablePersistence", void 0);
7720
- __decorate$9([
7715
+ __decorate$8([
7716
+ Property(false)
7717
+ ], FileManager.prototype, "enableVirtualization", void 0);
7718
+ __decorate$8([
7721
7719
  Property('400px')
7722
7720
  ], FileManager.prototype, "height", void 0);
7723
- __decorate$9([
7721
+ __decorate$8([
7724
7722
  Property('LargeIcons')
7725
7723
  ], FileManager.prototype, "view", void 0);
7726
- __decorate$9([
7724
+ __decorate$8([
7727
7725
  Complex({}, NavigationPaneSettings)
7728
7726
  ], FileManager.prototype, "navigationPaneSettings", void 0);
7729
- __decorate$9([
7727
+ __decorate$8([
7730
7728
  Property('/')
7731
7729
  ], FileManager.prototype, "path", void 0);
7732
- __decorate$9([
7730
+ __decorate$8([
7733
7731
  Property(null)
7734
7732
  ], FileManager.prototype, "popupTarget", void 0);
7735
- __decorate$9([
7733
+ __decorate$8([
7736
7734
  Complex({}, SearchSettings)
7737
7735
  ], FileManager.prototype, "searchSettings", void 0);
7738
- __decorate$9([
7736
+ __decorate$8([
7739
7737
  Property()
7740
7738
  ], FileManager.prototype, "selectedItems", void 0);
7741
- __decorate$9([
7739
+ __decorate$8([
7742
7740
  Property(true)
7743
7741
  ], FileManager.prototype, "showFileExtension", void 0);
7744
- __decorate$9([
7742
+ __decorate$8([
7745
7743
  Property(null)
7746
7744
  ], FileManager.prototype, "rootAliasName", void 0);
7747
- __decorate$9([
7745
+ __decorate$8([
7748
7746
  Property(false)
7749
7747
  ], FileManager.prototype, "showHiddenItems", void 0);
7750
- __decorate$9([
7748
+ __decorate$8([
7751
7749
  Property(true)
7752
7750
  ], FileManager.prototype, "showThumbnail", void 0);
7753
- __decorate$9([
7751
+ __decorate$8([
7754
7752
  Property('Ascending')
7755
7753
  ], FileManager.prototype, "sortOrder", void 0);
7756
- __decorate$9([
7754
+ __decorate$8([
7757
7755
  Property('name')
7758
7756
  ], FileManager.prototype, "sortBy", void 0);
7759
- __decorate$9([
7757
+ __decorate$8([
7760
7758
  Complex({}, ToolbarSettings)
7761
7759
  ], FileManager.prototype, "toolbarSettings", void 0);
7762
- __decorate$9([
7760
+ __decorate$8([
7763
7761
  Complex({}, UploadSettings)
7764
7762
  ], FileManager.prototype, "uploadSettings", void 0);
7765
- __decorate$9([
7763
+ __decorate$8([
7766
7764
  Property('100%')
7767
7765
  ], FileManager.prototype, "width", void 0);
7768
- __decorate$9([
7766
+ __decorate$8([
7769
7767
  Event()
7770
7768
  ], FileManager.prototype, "fileLoad", void 0);
7771
- __decorate$9([
7769
+ __decorate$8([
7772
7770
  Event()
7773
7771
  ], FileManager.prototype, "fileOpen", void 0);
7774
- __decorate$9([
7772
+ __decorate$8([
7775
7773
  Event()
7776
7774
  ], FileManager.prototype, "beforeDownload", void 0);
7777
- __decorate$9([
7775
+ __decorate$8([
7778
7776
  Event()
7779
7777
  ], FileManager.prototype, "beforeImageLoad", void 0);
7780
- __decorate$9([
7778
+ __decorate$8([
7781
7779
  Event()
7782
7780
  ], FileManager.prototype, "beforePopupClose", void 0);
7783
- __decorate$9([
7781
+ __decorate$8([
7784
7782
  Event()
7785
7783
  ], FileManager.prototype, "beforePopupOpen", void 0);
7786
- __decorate$9([
7784
+ __decorate$8([
7787
7785
  Event()
7788
7786
  ], FileManager.prototype, "beforeSend", void 0);
7789
- __decorate$9([
7787
+ __decorate$8([
7790
7788
  Event()
7791
7789
  ], FileManager.prototype, "created", void 0);
7792
- __decorate$9([
7790
+ __decorate$8([
7793
7791
  Event()
7794
7792
  ], FileManager.prototype, "destroyed", void 0);
7795
- __decorate$9([
7793
+ __decorate$8([
7796
7794
  Event()
7797
7795
  ], FileManager.prototype, "fileDragStart", void 0);
7798
- __decorate$9([
7796
+ __decorate$8([
7799
7797
  Event()
7800
7798
  ], FileManager.prototype, "fileDragging", void 0);
7801
- __decorate$9([
7799
+ __decorate$8([
7802
7800
  Event()
7803
7801
  ], FileManager.prototype, "fileDragStop", void 0);
7804
- __decorate$9([
7802
+ __decorate$8([
7805
7803
  Event()
7806
7804
  ], FileManager.prototype, "fileDropped", void 0);
7807
- __decorate$9([
7805
+ __decorate$8([
7808
7806
  Event()
7809
7807
  ], FileManager.prototype, "fileSelection", void 0);
7810
- __decorate$9([
7808
+ __decorate$8([
7811
7809
  Event()
7812
7810
  ], FileManager.prototype, "fileSelect", void 0);
7813
- __decorate$9([
7811
+ __decorate$8([
7814
7812
  Event()
7815
7813
  ], FileManager.prototype, "menuClick", void 0);
7816
- __decorate$9([
7814
+ __decorate$8([
7817
7815
  Event()
7818
7816
  ], FileManager.prototype, "menuOpen", void 0);
7819
- __decorate$9([
7817
+ __decorate$8([
7820
7818
  Event()
7821
7819
  ], FileManager.prototype, "failure", void 0);
7822
- __decorate$9([
7820
+ __decorate$8([
7823
7821
  Event()
7824
7822
  ], FileManager.prototype, "popupClose", void 0);
7825
- __decorate$9([
7823
+ __decorate$8([
7826
7824
  Event()
7827
7825
  ], FileManager.prototype, "popupOpen", void 0);
7828
- __decorate$9([
7826
+ __decorate$8([
7829
7827
  Event()
7830
7828
  ], FileManager.prototype, "success", void 0);
7831
- __decorate$9([
7829
+ __decorate$8([
7832
7830
  Event()
7833
7831
  ], FileManager.prototype, "toolbarClick", void 0);
7834
- __decorate$9([
7832
+ __decorate$8([
7835
7833
  Event()
7836
7834
  ], FileManager.prototype, "toolbarCreate", void 0);
7837
- __decorate$9([
7835
+ __decorate$8([
7838
7836
  Event()
7839
7837
  ], FileManager.prototype, "uploadListCreate", void 0);
7840
- FileManager = FileManager_1 = __decorate$9([
7838
+ FileManager = FileManager_1 = __decorate$8([
7841
7839
  NotifyPropertyChanges
7842
7840
  ], FileManager);
7843
7841
  return FileManager;
@@ -8222,7 +8220,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
8222
8220
  this.hideItems(this.selection, true);
8223
8221
  }
8224
8222
  var ele = select('#' + this.getId('Selection'), this.toolbarObj.element);
8225
- if (this.parent.selectedItems.length > 0 && ele) {
8223
+ if (this.parent.selectedItems.length > 0 && ele && !this.parent.enableVirtualization) {
8226
8224
  var txt = void 0;
8227
8225
  if (this.parent.selectedItems.length === 1) {
8228
8226
  txt = this.parent.selectedItems.length + ' ' + getLocaleText(this.parent, 'Item-Selection');
@@ -8339,159 +8337,226 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
8339
8337
 
8340
8338
  var Virtualization = /** @__PURE__ @class */ (function () {
8341
8339
  function Virtualization(instance) {
8342
- this.largeIconsViewItemsCount = 40;
8343
8340
  this.filemanagerInstance = instance;
8344
8341
  this.largeIconInstance = instance.largeiconsviewModule;
8345
8342
  }
8346
- // Update the scroller height based on the items count.
8343
+ /**
8344
+ * Sets up UI virtualization for the large icon view.
8345
+ */
8346
+ Virtualization.prototype.setUIVirtualization = function () {
8347
+ // Get the current view data source
8348
+ var currentViewItems = this.largeIconInstance.items;
8349
+ // Get the first item in the data source
8350
+ var firstItem = currentViewItems.slice(0, 1);
8351
+ // Create a list element from the first item in the data source
8352
+ var listElements = ListBase.createListFromJson(createElement, firstItem, this.largeIconInstance.listObj);
8353
+ // Get the list items from the list element
8354
+ this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, listElements));
8355
+ // Append the list element to the large icon element
8356
+ this.largeIconInstance.element.appendChild(listElements);
8357
+ // Get the total number of items
8358
+ this.itemCount = this.getItemCount(Object.keys(this.largeIconInstance.allItems).length);
8359
+ // Remove the first child element from the large icon element
8360
+ this.largeIconInstance.element.firstChild.remove();
8361
+ // Set the items for the large icon view to the current view data source, limited to the number of items to display
8362
+ this.largeIconInstance.items = currentViewItems.slice(0, this.itemCount);
8363
+ };
8364
+ /**
8365
+ * Sets the height of the top and bottom elements that are used for virtualization.
8366
+ * These elements are used to give the appearance of an infinitely scrolling list.
8367
+ */
8347
8368
  Virtualization.prototype.setUlElementHeight = function () {
8348
- this.rowItemCount = this.ValidateItemCount(Object.keys(this.largeIconInstance.allItems).length);
8349
- this.lastRowCount = (this.largeIconInstance.allItems.length - this.largeIconsViewItemsCount) % this.rowItemCount ?
8350
- (this.largeIconInstance.allItems.length - this.largeIconsViewItemsCount) % this.rowItemCount : this.rowItemCount;
8369
+ // Calculate the number of items in the last row
8370
+ this.lastRowCount = (this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount ?
8371
+ (this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount : this.rowItemCount;
8372
+ // Create top and bottom elements
8351
8373
  this.topElement = this.filemanagerInstance.createElement('div');
8374
+ this.topElement.classList.add("e-virtual-top");
8352
8375
  this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement, this.largeIconInstance.element.firstElementChild.firstChild);
8353
8376
  this.bottomElement = this.filemanagerInstance.createElement('div');
8377
+ this.bottomElement.classList.add("e-virtual-bottom");
8354
8378
  this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement, null);
8355
- var marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top')) +
8356
- parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-bottom'));
8379
+ // Get the margin value for list items
8380
+ var marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top'), 10) +
8381
+ parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-bottom'), 10);
8382
+ // Calculate the height of a single list item
8357
8383
  this.listItemHeight = this.largeIconInstance.itemList[0].getBoundingClientRect().height + marginValue;
8384
+ // Calculate the total height of the list
8358
8385
  this.totalHeight = (Object.keys(this.largeIconInstance.allItems).length / this.rowItemCount) * this.listItemHeight;
8386
+ // Set the initial height of the top and bottom elements
8359
8387
  this.topElement.style.height = 0 + 'px';
8360
8388
  this.bottomElement.style.height = this.totalHeight + 'px';
8389
+ // Initialize the top and bottom element heights
8361
8390
  this.topElementHeight = 0;
8362
8391
  this.bottomElementHeight = this.totalHeight;
8392
+ // Initialize the list difference variable
8363
8393
  this.listDiff = 0;
8364
- this.renderedCount = this.largeIconsViewItemsCount;
8365
- };
8366
- // Calculated the maximum number of items can be rendered in each row.
8367
- Virtualization.prototype.ValidateItemCount = function (dataSourceLength) {
8368
- var width = parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth));
8369
- var marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-right')) +
8370
- parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-left'));
8371
- var itemCount = Math.floor(width / (this.largeIconInstance.itemList[0].offsetWidth + marginValue));
8394
+ // Set the initial rendered count
8395
+ this.renderedCount = this.itemCount;
8396
+ };
8397
+ /**
8398
+ * Calculates the number of items to display in the list based on the available width and height.
8399
+ * @param dataSourceLength The length of the data source.
8400
+ * @returns The number of items to display.
8401
+ */
8402
+ Virtualization.prototype.getItemCount = function (dataSourceLength) {
8403
+ // Get the margin values for list items
8404
+ var widthMargin = parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-right'), 10) +
8405
+ parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-left'), 10);
8406
+ // Calculate the number of items that can fit in a single row
8407
+ this.rowItemCount = Math.floor(parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth)) / (this.itemList[0].offsetWidth + widthMargin));
8408
+ // Calculate the number of items that can fit in the available height
8409
+ var itemCount = this.rowItemCount * (Math.round(parseFloat(formatUnit(this.largeIconInstance.element.clientHeight)) / this.itemList[0].offsetHeight));
8410
+ // If the calculated item count is greater than the data source length, set the item count to the data source length
8372
8411
  if (itemCount > dataSourceLength) {
8373
8412
  itemCount = dataSourceLength;
8374
8413
  }
8375
8414
  return itemCount;
8376
8415
  };
8377
- // Bind the scroll event for large icons view ul element.
8416
+ /**
8417
+ * Wires or un wires the scroll event for the list element.
8418
+ * @param destroy - Set `true` to unwire the scroll event.
8419
+ */
8378
8420
  Virtualization.prototype.wireScrollEvent = function (destroy) {
8379
8421
  if (!destroy) {
8422
+ // Wire the scroll event
8380
8423
  EventHandler.add(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll, this);
8381
8424
  }
8382
8425
  else {
8426
+ // Unwire the scroll event
8383
8427
  EventHandler.remove(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll);
8384
8428
  }
8385
8429
  };
8386
- // Update the top and bottom element height and update the scroll position.
8387
- Virtualization.prototype.onVirtualUiScroll = function (e) {
8430
+ /**
8431
+ * Handles the scroll event for the list element.
8432
+ * This method updates the top and bottom elements and the displayed items based on the scroll position.
8433
+ */
8434
+ Virtualization.prototype.onVirtualUiScroll = function () {
8388
8435
  var _a;
8436
+ // Set the starting height to 0
8389
8437
  var startingHeight = 0;
8438
+ // Get the current scroll position
8390
8439
  this.scrollPosition = isNullOrUndefined(this.scrollPosition) ? 0 : this.scrollPosition;
8391
8440
  var scroll = this.getscrollerHeight(startingHeight);
8441
+ // Calculate the height of the top element
8392
8442
  this.topElementHeight = this.listItemHeight * Math.floor(scroll / this.listItemHeight);
8443
+ // Calculate the height of the bottom element
8393
8444
  this.bottomElementHeight = this.totalHeight - this.topElementHeight;
8445
+ // If the scroll position is less than or equal to the total height, set the top and bottom element heights.
8446
+ // Otherwise, set the top element height to the total height and the bottom element height to 0.
8394
8447
  _a = scroll <= this.totalHeight ?
8395
8448
  [this.topElementHeight, this.bottomElementHeight] : [this.totalHeight, 0], this.topElementHeight = _a[0], this.bottomElementHeight = _a[1];
8449
+ // If the top element height has changed, update the top and bottom element heights and re-render the items.
8396
8450
  if (this.topElementHeight !== parseFloat(this.topElement.style.height)) {
8397
8451
  this.topElement.style.height = this.topElementHeight + 'px';
8398
8452
  this.bottomElement.style.height = this.bottomElementHeight + 'px';
8399
- // checked whether the scrolling is upward/downward
8453
+ // Check whether the scroll direction is upward or downward
8400
8454
  if (scroll > this.scrollPosition) {
8455
+ // Scrolling is upward
8401
8456
  var listDiff = Math.round(((this.topElementHeight / this.listItemHeight) - this.listDiff));
8402
8457
  this.onNormalScroll(listDiff, true);
8403
8458
  }
8404
8459
  else {
8460
+ // Scrolling is downward
8405
8461
  var listDiff = Math.round((this.listDiff - (this.topElementHeight / this.listItemHeight)));
8406
8462
  this.onNormalScroll(listDiff, false);
8407
8463
  }
8408
8464
  }
8465
+ // Update the list difference and scroll position variables
8409
8466
  this.listDiff = Math.round(this.topElementHeight / this.listItemHeight);
8410
8467
  this.scrollPosition = scroll;
8468
+ // Update the list of items and the items property of the largeIconInstance
8411
8469
  this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.largeIconInstance.element));
8412
8470
  this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
8413
- this.largeIconsViewItemsCount, this.renderedCount);
8471
+ this.itemCount, this.renderedCount);
8414
8472
  };
8415
- // Calculated the scroller height.
8473
+ /**
8474
+ * Calculates the current scroll position of the list element.
8475
+ * @param startingHeight The starting height from which to calculate the scroll position.
8476
+ * @returns The current scroll position.
8477
+ */
8416
8478
  Virtualization.prototype.getscrollerHeight = function (startingHeight) {
8479
+ // If the scroll position is less than or equal to the starting height, return 0.
8480
+ // Otherwise, return the scroll position minus the starting height.
8417
8481
  return ((this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight) <= 0) ? 0 :
8418
8482
  (this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight);
8419
8483
  };
8420
- // Update the UI based on the scrolled position.
8484
+ /**
8485
+ * This method updates the displayed items and the selection based on the scroll direction.
8486
+ * @param listDiff The number of rows to update.
8487
+ * @param isScrollingDown If set to true, the scroll direction is downward.
8488
+ */
8421
8489
  Virtualization.prototype.onNormalScroll = function (listDiff, isScrollingDown) {
8490
+ // Update the displayed items
8422
8491
  for (var i = 0; i < listDiff; i++) {
8423
8492
  this.updateUI(isScrollingDown);
8424
8493
  }
8425
- this.updateSelection();
8426
8494
  };
8427
- // Updating the items in large icons view dynamically.
8495
+ /**
8496
+ * Updates the items in the large icons view.
8497
+ * @param isScrollingDown If set to true, the scroll direction is downward.
8498
+ */
8428
8499
  Virtualization.prototype.updateUI = function (isScrollingDown) {
8429
8500
  var _this = this;
8430
8501
  if (isScrollingDown) {
8502
+ // Get the next batch of items to be displayed
8431
8503
  this.items = this.largeIconInstance.allItems.slice(this.renderedCount, this.renderedCount + this.rowItemCount);
8504
+ // If there are items to be displayed, create list elements for them and append them to the list
8432
8505
  if (this.items.length > 0) {
8433
- this.listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
8434
- this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.listElements));
8506
+ var listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
8507
+ this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, listElements));
8435
8508
  this.itemList.forEach(function (liEle) {
8436
8509
  _this.largeIconInstance.element.firstElementChild.insertBefore(liEle, _this.bottomElement);
8437
8510
  });
8511
+ // Update the rendered count variable
8438
8512
  this.renderedCount = (this.largeIconInstance.allItems.length >= this.renderedCount + this.rowItemCount) ?
8439
8513
  this.renderedCount + this.rowItemCount : this.renderedCount + this.lastRowCount;
8440
- for (var i_1 = 0; i_1 < this.rowItemCount; i_1++) {
8514
+ // Remove the first batch of items from the list
8515
+ for (var i = 0; i < this.rowItemCount; i++) {
8441
8516
  detach(this.topElement.nextElementSibling);
8442
8517
  }
8443
8518
  }
8444
8519
  }
8445
8520
  else {
8521
+ // Scrolling up
8446
8522
  var lastItemIndex = void 0;
8447
8523
  var isAllRendered = void 0;
8448
- if (this.renderedCount == this.largeIconInstance.allItems.length) {
8449
- lastItemIndex = this.renderedCount - (this.largeIconsViewItemsCount - this.rowItemCount + this.lastRowCount);
8450
- this.renderedCount = ((this.renderedCount - this.lastRowCount) < this.largeIconsViewItemsCount) ?
8451
- this.largeIconsViewItemsCount : (this.renderedCount - this.lastRowCount);
8524
+ if (this.renderedCount === this.largeIconInstance.allItems.length) {
8525
+ // Set lastItemIndex to the last item in the last row
8526
+ lastItemIndex = this.renderedCount - (this.itemCount - this.rowItemCount + this.lastRowCount);
8527
+ // Set renderedCount to the total number of items that have been rendered, except for the items in the last row
8528
+ this.renderedCount = ((this.renderedCount - this.lastRowCount) < this.itemCount) ?
8529
+ this.itemCount : (this.renderedCount - this.lastRowCount);
8530
+ // Set isAllRendered to true to indicate that all items have been rendered
8452
8531
  isAllRendered = true;
8453
8532
  }
8454
8533
  else {
8455
- lastItemIndex = this.renderedCount - this.largeIconsViewItemsCount;
8456
- this.renderedCount = ((this.renderedCount - this.rowItemCount) < this.largeIconsViewItemsCount) ?
8457
- this.largeIconsViewItemsCount : (this.renderedCount - this.rowItemCount);
8534
+ // Set lastItemIndex to the last item in the current row
8535
+ lastItemIndex = this.renderedCount - this.itemCount;
8536
+ // Set renderedCount to the total number of items that have been rendered, except for the items in the current row
8537
+ this.renderedCount = ((this.renderedCount - this.rowItemCount) < this.itemCount) ?
8538
+ this.itemCount : (this.renderedCount - this.rowItemCount);
8458
8539
  }
8540
+ // Set startItemIndex to the first item in the current or previous row
8459
8541
  var startItemIndex = (lastItemIndex - this.rowItemCount > 0) ? lastItemIndex - this.rowItemCount : 0;
8542
+ // Set the items array to the items in the current or previous row
8460
8543
  this.items = this.largeIconInstance.allItems.slice(startItemIndex, lastItemIndex);
8461
8544
  if (this.items.length > 0) {
8462
- this.listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
8463
- this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.listElements));
8545
+ // Create a list of elements from the items array
8546
+ var listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
8547
+ // Set the itemList array to the list items in the list elements
8548
+ this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, listElements));
8549
+ // Add the items to the beginning of the list
8464
8550
  for (var len = this.itemList.length; len > 0; len--) {
8465
8551
  this.largeIconInstance.element.firstElementChild.insertBefore(this.itemList[len - 1], this.topElement.nextElementSibling);
8466
8552
  }
8553
+ // Remove the last row of items from the list
8467
8554
  for (var i = 0; i < ((isAllRendered) ? this.lastRowCount : this.rowItemCount); i++) {
8468
8555
  detach(this.bottomElement.previousElementSibling);
8469
8556
  }
8470
8557
  }
8471
8558
  }
8472
8559
  };
8473
- // Update the selected item state.
8474
- Virtualization.prototype.updateSelection = function () {
8475
- for (var i = 0; i < this.filemanagerInstance.selectedItems.length; i++) {
8476
- for (var j = 0; j < this.items.length; j++) {
8477
- if (this.filemanagerInstance.selectedItems[i] == getValue('name', this.items[j])) {
8478
- this.updateCheckState(this.itemList[j]);
8479
- }
8480
- }
8481
- }
8482
- };
8483
- // Update the check state for items.
8484
- Virtualization.prototype.updateCheckState = function (liItem) {
8485
- if (this.filemanagerInstance.allowMultiSelection) {
8486
- addClass([liItem], [ACTIVE]);
8487
- liItem.setAttribute('aria-selected', 'true');
8488
- var checkEle = select('.' + FRAME, liItem);
8489
- if (!checkEle.classList.contains(CHECK)) {
8490
- addClass([checkEle], CHECK);
8491
- closest(checkEle, '.' + CB_WRAP).setAttribute('aria-checked', 'true');
8492
- }
8493
- }
8494
- };
8495
8560
  /**
8496
8561
  * For internal use only - Get the module name.
8497
8562
  *
@@ -8501,10 +8566,15 @@ var Virtualization = /** @__PURE__ @class */ (function () {
8501
8566
  Virtualization.prototype.getModuleName = function () {
8502
8567
  return 'virtualization';
8503
8568
  };
8569
+ /**
8570
+ * Destroys the component.
8571
+ */
8504
8572
  Virtualization.prototype.destroy = function () {
8573
+ // If the file manager has already been destroyed, return immediately
8505
8574
  if (this.filemanagerInstance.isDestroyed) {
8506
8575
  return;
8507
8576
  }
8577
+ // If the large icon element has a child element, unwire the scroll event
8508
8578
  if (!isNullOrUndefined(this.largeIconInstance.element.firstElementChild)) {
8509
8579
  this.wireScrollEvent(true);
8510
8580
  }
@@ -8701,11 +8771,13 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8701
8771
  var nodeData = this.getTreeData(getValue('id', args.nodeData));
8702
8772
  var eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8703
8773
  this.parent.trigger('fileOpen', eventArgs);
8774
+ var selecEventArgs = { action: args.action, fileDetails: nodeData[0], isInteracted: args.isInteracted };
8775
+ this.parent.trigger('fileSelect', selecEventArgs);
8704
8776
  args.cancel = eventArgs.cancel;
8705
8777
  if (args.cancel) {
8706
8778
  this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] !== args.node.getAttribute('data-uid') : false;
8707
- this.treeObj.selectedNodes = this.isNodeClickCalled ? this.previousSelected : this.treeObj.selectedNodes;
8708
8779
  this.previousSelected = this.treeObj.selectedNodes;
8780
+ this.treeObj.selectedNodes = [args.node.getAttribute("data-uid")];
8709
8781
  if (!isNullOrUndefined(this.parent) && !isNullOrUndefined(this.parent.contextmenuModule)) {
8710
8782
  this.parent.contextmenuModule.contextMenu.enableItems(['Open'], true);
8711
8783
  }
@@ -8742,13 +8814,21 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8742
8814
  this.parent.selectedItems = [];
8743
8815
  this.parent.itemData = nodeData;
8744
8816
  var previousPath = this.parent.path;
8745
- updatePath(args.node, this.parent.itemData[0], this.parent);
8817
+ if (!this.isRightClick) {
8818
+ updatePath(args.node, this.parent.itemData[0], this.parent);
8819
+ }
8820
+ else {
8821
+ this.parent.pathId = getPathId(args.node);
8822
+ this.parent.visitedItem = args.node;
8823
+ }
8746
8824
  if (previousPath !== this.parent.path) {
8747
8825
  this.expandNodeTarget = null;
8748
8826
  if (args.node.querySelector('.' + ICONS) && args.node.querySelector('.' + LIST_ITEM) === null) {
8749
8827
  this.expandNodeTarget = 'add';
8750
8828
  }
8751
- read(this.parent, this.isPathDragged ? pasteEnd : pathChanged, this.parent.path);
8829
+ if (!this.isRightClick) {
8830
+ read(this.parent, this.isPathDragged ? pasteEnd : pathChanged, this.parent.path);
8831
+ }
8752
8832
  this.parent.visitedItem = args.node;
8753
8833
  }
8754
8834
  this.isPathDragged = this.isRenameParent = this.isRightClick = false;
@@ -8925,7 +9005,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8925
9005
  }
8926
9006
  }
8927
9007
  if (resultData.length > 0) {
8928
- this.isRenameParent = true;
8929
9008
  var id_1 = getValue(this.treeObj.fields.id, resultData[0]);
8930
9009
  this.treeObj.selectedNodes = [id_1];
8931
9010
  this.treeObj.dataBind();
@@ -9454,14 +9533,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
9454
9533
  allowResizing: this.parent.detailsViewSettings.columnResizing,
9455
9534
  selectionSettings: {
9456
9535
  type: this.parent.allowMultiSelection ? 'Multiple' : 'Single',
9457
- checkboxMode: 'ResetOnRowClick'
9536
+ checkboxMode: 'ResetOnRowClick',
9537
+ persistSelection: (this.parent.enableVirtualization) ? true : false
9458
9538
  },
9459
9539
  enableRtl: this.parent.enableRtl,
9460
9540
  pageSettings: { pageSize: 20 },
9461
- // enableVirtualization: this.parent.virtualizationSettings.enable,
9541
+ enableVirtualization: this.parent.enableVirtualization,
9462
9542
  enablePersistence: this.parent.enablePersistence,
9463
- // enableVirtualMaskRow: true,
9464
- // pageSettings: { pageSize: this.parent.virtualizationSettings.detailsViewItemsCount },
9543
+ enableVirtualMaskRow: true,
9465
9544
  sortSettings: { allowUnsort: false, columns: sortSettings },
9466
9545
  columns: columns,
9467
9546
  recordDoubleClick: this.DblClickEvents.bind(this),
@@ -9471,6 +9550,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
9471
9550
  actionBegin: this.onActionBegin.bind(this),
9472
9551
  headerCellInfo: this.onHeaderCellInfo.bind(this),
9473
9552
  width: '100%',
9553
+ height: (this.parent.enableVirtualization) ? this.getGridHeight() : 'auto',
9474
9554
  beforeCopy: function (args) { args.cancel = true; },
9475
9555
  // eslint-disable-next-line
9476
9556
  load: function (args) {
@@ -9485,6 +9565,20 @@ var DetailsView = /** @__PURE__ @class */ (function () {
9485
9565
  this.emptyArgs = args;
9486
9566
  }
9487
9567
  };
9568
+ /**
9569
+ * Gets the grid height.
9570
+ * @returns The grid height.
9571
+ * @private
9572
+ */
9573
+ DetailsView.prototype.getGridHeight = function () {
9574
+ // Get the content pane and breadcrumb bar elements
9575
+ var pane = select('#' + this.parent.element.id + CONTENT_ID, this.parent.element);
9576
+ var bar = select('#' + this.parent.element.id + BREADCRUMBBAR_ID, this.parent.element);
9577
+ // The maximum height of the header is 36
9578
+ var headerMaxHeight = 36;
9579
+ // Calculate and return the grid height
9580
+ return (pane.offsetHeight - bar.offsetHeight - headerMaxHeight);
9581
+ };
9488
9582
  DetailsView.prototype.checkNameWidth = function () {
9489
9583
  var initialColumn = this.parent.detailsViewSettings.columns;
9490
9584
  this.isNameWidth = false;
@@ -9670,20 +9764,17 @@ var DetailsView = /** @__PURE__ @class */ (function () {
9670
9764
  }
9671
9765
  };
9672
9766
  DetailsView.prototype.onBeforeDataBound = function (args) {
9673
- // if (!this.parent.virtualizationSettings.enable) {
9674
9767
  showSpinner(this.parent.element);
9675
9768
  // eslint-disable-next-line
9676
- var items = getSortedData(this.parent, this.gridObj.dataSource);
9769
+ var items = getSortedData(this.parent, (this.parent.enableVirtualization) ? args.result : this.gridObj.dataSource);
9677
9770
  args.result = items;
9678
- // }
9679
9771
  };
9680
9772
  /* istanbul ignore next */
9681
9773
  DetailsView.prototype.onDataBound = function () {
9682
9774
  this.createDragObj();
9683
- // if ((this.parent.selectedItems.length !== 0 && !this.parent.virtualizationSettings.enable) ||
9684
- // ((this.parent.selectedItems.length !== 0 && this.parent.virtualizationSettings.enable &&
9685
- // this.element.querySelector('.e-content').scrollTop == 0))) {
9686
- if (this.parent.selectedItems.length !== 0) {
9775
+ if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization) ||
9776
+ ((this.parent.selectedItems.length !== 0 && this.parent.enableVirtualization &&
9777
+ this.element.querySelector('.e-content').scrollTop == 0))) {
9687
9778
  this.selectRecords(this.parent.selectedItems);
9688
9779
  }
9689
9780
  if (this.isPasteOperation === true) {
@@ -9802,6 +9893,9 @@ var DetailsView = /** @__PURE__ @class */ (function () {
9802
9893
  // eslint-disable-next-line
9803
9894
  this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
9804
9895
  }
9896
+ if (this.element.querySelector('.e-content').scrollTop !== 0) {
9897
+ this.gridObj.freezeRefresh();
9898
+ }
9805
9899
  };
9806
9900
  DetailsView.prototype.onPropertyChanged = function (e) {
9807
9901
  if (e.module !== this.getModuleName() && e.module !== 'common') {
@@ -9881,6 +9975,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
9881
9975
  showSpinner(this.parent.element);
9882
9976
  this.parent.setProperties({ selectedItems: [] }, true);
9883
9977
  this.gridObj.dataSource = getSortedData(this.parent, args.files);
9978
+ this.gridObj.freezeRefresh();
9884
9979
  }
9885
9980
  this.emptyArgs = args;
9886
9981
  };
@@ -9966,12 +10061,18 @@ var DetailsView = /** @__PURE__ @class */ (function () {
9966
10061
  _this.parent.isFiltered = false;
9967
10062
  }
9968
10063
  _this.element.focus();
10064
+ if (_this.parent.enableVirtualization) {
10065
+ _this.parent.element.querySelector('#' + _this.parent.element.id + IMG_DIALOG_ID).focus();
10066
+ }
9969
10067
  }
9970
10068
  });
9971
10069
  };
9972
10070
  /* istanbul ignore next */
9973
10071
  DetailsView.prototype.onLayoutChange = function (args) {
9974
10072
  if (this.parent.view === 'Details') {
10073
+ if (this.parent.enableVirtualization) {
10074
+ this.parent.setProperties({ selectedItems: [] }, true);
10075
+ }
9975
10076
  if (!this.gridObj) {
9976
10077
  this.render(args);
9977
10078
  }
@@ -10444,11 +10545,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
10444
10545
  }
10445
10546
  }
10446
10547
  var len = rows.length;
10447
- if (len > 0) {
10448
- // if (this.parent.virtualizationSettings.enable) {
10449
- // this.parent.currentItemText = getValue('name', args.data);
10450
- // }
10451
- // else if (len > 0) {
10548
+ if (this.parent.enableVirtualization) {
10549
+ this.parent.currentItemText = getValue('name', args.data);
10550
+ }
10551
+ else if (len > 0) {
10452
10552
  // eslint-disable-next-line
10453
10553
  var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
10454
10554
  this.parent.currentItemText = getValue('name', data);
@@ -10462,11 +10562,13 @@ var DetailsView = /** @__PURE__ @class */ (function () {
10462
10562
  }
10463
10563
  }
10464
10564
  this.parent.visitedItem = args.row;
10465
- if (this.parent.allowMultiSelection && !isNullOrUndefined(item) && !isNullOrUndefined(item.querySelector('.e-checkselect'))) {
10466
- var checkItem = item.querySelector('.e-checkselect');
10467
- checkItem.focus();
10565
+ if ((!this.parent.enableVirtualization) || (!args.isHeaderCheckboxClicked)) {
10566
+ if (this.parent.allowMultiSelection && !isNullOrUndefined(item) && !isNullOrUndefined(item.querySelector('.e-checkselect'))) {
10567
+ var checkItem = item.querySelector('.e-checkselect');
10568
+ checkItem.focus();
10569
+ }
10570
+ this.addFocus(this.gridObj.selectedRowIndex);
10468
10571
  }
10469
- this.addFocus(this.gridObj.selectedRowIndex);
10470
10572
  if (!this.parent.isLayoutChange) {
10471
10573
  this.isInteracted = true;
10472
10574
  }
@@ -11230,5 +11332,5 @@ var DetailsView = /** @__PURE__ @class */ (function () {
11230
11332
  * File Manager all modules
11231
11333
  */
11232
11334
 
11233
- export { AjaxSettings, toolbarItems, ToolbarSettings, SearchSettings, columnArray, DetailsViewSettings, VirtualizationSettings, fileItems, folderItems, layoutItems, ContextMenuSettings, NavigationPaneSettings, UploadSettings, Column, TOOLBAR_ID, LAYOUT_ID, NAVIGATION_ID, TREE_ID, GRID_ID, LARGEICON_ID, DIALOG_ID, ALT_DIALOG_ID, IMG_DIALOG_ID, EXTN_DIALOG_ID, UPLOAD_DIALOG_ID, RETRY_DIALOG_ID, CONTEXT_MENU_ID, SORTBY_ID, VIEW_ID, SPLITTER_ID, CONTENT_ID, BREADCRUMBBAR_ID, UPLOAD_ID, RETRY_ID, SEARCH_ID, ROOT, CONTROL, CHECK_SELECT, ROOT_POPUP, MOBILE, MOB_POPUP, MULTI_SELECT, FILTER, LAYOUT, NAVIGATION, LAYOUT_CONTENT, LARGE_ICONS, TB_ITEM, LIST_ITEM, LIST_TEXT, LIST_PARENT, TB_OPTION_TICK, TB_OPTION_DOT, BLUR, ACTIVE, HOVER, FOCUS, FOCUSED, CHECK, FRAME, CB_WRAP, ROW, ROWCELL, EMPTY, EMPTY_CONTENT, EMPTY_INNER_CONTENT, CLONE, DROP_FOLDER, DROP_FILE, FOLDER, ICON_IMAGE, ICON_MUSIC, ICON_VIDEO, LARGE_ICON, LARGE_EMPTY_FOLDER, LARGE_EMPTY_FOLDER_TWO, LARGE_ICON_FOLDER, SELECTED_ITEMS, TEXT_CONTENT, GRID_HEADER, TEMPLATE_CELL, TREE_VIEW, MENU_ITEM, MENU_ICON, SUBMENU_ICON, GRID_VIEW, GRID_CONTENT, ICON_VIEW, ICON_OPEN, ICON_UPLOAD, ICON_CUT, ICON_COPY, ICON_PASTE, ICON_DELETE, ICON_RENAME, ICON_NEWFOLDER, ICON_DETAILS, ICON_SHORTBY, ICON_REFRESH, ICON_SELECTALL, ICON_DOWNLOAD, ICON_OPTIONS, ICON_GRID, ICON_LARGE, ICON_BREADCRUMB, ICON_CLEAR, ICON_DROP_IN, ICON_DROP_OUT, ICON_NO_DROP, ICONS, DETAILS_LABEL, ERROR_CONTENT, STATUS, BREADCRUMBS, RTL, DISPLAY_NONE, COLLAPSED, FULLROW, ICON_COLLAPSIBLE, SPLIT_BAR, HEADER_CHECK, OVERLAY, VALUE, isFile, modelChanged, initialEnd, finalizeEnd, createEnd, filterEnd, beforeDelete, pathDrag, deleteInit, deleteEnd, refreshEnd, resizeEnd, splitterResize, pathChanged, destroy, beforeRequest, upload, skipUpload, afterRequest, download, layoutRefresh, actionFailure, search, openInit, openEnd, selectionChanged, selectAllInit, clearAllInit, clearPathInit, layoutChange, sortByChange, nodeExpand, detailsInit, menuItemData, renameInit, renameEndParent, renameEnd, showPaste, hidePaste, selectedData, cutCopyInit, pasteInit, pasteEnd, cutEnd, hideLayout, updateTreeSelection, treeSelect, sortColumn, pathColumn, searchTextChange, beforeDownload, downloadInit, dropInit, dragEnd, dropPath, dragHelper, dragging, updateSelectionData, methodCall, permissionRead, permissionEdit, permissionEditContents, permissionCopy, permissionUpload, permissionDownload, FileManager, Toolbar$1 as Toolbar, BreadCrumbBar, Virtualization, NavigationPane, DetailsView, LargeIconsView, createDialog, createExtDialog, createImageDialog, ContextMenu$2 as ContextMenu };
11335
+ export { AjaxSettings, toolbarItems, ToolbarSettings, SearchSettings, columnArray, DetailsViewSettings, fileItems, folderItems, layoutItems, ContextMenuSettings, NavigationPaneSettings, UploadSettings, Column, TOOLBAR_ID, LAYOUT_ID, NAVIGATION_ID, TREE_ID, GRID_ID, LARGEICON_ID, DIALOG_ID, ALT_DIALOG_ID, IMG_DIALOG_ID, EXTN_DIALOG_ID, UPLOAD_DIALOG_ID, RETRY_DIALOG_ID, CONTEXT_MENU_ID, SORTBY_ID, VIEW_ID, SPLITTER_ID, CONTENT_ID, BREADCRUMBBAR_ID, UPLOAD_ID, RETRY_ID, SEARCH_ID, ROOT, CONTROL, CHECK_SELECT, ROOT_POPUP, MOBILE, MOB_POPUP, MULTI_SELECT, FILTER, LAYOUT, NAVIGATION, LAYOUT_CONTENT, LARGE_ICONS, TB_ITEM, LIST_ITEM, LIST_TEXT, LIST_PARENT, TB_OPTION_TICK, TB_OPTION_DOT, BLUR, ACTIVE, HOVER, FOCUS, FOCUSED, CHECK, FRAME, CB_WRAP, ROW, ROWCELL, EMPTY, EMPTY_CONTENT, EMPTY_INNER_CONTENT, CLONE, DROP_FOLDER, DROP_FILE, FOLDER, ICON_IMAGE, ICON_MUSIC, ICON_VIDEO, LARGE_ICON, LARGE_EMPTY_FOLDER, LARGE_EMPTY_FOLDER_TWO, LARGE_ICON_FOLDER, SELECTED_ITEMS, TEXT_CONTENT, GRID_HEADER, TEMPLATE_CELL, TREE_VIEW, MENU_ITEM, MENU_ICON, SUBMENU_ICON, GRID_VIEW, GRID_CONTENT, ICON_VIEW, ICON_OPEN, ICON_UPLOAD, ICON_CUT, ICON_COPY, ICON_PASTE, ICON_DELETE, ICON_RENAME, ICON_NEWFOLDER, ICON_DETAILS, ICON_SHORTBY, ICON_REFRESH, ICON_SELECTALL, ICON_DOWNLOAD, ICON_OPTIONS, ICON_GRID, ICON_LARGE, ICON_BREADCRUMB, ICON_CLEAR, ICON_DROP_IN, ICON_DROP_OUT, ICON_NO_DROP, ICONS, DETAILS_LABEL, ERROR_CONTENT, STATUS, BREADCRUMBS, RTL, DISPLAY_NONE, COLLAPSED, FULLROW, ICON_COLLAPSIBLE, SPLIT_BAR, HEADER_CHECK, OVERLAY, VALUE, isFile, modelChanged, initialEnd, finalizeEnd, createEnd, filterEnd, beforeDelete, pathDrag, deleteInit, deleteEnd, refreshEnd, resizeEnd, splitterResize, pathChanged, destroy, beforeRequest, upload, skipUpload, afterRequest, download, layoutRefresh, actionFailure, search, openInit, openEnd, selectionChanged, selectAllInit, clearAllInit, clearPathInit, layoutChange, sortByChange, nodeExpand, detailsInit, menuItemData, renameInit, renameEndParent, renameEnd, showPaste, hidePaste, selectedData, cutCopyInit, pasteInit, pasteEnd, cutEnd, hideLayout, updateTreeSelection, treeSelect, sortColumn, pathColumn, searchTextChange, beforeDownload, downloadInit, dropInit, dragEnd, dropPath, dragHelper, dragging, updateSelectionData, methodCall, permissionRead, permissionEdit, permissionEditContents, permissionCopy, permissionUpload, permissionDownload, FileManager, Toolbar$1 as Toolbar, BreadCrumbBar, Virtualization, NavigationPane, DetailsView, LargeIconsView, createDialog, createExtDialog, createImageDialog, ContextMenu$2 as ContextMenu };
11234
11336
  //# sourceMappingURL=ej2-filemanager.es5.js.map