@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.
- package/.eslintrc.json +16 -1
- package/CHANGELOG.md +0 -8
- package/README.md +53 -42
- 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 +313 -90
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +343 -99
- 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 +26 -17
- package/src/file-manager/actions/breadcrumb-bar.js +1 -1
- package/src/file-manager/actions/index.d.ts +1 -0
- package/src/file-manager/actions/index.js +1 -0
- package/src/file-manager/actions/virtualization.d.ts +38 -0
- package/src/file-manager/actions/virtualization.js +179 -0
- package/src/file-manager/base/file-manager-model.d.ts +14 -1
- package/src/file-manager/base/file-manager.d.ts +15 -0
- package/src/file-manager/base/file-manager.js +10 -1
- package/src/file-manager/base/interface.d.ts +2 -1
- package/src/file-manager/common/utility.js +5 -4
- package/src/file-manager/layout/details-view.js +13 -0
- package/src/file-manager/layout/large-icons-view.d.ts +2 -1
- package/src/file-manager/layout/large-icons-view.js +8 -1
- package/src/file-manager/models/index.d.ts +2 -0
- package/src/file-manager/models/index.js +1 -0
- package/src/file-manager/models/virtualization-settings-model.d.ts +29 -0
- package/src/file-manager/models/virtualization-settings.d.ts +24 -0
- package/src/file-manager/models/virtualization-settings.js +40 -0
- package/src/global.js +1 -1
- package/styles/bootstrap-dark.css +2 -12
- package/styles/bootstrap.css +2 -12
- package/styles/bootstrap4.css +2 -12
- package/styles/bootstrap5-dark.css +2 -12
- package/styles/bootstrap5.css +2 -12
- package/styles/fabric-dark.css +2 -12
- package/styles/fabric.css +2 -12
- package/styles/file-manager/_layout.scss +9 -19
- package/styles/file-manager/bootstrap-dark.css +2 -12
- package/styles/file-manager/bootstrap.css +2 -12
- package/styles/file-manager/bootstrap4.css +2 -12
- package/styles/file-manager/bootstrap5-dark.css +2 -12
- package/styles/file-manager/bootstrap5.css +2 -12
- package/styles/file-manager/fabric-dark.css +2 -12
- package/styles/file-manager/fabric.css +2 -12
- package/styles/file-manager/fluent-dark.css +8 -12
- package/styles/file-manager/fluent.css +8 -12
- package/styles/file-manager/highcontrast-light.css +2 -12
- package/styles/file-manager/highcontrast.css +2 -12
- package/styles/file-manager/material-dark.css +2 -12
- package/styles/file-manager/material.css +2 -15
- package/styles/file-manager/tailwind-dark.css +2 -12
- package/styles/file-manager/tailwind.css +2 -12
- package/styles/fluent-dark.css +8 -12
- package/styles/fluent.css +8 -12
- package/styles/highcontrast-light.css +2 -12
- package/styles/highcontrast.css +2 -12
- package/styles/material-dark.css +2 -12
- package/styles/material.css +2 -15
- package/styles/tailwind-dark.css +2 -12
- package/styles/tailwind.css +2 -12
package/dist/global/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* filename: index.d.ts
|
3
|
-
* version : 20.
|
3
|
+
* version : 20.4.38
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
5
5
|
* Use of this code is subject to the terms of our license.
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"_from": "@syncfusion/ej2-filemanager@*",
|
3
|
-
"_id": "@syncfusion/ej2-filemanager@
|
3
|
+
"_id": "@syncfusion/ej2-filemanager@18.18.1",
|
4
4
|
"_inBundle": false,
|
5
|
-
"_integrity": "sha512-
|
5
|
+
"_integrity": "sha512-8Tfb1TMRmh7Q5hh1YVSc+Vp7CI7mnzpOU5ausAKSxucWlp8VsHRsVMrjkk2Z6wGSy+hlhhjGIC44HwNryUBDqQ==",
|
6
6
|
"_location": "/@syncfusion/ej2-filemanager",
|
7
7
|
"_phantomChildren": {},
|
8
8
|
"_requested": {
|
@@ -25,10 +25,10 @@
|
|
25
25
|
"/@syncfusion/ej2-richtexteditor",
|
26
26
|
"/@syncfusion/ej2-vue-filemanager"
|
27
27
|
],
|
28
|
-
"_resolved": "
|
29
|
-
"_shasum": "
|
28
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-filemanager/-/ej2-filemanager-18.18.1.tgz",
|
29
|
+
"_shasum": "a698e73cd80544f407c91497bcd431e6e2f1061a",
|
30
30
|
"_spec": "@syncfusion/ej2-filemanager@*",
|
31
|
-
"_where": "/jenkins/workspace/automation_release_19.1.0.1
|
31
|
+
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
32
32
|
"author": {
|
33
33
|
"name": "Syncfusion Inc."
|
34
34
|
},
|
@@ -37,16 +37,16 @@
|
|
37
37
|
},
|
38
38
|
"bundleDependencies": false,
|
39
39
|
"dependencies": {
|
40
|
-
"@syncfusion/ej2-base": "~20.
|
41
|
-
"@syncfusion/ej2-buttons": "~20.
|
42
|
-
"@syncfusion/ej2-data": "~20.
|
43
|
-
"@syncfusion/ej2-grids": "~20.
|
44
|
-
"@syncfusion/ej2-inputs": "~20.
|
45
|
-
"@syncfusion/ej2-layouts": "~20.
|
46
|
-
"@syncfusion/ej2-lists": "~20.
|
47
|
-
"@syncfusion/ej2-navigations": "~20.
|
48
|
-
"@syncfusion/ej2-popups": "~20.
|
49
|
-
"@syncfusion/ej2-splitbuttons": "~20.
|
40
|
+
"@syncfusion/ej2-base": "~20.4.38",
|
41
|
+
"@syncfusion/ej2-buttons": "~20.4.38",
|
42
|
+
"@syncfusion/ej2-data": "~20.4.38",
|
43
|
+
"@syncfusion/ej2-grids": "~20.4.38",
|
44
|
+
"@syncfusion/ej2-inputs": "~20.4.38",
|
45
|
+
"@syncfusion/ej2-layouts": "~20.4.38",
|
46
|
+
"@syncfusion/ej2-lists": "~20.4.38",
|
47
|
+
"@syncfusion/ej2-navigations": "~20.4.38",
|
48
|
+
"@syncfusion/ej2-popups": "~20.4.38",
|
49
|
+
"@syncfusion/ej2-splitbuttons": "~20.4.38"
|
50
50
|
},
|
51
51
|
"deprecated": false,
|
52
52
|
"description": "Essential JS 2 FileManager Component",
|
@@ -56,7 +56,16 @@
|
|
56
56
|
"keywords": [
|
57
57
|
"ej2",
|
58
58
|
"syncfusion",
|
59
|
-
"
|
59
|
+
"JavaScript",
|
60
|
+
"TypeScript",
|
61
|
+
"filemanager",
|
62
|
+
"file organizer",
|
63
|
+
"file organizing tool",
|
64
|
+
"file picker",
|
65
|
+
"file viewer",
|
66
|
+
"file browser",
|
67
|
+
"file selector",
|
68
|
+
"directory viewer"
|
60
69
|
],
|
61
70
|
"license": "SEE LICENSE IN license",
|
62
71
|
"main": "./dist/ej2-filemanager.umd.min.js",
|
@@ -67,6 +76,6 @@
|
|
67
76
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
68
77
|
},
|
69
78
|
"typings": "index.d.ts",
|
70
|
-
"version": "20.
|
79
|
+
"version": "20.4.38",
|
71
80
|
"sideEffects": false
|
72
81
|
}
|
@@ -405,7 +405,7 @@ var BreadCrumbBar = /** @class */ (function () {
|
|
405
405
|
}
|
406
406
|
};
|
407
407
|
BreadCrumbBar.prototype.onSearchTextChange = function (args) {
|
408
|
-
this.searchObj.element.placeholder = (this.parent.searchSettings.placeholder != null) ? this.parent.searchSettings.placeholder : getLocaleText(this.parent, 'Search') + ' ' + args.cwd.name;
|
408
|
+
this.searchObj.element.placeholder = (this.parent.searchSettings.placeholder != null) ? this.parent.searchSettings.placeholder : getLocaleText(this.parent, 'Search') + ' ' + getLocaleText(this.parent, args.cwd.name.toString());
|
409
409
|
};
|
410
410
|
return BreadCrumbBar;
|
411
411
|
}());
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { FileManager } from '../base';
|
2
|
+
export declare class Virtualization {
|
3
|
+
constructor(instance: FileManager);
|
4
|
+
private filemanagerInstance;
|
5
|
+
private largeIconInstance;
|
6
|
+
private rowItemCount;
|
7
|
+
private listElements;
|
8
|
+
private items;
|
9
|
+
private itemList;
|
10
|
+
private scrollPosition;
|
11
|
+
private totalHeight;
|
12
|
+
private listItemHeight;
|
13
|
+
private topElementHeight;
|
14
|
+
private bottomElementHeight;
|
15
|
+
private renderedCount;
|
16
|
+
private lastRowCount;
|
17
|
+
private topElement;
|
18
|
+
private bottomElement;
|
19
|
+
private listDiff;
|
20
|
+
private largeIconsViewItemsCount;
|
21
|
+
setUlElementHeight(): void;
|
22
|
+
private ValidateItemCount;
|
23
|
+
wireScrollEvent(destroy: boolean): void;
|
24
|
+
private onVirtualUiScroll;
|
25
|
+
private getscrollerHeight;
|
26
|
+
private onNormalScroll;
|
27
|
+
private updateUI;
|
28
|
+
private updateSelection;
|
29
|
+
private updateCheckState;
|
30
|
+
/**
|
31
|
+
* For internal use only - Get the module name.
|
32
|
+
*
|
33
|
+
* @returns {string} - returns the module name.
|
34
|
+
* @private
|
35
|
+
*/
|
36
|
+
private getModuleName;
|
37
|
+
destroy(): void;
|
38
|
+
}
|
@@ -0,0 +1,179 @@
|
|
1
|
+
import { EventHandler, isNullOrUndefined, detach, formatUnit, getValue, addClass, select, closest } from '@syncfusion/ej2-base';
|
2
|
+
import { ListBase } from '@syncfusion/ej2-lists';
|
3
|
+
import { createElement, selectAll, } from '@syncfusion/ej2-base';
|
4
|
+
import * as CLS from '../base/classes';
|
5
|
+
var Virtualization = /** @class */ (function () {
|
6
|
+
function Virtualization(instance) {
|
7
|
+
this.largeIconsViewItemsCount = 40;
|
8
|
+
this.filemanagerInstance = instance;
|
9
|
+
this.largeIconInstance = instance.largeiconsviewModule;
|
10
|
+
}
|
11
|
+
// Update the scroller height based on the items count.
|
12
|
+
Virtualization.prototype.setUlElementHeight = function () {
|
13
|
+
this.rowItemCount = this.ValidateItemCount(Object.keys(this.largeIconInstance.allItems).length);
|
14
|
+
this.lastRowCount = (this.largeIconInstance.allItems.length - this.largeIconsViewItemsCount) % this.rowItemCount ?
|
15
|
+
(this.largeIconInstance.allItems.length - this.largeIconsViewItemsCount) % this.rowItemCount : this.rowItemCount;
|
16
|
+
this.topElement = this.filemanagerInstance.createElement('div');
|
17
|
+
this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement, this.largeIconInstance.element.firstElementChild.firstChild);
|
18
|
+
this.bottomElement = this.filemanagerInstance.createElement('div');
|
19
|
+
this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement, null);
|
20
|
+
var marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top')) +
|
21
|
+
parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-bottom'));
|
22
|
+
this.listItemHeight = this.largeIconInstance.itemList[0].getBoundingClientRect().height + marginValue;
|
23
|
+
this.totalHeight = (Object.keys(this.largeIconInstance.allItems).length / this.rowItemCount) * this.listItemHeight;
|
24
|
+
this.topElement.style.height = 0 + 'px';
|
25
|
+
this.bottomElement.style.height = this.totalHeight + 'px';
|
26
|
+
this.topElementHeight = 0;
|
27
|
+
this.bottomElementHeight = this.totalHeight;
|
28
|
+
this.listDiff = 0;
|
29
|
+
this.renderedCount = this.largeIconsViewItemsCount;
|
30
|
+
};
|
31
|
+
// Calculated the maximum number of items can be rendered in each row.
|
32
|
+
Virtualization.prototype.ValidateItemCount = function (dataSourceLength) {
|
33
|
+
var width = parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth));
|
34
|
+
var marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-right')) +
|
35
|
+
parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-left'));
|
36
|
+
var itemCount = Math.floor(width / (this.largeIconInstance.itemList[0].offsetWidth + marginValue));
|
37
|
+
if (itemCount > dataSourceLength) {
|
38
|
+
itemCount = dataSourceLength;
|
39
|
+
}
|
40
|
+
return itemCount;
|
41
|
+
};
|
42
|
+
// Bind the scroll event for large icons view ul element.
|
43
|
+
Virtualization.prototype.wireScrollEvent = function (destroy) {
|
44
|
+
if (!destroy) {
|
45
|
+
EventHandler.add(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll, this);
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
EventHandler.remove(this.largeIconInstance.element.firstElementChild, 'scroll', this.onVirtualUiScroll);
|
49
|
+
}
|
50
|
+
};
|
51
|
+
// Update the top and bottom element height and update the scroll position.
|
52
|
+
Virtualization.prototype.onVirtualUiScroll = function (e) {
|
53
|
+
var _a;
|
54
|
+
var startingHeight = 0;
|
55
|
+
this.scrollPosition = isNullOrUndefined(this.scrollPosition) ? 0 : this.scrollPosition;
|
56
|
+
var scroll = this.getscrollerHeight(startingHeight);
|
57
|
+
this.topElementHeight = this.listItemHeight * Math.floor(scroll / this.listItemHeight);
|
58
|
+
this.bottomElementHeight = this.totalHeight - this.topElementHeight;
|
59
|
+
_a = scroll <= this.totalHeight ?
|
60
|
+
[this.topElementHeight, this.bottomElementHeight] : [this.totalHeight, 0], this.topElementHeight = _a[0], this.bottomElementHeight = _a[1];
|
61
|
+
if (this.topElementHeight !== parseFloat(this.topElement.style.height)) {
|
62
|
+
this.topElement.style.height = this.topElementHeight + 'px';
|
63
|
+
this.bottomElement.style.height = this.bottomElementHeight + 'px';
|
64
|
+
// checked whether the scrolling is upward/downward
|
65
|
+
if (scroll > this.scrollPosition) {
|
66
|
+
var listDiff = Math.round(((this.topElementHeight / this.listItemHeight) - this.listDiff));
|
67
|
+
this.onNormalScroll(listDiff, true);
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
var listDiff = Math.round((this.listDiff - (this.topElementHeight / this.listItemHeight)));
|
71
|
+
this.onNormalScroll(listDiff, false);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
this.listDiff = Math.round(this.topElementHeight / this.listItemHeight);
|
75
|
+
this.scrollPosition = scroll;
|
76
|
+
this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, this.largeIconInstance.element));
|
77
|
+
this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
|
78
|
+
this.largeIconsViewItemsCount, this.renderedCount);
|
79
|
+
};
|
80
|
+
// Calculated the scroller height.
|
81
|
+
Virtualization.prototype.getscrollerHeight = function (startingHeight) {
|
82
|
+
return ((this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight) <= 0) ? 0 :
|
83
|
+
(this.largeIconInstance.element.firstElementChild.scrollTop - startingHeight);
|
84
|
+
};
|
85
|
+
// Update the UI based on the scrolled position.
|
86
|
+
Virtualization.prototype.onNormalScroll = function (listDiff, isScrollingDown) {
|
87
|
+
for (var i = 0; i < listDiff; i++) {
|
88
|
+
this.updateUI(isScrollingDown);
|
89
|
+
}
|
90
|
+
this.updateSelection();
|
91
|
+
};
|
92
|
+
// Updating the items in large icons view dynamically.
|
93
|
+
Virtualization.prototype.updateUI = function (isScrollingDown) {
|
94
|
+
var _this = this;
|
95
|
+
if (isScrollingDown) {
|
96
|
+
this.items = this.largeIconInstance.allItems.slice(this.renderedCount, this.renderedCount + this.rowItemCount);
|
97
|
+
if (this.items.length > 0) {
|
98
|
+
this.listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
|
99
|
+
this.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, this.listElements));
|
100
|
+
this.itemList.forEach(function (liEle) {
|
101
|
+
_this.largeIconInstance.element.firstElementChild.insertBefore(liEle, _this.bottomElement);
|
102
|
+
});
|
103
|
+
this.renderedCount = (this.largeIconInstance.allItems.length >= this.renderedCount + this.rowItemCount) ?
|
104
|
+
this.renderedCount + this.rowItemCount : this.renderedCount + this.lastRowCount;
|
105
|
+
for (var i_1 = 0; i_1 < this.rowItemCount; i_1++) {
|
106
|
+
detach(this.topElement.nextElementSibling);
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
else {
|
111
|
+
var lastItemIndex = void 0;
|
112
|
+
var isAllRendered = void 0;
|
113
|
+
if (this.renderedCount == this.largeIconInstance.allItems.length) {
|
114
|
+
lastItemIndex = this.renderedCount - (this.largeIconsViewItemsCount - this.rowItemCount + this.lastRowCount);
|
115
|
+
this.renderedCount = ((this.renderedCount - this.lastRowCount) < this.largeIconsViewItemsCount) ?
|
116
|
+
this.largeIconsViewItemsCount : (this.renderedCount - this.lastRowCount);
|
117
|
+
isAllRendered = true;
|
118
|
+
}
|
119
|
+
else {
|
120
|
+
lastItemIndex = this.renderedCount - this.largeIconsViewItemsCount;
|
121
|
+
this.renderedCount = ((this.renderedCount - this.rowItemCount) < this.largeIconsViewItemsCount) ?
|
122
|
+
this.largeIconsViewItemsCount : (this.renderedCount - this.rowItemCount);
|
123
|
+
}
|
124
|
+
var startItemIndex = (lastItemIndex - this.rowItemCount > 0) ? lastItemIndex - this.rowItemCount : 0;
|
125
|
+
this.items = this.largeIconInstance.allItems.slice(startItemIndex, lastItemIndex);
|
126
|
+
if (this.items.length > 0) {
|
127
|
+
this.listElements = ListBase.createListFromJson(createElement, this.items, this.largeIconInstance.listObj);
|
128
|
+
this.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, this.listElements));
|
129
|
+
for (var len = this.itemList.length; len > 0; len--) {
|
130
|
+
this.largeIconInstance.element.firstElementChild.insertBefore(this.itemList[len - 1], this.topElement.nextElementSibling);
|
131
|
+
}
|
132
|
+
for (var i = 0; i < ((isAllRendered) ? this.lastRowCount : this.rowItemCount); i++) {
|
133
|
+
detach(this.bottomElement.previousElementSibling);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
};
|
138
|
+
// Update the selected item state.
|
139
|
+
Virtualization.prototype.updateSelection = function () {
|
140
|
+
for (var i = 0; i < this.filemanagerInstance.selectedItems.length; i++) {
|
141
|
+
for (var j = 0; j < this.items.length; j++) {
|
142
|
+
if (this.filemanagerInstance.selectedItems[i] == getValue('name', this.items[j])) {
|
143
|
+
this.updateCheckState(this.itemList[j]);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
147
|
+
};
|
148
|
+
// Update the check state for items.
|
149
|
+
Virtualization.prototype.updateCheckState = function (liItem) {
|
150
|
+
if (this.filemanagerInstance.allowMultiSelection) {
|
151
|
+
addClass([liItem], [CLS.ACTIVE]);
|
152
|
+
liItem.setAttribute('aria-selected', 'true');
|
153
|
+
var checkEle = select('.' + CLS.FRAME, liItem);
|
154
|
+
if (!checkEle.classList.contains(CLS.CHECK)) {
|
155
|
+
addClass([checkEle], CLS.CHECK);
|
156
|
+
closest(checkEle, '.' + CLS.CB_WRAP).setAttribute('aria-checked', 'true');
|
157
|
+
}
|
158
|
+
}
|
159
|
+
};
|
160
|
+
/**
|
161
|
+
* For internal use only - Get the module name.
|
162
|
+
*
|
163
|
+
* @returns {string} - returns the module name.
|
164
|
+
* @private
|
165
|
+
*/
|
166
|
+
Virtualization.prototype.getModuleName = function () {
|
167
|
+
return 'virtualization';
|
168
|
+
};
|
169
|
+
Virtualization.prototype.destroy = function () {
|
170
|
+
if (this.filemanagerInstance.isDestroyed) {
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
if (!isNullOrUndefined(this.largeIconInstance.element.firstElementChild)) {
|
174
|
+
this.wireScrollEvent(true);
|
175
|
+
}
|
176
|
+
};
|
177
|
+
return Virtualization;
|
178
|
+
}());
|
179
|
+
export { Virtualization };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Component, EmitType, ModuleDeclaration, isNullOrUndefined, L10n, closest } from '@syncfusion/ej2-base';import { Property, INotifyPropertyChanged, NotifyPropertyChanges, Complex, select } from '@syncfusion/ej2-base';import { createElement, addClass, removeClass, setStyleAttribute as setAttr, getUniqueID } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, formatUnit, Browser, KeyboardEvents, KeyboardEventArgs } from '@syncfusion/ej2-base';import { Event, EventHandler, getValue, setValue } from '@syncfusion/ej2-base';import { Splitter, PanePropertiesModel } from '@syncfusion/ej2-layouts';import { Dialog, createSpinner, hideSpinner, showSpinner, BeforeOpenEventArgs, BeforeCloseEventArgs } from '@syncfusion/ej2-popups';import { createDialog, createExtDialog } from '../pop-up/dialog';import { ToolbarSettings, ToolbarSettingsModel, AjaxSettings, NavigationPaneSettings, DetailsViewSettings } from '../models/index';import { NavigationPaneSettingsModel, DetailsViewSettingsModel } from '../models/index';import { AjaxSettingsModel, SearchSettings, SearchSettingsModel } from '../models/index';import { Toolbar } from '../actions/toolbar';import { DetailsView } from '../layout/details-view';import { LargeIconsView } from '../layout/large-icons-view';import { Uploader, UploadingEventArgs, SelectedEventArgs, FileInfo, CancelEventArgs } from '@syncfusion/ej2-inputs';import { UploadSettingsModel } from '../models/upload-settings-model';import { UploadSettings } from '../models/upload-settings';import * as events from './constant';import * as CLS from './classes';import { read, filter, createFolder } from '../common/operations';import { ITreeView, IContextMenu, ViewType, SortOrder, FileDragEventArgs, RetryArgs, ReadArgs, FileSelectionEventArgs } from './interface';import { BeforeSendEventArgs, SuccessEventArgs, FailureEventArgs, FileLoadEventArgs } from './interface';import { FileOpenEventArgs, FileSelectEventArgs, MenuClickEventArgs, MenuOpenEventArgs } from './interface';import { ToolbarClickEventArgs, ToolbarCreateEventArgs, UploadListCreateArgs } from './interface';import { PopupOpenCloseEventArgs, BeforePopupOpenCloseEventArgs, BeforeDownloadEventArgs, BeforeImageLoadEventArgs } from './interface';import { refresh, getPathObject, getLocaleText, setNextPath, createDeniedDialog, getCssClass } from '../common/utility';import { hasContentAccess, hasUploadAccess, updateLayout, createNewFolder, uploadItem } from '../common/utility';import { TreeView as BaseTreeView } from '@syncfusion/ej2-navigations';import { ContextMenuSettingsModel } from '../models/contextMenu-settings-model';import { ContextMenuSettings } from '../models/contextMenu-settings';import { BreadCrumbBar } from '../actions/breadcrumb-bar';import { ContextMenu } from '../pop-up/context-menu';import { defaultLocale } from '../models/default-locale';import { PositionModel } from '@syncfusion/ej2-base/src/draggable-model';
|
1
|
+
import { Component, EmitType, ModuleDeclaration, isNullOrUndefined, L10n, closest } from '@syncfusion/ej2-base';import { Property, INotifyPropertyChanged, NotifyPropertyChanges, Complex, select } from '@syncfusion/ej2-base';import { createElement, addClass, removeClass, setStyleAttribute as setAttr, getUniqueID } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, formatUnit, Browser, KeyboardEvents, KeyboardEventArgs } from '@syncfusion/ej2-base';import { Event, EventHandler, getValue, setValue } from '@syncfusion/ej2-base';import { Splitter, PanePropertiesModel } from '@syncfusion/ej2-layouts';import { Dialog, createSpinner, hideSpinner, showSpinner, BeforeOpenEventArgs, BeforeCloseEventArgs } from '@syncfusion/ej2-popups';import { createDialog, createExtDialog } from '../pop-up/dialog';import { ToolbarSettings, ToolbarSettingsModel, AjaxSettings, NavigationPaneSettings, DetailsViewSettings, VirtualizationSettings } from '../models/index';import { NavigationPaneSettingsModel, DetailsViewSettingsModel, VirtualizationSettingsModel } from '../models/index';import { AjaxSettingsModel, SearchSettings, SearchSettingsModel } from '../models/index';import { Toolbar } from '../actions/toolbar';import { DetailsView } from '../layout/details-view';import { LargeIconsView } from '../layout/large-icons-view';import { Uploader, UploadingEventArgs, SelectedEventArgs, FileInfo, CancelEventArgs } from '@syncfusion/ej2-inputs';import { UploadSettingsModel } from '../models/upload-settings-model';import { UploadSettings } from '../models/upload-settings';import * as events from './constant';import * as CLS from './classes';import { read, filter, createFolder } from '../common/operations';import { ITreeView, IContextMenu, ViewType, SortOrder, FileDragEventArgs, RetryArgs, ReadArgs, FileSelectionEventArgs } from './interface';import { BeforeSendEventArgs, SuccessEventArgs, FailureEventArgs, FileLoadEventArgs } from './interface';import { FileOpenEventArgs, FileSelectEventArgs, MenuClickEventArgs, MenuOpenEventArgs } from './interface';import { ToolbarClickEventArgs, ToolbarCreateEventArgs, UploadListCreateArgs } from './interface';import { PopupOpenCloseEventArgs, BeforePopupOpenCloseEventArgs, BeforeDownloadEventArgs, BeforeImageLoadEventArgs } from './interface';import { refresh, getPathObject, getLocaleText, setNextPath, createDeniedDialog, getCssClass } from '../common/utility';import { hasContentAccess, hasUploadAccess, updateLayout, createNewFolder, uploadItem } from '../common/utility';import { TreeView as BaseTreeView } from '@syncfusion/ej2-navigations';import { ContextMenuSettingsModel } from '../models/contextMenu-settings-model';import { ContextMenuSettings } from '../models/contextMenu-settings';import { BreadCrumbBar } from '../actions/breadcrumb-bar';import { ContextMenu } from '../pop-up/context-menu';import { defaultLocale } from '../models/default-locale';import { PositionModel } from '@syncfusion/ej2-base/src/draggable-model';import { Virtualization } from '../actions/virtualization';
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
3
3
|
|
4
4
|
/**
|
@@ -65,6 +65,19 @@ export interface FileManagerModel extends ComponentModel{
|
|
65
65
|
*/
|
66
66
|
detailsViewSettings?: DetailsViewSettingsModel;
|
67
67
|
|
68
|
+
/**
|
69
|
+
* Gets or sets the virtualization settings of the File Manager to load a large set of files/folders.
|
70
|
+
* When `virtualizationSettings.enable` is true, the file and folders will be loaded based on the count specified in corresponding views.
|
71
|
+
* By default, 20 files/folders render in the details view and 40 files and folders render in the large icons view.
|
72
|
+
* The remaining files/folders will be rendered on vertical scroll within File Manager content.
|
73
|
+
* @default {
|
74
|
+
* enable: false
|
75
|
+
* detailsViewItemsCount: 20,
|
76
|
+
* largeIconsViewItemsCount: 40
|
77
|
+
* }
|
78
|
+
*/
|
79
|
+
virtualizationSettings?: VirtualizationSettingsModel;
|
80
|
+
|
68
81
|
/**
|
69
82
|
* Defines whether to allow the cross-scripting site or not.
|
70
83
|
*
|
@@ -20,6 +20,7 @@ import { TreeView as BaseTreeView } from '@syncfusion/ej2-navigations';
|
|
20
20
|
import { ContextMenuSettingsModel } from '../models/contextMenu-settings-model';
|
21
21
|
import { BreadCrumbBar } from '../actions/breadcrumb-bar';
|
22
22
|
import { PositionModel } from '@syncfusion/ej2-base/src/draggable-model';
|
23
|
+
import { Virtualization } from '../actions/virtualization';
|
23
24
|
/**
|
24
25
|
* The FileManager component allows users to access and manage the file system through the web browser. It can performs the
|
25
26
|
* functionalities like add, rename, search, sort, upload and delete files or folders. And also it
|
@@ -45,6 +46,8 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
|
|
45
46
|
contextmenuModule: IContextMenu;
|
46
47
|
/** @hidden */
|
47
48
|
breadcrumbbarModule: BreadCrumbBar;
|
49
|
+
/** @hidden */
|
50
|
+
virtualizationModule: Virtualization;
|
48
51
|
private keyboardModule;
|
49
52
|
private keyConfigs;
|
50
53
|
filterData: Object;
|
@@ -197,6 +200,18 @@ export declare class FileManager extends Component<HTMLElement> implements INoti
|
|
197
200
|
* }
|
198
201
|
*/
|
199
202
|
detailsViewSettings: DetailsViewSettingsModel;
|
203
|
+
/**
|
204
|
+
* Gets or sets the virtualization settings of the File Manager to load a large set of files/folders.
|
205
|
+
* When `virtualizationSettings.enable` is true, the file and folders will be loaded based on the count specified in corresponding views.
|
206
|
+
* By default, 20 files/folders render in the details view and 40 files and folders render in the large icons view.
|
207
|
+
* The remaining files/folders will be rendered on vertical scroll within File Manager content.
|
208
|
+
* @default {
|
209
|
+
* enable: false
|
210
|
+
* detailsViewItemsCount: 20,
|
211
|
+
* largeIconsViewItemsCount: 40
|
212
|
+
* }
|
213
|
+
*/
|
214
|
+
private virtualizationSettings;
|
200
215
|
/**
|
201
216
|
* Defines whether to allow the cross-scripting site or not.
|
202
217
|
*
|
@@ -25,7 +25,7 @@ import { Event, EventHandler, getValue, setValue } from '@syncfusion/ej2-base';
|
|
25
25
|
import { Splitter } from '@syncfusion/ej2-layouts';
|
26
26
|
import { Dialog, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
27
27
|
import { createDialog, createExtDialog } from '../pop-up/dialog';
|
28
|
-
import { ToolbarSettings, AjaxSettings, NavigationPaneSettings, DetailsViewSettings } from '../models/index';
|
28
|
+
import { ToolbarSettings, AjaxSettings, NavigationPaneSettings, DetailsViewSettings, VirtualizationSettings } from '../models/index';
|
29
29
|
import { SearchSettings } from '../models/index';
|
30
30
|
import { LargeIconsView } from '../layout/large-icons-view';
|
31
31
|
import { Uploader } from '@syncfusion/ej2-inputs';
|
@@ -199,6 +199,12 @@ var FileManager = /** @class */ (function (_super) {
|
|
199
199
|
args: [this]
|
200
200
|
});
|
201
201
|
}
|
202
|
+
if (this.virtualizationSettings.enable) {
|
203
|
+
modules.push({
|
204
|
+
member: 'virtualization',
|
205
|
+
args: [this]
|
206
|
+
});
|
207
|
+
}
|
202
208
|
return modules;
|
203
209
|
};
|
204
210
|
/**
|
@@ -1144,6 +1150,9 @@ var FileManager = /** @class */ (function (_super) {
|
|
1144
1150
|
__decorate([
|
1145
1151
|
Complex({}, DetailsViewSettings)
|
1146
1152
|
], FileManager.prototype, "detailsViewSettings", void 0);
|
1153
|
+
__decorate([
|
1154
|
+
Complex({}, VirtualizationSettings)
|
1155
|
+
], FileManager.prototype, "virtualizationSettings", void 0);
|
1147
1156
|
__decorate([
|
1148
1157
|
Property(true)
|
1149
1158
|
], FileManager.prototype, "enableHtmlSanitizer", void 0);
|
@@ -11,7 +11,7 @@ import { ContextMenuSettingsModel } from '../models/contextMenu-settings-model';
|
|
11
11
|
import { LargeIconsView } from '../layout';
|
12
12
|
import { NavigationPaneSettingsModel } from '../models/navigation-pane-settings-model';
|
13
13
|
import { Uploader } from '@syncfusion/ej2-inputs';
|
14
|
-
import { BreadCrumbBar } from '../actions';
|
14
|
+
import { BreadCrumbBar, Virtualization } from '../actions';
|
15
15
|
import { PositionModel } from '@syncfusion/ej2-base/src/draggable-model';
|
16
16
|
/**
|
17
17
|
* Defines the view type of the FileManager.
|
@@ -511,6 +511,7 @@ export interface IFileManager extends Component<HTMLElement> {
|
|
511
511
|
navigationpaneModule: ITreeView;
|
512
512
|
largeiconsviewModule: LargeIconsView;
|
513
513
|
breadcrumbbarModule: BreadCrumbBar;
|
514
|
+
virtualizationModule: Virtualization;
|
514
515
|
toolbarSelection: boolean;
|
515
516
|
duplicateItems: string[];
|
516
517
|
duplicateRecords: Object[];
|
@@ -268,7 +268,7 @@ export function searchWordHandler(parent, value, isLayoutChange) {
|
|
268
268
|
else {
|
269
269
|
if (!parent.isFiltered) {
|
270
270
|
if (parent.isSortByClicked) {
|
271
|
-
parent.notify(events.layoutChange, { files: (parent.oldView === 'Details') ? parent.detailsviewModule.gridObj.dataSource : parent.largeiconsviewModule.
|
271
|
+
parent.notify(events.layoutChange, { files: (parent.oldView === 'Details') ? parent.detailsviewModule.gridObj.dataSource : parent.largeiconsviewModule.allItems });
|
272
272
|
parent.isSortByClicked = false;
|
273
273
|
}
|
274
274
|
else {
|
@@ -454,18 +454,19 @@ export function fileType(file) {
|
|
454
454
|
// eslint-disable-next-line
|
455
455
|
export function getImageUrl(parent, item) {
|
456
456
|
var baseUrl = parent.ajaxSettings.getImageUrl ? parent.ajaxSettings.getImageUrl : parent.ajaxSettings.url;
|
457
|
+
var pathUrl = (baseUrl.indexOf('?') !== -1) ? '&path=' : '?path=';
|
457
458
|
var imgUrl;
|
458
459
|
var fileName = encodeURIComponent(getValue('name', item));
|
459
460
|
var fPath = getValue('filterPath', item);
|
460
461
|
if (parent.hasId) {
|
461
462
|
var imgId = getValue('id', item);
|
462
|
-
imgUrl = baseUrl +
|
463
|
+
imgUrl = baseUrl + pathUrl + parent.path + '&id=' + imgId;
|
463
464
|
}
|
464
465
|
else if (!isNOU(fPath)) {
|
465
|
-
imgUrl = baseUrl +
|
466
|
+
imgUrl = baseUrl + pathUrl + encodeURIComponent(fPath.replace(/\\/g, '/')) + fileName;
|
466
467
|
}
|
467
468
|
else {
|
468
|
-
imgUrl = baseUrl +
|
469
|
+
imgUrl = baseUrl + pathUrl + parent.path + fileName;
|
469
470
|
}
|
470
471
|
imgUrl = imgUrl + '&time=' + (new Date().getTime()).toString();
|
471
472
|
var eventArgs = {
|
@@ -117,6 +117,10 @@ var DetailsView = /** @class */ (function () {
|
|
117
117
|
},
|
118
118
|
enableRtl: this.parent.enableRtl,
|
119
119
|
pageSettings: { pageSize: 20 },
|
120
|
+
// enableVirtualization: this.parent.virtualizationSettings.enable,
|
121
|
+
enablePersistence: this.parent.enablePersistence,
|
122
|
+
// enableVirtualMaskRow: true,
|
123
|
+
// pageSettings: { pageSize: this.parent.virtualizationSettings.detailsViewItemsCount },
|
120
124
|
sortSettings: { allowUnsort: false, columns: sortSettings },
|
121
125
|
columns: columns,
|
122
126
|
recordDoubleClick: this.DblClickEvents.bind(this),
|
@@ -325,14 +329,19 @@ var DetailsView = /** @class */ (function () {
|
|
325
329
|
}
|
326
330
|
};
|
327
331
|
DetailsView.prototype.onBeforeDataBound = function (args) {
|
332
|
+
// if (!this.parent.virtualizationSettings.enable) {
|
328
333
|
showSpinner(this.parent.element);
|
329
334
|
// eslint-disable-next-line
|
330
335
|
var items = getSortedData(this.parent, this.gridObj.dataSource);
|
331
336
|
args.result = items;
|
337
|
+
// }
|
332
338
|
};
|
333
339
|
/* istanbul ignore next */
|
334
340
|
DetailsView.prototype.onDataBound = function () {
|
335
341
|
this.createDragObj();
|
342
|
+
// if ((this.parent.selectedItems.length !== 0 && !this.parent.virtualizationSettings.enable) ||
|
343
|
+
// ((this.parent.selectedItems.length !== 0 && this.parent.virtualizationSettings.enable &&
|
344
|
+
// this.element.querySelector('.e-content').scrollTop == 0))) {
|
336
345
|
if (this.parent.selectedItems.length !== 0) {
|
337
346
|
this.selectRecords(this.parent.selectedItems);
|
338
347
|
}
|
@@ -1095,6 +1104,10 @@ var DetailsView = /** @class */ (function () {
|
|
1095
1104
|
}
|
1096
1105
|
var len = rows.length;
|
1097
1106
|
if (len > 0) {
|
1107
|
+
// if (this.parent.virtualizationSettings.enable) {
|
1108
|
+
// this.parent.currentItemText = getValue('name', args.data);
|
1109
|
+
// }
|
1110
|
+
// else if (len > 0) {
|
1098
1111
|
// eslint-disable-next-line
|
1099
1112
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
1100
1113
|
this.parent.currentItemText = getValue('name', data);
|
@@ -12,8 +12,9 @@ export declare class LargeIconsView {
|
|
12
12
|
private keyboardDownModule;
|
13
13
|
private keyConfigs;
|
14
14
|
private isInteraction;
|
15
|
-
|
15
|
+
itemList: HTMLElement[];
|
16
16
|
items: Object[];
|
17
|
+
allItems: Object[];
|
17
18
|
private clickObj;
|
18
19
|
private perRow;
|
19
20
|
private startItem;
|
@@ -111,7 +111,10 @@ var LargeIconsView = /** @class */ (function () {
|
|
111
111
|
};
|
112
112
|
this.items = [];
|
113
113
|
this.items = this.renderList(args);
|
114
|
-
this.items = getSortedData(this.parent, this.items);
|
114
|
+
this.items = this.allItems = getSortedData(this.parent, this.items);
|
115
|
+
// if (this.parent.virtualizationSettings.enable) {
|
116
|
+
// this.items = this.allItems.slice(0, this.parent.virtualizationSettings.largeIconsViewItemsCount);
|
117
|
+
// }
|
115
118
|
// eslint-disable-next-line
|
116
119
|
this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
|
117
120
|
this.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, this.listElements));
|
@@ -153,6 +156,10 @@ var LargeIconsView = /** @class */ (function () {
|
|
153
156
|
this.getItemCount();
|
154
157
|
this.addEventListener();
|
155
158
|
this.wireEvents();
|
159
|
+
// if (this.parent.virtualizationSettings.enable && this.allItems.length > 0) {
|
160
|
+
// this.parent.virtualizationModule.setUlElementHeight();
|
161
|
+
// this.parent.virtualizationModule.wireScrollEvent(false);
|
162
|
+
// }
|
156
163
|
this.isRendered = true;
|
157
164
|
hideSpinner(this.parent.element);
|
158
165
|
if (this.parent.selectedItems.length) {
|
@@ -9,6 +9,8 @@ export * from './search-settings';
|
|
9
9
|
export * from './search-settings-model';
|
10
10
|
export * from './details-view-settings-model';
|
11
11
|
export * from './details-view-settings';
|
12
|
+
export * from './virtualization-settings-model';
|
13
|
+
export * from './virtualization-settings';
|
12
14
|
export * from './contextMenu-settings';
|
13
15
|
export * from './contextMenu-settings-model';
|
14
16
|
export * from './navigation-pane-settings-model';
|
@@ -5,6 +5,7 @@ export * from './ajax-settings';
|
|
5
5
|
export * from './toolbar-settings';
|
6
6
|
export * from './search-settings';
|
7
7
|
export * from './details-view-settings';
|
8
|
+
export * from './virtualization-settings';
|
8
9
|
export * from './contextMenu-settings';
|
9
10
|
export * from './navigation-pane-settings';
|
10
11
|
export * from './upload-settings';
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Property, ChildProperty } from '@syncfusion/ej2-base';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Interface for a class VirtualizationSettings
|
5
|
+
*/
|
6
|
+
export interface VirtualizationSettingsModel {
|
7
|
+
|
8
|
+
/**
|
9
|
+
* If `enable` is set to true, it will increase the FileManager performance, while loading a large number of files/folders.
|
10
|
+
*
|
11
|
+
* @default false
|
12
|
+
*/
|
13
|
+
enable?: boolean;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Defines the number of records to be displayed in the details view.
|
17
|
+
*
|
18
|
+
* @default 20
|
19
|
+
*/
|
20
|
+
detailsViewItemsCount?: number;
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Defines the number of records to be displayed in large icons view.
|
24
|
+
*
|
25
|
+
* @default 40
|
26
|
+
*/
|
27
|
+
largeIconsViewItemsCount?: number;
|
28
|
+
|
29
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { ChildProperty } from '@syncfusion/ej2-base';
|
2
|
+
/**
|
3
|
+
* Specifies the virtualization settings of the File Manager.
|
4
|
+
*/
|
5
|
+
export declare class VirtualizationSettings extends ChildProperty<VirtualizationSettings> {
|
6
|
+
/**
|
7
|
+
* If `enable` is set to true, it will increase the FileManager performance, while loading a large number of files/folders.
|
8
|
+
*
|
9
|
+
* @default false
|
10
|
+
*/
|
11
|
+
private enable;
|
12
|
+
/**
|
13
|
+
* Defines the number of records to be displayed in the details view.
|
14
|
+
*
|
15
|
+
* @default 20
|
16
|
+
*/
|
17
|
+
private detailsViewItemsCount;
|
18
|
+
/**
|
19
|
+
* Defines the number of records to be displayed in large icons view.
|
20
|
+
*
|
21
|
+
* @default 40
|
22
|
+
*/
|
23
|
+
private largeIconsViewItemsCount;
|
24
|
+
}
|