@syncfusion/ej2-filemanager 20.3.49 → 20.4.38

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 (64) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +0 -8
  3. package/README.md +53 -42
  4. package/dist/ej2-filemanager.min.js +2 -2
  5. package/dist/ej2-filemanager.umd.min.js +2 -2
  6. package/dist/ej2-filemanager.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-filemanager.es2015.js +313 -90
  8. package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
  9. package/dist/es6/ej2-filemanager.es5.js +343 -99
  10. package/dist/es6/ej2-filemanager.es5.js.map +1 -1
  11. package/dist/global/ej2-filemanager.min.js +2 -2
  12. package/dist/global/ej2-filemanager.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +26 -17
  15. package/src/file-manager/actions/breadcrumb-bar.js +1 -1
  16. package/src/file-manager/actions/index.d.ts +1 -0
  17. package/src/file-manager/actions/index.js +1 -0
  18. package/src/file-manager/actions/virtualization.d.ts +38 -0
  19. package/src/file-manager/actions/virtualization.js +179 -0
  20. package/src/file-manager/base/file-manager-model.d.ts +14 -1
  21. package/src/file-manager/base/file-manager.d.ts +15 -0
  22. package/src/file-manager/base/file-manager.js +10 -1
  23. package/src/file-manager/base/interface.d.ts +2 -1
  24. package/src/file-manager/common/utility.js +5 -4
  25. package/src/file-manager/layout/details-view.js +13 -0
  26. package/src/file-manager/layout/large-icons-view.d.ts +2 -1
  27. package/src/file-manager/layout/large-icons-view.js +8 -1
  28. package/src/file-manager/models/index.d.ts +2 -0
  29. package/src/file-manager/models/index.js +1 -0
  30. package/src/file-manager/models/virtualization-settings-model.d.ts +29 -0
  31. package/src/file-manager/models/virtualization-settings.d.ts +24 -0
  32. package/src/file-manager/models/virtualization-settings.js +40 -0
  33. package/src/global.js +1 -1
  34. package/styles/bootstrap-dark.css +2 -12
  35. package/styles/bootstrap.css +2 -12
  36. package/styles/bootstrap4.css +2 -12
  37. package/styles/bootstrap5-dark.css +2 -12
  38. package/styles/bootstrap5.css +2 -12
  39. package/styles/fabric-dark.css +2 -12
  40. package/styles/fabric.css +2 -12
  41. package/styles/file-manager/_layout.scss +9 -19
  42. package/styles/file-manager/bootstrap-dark.css +2 -12
  43. package/styles/file-manager/bootstrap.css +2 -12
  44. package/styles/file-manager/bootstrap4.css +2 -12
  45. package/styles/file-manager/bootstrap5-dark.css +2 -12
  46. package/styles/file-manager/bootstrap5.css +2 -12
  47. package/styles/file-manager/fabric-dark.css +2 -12
  48. package/styles/file-manager/fabric.css +2 -12
  49. package/styles/file-manager/fluent-dark.css +8 -12
  50. package/styles/file-manager/fluent.css +8 -12
  51. package/styles/file-manager/highcontrast-light.css +2 -12
  52. package/styles/file-manager/highcontrast.css +2 -12
  53. package/styles/file-manager/material-dark.css +2 -12
  54. package/styles/file-manager/material.css +2 -15
  55. package/styles/file-manager/tailwind-dark.css +2 -12
  56. package/styles/file-manager/tailwind.css +2 -12
  57. package/styles/fluent-dark.css +8 -12
  58. package/styles/fluent.css +8 -12
  59. package/styles/highcontrast-light.css +2 -12
  60. package/styles/highcontrast.css +2 -12
  61. package/styles/material-dark.css +2 -12
  62. package/styles/material.css +2 -15
  63. package/styles/tailwind-dark.css +2 -12
  64. package/styles/tailwind.css +2 -12
@@ -117,6 +117,27 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
117
117
  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;
118
118
  return c > 3 && r && Object.defineProperty(target, key, r), r;
119
119
  };
120
+ /**
121
+ * Specifies the virtualization settings of the File Manager.
122
+ */
123
+ class VirtualizationSettings extends ChildProperty {
124
+ }
125
+ __decorate$4([
126
+ Property(false)
127
+ ], VirtualizationSettings.prototype, "enable", void 0);
128
+ __decorate$4([
129
+ Property(20)
130
+ ], VirtualizationSettings.prototype, "detailsViewItemsCount", void 0);
131
+ __decorate$4([
132
+ Property(40)
133
+ ], VirtualizationSettings.prototype, "largeIconsViewItemsCount", void 0);
134
+
135
+ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
136
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
137
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
138
+ 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;
139
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
140
+ };
120
141
  const fileItems = ['Open', '|', 'Cut', 'Copy', '|', 'Delete', 'Download', 'Rename', '|', 'Details'];
