@syncfusion/ej2-filemanager 29.2.10 → 30.1.37
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 +2 -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 +179 -20
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +180 -20
- 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/dist/ts/file-manager/actions/breadcrumb-bar.d.ts +60 -0
- package/dist/ts/file-manager/actions/breadcrumb-bar.ts +423 -0
- package/dist/ts/file-manager/actions/index.d.ts +6 -0
- package/dist/ts/file-manager/actions/index.ts +6 -0
- package/dist/ts/file-manager/actions/toolbar.d.ts +54 -0
- package/dist/ts/file-manager/actions/toolbar.ts +609 -0
- package/dist/ts/file-manager/actions/virtualization.d.ts +93 -0
- package/dist/ts/file-manager/actions/virtualization.ts +324 -0
- package/dist/ts/file-manager/base/classes.d.ts +224 -0
- package/dist/ts/file-manager/base/classes.ts +225 -0
- package/dist/ts/file-manager/base/constant.d.ts +136 -0
- package/dist/ts/file-manager/base/constant.ts +137 -0
- package/dist/ts/file-manager/base/file-manager-model.d.ts +520 -0
- package/dist/ts/file-manager/base/file-manager.d.ts +867 -0
- package/dist/ts/file-manager/base/file-manager.ts +2061 -0
- package/dist/ts/file-manager/base/index.d.ts +8 -0
- package/dist/ts/file-manager/base/index.ts +8 -0
- package/dist/ts/file-manager/base/interface.d.ts +952 -0
- package/dist/ts/file-manager/base/interface.ts +931 -0
- package/dist/ts/file-manager/common/index.d.ts +5 -0
- package/dist/ts/file-manager/common/index.ts +5 -0
- package/dist/ts/file-manager/common/operations.d.ts +122 -0
- package/dist/ts/file-manager/common/operations.ts +1369 -0
- package/dist/ts/file-manager/common/utility.d.ts +644 -0
- package/dist/ts/file-manager/common/utility.ts +1728 -0
- package/dist/ts/file-manager/index.d.ts +9 -0
- package/dist/ts/file-manager/index.ts +9 -0
- package/dist/ts/file-manager/layout/details-view.d.ts +152 -0
- package/dist/ts/file-manager/layout/details-view.ts +1990 -0
- package/dist/ts/file-manager/layout/index.d.ts +6 -0
- package/dist/ts/file-manager/layout/index.ts +6 -0
- package/dist/ts/file-manager/layout/large-icons-view.d.ts +157 -0
- package/dist/ts/file-manager/layout/large-icons-view.ts +1684 -0
- package/dist/ts/file-manager/layout/navigation-pane.d.ts +104 -0
- package/dist/ts/file-manager/layout/navigation-pane.ts +919 -0
- package/dist/ts/file-manager/models/ajax-settings-model.d.ts +36 -0
- package/dist/ts/file-manager/models/ajax-settings.d.ts +30 -0
- package/dist/ts/file-manager/models/ajax-settings.ts +39 -0
- package/dist/ts/file-manager/models/column-model.d.ts +155 -0
- package/dist/ts/file-manager/models/column.d.ts +179 -0
- package/dist/ts/file-manager/models/column.ts +216 -0
- package/dist/ts/file-manager/models/contextMenu-settings-model.d.ts +36 -0
- package/dist/ts/file-manager/models/contextMenu-settings.d.ts +33 -0
- package/dist/ts/file-manager/models/contextMenu-settings.ts +44 -0
- package/dist/ts/file-manager/models/default-locale.d.ts +4 -0
- package/dist/ts/file-manager/models/default-locale.ts +101 -0
- package/dist/ts/file-manager/models/details-view-settings-model.d.ts +30 -0
- package/dist/ts/file-manager/models/details-view-settings.d.ts +31 -0
- package/dist/ts/file-manager/models/details-view-settings.ts +54 -0
- package/dist/ts/file-manager/models/index.d.ts +19 -0
- package/dist/ts/file-manager/models/index.ts +19 -0
- package/dist/ts/file-manager/models/navigation-pane-settings-model.d.ts +40 -0
- package/dist/ts/file-manager/models/navigation-pane-settings.d.ts +34 -0
- package/dist/ts/file-manager/models/navigation-pane-settings.ts +42 -0
- package/dist/ts/file-manager/models/search-settings-model.d.ts +42 -0
- package/dist/ts/file-manager/models/search-settings.d.ts +44 -0
- package/dist/ts/file-manager/models/search-settings.ts +53 -0
- package/dist/ts/file-manager/models/toolbar-settings-model.d.ts +197 -0
- package/dist/ts/file-manager/models/toolbar-settings.d.ts +174 -0
- package/dist/ts/file-manager/models/toolbar-settings.ts +198 -0
- package/dist/ts/file-manager/models/upload-settings-model.d.ts +70 -0
- package/dist/ts/file-manager/models/upload-settings.d.ts +61 -0
- package/dist/ts/file-manager/models/upload-settings.ts +75 -0
- package/dist/ts/file-manager/pop-up/context-menu.d.ts +64 -0
- package/dist/ts/file-manager/pop-up/context-menu.ts +693 -0
- package/dist/ts/file-manager/pop-up/dialog.d.ts +31 -0
- package/dist/ts/file-manager/pop-up/dialog.ts +1009 -0
- package/dist/ts/file-manager/pop-up/index.d.ts +5 -0
- package/dist/ts/file-manager/pop-up/index.ts +5 -0
- package/dist/ts/index.d.ts +4 -0
- package/dist/ts/index.ts +4 -0
- package/package.json +56 -21
- package/src/file-manager/base/interface.d.ts +10 -0
- package/src/file-manager/common/operations.d.ts +18 -1
- package/src/file-manager/common/operations.js +59 -0
- package/src/file-manager/common/utility.d.ts +3 -3
- package/src/file-manager/common/utility.js +20 -6
- package/src/file-manager/layout/details-view.js +4 -3
- package/src/file-manager/layout/large-icons-view.d.ts +3 -0
- package/src/file-manager/layout/large-icons-view.js +67 -9
- package/src/file-manager/pop-up/dialog.d.ts +3 -3
- package/src/file-manager/pop-up/dialog.js +34 -6
- package/styles/bds-lite.css +51 -1
- package/styles/bds.css +51 -1
- package/styles/bootstrap-dark-lite.css +51 -0
- package/styles/bootstrap-dark.css +51 -0
- package/styles/bootstrap-lite.css +51 -0
- package/styles/bootstrap.css +51 -0
- package/styles/bootstrap4-lite.css +51 -0
- package/styles/bootstrap4.css +51 -0
- package/styles/bootstrap5-dark-lite.css +51 -1
- package/styles/bootstrap5-dark.css +51 -1
- package/styles/bootstrap5-lite.css +51 -1
- package/styles/bootstrap5.3-lite.css +51 -0
- package/styles/bootstrap5.3.css +51 -0
- package/styles/bootstrap5.css +51 -1
- package/styles/fabric-dark-lite.css +51 -0
- package/styles/fabric-dark.css +51 -0
- package/styles/fabric-lite.css +51 -0
- package/styles/fabric.css +51 -0
- package/styles/file-manager/_bds-definition.scss +1 -0
- package/styles/file-manager/_bootstrap5-definition.scss +1 -0
- package/styles/file-manager/_layout.scss +46 -4
- package/styles/file-manager/_material3-definition.scss +2 -2
- package/styles/file-manager/_tailwind-definition.scss +1 -0
- package/styles/file-manager/_tailwind3-definition.scss +1 -0
- package/styles/file-manager/bds.css +51 -1
- package/styles/file-manager/bootstrap-dark.css +51 -0
- package/styles/file-manager/bootstrap.css +51 -0
- package/styles/file-manager/bootstrap4.css +51 -0
- package/styles/file-manager/bootstrap5-dark.css +51 -1
- package/styles/file-manager/bootstrap5.3.css +51 -0
- package/styles/file-manager/bootstrap5.css +51 -1
- package/styles/file-manager/fabric-dark.css +51 -0
- package/styles/file-manager/fabric.css +51 -0
- package/styles/file-manager/fluent-dark.css +51 -0
- package/styles/file-manager/fluent.css +51 -0
- package/styles/file-manager/fluent2.css +51 -0
- package/styles/file-manager/highcontrast-light.css +51 -0
- package/styles/file-manager/highcontrast.css +51 -0
- package/styles/file-manager/material-dark.css +51 -0
- package/styles/file-manager/material.css +51 -0
- package/styles/file-manager/material3-dark.css +53 -2
- package/styles/file-manager/material3.css +53 -2
- package/styles/file-manager/tailwind-dark.css +51 -1
- package/styles/file-manager/tailwind.css +51 -1
- package/styles/file-manager/tailwind3.css +51 -0
- package/styles/fluent-dark-lite.css +51 -0
- package/styles/fluent-dark.css +51 -0
- package/styles/fluent-lite.css +51 -0
- package/styles/fluent.css +51 -0
- package/styles/fluent2-lite.css +51 -0
- package/styles/fluent2.css +51 -0
- package/styles/highcontrast-light-lite.css +51 -0
- package/styles/highcontrast-light.css +51 -0
- package/styles/highcontrast-lite.css +51 -0
- package/styles/highcontrast.css +51 -0
- package/styles/material-dark-lite.css +51 -0
- package/styles/material-dark.css +51 -0
- package/styles/material-lite.css +51 -0
- package/styles/material.css +51 -0
- package/styles/material3-dark-lite.css +51 -0
- package/styles/material3-dark.css +53 -2
- package/styles/material3-lite.css +51 -0
- package/styles/material3.css +53 -2
- package/styles/tailwind-dark-lite.css +51 -1
- package/styles/tailwind-dark.css +51 -1
- package/styles/tailwind-lite.css +51 -1
- package/styles/tailwind.css +51 -1
- package/styles/tailwind3-lite.css +51 -0
- package/styles/tailwind3.css +51 -0
package/dist/ts/index.ts
ADDED
package/package.json
CHANGED
@@ -1,25 +1,56 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"
|
7
|
-
"
|
8
|
-
"
|
9
|
-
|
2
|
+
"_from": "@syncfusion/ej2-filemanager@*",
|
3
|
+
"_id": "@syncfusion/ej2-filemanager@18.29.0",
|
4
|
+
"_inBundle": false,
|
5
|
+
"_integrity": "sha512-m+dTRx6v4/UxMRkeGpTrb+MkOh3/4GRzAeQzb3lNgJBKYqUPT2rntcsowQu6G040eYFLdwcpubRZzRcb4NttDg==",
|
6
|
+
"_location": "/@syncfusion/ej2-filemanager",
|
7
|
+
"_phantomChildren": {},
|
8
|
+
"_requested": {
|
9
|
+
"type": "range",
|
10
|
+
"registry": true,
|
11
|
+
"raw": "@syncfusion/ej2-filemanager@*",
|
12
|
+
"name": "@syncfusion/ej2-filemanager",
|
13
|
+
"escapedName": "@syncfusion%2fej2-filemanager",
|
14
|
+
"scope": "@syncfusion",
|
15
|
+
"rawSpec": "*",
|
16
|
+
"saveSpec": null,
|
17
|
+
"fetchSpec": "*"
|
18
|
+
},
|
19
|
+
"_requiredBy": [
|
20
|
+
"/",
|
21
|
+
"/@syncfusion/ej2-angular-filemanager",
|
22
|
+
"/@syncfusion/ej2-react-filemanager",
|
23
|
+
"/@syncfusion/ej2-richtexteditor",
|
24
|
+
"/@syncfusion/ej2-vue-filemanager"
|
25
|
+
],
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-development/@syncfusion/ej2-filemanager/-/ej2-filemanager-18.29.0.tgz",
|
27
|
+
"_shasum": "2d7974f000a566a7fa4ed02ab2a9083550b03515",
|
28
|
+
"_spec": "@syncfusion/ej2-filemanager@*",
|
29
|
+
"_where": "D:\\SF3992\\WFH\\Nexus\\ej2-nexus-branch-switching-dev\\release",
|
30
|
+
"author": {
|
31
|
+
"name": "Syncfusion Inc."
|
32
|
+
},
|
33
|
+
"bugs": {
|
34
|
+
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/issues"
|
35
|
+
},
|
36
|
+
"bundleDependencies": false,
|
10
37
|
"dependencies": {
|
11
|
-
"@syncfusion/ej2-base": "~
|
12
|
-
"@syncfusion/ej2-buttons": "~
|
13
|
-
"@syncfusion/ej2-data": "~
|
14
|
-
"@syncfusion/ej2-grids": "~
|
15
|
-
"@syncfusion/ej2-inputs": "~
|
16
|
-
"@syncfusion/ej2-layouts": "~
|
17
|
-
"@syncfusion/ej2-lists": "~
|
18
|
-
"@syncfusion/ej2-navigations": "~
|
19
|
-
"@syncfusion/ej2-popups": "~
|
20
|
-
"@syncfusion/ej2-splitbuttons": "~
|
38
|
+
"@syncfusion/ej2-base": "~30.1.37",
|
39
|
+
"@syncfusion/ej2-buttons": "~30.1.37",
|
40
|
+
"@syncfusion/ej2-data": "~30.1.37",
|
41
|
+
"@syncfusion/ej2-grids": "~30.1.37",
|
42
|
+
"@syncfusion/ej2-inputs": "~30.1.37",
|
43
|
+
"@syncfusion/ej2-layouts": "~30.1.37",
|
44
|
+
"@syncfusion/ej2-lists": "~30.1.37",
|
45
|
+
"@syncfusion/ej2-navigations": "~30.1.37",
|
46
|
+
"@syncfusion/ej2-popups": "~30.1.37",
|
47
|
+
"@syncfusion/ej2-splitbuttons": "~30.1.37"
|
21
48
|
},
|
49
|
+
"deprecated": false,
|
50
|
+
"description": "Essential JS 2 FileManager Component",
|
22
51
|
"devDependencies": {},
|
52
|
+
"es2015": "./dist/es6/ej2-filemanager.es5.js",
|
53
|
+
"homepage": "https://www.syncfusion.com/javascript-ui-controls",
|
23
54
|
"keywords": [
|
24
55
|
"ej2",
|
25
56
|
"syncfusion",
|
@@ -34,11 +65,15 @@
|
|
34
65
|
"file selector",
|
35
66
|
"directory viewer"
|
36
67
|
],
|
68
|
+
"license": "SEE LICENSE IN license",
|
69
|
+
"main": "./dist/ej2-filemanager.umd.min.js",
|
70
|
+
"module": "./index.js",
|
71
|
+
"name": "@syncfusion/ej2-filemanager",
|
37
72
|
"repository": {
|
38
73
|
"type": "git",
|
39
|
-
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
74
|
+
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
40
75
|
},
|
41
76
|
"typings": "index.d.ts",
|
42
|
-
"
|
43
|
-
"
|
77
|
+
"version": "30.1.37",
|
78
|
+
"sideEffects": false
|
44
79
|
}
|
@@ -328,6 +328,16 @@ export interface BeforeImageLoadEventArgs {
|
|
328
328
|
* Specifies the URL along with custom attributes to be sent to server.
|
329
329
|
*/
|
330
330
|
imageUrl?: string;
|
331
|
+
/**
|
332
|
+
* Returns the AJAX configuration details used when the `ajaxSettings` URL is specified.
|
333
|
+
*/
|
334
|
+
ajaxSettings?: Object;
|
335
|
+
/**
|
336
|
+
* Specifies whether the image source should be represented as a URL or a Blob object.
|
337
|
+
* Set this property to <c>false</c> to render the image source as a Blob (e.g., via `URL.createObjectURL(file)`), which is useful in scenarios.
|
338
|
+
* where the File Manager must authenticate requests to access the images.
|
339
|
+
*/
|
340
|
+
useImageAsUrl?: boolean;
|
331
341
|
}
|
332
342
|
/**
|
333
343
|
* Interface for folder create event arguments.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IFileManager } from '../base/interface';
|
1
|
+
import { IFileManager, ReadArgs } from '../base/interface';
|
2
2
|
/**
|
3
3
|
* Function to read the content from given path in File Manager.
|
4
4
|
*
|
@@ -103,3 +103,20 @@ export declare function Search(parent: IFileManager, event: string, path: string
|
|
103
103
|
* @private
|
104
104
|
*/
|
105
105
|
export declare function Download(parent: IFileManager, path: string, items: string[]): void;
|
106
|
+
/**
|
107
|
+
* Function for trigger Fetch success in File Manager.
|
108
|
+
*
|
109
|
+
* @param {IFileManager} parent - specifies the parent element.
|
110
|
+
* @param {Object} ajaxSettings - specifies the ajax settings.
|
111
|
+
* @returns {void}
|
112
|
+
*/
|
113
|
+
export declare function triggerFetchSuccess(parent: IFileManager, ajaxSettings: Object): void;
|
114
|
+
/**
|
115
|
+
* Function for trigger Fetch failure in File Manager.
|
116
|
+
*
|
117
|
+
* @param {IFileManager} parent - specifies the parent element.
|
118
|
+
* @param {Object} ajaxSettings - specifies the ajax settings.
|
119
|
+
* @param {ReadArgs} result - specifies the result.
|
120
|
+
* @returns {void}
|
121
|
+
*/
|
122
|
+
export declare function triggerFetchFailure(parent: IFileManager, ajaxSettings: Object, result: ReadArgs): void;
|
@@ -226,6 +226,11 @@ function createNewItem(data, target, itemName, isCopy) {
|
|
226
226
|
size: isCopy ? data.size : 0,
|
227
227
|
type: isCopy ? data.type : ''
|
228
228
|
});
|
229
|
+
if (!isNOU(target.filterId)) {
|
230
|
+
Object.assign(newItem, {
|
231
|
+
filterId: target.filterId + target.id + '/'
|
232
|
+
});
|
233
|
+
}
|
229
234
|
return newItem;
|
230
235
|
}
|
231
236
|
/**
|
@@ -467,6 +472,12 @@ function triggerMoveOrCopyOperation(parent, data, eventArgs) {
|
|
467
472
|
}
|
468
473
|
fileData.parentId = target_1.id;
|
469
474
|
fileData.filterPath = target_1.id === 0 ? '\\' : target_1.filterPath + target_1.name + '\\';
|
475
|
+
if (!isNOU(target_1.filterId)) {
|
476
|
+
fileData.filterId = target_1.filterId + target_1.id + '/';
|
477
|
+
}
|
478
|
+
if (!currItem.isFile) {
|
479
|
+
updateMovedItemChildren(parent, fileData);
|
480
|
+
}
|
470
481
|
}
|
471
482
|
else {
|
472
483
|
file_1.push(currItem.name);
|
@@ -786,6 +797,26 @@ function copyFolderItems(parent, data, target, itemName) {
|
|
786
797
|
copyFolderItems(parent, copiedItems[i], newObject, null);
|
787
798
|
}
|
788
799
|
}
|
800
|
+
/**
|
801
|
+
* Function to move operation.
|
802
|
+
*
|
803
|
+
* @param {IFileManager} parent - specifies the parent element.
|
804
|
+
* @param {Object} itemData - specifies the data.
|
805
|
+
* @returns {void}
|
806
|
+
* @private
|
807
|
+
*/
|
808
|
+
function updateMovedItemChildren(parent, itemData) {
|
809
|
+
var childItems = filterByParent(parent, itemData.id);
|
810
|
+
childItems.forEach(function (childItem) {
|
811
|
+
childItem.filterPath = itemData.filterPath + itemData.name + '\\';
|
812
|
+
if (!isNOU(itemData.filterId)) {
|
813
|
+
childItem.filterId = itemData.filterId + itemData.id + '/';
|
814
|
+
}
|
815
|
+
if (!childItem.isFile) {
|
816
|
+
updateMovedItemChildren(parent, childItem);
|
817
|
+
}
|
818
|
+
});
|
819
|
+
}
|
789
820
|
/**
|
790
821
|
* Function for trigger Ajax failure in File Manager.
|
791
822
|
*
|
@@ -1300,3 +1331,31 @@ function handleCatchError(parent, error, action) {
|
|
1300
1331
|
};
|
1301
1332
|
onFailure(parent, errorResult, action);
|
1302
1333
|
}
|
1334
|
+
/**
|
1335
|
+
* Function for trigger Fetch success in File Manager.
|
1336
|
+
*
|
1337
|
+
* @param {IFileManager} parent - specifies the parent element.
|
1338
|
+
* @param {Object} ajaxSettings - specifies the ajax settings.
|
1339
|
+
* @returns {void}
|
1340
|
+
*/
|
1341
|
+
export function triggerFetchSuccess(parent, ajaxSettings) {
|
1342
|
+
parent.notify(events.afterRequest, { action: 'success' });
|
1343
|
+
if (ajaxSettings && typeof getValue('onSuccess', ajaxSettings) === 'function') {
|
1344
|
+
getValue('onSuccess', ajaxSettings)();
|
1345
|
+
}
|
1346
|
+
}
|
1347
|
+
/**
|
1348
|
+
* Function for trigger Fetch failure in File Manager.
|
1349
|
+
*
|
1350
|
+
* @param {IFileManager} parent - specifies the parent element.
|
1351
|
+
* @param {Object} ajaxSettings - specifies the ajax settings.
|
1352
|
+
* @param {ReadArgs} result - specifies the result.
|
1353
|
+
* @returns {void}
|
1354
|
+
*/
|
1355
|
+
export function triggerFetchFailure(parent, ajaxSettings, result) {
|
1356
|
+
parent.notify(events.afterRequest, { action: 'failure' });
|
1357
|
+
createDialog(parent, 'Error', result);
|
1358
|
+
if (typeof getValue('onFailure', ajaxSettings) === 'function') {
|
1359
|
+
getValue('onFailure', ajaxSettings)();
|
1360
|
+
}
|
1361
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IFileManager, ReadArgs, SearchArgs } from '../base/interface';
|
1
|
+
import { IFileManager, ReadArgs, SearchArgs, BeforeImageLoadEventArgs } from '../base/interface';
|
2
2
|
import { Draggable } from '@syncfusion/ej2-base';
|
3
3
|
import { DragEventArgs } from '@syncfusion/ej2-base';
|
4
4
|
import { MenuEventArgs } from '@syncfusion/ej2-navigations';
|
@@ -202,10 +202,10 @@ export declare function fileType(file: Object): string;
|
|
202
202
|
*
|
203
203
|
* @param {IFileManager} parent - specifies the parent element.
|
204
204
|
* @param {Object} item - specifies the item.
|
205
|
-
* @returns {
|
205
|
+
* @returns {BeforeImageLoadEventArgs} - returns the eventargs.
|
206
206
|
* @private
|
207
207
|
*/
|
208
|
-
export declare function getImageUrl(parent: IFileManager, item: Object):
|
208
|
+
export declare function getImageUrl(parent: IFileManager, item: Object): BeforeImageLoadEventArgs;
|
209
209
|
/**
|
210
210
|
* Gets the full path
|
211
211
|
*
|
@@ -518,7 +518,7 @@ export function fileType(file) {
|
|
518
518
|
*
|
519
519
|
* @param {IFileManager} parent - specifies the parent element.
|
520
520
|
* @param {Object} item - specifies the item.
|
521
|
-
* @returns {
|
521
|
+
* @returns {BeforeImageLoadEventArgs} - returns the eventargs.
|
522
522
|
* @private
|
523
523
|
*/
|
524
524
|
export function getImageUrl(parent, item) {
|
@@ -526,10 +526,11 @@ export function getImageUrl(parent, item) {
|
|
526
526
|
if (isFileSystemData(parent)) {
|
527
527
|
var eventArgs_1 = {
|
528
528
|
fileDetails: [item],
|
529
|
-
imageUrl: imgUrl
|
529
|
+
imageUrl: imgUrl,
|
530
|
+
useImageAsUrl: true
|
530
531
|
};
|
531
532
|
parent.trigger('beforeImageLoad', eventArgs_1);
|
532
|
-
return eventArgs_1
|
533
|
+
return eventArgs_1;
|
533
534
|
}
|
534
535
|
var baseUrl = parent.ajaxSettings.getImageUrl ? parent.ajaxSettings.getImageUrl : parent.ajaxSettings.url;
|
535
536
|
var pathUrl = (baseUrl.indexOf('?') !== -1) ? '&path=' : '?path=';
|
@@ -546,12 +547,25 @@ export function getImageUrl(parent, item) {
|
|
546
547
|
imgUrl = baseUrl + pathUrl + parent.path + fileName;
|
547
548
|
}
|
548
549
|
imgUrl = imgUrl + '&time=' + (new Date().getTime()).toString();
|
550
|
+
var data = { 'action': 'getImage', 'path': parent.path + fileName, 'id': getValue('id', item) };
|
551
|
+
var ajaxSettings = {
|
552
|
+
url: baseUrl,
|
553
|
+
type: 'POST',
|
554
|
+
contentType: 'application/json',
|
555
|
+
responseType: 'blob',
|
556
|
+
data: JSON.stringify(data),
|
557
|
+
onSuccess: null,
|
558
|
+
onFailure: null,
|
559
|
+
beforeSend: null
|
560
|
+
};
|
549
561
|
var eventArgs = {
|
550
562
|
fileDetails: [item],
|
551
|
-
imageUrl: imgUrl
|
563
|
+
imageUrl: imgUrl,
|
564
|
+
useImageAsUrl: true,
|
565
|
+
ajaxSettings: ajaxSettings
|
552
566
|
};
|
553
567
|
parent.trigger('beforeImageLoad', eventArgs);
|
554
|
-
return eventArgs
|
568
|
+
return eventArgs;
|
555
569
|
}
|
556
570
|
/* istanbul ignore next */
|
557
571
|
/**
|
@@ -673,7 +687,7 @@ export function createEmptyElement(parent, element, args) {
|
|
673
687
|
}
|
674
688
|
else {
|
675
689
|
element.querySelector('.' + CLS.EMPTY_CONTENT).innerHTML = getLocaleText(parent, 'Folder-Empty');
|
676
|
-
element.querySelector('.' + CLS.EMPTY_INNER_CONTENT).innerHTML = getLocaleText(parent, 'File-Upload');
|
690
|
+
element.querySelector('.' + CLS.EMPTY_INNER_CONTENT).innerHTML = parent.uploadObj.dropArea == null ? getLocaleText(parent, '') : getLocaleText(parent, 'File-Upload');
|
677
691
|
}
|
678
692
|
}
|
679
693
|
var eDiv = select('.' + CLS.EMPTY, element);
|
@@ -435,7 +435,8 @@ var DetailsView = /** @class */ (function () {
|
|
435
435
|
if (this.parent.layoutSelectedItems.length) {
|
436
436
|
this.selectRecords(this.parent.layoutSelectedItems);
|
437
437
|
}
|
438
|
-
if (this.parent.renamedItem) {
|
438
|
+
if (this.parent.renamedItem && this.parent.selectedItems.length === 0) {
|
439
|
+
this.gridObj.clearSelection();
|
439
440
|
this.addSelection(this.parent.renamedItem);
|
440
441
|
this.parent.renamedItem = null;
|
441
442
|
}
|
@@ -685,8 +686,8 @@ var DetailsView = /** @class */ (function () {
|
|
685
686
|
if (getValue('isFile', data)) {
|
686
687
|
var icon = fileType(data);
|
687
688
|
if (icon === CLS.ICON_IMAGE) {
|
688
|
-
var
|
689
|
-
createImageDialog(_this.parent, name_2,
|
689
|
+
var imageData = getImageUrl(_this.parent, data);
|
690
|
+
createImageDialog(_this.parent, name_2, imageData);
|
690
691
|
}
|
691
692
|
}
|
692
693
|
else {
|
@@ -29,6 +29,8 @@ export declare class LargeIconsView {
|
|
29
29
|
private isPasteOperation;
|
30
30
|
private dragObj;
|
31
31
|
private isInteracted;
|
32
|
+
private imageEventArgsMap;
|
33
|
+
private imageUrlCache;
|
32
34
|
/**
|
33
35
|
* Constructor for the LargeIcons module.
|
34
36
|
*
|
@@ -37,6 +39,7 @@ export declare class LargeIconsView {
|
|
37
39
|
*/
|
38
40
|
constructor(parent?: IFileManager);
|
39
41
|
private render;
|
42
|
+
private loadImages;
|
40
43
|
private comparer;
|
41
44
|
private preventImgDrag;
|
42
45
|
private createDragObj;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ListBase } from '@syncfusion/ej2-lists';
|
2
|
-
import { createElement, select, selectAll, EventHandler, KeyboardEvents, closest, Draggable } from '@syncfusion/ej2-base';
|
2
|
+
import { createElement, select, selectAll, EventHandler, KeyboardEvents, closest, Draggable, Fetch } from '@syncfusion/ej2-base';
|
3
3
|
import { isNullOrUndefined as isNOU, addClass, removeClass, Touch, isVisible } from '@syncfusion/ej2-base';
|
4
4
|
import { getValue, setValue, remove } from '@syncfusion/ej2-base';
|
5
5
|
import { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';
|
@@ -7,12 +7,12 @@ import { hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
|
7
7
|
import * as events from '../base/constant';
|
8
8
|
import * as CLS from '../base/classes';
|
9
9
|
import { createCheckBox } from '@syncfusion/ej2-buttons';
|
10
|
-
import { read, GetDetails, Delete } from '../common/operations';
|
10
|
+
import { read, GetDetails, Delete, triggerFetchFailure, triggerFetchSuccess } from '../common/operations';
|
11
11
|
import { doRename, getAccessClass, getPathObject, getFullPath, getDirectoryPath, rename, doDownload, getItemName } from '../common/index';
|
12
12
|
import { removeBlur, cutFiles, copyFiles, addBlur, openSearchFolder, removeActive, pasteHandler } from '../common/index';
|
13
13
|
import { createVirtualDragElement, dragStopHandler, dragStartHandler, draggingHandler, getModule } from '../common/index';
|
14
14
|
import { updateRenamingData, doDeleteFiles, doDownloadFiles } from '../common/index';
|
15
|
-
import { openAction, fileType, refresh, getImageUrl, getSortedData, createDeniedDialog, updateLayout } from '../common/utility';
|
15
|
+
import { openAction, fileType, refresh, getImageUrl, getSortedData, createDeniedDialog, updateLayout, getLocaleText } from '../common/utility';
|
16
16
|
import { createEmptyElement, hasReadAccess, hasEditAccess } from '../common/utility';
|
17
17
|
import { createDialog, createImageDialog } from '../pop-up/dialog';
|
18
18
|
/**
|
@@ -34,6 +34,8 @@ var LargeIconsView = /** @class */ (function () {
|
|
34
34
|
this.isSelectAllCalled = false;
|
35
35
|
this.isPasteOperation = false;
|
36
36
|
this.isInteracted = true;
|
37
|
+
this.imageEventArgsMap = new Map();
|
38
|
+
this.imageUrlCache = new Map();
|
37
39
|
this.parent = parent;
|
38
40
|
this.element = select('#' + this.parent.element.id + CLS.LARGEICON_ID, this.parent.element);
|
39
41
|
addClass([this.element], CLS.LARGE_ICONS);
|
@@ -105,7 +107,7 @@ var LargeIconsView = /** @class */ (function () {
|
|
105
107
|
groupItemRole: 'group', wrapperRole: ''
|
106
108
|
},
|
107
109
|
showIcon: true,
|
108
|
-
fields: { text: 'name', iconCss: '_fm_icon', imageUrl: '_fm_imageUrl', htmlAttributes: '_fm_htmlAttr' },
|
110
|
+
fields: { text: 'name', iconCss: '_fm_icon', imageUrl: '_fm_imageUrl', imageAttributes: '_fm_imageAttr', htmlAttributes: '_fm_htmlAttr' },
|
109
111
|
sortOrder: this.parent.sortOrder,
|
110
112
|
itemCreated: this.onItemCreated.bind(this),
|
111
113
|
enableHtmlSanitizer: this.parent.enableHtmlSanitizer
|
@@ -125,6 +127,9 @@ var LargeIconsView = /** @class */ (function () {
|
|
125
127
|
this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
|
126
128
|
this.itemList = Array.prototype.slice.call(selectAll('.' + CLS.LIST_ITEM, this.listElements));
|
127
129
|
this.element.appendChild(this.listElements);
|
130
|
+
if (this.imageEventArgsMap.size > 0) {
|
131
|
+
this.loadImages();
|
132
|
+
}
|
128
133
|
this.listElements.setAttribute('aria-label', 'listbox');
|
129
134
|
this.preventImgDrag();
|
130
135
|
this.createDragObj();
|
@@ -172,6 +177,51 @@ var LargeIconsView = /** @class */ (function () {
|
|
172
177
|
}
|
173
178
|
}
|
174
179
|
};
|
180
|
+
LargeIconsView.prototype.loadImages = function () {
|
181
|
+
var _this = this;
|
182
|
+
var imageEle = this.parent.element.querySelectorAll('.e-list-img');
|
183
|
+
imageEle.forEach(function (imgElement) {
|
184
|
+
var imageKey = imgElement.getAttribute('data-image-key');
|
185
|
+
if (!imageKey) {
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
if (_this.imageUrlCache.has(imageKey)) {
|
189
|
+
imgElement.setAttribute('src', _this.imageUrlCache.get(imageKey));
|
190
|
+
imgElement.classList.remove('image-blur');
|
191
|
+
return;
|
192
|
+
}
|
193
|
+
var imageDetails = _this.imageEventArgsMap.get(imageKey);
|
194
|
+
if (!imageDetails) {
|
195
|
+
return;
|
196
|
+
}
|
197
|
+
var fetch = new Fetch({
|
198
|
+
url: getValue('url', imageDetails.ajaxSettings),
|
199
|
+
type: getValue('type', imageDetails.ajaxSettings),
|
200
|
+
contentType: getValue('contentType', imageDetails.ajaxSettings),
|
201
|
+
responseType: getValue('responseType', imageDetails.ajaxSettings),
|
202
|
+
beforeSend: getValue('beforeSend', imageDetails.ajaxSettings),
|
203
|
+
onSuccess: function (blob) {
|
204
|
+
var blobUrl = URL.createObjectURL(blob);
|
205
|
+
_this.imageUrlCache.set(imageKey, blobUrl);
|
206
|
+
imgElement.setAttribute('src', blobUrl);
|
207
|
+
imgElement.classList.remove('image-blur');
|
208
|
+
triggerFetchSuccess(_this.parent, imageDetails.ajaxSettings);
|
209
|
+
},
|
210
|
+
onFailure: function (response) {
|
211
|
+
var result = {
|
212
|
+
files: null,
|
213
|
+
error: {
|
214
|
+
code: response.status ? response.status.toString() : '404',
|
215
|
+
message: getLocaleText(_this.parent, 'Network-Error') + ' ' + getValue('url', imageDetails.ajaxSettings),
|
216
|
+
fileExists: null
|
217
|
+
}
|
218
|
+
};
|
219
|
+
triggerFetchFailure(_this.parent, imageDetails.ajaxSettings, result);
|
220
|
+
}
|
221
|
+
});
|
222
|
+
fetch.send(getValue('data', imageDetails.ajaxSettings));
|
223
|
+
});
|
224
|
+
};
|
175
225
|
LargeIconsView.prototype.comparer = function (x, y) {
|
176
226
|
if (this.parent.sortOrder === 'Descending') {
|
177
227
|
var z = x;
|
@@ -346,9 +396,17 @@ var LargeIconsView = /** @class */ (function () {
|
|
346
396
|
className += ' ' + getAccessClass(items[i]);
|
347
397
|
}
|
348
398
|
if (icon === CLS.ICON_IMAGE && this.parent.showThumbnail && hasReadAccess(items[i])) {
|
349
|
-
var
|
350
|
-
|
351
|
-
|
399
|
+
var imageData = getImageUrl(this.parent, items[i]);
|
400
|
+
if (imageData.useImageAsUrl) {
|
401
|
+
setValue('_fm_imageUrl', imageData.imageUrl, items[i]);
|
402
|
+
setValue('_fm_imageAttr', { alt: name_1 }, items[i]);
|
403
|
+
}
|
404
|
+
else {
|
405
|
+
var uniqueKey = "img_" + name_1 + "_" + i;
|
406
|
+
this.imageEventArgsMap.set(uniqueKey, imageData);
|
407
|
+
setValue('_fm_imageUrl', '', items[i]);
|
408
|
+
setValue('_fm_imageAttr', { alt: name_1, class: 'e-list-img image-blur', 'data-image-key': uniqueKey }, items[i]);
|
409
|
+
}
|
352
410
|
}
|
353
411
|
else {
|
354
412
|
setValue('_fm_icon', icon, items[i]);
|
@@ -894,8 +952,8 @@ var LargeIconsView = /** @class */ (function () {
|
|
894
952
|
else {
|
895
953
|
var icon = fileType(details_1);
|
896
954
|
if (icon === CLS.ICON_IMAGE) {
|
897
|
-
var
|
898
|
-
createImageDialog(_this.parent, text,
|
955
|
+
var imageData = getImageUrl(_this.parent, details_1);
|
956
|
+
createImageDialog(_this.parent, text, imageData);
|
899
957
|
}
|
900
958
|
}
|
901
959
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IFileManager, ReadArgs, FileDetails } from '../base/interface';
|
1
|
+
import { IFileManager, ReadArgs, FileDetails, BeforeImageLoadEventArgs } from '../base/interface';
|
2
2
|
import { SelectedEventArgs } from '@syncfusion/ej2-inputs';
|
3
3
|
/**
|
4
4
|
*
|
@@ -24,8 +24,8 @@ export declare function createExtDialog(parent: IFileManager, text: string, repl
|
|
24
24
|
*
|
25
25
|
* @param {IFileManager} parent - specifies the parent element.
|
26
26
|
* @param {string} header - specifies the header element.
|
27
|
-
* @param {
|
27
|
+
* @param {BeforeImageLoadEventArgs} imageData - specifies the image eventargs.
|
28
28
|
* @returns {void}
|
29
29
|
* @private
|
30
30
|
*/
|
31
|
-
export declare function createImageDialog(parent: IFileManager, header: string,
|
31
|
+
export declare function createImageDialog(parent: IFileManager, header: string, imageData: BeforeImageLoadEventArgs): void;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { Dialog } from '@syncfusion/ej2-popups';
|
2
|
-
import { select, isNullOrUndefined as isNOU, createElement, Internationalization } from '@syncfusion/ej2-base';
|
2
|
+
import { select, isNullOrUndefined as isNOU, createElement, Internationalization, Fetch } from '@syncfusion/ej2-base';
|
3
3
|
import { getValue, remove, selectAll } from '@syncfusion/ej2-base';
|
4
4
|
import { createFolder } from '../common/operations';
|
5
5
|
import * as CLS from '../base/classes';
|
6
6
|
import * as events from '../base/constant';
|
7
|
-
import { paste, rename } from '../common/operations';
|
7
|
+
import { paste, rename, triggerFetchFailure, triggerFetchSuccess } from '../common/operations';
|
8
8
|
import { getLocaleText, getDuplicateData, objectToString, getCssClass, getTargetPath } from '../common/utility';
|
9
9
|
import { Input } from '@syncfusion/ej2-inputs';
|
10
10
|
import { CheckBox } from '@syncfusion/ej2-buttons';
|
@@ -917,14 +917,42 @@ function getKeyCode(e) {
|
|
917
917
|
*
|
918
918
|
* @param {IFileManager} parent - specifies the parent element.
|
919
919
|
* @param {string} header - specifies the header element.
|
920
|
-
* @param {
|
920
|
+
* @param {BeforeImageLoadEventArgs} imageData - specifies the image eventargs.
|
921
921
|
* @returns {void}
|
922
922
|
* @private
|
923
923
|
*/
|
924
|
-
export function createImageDialog(parent, header,
|
924
|
+
export function createImageDialog(parent, header, imageData) {
|
925
925
|
var content = createElement('div', { className: 'e-image-wrap' });
|
926
|
-
|
927
|
-
|
926
|
+
if (imageData.useImageAsUrl) {
|
927
|
+
var image = createElement('img', { className: 'e-image', attrs: { src: imageData.imageUrl, alt: header } });
|
928
|
+
content.appendChild(image);
|
929
|
+
}
|
930
|
+
else {
|
931
|
+
var fetch_1 = new Fetch({
|
932
|
+
url: getValue('url', imageData.ajaxSettings),
|
933
|
+
type: getValue('type', imageData.ajaxSettings),
|
934
|
+
contentType: getValue('contentType', imageData.ajaxSettings),
|
935
|
+
responseType: getValue('responseType', imageData.ajaxSettings),
|
936
|
+
beforeSend: getValue('beforeSend', imageData.ajaxSettings),
|
937
|
+
onSuccess: function (e) {
|
938
|
+
var blobUrl = URL.createObjectURL(e);
|
939
|
+
var image = createElement('img', { className: 'e-image', attrs: { src: blobUrl, alt: header } });
|
940
|
+
content.appendChild(image);
|
941
|
+
triggerFetchSuccess(parent, imageData.ajaxSettings);
|
942
|
+
},
|
943
|
+
onFailure: function (e) {
|
944
|
+
var result = {
|
945
|
+
error: {
|
946
|
+
code: e.status.toString(),
|
947
|
+
message: getLocaleText(parent, 'Network-Error') + ' ' + getValue('url', imageData.ajaxSettings)
|
948
|
+
}
|
949
|
+
};
|
950
|
+
triggerFetchFailure(parent, imageData.ajaxSettings, result);
|
951
|
+
}
|
952
|
+
});
|
953
|
+
var data = getValue('data', imageData.ajaxSettings);
|
954
|
+
fetch_1.send(data);
|
955
|
+
}
|
928
956
|
if (isNOU(parent.viewerObj)) {
|
929
957
|
parent.viewerObj = new Dialog({
|
930
958
|
header: header,
|
package/styles/bds-lite.css
CHANGED
@@ -582,7 +582,6 @@ ejs-filemanager {
|
|
582
582
|
margin: 5px;
|
583
583
|
margin-right: 4px;
|
584
584
|
padding: 3px;
|
585
|
-
padding: 5px;
|
586
585
|
position: absolute;
|
587
586
|
z-index: 1;
|
588
587
|
}
|
@@ -841,6 +840,10 @@ ejs-filemanager {
|
|
841
840
|
position: relative;
|
842
841
|
vertical-align: bottom;
|
843
842
|
}
|
843
|
+
.e-filemanager .e-large-icons .image-blur {
|
844
|
+
-webkit-filter: blur(8px);
|
845
|
+
filter: blur(8px);
|
846
|
+
}
|
844
847
|
.e-filemanager .e-large-icons .e-list-text {
|
845
848
|
overflow: hidden;
|
846
849
|
text-overflow: ellipsis;
|
@@ -1126,6 +1129,53 @@ ejs-filemanager {
|
|
1126
1129
|
width: 100%;
|
1127
1130
|
}
|
1128
1131
|
|
1132
|
+
.e-filemanager-dialog {
|
1133
|
+
z-index: 1005;
|
1134
|
+
display: -webkit-box;
|
1135
|
+
display: -ms-flexbox;
|
1136
|
+
display: flex;
|
1137
|
+
position: absolute;
|
1138
|
+
}
|
1139
|
+
|
1140
|
+
.e-image-wrap-style {
|
1141
|
+
height: 100%;
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
.e-fe-popup.e-dialog td.e-permission-content {
|
1145
|
+
white-space: unset;
|
1146
|
+
}
|
1147
|
+
|
1148
|
+
.e-large-icon-visible {
|
1149
|
+
visibility: visible;
|
1150
|
+
}
|
1151
|
+
|
1152
|
+
.e-large-icon-hidden {
|
1153
|
+
visibility: hidden;
|
1154
|
+
}
|
1155
|
+
|
1156
|
+
.e-fm-view-container {
|
1157
|
+
display: -webkit-box;
|
1158
|
+
display: -ms-flexbox;
|
1159
|
+
display: flex;
|
1160
|
+
width: 100%;
|
1161
|
+
-webkit-box-orient: vertical;
|
1162
|
+
-webkit-box-direction: normal;
|
1163
|
+
-ms-flex-direction: column;
|
1164
|
+
flex-direction: column;
|
1165
|
+
height: 100%;
|
1166
|
+
}
|
1167
|
+
|
1168
|
+
.e-filemanager .e-empty-state-container {
|
1169
|
+
display: -webkit-box;
|
1170
|
+
display: -ms-flexbox;
|
1171
|
+
display: flex;
|
1172
|
+
height: 100%;
|
1173
|
+
}
|
1174
|
+
|
1175
|
+
.e-filemanager .e-empty.e-view-container {
|
1176
|
+
margin: auto;
|
1177
|
+
}
|
1178
|
+
|
1129
1179
|
.e-filemanager {
|
1130
1180
|
background: transparent;
|
1131
1181
|
border-color: var(--color-sf-border-secondary);
|