@syncfusion/ej2-filemanager 20.4.42 → 20.4.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/ej2-filemanager.min.js +2 -2
- package/dist/ej2-filemanager.umd.min.js +2 -2
- package/dist/ej2-filemanager.umd.min.js.map +1 -1
- package/dist/es6/ej2-filemanager.es2015.js +321 -207
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +327 -230
- package/dist/es6/ej2-filemanager.es5.js.map +1 -1
- package/dist/global/ej2-filemanager.min.js +2 -2
- package/dist/global/ej2-filemanager.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +15 -15
- package/src/file-manager/actions/toolbar.js +1 -1
- package/src/file-manager/actions/virtualization.d.ts +40 -5
- package/src/file-manager/actions/virtualization.js +131 -59
- package/src/file-manager/base/file-manager-model.d.ts +10 -14
- package/src/file-manager/base/file-manager.d.ts +8 -12
- package/src/file-manager/base/file-manager.js +5 -5
- package/src/file-manager/base/interface.d.ts +1 -0
- package/src/file-manager/layout/details-view.d.ts +6 -0
- package/src/file-manager/layout/details-view.js +43 -20
- package/src/file-manager/layout/large-icons-view.js +41 -10
- package/src/file-manager/layout/navigation-pane.js +7 -3
- package/src/file-manager/models/column-model.d.ts +7 -0
- package/src/file-manager/models/column.d.ts +6 -0
- package/src/file-manager/models/column.js +3 -0
- package/src/file-manager/models/details-view-settings.js +1 -1
- package/src/file-manager/models/index.d.ts +0 -2
- package/src/file-manager/models/index.js +0 -1
- package/src/file-manager/pop-up/context-menu.js +3 -0
- package/src/file-manager/pop-up/dialog.js +1 -1
- package/styles/file-manager/_layout.scss +6 -0
- package/styles/file-manager/fluent-dark.css +3 -0
- package/styles/file-manager/fluent.css +3 -0
- package/styles/fluent-dark.css +3 -0
- package/styles/fluent.css +3 -0
@@ -88,7 +88,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
|
|
88
88
|
*/
|
89
89
|
const columnArray = [
|
90
90
|
{
|
91
|
-
field: 'name', headerText: 'Name', minWidth: 120,
|
91
|
+
field: 'name', headerText: 'Name', minWidth: 120, isPrimaryKey: true,
|
92
92
|
template: '<span class="e-fe-text">${name}</span>', customAttributes: { class: 'e-fe-grid-name' }
|
93
93
|
},
|
94
94
|
{
|
@@ -117,27 +117,6 @@ 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
|
-
};
|
141
120
|
const fileItems = ['Open', '|', 'Cut', 'Copy', '|', 'Delete', 'Download', 'Rename', '|', 'Details'];
|
142
121
|
const folderItems = ['Open', '|', 'Cut', 'Copy', 'Paste', '|', 'Delete', 'Rename', 'Download', '|', 'Details'];
|
143
122
|
const layoutItems = [
|
@@ -148,20 +127,20 @@ const layoutItems = [
|
|
148
127
|
*/
|
149
128
|
class ContextMenuSettings extends ChildProperty {
|
150
129
|
}
|
151
|
-
__decorate$
|
130
|
+
__decorate$4([
|
152
131
|
Property(fileItems)
|
153
132
|
], ContextMenuSettings.prototype, "file", void 0);
|
154
|
-
__decorate$
|
133
|
+
__decorate$4([
|
155
134
|
Property(folderItems)
|
156
135
|
], ContextMenuSettings.prototype, "folder", void 0);
|
157
|
-
__decorate$
|
136
|
+
__decorate$4([
|
158
137
|
Property(layoutItems)
|
159
138
|
], ContextMenuSettings.prototype, "layout", void 0);
|
160
|
-
__decorate$
|
139
|
+
__decorate$4([
|
161
140
|
Property(true)
|
162
141
|
], ContextMenuSettings.prototype, "visible", void 0);
|
163
142
|
|
164
|
-
var __decorate$
|
143
|
+
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
165
144
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
166
145
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
167
146
|
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;
|
@@ -172,20 +151,20 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
|
|
172
151
|
*/
|
173
152
|
class NavigationPaneSettings extends ChildProperty {
|
174
153
|
}
|
175
|
-
__decorate$
|
154
|
+
__decorate$5([
|
176
155
|
Property('650px')
|
177
156
|
], NavigationPaneSettings.prototype, "maxWidth", void 0);
|
178
|
-
__decorate$
|
157
|
+
__decorate$5([
|
179
158
|
Property('240px')
|
180
159
|
], NavigationPaneSettings.prototype, "minWidth", void 0);
|
181
|
-
__decorate$
|
160
|
+
__decorate$5([
|
182
161
|
Property(true)
|
183
162
|
], NavigationPaneSettings.prototype, "visible", void 0);
|
184
|
-
__decorate$
|
163
|
+
__decorate$5([
|
185
164
|
Property('None')
|
186
165
|
], NavigationPaneSettings.prototype, "sortOrder", void 0);
|
187
166
|
|
188
|
-
var __decorate$
|
167
|
+
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
189
168
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
190
169
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
191
170
|
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;
|
@@ -196,26 +175,26 @@ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators,
|
|
196
175
|
*/
|
197
176
|
class UploadSettings extends ChildProperty {
|
198
177
|
}
|
199
|
-
__decorate$
|
178
|
+
__decorate$6([
|
200
179
|
Property('')
|
201
180
|
], UploadSettings.prototype, "allowedExtensions", void 0);
|
202
|
-
__decorate$
|
181
|
+
__decorate$6([
|
203
182
|
Property(true)
|
204
183
|
], UploadSettings.prototype, "autoUpload", void 0);
|
205
|
-
__decorate$
|
184
|
+
__decorate$6([
|
206
185
|
Property(false)
|
207
186
|
], UploadSettings.prototype, "autoClose", void 0);
|
208
|
-
__decorate$
|
187
|
+
__decorate$6([
|
209
188
|
Property(false)
|
210
189
|
], UploadSettings.prototype, "directoryUpload", void 0);
|
211
|
-
__decorate$
|
190
|
+
__decorate$6([
|
212
191
|
Property(0)
|
213
192
|
], UploadSettings.prototype, "minFileSize", void 0);
|
214
|
-
__decorate$
|
193
|
+
__decorate$6([
|
215
194
|
Property(30000000)
|
216
195
|
], UploadSettings.prototype, "maxFileSize", void 0);
|
217
196
|
|
218
|
-
var __decorate$
|
197
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
219
198
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
220
199
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
221
200
|
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;
|
@@ -227,54 +206,57 @@ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators,
|
|
227
206
|
/* istanbul ignore next */
|
228
207
|
class Column extends ChildProperty {
|
229
208
|
}
|
230
|
-
__decorate$
|
209
|
+
__decorate$7([
|
231
210
|
Property('')
|
232
211
|
], Column.prototype, "field", void 0);
|
233
|
-
__decorate$
|
212
|
+
__decorate$7([
|
234
213
|
Property('')
|
235
214
|
], Column.prototype, "headerText", void 0);
|
236
|
-
__decorate$
|
215
|
+
__decorate$7([
|
237
216
|
Property('')
|
238
217
|
], Column.prototype, "width", void 0);
|
239
|
-
__decorate$
|
218
|
+
__decorate$7([
|
240
219
|
Property('')
|
241
220
|
], Column.prototype, "minWidth", void 0);
|
242
|
-
__decorate$
|
221
|
+
__decorate$7([
|
243
222
|
Property('')
|
244
223
|
], Column.prototype, "maxWidth", void 0);
|
245
|
-
__decorate$
|
224
|
+
__decorate$7([
|
246
225
|
Property('Left')
|
247
226
|
], Column.prototype, "textAlign", void 0);
|
248
|
-
__decorate$
|
227
|
+
__decorate$7([
|
249
228
|
Property(null)
|
250
229
|
], Column.prototype, "headerTextAlign", void 0);
|
251
|
-
__decorate$
|
230
|
+
__decorate$7([
|
252
231
|
Property(null)
|
253
232
|
], Column.prototype, "type", void 0);
|
254
|
-
__decorate$
|
233
|
+
__decorate$7([
|
255
234
|
Property(null)
|
256
235
|
], Column.prototype, "format", void 0);
|
257
|
-
__decorate$
|
236
|
+
__decorate$7([
|
258
237
|
Property(null)
|
259
238
|
], Column.prototype, "template", void 0);
|
260
|
-
__decorate$
|
239
|
+
__decorate$7([
|
261
240
|
Property(null)
|
262
241
|
], Column.prototype, "headerTemplate", void 0);
|
263
|
-
__decorate$
|
242
|
+
__decorate$7([
|
264
243
|
Property(true)
|
265
244
|
], Column.prototype, "allowSorting", void 0);
|
266
|
-
__decorate$
|
245
|
+
__decorate$7([
|
267
246
|
Property(true)
|
268
247
|
], Column.prototype, "allowResizing", void 0);
|
269
|
-
__decorate$
|
248
|
+
__decorate$7([
|
270
249
|
Property(null)
|
271
250
|
], Column.prototype, "customAttributes", void 0);
|
272
|
-
__decorate$
|
251
|
+
__decorate$7([
|
273
252
|
Property('')
|
274
253
|
], Column.prototype, "hideAtMedia", void 0);
|
275
|
-
__decorate$
|
254
|
+
__decorate$7([
|
276
255
|
Property(null)
|
277
256
|
], Column.prototype, "customFormat", void 0);
|
257
|
+
__decorate$7([
|
258
|
+
Property(false)
|
259
|
+
], Column.prototype, "isPrimaryKey", void 0);
|
278
260
|
|
279
261
|
/**
|
280
262
|
* FileExplorer common modules
|
@@ -3636,7 +3618,7 @@ function onSubmitValidate(parent, ele) {
|
|
3636
3618
|
onValidate(parent, ele);
|
3637
3619
|
const len = ele.value.length - 1;
|
3638
3620
|
if (ele.value !== '' && ((ele.value.lastIndexOf('.') === len) || (ele.value.lastIndexOf(' ') === len)) &&
|
3639
|
-
(parent.showFileExtension || (
|
3621
|
+
(parent.showFileExtension || (ele.value.lastIndexOf('.') === -1 || ele.value.substring(ele.value.indexOf('.') + 1).length === 0))) {
|
3640
3622
|
addInvalid(parent, ele);
|
3641
3623
|
}
|
3642
3624
|
}
|
@@ -3861,16 +3843,19 @@ class LargeIconsView {
|
|
3861
3843
|
this.items = [];
|
3862
3844
|
this.items = this.renderList(args);
|
3863
3845
|
this.items = this.allItems = getSortedData(this.parent, this.items);
|
3864
|
-
|
3865
|
-
|
3866
|
-
|
3846
|
+
iconsView.classList.remove(DISPLAY_NONE);
|
3847
|
+
if (this.parent.enableVirtualization && this.allItems.length > 0) {
|
3848
|
+
if (!this.element.style.height) {
|
3849
|
+
this.adjustHeight();
|
3850
|
+
}
|
3851
|
+
this.parent.virtualizationModule.setUIVirtualization();
|
3852
|
+
}
|
3867
3853
|
// eslint-disable-next-line
|
3868
3854
|
this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
|
3869
3855
|
this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.listElements));
|
3870
3856
|
this.element.appendChild(this.listElements);
|
3871
3857
|
this.preventImgDrag();
|
3872
3858
|
this.createDragObj();
|
3873
|
-
iconsView.classList.remove(DISPLAY_NONE);
|
3874
3859
|
if (this.itemList.length === 0) {
|
3875
3860
|
const emptyList = this.element.querySelector('.' + LIST_PARENT);
|
3876
3861
|
this.element.removeChild(emptyList);
|
@@ -3905,10 +3890,10 @@ class LargeIconsView {
|
|
3905
3890
|
this.getItemCount();
|
3906
3891
|
this.addEventListener();
|
3907
3892
|
this.wireEvents();
|
3908
|
-
|
3909
|
-
|
3910
|
-
|
3911
|
-
|
3893
|
+
if (this.parent.enableVirtualization && this.allItems.length > 0) {
|
3894
|
+
this.parent.virtualizationModule.setUlElementHeight();
|
3895
|
+
this.parent.virtualizationModule.wireScrollEvent(false);
|
3896
|
+
}
|
3912
3897
|
this.isRendered = true;
|
3913
3898
|
hideSpinner(this.parent.element);
|
3914
3899
|
if (this.parent.selectedItems.length) {
|
@@ -4037,6 +4022,9 @@ class LargeIconsView {
|
|
4037
4022
|
onLayoutChange(args) {
|
4038
4023
|
if (this.parent.view === 'LargeIcons') {
|
4039
4024
|
this.destroy();
|
4025
|
+
if (this.parent.enableVirtualization) {
|
4026
|
+
this.parent.setProperties({ selectedItems: [] }, true);
|
4027
|
+
}
|
4040
4028
|
this.render(args);
|
4041
4029
|
/* istanbul ignore next */
|
4042
4030
|
if (getValue('name', args) === 'layout-change' && this.parent.fileAction === 'move' &&
|
@@ -4697,10 +4685,28 @@ class LargeIconsView {
|
|
4697
4685
|
const lastItem = this.getLastItem();
|
4698
4686
|
switch (e.action) {
|
4699
4687
|
case 'end':
|
4700
|
-
this.
|
4688
|
+
if (this.parent.enableVirtualization) {
|
4689
|
+
this.clearSelect();
|
4690
|
+
this.element.firstElementChild.scrollTo(0, this.element.firstElementChild.scrollHeight);
|
4691
|
+
setTimeout(() => {
|
4692
|
+
this.navigateItem(this.itemList[this.itemList.length - 1]);
|
4693
|
+
}, 10);
|
4694
|
+
}
|
4695
|
+
else {
|
4696
|
+
this.navigateItem(lastItem);
|
4697
|
+
}
|
4701
4698
|
break;
|
4702
4699
|
case 'home':
|
4703
|
-
this.
|
4700
|
+
if (this.parent.enableVirtualization) {
|
4701
|
+
this.clearSelect();
|
4702
|
+
this.element.firstElementChild.scrollTop = 0;
|
4703
|
+
setTimeout(() => {
|
4704
|
+
this.navigateItem(this.itemList[0]);
|
4705
|
+
}, 10);
|
4706
|
+
}
|
4707
|
+
else {
|
4708
|
+
this.navigateItem(firstItem);
|
4709
|
+
}
|
4704
4710
|
break;
|
4705
4711
|
case 'tab':
|
4706
4712
|
if (!isNullOrUndefined(fItem)) {
|
@@ -4869,6 +4875,12 @@ class LargeIconsView {
|
|
4869
4875
|
index = perRow ? index - perRow : index - 1;
|
4870
4876
|
}
|
4871
4877
|
nextItem = this.itemList[index];
|
4878
|
+
if (this.parent.enableVirtualization && isNullOrUndefined(nextItem)) {
|
4879
|
+
const marginValue = parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-top'), 10) +
|
4880
|
+
parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-bottom'), 10);
|
4881
|
+
const scrollHeight = this.itemList[0].getBoundingClientRect().height + marginValue;
|
4882
|
+
this.element.firstElementChild.scrollTo(this.element.firstElementChild.scrollTop, this.element.firstElementChild.scrollTop + scrollHeight);
|
4883
|
+
}
|
4872
4884
|
if (isNullOrUndefined(nextItem)) {
|
4873
4885
|
return li;
|
4874
4886
|
}
|
@@ -5777,6 +5789,9 @@ class ContextMenu$2 {
|
|
5777
5789
|
this.menuTarget = this.targetNodeElement = target;
|
5778
5790
|
}
|
5779
5791
|
this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr.e-row') : target;
|
5792
|
+
if (this.parent.enableVirtualization && (target.classList.contains('e-virtual-bottom') || target.classList.contains('e-virtualtable'))) {
|
5793
|
+
target = target.parentElement.closest("div");
|
5794
|
+
}
|
5780
5795
|
const view = this.getTargetView(target);
|
5781
5796
|
this.updateActiveModule();
|
5782
5797
|
/* istanbul ignore next */
|
@@ -6402,7 +6417,7 @@ const defaultLocale = {
|
|
6402
6417
|
'Server-Error': 'ServerError: Invalid response from'
|
6403
6418
|
};
|
6404
6419
|
|
6405
|
-
var __decorate$
|
6420
|
+
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
6406
6421
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
6407
6422
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
6408
6423
|
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;
|
@@ -6566,7 +6581,7 @@ let FileManager = FileManager_1 = class FileManager extends Component {
|
|
6566
6581
|
args: [this]
|
6567
6582
|
});
|
6568
6583
|
}
|
6569
|
-
if (this.
|
6584
|
+
if (this.enableVirtualization) {
|
6570
6585
|
modules.push({
|
6571
6586
|
member: 'virtualization',
|
6572
6587
|
args: [this]
|
@@ -7498,154 +7513,154 @@ let FileManager = FileManager_1 = class FileManager extends Component {
|
|
7498
7513
|
}
|
7499
7514
|
}
|
7500
7515
|
};
|
7501
|
-
__decorate$
|
7516
|
+
__decorate$8([
|
7502
7517
|
Complex({}, AjaxSettings)
|
7503
7518
|
], FileManager.prototype, "ajaxSettings", void 0);
|
7504
|
-
__decorate$
|
7519
|
+
__decorate$8([
|
7505
7520
|
Property(false)
|
7506
7521
|
], FileManager.prototype, "allowDragAndDrop", void 0);
|
7507
|
-
__decorate$
|
7522
|
+
__decorate$8([
|
7508
7523
|
Property(true)
|
7509
7524
|
], FileManager.prototype, "allowMultiSelection", void 0);
|
7510
|
-
__decorate$
|
7525
|
+
__decorate$8([
|
7511
7526
|
Complex({}, ContextMenuSettings)
|
7512
7527
|
], FileManager.prototype, "contextMenuSettings", void 0);
|
7513
|
-
__decorate$
|
7528
|
+
__decorate$8([
|
7514
7529
|
Property('')
|
7515
7530
|
], FileManager.prototype, "cssClass", void 0);
|
7516
|
-
__decorate$
|
7531
|
+
__decorate$8([
|
7517
7532
|
Complex({}, DetailsViewSettings)
|
7518
7533
|
], FileManager.prototype, "detailsViewSettings", void 0);
|
7519
|
-
__decorate$
|
7520
|
-
Complex({}, VirtualizationSettings)
|
7521
|
-
], FileManager.prototype, "virtualizationSettings", void 0);
|
7522
|
-
__decorate$9([
|
7534
|
+
__decorate$8([
|
7523
7535
|
Property(true)
|
7524
7536
|
], FileManager.prototype, "enableHtmlSanitizer", void 0);
|
7525
|
-
__decorate$
|
7537
|
+
__decorate$8([
|
7526
7538
|
Property(false)
|
7527
7539
|
], FileManager.prototype, "enablePersistence", void 0);
|
7528
|
-
__decorate$
|
7540
|
+
__decorate$8([
|
7541
|
+
Property(false)
|
7542
|
+
], FileManager.prototype, "enableVirtualization", void 0);
|
7543
|
+
__decorate$8([
|
7529
7544
|
Property('400px')
|
7530
7545
|
], FileManager.prototype, "height", void 0);
|
7531
|
-
__decorate$
|
7546
|
+
__decorate$8([
|
7532
7547
|
Property('LargeIcons')
|
7533
7548
|
], FileManager.prototype, "view", void 0);
|
7534
|
-
__decorate$
|
7549
|
+
__decorate$8([
|
7535
7550
|
Complex({}, NavigationPaneSettings)
|
7536
7551
|
], FileManager.prototype, "navigationPaneSettings", void 0);
|
7537
|
-
__decorate$
|
7552
|
+
__decorate$8([
|
7538
7553
|
Property('/')
|
7539
7554
|
], FileManager.prototype, "path", void 0);
|
7540
|
-
__decorate$
|
7555
|
+
__decorate$8([
|
7541
7556
|
Property(null)
|
7542
7557
|
], FileManager.prototype, "popupTarget", void 0);
|
7543
|
-
__decorate$
|
7558
|
+
__decorate$8([
|
7544
7559
|
Complex({}, SearchSettings)
|
7545
7560
|
], FileManager.prototype, "searchSettings", void 0);
|
7546
|
-
__decorate$
|
7561
|
+
__decorate$8([
|
7547
7562
|
Property()
|
7548
7563
|
], FileManager.prototype, "selectedItems", void 0);
|
7549
|
-
__decorate$
|
7564
|
+
__decorate$8([
|
7550
7565
|
Property(true)
|
7551
7566
|
], FileManager.prototype, "showFileExtension", void 0);
|
7552
|
-
__decorate$
|
7567
|
+
__decorate$8([
|
7553
7568
|
Property(null)
|
7554
7569
|
], FileManager.prototype, "rootAliasName", void 0);
|
7555
|
-
__decorate$
|
7570
|
+
__decorate$8([
|
7556
7571
|
Property(false)
|
7557
7572
|
], FileManager.prototype, "showHiddenItems", void 0);
|
7558
|
-
__decorate$
|
7573
|
+
__decorate$8([
|
7559
7574
|
Property(true)
|
7560
7575
|
], FileManager.prototype, "showThumbnail", void 0);
|
7561
|
-
__decorate$
|
7576
|
+
__decorate$8([
|
7562
7577
|
Property('Ascending')
|
7563
7578
|
], FileManager.prototype, "sortOrder", void 0);
|
7564
|
-
__decorate$
|
7579
|
+
__decorate$8([
|
7565
7580
|
Property('name')
|
7566
7581
|
], FileManager.prototype, "sortBy", void 0);
|
7567
|
-
__decorate$
|
7582
|
+
__decorate$8([
|
7568
7583
|
Complex({}, ToolbarSettings)
|
7569
7584
|
], FileManager.prototype, "toolbarSettings", void 0);
|
7570
|
-
__decorate$
|
7585
|
+
__decorate$8([
|
7571
7586
|
Complex({}, UploadSettings)
|
7572
7587
|
], FileManager.prototype, "uploadSettings", void 0);
|
7573
|
-
__decorate$
|
7588
|
+
__decorate$8([
|
7574
7589
|
Property('100%')
|
7575
7590
|
], FileManager.prototype, "width", void 0);
|
7576
|
-
__decorate$
|
7591
|
+
__decorate$8([
|
7577
7592
|
Event()
|
7578
7593
|
], FileManager.prototype, "fileLoad", void 0);
|
7579
|
-
__decorate$
|
7594
|
+
__decorate$8([
|
7580
7595
|
Event()
|
7581
7596
|
], FileManager.prototype, "fileOpen", void 0);
|
7582
|
-
__decorate$
|
7597
|
+
__decorate$8([
|
7583
7598
|
Event()
|
7584
7599
|
], FileManager.prototype, "beforeDownload", void 0);
|
7585
|
-
__decorate$
|
7600
|
+
__decorate$8([
|
7586
7601
|
Event()
|
7587
7602
|
], FileManager.prototype, "beforeImageLoad", void 0);
|
7588
|
-
__decorate$
|
7603
|
+
__decorate$8([
|
7589
7604
|
Event()
|
7590
7605
|
], FileManager.prototype, "beforePopupClose", void 0);
|
7591
|
-
__decorate$
|
7606
|
+
__decorate$8([
|
7592
7607
|
Event()
|
7593
7608
|
], FileManager.prototype, "beforePopupOpen", void 0);
|
7594
|
-
__decorate$
|
7609
|
+
__decorate$8([
|
7595
7610
|
Event()
|
7596
7611
|
], FileManager.prototype, "beforeSend", void 0);
|
7597
|
-
__decorate$
|
7612
|
+
__decorate$8([
|
7598
7613
|
Event()
|
7599
7614
|
], FileManager.prototype, "created", void 0);
|
7600
|
-
__decorate$
|
7615
|
+
__decorate$8([
|
7601
7616
|
Event()
|
7602
7617
|
], FileManager.prototype, "destroyed", void 0);
|
7603
|
-
__decorate$
|
7618
|
+
__decorate$8([
|
7604
7619
|
Event()
|
7605
7620
|
], FileManager.prototype, "fileDragStart", void 0);
|
7606
|
-
__decorate$
|
7621
|
+
__decorate$8([
|
7607
7622
|
Event()
|
7608
7623
|
], FileManager.prototype, "fileDragging", void 0);
|
7609
|
-
__decorate$
|
7624
|
+
__decorate$8([
|
7610
7625
|
Event()
|
7611
7626
|
], FileManager.prototype, "fileDragStop", void 0);
|
7612
|
-
__decorate$
|
7627
|
+
__decorate$8([
|
7613
7628
|
Event()
|
7614
7629
|
], FileManager.prototype, "fileDropped", void 0);
|
7615
|
-
__decorate$
|
7630
|
+
__decorate$8([
|
7616
7631
|
Event()
|
7617
7632
|
], FileManager.prototype, "fileSelection", void 0);
|
7618
|
-
__decorate$
|
7633
|
+
__decorate$8([
|
7619
7634
|
Event()
|
7620
7635
|
], FileManager.prototype, "fileSelect", void 0);
|
7621
|
-
__decorate$
|
7636
|
+
__decorate$8([
|
7622
7637
|
Event()
|
7623
7638
|
], FileManager.prototype, "menuClick", void 0);
|
7624
|
-
__decorate$
|
7639
|
+
__decorate$8([
|
7625
7640
|
Event()
|
7626
7641
|
], FileManager.prototype, "menuOpen", void 0);
|
7627
|
-
__decorate$
|
7642
|
+
__decorate$8([
|
7628
7643
|
Event()
|
7629
7644
|
], FileManager.prototype, "failure", void 0);
|
7630
|
-
__decorate$
|
7645
|
+
__decorate$8([
|
7631
7646
|
Event()
|
7632
7647
|
], FileManager.prototype, "popupClose", void 0);
|
7633
|
-
__decorate$
|
7648
|
+
__decorate$8([
|
7634
7649
|
Event()
|
7635
7650
|
], FileManager.prototype, "popupOpen", void 0);
|
7636
|
-
__decorate$
|
7651
|
+
__decorate$8([
|
7637
7652
|
Event()
|
7638
7653
|
], FileManager.prototype, "success", void 0);
|
7639
|
-
__decorate$
|
7654
|
+
__decorate$8([
|
7640
7655
|
Event()
|
7641
7656
|
], FileManager.prototype, "toolbarClick", void 0);
|
7642
|
-
__decorate$
|
7657
|
+
__decorate$8([
|
7643
7658
|
Event()
|
7644
7659
|
], FileManager.prototype, "toolbarCreate", void 0);
|
7645
|
-
__decorate$
|
7660
|
+
__decorate$8([
|
7646
7661
|
Event()
|
7647
7662
|
], FileManager.prototype, "uploadListCreate", void 0);
|
7648
|
-
FileManager = FileManager_1 = __decorate$
|
7663
|
+
FileManager = FileManager_1 = __decorate$8([
|
7649
7664
|
NotifyPropertyChanges
|
7650
7665
|
], FileManager);
|
7651
7666
|
|
@@ -8022,7 +8037,7 @@ class Toolbar$1 {
|
|
8022
8037
|
this.hideItems(this.selection, true);
|
8023
8038
|
}
|
8024
8039
|
const ele = select('#' + this.getId('Selection'), this.toolbarObj.element);
|
8025
|
-
if (this.parent.selectedItems.length > 0 && ele) {
|
8040
|
+
if (this.parent.selectedItems.length > 0 && ele && !this.parent.enableVirtualization) {
|
8026
8041
|
let txt;
|
8027
8042
|
if (this.parent.selectedItems.length === 1) {
|
8028
8043
|
txt = this.parent.selectedItems.length + ' ' + getLocaleText(this.parent, 'Item-Selection');
|
@@ -8137,157 +8152,224 @@ class Toolbar$1 {
|
|
8137
8152
|
|
8138
8153
|
class Virtualization {
|
8139
8154
|
constructor(instance) {
|
8140
|
-
this.largeIconsViewItemsCount = 40;
|
8141
8155
|
this.filemanagerInstance = instance;
|
8142
8156
|
this.largeIconInstance = instance.largeiconsviewModule;
|
8143
8157
|
}
|
8144
|
-
|
8158
|
+
/**
|
8159
|
+
* Sets up UI virtualization for the large icon view.
|
8160
|
+
*/
|
8161
|
+
setUIVirtualization() {
|
8162
|
+
// Get the current view data source
|
8163
|
+
const currentViewItems = this.largeIconInstance.items;
|
8164
|
+
// Get the first item in the data source
|
8165
|
+
const firstItem = currentViewItems.slice(0, 1);
|
8166
|
+
// Create a list element from the first item in the data source
|
8167
|
+
const listElements = ListBase.createListFromJson(createElement, firstItem, this.largeIconInstance.listObj);
|
8168
|
+
// Get the list items from the list element
|
8169
|
+
this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, listElements));
|
8170
|
+
// Append the list element to the large icon element
|
8171
|
+
this.largeIconInstance.element.appendChild(listElements);
|
8172
|
+
// Get the total number of items
|
8173
|
+
this.itemCount = this.getItemCount(Object.keys(this.largeIconInstance.allItems).length);
|
8174
|
+
// Remove the first child element from the large icon element
|
8175
|
+
this.largeIconInstance.element.firstChild.remove();
|
8176
|
+
// Set the items for the large icon view to the current view data source, limited to the number of items to display
|
8177
|
+
this.largeIconInstance.items = currentViewItems.slice(0, this.itemCount);
|
8178
|
+
}
|
8179
|
+
/**
|
8180
|
+
* Sets the height of the top and bottom elements that are used for virtualization.
|
8181
|
+
* These elements are used to give the appearance of an infinitely scrolling list.
|
8182
|
+
*/
|
8145
8183
|
setUlElementHeight() {
|
8146
|
-
|
8147
|
-
this.lastRowCount = (this.largeIconInstance.allItems.length - this.
|
8148
|
-
(this.largeIconInstance.allItems.length - this.
|
8184
|
+
// Calculate the number of items in the last row
|
8185
|
+
this.lastRowCount = (this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount ?
|
8186
|
+
(this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount : this.rowItemCount;
|
8187
|
+
// Create top and bottom elements
|
8149
8188
|
this.topElement = this.filemanagerInstance.createElement('div');
|
8189
|
+
this.topElement.classList.add("e-virtual-top");
|
8150
8190
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement, this.largeIconInstance.element.firstElementChild.firstChild);
|
8151
8191
|
this.bottomElement = this.filemanagerInstance.createElement('div');
|
8192
|
+
this.bottomElement.classList.add("e-virtual-bottom");
|
8152
8193
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement, null);
|
8153
|
-
|
8154
|
-
|
8194
|
+
// Get the margin value for list items
|
8195
|
+
const marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top'), 10) +
|
8196
|
+
parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-bottom'), 10);
|
8197
|
+
// Calculate the height of a single list item
|
8155
8198
|
this.listItemHeight = this.largeIconInstance.itemList[0].getBoundingClientRect().height + marginValue;
|
8199
|
+
// Calculate the total height of the list
|
8156
8200
|
this.totalHeight = (Object.keys(this.largeIconInstance.allItems).length / this.rowItemCount) * this.listItemHeight;
|
8201
|
+
// Set the initial height of the top and bottom elements
|
8157
8202
|
this.topElement.style.height = 0 + 'px';
|
8158
8203
|
this.bottomElement.style.height = this.totalHeight + 'px';
|
8204
|
+
// Initialize the top and bottom element heights
|
8159
8205
|
this.topElementHeight = 0;
|
8160
8206
|
this.bottomElementHeight = this.totalHeight;
|
8207
|
+
// Initialize the list difference variable
|
8161
8208
|
this.listDiff = 0;
|
8162
|
-
|
8163
|
-
|
8164
|
-
|
8165
|
-
|
8166
|
-
|
8167
|
-
|
8168
|
-
|
8169
|
-
|
8209
|
+
// Set the initial rendered count
|
8210
|
+
this.renderedCount = this.itemCount;
|
8211
|
+
}
|
8212
|
+
/**
|
8213
|
+
* Calculates the number of items to display in the list based on the available width and height.
|
8214
|
+
* @param dataSourceLength The length of the data source.
|
8215
|
+
* @returns The number of items to display.
|
8216
|
+
*/
|
8217
|
+
getItemCount(dataSourceLength) {
|
8218
|
+
// Get the margin values for list items
|
8219
|
+
const widthMargin = parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-right'), 10) +
|
8220
|
+
parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-left'), 10);
|
8221
|
+
// Calculate the number of items that can fit in a single row
|
8222
|
+
this.rowItemCount = Math.floor(parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth)) / (this.itemList[0].offsetWidth + widthMargin));
|
8223
|
+
// Calculate the number of items that can fit in the available height
|
8224
|
+
let itemCount = this.rowItemCount * (Math.round(parseFloat(formatUnit(this.largeIconInstance.element.clientHeight)) / this.itemList[0].offsetHeight));
|
8225
|
+
// If the calculated item count is greater than the data source length, set the item count to the data source length
|
8170
8226
|
if (itemCount > dataSourceLength) {
|
8171
8227
|
itemCount = dataSourceLength;
|
8172
8228
|
}
|
8173
8229
|
return itemCount;
|
8174
8230
|
}
|
8175
|
-
|
8231
|
+
/**
|
8232
|
+
* Wires or un wires the scroll event for the list element.
|
8233
|
+
* @param destroy - Set `true` to unwire the scroll event.
|
8234
|
+
*/
|
8176
8235
|
wireScrollEvent(destroy) {
|
8177
8236
|
if (!destroy) {
|
8237
|
+
// Wire the scroll event
|
8178
8238
|
EventHandler.add(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll, this);
|
8179
8239
|
}
|
8180
8240
|
else {
|
8241
|
+
// Unwire the scroll event
|
8181
8242
|
EventHandler.remove(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll);
|
8182
8243
|
}
|
8183
8244
|
}
|
8184
|
-
|
8185
|
-
|
8186
|
-
|
8245
|
+
/**
|
8246
|
+
* Handles the scroll event for the list element.
|
8247
|
+
* This method updates the top and bottom elements and the displayed items based on the scroll position.
|
8248
|
+
*/
|
8249
|
+
onVirtualUiScroll() {
|
8250
|
+
// Set the starting height to 0
|
8251
|
+
const startingHeight = 0;
|
8252
|
+
// Get the current scroll position
|
8187
8253
|
this.scrollPosition = isNullOrUndefined(this.scrollPosition) ? 0 : this.scrollPosition;
|
8188
8254
|
const scroll = this.getscrollerHeight(startingHeight);
|
8255
|
+
// Calculate the height of the top element
|
8189
8256
|
this.topElementHeight = this.listItemHeight * Math.floor(scroll / this.listItemHeight);
|
8257
|
+
// Calculate the height of the bottom element
|
8190
8258
|
this.bottomElementHeight = this.totalHeight - this.topElementHeight;
|
8259
|
+
// If the scroll position is less than or equal to the total height, set the top and bottom element heights.
|
8260
|
+
// Otherwise, set the top element height to the total height and the bottom element height to 0.
|
8191
8261
|
[this.topElementHeight, this.bottomElementHeight] = scroll <= this.totalHeight ?
|
8192
8262
|
[this.topElementHeight, this.bottomElementHeight] : [this.totalHeight, 0];
|
8263
|
+
// If the top element height has changed, update the top and bottom element heights and re-render the items.
|
8193
8264
|
if (this.topElementHeight !== parseFloat(this.topElement.style.height)) {
|
8194
8265
|
this.topElement.style.height = this.topElementHeight + 'px';
|
8195
8266
|
this.bottomElement.style.height = this.bottomElementHeight + 'px';
|
8196
|
-
//
|
8267
|
+
// Check whether the scroll direction is upward or downward
|
8197
8268
|
if (scroll > this.scrollPosition) {
|
8269
|
+
// Scrolling is upward
|
8198
8270
|
const listDiff = Math.round(((this.topElementHeight / this.listItemHeight) - this.listDiff));
|
8199
8271
|
this.onNormalScroll(listDiff, true);
|
8200
8272
|
}
|
8201
8273
|
else {
|
8274
|
+
// Scrolling is downward
|
8202
8275
|
const listDiff = Math.round((this.listDiff - (this.topElementHeight / this.listItemHeight)));
|
8203
8276
|
this.onNormalScroll(listDiff, false);
|
8204
8277
|
}
|
8205
8278
|
}
|
8279
|
+
// Update the list difference and scroll position variables
|
8206
8280
|
this.listDiff = Math.round(this.topElementHeight / this.listItemHeight);
|
8207
8281
|
this.scrollPosition = scroll;
|
8282
|
+
// Update the list of items and the items property of the largeIconInstance
|
8208
8283
|
this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.largeIconInstance.element));
|
8209
8284
|
this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
|
8210
|
-
this.
|
8285
|
+
this.itemCount, this.renderedCount);
|
8211
8286
|
}
|
8212
|
-
|
8287
|
+
/**
|
8288
|
+
* Calculates the current scroll position of the list element.
|
8289
|
+
* @param startingHeight The starting height from which to calculate the scroll position.
|
8290
|
+
* @returns The current scroll position.
|
8291
|
+
*/
|
8213
8292
|
getscrollerHeight(startingHeight) {
|
8293
|
+
// If the scroll position is less than or equal to the starting height, return 0.
|
8294
|
+
// Otherwise, return the scroll position minus the starting height.
|
8214
8295
|
return ((this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight) <= 0) ? 0 :
|
8215
8296
|
(this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight);
|
8216
8297
|
}
|
8217
|
-
|
8298
|
+
/**
|
8299
|
+
* This method updates the displayed items and the selection based on the scroll direction.
|
8300
|
+
* @param listDiff The number of rows to update.
|
8301
|
+
* @param isScrollingDown If set to true, the scroll direction is downward.
|
8302
|
+
*/
|
8218
8303
|
onNormalScroll(listDiff, isScrollingDown) {
|
8304
|
+
// Update the displayed items
|
8219
8305
|
for (let i = 0; i < listDiff; i++) {
|
8220
8306
|
this.updateUI(isScrollingDown);
|
8221
8307
|
}
|
8222
|
-
this.updateSelection();
|
8223
8308
|
}
|
8224
|
-
|
8309
|
+
/**
|
8310
|
+
* Updates the items in the large icons view.
|
8311
|
+
* @param isScrollingDown If set to true, the scroll direction is downward.
|
8312
|
+
*/
|
8225
8313
|
updateUI(isScrollingDown) {
|
8226
8314
|
if (isScrollingDown) {
|
8315
|
+
// Get the next batch of items to be displayed
|
8227
8316
|
this.items = this.largeIconInstance.allItems.slice(this.renderedCount, this.renderedCount + this.rowItemCount);
|
8317
|
+
// If there are items to be displayed, create list elements for them and append them to the list
|
8228
8318
|
if (this.items.length > 0) {
|
8229
|
-
|
8230
|
-
this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM,
|
8231
|
-
this.itemList.forEach(liEle => {
|
8319
|
+
const listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
|
8320
|
+
this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, listElements));
|
8321
|
+
this.itemList.forEach((liEle) => {
|
8232
8322
|
this.largeIconInstance.element.firstElementChild.insertBefore(liEle, this.bottomElement);
|
8233
8323
|
});
|
8324
|
+
// Update the rendered count variable
|
8234
8325
|
this.renderedCount = (this.largeIconInstance.allItems.length >= this.renderedCount + this.rowItemCount) ?
|
8235
8326
|
this.renderedCount + this.rowItemCount : this.renderedCount + this.lastRowCount;
|
8327
|
+
// Remove the first batch of items from the list
|
8236
8328
|
for (let i = 0; i < this.rowItemCount; i++) {
|
8237
8329
|
detach(this.topElement.nextElementSibling);
|
8238
8330
|
}
|
8239
8331
|
}
|
8240
8332
|
}
|
8241
8333
|
else {
|
8334
|
+
// Scrolling up
|
8242
8335
|
let lastItemIndex;
|
8243
8336
|
let isAllRendered;
|
8244
|
-
if (this.renderedCount
|
8245
|
-
lastItemIndex
|
8246
|
-
this.renderedCount
|
8247
|
-
|
8337
|
+
if (this.renderedCount === this.largeIconInstance.allItems.length) {
|
8338
|
+
// Set lastItemIndex to the last item in the last row
|
8339
|
+
lastItemIndex = this.renderedCount - (this.itemCount - this.rowItemCount + this.lastRowCount);
|
8340
|
+
// Set renderedCount to the total number of items that have been rendered, except for the items in the last row
|
8341
|
+
this.renderedCount = ((this.renderedCount - this.lastRowCount) < this.itemCount) ?
|
8342
|
+
this.itemCount : (this.renderedCount - this.lastRowCount);
|
8343
|
+
// Set isAllRendered to true to indicate that all items have been rendered
|
8248
8344
|
isAllRendered = true;
|
8249
8345
|
}
|
8250
8346
|
else {
|
8251
|
-
lastItemIndex
|
8252
|
-
|
8253
|
-
|
8254
|
-
|
8255
|
-
|
8347
|
+
// Set lastItemIndex to the last item in the current row
|
8348
|
+
lastItemIndex = this.renderedCount - this.itemCount;
|
8349
|
+
// Set renderedCount to the total number of items that have been rendered, except for the items in the current row
|
8350
|
+
this.renderedCount = ((this.renderedCount - this.rowItemCount) < this.itemCount) ?
|
8351
|
+
this.itemCount : (this.renderedCount - this.rowItemCount);
|
8352
|
+
}
|
8353
|
+
// Set startItemIndex to the first item in the current or previous row
|
8354
|
+
const startItemIndex = (lastItemIndex - this.rowItemCount > 0) ? lastItemIndex - this.rowItemCount : 0;
|
8355
|
+
// Set the items array to the items in the current or previous row
|
8256
8356
|
this.items = this.largeIconInstance.allItems.slice(startItemIndex, lastItemIndex);
|
8257
8357
|
if (this.items.length > 0) {
|
8258
|
-
|
8259
|
-
|
8358
|
+
// Create a list of elements from the items array
|
8359
|
+
const listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
|
8360
|
+
// Set the itemList array to the list items in the list elements
|
8361
|
+
this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, listElements));
|
8362
|
+
// Add the items to the beginning of the list
|
8260
8363
|
for (let len = this.itemList.length; len > 0; len--) {
|
8261
8364
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.itemList[len - 1], this.topElement.nextElementSibling);
|
8262
8365
|
}
|
8263
|
-
|
8366
|
+
// Remove the last row of items from the list
|
8367
|
+
for (let i = 0; i < ((isAllRendered) ? this.lastRowCount : this.rowItemCount); i++) {
|
8264
8368
|
detach(this.bottomElement.previousElementSibling);
|
8265
8369
|
}
|
8266
8370
|
}
|
8267
8371
|
}
|
8268
8372
|
}
|
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
8373
|
/**
|
8292
8374
|
* For internal use only - Get the module name.
|
8293
8375
|
*
|
@@ -8297,10 +8379,15 @@ class Virtualization {
|
|
8297
8379
|
getModuleName() {
|
8298
8380
|
return 'virtualization';
|
8299
8381
|
}
|
8382
|
+
/**
|
8383
|
+
* Destroys the component.
|
8384
|
+
*/
|
8300
8385
|
destroy() {
|
8386
|
+
// If the file manager has already been destroyed, return immediately
|
8301
8387
|
if (this.filemanagerInstance.isDestroyed) {
|
8302
8388
|
return;
|
8303
8389
|
}
|
8390
|
+
// If the large icon element has a child element, unwire the scroll event
|
8304
8391
|
if (!isNullOrUndefined(this.largeIconInstance.element.firstElementChild)) {
|
8305
8392
|
this.wireScrollEvent(true);
|
8306
8393
|
}
|
@@ -8498,8 +8585,8 @@ class NavigationPane {
|
|
8498
8585
|
args.cancel = eventArgs.cancel;
|
8499
8586
|
if (args.cancel) {
|
8500
8587
|
this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] !== args.node.getAttribute('data-uid') : false;
|
8501
|
-
this.treeObj.selectedNodes = this.isNodeClickCalled ? this.previousSelected : this.treeObj.selectedNodes;
|
8502
8588
|
this.previousSelected = this.treeObj.selectedNodes;
|
8589
|
+
this.treeObj.selectedNodes = [args.node.getAttribute("data-uid")];
|
8503
8590
|
if (!isNullOrUndefined(this.parent) && !isNullOrUndefined(this.parent.contextmenuModule)) {
|
8504
8591
|
this.parent.contextmenuModule.contextMenu.enableItems(['Open'], true);
|
8505
8592
|
}
|
@@ -8536,13 +8623,17 @@ class NavigationPane {
|
|
8536
8623
|
this.parent.selectedItems = [];
|
8537
8624
|
this.parent.itemData = nodeData;
|
8538
8625
|
const previousPath = this.parent.path;
|
8539
|
-
|
8626
|
+
if (!this.isRightClick) {
|
8627
|
+
updatePath(args.node, this.parent.itemData[0], this.parent);
|
8628
|
+
}
|
8540
8629
|
if (previousPath !== this.parent.path) {
|
8541
8630
|
this.expandNodeTarget = null;
|
8542
8631
|
if (args.node.querySelector('.' + ICONS) && args.node.querySelector('.' + LIST_ITEM) === null) {
|
8543
8632
|
this.expandNodeTarget = 'add';
|
8544
8633
|
}
|
8545
|
-
|
8634
|
+
if (!this.isRightClick) {
|
8635
|
+
read(this.parent, this.isPathDragged ? pasteEnd : pathChanged, this.parent.path);
|
8636
|
+
}
|
8546
8637
|
this.parent.visitedItem = args.node;
|
8547
8638
|
}
|
8548
8639
|
this.isPathDragged = this.isRenameParent = this.isRightClick = false;
|
@@ -9246,14 +9337,14 @@ class DetailsView {
|
|
9246
9337
|
allowResizing: this.parent.detailsViewSettings.columnResizing,
|
9247
9338
|
selectionSettings: {
|
9248
9339
|
type: this.parent.allowMultiSelection ? 'Multiple' : 'Single',
|
9249
|
-
checkboxMode: 'ResetOnRowClick'
|
9340
|
+
checkboxMode: 'ResetOnRowClick',
|
9341
|
+
persistSelection: (this.parent.enableVirtualization) ? true : false
|
9250
9342
|
},
|
9251
9343
|
enableRtl: this.parent.enableRtl,
|
9252
9344
|
pageSettings: { pageSize: 20 },
|
9253
|
-
|
9345
|
+
enableVirtualization: this.parent.enableVirtualization,
|
9254
9346
|
enablePersistence: this.parent.enablePersistence,
|
9255
|
-
|
9256
|
-
// pageSettings: { pageSize: this.parent.virtualizationSettings.detailsViewItemsCount },
|
9347
|
+
enableVirtualMaskRow: true,
|
9257
9348
|
sortSettings: { allowUnsort: false, columns: sortSettings },
|
9258
9349
|
columns: columns,
|
9259
9350
|
recordDoubleClick: this.DblClickEvents.bind(this),
|
@@ -9263,6 +9354,7 @@ class DetailsView {
|
|
9263
9354
|
actionBegin: this.onActionBegin.bind(this),
|
9264
9355
|
headerCellInfo: this.onHeaderCellInfo.bind(this),
|
9265
9356
|
width: '100%',
|
9357
|
+
height: (this.parent.enableVirtualization) ? this.getGridHeight() : 'auto',
|
9266
9358
|
beforeCopy: (args) => { args.cancel = true; },
|
9267
9359
|
// eslint-disable-next-line
|
9268
9360
|
load: function (args) {
|
@@ -9277,6 +9369,20 @@ class DetailsView {
|
|
9277
9369
|
this.emptyArgs = args;
|
9278
9370
|
}
|
9279
9371
|
}
|
9372
|
+
/**
|
9373
|
+
* Gets the grid height.
|
9374
|
+
* @returns The grid height.
|
9375
|
+
* @private
|
9376
|
+
*/
|
9377
|
+
getGridHeight() {
|
9378
|
+
// Get the content pane and breadcrumb bar elements
|
9379
|
+
const pane = select('#' + this.parent.element.id + CONTENT_ID, this.parent.element);
|
9380
|
+
const bar = select('#' + this.parent.element.id + BREADCRUMBBAR_ID, this.parent.element);
|
9381
|
+
// The maximum height of the header is 36
|
9382
|
+
const headerMaxHeight = 36;
|
9383
|
+
// Calculate and return the grid height
|
9384
|
+
return (pane.offsetHeight - bar.offsetHeight - headerMaxHeight);
|
9385
|
+
}
|
9280
9386
|
checkNameWidth() {
|
9281
9387
|
const initialColumn = this.parent.detailsViewSettings.columns;
|
9282
9388
|
this.isNameWidth = false;
|
@@ -9462,20 +9568,17 @@ class DetailsView {
|
|
9462
9568
|
}
|
9463
9569
|
}
|
9464
9570
|
onBeforeDataBound(args) {
|
9465
|
-
// if (!this.parent.virtualizationSettings.enable) {
|
9466
9571
|
showSpinner(this.parent.element);
|
9467
9572
|
// eslint-disable-next-line
|
9468
|
-
const items = getSortedData(this.parent, this.gridObj.dataSource);
|
9573
|
+
const items = getSortedData(this.parent, (this.parent.enableVirtualization) ? args.result : this.gridObj.dataSource);
|
9469
9574
|
args.result = items;
|
9470
|
-
// }
|
9471
9575
|
}
|
9472
9576
|
/* istanbul ignore next */
|
9473
9577
|
onDataBound() {
|
9474
9578
|
this.createDragObj();
|
9475
|
-
|
9476
|
-
|
9477
|
-
|
9478
|
-
if (this.parent.selectedItems.length !== 0) {
|
9579
|
+
if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization) ||
|
9580
|
+
((this.parent.selectedItems.length !== 0 && this.parent.enableVirtualization &&
|
9581
|
+
this.element.querySelector('.e-content').scrollTop == 0))) {
|
9479
9582
|
this.selectRecords(this.parent.selectedItems);
|
9480
9583
|
}
|
9481
9584
|
if (this.isPasteOperation === true) {
|
@@ -9594,6 +9697,9 @@ class DetailsView {
|
|
9594
9697
|
// eslint-disable-next-line
|
9595
9698
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
9596
9699
|
}
|
9700
|
+
if (this.element.querySelector('.e-content').scrollTop !== 0) {
|
9701
|
+
this.gridObj.freezeRefresh();
|
9702
|
+
}
|
9597
9703
|
}
|
9598
9704
|
onPropertyChanged(e) {
|
9599
9705
|
if (e.module !== this.getModuleName() && e.module !== 'common') {
|
@@ -9672,6 +9778,7 @@ class DetailsView {
|
|
9672
9778
|
showSpinner(this.parent.element);
|
9673
9779
|
this.parent.setProperties({ selectedItems: [] }, true);
|
9674
9780
|
this.gridObj.dataSource = getSortedData(this.parent, args.files);
|
9781
|
+
this.gridObj.freezeRefresh();
|
9675
9782
|
}
|
9676
9783
|
this.emptyArgs = args;
|
9677
9784
|
}
|
@@ -9756,12 +9863,18 @@ class DetailsView {
|
|
9756
9863
|
this.parent.isFiltered = false;
|
9757
9864
|
}
|
9758
9865
|
this.element.focus();
|
9866
|
+
if (this.parent.enableVirtualization) {
|
9867
|
+
this.parent.element.querySelector('#' + this.parent.element.id + IMG_DIALOG_ID).focus();
|
9868
|
+
}
|
9759
9869
|
}
|
9760
9870
|
});
|
9761
9871
|
}
|
9762
9872
|
/* istanbul ignore next */
|
9763
9873
|
onLayoutChange(args) {
|
9764
9874
|
if (this.parent.view === 'Details') {
|
9875
|
+
if (this.parent.enableVirtualization) {
|
9876
|
+
this.parent.setProperties({ selectedItems: [] }, true);
|
9877
|
+
}
|
9765
9878
|
if (!this.gridObj) {
|
9766
9879
|
this.render(args);
|
9767
9880
|
}
|
@@ -10233,11 +10346,10 @@ class DetailsView {
|
|
10233
10346
|
}
|
10234
10347
|
}
|
10235
10348
|
const len = rows.length;
|
10236
|
-
if (
|
10237
|
-
|
10238
|
-
|
10239
|
-
|
10240
|
-
// else if (len > 0) {
|
10349
|
+
if (this.parent.enableVirtualization) {
|
10350
|
+
this.parent.currentItemText = getValue('name', args.data);
|
10351
|
+
}
|
10352
|
+
else if (len > 0) {
|
10241
10353
|
// eslint-disable-next-line
|
10242
10354
|
const data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
10243
10355
|
this.parent.currentItemText = getValue('name', data);
|
@@ -10251,11 +10363,13 @@ class DetailsView {
|
|
10251
10363
|
}
|
10252
10364
|
}
|
10253
10365
|
this.parent.visitedItem = args.row;
|
10254
|
-
if (this.parent.
|
10255
|
-
|
10256
|
-
|
10366
|
+
if ((!this.parent.enableVirtualization) || (!args.isHeaderCheckboxClicked)) {
|
10367
|
+
if (this.parent.allowMultiSelection && !isNullOrUndefined(item) && !isNullOrUndefined(item.querySelector('.e-checkselect'))) {
|
10368
|
+
const checkItem = item.querySelector('.e-checkselect');
|
10369
|
+
checkItem.focus();
|
10370
|
+
}
|
10371
|
+
this.addFocus(this.gridObj.selectedRowIndex);
|
10257
10372
|
}
|
10258
|
-
this.addFocus(this.gridObj.selectedRowIndex);
|
10259
10373
|
if (!this.parent.isLayoutChange) {
|
10260
10374
|
this.isInteracted = true;
|
10261
10375
|
}
|
@@ -11018,5 +11132,5 @@ class DetailsView {
|
|
11018
11132
|
* File Manager all modules
|
11019
11133
|
*/
|
11020
11134
|
|
11021
|
-
export { AjaxSettings, toolbarItems, ToolbarSettings, SearchSettings, columnArray, DetailsViewSettings,
|
11135
|
+
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 };
|
11022
11136
|
//# sourceMappingURL=ej2-filemanager.es2015.js.map
|