121
142
  const folderItems = ['Open', '|', 'Cut', 'Copy', 'Paste', '|', 'Delete', 'Rename', 'Download', '|', 'Details'];
122
143
  const layoutItems = [
@@ -127,20 +148,20 @@ const layoutItems = [
127
148
  */
128
149
  class ContextMenuSettings extends ChildProperty {
129
150
  }
130
- __decorate$4([
151
+ __decorate$5([
131
152
  Property(fileItems)
132
153
  ], ContextMenuSettings.prototype, "file", void 0);
133
- __decorate$4([
154
+ __decorate$5([
134
155
  Property(folderItems)
135
156
  ], ContextMenuSettings.prototype, "folder", void 0);
136
- __decorate$4([
157
+ __decorate$5([
137
158
  Property(layoutItems)
138
159
  ], ContextMenuSettings.prototype, "layout", void 0);
139
- __decorate$4([
160
+ __decorate$5([
140
161
  Property(true)
141
162
  ], ContextMenuSettings.prototype, "visible", void 0);
142
163
 
143
- var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
164
+ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
144
165
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
145
166
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
146
167
  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;
@@ -151,20 +172,20 @@ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators,
151
172
  */
152
173
  class NavigationPaneSettings extends ChildProperty {
153
174
  }
154
- __decorate$5([
175
+ __decorate$6([
155
176
  Property('650px')
156
177
  ], NavigationPaneSettings.prototype, "maxWidth", void 0);
157
- __decorate$5([
178
+ __decorate$6([
158
179
  Property('240px')
159
180
  ], NavigationPaneSettings.prototype, "minWidth", void 0);
160
- __decorate$5([
181
+ __decorate$6([
161
182
  Property(true)
162
183
  ], NavigationPaneSettings.prototype, "visible", void 0);
163
- __decorate$5([
184
+ __decorate$6([
164
185
  Property('None')
165
186
  ], NavigationPaneSettings.prototype, "sortOrder", void 0);
166
187
 
167
- var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
188
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
168
189
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
169
190
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
170
191
  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;
@@ -175,26 +196,26 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
175
196
  */
176
197
  class UploadSettings extends ChildProperty {
177
198
  }
178
- __decorate$6([
199
+ __decorate$7([
179
200
  Property('')
180
201
  ], UploadSettings.prototype, "allowedExtensions", void 0);
181
- __decorate$6([
202
+ __decorate$7([
182
203
  Property(true)
183
204
  ], UploadSettings.prototype, "autoUpload", void 0);
184
- __decorate$6([
205
+ __decorate$7([
185
206
  Property(false)
186
207
  ], UploadSettings.prototype, "autoClose", void 0);
187
- __decorate$6([
208
+ __decorate$7([
188
209
  Property(false)
189
210
  ], UploadSettings.prototype, "directoryUpload", void 0);
190
- __decorate$6([
211
+ __decorate$7([
191
212
  Property(0)
192
213
  ], UploadSettings.prototype, "minFileSize", void 0);
193
- __decorate$6([
214
+ __decorate$7([
194
215
  Property(30000000)
195
216
  ], UploadSettings.prototype, "maxFileSize", void 0);
196
217
 
197
- var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
218
+ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
198
219
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
199
220
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
200
221
  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;
@@ -206,52 +227,52 @@ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators,
206
227
  /* istanbul ignore next */
207
228
  class Column extends ChildProperty {
208
229
  }
209
- __decorate$7([
230
+ __decorate$8([
210
231
  Property('')
211
232
  ], Column.prototype, "field", void 0);
212
- __decorate$7([
233
+ __decorate$8([
213
234
  Property('')
214
235
  ], Column.prototype, "headerText", void 0);
215
- __decorate$7([
236
+ __decorate$8([
216
237
  Property('')
217
238
  ], Column.prototype, "width", void 0);
218
- __decorate$7([
239
+ __decorate$8([
219
240
  Property('')
220
241
  ], Column.prototype, "minWidth", void 0);
221
- __decorate$7([
242
+ __decorate$8([
222
243
  Property('')
223
244
  ], Column.prototype, "maxWidth", void 0);
224
- __decorate$7([
245
+ __decorate$8([
225
246
  Property('Left')
226
247
  ], Column.prototype, "textAlign", void 0);
227
- __decorate$7([
248
+ __decorate$8([
228
249
  Property(null)
229
250
  ], Column.prototype, "headerTextAlign", void 0);
230
- __decorate$7([
251
+ __decorate$8([
231
252
  Property(null)
232
253
  ], Column.prototype, "type", void 0);
233
- __decorate$7([
254
+ __decorate$8([
234
255
  Property(null)
235
256
  ], Column.prototype, "format", void 0);
236
- __decorate$7([
257
+ __decorate$8([
237
258
  Property(null)
238
259
  ], Column.prototype, "template", void 0);
239
- __decorate$7([
260
+ __decorate$8([
240
261
  Property(null)
241
262
  ], Column.prototype, "headerTemplate", void 0);
242
- __decorate$7([
263
+ __decorate$8([
243
264
  Property(true)
244
265
  ], Column.prototype, "allowSorting", void 0);
245
- __decorate$7([
266
+ __decorate$8([
246
267
  Property(true)
247
268
  ], Column.prototype, "allowResizing", void 0);
248
- __decorate$7([
269
+ __decorate$8([
249
270
  Property(null)
250
271
  ], Column.prototype, "customAttributes", void 0);
251
- __decorate$7([
272
+ __decorate$8([
252
273
  Property('')
253
274
  ], Column.prototype, "hideAtMedia", void 0);
254
- __decorate$7([
275
+ __decorate$8([
255
276
  Property(null)
256
277
  ], Column.prototype, "customFormat", void 0);
257
278
 
@@ -884,7 +905,7 @@ function searchWordHandler(parent, value, isLayoutChange) {
884
905
  else {
885
906
  if (!parent.isFiltered) {
886
907
  if (parent.isSortByClicked) {
887
- parent.notify(layoutChange, { files: (parent.oldView === 'Details') ? parent.detailsviewModule.gridObj.dataSource : parent.largeiconsviewModule.items });
908
+ parent.notify(layoutChange, { files: (parent.oldView === 'Details') ? parent.detailsviewModule.gridObj.dataSource : parent.largeiconsviewModule.allItems });
888
909
  parent.isSortByClicked = false;
889
910
  }
890
911
  else {
@@ -1070,18 +1091,19 @@ function fileType(file) {
1070
1091
  // eslint-disable-next-line
1071
1092
  function getImageUrl(parent, item) {
1072
1093
  const baseUrl = parent.ajaxSettings.getImageUrl ? parent.ajaxSettings.getImageUrl : parent.ajaxSettings.url;
1094
+ let pathUrl = (baseUrl.indexOf('?') !== -1) ? '&path=' : '?path=';
1073
1095
  let imgUrl;
1074
1096
  const fileName = encodeURIComponent(getValue('name', item));
1075
1097
  const fPath = getValue('filterPath', item);
1076
1098
  if (parent.hasId) {
1077
1099
  const imgId = getValue('id', item);
1078
- imgUrl = baseUrl + '?path=' + parent.path + '&id=' + imgId;
1100
+ imgUrl = baseUrl + pathUrl + parent.path + '&id=' + imgId;
1079
1101
  }
1080
1102
  else if (!isNullOrUndefined(fPath)) {
1081
- imgUrl = baseUrl + '?path=' + encodeURIComponent(fPath.replace(/\\/g, '/')) + fileName;
1103
+ imgUrl = baseUrl + pathUrl + encodeURIComponent(fPath.replace(/\\/g, '/')) + fileName;
1082
1104
  }
1083
1105
  else {
1084
- imgUrl = baseUrl + '?path=' + parent.path + fileName;
1106
+ imgUrl = baseUrl + pathUrl + parent.path + fileName;
1085
1107
  }
1086
1108
  imgUrl = imgUrl + '&time=' + (new Date().getTime()).toString();
1087
1109
  const eventArgs = {
@@ -3838,7 +3860,10 @@ class LargeIconsView {
3838
3860
  };
3839
3861
  this.items = [];
3840
3862
  this.items = this.renderList(args);
3841
- this.items = getSortedData(this.parent, this.items);
3863
+ this.items = this.allItems = getSortedData(this.parent, this.items);
3864
+ // if (this.parent.virtualizationSettings.enable) {
3865
+ // this.items = this.allItems.slice(0, this.parent.virtualizationSettings.largeIconsViewItemsCount);
3866
+ // }
3842
3867
  // eslint-disable-next-line
3843
3868
  this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
3844
3869
  this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.listElements));
@@ -3880,6 +3905,10 @@ class LargeIconsView {
3880
3905
  this.getItemCount();
3881
3906
  this.addEventListener();
3882
3907
  this.wireEvents();
3908
+ // if (this.parent.virtualizationSettings.enable && this.allItems.length > 0) {
3909
+ // this.parent.virtualizationModule.setUlElementHeight();
3910
+ // this.parent.virtualizationModule.wireScrollEvent(false);
3911
+ // }
3883
3912
  this.isRendered = true;
3884
3913
  hideSpinner(this.parent.element);
3885
3914
  if (this.parent.selectedItems.length) {
@@ -5673,7 +5702,7 @@ class BreadCrumbBar {
5673
5702
  }
5674
5703
  }
5675
5704
  onSearchTextChange(args) {
5676
- this.searchObj.element.placeholder = (this.parent.searchSettings.placeholder != null) ? this.parent.searchSettings.placeholder : getLocaleText(this.parent, 'Search') + ' ' + args.cwd.name;
5705
+ this.searchObj.element.placeholder = (this.parent.searchSettings.placeholder != null) ? this.parent.searchSettings.placeholder : getLocaleText(this.parent, 'Search') + ' ' + getLocaleText(this.parent, args.cwd.name.toString());
5677
5706
  }
5678
5707
  }
5679
5708
 
@@ -6373,7 +6402,7 @@ const defaultLocale = {
6373
6402
  'Server-Error': 'ServerError: Invalid response from'
6374
6403
  };
6375
6404
 
6376
- var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
6405
+ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
6377
6406
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6378
6407
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6379
6408
  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;
@@ -6537,6 +6566,12 @@ let FileManager = FileManager_1 = class FileManager extends Component {
6537
6566
  args: [this]
6538
6567
  });
6539
6568
  }
6569
+ if (this.virtualizationSettings.enable) {
6570
+ modules.push({
6571
+ member: 'virtualization',
6572
+ args: [this]
6573
+ });
6574
+ }
6540
6575
  return modules;
6541
6576
  }
6542
6577
  /**
@@ -7463,151 +7498,154 @@ let FileManager = FileManager_1 = class FileManager extends Component {
7463
7498
  }
7464
7499
  }
7465
7500
  };
7466
- __decorate$8([
7501
+ __decorate$9([
7467
7502
  Complex({}, AjaxSettings)
7468
7503
  ], FileManager.prototype, "ajaxSettings", void 0);
7469
- __decorate$8([
7504
+ __decorate$9([
7470
7505
  Property(false)
7471
7506
  ], FileManager.prototype, "allowDragAndDrop", void 0);
7472
- __decorate$8([
7507
+ __decorate$9([
7473
7508
  Property(true)
7474
7509
  ], FileManager.prototype, "allowMultiSelection", void 0);
7475
- __decorate$8([
7510
+ __decorate$9([
7476
7511
  Complex({}, ContextMenuSettings)
7477
7512
  ], FileManager.prototype, "contextMenuSettings", void 0);
7478
- __decorate$8([
7513
+ __decorate$9([
7479
7514
  Property('')
7480
7515
  ], FileManager.prototype, "cssClass", void 0);
7481
- __decorate$8([
7516
+ __decorate$9([
7482
7517
  Complex({}, DetailsViewSettings)
7483
7518
  ], FileManager.prototype, "detailsViewSettings", void 0);
7484
- __decorate$8([
7519
+ __decorate$9([
7520
+ Complex({}, VirtualizationSettings)
7521
+ ], FileManager.prototype, "virtualizationSettings", void 0);
7522
+ __decorate$9([
7485
7523
  Property(true)
7486
7524
  ], FileManager.prototype, "enableHtmlSanitizer", void 0);
7487
- __decorate$8([
7525
+ __decorate$9([
7488
7526
  Property(false)
7489
7527
  ], FileManager.prototype, "enablePersistence", void 0);
7490
- __decorate$8([
7528
+ __decorate$9([
7491
7529
  Property('400px')
7492
7530
  ], FileManager.prototype, "height", void 0);
7493
- __decorate$8([
7531
+ __decorate$9([
7494
7532
  Property('LargeIcons')
7495
7533
  ], FileManager.prototype, "view", void 0);
7496
- __decorate$8([
7534
+ __decorate$9([
7497
7535
  Complex({}, NavigationPaneSettings)
7498
7536
  ], FileManager.prototype, "navigationPaneSettings", void 0);
7499
- __decorate$8([
7537
+ __decorate$9([
7500
7538
  Property('/')
7501
7539
  ], FileManager.prototype, "path", void 0);
7502
- __decorate$8([
7540
+ __decorate$9([
7503
7541
  Property(null)
7504
7542
  ], FileManager.prototype, "popupTarget", void 0);
7505
- __decorate$8([
7543
+ __decorate$9([
7506
7544
  Complex({}, SearchSettings)
7507
7545
  ], FileManager.prototype, "searchSettings", void 0);
7508
- __decorate$8([
7546
+ __decorate$9([
7509
7547
  Property()
7510
7548
  ], FileManager.prototype, "selectedItems", void 0);
7511
- __decorate$8([
7549
+ __decorate$9([
7512
7550
  Property(true)
7513
7551
  ], FileManager.prototype, "showFileExtension", void 0);
7514
- __decorate$8([
7552
+ __decorate$9([
7515
7553
  Property(null)
7516
7554
  ], FileManager.prototype, "rootAliasName", void 0);
7517
- __decorate$8([
7555
+ __decorate$9([
7518
7556
  Property(false)
7519
7557
  ], FileManager.prototype, "showHiddenItems", void 0);
7520
- __decorate$8([
7558
+ __decorate$9([
7521
7559
  Property(true)
7522
7560
  ], FileManager.prototype, "showThumbnail", void 0);
7523
- __decorate$8([
7561
+ __decorate$9([
7524
7562
  Property('Ascending')
7525
7563
  ], FileManager.prototype, "sortOrder", void 0);
7526
- __decorate$8([
7564
+ __decorate$9([
7527
7565
  Property('name')
7528
7566
  ], FileManager.prototype, "sortBy", void 0);
7529
- __decorate$8([
7567
+ __decorate$9([
7530
7568
  Complex({}, ToolbarSettings)
7531
7569
  ], FileManager.prototype, "toolbarSettings", void 0);
7532
- __decorate$8([
7570
+ __decorate$9([
7533
7571
  Complex({}, UploadSettings)
7534
7572
  ], FileManager.prototype, "uploadSettings", void 0);
7535
- __decorate$8([
7573
+ __decorate$9([
7536
7574
  Property('100%')
7537
7575
  ], FileManager.prototype, "width", void 0);
7538
- __decorate$8([
7576
+ __decorate$9([
7539
7577
  Event()
7540
7578
  ], FileManager.prototype, "fileLoad", void 0);
7541
- __decorate$8([
7579
+ __decorate$9([
7542
7580
  Event()
7543
7581
  ], FileManager.prototype, "fileOpen", void 0);
7544
- __decorate$8([
7582
+ __decorate$9([
7545
7583
  Event()
7546
7584
  ], FileManager.prototype, "beforeDownload", void 0);
7547
- __decorate$8([
7585
+ __decorate$9([
7548
7586
  Event()
7549
7587
  ], FileManager.prototype, "beforeImageLoad", void 0);
7550
- __decorate$8([
7588
+ __decorate$9([
7551
7589
  Event()
7552
7590
  ], FileManager.prototype, "beforePopupClose", void 0);
7553
- __decorate$8([
7591
+ __decorate$9([
7554
7592
  Event()
7555
7593
  ], FileManager.prototype, "beforePopupOpen", void 0);
7556
- __decorate$8([
7594
+ __decorate$9([
7557
7595
  Event()
7558
7596
  ], FileManager.prototype, "beforeSend", void 0);
7559
- __decorate$8([
7597
+ __decorate$9([
7560
7598
  Event()
7561
7599
  ], FileManager.prototype, "created", void 0);
7562
- __decorate$8([
7600
+ __decorate$9([
7563
7601
  Event()
7564
7602
  ], FileManager.prototype, "destroyed", void 0);
7565
- __decorate$8([
7603
+ __decorate$9([
7566
7604
  Event()
7567
7605
  ], FileManager.prototype, "fileDragStart", void 0);
7568
- __decorate$8([
7606
+ __decorate$9([
7569
7607
  Event()
7570
7608
  ], FileManager.prototype, "fileDragging", void 0);
7571
- __decorate$8([
7609
+ __decorate$9([
7572
7610
  Event()
7573
7611
  ], FileManager.prototype, "fileDragStop", void 0);
7574
- __decorate$8([
7612
+ __decorate$9([
7575
7613
  Event()
7576
7614
  ], FileManager.prototype, "fileDropped", void 0);
7577
- __decorate$8([
7615
+ __decorate$9([
7578
7616
  Event()
7579
7617
  ], FileManager.prototype, "fileSelection", void 0);
7580
- __decorate$8([
7618
+ __decorate$9([
7581
7619
  Event()
7582
7620
  ], FileManager.prototype, "fileSelect", void 0);
7583
- __decorate$8([
7621
+ __decorate$9([
7584
7622
  Event()
7585
7623
  ], FileManager.prototype, "menuClick", void 0);
7586
- __decorate$8([
7624
+ __decorate$9([
7587
7625
  Event()
7588
7626
  ], FileManager.prototype, "menuOpen", void 0);
7589
- __decorate$8([
7627
+ __decorate$9([
7590
7628
  Event()
7591
7629
  ], FileManager.prototype, "failure", void 0);
7592
- __decorate$8([
7630
+ __decorate$9([
7593
7631
  Event()
7594
7632
  ], FileManager.prototype, "popupClose", void 0);
7595
- __decorate$8([
7633
+ __decorate$9([
7596
7634
  Event()
7597
7635
  ], FileManager.prototype, "popupOpen", void 0);
7598
- __decorate$8([
7636
+ __decorate$9([
7599
7637
  Event()
7600
7638
  ], FileManager.prototype, "success", void 0);
7601
- __decorate$8([
7639
+ __decorate$9([
7602
7640
  Event()
7603
7641
  ], FileManager.prototype, "toolbarClick", void 0);
7604
- __decorate$8([
7642
+ __decorate$9([
7605
7643
  Event()
7606
7644
  ], FileManager.prototype, "toolbarCreate", void 0);
7607
- __decorate$8([
7645
+ __decorate$9([
7608
7646
  Event()
7609
7647
  ], FileManager.prototype, "uploadListCreate", void 0);
7610
- FileManager = FileManager_1 = __decorate$8([
7648
+ FileManager = FileManager_1 = __decorate$9([
7611
7649
  NotifyPropertyChanges
7612
7650
  ], FileManager);
7613
7651
 
@@ -8097,6 +8135,178 @@ class Toolbar$1 {
8097
8135
  }
8098
8136
  }
8099
8137
 
8138
+ class Virtualization {
8139
+ constructor(instance) {
8140
+ this.largeIconsViewItemsCount = 40;
8141
+ this.filemanagerInstance = instance;
8142
+ this.largeIconInstance = instance.largeiconsviewModule;
8143
+ }
8144
+ // Update the scroller height based on the items count.
8145
+ setUlElementHeight() {
8146
+ this.rowItemCount = this.ValidateItemCount(Object.keys(this.largeIconInstance.allItems).length);
8147
+ this.lastRowCount = (this.largeIconInstance.allItems.length - this.largeIconsViewItemsCount) % this.rowItemCount ?
8148
+ (this.largeIconInstance.allItems.length - this.largeIconsViewItemsCount) % this.rowItemCount : this.rowItemCount;
8149
+ this.topElement = this.filemanagerInstance.createElement('div');
8150
+ this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement, this.largeIconInstance.element.firstElementChild.firstChild);
8151
+ this.bottomElement = this.filemanagerInstance.createElement('div');
8152
+ this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement, null);
8153
+ const marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top')) +
8154
+ parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-bottom'));
8155
+ this.listItemHeight = this.largeIconInstance.itemList[0].getBoundingClientRect().height + marginValue;
8156
+ this.totalHeight = (Object.keys(this.largeIconInstance.allItems).length / this.rowItemCount) * this.listItemHeight;
8157
+ this.topElement.style.height = 0 + 'px';
8158
+ this.bottomElement.style.height = this.totalHeight + 'px';
8159
+ this.topElementHeight = 0;
8160
+ this.bottomElementHeight = this.totalHeight;
8161
+ this.listDiff = 0;
8162
+ this.renderedCount = this.largeIconsViewItemsCount;
8163
+ }
8164
+ // Calculated the maximum number of items can be rendered in each row.
8165
+ ValidateItemCount(dataSourceLength) {
8166
+ const width = parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth));
8167
+ const marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-right')) +
8168
+ parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-left'));
8169
+ let itemCount = Math.floor(width / (this.largeIconInstance.itemList[0].offsetWidth + marginValue));
8170
+ if (itemCount > dataSourceLength) {
8171
+ itemCount = dataSourceLength;
8172
+ }
8173
+ return itemCount;
8174
+ }
8175
+ // Bind the scroll event for large icons view ul element.
8176
+ wireScrollEvent(destroy) {
8177
+ if (!destroy) {
8178
+ EventHandler.add(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll, this);
8179
+ }
8180
+ else {
8181
+ EventHandler.remove(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll);
8182
+ }
8183
+ }
8184
+ // Update the top and bottom element height and update the scroll position.
8185
+ onVirtualUiScroll(e) {
8186
+ let startingHeight = 0;
8187
+ this.scrollPosition = isNullOrUndefined(this.scrollPosition) ? 0 : this.scrollPosition;
8188
+ const scroll = this.getscrollerHeight(startingHeight);
8189
+ this.topElementHeight = this.listItemHeight * Math.floor(scroll / this.listItemHeight);
8190
+ this.bottomElementHeight = this.totalHeight - this.topElementHeight;
8191
+ [this.topElementHeight, this.bottomElementHeight] = scroll <= this.totalHeight ?
8192
+ [this.topElementHeight, this.bottomElementHeight] : [this.totalHeight, 0];
8193
+ if (this.topElementHeight !== parseFloat(this.topElement.style.height)) {
8194
+ this.topElement.style.height = this.topElementHeight + 'px';
8195
+ this.bottomElement.style.height = this.bottomElementHeight + 'px';
8196
+ // checked whether the scrolling is upward/downward
8197
+ if (scroll > this.scrollPosition) {
8198
+ const listDiff = Math.round(((this.topElementHeight / this.listItemHeight) - this.listDiff));
8199
+ this.onNormalScroll(listDiff, true);
8200
+ }
8201
+ else {
8202
+ const listDiff = Math.round((this.listDiff - (this.topElementHeight / this.listItemHeight)));
8203
+ this.onNormalScroll(listDiff, false);
8204
+ }
8205
+ }
8206
+ this.listDiff = Math.round(this.topElementHeight / this.listItemHeight);
8207
+ this.scrollPosition = scroll;
8208
+ this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.largeIconInstance.element));
8209
+ this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
8210
+ this.largeIconsViewItemsCount, this.renderedCount);
8211
+ }
8212
+ // Calculated the scroller height.
8213
+ getscrollerHeight(startingHeight) {
8214
+ return ((this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight) <= 0) ? 0 :
8215
+ (this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight);
8216
+ }
8217
+ // Update the UI based on the scrolled position.
8218
+ onNormalScroll(listDiff, isScrollingDown) {
8219
+ for (let i = 0; i < listDiff; i++) {
8220
+ this.updateUI(isScrollingDown);
8221
+ }
8222
+ this.updateSelection();
8223
+ }
8224
+ // Updating the items in large icons view dynamically.
8225
+ updateUI(isScrollingDown) {
8226
+ if (isScrollingDown) {
8227
+ this.items = this.largeIconInstance.allItems.slice(this.renderedCount, this.renderedCount + this.rowItemCount);
8228
+ if (this.items.length > 0) {
8229
+ this.listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
8230
+ this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.listElements));
8231
+ this.itemList.forEach(liEle => {
8232
+ this.largeIconInstance.element.firstElementChild.insertBefore(liEle, this.bottomElement);
8233
+ });
8234
+ this.renderedCount = (this.largeIconInstance.allItems.length >= this.renderedCount + this.rowItemCount) ?
8235
+ this.renderedCount + this.rowItemCount : this.renderedCount + this.lastRowCount;
8236
+ for (let i = 0; i < this.rowItemCount; i++) {
8237
+ detach(this.topElement.nextElementSibling);
8238
+ }
8239
+ }
8240
+ }
8241
+ else {
8242
+ let lastItemIndex;
8243
+ let isAllRendered;
8244
+ if (this.renderedCount == this.largeIconInstance.allItems.length) {
8245
+ lastItemIndex = this.renderedCount - (this.largeIconsViewItemsCount - this.rowItemCount + this.lastRowCount);
8246
+ this.renderedCount = ((this.renderedCount - this.lastRowCount) < this.largeIconsViewItemsCount) ?
8247
+ this.largeIconsViewItemsCount : (this.renderedCount - this.lastRowCount);
8248
+ isAllRendered = true;
8249
+ }
8250
+ else {
8251
+ lastItemIndex = this.renderedCount - this.largeIconsViewItemsCount;
8252
+ this.renderedCount = ((this.renderedCount - this.rowItemCount) < this.largeIconsViewItemsCount) ?
8253
+ this.largeIconsViewItemsCount : (this.renderedCount - this.rowItemCount);
8254
+ }
8255
+ let startItemIndex = (lastItemIndex - this.rowItemCount > 0) ? lastItemIndex - this.rowItemCount : 0;
8256
+ this.items = this.largeIconInstance.allItems.slice(startItemIndex, lastItemIndex);
8257
+ if (this.items.length > 0) {
8258
+ this.listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
8259
+ this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.listElements));
8260
+ for (let len = this.itemList.length; len > 0; len--) {
8261
+ this.largeIconInstance.element.firstElementChild.insertBefore(this.itemList[len - 1], this.topElement.nextElementSibling);
8262
+ }
8263
+ for (var i = 0; i < ((isAllRendered) ? this.lastRowCount : this.rowItemCount); i++) {
8264
+ detach(this.bottomElement.previousElementSibling);
8265
+ }
8266
+ }
8267
+ }
8268
+ }
8269
+ // Update the selected item state.
8270
+ updateSelection() {
8271
+ for (let i = 0; i < this.filemanagerInstance.selectedItems.length; i++) {
8272
+ for (let j = 0; j < this.items.length; j++) {
8273
+ if (this.filemanagerInstance.selectedItems[i] == getValue('name', this.items[j])) {
8274
+ this.updateCheckState(this.itemList[j]);
8275
+ }
8276
+ }
8277
+ }
8278
+ }
8279
+ // Update the check state for items.
8280
+ updateCheckState(liItem) {
8281
+ if (this.filemanagerInstance.allowMultiSelection) {
8282
+ addClass([liItem], [ACTIVE]);
8283
+ liItem.setAttribute('aria-selected', 'true');
8284
+ const checkEle = select('.' + FRAME, liItem);
8285
+ if (!checkEle.classList.contains(CHECK)) {
8286
+ addClass([checkEle], CHECK);
8287
+ closest(checkEle, '.' + CB_WRAP).setAttribute('aria-checked', 'true');
8288
+ }
8289
+ }
8290
+ }
8291
+ /**
8292
+ * For internal use only - Get the module name.
8293
+ *
8294
+ * @returns {string} - returns the module name.
8295
+ * @private
8296
+ */
8297
+ getModuleName() {
8298
+ return 'virtualization';
8299
+ }
8300
+ destroy() {
8301
+ if (this.filemanagerInstance.isDestroyed) {
8302
+ return;
8303
+ }
8304
+ if (!isNullOrUndefined(this.largeIconInstance.element.firstElementChild)) {
8305
+ this.wireScrollEvent(true);
8306
+ }
8307
+ }
8308
+ }
8309
+
8100
8310
  /**
8101
8311
  * File Manager actions modules
8102
8312
  */
@@ -9040,6 +9250,10 @@ class DetailsView {
9040
9250
  },
9041
9251
  enableRtl: this.parent.enableRtl,
9042
9252
  pageSettings: { pageSize: 20 },
9253
+ // enableVirtualization: this.parent.virtualizationSettings.enable,
9254
+ enablePersistence: this.parent.enablePersistence,
9255
+ // enableVirtualMaskRow: true,
9256
+ // pageSettings: { pageSize: this.parent.virtualizationSettings.detailsViewItemsCount },
9043
9257
  sortSettings: { allowUnsort: false, columns: sortSettings },
9044
9258
  columns: columns,
9045
9259
  recordDoubleClick: this.DblClickEvents.bind(this),
@@ -9248,14 +9462,19 @@ class DetailsView {
9248
9462
  }
9249
9463
  }
9250
9464
  onBeforeDataBound(args) {
9465
+ // if (!this.parent.virtualizationSettings.enable) {
9251
9466
  showSpinner(this.parent.element);
9252
9467
  // eslint-disable-next-line
9253
9468
  const items = getSortedData(this.parent, this.gridObj.dataSource);
9254
9469
  args.result = items;
9470
+ // }
9255
9471
  }
9256
9472
  /* istanbul ignore next */
9257
9473
  onDataBound() {
9258
9474
  this.createDragObj();
9475
+ // if ((this.parent.selectedItems.length !== 0 && !this.parent.virtualizationSettings.enable) ||
9476
+ // ((this.parent.selectedItems.length !== 0 && this.parent.virtualizationSettings.enable &&
9477
+ // this.element.querySelector('.e-content').scrollTop == 0))) {
9259
9478
  if (this.parent.selectedItems.length !== 0) {
9260
9479
  this.selectRecords(this.parent.selectedItems);
9261
9480
  }
@@ -10015,6 +10234,10 @@ class DetailsView {
10015
10234
  }
10016
10235
  const len = rows.length;
10017
10236
  if (len > 0) {
10237
+ // if (this.parent.virtualizationSettings.enable) {
10238
+ // this.parent.currentItemText = getValue('name', args.data);
10239
+ // }
10240
+ // else if (len > 0) {
10018
10241
  // eslint-disable-next-line
10019
10242
  const data = this.gridObj.getRowsObject()[rows[len - 1]].data;
10020
10243
  this.parent.currentItemText = getValue('name', data);
@@ -10795,5 +11018,5 @@ class DetailsView {
10795
11018
  * File Manager all modules
10796
11019
  */
10797
11020
 
10798
- 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, NavigationPane, DetailsView, LargeIconsView, createDialog, createExtDialog, createImageDialog, ContextMenu$2 as ContextMenu };
11021
+ 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 };
10799
11022
  //# sourceMappingURL=ej2-filemanager.es2015.js.map