@syncfusion/ej2-filemanager 25.2.3 → 26.1.35
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 +3 -2
- 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 +931 -464
- package/dist/es6/ej2-filemanager.es2015.js.map +1 -1
- package/dist/es6/ej2-filemanager.es5.js +975 -517
- 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 +16 -16
- package/src/file-manager/actions/breadcrumb-bar.js +0 -4
- package/src/file-manager/actions/toolbar.js +1 -13
- package/src/file-manager/actions/virtualization.d.ts +28 -8
- package/src/file-manager/actions/virtualization.js +36 -12
- package/src/file-manager/base/file-manager-model.d.ts +107 -36
- package/src/file-manager/base/file-manager.d.ts +100 -25
- package/src/file-manager/base/file-manager.js +46 -20
- package/src/file-manager/base/interface.d.ts +224 -2
- package/src/file-manager/base/interface.js +0 -1
- package/src/file-manager/common/operations.d.ts +7 -0
- package/src/file-manager/common/operations.js +596 -94
- package/src/file-manager/common/utility.d.ts +22 -0
- package/src/file-manager/common/utility.js +117 -65
- package/src/file-manager/layout/details-view.d.ts +1 -1
- package/src/file-manager/layout/details-view.js +23 -68
- package/src/file-manager/layout/large-icons-view.js +24 -46
- package/src/file-manager/layout/navigation-pane.js +18 -41
- package/src/file-manager/models/column-model.d.ts +1 -3
- package/src/file-manager/models/default-locale.js +0 -1
- package/src/file-manager/models/details-view-settings.js +2 -1
- package/src/file-manager/pop-up/context-menu.js +26 -27
- package/src/file-manager/pop-up/dialog.d.ts +1 -2
- package/src/file-manager/pop-up/dialog.js +12 -35
- package/styles/bootstrap-dark.css +116 -105
- package/styles/bootstrap-dark.scss +16 -1
- package/styles/bootstrap.css +117 -106
- package/styles/bootstrap.scss +16 -1
- package/styles/bootstrap4.css +116 -105
- package/styles/bootstrap4.scss +16 -1
- package/styles/bootstrap5-dark.css +98 -98
- package/styles/bootstrap5-dark.scss +16 -1
- package/styles/bootstrap5.css +98 -98
- package/styles/bootstrap5.scss +16 -1
- package/styles/fabric-dark.css +116 -105
- package/styles/fabric-dark.scss +16 -1
- package/styles/fabric.css +116 -105
- package/styles/fabric.scss +16 -1
- package/styles/file-manager/_bds-definition.scss +1 -1
- package/styles/file-manager/_bootstrap5-definition.scss +2 -1
- package/styles/file-manager/_bootstrap5.3-definition.scss +240 -0
- package/styles/file-manager/_fluent-definition.scss +1 -1
- package/styles/file-manager/_fluent2-definition.scss +249 -0
- package/styles/file-manager/_layout.scss +255 -396
- package/styles/file-manager/_material-dark-definition.scss +1 -0
- package/styles/file-manager/_material-definition.scss +1 -0
- package/styles/file-manager/_material3-definition.scss +1 -27
- package/styles/file-manager/_tailwind-definition.scss +1 -1
- package/styles/file-manager/_theme.scss +37 -85
- package/styles/file-manager/bootstrap-dark.css +116 -105
- package/styles/file-manager/bootstrap.css +117 -106
- package/styles/file-manager/bootstrap4.css +116 -105
- package/styles/file-manager/bootstrap5-dark.css +98 -98
- package/styles/file-manager/bootstrap5.css +98 -98
- package/styles/file-manager/fabric-dark.css +116 -105
- package/styles/file-manager/fabric.css +116 -105
- package/styles/file-manager/fluent-dark.css +107 -102
- package/styles/file-manager/fluent.css +107 -102
- package/styles/file-manager/fluent2.css +2872 -0
- package/styles/file-manager/fluent2.scss +16 -0
- package/styles/file-manager/highcontrast-light.css +116 -105
- package/styles/file-manager/highcontrast.css +116 -105
- package/styles/file-manager/icons/_bootstrap5.3.scss +235 -0
- package/styles/file-manager/icons/_fluent2.scss +235 -0
- package/styles/file-manager/material-dark.css +140 -108
- package/styles/file-manager/material.css +156 -112
- package/styles/file-manager/material3-dark.css +134 -109
- package/styles/file-manager/material3.css +134 -109
- package/styles/file-manager/tailwind-dark.css +93 -95
- package/styles/file-manager/tailwind.css +93 -95
- package/styles/fluent-dark.css +107 -102
- package/styles/fluent-dark.scss +16 -1
- package/styles/fluent.css +107 -102
- package/styles/fluent.scss +16 -1
- package/styles/fluent2.css +2872 -0
- package/styles/fluent2.scss +16 -0
- package/styles/highcontrast-light.css +116 -105
- package/styles/highcontrast-light.scss +16 -1
- package/styles/highcontrast.css +116 -105
- package/styles/highcontrast.scss +16 -1
- package/styles/material-dark.css +140 -108
- package/styles/material-dark.scss +16 -1
- package/styles/material.css +156 -112
- package/styles/material.scss +16 -1
- package/styles/material3-dark.css +134 -109
- package/styles/material3-dark.scss +16 -1
- package/styles/material3.css +134 -109
- package/styles/material3.scss +16 -1
- package/styles/tailwind-dark.css +93 -95
- package/styles/tailwind-dark.scss +16 -1
- package/styles/tailwind.css +93 -95
- package/styles/tailwind.scss +16 -1
- package/CHANGELOG.md +0 -467
@@ -1,13 +1,13 @@
|
|
1
|
-
import {
|
1
|
+
import { Property, ChildProperty, initializeCSPTemplate, getValue, isNullOrUndefined, matches, select, closest, createElement, setValue, detach, extend, Ajax, Internationalization, Fetch, remove, selectAll, Draggable, KeyboardEvents, EventHandler, Touch, addClass, removeClass, isVisible, getUniqueID, setStyleAttribute, formatUnit, Browser, L10n, Complex, Collection, Event, NotifyPropertyChanges, Component, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
|
2
2
|
import { Splitter } from '@syncfusion/ej2-layouts';
|
3
|
-
import { Dialog,
|
4
|
-
import { DataManager,
|
3
|
+
import { Dialog, showSpinner, hideSpinner, createSpinner } from '@syncfusion/ej2-popups';
|
4
|
+
import { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';
|
5
|
+
import { getUid, Grid, Resize, ContextMenu as ContextMenu$2, Sort, VirtualScroll } from '@syncfusion/ej2-grids';
|
5
6
|
import { Input, TextBox, Uploader } from '@syncfusion/ej2-inputs';
|
6
7
|
import { CheckBox, createCheckBox } from '@syncfusion/ej2-buttons';
|
7
8
|
import { ListBase } from '@syncfusion/ej2-lists';
|
8
9
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
9
|
-
import { ContextMenu, Toolbar, TreeView } from '@syncfusion/ej2-navigations';
|
10
|
-
import { ContextMenu as ContextMenu$1, Grid, Resize, Sort, VirtualScroll } from '@syncfusion/ej2-grids';
|
10
|
+
import { ContextMenu as ContextMenu$1, Toolbar as Toolbar$1, TreeView } from '@syncfusion/ej2-navigations';
|
11
11
|
|
12
12
|
var __extends = (undefined && undefined.__extends) || (function () {
|
13
13
|
var extendStatics = function (d, b) {
|
@@ -217,7 +217,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
|
|
217
217
|
var columnArray = [
|
218
218
|
{
|
219
219
|
field: 'name', headerText: 'Name', minWidth: 120,
|
220
|
-
template: '<span class
|
220
|
+
template: '<span class="e-fe-text">${name}</span>',
|
221
221
|
customAttributes: { class: 'e-fe-grid-name' }
|
222
222
|
},
|
223
223
|
{
|
@@ -226,6 +226,7 @@ var columnArray = [
|
|
226
226
|
},
|
227
227
|
{
|
228
228
|
field: 'size', headerText: 'Size', minWidth: 90, width: '110',
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
229
230
|
template: initializeCSPTemplate(function (data) {
|
230
231
|
return "<span class=\"e-fe-size\">" + data.size + "</span>";
|
231
232
|
}), format: 'n2'
|
@@ -470,10 +471,6 @@ var Column = /** @__PURE__ @class */ (function (_super) {
|
|
470
471
|
return Column;
|
471
472
|
}(ChildProperty));
|
472
473
|
|
473
|
-
/**
|
474
|
-
* FileExplorer common modules
|
475
|
-
*/
|
476
|
-
|
477
474
|
/**
|
478
475
|
* Specifies the File Manager internal ID's
|
479
476
|
*/
|
@@ -849,22 +846,27 @@ function sortComparer(reference, comparer) {
|
|
849
846
|
var referenceIsFile = /\.\S+/.test(reference);
|
850
847
|
var comparerIsFile = /\.\S+/.test(comparer);
|
851
848
|
// If one is a file and the other is a folder, the folder should come first
|
852
|
-
if (referenceIsFile && !comparerIsFile)
|
849
|
+
if (referenceIsFile && !comparerIsFile) {
|
853
850
|
return 1;
|
854
|
-
|
851
|
+
}
|
852
|
+
if (!referenceIsFile && comparerIsFile) {
|
855
853
|
return -1;
|
854
|
+
}
|
856
855
|
var referenceParts = [];
|
857
856
|
var comparerParts = [];
|
858
|
-
(reference + '').replace(/(\d+)|(\D+)/g, function (_, $1, $2) { referenceParts.push([$1 || Infinity, $2 ||
|
859
|
-
(comparer + '').replace(/(\d+)|(\D+)/g, function (_, $1, $2) { comparerParts.push([$1 || Infinity, $2 ||
|
857
|
+
(reference + '').replace(/(\d+)|(\D+)/g, function (_, $1, $2) { referenceParts.push([$1 || Infinity, $2 || '']); return ''; });
|
858
|
+
(comparer + '').replace(/(\d+)|(\D+)/g, function (_, $1, $2) { comparerParts.push([$1 || Infinity, $2 || '']); return ''; });
|
860
859
|
// Compare each part of reference and comparer
|
861
860
|
while (referenceParts.length && comparerParts.length) {
|
862
861
|
var referencePart = referenceParts.shift();
|
863
862
|
var comparerPart = comparerParts.shift();
|
864
|
-
|
865
|
-
referencePart[
|
866
|
-
|
867
|
-
|
863
|
+
if (referencePart && comparerPart) {
|
864
|
+
var comparisonResult = referencePart[0] - comparerPart[0] ||
|
865
|
+
referencePart[1].localeCompare(comparerPart[1]);
|
866
|
+
if (comparisonResult) {
|
867
|
+
return comparisonResult;
|
868
|
+
}
|
869
|
+
}
|
868
870
|
}
|
869
871
|
return referenceParts.length - comparerParts.length;
|
870
872
|
}
|
@@ -877,7 +879,6 @@ function sortComparer(reference, comparer) {
|
|
877
879
|
* @returns {void}
|
878
880
|
* @private
|
879
881
|
*/
|
880
|
-
// eslint-disable-next-line
|
881
882
|
function updatePath(node, data, instance) {
|
882
883
|
var text = getValue('name', data);
|
883
884
|
var id = node.getAttribute('data-id');
|
@@ -973,8 +974,7 @@ function generatePath(parent) {
|
|
973
974
|
var newPath = '/';
|
974
975
|
var i = 1;
|
975
976
|
for (i; i < parent.pathId.length; i++) {
|
976
|
-
|
977
|
-
var data = getValue(parent.pathId[i], parent.feParent);
|
977
|
+
var data = getValue(parent.pathId[parseInt(i.toString(), 10)], parent.feParent);
|
978
978
|
newPath += getValue(key, data) + '/';
|
979
979
|
}
|
980
980
|
parent.setProperties({ path: newPath }, true);
|
@@ -1112,6 +1112,22 @@ function searchWordHandler(parent, value, isLayoutChange) {
|
|
1112
1112
|
if (value.length === 0 && !parent.isFiltered) {
|
1113
1113
|
parent.notify(pathColumn, { args: parent });
|
1114
1114
|
}
|
1115
|
+
if (isFileSystemData(parent)) {
|
1116
|
+
if (value === '') {
|
1117
|
+
parent.itemData = parent.fileSystemData;
|
1118
|
+
read(parent, layoutChange, parent.path);
|
1119
|
+
}
|
1120
|
+
else {
|
1121
|
+
parent.searchSettings.filterType = isNullOrUndefined(parent.searchSettings.filterType) ? 'contains' : parent.searchSettings.filterType;
|
1122
|
+
var filteredData = parent.fileSystemData.filter(function (obj) { return obj.parentId !== null; });
|
1123
|
+
var data = new DataManager(filteredData).
|
1124
|
+
executeLocal(new Query().where('name', parent.searchSettings.filterType, value, parent.searchSettings.ignoreCase));
|
1125
|
+
var searchValue = parent.searchSettings.ignoreCase ? value.toLowerCase() : value;
|
1126
|
+
parent.itemData = data;
|
1127
|
+
Search(parent, isLayoutChange ? layoutChange : search, parent.path, searchValue, parent.showHiddenItems, !parent.searchSettings.ignoreCase);
|
1128
|
+
}
|
1129
|
+
return;
|
1130
|
+
}
|
1115
1131
|
if (parent.searchSettings.filterType === 'startsWith') {
|
1116
1132
|
searchWord = value + '*';
|
1117
1133
|
}
|
@@ -1229,7 +1245,6 @@ function openAction(parent) {
|
|
1229
1245
|
* @returns {Object} - returns the path data.
|
1230
1246
|
* @private
|
1231
1247
|
*/
|
1232
|
-
// eslint-disable-next-line
|
1233
1248
|
function getPathObject(parent) {
|
1234
1249
|
return getValue(parent.pathId[parent.pathId.length - 1], parent.feParent);
|
1235
1250
|
}
|
@@ -1271,10 +1286,9 @@ function cutFiles(parent) {
|
|
1271
1286
|
* @returns {string} - returns the file type.
|
1272
1287
|
* @private
|
1273
1288
|
*/
|
1274
|
-
// eslint-disable-next-line
|
1275
1289
|
function fileType(file) {
|
1276
|
-
var isFile
|
1277
|
-
if (!isFile
|
1290
|
+
var isFile = getValue('isFile', file);
|
1291
|
+
if (!isFile) {
|
1278
1292
|
return FOLDER;
|
1279
1293
|
}
|
1280
1294
|
var imageFormat = ['bmp', 'dib', 'jpg', 'jpeg', 'jpe', 'jfif', 'gif', 'tif', 'tiff', 'png', 'ico'];
|
@@ -1314,11 +1328,18 @@ function fileType(file) {
|
|
1314
1328
|
* @returns {string} - returns the image url.
|
1315
1329
|
* @private
|
1316
1330
|
*/
|
1317
|
-
// eslint-disable-next-line
|
1318
1331
|
function getImageUrl(parent, item) {
|
1332
|
+
var imgUrl = isFileSystemData(parent) ? getValue('imageUrl', item) : '';
|
1333
|
+
if (isFileSystemData(parent)) {
|
1334
|
+
var eventArgs_1 = {
|
1335
|
+
fileDetails: [item],
|
1336
|
+
imageUrl: imgUrl
|
1337
|
+
};
|
1338
|
+
parent.trigger('beforeImageLoad', eventArgs_1);
|
1339
|
+
return eventArgs_1.imageUrl;
|
1340
|
+
}
|
1319
1341
|
var baseUrl = parent.ajaxSettings.getImageUrl ? parent.ajaxSettings.getImageUrl : parent.ajaxSettings.url;
|
1320
1342
|
var pathUrl = (baseUrl.indexOf('?') !== -1) ? '&path=' : '?path=';
|
1321
|
-
var imgUrl;
|
1322
1343
|
var fileName = encodeURIComponent(getValue('name', item));
|
1323
1344
|
var fPath = getValue('filterPath', item);
|
1324
1345
|
if (parent.hasId) {
|
@@ -1349,7 +1370,6 @@ function getImageUrl(parent, item) {
|
|
1349
1370
|
* @returns {string} - returns the image url.
|
1350
1371
|
* @private
|
1351
1372
|
*/
|
1352
|
-
// eslint-disable-next-line
|
1353
1373
|
function getFullPath(parent, data, path) {
|
1354
1374
|
var filePath = getValue(parent.hasId ? 'id' : 'name', data) + '/';
|
1355
1375
|
var fPath = getValue(parent.hasId ? 'filterId' : 'filterPath', data);
|
@@ -1368,7 +1388,6 @@ function getFullPath(parent, data, path) {
|
|
1368
1388
|
* @returns {string} - returns the name.
|
1369
1389
|
* @private
|
1370
1390
|
*/
|
1371
|
-
// eslint-disable-next-line
|
1372
1391
|
function getName(parent, data) {
|
1373
1392
|
var name = getValue('name', data);
|
1374
1393
|
var fPath = getValue('filterPath', data);
|
@@ -1386,19 +1405,17 @@ function getName(parent, data) {
|
|
1386
1405
|
* @returns {Object[]} - returns the sorted data.
|
1387
1406
|
* @private
|
1388
1407
|
*/
|
1389
|
-
// eslint-disable-next-line
|
1390
1408
|
function getSortedData(parent, items) {
|
1391
1409
|
if (items.length === 0) {
|
1392
1410
|
return items;
|
1393
1411
|
}
|
1394
1412
|
var query;
|
1395
|
-
if (parent.sortOrder !== 'None') {
|
1413
|
+
if (parent.sortOrder !== 'None' && !isNullOrUndefined(parent.sortOrder)) {
|
1396
1414
|
query = new Query().sortBy(parent.sortBy, parent.sortOrder.toLowerCase(), true).group('isFile');
|
1397
1415
|
}
|
1398
1416
|
else {
|
1399
1417
|
query = new Query().group('isFile');
|
1400
1418
|
}
|
1401
|
-
// eslint-disable-next-line
|
1402
1419
|
var lists = new DataManager(items).executeLocal(query);
|
1403
1420
|
return getValue('records', lists);
|
1404
1421
|
}
|
@@ -1411,12 +1428,9 @@ function getSortedData(parent, items) {
|
|
1411
1428
|
* @returns {Object} - returns the sorted data.
|
1412
1429
|
* @private
|
1413
1430
|
*/
|
1414
|
-
// eslint-disable-next-line
|
1415
1431
|
function getObject(parent, key, value) {
|
1416
|
-
// eslint-disable-next-line
|
1417
1432
|
var currFiles = getValue(parent.pathId[parent.pathId.length - 1], parent.feFiles);
|
1418
1433
|
var query = new Query().where(key, 'equal', value);
|
1419
|
-
// eslint-disable-next-line
|
1420
1434
|
var lists = new DataManager(currFiles).executeLocal(query);
|
1421
1435
|
return lists[0];
|
1422
1436
|
}
|
@@ -1481,7 +1495,6 @@ function createEmptyElement(parent, element, args) {
|
|
1481
1495
|
* @returns {Object[]} - returns the sorted data.
|
1482
1496
|
* @private
|
1483
1497
|
*/
|
1484
|
-
// eslint-disable-next-line
|
1485
1498
|
function getDirectories(files) {
|
1486
1499
|
return new DataManager(files).executeLocal(new Query().where(isFile, 'equal', false, false));
|
1487
1500
|
}
|
@@ -1494,7 +1507,6 @@ function getDirectories(files) {
|
|
1494
1507
|
* @private
|
1495
1508
|
*/
|
1496
1509
|
function setNodeId(result, rootId) {
|
1497
|
-
// eslint-disable-next-line
|
1498
1510
|
var dirs = getDirectories(result.files);
|
1499
1511
|
for (var i = 0, len = dirs.length; i < len; i++) {
|
1500
1512
|
setValue('_fm_id', rootId + '_' + i, dirs[i]);
|
@@ -1504,16 +1516,17 @@ function setNodeId(result, rootId) {
|
|
1504
1516
|
* set the date object
|
1505
1517
|
*
|
1506
1518
|
* @param {Object[]} args - specifies the file object.
|
1519
|
+
* @param {Internationalization} localeString - The internationalization object for formatting dates.
|
1520
|
+
* @param {string} dateFormat - The date format string.
|
1507
1521
|
* @returns {void}
|
1508
1522
|
* @private
|
1509
1523
|
*/
|
1510
|
-
// eslint-disable-next-line
|
1511
1524
|
function setDateObject(args, localeString, dateFormat) {
|
1512
1525
|
for (var i = 0; i < args.length; i++) {
|
1513
1526
|
var createdDate = new Date(getValue('dateCreated', args[i]));
|
1514
1527
|
var modifiedDate = new Date(getValue('dateModified', args[i]));
|
1515
1528
|
if (isNullOrUndefined(dateFormat)) {
|
1516
|
-
dateFormat =
|
1529
|
+
dateFormat = 'MM/dd/yyyy';
|
1517
1530
|
}
|
1518
1531
|
setValue('_fm_created', localeString.formatDate(createdDate, { format: dateFormat }), args[i]);
|
1519
1532
|
setValue('_fm_modified', localeString.formatDate(modifiedDate, { format: dateFormat }), args[i]);
|
@@ -1586,6 +1599,7 @@ function sortbyClickHandler(parent, args) {
|
|
1586
1599
|
* Gets the sorted fields
|
1587
1600
|
*
|
1588
1601
|
* @param {string} id - specifies the id.
|
1602
|
+
* @param {IFileManager} [parent] - optional parameter representing the parent IFileManager.
|
1589
1603
|
* @returns {string} - returns the sorted fields
|
1590
1604
|
* @private
|
1591
1605
|
*/
|
@@ -1631,14 +1645,12 @@ function getSortField(id, parent) {
|
|
1631
1645
|
function setNextPath(parent, path) {
|
1632
1646
|
var currfolders = path.split('/');
|
1633
1647
|
var folders = parent.originalPath.split('/');
|
1634
|
-
// eslint-disable-next-line
|
1635
1648
|
var root = getValue(parent.pathId[0], parent.feParent);
|
1636
1649
|
var key = isNullOrUndefined(getValue('id', root)) ? 'name' : 'id';
|
1637
1650
|
for (var i = currfolders.length - 1, len = folders.length - 1; i < len; i++) {
|
1638
1651
|
var eventName = (folders[i + 1] === '') ? finalizeEnd : initialEnd;
|
1639
1652
|
var newPath = (folders[i] === '') ? '/' : (parent.path + folders[i] + '/');
|
1640
|
-
|
1641
|
-
var data = getObject(parent, key, folders[i]);
|
1653
|
+
var data = getObject(parent, key, folders[parseInt(i.toString(), 10)]);
|
1642
1654
|
if (!isNullOrUndefined(data)) {
|
1643
1655
|
var id = getValue('_fm_id', data);
|
1644
1656
|
parent.setProperties({ path: newPath }, true);
|
@@ -1661,13 +1673,12 @@ function setNextPath(parent, path) {
|
|
1661
1673
|
* @returns {void}
|
1662
1674
|
* @private
|
1663
1675
|
*/
|
1664
|
-
// eslint-disable-next-line
|
1665
1676
|
function openSearchFolder(parent, data) {
|
1666
1677
|
parent.originalPath = getFullPath(parent, data, parent.path);
|
1667
1678
|
var root = getValue(parent.pathId[0], parent.feParent);
|
1668
|
-
var isRoot = getValue('_fm_id', parent.itemData[0])
|
1679
|
+
var isRoot = getValue('_fm_id', parent.itemData[0]) === 'fe_tree';
|
1669
1680
|
var key = isNullOrUndefined(getValue('id', root)) ? 'name' : 'id';
|
1670
|
-
var searchData = getObject(parent, key, getValue('name', data));
|
1681
|
+
var searchData = getObject(parent, key, isFileSystemData(parent) ? getValue('id', data) : getValue('name', data));
|
1671
1682
|
if (isNullOrUndefined(searchData)) {
|
1672
1683
|
if (!isRoot) {
|
1673
1684
|
parent.notify(clearPathInit, { selectedNode: parent.pathId[parent.pathId.length - 1] });
|
@@ -1697,7 +1708,6 @@ function pasteHandler(parent) {
|
|
1697
1708
|
parent.isDragDrop = false;
|
1698
1709
|
if (parent.selectedNodes.length !== 0 && parent.enablePaste) {
|
1699
1710
|
var path = (parent.folderPath === '') ? parent.path : parent.folderPath;
|
1700
|
-
// eslint-disable-next-line
|
1701
1711
|
var subFolder = validateSubFolder(parent, parent.actionRecords, path, parent.path);
|
1702
1712
|
if (!subFolder) {
|
1703
1713
|
if ((parent.fileAction === 'move' && parent.targetPath !== path) || parent.fileAction === 'copy') {
|
@@ -1731,13 +1741,12 @@ function pasteHandler(parent) {
|
|
1731
1741
|
* @returns {boolean} - returns the validated sub folder.
|
1732
1742
|
* @private
|
1733
1743
|
*/
|
1734
|
-
|
1735
|
-
function validateSubFolder(parent, data, dropPath$$1, dragPath) {
|
1744
|
+
function validateSubFolder(parent, data, dropPath, dragPath) {
|
1736
1745
|
var subFolder = false;
|
1737
1746
|
for (var i = 0; i < data.length; i++) {
|
1738
1747
|
if (!getValue('isFile', data[i])) {
|
1739
1748
|
var tempTarget = getFullPath(parent, data[i], dragPath);
|
1740
|
-
if (dropPath
|
1749
|
+
if (dropPath.indexOf(tempTarget) === 0) {
|
1741
1750
|
var result = {
|
1742
1751
|
files: null,
|
1743
1752
|
error: {
|
@@ -1752,7 +1761,8 @@ function validateSubFolder(parent, data, dropPath$$1, dragPath) {
|
|
1752
1761
|
}
|
1753
1762
|
}
|
1754
1763
|
else {
|
1755
|
-
var
|
1764
|
+
var name_1 = parent.dragData[i] ? parent.dragData[i].name : null;
|
1765
|
+
var srcData = isFileSystemData(parent) ? name_1 : parent.dragNodes[i];
|
1756
1766
|
var len = 0;
|
1757
1767
|
if (srcData) {
|
1758
1768
|
len = srcData.lastIndexOf('/');
|
@@ -1761,7 +1771,7 @@ function validateSubFolder(parent, data, dropPath$$1, dragPath) {
|
|
1761
1771
|
if (len > 0) {
|
1762
1772
|
path = dragPath + srcData.substring(0, len + 1);
|
1763
1773
|
}
|
1764
|
-
if (path === dropPath
|
1774
|
+
if (path === dropPath) {
|
1765
1775
|
var result = {
|
1766
1776
|
files: null,
|
1767
1777
|
error: {
|
@@ -1823,15 +1833,15 @@ function getParentPath(oldPath) {
|
|
1823
1833
|
*/
|
1824
1834
|
function getDirectoryPath(parent, args) {
|
1825
1835
|
var filePath = getValue(parent.hasId ? 'id' : 'name', args.cwd) + '/';
|
1826
|
-
var fPath = getValue(parent.hasId ? 'filterId' : 'filterPath', args.cwd);
|
1836
|
+
var fPath = getValue(parent.hasId && !isNullOrUndefined(parent.ajaxSettings.url) ? 'filterId' : 'filterPath', args.cwd);
|
1827
1837
|
if (!isNullOrUndefined(fPath)) {
|
1828
1838
|
if (fPath === '') {
|
1829
|
-
return parent.hasId ? filePath : '/';
|
1839
|
+
return parent.hasId && !isNullOrUndefined(parent.ajaxSettings.url) ? filePath : '/';
|
1830
1840
|
}
|
1831
1841
|
return fPath.replace(/\\/g, '/') + filePath;
|
1832
1842
|
}
|
1833
1843
|
else {
|
1834
|
-
return parent.path + filePath;
|
1844
|
+
return isFileSystemData(parent) ? filePath : parent.path + filePath;
|
1835
1845
|
}
|
1836
1846
|
}
|
1837
1847
|
/**
|
@@ -1901,7 +1911,7 @@ function readDropPath(parent) {
|
|
1901
1911
|
var node = select('[data-uid="' + pathId + '"]', parent.navigationpaneModule.treeObj.element);
|
1902
1912
|
if (!node) {
|
1903
1913
|
var liElement = document.querySelector('[data-id = "' + getValue('id', parent.dropData) + '"]');
|
1904
|
-
pathId = liElement.getAttribute(
|
1914
|
+
pathId = liElement.getAttribute('data-uid');
|
1905
1915
|
node = select('[data-uid="' + pathId + '"]', parent.navigationpaneModule.treeObj.element);
|
1906
1916
|
}
|
1907
1917
|
updatePath(node, parent.dropData, parent);
|
@@ -1917,11 +1927,8 @@ function readDropPath(parent) {
|
|
1917
1927
|
* @returns {object} - returns the duplicated path.
|
1918
1928
|
* @private
|
1919
1929
|
*/
|
1920
|
-
// eslint-disable-next-line
|
1921
1930
|
function getDuplicateData(parent, name) {
|
1922
|
-
// eslint-disable-next-line
|
1923
1931
|
var data = null;
|
1924
|
-
// eslint-disable-next-line
|
1925
1932
|
var records = parent.isDragDrop ? parent.dragData : parent.actionRecords;
|
1926
1933
|
for (var i = 0; i < records.length; i++) {
|
1927
1934
|
if (getValue('name', records[i]) === name) {
|
@@ -2115,7 +2122,7 @@ function removeItemClass(parent, value) {
|
|
2115
2122
|
function scrollHandler(scrollParent, parent, nodeClass, screenY, clientY) {
|
2116
2123
|
var position;
|
2117
2124
|
var elementData = scrollParent.getBoundingClientRect();
|
2118
|
-
var node = select(
|
2125
|
+
var node = select('.' + nodeClass, scrollParent);
|
2119
2126
|
if ((screenY >= (elementData.top + scrollParent.clientHeight - 30)) && !isNullOrUndefined(node)) {
|
2120
2127
|
position = (parent.targetModule === 'navigationpane' || parent.targetModule === 'detailsview') ? node.offsetHeight / 2.5 : node.offsetHeight / 4.5;
|
2121
2128
|
scrollParent.scrollBy(0, position);
|
@@ -2193,7 +2200,6 @@ function draggingHandler(parent, args) {
|
|
2193
2200
|
* @private
|
2194
2201
|
*/
|
2195
2202
|
// Ignored the message key value in permission object
|
2196
|
-
// eslint-disable-next-line
|
2197
2203
|
function objectToString(data) {
|
2198
2204
|
var str = '';
|
2199
2205
|
var keys = Object.keys(data);
|
@@ -2212,7 +2218,6 @@ function objectToString(data) {
|
|
2212
2218
|
* @returns {string} returns the item name.
|
2213
2219
|
* @private
|
2214
2220
|
*/
|
2215
|
-
// eslint-disable-next-line
|
2216
2221
|
function getItemName(parent, data) {
|
2217
2222
|
if (parent.hasId) {
|
2218
2223
|
return getValue('id', data);
|
@@ -2227,7 +2232,6 @@ function getItemName(parent, data) {
|
|
2227
2232
|
* @returns {void}
|
2228
2233
|
* @private
|
2229
2234
|
*/
|
2230
|
-
// eslint-disable-next-line
|
2231
2235
|
function updateRenamingData(parent, data) {
|
2232
2236
|
parent.itemData = [data];
|
2233
2237
|
parent.currentItemText = getValue('name', data);
|
@@ -2258,7 +2262,6 @@ function doRename(parent) {
|
|
2258
2262
|
* @private
|
2259
2263
|
*/
|
2260
2264
|
function doDownload(parent) {
|
2261
|
-
// eslint-disable-next-line
|
2262
2265
|
var items = parent.itemData;
|
2263
2266
|
for (var i = 0; i < items.length; i++) {
|
2264
2267
|
if (!hasDownloadAccess(items[i])) {
|
@@ -2279,7 +2282,6 @@ function doDownload(parent) {
|
|
2279
2282
|
* @returns {void}
|
2280
2283
|
* @private
|
2281
2284
|
*/
|
2282
|
-
// eslint-disable-next-line
|
2283
2285
|
function doDeleteFiles(parent, data, newIds) {
|
2284
2286
|
for (var i = 0; i < data.length; i++) {
|
2285
2287
|
if (!hasEditAccess(data[i])) {
|
@@ -2300,7 +2302,6 @@ function doDeleteFiles(parent, data, newIds) {
|
|
2300
2302
|
* @returns {void}
|
2301
2303
|
* @private
|
2302
2304
|
*/
|
2303
|
-
// eslint-disable-next-line
|
2304
2305
|
function doDownloadFiles(parent, data, newIds) {
|
2305
2306
|
for (var i = 0; i < data.length; i++) {
|
2306
2307
|
if (!hasDownloadAccess(data[i])) {
|
@@ -2322,7 +2323,6 @@ function doDownloadFiles(parent, data, newIds) {
|
|
2322
2323
|
* @returns {void}
|
2323
2324
|
* @private
|
2324
2325
|
*/
|
2325
|
-
// eslint-disable-next-line
|
2326
2326
|
function createDeniedDialog(parent, data, action) {
|
2327
2327
|
var message = getValue('message', getValue('permission', data));
|
2328
2328
|
if (message === '') {
|
@@ -2344,7 +2344,6 @@ function createDeniedDialog(parent, data, action) {
|
|
2344
2344
|
* @returns {string} - returns accesses classes.
|
2345
2345
|
* @private
|
2346
2346
|
*/
|
2347
|
-
// eslint-disable-next-line
|
2348
2347
|
function getAccessClass(data) {
|
2349
2348
|
return !hasReadAccess(data) ? 'e-fe-locked e-fe-hidden' : 'e-fe-locked';
|
2350
2349
|
}
|
@@ -2355,9 +2354,7 @@ function getAccessClass(data) {
|
|
2355
2354
|
* @returns {boolean} - returns read access.
|
2356
2355
|
* @private
|
2357
2356
|
*/
|
2358
|
-
// eslint-disable-next-line
|
2359
2357
|
function hasReadAccess(data) {
|
2360
|
-
// eslint-disable-next-line
|
2361
2358
|
var permission = getValue('permission', data);
|
2362
2359
|
return (permission && !getValue('read', permission)) ? false : true;
|
2363
2360
|
}
|
@@ -2368,9 +2365,7 @@ function hasReadAccess(data) {
|
|
2368
2365
|
* @returns {boolean} - returns edit access.
|
2369
2366
|
* @private
|
2370
2367
|
*/
|
2371
|
-
// eslint-disable-next-line
|
2372
2368
|
function hasEditAccess(data) {
|
2373
|
-
// eslint-disable-next-line
|
2374
2369
|
var permission = getValue('permission', data);
|
2375
2370
|
return permission ? ((getValue('read', permission) && getValue('write', permission))) : true;
|
2376
2371
|
}
|
@@ -2381,9 +2376,7 @@ function hasEditAccess(data) {
|
|
2381
2376
|
* @returns {boolean} - returns content access.
|
2382
2377
|
* @private
|
2383
2378
|
*/
|
2384
|
-
// eslint-disable-next-line
|
2385
2379
|
function hasContentAccess(data) {
|
2386
|
-
// eslint-disable-next-line
|
2387
2380
|
var permission = getValue('permission', data);
|
2388
2381
|
return permission ? ((getValue('read', permission) && getValue('writeContents', permission))) : true;
|
2389
2382
|
}
|
@@ -2394,9 +2387,7 @@ function hasContentAccess(data) {
|
|
2394
2387
|
* @returns {boolean} - returns upload access.
|
2395
2388
|
* @private
|
2396
2389
|
*/
|
2397
|
-
// eslint-disable-next-line
|
2398
2390
|
function hasUploadAccess(data) {
|
2399
|
-
// eslint-disable-next-line
|
2400
2391
|
var permission = getValue('permission', data);
|
2401
2392
|
return permission ? ((getValue('read', permission) && getValue('upload', permission))) : true;
|
2402
2393
|
}
|
@@ -2407,9 +2398,7 @@ function hasUploadAccess(data) {
|
|
2407
2398
|
* @returns {boolean} - returns download access.
|
2408
2399
|
* @private
|
2409
2400
|
*/
|
2410
|
-
// eslint-disable-next-line
|
2411
2401
|
function hasDownloadAccess(data) {
|
2412
|
-
// eslint-disable-next-line
|
2413
2402
|
var permission = getValue('permission', data);
|
2414
2403
|
return permission ? ((getValue('read', permission) && getValue('download', permission))) : true;
|
2415
2404
|
}
|
@@ -2421,7 +2410,6 @@ function hasDownloadAccess(data) {
|
|
2421
2410
|
* @private
|
2422
2411
|
*/
|
2423
2412
|
function createNewFolder(parent) {
|
2424
|
-
// eslint-disable-next-line
|
2425
2413
|
var details = parent.itemData[0];
|
2426
2414
|
if (!hasContentAccess(details)) {
|
2427
2415
|
createDeniedDialog(parent, details, permissionEditContents);
|
@@ -2438,7 +2426,6 @@ function createNewFolder(parent) {
|
|
2438
2426
|
* @private
|
2439
2427
|
*/
|
2440
2428
|
function uploadItem(parent) {
|
2441
|
-
// eslint-disable-next-line
|
2442
2429
|
var details = parent.itemData[0];
|
2443
2430
|
if (!hasUploadAccess(details)) {
|
2444
2431
|
createDeniedDialog(parent, details, permissionUpload);
|
@@ -2449,7 +2436,70 @@ function uploadItem(parent) {
|
|
2449
2436
|
uploadEle.click();
|
2450
2437
|
}
|
2451
2438
|
}
|
2439
|
+
/**
|
2440
|
+
* Close dialog popup handler
|
2441
|
+
*
|
2442
|
+
* @param {IFileManager} parent - specifies the parent.
|
2443
|
+
* @returns {void}
|
2444
|
+
* @private
|
2445
|
+
*/
|
2446
|
+
function closePopup(parent) {
|
2447
|
+
if (!isNullOrUndefined(parent.dialogObj)) {
|
2448
|
+
parent.dialogObj.hide();
|
2449
|
+
}
|
2450
|
+
}
|
2451
|
+
/**
|
2452
|
+
* Access control handler
|
2453
|
+
*
|
2454
|
+
* @param {IFileManager} parent - specifies the parent.
|
2455
|
+
* @param {Object[]} itemData - specifies the item elements.
|
2456
|
+
* @param {string} action - specifies the action.
|
2457
|
+
* @param {boolean} isPathPermision - specifies the path permission.
|
2458
|
+
* @returns {string} returns the path.
|
2459
|
+
* @private
|
2460
|
+
*/
|
2461
|
+
function getAccessDetails(parent, itemData, action, isPathPermision) {
|
2462
|
+
var accessMessage = '';
|
2463
|
+
for (var i = 0; i < itemData.length; i++) {
|
2464
|
+
var permission = getValue('permission', itemData[i]);
|
2465
|
+
if (permission == null) {
|
2466
|
+
permission = undefined;
|
2467
|
+
}
|
2468
|
+
if (isPathPermision) {
|
2469
|
+
if (permission && (!getValue('read', permission) || !getValue('writeContents', permission))) {
|
2470
|
+
accessMessage = getValue('message', getValue('permission', itemData[i]));
|
2471
|
+
if (accessMessage === '') {
|
2472
|
+
accessMessage = getLocaleText(parent, 'Access-Message').replace('{0}', getValue('name', itemData[i])).replace('{1}', 'writeContents');
|
2473
|
+
}
|
2474
|
+
}
|
2475
|
+
}
|
2476
|
+
else {
|
2477
|
+
var copyOrMovePermission = action === 'copy' ? getValue('copy', permission) : getValue('write', permission);
|
2478
|
+
if (permission && (!getValue('read', permission) || !copyOrMovePermission)) {
|
2479
|
+
accessMessage = getValue('message', getValue('permission', itemData[i]));
|
2480
|
+
if (accessMessage === '') {
|
2481
|
+
accessMessage = getLocaleText(parent, 'Access-Message').replace('{0}', getValue('name', itemData[i])).replace('{1}', action);
|
2482
|
+
}
|
2483
|
+
}
|
2484
|
+
}
|
2485
|
+
if (accessMessage !== '') {
|
2486
|
+
parent.responseData = {
|
2487
|
+
cwd: null,
|
2488
|
+
details: null,
|
2489
|
+
error: {
|
2490
|
+
code: '401',
|
2491
|
+
message: accessMessage,
|
2492
|
+
fileExists: null
|
2493
|
+
},
|
2494
|
+
files: null
|
2495
|
+
};
|
2496
|
+
break;
|
2497
|
+
}
|
2498
|
+
}
|
2499
|
+
return accessMessage;
|
2500
|
+
}
|
2452
2501
|
|
2502
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2453
2503
|
/**
|
2454
2504
|
* Function to read the content from given path in File Manager.
|
2455
2505
|
*
|
@@ -2460,14 +2510,12 @@ function uploadItem(parent) {
|
|
2460
2510
|
* @private
|
2461
2511
|
*/
|
2462
2512
|
function read(parent, event, path) {
|
2463
|
-
// eslint-disable-next-line
|
2464
2513
|
var itemData = parent.itemData;
|
2465
2514
|
for (var i = 0; i < itemData.length; i++) {
|
2466
2515
|
if (isNullOrUndefined(getValue('hasChild', itemData[i]))) {
|
2467
2516
|
setValue('hasChild', false, itemData[i]);
|
2468
2517
|
}
|
2469
2518
|
}
|
2470
|
-
// eslint-disable-next-line
|
2471
2519
|
var data = { action: 'read', path: path, showHiddenItems: parent.showHiddenItems, data: itemData };
|
2472
2520
|
createAjax(parent, data, readSuccess, event);
|
2473
2521
|
}
|
@@ -2480,7 +2528,6 @@ function read(parent, event, path) {
|
|
2480
2528
|
* @private
|
2481
2529
|
*/
|
2482
2530
|
function createFolder(parent, itemName) {
|
2483
|
-
// eslint-disable-next-line
|
2484
2531
|
var data = { action: 'create', path: parent.path, name: itemName, data: parent.itemData };
|
2485
2532
|
createAjax(parent, data, createSuccess, itemName);
|
2486
2533
|
}
|
@@ -2493,11 +2540,8 @@ function createFolder(parent, itemName) {
|
|
2493
2540
|
* @private
|
2494
2541
|
*/
|
2495
2542
|
function filter(parent, event) {
|
2496
|
-
// eslint-disable-next-line
|
2497
2543
|
var data = { action: 'filter', path: parent.path, showHiddenItems: parent.showHiddenItems, data: [getPathObject(parent)] };
|
2498
|
-
// eslint-disable-next-line
|
2499
2544
|
var filterData;
|
2500
|
-
// eslint-disable-next-line
|
2501
2545
|
var filterDataVal = parent.filterData ? extend(filterData, data, parent.filterData) : data;
|
2502
2546
|
createAjax(parent, filterDataVal, filterSuccess, event, getValue('action', filterDataVal));
|
2503
2547
|
}
|
@@ -2529,7 +2573,6 @@ function rename(parent, path, itemNewName) {
|
|
2529
2573
|
newName = fPath.replace(path, '') + itemNewName;
|
2530
2574
|
}
|
2531
2575
|
}
|
2532
|
-
// eslint-disable-next-line
|
2533
2576
|
var data = {
|
2534
2577
|
action: 'rename', path: path, name: name, newName: newName, data: parent.itemData, showFileExtension: parent.showFileExtension
|
2535
2578
|
};
|
@@ -2548,10 +2591,7 @@ function rename(parent, path, itemNewName) {
|
|
2548
2591
|
* @returns {void}
|
2549
2592
|
* @private
|
2550
2593
|
*/
|
2551
|
-
function paste(parent, path, names, targetPath, pasteOperation,
|
2552
|
-
// eslint-disable-next-line
|
2553
|
-
renameItems, actionRecords) {
|
2554
|
-
// eslint-disable-next-line
|
2594
|
+
function paste(parent, path, names, targetPath, pasteOperation, renameItems, actionRecords) {
|
2555
2595
|
var data = {
|
2556
2596
|
action: pasteOperation, path: path, targetData: parent.itemData[0],
|
2557
2597
|
targetPath: targetPath, names: names, renameFiles: renameItems, data: actionRecords
|
@@ -2570,7 +2610,6 @@ renameItems, actionRecords) {
|
|
2570
2610
|
* @private
|
2571
2611
|
*/
|
2572
2612
|
function Delete(parent, items, path, operation) {
|
2573
|
-
// eslint-disable-next-line
|
2574
2613
|
var data = { action: operation, path: path, names: items, data: parent.itemData };
|
2575
2614
|
createAjax(parent, data, deleteSuccess, path);
|
2576
2615
|
}
|
@@ -2586,25 +2625,22 @@ function Delete(parent, items, path, operation) {
|
|
2586
2625
|
* @private
|
2587
2626
|
*/
|
2588
2627
|
function GetDetails(parent, names, path, operation) {
|
2589
|
-
// eslint-disable-next-line
|
2590
2628
|
var data = { action: operation, path: path, names: names, data: parent.itemData };
|
2591
2629
|
createAjax(parent, data, detailsSuccess, path, operation);
|
2592
2630
|
}
|
2593
2631
|
/**
|
2594
|
-
* Function for
|
2632
|
+
* Function for getDateFormat in File Manager.
|
2595
2633
|
*
|
2596
2634
|
* @param {IFileManager} parent - specifies the parent element.
|
2597
|
-
* @param {Object} data - specifies the data.
|
2598
|
-
* @param {Function} fn - specifies the fn.
|
2599
|
-
* @param {string} event - specifies the event.
|
2600
|
-
* @param {string} operation - specifies the operation.
|
2601
|
-
* @param {string} targetPath - specifies the target path.
|
2602
2635
|
* @returns {void}
|
2603
2636
|
* @private
|
2604
2637
|
*/
|
2605
2638
|
function getDateFormat(parent) {
|
2606
2639
|
var columns = parent.detailsViewSettings.columns;
|
2607
2640
|
var dateFormat;
|
2641
|
+
if (!columns) {
|
2642
|
+
return null;
|
2643
|
+
}
|
2608
2644
|
for (var i = 0; i < columns.length; i++) {
|
2609
2645
|
if (columns[i].field === '_fm_modified') {
|
2610
2646
|
if (!isNullOrUndefined(columns[i].format)) {
|
@@ -2615,10 +2651,393 @@ function getDateFormat(parent) {
|
|
2615
2651
|
}
|
2616
2652
|
return dateFormat;
|
2617
2653
|
}
|
2618
|
-
|
2619
|
-
|
2620
|
-
|
2621
|
-
|
2654
|
+
/**
|
2655
|
+
* Checks whether fileSystemData is enabled.
|
2656
|
+
*
|
2657
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2658
|
+
* @returns {boolean} - returns the boolean value.
|
2659
|
+
*/
|
2660
|
+
function isFileSystemData(parent) {
|
2661
|
+
var isFileSystemData = parent.fileSystemData.length >= 0 && isNullOrUndefined(parent.ajaxSettings.url);
|
2662
|
+
return isFileSystemData;
|
2663
|
+
}
|
2664
|
+
/**
|
2665
|
+
* Function to check whether file already exist or not.
|
2666
|
+
*
|
2667
|
+
* @param {Record<string, any>} fileSystemData - specifies the file data.
|
2668
|
+
* @param {string} name - specifies the name.
|
2669
|
+
* @returns {boolean} - returns the boolean value.
|
2670
|
+
* @private
|
2671
|
+
*/
|
2672
|
+
function isFileExists(fileSystemData, name) {
|
2673
|
+
var isExists = fileSystemData.some(function (item) { return item.name === name; });
|
2674
|
+
return isExists;
|
2675
|
+
}
|
2676
|
+
/**
|
2677
|
+
* Function to find the index value of a file or folder.
|
2678
|
+
*
|
2679
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2680
|
+
* @param {number} id - specifies the id.
|
2681
|
+
* @returns {number} - returns the index value.
|
2682
|
+
* @private
|
2683
|
+
*/
|
2684
|
+
function findIndexById(parent, id) {
|
2685
|
+
var index = parent.fileSystemData.findIndex(function (item) { return String(item.id) === String(id); });
|
2686
|
+
return index;
|
2687
|
+
}
|
2688
|
+
/**
|
2689
|
+
* Function to get the entire data of a file or folder using id value.
|
2690
|
+
*
|
2691
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2692
|
+
* @param {number | string} id - specifies the id.
|
2693
|
+
* @returns {Object} - returns the data.
|
2694
|
+
* @private
|
2695
|
+
*/
|
2696
|
+
function filterById(parent, id) {
|
2697
|
+
var data = parent.fileSystemData.filter(function (item) { return String(item.id) === String(id); })[0];
|
2698
|
+
return data;
|
2699
|
+
}
|
2700
|
+
/**
|
2701
|
+
* Function to get the entire data of a file or folder for a parent.
|
2702
|
+
*
|
2703
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2704
|
+
* @param {number | string} parentId - specifies the parent id.
|
2705
|
+
* @returns {Object[]} - returns the data.
|
2706
|
+
* @private
|
2707
|
+
*/
|
2708
|
+
function filterByParent(parent, parentId) {
|
2709
|
+
var data = parent.fileSystemData.filter(function (item) { return String(item.parentId) === String(parentId); });
|
2710
|
+
return data;
|
2711
|
+
}
|
2712
|
+
/**
|
2713
|
+
* Function to create a new copied file or folder.
|
2714
|
+
*
|
2715
|
+
* @param {Record<string, any>} data - specifies the file or folder data.
|
2716
|
+
* @param {Record<string, any>} target - specifies the target data.
|
2717
|
+
* @param {string} itemName - specifies the item name.
|
2718
|
+
* @param {boolean} isCopy - specifies the copy operation.
|
2719
|
+
* @returns {Record<string, Object>} - returns the data.
|
2720
|
+
* @private
|
2721
|
+
*/
|
2722
|
+
function createNewItem(data, target, itemName, isCopy) {
|
2723
|
+
var newItem = {};
|
2724
|
+
//Construct the new folder details.
|
2725
|
+
for (var key in data) {
|
2726
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
2727
|
+
newItem[key] = null;
|
2728
|
+
}
|
2729
|
+
}
|
2730
|
+
var currentDate = new Date();
|
2731
|
+
var folderPath = target.id !== 0 ? target.filterPath + target.name : '\\';
|
2732
|
+
Object.assign(newItem, {
|
2733
|
+
dateCreated: currentDate,
|
2734
|
+
dateModified: currentDate,
|
2735
|
+
filterPath: folderPath,
|
2736
|
+
hasChild: isCopy ? data.hasChild : false,
|
2737
|
+
id: getUid(itemName === null ? data.name : itemName),
|
2738
|
+
isFile: isCopy ? data.isFile : false,
|
2739
|
+
name: itemName === null ? data.name : itemName,
|
2740
|
+
parentId: target.id,
|
2741
|
+
size: isCopy ? data.size : 0,
|
2742
|
+
type: isCopy ? data.type : ''
|
2743
|
+
});
|
2744
|
+
return newItem;
|
2745
|
+
}
|
2746
|
+
/**
|
2747
|
+
* Function to create an error response.
|
2748
|
+
*
|
2749
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2750
|
+
* @param {string} message - specifies the error message.
|
2751
|
+
* @param {string} code - specifies the error code.
|
2752
|
+
* @param {Object[]} fileName - specifies the file name.
|
2753
|
+
* @returns {void}
|
2754
|
+
* @private
|
2755
|
+
*/
|
2756
|
+
function createErrorObject(parent, message, code, fileName) {
|
2757
|
+
parent.responseData = {
|
2758
|
+
cwd: null,
|
2759
|
+
details: null,
|
2760
|
+
error: {
|
2761
|
+
code: code,
|
2762
|
+
message: message,
|
2763
|
+
fileExists: fileName != null ? fileName : null
|
2764
|
+
},
|
2765
|
+
files: null
|
2766
|
+
};
|
2767
|
+
}
|
2768
|
+
/**
|
2769
|
+
* Function to trigger folder creation.
|
2770
|
+
*
|
2771
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2772
|
+
* @param {Object} data - specifies the data.
|
2773
|
+
* @param {BeforeSendEventArgs} eventArgs - specifies the eventArgs.
|
2774
|
+
* @returns {void}
|
2775
|
+
* @private
|
2776
|
+
*/
|
2777
|
+
function triggerFolderCreation(parent, data, eventArgs) {
|
2778
|
+
var createEventArgs = {
|
2779
|
+
folderName: getValue('name', data),
|
2780
|
+
cancel: false,
|
2781
|
+
path: getValue('path', data),
|
2782
|
+
parentFolder: getValue('data', data)
|
2783
|
+
};
|
2784
|
+
parent.trigger('beforeFolderCreate', createEventArgs, function (args) {
|
2785
|
+
if (args.cancel) {
|
2786
|
+
eventArgs.cancel = true;
|
2787
|
+
return;
|
2788
|
+
}
|
2789
|
+
if (isFileSystemData(parent)) {
|
2790
|
+
if (!isFileExists(parent.fileSystemData, args.folderName)) {
|
2791
|
+
var data_1 = args.parentFolder[0];
|
2792
|
+
var newObject = createNewItem(data_1, data_1, args.folderName, false);
|
2793
|
+
parent.fileSystemData.push(newObject);
|
2794
|
+
}
|
2795
|
+
else {
|
2796
|
+
var message = 'A file or folder with the name ' + args.folderName + ' already exists.';
|
2797
|
+
createErrorObject(parent, message, '400', null);
|
2798
|
+
}
|
2799
|
+
}
|
2800
|
+
});
|
2801
|
+
}
|
2802
|
+
/**
|
2803
|
+
* Function to trigger delete operation.
|
2804
|
+
*
|
2805
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2806
|
+
* @param {Object} data - specifies the data.
|
2807
|
+
* @param {BeforeSendEventArgs} eventArgs - specifies the eventArgs.
|
2808
|
+
* @returns {void}
|
2809
|
+
* @private
|
2810
|
+
*/
|
2811
|
+
function triggerDeleteOperation(parent, data, eventArgs) {
|
2812
|
+
var deleteEventArgs = {
|
2813
|
+
cancel: false,
|
2814
|
+
itemData: getValue('data', data),
|
2815
|
+
path: getValue('path', data)
|
2816
|
+
};
|
2817
|
+
parent.trigger('beforeDelete', deleteEventArgs, function (args) {
|
2818
|
+
if (args.cancel) {
|
2819
|
+
eventArgs.cancel = true;
|
2820
|
+
return;
|
2821
|
+
}
|
2822
|
+
if (isFileSystemData(parent)) {
|
2823
|
+
args.itemData.forEach(function (itemData) {
|
2824
|
+
var index = findIndexById(parent, itemData.id);
|
2825
|
+
if (index !== -1) {
|
2826
|
+
parent.fileSystemData.splice(index, 1);
|
2827
|
+
}
|
2828
|
+
if (!itemData.isFile) {
|
2829
|
+
var subItems = parent.fileSystemData.filter(function (obj) { return obj.filterPath.includes(itemData.name); });
|
2830
|
+
subItems.forEach(function (subItem) {
|
2831
|
+
var index = findIndexById(parent, subItem.id);
|
2832
|
+
if (index !== -1) {
|
2833
|
+
parent.fileSystemData.splice(index, 1);
|
2834
|
+
}
|
2835
|
+
});
|
2836
|
+
}
|
2837
|
+
});
|
2838
|
+
}
|
2839
|
+
});
|
2840
|
+
}
|
2841
|
+
/**
|
2842
|
+
* Function to trigger rename operation.
|
2843
|
+
*
|
2844
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2845
|
+
* @param {Object} data - specifies the data.
|
2846
|
+
* @param {BeforeSendEventArgs} eventArgs - specifies the eventArgs.
|
2847
|
+
* @returns {void}
|
2848
|
+
* @private
|
2849
|
+
*/
|
2850
|
+
function triggerRenameOperation(parent, data, eventArgs) {
|
2851
|
+
var renameEventArgs = {
|
2852
|
+
cancel: false,
|
2853
|
+
newName: getValue('newName', data),
|
2854
|
+
itemData: getValue('data', data),
|
2855
|
+
path: getValue('path', data)
|
2856
|
+
};
|
2857
|
+
parent.trigger('beforeRename', renameEventArgs, function (args) {
|
2858
|
+
if (args.cancel) {
|
2859
|
+
eventArgs.cancel = true;
|
2860
|
+
return;
|
2861
|
+
}
|
2862
|
+
if (isFileSystemData(parent)) {
|
2863
|
+
if (!isFileExists(parent.fileSystemData, args.newName)) {
|
2864
|
+
var fileData = filterById(parent, args.itemData[0].id);
|
2865
|
+
fileData.name = args.newName;
|
2866
|
+
}
|
2867
|
+
else {
|
2868
|
+
var message = 'Cannot rename' + args.itemData[0].name + 'to' + args.newName + ': destination already exists.';
|
2869
|
+
createErrorObject(parent, message, '400', null);
|
2870
|
+
}
|
2871
|
+
}
|
2872
|
+
});
|
2873
|
+
}
|
2874
|
+
/**
|
2875
|
+
* Function to trigger move or copy operation.
|
2876
|
+
*
|
2877
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2878
|
+
* @param {Object} data - specifies the data.
|
2879
|
+
* @param {BeforeSendEventArgs} eventArgs - specifies the eventArgs.
|
2880
|
+
* @returns {void}
|
2881
|
+
* @private
|
2882
|
+
*/
|
2883
|
+
function triggerMoveOrCopyOperation(parent, data, eventArgs) {
|
2884
|
+
var moveEventArgs = {
|
2885
|
+
cancel: false,
|
2886
|
+
itemData: getValue('data', data),
|
2887
|
+
isCopy: getValue('action', data) === 'copy' ? true : false,
|
2888
|
+
path: getValue('path', data),
|
2889
|
+
targetData: getValue('targetData', data),
|
2890
|
+
targetPath: getValue('targetPath', data)
|
2891
|
+
};
|
2892
|
+
parent.trigger('beforeMove', moveEventArgs, function (args) {
|
2893
|
+
if (args.cancel) {
|
2894
|
+
eventArgs.cancel = true;
|
2895
|
+
return;
|
2896
|
+
}
|
2897
|
+
if (isFileSystemData(parent)) {
|
2898
|
+
var message = 'File Already Exists';
|
2899
|
+
var action = getValue('action', data);
|
2900
|
+
var itemPermission = getAccessDetails(parent, args.itemData, action, false);
|
2901
|
+
var pathPermission = getAccessDetails(parent, [args.targetData], action, true);
|
2902
|
+
var file_1 = [];
|
2903
|
+
parent.pasteNodes = [];
|
2904
|
+
if (itemPermission === '' && pathPermission === '') {
|
2905
|
+
if (args.isCopy) {
|
2906
|
+
var folderSubItems_1 = filterByParent(parent, args.targetData.id);
|
2907
|
+
var copiedFolders = args.itemData;
|
2908
|
+
copiedFolders.forEach(function (itemData) {
|
2909
|
+
if (!isFileExists(folderSubItems_1, itemData.name) || getValue('renameFiles', data).length > 0) {
|
2910
|
+
if (getValue('renameFiles', data).length > 0) {
|
2911
|
+
var names = itemData.name.split('.');
|
2912
|
+
var name_1 = itemData.name.includes('.') ? names[0] + '(' + parent.existingFileCount + ').' + names[1] : names[0] + '(' + parent.existingFileCount + ')';
|
2913
|
+
copyFolderItems(parent, itemData, args.targetData, name_1);
|
2914
|
+
parent.responseData.error = null;
|
2915
|
+
parent.existingFileCount++;
|
2916
|
+
return;
|
2917
|
+
}
|
2918
|
+
copyFolderItems(parent, itemData, args.targetData, null);
|
2919
|
+
}
|
2920
|
+
else {
|
2921
|
+
file_1.push(itemData.name);
|
2922
|
+
}
|
2923
|
+
});
|
2924
|
+
if (file_1.length > 0) {
|
2925
|
+
createErrorObject(parent, message, '400', file_1);
|
2926
|
+
}
|
2927
|
+
return;
|
2928
|
+
}
|
2929
|
+
var target = args.targetData;
|
2930
|
+
var getTargetFiles = filterByParent(parent, target.id);
|
2931
|
+
for (var i = 0; i < args.itemData.length; i++) {
|
2932
|
+
var currItem = args.itemData[i];
|
2933
|
+
if (!isFileExists(getTargetFiles, currItem.name) || getValue('renameFiles', data).length > 0) {
|
2934
|
+
if (!target.hasChild) {
|
2935
|
+
target.hasChild = !currItem.isFile;
|
2936
|
+
}
|
2937
|
+
if (!currItem.isFile) {
|
2938
|
+
//Check whether the source folder include other sub folders or not.
|
2939
|
+
var subItems = currItem.parentId !== 0
|
2940
|
+
? filterByParent(parent, currItem.parentID) : [];
|
2941
|
+
var itemData = filterById(parent, currItem.parentId);
|
2942
|
+
itemData.hasChild = subItems.length > 1 ? true : false;
|
2943
|
+
}
|
2944
|
+
var fileData = filterById(parent, currItem.id);
|
2945
|
+
if (getValue('renameFiles', data).length > 0) {
|
2946
|
+
var names = currItem.name.split('.');
|
2947
|
+
currItem.name = currItem.name.includes('.') ? names[0] + '(' + parent.existingFileCount + ').' + names[1] : names[0] + '(' + parent.existingFileCount + ')';
|
2948
|
+
fileData.name = currItem.name;
|
2949
|
+
parent.responseData.error = null;
|
2950
|
+
parent.existingFileCount++;
|
2951
|
+
parent.dropData = target;
|
2952
|
+
parent.dropPath = args.path;
|
2953
|
+
var pathArray = args.targetPath.replace(/^\/|\/$/g, '').split('/');
|
2954
|
+
target = filterById(parent, pathArray[pathArray.length - 1]);
|
2955
|
+
}
|
2956
|
+
fileData.parentId = target.id;
|
2957
|
+
fileData.filterPath = target.id === 0 ? '\\' : target.filterPath + target.name + '\\';
|
2958
|
+
}
|
2959
|
+
else {
|
2960
|
+
file_1.push(currItem.name);
|
2961
|
+
}
|
2962
|
+
}
|
2963
|
+
if (file_1.length > 0) {
|
2964
|
+
createErrorObject(parent, message, '400', file_1);
|
2965
|
+
}
|
2966
|
+
}
|
2967
|
+
}
|
2968
|
+
});
|
2969
|
+
}
|
2970
|
+
/**
|
2971
|
+
* Function to trigger search operation.
|
2972
|
+
*
|
2973
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2974
|
+
* @param {Object} data - specifies the data.
|
2975
|
+
* @param {BeforeSendEventArgs} eventArgs - specifies the eventArgs.
|
2976
|
+
* @returns {void}
|
2977
|
+
* @private
|
2978
|
+
*/
|
2979
|
+
function triggerSearchOperation(parent, data, eventArgs) {
|
2980
|
+
var searchEventArgs = {
|
2981
|
+
searchResults: getValue('data', data),
|
2982
|
+
cancel: false,
|
2983
|
+
path: getValue('path', data),
|
2984
|
+
searchText: getValue('searchString', data),
|
2985
|
+
caseSensitive: getValue('caseSensitive', data),
|
2986
|
+
showHiddenItems: getValue('showHiddenItems', data)
|
2987
|
+
};
|
2988
|
+
parent.trigger('search', searchEventArgs, function (args) {
|
2989
|
+
if (args.cancel) {
|
2990
|
+
eventArgs.cancel = true;
|
2991
|
+
}
|
2992
|
+
});
|
2993
|
+
}
|
2994
|
+
/**
|
2995
|
+
* Function to trigger client side events.
|
2996
|
+
*
|
2997
|
+
* @param {IFileManager} parent - specifies the parent element.
|
2998
|
+
* @param {Object} data - specifies the data.
|
2999
|
+
* @param {BeforeSendEventArgs} eventArgs - specifies the eventArgs.
|
3000
|
+
* @returns {void}
|
3001
|
+
* @private
|
3002
|
+
*/
|
3003
|
+
function triggerClientEvents(parent, data, eventArgs) {
|
3004
|
+
switch (getValue('action', data)) {
|
3005
|
+
case 'create': {
|
3006
|
+
triggerFolderCreation(parent, data, eventArgs);
|
3007
|
+
break;
|
3008
|
+
}
|
3009
|
+
case 'delete': {
|
3010
|
+
triggerDeleteOperation(parent, data, eventArgs);
|
3011
|
+
break;
|
3012
|
+
}
|
3013
|
+
case 'rename': {
|
3014
|
+
triggerRenameOperation(parent, data, eventArgs);
|
3015
|
+
break;
|
3016
|
+
}
|
3017
|
+
case 'move':
|
3018
|
+
case 'copy': {
|
3019
|
+
triggerMoveOrCopyOperation(parent, data, eventArgs);
|
3020
|
+
break;
|
3021
|
+
}
|
3022
|
+
case 'search': {
|
3023
|
+
triggerSearchOperation(parent, data, eventArgs);
|
3024
|
+
break;
|
3025
|
+
}
|
3026
|
+
}
|
3027
|
+
}
|
3028
|
+
/**
|
3029
|
+
* Creates an AJAX request for the file manager.
|
3030
|
+
*
|
3031
|
+
* @param {IFileManager} parent - The parent file manager instance.
|
3032
|
+
* @param {Object} data - The data object for the AJAX request.
|
3033
|
+
* @param {Function} fn - The callback function to be executed after the AJAX request.
|
3034
|
+
* @param {string} [event] - The event type for the AJAX request.
|
3035
|
+
* @param {string} [operation] - The operation type for the AJAX request.
|
3036
|
+
* @param {string} [targetPath] - The target path for the AJAX request.
|
3037
|
+
* @returns {void}
|
3038
|
+
* @private
|
3039
|
+
*/
|
3040
|
+
function createAjax(parent, data, fn, event, operation, targetPath) {
|
2622
3041
|
var ajaxSettings = {
|
2623
3042
|
url: parent.ajaxSettings.url,
|
2624
3043
|
type: 'POST',
|
@@ -2631,9 +3050,64 @@ parent, data, fn, event, operation, targetPath) {
|
|
2631
3050
|
beforeSend: null
|
2632
3051
|
};
|
2633
3052
|
var eventArgs = { action: getValue('action', data), ajaxSettings: ajaxSettings, cancel: false };
|
3053
|
+
triggerClientEvents(parent, data, eventArgs);
|
2634
3054
|
parent.trigger('beforeSend', eventArgs, function (beforeSendArgs) {
|
2635
3055
|
if (!beforeSendArgs.cancel) {
|
2636
3056
|
parent.notify(beforeRequest, {});
|
3057
|
+
if (isFileSystemData(parent)) {
|
3058
|
+
var filePath = event === 'node-expand' || event === 'finalize-end' ? getValue('path', data) : parent.path;
|
3059
|
+
var pathArray = filePath.replace(/^\/|\/$/g, '').split('/');
|
3060
|
+
var idValue = event === 'rename-end-parent' || (event === 'path-changed' && getValue('data', data).length != 0)
|
3061
|
+
|| (event === 'paste-end' && (parent.targetModule === 'largeiconsview' || parent.targetModule === 'detailsview'))
|
3062
|
+
? getValue('data', data)[0].id : pathArray[pathArray.length - 1];
|
3063
|
+
var action = getValue('action', data);
|
3064
|
+
var isFileOperation = (action === 'move' || action === 'rename' || action === 'copy' || action === 'delete' || action === 'search') && event !== 'rename-end';
|
3065
|
+
if (action === 'read' || action === 'create' || event === 'rename-end') {
|
3066
|
+
parent.responseData = {
|
3067
|
+
cwd: filterById(parent, parent.path === '/' && event !== 'node-expand' && event != 'rename-end-parent' ? 0 : idValue),
|
3068
|
+
details: null,
|
3069
|
+
error: null,
|
3070
|
+
files: filterByParent(parent, parent.path === '/' && event !== 'node-expand' && event != 'rename-end-parent' ? 0 : idValue)
|
3071
|
+
};
|
3072
|
+
if (isNullOrUndefined(parent.responseData.cwd)) {
|
3073
|
+
var message = 'Cannot load empty data within the File Manager.';
|
3074
|
+
createErrorObject(parent, message, '400', null);
|
3075
|
+
}
|
3076
|
+
}
|
3077
|
+
else if (isFileOperation && parent.responseData.error === null) {
|
3078
|
+
var itemData = action === 'search' || action === 'delete' ? getValue('data', data) : [];
|
3079
|
+
if (itemData.length === 0) {
|
3080
|
+
itemData = getValue('data', data).map(function (item) { return filterById(parent, item.id); });
|
3081
|
+
}
|
3082
|
+
parent.responseData = {
|
3083
|
+
cwd: null,
|
3084
|
+
details: null,
|
3085
|
+
error: null,
|
3086
|
+
files: itemData
|
3087
|
+
};
|
3088
|
+
}
|
3089
|
+
else if (getValue('action', data) === 'details') {
|
3090
|
+
var itemData = getValue('data', data);
|
3091
|
+
var details = itemData[0];
|
3092
|
+
var isMultipleFiles = itemData.length > 1;
|
3093
|
+
var itemNames = itemData.map(function (item) { return item.name; });
|
3094
|
+
var totalSize = isMultipleFiles ? getSize(itemData.reduce(function (accumulator, currentObject) { return accumulator + (currentObject.size || 0); }, 0)) : getSize(details.size);
|
3095
|
+
var path = (parent.pathNames.includes(details.name) ? parent.pathNames.join('/') : parent.pathNames.join('/') + '/' + details.name);
|
3096
|
+
parent.responseData.details = Object.assign({
|
3097
|
+
location: isMultipleFiles ? null : path,
|
3098
|
+
multipleFiles: isMultipleFiles,
|
3099
|
+
name: itemNames.join(', '),
|
3100
|
+
size: totalSize
|
3101
|
+
}, isMultipleFiles ? {} : {
|
3102
|
+
created: details.dateCreated,
|
3103
|
+
isFile: details.isFile,
|
3104
|
+
modified: details.dateModified,
|
3105
|
+
permission: details.permission
|
3106
|
+
});
|
3107
|
+
}
|
3108
|
+
performReadOperation(parent, parent.responseData, fn, data, event, operation, targetPath, beforeSendArgs);
|
3109
|
+
return;
|
3110
|
+
}
|
2637
3111
|
var ajax = new Ajax({
|
2638
3112
|
url: getValue('url', beforeSendArgs.ajaxSettings),
|
2639
3113
|
type: getValue('type', beforeSendArgs.ajaxSettings),
|
@@ -2658,61 +3132,7 @@ parent, data, fn, event, operation, targetPath) {
|
|
2658
3132
|
if (typeof (result) === 'string') {
|
2659
3133
|
result = JSON.parse(result);
|
2660
3134
|
}
|
2661
|
-
parent
|
2662
|
-
var id = parent.expandedId ? parent.expandedId : parent.pathId[parent.pathId.length - 1];
|
2663
|
-
if (!isNullOrUndefined(result.cwd) && (getValue('action', data) === 'read')) {
|
2664
|
-
result.cwd.name = (parent.pathId.length === 1) ? (parent.rootAliasName || result.cwd.name) : result.cwd.name;
|
2665
|
-
setValue('_fm_id', id, result.cwd);
|
2666
|
-
setValue(id, result.cwd, parent.feParent);
|
2667
|
-
if (!isNullOrUndefined(result.files) || result.error.code === '401') {
|
2668
|
-
if ((event === 'finalize-end' || event === 'initial-end') && parent.pathNames.length === 0) {
|
2669
|
-
// eslint-disable-next-line
|
2670
|
-
var root = getValue(parent.pathId[0], parent.feParent);
|
2671
|
-
parent.pathNames[0] = getValue('name', root);
|
2672
|
-
parent.hasId = !isNullOrUndefined(getValue('id', root));
|
2673
|
-
}
|
2674
|
-
if (event === 'finalize-end') {
|
2675
|
-
generatePath(parent);
|
2676
|
-
}
|
2677
|
-
}
|
2678
|
-
}
|
2679
|
-
var intl = new Internationalization(parent.locale);
|
2680
|
-
if (!isNullOrUndefined(result.files)) {
|
2681
|
-
setDateObject(result.files, intl, getDateFormat(parent));
|
2682
|
-
for (var i = 0, len = result.files.length; i < len; i++) {
|
2683
|
-
// eslint-disable-next-line
|
2684
|
-
var item = result.files[i];
|
2685
|
-
setValue('_fm_iconClass', fileType(item), item);
|
2686
|
-
}
|
2687
|
-
if (getValue('action', data) === 'read') {
|
2688
|
-
setNodeId(result, id);
|
2689
|
-
setValue(id, result.files, parent.feFiles);
|
2690
|
-
}
|
2691
|
-
}
|
2692
|
-
if (!isNullOrUndefined(result.details) && !isNullOrUndefined(parent.rootAliasName)) {
|
2693
|
-
var rootName = parent.rootAliasName || getValue('name', result.details);
|
2694
|
-
var location_1 = getValue('location', result.details).replace(new RegExp('/', 'g'), '\\');
|
2695
|
-
if ((getValue('path', data) === '/') || (parent.hasId && getValue('path', data).match(/[/]/g).length === 1)) {
|
2696
|
-
if (getValue('names', data).length === 0) {
|
2697
|
-
setValue('name', rootName, result.details);
|
2698
|
-
location_1 = rootName;
|
2699
|
-
}
|
2700
|
-
else {
|
2701
|
-
location_1 = location_1.replace(location_1.substring(0, location_1.indexOf('\\')), rootName);
|
2702
|
-
}
|
2703
|
-
}
|
2704
|
-
else {
|
2705
|
-
location_1 = location_1.replace(location_1.substring(0, location_1.indexOf('\\')), rootName);
|
2706
|
-
}
|
2707
|
-
setValue('location', location_1, result.details);
|
2708
|
-
}
|
2709
|
-
fn(parent, result, event, operation, targetPath);
|
2710
|
-
if (!isNullOrUndefined(result.files) && (event === 'path-changed' || event === 'finalize-end' || event === 'open-end' || event === 'drop-path')) {
|
2711
|
-
parent.notify(searchTextChange, result);
|
2712
|
-
}
|
2713
|
-
if (typeof getValue('onSuccess', beforeSendArgs.ajaxSettings) === 'function') {
|
2714
|
-
getValue('onSuccess', beforeSendArgs.ajaxSettings)();
|
2715
|
-
}
|
3135
|
+
performReadOperation(parent, result, fn, data, event, operation, targetPath, beforeSendArgs);
|
2716
3136
|
},
|
2717
3137
|
onFailure: function () {
|
2718
3138
|
var result = {
|
@@ -2730,6 +3150,117 @@ parent, data, fn, event, operation, targetPath) {
|
|
2730
3150
|
}
|
2731
3151
|
});
|
2732
3152
|
}
|
3153
|
+
/**
|
3154
|
+
* Function to get file size.
|
3155
|
+
*
|
3156
|
+
* @param {number} size - specifies the size.
|
3157
|
+
* @returns {string} - returns the size.
|
3158
|
+
* @private
|
3159
|
+
*/
|
3160
|
+
function getSize(size) {
|
3161
|
+
var hz;
|
3162
|
+
if (size < 1024) {
|
3163
|
+
hz = size + ' B';
|
3164
|
+
}
|
3165
|
+
else if (size < 1024 * 1024) {
|
3166
|
+
hz = (size / 1024).toFixed(2) + ' KB';
|
3167
|
+
}
|
3168
|
+
else if (size < 1024 * 1024 * 1024) {
|
3169
|
+
hz = (size / 1024 / 1024).toFixed(2) + ' MB';
|
3170
|
+
}
|
3171
|
+
else {
|
3172
|
+
hz = (size / 1024 / 1024 / 1024).toFixed(2) + ' GB';
|
3173
|
+
}
|
3174
|
+
return hz;
|
3175
|
+
}
|
3176
|
+
/**
|
3177
|
+
* Function to perform read operation.
|
3178
|
+
*
|
3179
|
+
* @param {IFileManager} parent - specifies the parent element.
|
3180
|
+
* @param {ReadArgs} result - specifies the result.
|
3181
|
+
* @param {Function} fn - specifies the function.
|
3182
|
+
* @param {Object} data - specifies the data.
|
3183
|
+
* @param {string} event - specifies the event.
|
3184
|
+
* @param {string} operation - specifies the operation.
|
3185
|
+
* @param {string} targetPath - specifies the targetPath.
|
3186
|
+
* @param {BeforeSendEventArgs} beforeSendArgs - specifies the eventArgs.
|
3187
|
+
* @returns {void}
|
3188
|
+
* @private
|
3189
|
+
*/
|
3190
|
+
function performReadOperation(parent, result, fn, data, event, operation, targetPath, beforeSendArgs) {
|
3191
|
+
parent.notify(afterRequest, { action: 'success' });
|
3192
|
+
var id = parent.expandedId ? parent.expandedId : parent.pathId[parent.pathId.length - 1];
|
3193
|
+
if (!isNullOrUndefined(result.cwd) && (getValue('action', data) === 'read')) {
|
3194
|
+
result.cwd.name = (parent.pathId.length === 1) ? (parent.rootAliasName || result.cwd.name) : result.cwd.name;
|
3195
|
+
setValue('_fm_id', id, result.cwd);
|
3196
|
+
setValue(id, result.cwd, parent.feParent);
|
3197
|
+
if (!isNullOrUndefined(result.files) || result.error.code === '401') {
|
3198
|
+
if ((event === 'finalize-end' || event === 'initial-end') && parent.pathNames.length === 0) {
|
3199
|
+
var root = getValue(parent.pathId[0], parent.feParent);
|
3200
|
+
parent.pathNames[0] = getValue('name', root);
|
3201
|
+
parent.hasId = !isNullOrUndefined(getValue('id', root));
|
3202
|
+
}
|
3203
|
+
if (event === 'finalize-end') {
|
3204
|
+
generatePath(parent);
|
3205
|
+
}
|
3206
|
+
}
|
3207
|
+
}
|
3208
|
+
var intl = new Internationalization(parent.locale);
|
3209
|
+
if (!isNullOrUndefined(result.files)) {
|
3210
|
+
setDateObject(result.files, intl, getDateFormat(parent));
|
3211
|
+
for (var i = 0, len = result.files.length; i < len; i++) {
|
3212
|
+
var item = result.files[i];
|
3213
|
+
setValue('_fm_iconClass', fileType(item), item);
|
3214
|
+
}
|
3215
|
+
if (getValue('action', data) === 'read' || isFileSystemData(parent) && getValue('action', data) === 'search') {
|
3216
|
+
setNodeId(result, id);
|
3217
|
+
setValue(id, result.files, parent.feFiles);
|
3218
|
+
}
|
3219
|
+
}
|
3220
|
+
if (!isNullOrUndefined(result.details) && !isNullOrUndefined(parent.rootAliasName)) {
|
3221
|
+
var rootName = parent.rootAliasName || getValue('name', result.details);
|
3222
|
+
var location_1 = getValue('location', result.details).replace(new RegExp('/', 'g'), '\\');
|
3223
|
+
if ((getValue('path', data) === '/') || (parent.hasId && getValue('path', data).match(/[/]/g).length === 1)) {
|
3224
|
+
if (getValue('names', data).length === 0) {
|
3225
|
+
setValue('name', rootName, result.details);
|
3226
|
+
location_1 = rootName;
|
3227
|
+
}
|
3228
|
+
else {
|
3229
|
+
location_1 = location_1.replace(location_1.substring(0, location_1.indexOf('\\')), rootName);
|
3230
|
+
}
|
3231
|
+
}
|
3232
|
+
else {
|
3233
|
+
location_1 = location_1.replace(location_1.substring(0, location_1.indexOf('\\')), rootName);
|
3234
|
+
}
|
3235
|
+
setValue('location', location_1, result.details);
|
3236
|
+
}
|
3237
|
+
fn(parent, result, event, operation, targetPath);
|
3238
|
+
if (!isNullOrUndefined(result.files) && (event === 'path-changed' || event === 'finalize-end' || event === 'open-end' || event === 'drop-path')) {
|
3239
|
+
parent.notify(searchTextChange, result);
|
3240
|
+
}
|
3241
|
+
if (typeof getValue('onSuccess', beforeSendArgs.ajaxSettings) === 'function') {
|
3242
|
+
getValue('onSuccess', beforeSendArgs.ajaxSettings)();
|
3243
|
+
}
|
3244
|
+
}
|
3245
|
+
/**
|
3246
|
+
* Function to copy operation.
|
3247
|
+
*
|
3248
|
+
* @param {IFileManager} parent - specifies the parent element.
|
3249
|
+
* @param {Object} data - specifies the data.
|
3250
|
+
* @param {string} target - specifies the target.
|
3251
|
+
* @param {string} itemName - specifies the item name.
|
3252
|
+
* @returns {void}
|
3253
|
+
* @private
|
3254
|
+
*/
|
3255
|
+
function copyFolderItems(parent, data, target, itemName) {
|
3256
|
+
var newObject = createNewItem(data, target, itemName, true);
|
3257
|
+
parent.fileSystemData.push(newObject);
|
3258
|
+
parent.pasteNodes.push(newObject.id);
|
3259
|
+
var copiedItems = filterByParent(parent, data.id);
|
3260
|
+
for (var i = 0; i < copiedItems.length; i++) {
|
3261
|
+
copyFolderItems(parent, copiedItems[i], newObject, null);
|
3262
|
+
}
|
3263
|
+
}
|
2733
3264
|
/**
|
2734
3265
|
* Function for trigger Ajax failure in File Manager.
|
2735
3266
|
*
|
@@ -2743,9 +3274,7 @@ parent, data, fn, event, operation, targetPath) {
|
|
2743
3274
|
* @returns {void}
|
2744
3275
|
* @private
|
2745
3276
|
*/
|
2746
|
-
function triggerAjaxFailure(
|
2747
|
-
// eslint-disable-next-line
|
2748
|
-
parent, beforeSendArgs, fn, result, event, operation, targetPath) {
|
3277
|
+
function triggerAjaxFailure(parent, beforeSendArgs, fn, result, event, operation, targetPath) {
|
2749
3278
|
parent.notify(afterRequest, { action: 'failure' });
|
2750
3279
|
fn(parent, result, event, operation, targetPath);
|
2751
3280
|
if (typeof getValue('onFailure', beforeSendArgs.ajaxSettings) === 'function') {
|
@@ -2821,8 +3350,14 @@ function createSuccess(parent, result, itemName) {
|
|
2821
3350
|
if (parent.dialogObj && parent.dialogObj.visible) {
|
2822
3351
|
parent.dialogObj.hide();
|
2823
3352
|
}
|
2824
|
-
parent.createdItem = result.files[0];
|
3353
|
+
parent.createdItem = isFileSystemData(parent) ? result.files[result.files.length - 1] : result.files[0];
|
2825
3354
|
parent.breadcrumbbarModule.searchObj.value = '';
|
3355
|
+
var createEventArgs = {
|
3356
|
+
folderName: itemName,
|
3357
|
+
path: parent.path,
|
3358
|
+
parentFolder: parent.itemData
|
3359
|
+
};
|
3360
|
+
parent.trigger('folderCreate', createEventArgs);
|
2826
3361
|
var args = { action: 'create', result: result };
|
2827
3362
|
parent.trigger('success', args);
|
2828
3363
|
parent.itemData = [getPathObject(parent)];
|
@@ -2863,11 +3398,10 @@ function createSuccess(parent, result, itemName) {
|
|
2863
3398
|
*
|
2864
3399
|
* @param {IFileManager} parent - specifies the parent element.
|
2865
3400
|
* @param {ReadArgs} result - specifies the result.
|
2866
|
-
* @param {string} path - specifies the path
|
2867
3401
|
* @returns {void}
|
2868
3402
|
* @private
|
2869
3403
|
*/
|
2870
|
-
function renameSuccess(parent, result
|
3404
|
+
function renameSuccess(parent, result) {
|
2871
3405
|
if (!isNullOrUndefined(result.files)) {
|
2872
3406
|
if (!isNullOrUndefined(parent.dialogObj)) {
|
2873
3407
|
parent.dialogObj.hide();
|
@@ -2875,15 +3409,22 @@ function renameSuccess(parent, result, path) {
|
|
2875
3409
|
var args = { action: 'rename', result: result };
|
2876
3410
|
parent.trigger('success', args);
|
2877
3411
|
parent.renamedItem = Array.isArray(result.files) ? result.files[0] : result.files;
|
3412
|
+
var renameEventArgs = {
|
3413
|
+
newName: parent.renamedItem.name,
|
3414
|
+
itemData: parent.renamedItem,
|
3415
|
+
path: parent.path
|
3416
|
+
};
|
3417
|
+
parent.trigger('rename', renameEventArgs);
|
2878
3418
|
if (parent.activeModule === 'navigationpane') {
|
2879
3419
|
parent.pathId.pop();
|
2880
3420
|
parent.itemData = [getValue(parent.pathId[parent.pathId.length - 1], parent.feParent)];
|
2881
3421
|
read(parent, renameEndParent, getValue('filterPath', parent.renamedItem).replace(/\\/g, '/'));
|
2882
3422
|
parent.itemData[0] = parent.renamedItem;
|
2883
|
-
read(parent, pathChanged, parent.path === '/' ? parent.path : getValue('filterPath', parent.renamedItem).replace(/\\/g, '/') + parent.renamedItem.name + '/');
|
2884
3423
|
if (getValue('filterPath', parent.renamedItem) === getValue('filterPath', parent.itemData[0]) && parent.pathNames.length > 1) {
|
2885
3424
|
parent.pathNames[parent.pathNames.length - 1] = parent.renameText;
|
2886
3425
|
}
|
3426
|
+
read(parent, pathChanged, parent.path === '/' ? parent.path : getValue('filterPath', parent.renamedItem).replace(/\\/g, '/') + parent.renamedItem.name + '/');
|
3427
|
+
parent.renamedItem = null;
|
2887
3428
|
}
|
2888
3429
|
else {
|
2889
3430
|
parent.itemData = [getPathObject(parent)];
|
@@ -2929,6 +3470,14 @@ function renameSuccess(parent, result, path) {
|
|
2929
3470
|
* @private
|
2930
3471
|
*/
|
2931
3472
|
function pasteSuccess(parent, result, path, operation) {
|
3473
|
+
var moveorcopyEventArgs = {
|
3474
|
+
itemData: result.files,
|
3475
|
+
isCopy: operation === 'copy' ? true : false,
|
3476
|
+
path: path,
|
3477
|
+
targetData: parent.itemData[0],
|
3478
|
+
targetPath: parent.path
|
3479
|
+
};
|
3480
|
+
parent.trigger('move', moveorcopyEventArgs);
|
2932
3481
|
if (result.error && result.error.fileExists) {
|
2933
3482
|
parent.fileLength = 0;
|
2934
3483
|
if (!isNullOrUndefined(result.files)) {
|
@@ -2963,6 +3512,11 @@ function pasteSuccess(parent, result, path, operation) {
|
|
2963
3512
|
* @private
|
2964
3513
|
*/
|
2965
3514
|
function deleteSuccess(parent, result, path) {
|
3515
|
+
var deleteEventArgs = {
|
3516
|
+
itemData: result.files,
|
3517
|
+
path: path
|
3518
|
+
};
|
3519
|
+
parent.trigger('delete', deleteEventArgs);
|
2966
3520
|
if (!isNullOrUndefined(result.files)) {
|
2967
3521
|
parent.setProperties({ path: path }, true);
|
2968
3522
|
parent.itemData = [getPathObject(parent)];
|
@@ -3027,10 +3581,7 @@ function onFailure(parent, result, action) {
|
|
3027
3581
|
* @returns {void}
|
3028
3582
|
* @private
|
3029
3583
|
*/
|
3030
|
-
function Search(
|
3031
|
-
// eslint:disable-next-line
|
3032
|
-
parent, event, path, searchString, showHiddenItems, caseSensitive) {
|
3033
|
-
// eslint-disable-next-line
|
3584
|
+
function Search(parent, event, path, searchString, showHiddenItems, caseSensitive) {
|
3034
3585
|
var data = {
|
3035
3586
|
action: 'search', path: path, searchString: searchString, showHiddenItems: showHiddenItems, caseSensitive: caseSensitive,
|
3036
3587
|
data: parent.itemData
|
@@ -3069,7 +3620,6 @@ function searchSuccess(parent, result, event) {
|
|
3069
3620
|
*/
|
3070
3621
|
function Download(parent, path, items) {
|
3071
3622
|
var downloadUrl = parent.ajaxSettings.downloadUrl ? parent.ajaxSettings.downloadUrl : parent.ajaxSettings.url;
|
3072
|
-
// eslint-disable-next-line
|
3073
3623
|
var data = { 'action': 'download', 'path': path, 'names': items, 'data': parent.itemData };
|
3074
3624
|
var ajaxSettings = {
|
3075
3625
|
url: downloadUrl,
|
@@ -3133,12 +3683,12 @@ function Download(parent, path, items) {
|
|
3133
3683
|
var result = {
|
3134
3684
|
error: {
|
3135
3685
|
code: e.status.toString(),
|
3136
|
-
message: getLocaleText(parent, 'Network-Error') + ' ' + parent.ajaxSettings.downloadUrl
|
3137
|
-
}
|
3686
|
+
message: getLocaleText(parent, 'Network-Error') + ' ' + parent.ajaxSettings.downloadUrl
|
3687
|
+
}
|
3138
3688
|
};
|
3139
3689
|
createDialog(parent, 'Error', result);
|
3140
3690
|
parent.trigger('failure', downloadArgs);
|
3141
|
-
}
|
3691
|
+
}
|
3142
3692
|
});
|
3143
3693
|
fetch_1.send(JSON.stringify(downloadArgs.data));
|
3144
3694
|
}
|
@@ -3152,12 +3702,11 @@ function Download(parent, path, items) {
|
|
3152
3702
|
* @param {string} text - specifies the text string.
|
3153
3703
|
* @param {ReadArgs | SelectedEventArgs} e - specifies the type of event args.
|
3154
3704
|
* @param {FileDetails} details - specifies the file details.
|
3155
|
-
* @param {string[]} replaceItems - specifies the replacement.
|
3156
3705
|
* @returns {void}
|
3157
3706
|
* @private
|
3158
3707
|
*/
|
3159
|
-
function createDialog(parent, text, e, details
|
3160
|
-
var options = getOptions(parent, text, e, details
|
3708
|
+
function createDialog(parent, text, e, details) {
|
3709
|
+
var options = getOptions(parent, text, e, details);
|
3161
3710
|
if (isNullOrUndefined(parent.dialogObj)) {
|
3162
3711
|
parent.dialogObj = new Dialog({
|
3163
3712
|
beforeOpen: keydownAction.bind(this, parent, options.dialogName),
|
@@ -3678,11 +4227,10 @@ function createInput(ele, placeholder) {
|
|
3678
4227
|
* @param {string} text - specifies the text string.
|
3679
4228
|
* @param {ReadArgs | SelectedEventArgs} e - specifies the event arguements.
|
3680
4229
|
* @param {FileDetails} details - specifies the file details.
|
3681
|
-
* @param {string[]} replaceItems - specifies the replacement items.
|
3682
4230
|
* @returns {DialogOptions} - specifies the dialog options.
|
3683
4231
|
* @private
|
3684
4232
|
*/
|
3685
|
-
function getOptions(parent, text, e, details
|
4233
|
+
function getOptions(parent, text, e, details) {
|
3686
4234
|
var options = {
|
3687
4235
|
header: '', content: '', buttons: [], dialogName: ''
|
3688
4236
|
};
|
@@ -3690,11 +4238,12 @@ function getOptions(parent, text, e, details, replaceItems) {
|
|
3690
4238
|
var formattedString;
|
3691
4239
|
var intl;
|
3692
4240
|
var strArr;
|
3693
|
-
var fileType
|
4241
|
+
var fileType;
|
3694
4242
|
var location;
|
3695
4243
|
options.open = function () { triggerPopupOpen(parent, parent.dialogObj, options.dialogName); };
|
3696
4244
|
options.close = function () { triggerPopupClose(parent, parent.dialogObj, options.dialogName); };
|
3697
4245
|
text = (details && details.multipleFiles === true) ? 'MultipleFileDetails' : text;
|
4246
|
+
var index;
|
3698
4247
|
switch (text) {
|
3699
4248
|
case 'NewFolder':
|
3700
4249
|
options.dialogName = 'Create Folder';
|
@@ -3727,7 +4276,7 @@ function getOptions(parent, text, e, details, replaceItems) {
|
|
3727
4276
|
options.buttons = [
|
3728
4277
|
{
|
3729
4278
|
buttonModel: { isPrimary: true, content: getLocaleText(parent, 'Button-Yes') },
|
3730
|
-
click: function (
|
4279
|
+
click: function () {
|
3731
4280
|
onDeleteSubmit(parent);
|
3732
4281
|
}
|
3733
4282
|
},
|
@@ -3779,31 +4328,30 @@ function getOptions(parent, text, e, details, replaceItems) {
|
|
3779
4328
|
options.buttons = [
|
3780
4329
|
{
|
3781
4330
|
buttonModel: { isPrimary: true, content: getLocaleText(parent, 'Button-Ok') },
|
3782
|
-
click: function (
|
4331
|
+
click: function () {
|
3783
4332
|
parent.dialogObj.hide();
|
3784
4333
|
}
|
3785
4334
|
}
|
3786
4335
|
];
|
3787
4336
|
break;
|
3788
4337
|
case 'MultipleFileDetails':
|
3789
|
-
var index_1;
|
3790
4338
|
options.dialogName = 'File Details';
|
3791
4339
|
strArr = parent.itemData.map(function (val) {
|
3792
|
-
|
3793
|
-
return (
|
4340
|
+
index = val.name.indexOf('.') + 1;
|
4341
|
+
return (index === 0 && (!val.isFile)) ? 'Folder' : ((index !== 0) ? val.name.substr(index).replace(' ', '') : 'undetermined');
|
3794
4342
|
});
|
3795
|
-
if (strArr[0]
|
4343
|
+
if (strArr[0] === undefined) {
|
3796
4344
|
strArr = details.name.split(',').map(function (val) {
|
3797
|
-
|
3798
|
-
return (
|
4345
|
+
index = val.indexOf('.') + 1;
|
4346
|
+
return (index === 0) ? 'Folder' : val.substr(index).replace(' ', '');
|
3799
4347
|
});
|
3800
4348
|
}
|
3801
|
-
fileType
|
4349
|
+
fileType = strArr.every(function (val, i, arr) { return val === arr[0]; }) ?
|
3802
4350
|
((strArr[0] === 'Folder') ? 'Folder' : strArr[0].toLocaleUpperCase() + ' Type') : 'Multiple Types';
|
3803
4351
|
location = details.location;
|
3804
4352
|
options.header = details.name;
|
3805
4353
|
options.content = '<table><tr><td>' + getLocaleText(parent, 'Type')
|
3806
|
-
+ ':</td><td class="' + VALUE + '">' + fileType
|
4354
|
+
+ ':</td><td class="' + VALUE + '">' + fileType + '</td></tr>' +
|
3807
4355
|
'<tr><td>' + getLocaleText(parent, 'Size') + ':</td><td>' +
|
3808
4356
|
details.size + '<span class="' + VALUE + '" title ="' + details.size
|
3809
4357
|
+ '"></span></td></tr>' + '<tr><td>' + getLocaleText(parent, 'Location') +
|
@@ -3835,7 +4383,7 @@ function getOptions(parent, text, e, details, replaceItems) {
|
|
3835
4383
|
options.buttons = [
|
3836
4384
|
{
|
3837
4385
|
buttonModel: { isPrimary: true, content: getLocaleText(parent, 'Button-Ok') },
|
3838
|
-
click: function (
|
4386
|
+
click: function () {
|
3839
4387
|
parent.dialogObj.hide();
|
3840
4388
|
}
|
3841
4389
|
}
|
@@ -4132,10 +4680,6 @@ function updateImage(parent) {
|
|
4132
4680
|
imgWrap.style.height = (content.offsetHeight - paddingHeight) + 'px';
|
4133
4681
|
}
|
4134
4682
|
|
4135
|
-
/**
|
4136
|
-
* File Manager common operations
|
4137
|
-
*/
|
4138
|
-
|
4139
4683
|
/**
|
4140
4684
|
* LargeIconsView module
|
4141
4685
|
*/
|
@@ -4246,11 +4790,10 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4246
4790
|
}
|
4247
4791
|
this.parent.virtualizationModule.setUIVirtualization();
|
4248
4792
|
}
|
4249
|
-
// eslint-disable-next-line
|
4250
4793
|
this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
|
4251
4794
|
this.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.listElements));
|
4252
4795
|
this.element.appendChild(this.listElements);
|
4253
|
-
this.listElements.setAttribute(
|
4796
|
+
this.listElements.setAttribute('aria-label', 'listbox');
|
4254
4797
|
this.preventImgDrag();
|
4255
4798
|
this.createDragObj();
|
4256
4799
|
if (this.itemList.length === 0) {
|
@@ -4298,7 +4841,7 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4298
4841
|
}
|
4299
4842
|
}
|
4300
4843
|
};
|
4301
|
-
LargeIconsView.prototype.comparer = function (x, y
|
4844
|
+
LargeIconsView.prototype.comparer = function (x, y) {
|
4302
4845
|
if (this.parent.sortOrder === 'Descending') {
|
4303
4846
|
var z = x;
|
4304
4847
|
x = y;
|
@@ -4306,7 +4849,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4306
4849
|
}
|
4307
4850
|
return this.parent.sortComparer(x, y);
|
4308
4851
|
};
|
4309
|
-
|
4310
4852
|
LargeIconsView.prototype.preventImgDrag = function () {
|
4311
4853
|
var i = 0;
|
4312
4854
|
while (i < this.itemList.length) {
|
@@ -4358,8 +4900,7 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4358
4900
|
this.parent.activeElements = [];
|
4359
4901
|
this.parent.dragData = [];
|
4360
4902
|
for (var i = 0; i < activeEle.length; i++) {
|
4361
|
-
|
4362
|
-
this.parent.dragData.push(this.getItemObject(activeEle[i]));
|
4903
|
+
this.parent.dragData.push(this.getItemObject(activeEle[parseInt(i.toString(), 10)]));
|
4363
4904
|
this.parent.activeElements.push(activeEle[i]);
|
4364
4905
|
}
|
4365
4906
|
getModule(this.parent, dragLi);
|
@@ -4370,10 +4911,8 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4370
4911
|
LargeIconsView.prototype.onDropInit = function (args) {
|
4371
4912
|
if (this.parent.targetModule === this.getModuleName()) {
|
4372
4913
|
var dropLi = closest(args.target, '.e-list-item');
|
4373
|
-
// eslint-disable-next-line
|
4374
4914
|
var cwdData = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feParent);
|
4375
4915
|
if (dropLi) {
|
4376
|
-
// eslint-disable-next-line
|
4377
4916
|
var info = this.getItemObject(dropLi);
|
4378
4917
|
this.parent.dropPath = info.isFile ? this.parent.path : getFullPath(this.parent, info, this.parent.path);
|
4379
4918
|
this.parent.dropData = info.isFile ? cwdData : info;
|
@@ -4465,10 +5004,8 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4465
5004
|
}
|
4466
5005
|
}
|
4467
5006
|
};
|
4468
|
-
// eslint-disable-next-line
|
4469
5007
|
LargeIconsView.prototype.renderList = function (args) {
|
4470
5008
|
var i = 0;
|
4471
|
-
// eslint-disable-next-line
|
4472
5009
|
var items = JSON.parse(JSON.stringify(args.files));
|
4473
5010
|
while (i < items.length) {
|
4474
5011
|
var icon = fileType(items[i]);
|
@@ -4550,7 +5087,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4550
5087
|
if (this.parent.renamedItem) {
|
4551
5088
|
this.clearSelect();
|
4552
5089
|
this.addSelection(this.parent.renamedItem);
|
4553
|
-
this.parent.renamedItem = null;
|
4554
5090
|
}
|
4555
5091
|
}
|
4556
5092
|
};
|
@@ -4692,7 +5228,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4692
5228
|
this.parent.on(filterEnd, this.onPathChanged, this);
|
4693
5229
|
};
|
4694
5230
|
LargeIconsView.prototype.onActionFailure = function () { this.isInteraction = true; this.isInteracted = true; };
|
4695
|
-
// eslint-disable-next-line
|
4696
5231
|
LargeIconsView.prototype.onMenuItemData = function (args) {
|
4697
5232
|
if (this.parent.activeModule === this.getModuleName()) {
|
4698
5233
|
var ele = closest(args.target, 'li');
|
@@ -4830,38 +5365,37 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4830
5365
|
}
|
4831
5366
|
};
|
4832
5367
|
LargeIconsView.prototype.wireClickEvent = function (toBind) {
|
5368
|
+
var _this = this;
|
4833
5369
|
if (toBind) {
|
4834
|
-
// eslint-disable-next-line
|
4835
|
-
var proxy_1 = this;
|
4836
5370
|
this.clickObj = new Touch(this.element, {
|
4837
5371
|
tap: function (eve) {
|
4838
5372
|
eve.originalEvent.preventDefault();
|
4839
|
-
if (
|
4840
|
-
|
4841
|
-
|
5373
|
+
if (_this.parent.isDevice) {
|
5374
|
+
_this.tapCount = eve.tapCount;
|
5375
|
+
_this.tapEvent = eve;
|
4842
5376
|
setTimeout(function () {
|
4843
|
-
if (
|
4844
|
-
|
5377
|
+
if (_this.tapCount > 0) {
|
5378
|
+
_this.doTapAction(_this.tapEvent);
|
4845
5379
|
}
|
4846
|
-
|
5380
|
+
_this.tapCount = 0;
|
4847
5381
|
}, 350);
|
4848
5382
|
}
|
4849
5383
|
else {
|
4850
5384
|
if (eve.tapCount === 2 && eve.originalEvent.which !== 3) {
|
4851
|
-
|
5385
|
+
_this.dblClickHandler(eve);
|
4852
5386
|
}
|
4853
5387
|
else {
|
4854
|
-
|
5388
|
+
_this.clickHandler(eve);
|
4855
5389
|
}
|
4856
5390
|
}
|
4857
5391
|
},
|
4858
5392
|
tapHold: function (e) {
|
4859
|
-
if (
|
4860
|
-
|
4861
|
-
if (
|
4862
|
-
addClass([
|
5393
|
+
if (_this.parent.isDevice) {
|
5394
|
+
_this.multiSelect = _this.parent.allowMultiSelection ? true : false;
|
5395
|
+
if (_this.parent.allowMultiSelection) {
|
5396
|
+
addClass([_this.parent.element], MULTI_SELECT);
|
4863
5397
|
}
|
4864
|
-
|
5398
|
+
_this.clickHandler(e);
|
4865
5399
|
}
|
4866
5400
|
}
|
4867
5401
|
});
|
@@ -4912,6 +5446,7 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
4912
5446
|
this.parent.isFile = false;
|
4913
5447
|
var action = 'select';
|
4914
5448
|
if (e.which === 3 && !isNullOrUndefined(item) && item.classList.contains(ACTIVE)) {
|
5449
|
+
this.addActive(item);
|
4915
5450
|
this.updateType(item);
|
4916
5451
|
return;
|
4917
5452
|
}
|
@@ -5002,7 +5537,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5002
5537
|
this.parent.isFile = false;
|
5003
5538
|
if (!isNullOrUndefined(item)) {
|
5004
5539
|
this.updateType(item);
|
5005
|
-
// eslint-disable-next-line
|
5006
5540
|
var details_1 = this.getItemObject(item);
|
5007
5541
|
if (!hasReadAccess(details_1)) {
|
5008
5542
|
createDeniedDialog(this.parent, details_1, permissionRead);
|
@@ -5046,7 +5580,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5046
5580
|
this.parent.isFile = isNullOrUndefined(folder) ? true : false;
|
5047
5581
|
};
|
5048
5582
|
/* istanbul ignore next */
|
5049
|
-
// eslint:disable-next-line
|
5050
5583
|
LargeIconsView.prototype.keydownActionHandler = function (e) {
|
5051
5584
|
if (!this.isRendered) {
|
5052
5585
|
return;
|
@@ -5090,12 +5623,9 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5090
5623
|
case 'ctrlD':
|
5091
5624
|
e.preventDefault();
|
5092
5625
|
break;
|
5093
|
-
default:
|
5094
|
-
break;
|
5095
5626
|
}
|
5096
5627
|
};
|
5097
5628
|
/* istanbul ignore next */
|
5098
|
-
// eslint:disable-next-line
|
5099
5629
|
LargeIconsView.prototype.keyActionHandler = function (e) {
|
5100
5630
|
var _this = this;
|
5101
5631
|
if (!this.isRendered) {
|
@@ -5231,7 +5761,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5231
5761
|
LargeIconsView.prototype.performDelete = function () {
|
5232
5762
|
if (this.parent.selectedItems && this.parent.selectedItems.length > 0) {
|
5233
5763
|
this.updateSelectedData();
|
5234
|
-
// eslint-disable-next-line
|
5235
5764
|
var data = this.parent.itemData;
|
5236
5765
|
for (var i = 0; i < data.length; i++) {
|
5237
5766
|
if (!hasEditAccess(data[i])) {
|
@@ -5250,7 +5779,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5250
5779
|
};
|
5251
5780
|
LargeIconsView.prototype.updateRenameData = function () {
|
5252
5781
|
var item = select('.' + LIST_ITEM + '.' + ACTIVE, this.element);
|
5253
|
-
// eslint-disable-next-line
|
5254
5782
|
var data = this.getItemObject(item);
|
5255
5783
|
updateRenamingData(this.parent, data);
|
5256
5784
|
};
|
@@ -5466,7 +5994,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5466
5994
|
}
|
5467
5995
|
};
|
5468
5996
|
LargeIconsView.prototype.getDataName = function (item) {
|
5469
|
-
// eslint-disable-next-line
|
5470
5997
|
var data = this.getItemObject(item);
|
5471
5998
|
return getItemName(this.parent, data);
|
5472
5999
|
};
|
@@ -5539,7 +6066,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5539
6066
|
this.perRow = perRow;
|
5540
6067
|
};
|
5541
6068
|
LargeIconsView.prototype.triggerSelection = function (action, item) {
|
5542
|
-
// eslint-disable-next-line
|
5543
6069
|
var data = [];
|
5544
6070
|
if (this.isSelectAllCalled) {
|
5545
6071
|
for (var i = 0, len = this.itemList.length; i < len; i++) {
|
@@ -5549,15 +6075,15 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5549
6075
|
else {
|
5550
6076
|
data[0] = this.getItemObject(item);
|
5551
6077
|
}
|
5552
|
-
var eventArgs = {
|
5553
|
-
|
6078
|
+
var eventArgs = { action: action, fileDetails: data.length > 1
|
6079
|
+
? data : data[0], isInteracted: this.isInteraction, cancel: false, target: this.isSelectAllCalled ? null
|
6080
|
+
: item
|
5554
6081
|
};
|
5555
6082
|
this.parent.trigger('fileSelection', eventArgs);
|
5556
6083
|
this.isInteraction = true;
|
5557
6084
|
return eventArgs;
|
5558
6085
|
};
|
5559
6086
|
LargeIconsView.prototype.triggerSelect = function (action, item) {
|
5560
|
-
// eslint-disable-next-line
|
5561
6087
|
var data = [];
|
5562
6088
|
if (this.isSelectAllCalled) {
|
5563
6089
|
for (var i = 0, len = this.itemList.length; i < len; i++) {
|
@@ -5569,7 +6095,9 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5569
6095
|
data[0] = this.getItemObject(item);
|
5570
6096
|
}
|
5571
6097
|
this.parent.visitedData = data.length > 1 ? data[data.length - 1] : data[0];
|
5572
|
-
var eventArgs = { action: action, fileDetails: data.length > 1
|
6098
|
+
var eventArgs = { action: action, fileDetails: data.length > 1
|
6099
|
+
? data
|
6100
|
+
: data[0], isInteracted: this.isInteracted };
|
5573
6101
|
this.parent.trigger('fileSelect', eventArgs);
|
5574
6102
|
this.isInteracted = true;
|
5575
6103
|
};
|
@@ -5582,29 +6110,25 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5582
6110
|
};
|
5583
6111
|
LargeIconsView.prototype.getIndexes = function (items, byId) {
|
5584
6112
|
var indexes = [];
|
5585
|
-
var filter
|
6113
|
+
var filter = byId ? 'id' : 'name';
|
5586
6114
|
for (var i = 0, len = this.items.length; i < len; i++) {
|
5587
|
-
if (items.indexOf(getValue(filter
|
6115
|
+
if (items.indexOf(getValue(filter, this.items[i])) !== -1) {
|
5588
6116
|
indexes.push(i);
|
5589
6117
|
}
|
5590
6118
|
}
|
5591
6119
|
return indexes;
|
5592
6120
|
};
|
5593
|
-
// eslint-disable-next-line
|
5594
6121
|
LargeIconsView.prototype.getItemObject = function (item) {
|
5595
6122
|
var index = this.itemList.indexOf(item);
|
5596
6123
|
return this.items[index];
|
5597
6124
|
};
|
5598
|
-
// eslint-disable-next-line
|
5599
6125
|
LargeIconsView.prototype.addSelection = function (data) {
|
5600
|
-
// eslint-disable-next-line
|
5601
6126
|
var resultData = [];
|
5602
6127
|
if (this.parent.hasId) {
|
5603
6128
|
resultData = new DataManager(this.items).
|
5604
6129
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
5605
6130
|
}
|
5606
6131
|
else {
|
5607
|
-
// eslint-disable-next-line
|
5608
6132
|
var newData = new DataManager(this.items).
|
5609
6133
|
executeLocal(new Query().where('name', 'equal', getValue('name', data), false));
|
5610
6134
|
if (newData.length > 0) {
|
@@ -5619,7 +6143,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5619
6143
|
}
|
5620
6144
|
};
|
5621
6145
|
LargeIconsView.prototype.updateSelectedData = function () {
|
5622
|
-
// eslint-disable-next-line
|
5623
6146
|
var data = [];
|
5624
6147
|
var items = selectAll('.' + LIST_ITEM + '.' + ACTIVE, this.element);
|
5625
6148
|
for (var i = 0; i < items.length; i++) {
|
@@ -5627,7 +6150,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5627
6150
|
}
|
5628
6151
|
this.parent.itemData = data;
|
5629
6152
|
};
|
5630
|
-
// eslint-disable-next-line
|
5631
6153
|
LargeIconsView.prototype.onMethodCall = function (args) {
|
5632
6154
|
if (this.parent.view !== 'LargeIcons') {
|
5633
6155
|
return;
|
@@ -5695,7 +6217,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5695
6217
|
if (indexes.length === 0) {
|
5696
6218
|
return;
|
5697
6219
|
}
|
5698
|
-
// eslint-disable-next-line
|
5699
6220
|
var data = [];
|
5700
6221
|
var newIds = [];
|
5701
6222
|
for (var i = 0; i < indexes.length; i++) {
|
@@ -5713,7 +6234,6 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
|
|
5713
6234
|
if (index.length === 0) {
|
5714
6235
|
return;
|
5715
6236
|
}
|
5716
|
-
// eslint-disable-next-line
|
5717
6237
|
var data = [];
|
5718
6238
|
var newIds = [];
|
5719
6239
|
for (var i = 0; i < index.length; i++) {
|
@@ -5891,8 +6411,8 @@ var BreadCrumbBar = /** @__PURE__ @class */ (function () {
|
|
5891
6411
|
});
|
5892
6412
|
this.searchObj.appendTo('#' + this.parent.element.id + SEARCH_ID);
|
5893
6413
|
this.searchEventBind(this.parent.searchSettings.allowSearchOnTyping);
|
5894
|
-
var search
|
5895
|
-
EventHandler.add(search
|
6414
|
+
var search = this.searchObj.element.nextElementSibling;
|
6415
|
+
EventHandler.add(search, 'mousedown', this.searchChangeHandler.bind(this), this);
|
5896
6416
|
EventHandler.add(this.searchObj.element, 'keyup', this.onKeyUp.bind(this), this);
|
5897
6417
|
}
|
5898
6418
|
var searchWrap = this.parent.breadCrumbBarNavigation.querySelector('.e-search-wrap');
|
@@ -5906,7 +6426,6 @@ var BreadCrumbBar = /** @__PURE__ @class */ (function () {
|
|
5906
6426
|
breadCrumbBarWidth = diff;
|
5907
6427
|
}
|
5908
6428
|
else {
|
5909
|
-
// eslint-disable-next-line
|
5910
6429
|
var items = [];
|
5911
6430
|
for (var j = 0; j <= i; j++) {
|
5912
6431
|
var liElement = liElements[j];
|
@@ -5916,7 +6435,6 @@ var BreadCrumbBar = /** @__PURE__ @class */ (function () {
|
|
5916
6435
|
});
|
5917
6436
|
}
|
5918
6437
|
var subMenuLi = this.parent.createElement('li', { className: 'e-breadcrumb-menu' });
|
5919
|
-
// eslint-disable-next-line
|
5920
6438
|
var attributes = { className: 'e-breadcrumb-submenu' };
|
5921
6439
|
var subMenuSpan = this.parent.createElement('button', attributes);
|
5922
6440
|
subMenuLi.appendChild(subMenuSpan);
|
@@ -5957,7 +6475,6 @@ var BreadCrumbBar = /** @__PURE__ @class */ (function () {
|
|
5957
6475
|
};
|
5958
6476
|
/* istanbul ignore next */
|
5959
6477
|
BreadCrumbBar.prototype.subMenuSelectOperations = function (event) {
|
5960
|
-
// eslint-disable-next-line
|
5961
6478
|
var args = { target: event.element };
|
5962
6479
|
this.addressPathClickHandler(args);
|
5963
6480
|
};
|
@@ -6005,7 +6522,6 @@ var BreadCrumbBar = /** @__PURE__ @class */ (function () {
|
|
6005
6522
|
}
|
6006
6523
|
}
|
6007
6524
|
};
|
6008
|
-
// eslint-disable-next-line
|
6009
6525
|
BreadCrumbBar.prototype.triggerFileOpen = function (data) {
|
6010
6526
|
var eventArgs = { cancel: false, fileDetails: data, module: 'BreadCrumbBar' };
|
6011
6527
|
delete eventArgs.cancel;
|
@@ -6163,14 +6679,14 @@ var BreadCrumbBar = /** @__PURE__ @class */ (function () {
|
|
6163
6679
|
/**
|
6164
6680
|
* ContextMenu module
|
6165
6681
|
*/
|
6166
|
-
var ContextMenu
|
6682
|
+
var ContextMenu = /** @__PURE__ @class */ (function () {
|
6167
6683
|
/**
|
6168
6684
|
* Constructor for the ContextMenu module
|
6169
6685
|
*
|
6170
6686
|
* @param {IFileManager} parent - Specifies the parent element.
|
6171
6687
|
* @hidden
|
6172
6688
|
*/
|
6173
|
-
function ContextMenu
|
6689
|
+
function ContextMenu(parent) {
|
6174
6690
|
this.isMenuItemClicked = false;
|
6175
6691
|
this.currentItems = [];
|
6176
6692
|
this.currentElement = null;
|
@@ -6178,12 +6694,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6178
6694
|
this.parent = parent;
|
6179
6695
|
this.render();
|
6180
6696
|
}
|
6181
|
-
ContextMenu
|
6697
|
+
ContextMenu.prototype.render = function () {
|
6182
6698
|
this.keyConfigs = {
|
6183
6699
|
downarrow: 'downarrow',
|
6184
6700
|
uparrow: 'uparrown'
|
6185
6701
|
};
|
6186
|
-
this.contextMenu = new ContextMenu({
|
6702
|
+
this.contextMenu = new ContextMenu$1({
|
6187
6703
|
enableRtl: this.parent.enableRtl,
|
6188
6704
|
locale: this.parent.locale,
|
6189
6705
|
target: '#' + this.parent.element.id,
|
@@ -6199,7 +6715,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6199
6715
|
this.addEventListener();
|
6200
6716
|
};
|
6201
6717
|
/* istanbul ignore next */
|
6202
|
-
ContextMenu
|
6718
|
+
ContextMenu.prototype.onBeforeItemRender = function (args) {
|
6203
6719
|
if (args.item.id === this.getMenuId('largeiconsview')) {
|
6204
6720
|
var iconSpan = createElement('span');
|
6205
6721
|
var element = args.element;
|
@@ -6213,14 +6729,15 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6213
6729
|
iconSpan.setAttribute('class', ICON_GRID + ' ' + MENU_ICON);
|
6214
6730
|
}
|
6215
6731
|
};
|
6216
|
-
ContextMenu
|
6732
|
+
ContextMenu.prototype.onBeforeClose = function () {
|
6217
6733
|
this.menuTarget = null;
|
6218
|
-
if (!this.isMenuItemClicked && this.parent.pathId.length > 1 && this.parent.activeModule
|
6734
|
+
if (!this.isMenuItemClicked && this.parent.pathId.length > 1 && this.parent.activeModule === 'navigationpane') {
|
6219
6735
|
this.parent.pathId.pop();
|
6220
6736
|
var parentKey = [];
|
6221
6737
|
var itemKeys = Object.keys(this.parent.feParent);
|
6222
6738
|
for (var _i = 0, itemKeys_1 = itemKeys; _i < itemKeys_1.length; _i++) {
|
6223
6739
|
var item = itemKeys_1[_i];
|
6740
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
6224
6741
|
var itemData = getValue(item, this.parent.feParent);
|
6225
6742
|
if (this.parent.pathNames.indexOf(itemData.name) !== -1) {
|
6226
6743
|
parentKey.push(itemData._fm_id);
|
@@ -6232,11 +6749,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6232
6749
|
this.isMenuItemClicked = false;
|
6233
6750
|
};
|
6234
6751
|
/* istanbul ignore next */
|
6235
|
-
ContextMenu
|
6752
|
+
ContextMenu.prototype.onBeforeOpen = function (args) {
|
6236
6753
|
var _this = this;
|
6237
6754
|
var selected = false;
|
6238
6755
|
var uid;
|
6239
|
-
// eslint-disable-next-line
|
6240
6756
|
var data;
|
6241
6757
|
var treeFolder = false;
|
6242
6758
|
var target = args.event.target;
|
@@ -6248,7 +6764,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6248
6764
|
}
|
6249
6765
|
this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr.e-row') : target;
|
6250
6766
|
if (this.parent.enableVirtualization && (target.classList.contains('e-virtual-bottom') || target.classList.contains('e-virtualtable'))) {
|
6251
|
-
target = target.parentElement.closest(
|
6767
|
+
target = target.parentElement.closest('div');
|
6252
6768
|
}
|
6253
6769
|
var view = this.getTargetView(target);
|
6254
6770
|
this.updateActiveModule();
|
@@ -6257,7 +6773,6 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6257
6773
|
(closest(target, '#' + this.parent.element.id + BREADCRUMBBAR_ID)) ||
|
6258
6774
|
(closest(target, '#' + this.parent.element.id + TOOLBAR_ID))) {
|
6259
6775
|
args.cancel = true;
|
6260
|
-
// eslint:disable-next-line
|
6261
6776
|
}
|
6262
6777
|
else if (!(this.parent.view === 'LargeIcons') && this.targetElement &&
|
6263
6778
|
this.targetElement.classList.contains('e-emptyrow')) {
|
@@ -6266,24 +6781,20 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6266
6781
|
}
|
6267
6782
|
else if (closest(target, '.' + EMPTY)) {
|
6268
6783
|
this.setLayoutItem(target);
|
6269
|
-
// eslint:disable-next-line
|
6270
6784
|
}
|
6271
6785
|
else if (!target.classList.contains(MENU_ITEM) &&
|
6272
6786
|
!target.classList.contains(MENU_ICON) && !target.classList.contains(SUBMENU_ICON)) {
|
6273
6787
|
/* istanbul ignore next */
|
6274
|
-
// eslint:disable-next-line
|
6275
6788
|
if (this.parent.view === 'LargeIcons' && !isNullOrUndefined(closest(target, 'li')) && !closest(target, '#' + this.parent.element.id + TREE_ID)) {
|
6276
6789
|
var eveArgs = { ctrlKey: true, shiftKey: true };
|
6277
6790
|
if (!closest(target, 'li').classList.contains('e-active')) {
|
6278
6791
|
this.parent.largeiconsviewModule.doSelection(target, eveArgs);
|
6279
6792
|
}
|
6280
|
-
// eslint-disable-next-line
|
6281
6793
|
data = this.parent.visitedData;
|
6282
6794
|
selected = true;
|
6283
6795
|
}
|
6284
6796
|
else if (!isNullOrUndefined(closest(target, 'tr.e-row'))) {
|
6285
6797
|
uid = this.targetElement.getAttribute('data-uid');
|
6286
|
-
// eslint-disable-next-line
|
6287
6798
|
data = this.parent.detailsviewModule.gridObj.getRowObjectFromUID(uid).data;
|
6288
6799
|
if (isNullOrUndefined(this.targetElement.getAttribute('aria-selected'))) {
|
6289
6800
|
/* istanbul ignore next */
|
@@ -6312,7 +6823,6 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6312
6823
|
this.disabledItems.push('Delete', 'Rename', 'Cut', 'Copy');
|
6313
6824
|
}
|
6314
6825
|
/* istanbul ignore next */
|
6315
|
-
// eslint:disable-next-line
|
6316
6826
|
}
|
6317
6827
|
else if (view === 'TreeView' || view === 'GridView' || view === 'LargeIcon') {
|
6318
6828
|
this.setLayoutItem(target);
|
@@ -6370,7 +6880,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6370
6880
|
}
|
6371
6881
|
});
|
6372
6882
|
};
|
6373
|
-
ContextMenu
|
6883
|
+
ContextMenu.prototype.updateActiveModule = function () {
|
6374
6884
|
this.parent.activeModule = closest(this.menuTarget, '#' + this.parent.element.id + TREE_ID) ?
|
6375
6885
|
'navigationpane' : closest(this.menuTarget, '#' + this.parent.element.id + GRID_ID) ?
|
6376
6886
|
'detailsview' : closest(this.menuTarget, '#' + this.parent.element.id + LARGEICON_ID) ?
|
@@ -6383,14 +6893,14 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6383
6893
|
* @returns {string} -returns the target view.
|
6384
6894
|
* @hidden
|
6385
6895
|
*/
|
6386
|
-
ContextMenu
|
6896
|
+
ContextMenu.prototype.getTargetView = function (target) {
|
6387
6897
|
return target.classList.contains(TREE_VIEW) ?
|
6388
6898
|
'TreeView' : target.classList.contains(GRID_VIEW) ?
|
6389
6899
|
'GridView' : target.classList.contains(ICON_VIEW) ?
|
6390
6900
|
'LargeIcon' : target.classList.contains(LARGE_ICONS) ?
|
6391
6901
|
'LargeIcon' : '';
|
6392
6902
|
};
|
6393
|
-
ContextMenu
|
6903
|
+
ContextMenu.prototype.getItemIndex = function (item) {
|
6394
6904
|
var itemId = this.getMenuId(item);
|
6395
6905
|
for (var i = 0; i < this.currentItems.length; i++) {
|
6396
6906
|
if ((this.currentItems[i].id === itemId) || (this.currentItems[i].id === item)) {
|
@@ -6399,12 +6909,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6399
6909
|
}
|
6400
6910
|
return -1;
|
6401
6911
|
};
|
6402
|
-
ContextMenu
|
6912
|
+
ContextMenu.prototype.disableItem = function (items) {
|
6403
6913
|
if (items.length !== 0) {
|
6404
6914
|
this.disabledItems = this.disabledItems.concat(items);
|
6405
6915
|
}
|
6406
6916
|
};
|
6407
|
-
ContextMenu
|
6917
|
+
ContextMenu.prototype.enableItems = function (items, enable, isUniqueId) {
|
6408
6918
|
for (var i = 0; i < items.length; i++) {
|
6409
6919
|
if (this.checkValidItem(items[i]) === 1) {
|
6410
6920
|
this.contextMenu.enableItems([this.getMenuId(items[i])], enable, isUniqueId);
|
@@ -6414,7 +6924,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6414
6924
|
}
|
6415
6925
|
}
|
6416
6926
|
};
|
6417
|
-
ContextMenu
|
6927
|
+
ContextMenu.prototype.setFolderItem = function (isTree) {
|
6418
6928
|
this.menuType = 'folder';
|
6419
6929
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.folder.map(function (item) { return item.trim(); }));
|
6420
6930
|
this.contextMenu.dataBind();
|
@@ -6423,20 +6933,40 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6423
6933
|
if (this.parent.pathNames[this.parent.pathNames.length - 1] === selectedTreeNode.querySelector('.e-list-text').innerHTML && this.parent.activeModule === 'navigationpane') {
|
6424
6934
|
this.disabledItems.push('Open');
|
6425
6935
|
}
|
6936
|
+
if (this.parent.selectedItems.length === 0) {
|
6937
|
+
var renameIndex = this.disabledItems.indexOf('Rename');
|
6938
|
+
if (renameIndex !== -1) {
|
6939
|
+
this.disabledItems.splice(renameIndex, 1);
|
6940
|
+
}
|
6941
|
+
}
|
6426
6942
|
}
|
6427
|
-
else if (this.parent.
|
6428
|
-
this.
|
6943
|
+
else if (this.parent.activeModule !== 'navigationpane') {
|
6944
|
+
if (this.parent.selectedItems.length === 1) {
|
6945
|
+
var renameIndex = this.disabledItems.indexOf('Rename');
|
6946
|
+
if (renameIndex !== -1) {
|
6947
|
+
this.disabledItems.splice(renameIndex, 1);
|
6948
|
+
}
|
6949
|
+
}
|
6950
|
+
else {
|
6951
|
+
this.disabledItems.push('Rename', 'Paste');
|
6952
|
+
}
|
6429
6953
|
}
|
6430
6954
|
};
|
6431
|
-
ContextMenu
|
6955
|
+
ContextMenu.prototype.setFileItem = function () {
|
6432
6956
|
this.menuType = 'file';
|
6433
6957
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.file.map(function (item) { return item.trim(); }));
|
6434
6958
|
this.contextMenu.dataBind();
|
6435
|
-
if (this.parent.selectedItems.length
|
6959
|
+
if (this.parent.selectedItems.length === 1) {
|
6960
|
+
var renameIndex = this.disabledItems.indexOf('Rename');
|
6961
|
+
if (renameIndex !== -1) {
|
6962
|
+
this.disabledItems.splice(renameIndex, 1);
|
6963
|
+
}
|
6964
|
+
}
|
6965
|
+
else {
|
6436
6966
|
this.disabledItems.push('Rename');
|
6437
6967
|
}
|
6438
6968
|
};
|
6439
|
-
ContextMenu
|
6969
|
+
ContextMenu.prototype.setLayoutItem = function (target) {
|
6440
6970
|
this.menuType = 'layout';
|
6441
6971
|
this.contextMenu.items = this.getItemData(this.parent.contextMenuSettings.layout.map(function (item) { return item.trim(); }));
|
6442
6972
|
this.contextMenu.dataBind();
|
@@ -6456,7 +6986,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6456
6986
|
}
|
6457
6987
|
this.contextMenu.dataBind();
|
6458
6988
|
};
|
6459
|
-
ContextMenu
|
6989
|
+
ContextMenu.prototype.checkValidItem = function (nameEle) {
|
6460
6990
|
if (!isNullOrUndefined(select('#' + this.getMenuId(nameEle), this.currentElement))) {
|
6461
6991
|
return 1;
|
6462
6992
|
}
|
@@ -6467,26 +6997,23 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6467
6997
|
return -1;
|
6468
6998
|
}
|
6469
6999
|
};
|
6470
|
-
|
6471
|
-
ContextMenu$$1.prototype.getMenuItemData = function () {
|
7000
|
+
ContextMenu.prototype.getMenuItemData = function () {
|
6472
7001
|
if (this.menuType === 'layout') {
|
6473
7002
|
return getPathObject(this.parent);
|
6474
7003
|
}
|
6475
7004
|
else {
|
6476
|
-
// eslint-disable-next-line
|
6477
7005
|
var args = { target: this.menuTarget };
|
6478
7006
|
this.parent.notify(menuItemData, args);
|
6479
7007
|
return this.parent.itemData[0];
|
6480
7008
|
}
|
6481
7009
|
};
|
6482
7010
|
/* istanbul ignore next */
|
6483
|
-
ContextMenu
|
7011
|
+
ContextMenu.prototype.onSelect = function (args) {
|
6484
7012
|
var _this = this;
|
6485
7013
|
if (isNullOrUndefined(args.item) || !args.item.id) {
|
6486
7014
|
return;
|
6487
7015
|
}
|
6488
7016
|
var itemText = args.item.id.substr((this.parent.element.id + '_cm_').length);
|
6489
|
-
// eslint-disable-next-line
|
6490
7017
|
var details;
|
6491
7018
|
if (itemText === 'refresh' || itemText === 'newfolder' || itemText === 'upload') {
|
6492
7019
|
details = [getPathObject(this.parent)];
|
@@ -6511,7 +7038,6 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6511
7038
|
var sItems;
|
6512
7039
|
if (!menuClickArgs.cancel) {
|
6513
7040
|
_this.isMenuItemClicked = true;
|
6514
|
-
// eslint:disable-next-line
|
6515
7041
|
switch (itemText) {
|
6516
7042
|
case 'cut':
|
6517
7043
|
cutFiles(_this.parent);
|
@@ -6599,19 +7125,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6599
7125
|
case 'upload':
|
6600
7126
|
uploadItem(_this.parent);
|
6601
7127
|
break;
|
6602
|
-
/* istanbul ignore next */
|
6603
7128
|
case 'name':
|
6604
|
-
/* istanbul ignore next */
|
6605
|
-
// eslint-disable-next-line no-fallthrough
|
6606
7129
|
case 'size':
|
6607
|
-
/* istanbul ignore next */
|
6608
|
-
// eslint-disable-next-line no-fallthrough
|
6609
7130
|
case 'date':
|
6610
|
-
/* istanbul ignore next */
|
6611
|
-
// eslint-disable-next-line no-fallthrough
|
6612
7131
|
case 'ascending':
|
6613
|
-
/* istanbul ignore next */
|
6614
|
-
// eslint-disable-next-line no-fallthrough
|
6615
7132
|
case 'descending':
|
6616
7133
|
/* istanbul ignore next */
|
6617
7134
|
sortbyClickHandler(_this.parent, args);
|
@@ -6622,12 +7139,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6622
7139
|
sortbyClickHandler(_this.parent, args);
|
6623
7140
|
break;
|
6624
7141
|
/* istanbul ignore next */
|
6625
|
-
// eslint:disable-next-line
|
6626
7142
|
case 'largeiconsview':
|
6627
7143
|
updateLayout(_this.parent, 'LargeIcons');
|
6628
7144
|
break;
|
6629
7145
|
/* istanbul ignore next */
|
6630
|
-
// eslint:disable-next-line
|
6631
7146
|
case 'detailsview':
|
6632
7147
|
updateLayout(_this.parent, 'Details');
|
6633
7148
|
break;
|
@@ -6635,7 +7150,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6635
7150
|
}
|
6636
7151
|
});
|
6637
7152
|
};
|
6638
|
-
ContextMenu
|
7153
|
+
ContextMenu.prototype.onPropertyChanged = function (e) {
|
6639
7154
|
if (e.module !== this.getModuleName() && e.module !== 'common') {
|
6640
7155
|
/* istanbul ignore next */
|
6641
7156
|
return;
|
@@ -6649,7 +7164,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6649
7164
|
}
|
6650
7165
|
}
|
6651
7166
|
};
|
6652
|
-
ContextMenu
|
7167
|
+
ContextMenu.prototype.addEventListener = function () {
|
6653
7168
|
this.parent.on(destroy, this.destroy, this);
|
6654
7169
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
6655
7170
|
this.keyboardModule = new KeyboardEvents(this.contextMenu.element, {
|
@@ -6658,12 +7173,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6658
7173
|
eventName: 'keydown'
|
6659
7174
|
});
|
6660
7175
|
};
|
6661
|
-
ContextMenu
|
7176
|
+
ContextMenu.prototype.removeEventListener = function () {
|
6662
7177
|
this.parent.off(destroy, this.destroy);
|
6663
7178
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
6664
7179
|
this.keyboardModule.destroy();
|
6665
7180
|
};
|
6666
|
-
ContextMenu
|
7181
|
+
ContextMenu.prototype.keyActionHandler = function (e) {
|
6667
7182
|
switch (e.action) {
|
6668
7183
|
case 'uparrow':
|
6669
7184
|
case 'downarrow':
|
@@ -6676,10 +7191,10 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6676
7191
|
* @returns {string} - returns the module name.
|
6677
7192
|
* @private
|
6678
7193
|
*/
|
6679
|
-
ContextMenu
|
7194
|
+
ContextMenu.prototype.getModuleName = function () {
|
6680
7195
|
return 'contextmenu';
|
6681
7196
|
};
|
6682
|
-
ContextMenu
|
7197
|
+
ContextMenu.prototype.destroy = function () {
|
6683
7198
|
if (this.parent.isDestroyed) {
|
6684
7199
|
return;
|
6685
7200
|
}
|
@@ -6688,7 +7203,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6688
7203
|
this.targetElement = null;
|
6689
7204
|
};
|
6690
7205
|
/* istanbul ignore next */
|
6691
|
-
ContextMenu
|
7206
|
+
ContextMenu.prototype.getItemData = function (data) {
|
6692
7207
|
var items = [];
|
6693
7208
|
for (var i = 0; i < data.length; i++) {
|
6694
7209
|
var item = void 0;
|
@@ -6792,16 +7307,15 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
|
|
6792
7307
|
}
|
6793
7308
|
return items;
|
6794
7309
|
};
|
6795
|
-
ContextMenu
|
7310
|
+
ContextMenu.prototype.getMenuId = function (id) {
|
6796
7311
|
return this.parent.element.id + '_cm_' + id.split(' ').join('').toLowerCase();
|
6797
7312
|
};
|
6798
|
-
return ContextMenu
|
7313
|
+
return ContextMenu;
|
6799
7314
|
}());
|
6800
7315
|
|
6801
7316
|
/**
|
6802
7317
|
* Specifies the default locale of FileManager component
|
6803
7318
|
*/
|
6804
|
-
// eslint-disable-next-line
|
6805
7319
|
var defaultLocale = {
|
6806
7320
|
'NewFolder': 'New folder',
|
6807
7321
|
'Upload': 'Upload',
|
@@ -6935,14 +7449,13 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6935
7449
|
__extends$8(FileManager, _super);
|
6936
7450
|
function FileManager(options, element) {
|
6937
7451
|
var _this = _super.call(this, options, element) || this;
|
6938
|
-
// eslint-disable-next-line
|
6939
7452
|
_this.filterData = null;
|
6940
7453
|
_this.selectedNodes = [];
|
6941
7454
|
_this.duplicateItems = [];
|
6942
|
-
// eslint-disable-next-line
|
6943
7455
|
_this.duplicateRecords = [];
|
6944
7456
|
_this.previousPath = [];
|
6945
7457
|
_this.nextPath = [];
|
7458
|
+
_this.existingFileCount = 0;
|
6946
7459
|
_this.isLayoutChange = false;
|
6947
7460
|
_this.layoutSelectedItems = [];
|
6948
7461
|
_this.renamedId = null;
|
@@ -6964,11 +7477,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6964
7477
|
_this.isOpened = false;
|
6965
7478
|
_this.isRetryOpened = false;
|
6966
7479
|
_this.isPathDrag = false;
|
6967
|
-
// eslint-disable-next-line
|
6968
7480
|
_this.searchedItems = [];
|
6969
7481
|
_this.retryFiles = [];
|
6970
7482
|
_this.isApplySame = false;
|
6971
|
-
// eslint-disable-next-line
|
6972
7483
|
_this.dragData = [];
|
6973
7484
|
_this.dragNodes = [];
|
6974
7485
|
_this.dragPath = '';
|
@@ -6978,13 +7489,12 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
6978
7489
|
_this.dragCursorPosition = { left: 44, top: 18 };
|
6979
7490
|
_this.isDropEnd = false;
|
6980
7491
|
_this.dragCount = 0;
|
6981
|
-
// eslint-disable-next-line
|
6982
7492
|
_this.droppedObjects = [];
|
6983
7493
|
_this.uploadingCount = 0;
|
6984
7494
|
_this.uploadedCount = 0;
|
6985
|
-
//Specifies whether the operating system is MAC or not
|
7495
|
+
//Specifies whether the operating system is MAC or not
|
6986
7496
|
_this.isMac = false;
|
6987
|
-
FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu
|
7497
|
+
FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu);
|
6988
7498
|
return _this;
|
6989
7499
|
}
|
6990
7500
|
FileManager_1 = FileManager;
|
@@ -7376,7 +7886,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7376
7886
|
var data = JSON.stringify(getValue(this.pathId[this.pathId.length - 1], this.feParent));
|
7377
7887
|
args.customFormData = [{ 'path': this.path }, { 'action': action }, { 'data': data }, { 'filename': args.fileData.name }];
|
7378
7888
|
var uploadUrl = this.ajaxSettings.uploadUrl ? this.ajaxSettings.uploadUrl : this.ajaxSettings.url;
|
7379
|
-
// eslint-disable-next-line
|
7380
7889
|
var ajaxSettings = {
|
7381
7890
|
url: uploadUrl,
|
7382
7891
|
type: 'POST',
|
@@ -7392,7 +7901,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7392
7901
|
this.trigger('beforeSend', this.uploadEventArgs, function (uploadEventArgs) {
|
7393
7902
|
args.customFormData = JSON.parse(getValue('data', uploadEventArgs.ajaxSettings));
|
7394
7903
|
args.cancel = uploadEventArgs.cancel;
|
7395
|
-
// eslint-disable-next-line
|
7396
7904
|
var eventArgs = {
|
7397
7905
|
cancel: false,
|
7398
7906
|
httpRequest: args.currentRequest
|
@@ -7429,7 +7937,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7429
7937
|
}
|
7430
7938
|
this.uploadingCount = args.filesData.length;
|
7431
7939
|
this.uploadedCount = 0;
|
7432
|
-
// eslint-disable-next-line
|
7433
7940
|
var details = getPathObject(this);
|
7434
7941
|
if (!hasUploadAccess(details)) {
|
7435
7942
|
args.cancel = true;
|
@@ -7438,7 +7945,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7438
7945
|
}
|
7439
7946
|
this.uploadDialogObj.show();
|
7440
7947
|
};
|
7441
|
-
// eslint-disable-next-line
|
7442
7948
|
FileManager.prototype.onFileUploadSuccess = function (args) {
|
7443
7949
|
this.uploadedCount = this.uploadedCount + args.count;
|
7444
7950
|
if (this.uploadSettings.autoClose && (this.uploadingCount === this.uploadedCount)) {
|
@@ -7446,7 +7952,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7446
7952
|
}
|
7447
7953
|
};
|
7448
7954
|
/* istanbul ignore next */
|
7449
|
-
// eslint-disable-next-line
|
7450
7955
|
FileManager.prototype.onUploadSuccess = function (files) {
|
7451
7956
|
var args = { action: 'Upload', result: files };
|
7452
7957
|
this.trigger('success', args);
|
@@ -7458,9 +7963,7 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7458
7963
|
}
|
7459
7964
|
};
|
7460
7965
|
/* istanbul ignore next */
|
7461
|
-
// eslint-disable-next-line
|
7462
7966
|
FileManager.prototype.onUploadFailure = function (files) {
|
7463
|
-
// eslint-disable-next-line
|
7464
7967
|
var response = getValue('response', files);
|
7465
7968
|
var statusText = getValue('statusText', response);
|
7466
7969
|
if (statusText !== '') {
|
@@ -7544,7 +8047,7 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7544
8047
|
break;
|
7545
8048
|
case 'ctrlU':
|
7546
8049
|
e.preventDefault();
|
7547
|
-
if (this.toolbarSettings.items.indexOf('Upload')
|
8050
|
+
if (this.toolbarSettings.items.indexOf('Upload') !== -1) {
|
7548
8051
|
uploadEle = select('#' + this.element.id + UPLOAD_ID, this.element);
|
7549
8052
|
uploadEle.click();
|
7550
8053
|
}
|
@@ -7578,7 +8081,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7578
8081
|
* @private
|
7579
8082
|
*/
|
7580
8083
|
/* istanbul ignore next */
|
7581
|
-
// eslint:disable-next-line
|
7582
8084
|
FileManager.prototype.onPropertyChanged = function (newProp, oldProp) {
|
7583
8085
|
var height;
|
7584
8086
|
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
@@ -7711,6 +8213,10 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7711
8213
|
this.viewerObj.target = newProp.popupTarget;
|
7712
8214
|
}
|
7713
8215
|
break;
|
8216
|
+
case 'fileSystemData':
|
8217
|
+
this.fileSystemData = newProp.fileSystemData;
|
8218
|
+
this.refresh();
|
8219
|
+
break;
|
7714
8220
|
}
|
7715
8221
|
}
|
7716
8222
|
};
|
@@ -7796,7 +8302,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7796
8302
|
*/
|
7797
8303
|
FileManager.prototype.createFolder = function (name) {
|
7798
8304
|
this.notify(methodCall, { action: 'createFolder' });
|
7799
|
-
// eslint-disable-next-line
|
7800
8305
|
var details = [getPathObject(this)];
|
7801
8306
|
this.itemData = details;
|
7802
8307
|
if (name) {
|
@@ -7919,7 +8424,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7919
8424
|
*
|
7920
8425
|
* @returns {void}
|
7921
8426
|
*/
|
7922
|
-
// eslint-disable-next-line
|
7923
8427
|
FileManager.prototype.filterFiles = function (filterData) {
|
7924
8428
|
this.filterData = filterData ? filterData : null;
|
7925
8429
|
this.setProperties({ selectedItems: [] }, true);
|
@@ -7935,7 +8439,6 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
7935
8439
|
*
|
7936
8440
|
* @returns {Object[]} - returns selected files.
|
7937
8441
|
*/
|
7938
|
-
// eslint-disable-next-line
|
7939
8442
|
FileManager.prototype.getSelectedFiles = function () {
|
7940
8443
|
this.notify(updateSelectionData, {});
|
7941
8444
|
return this.itemData;
|
@@ -8007,11 +8510,18 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8007
8510
|
* @returns {void}
|
8008
8511
|
*/
|
8009
8512
|
FileManager.prototype.uploadFiles = function () {
|
8010
|
-
// eslint-disable-next-line
|
8011
8513
|
var details = [getPathObject(this)];
|
8012
8514
|
this.itemData = details;
|
8013
8515
|
uploadItem(this);
|
8014
8516
|
};
|
8517
|
+
/**
|
8518
|
+
* Specifies the method which must be invoked to programmatically close the dialog popup in the file manager.
|
8519
|
+
*
|
8520
|
+
* @returns {void}
|
8521
|
+
*/
|
8522
|
+
FileManager.prototype.closeDialog = function () {
|
8523
|
+
closePopup(this);
|
8524
|
+
};
|
8015
8525
|
/**
|
8016
8526
|
* Specifies the direction of FileManager
|
8017
8527
|
*
|
@@ -8034,6 +8544,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8034
8544
|
__decorate$8([
|
8035
8545
|
Complex({}, AjaxSettings)
|
8036
8546
|
], FileManager.prototype, "ajaxSettings", void 0);
|
8547
|
+
__decorate$8([
|
8548
|
+
Property([])
|
8549
|
+
], FileManager.prototype, "fileSystemData", void 0);
|
8037
8550
|
__decorate$8([
|
8038
8551
|
Property(false)
|
8039
8552
|
], FileManager.prototype, "allowDragAndDrop", void 0);
|
@@ -8139,9 +8652,36 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8139
8652
|
__decorate$8([
|
8140
8653
|
Event()
|
8141
8654
|
], FileManager.prototype, "created", void 0);
|
8655
|
+
__decorate$8([
|
8656
|
+
Event()
|
8657
|
+
], FileManager.prototype, "beforeFolderCreate", void 0);
|
8658
|
+
__decorate$8([
|
8659
|
+
Event()
|
8660
|
+
], FileManager.prototype, "folderCreate", void 0);
|
8142
8661
|
__decorate$8([
|
8143
8662
|
Event()
|
8144
8663
|
], FileManager.prototype, "destroyed", void 0);
|
8664
|
+
__decorate$8([
|
8665
|
+
Event()
|
8666
|
+
], FileManager.prototype, "beforeDelete", void 0);
|
8667
|
+
__decorate$8([
|
8668
|
+
Event()
|
8669
|
+
], FileManager.prototype, "delete", void 0);
|
8670
|
+
__decorate$8([
|
8671
|
+
Event()
|
8672
|
+
], FileManager.prototype, "beforeRename", void 0);
|
8673
|
+
__decorate$8([
|
8674
|
+
Event()
|
8675
|
+
], FileManager.prototype, "rename", void 0);
|
8676
|
+
__decorate$8([
|
8677
|
+
Event()
|
8678
|
+
], FileManager.prototype, "beforeMove", void 0);
|
8679
|
+
__decorate$8([
|
8680
|
+
Event()
|
8681
|
+
], FileManager.prototype, "move", void 0);
|
8682
|
+
__decorate$8([
|
8683
|
+
Event()
|
8684
|
+
], FileManager.prototype, "search", void 0);
|
8145
8685
|
__decorate$8([
|
8146
8686
|
Event()
|
8147
8687
|
], FileManager.prototype, "fileDragStart", void 0);
|
@@ -8193,26 +8733,11 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
|
|
8193
8733
|
return FileManager;
|
8194
8734
|
}(Component));
|
8195
8735
|
|
8196
|
-
/**
|
8197
|
-
* File Manager base modules
|
8198
|
-
*/
|
8199
|
-
|
8200
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
8201
|
-
__assign = Object.assign || function(t) {
|
8202
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
8203
|
-
s = arguments[i];
|
8204
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
8205
|
-
t[p] = s[p];
|
8206
|
-
}
|
8207
|
-
return t;
|
8208
|
-
};
|
8209
|
-
return __assign.apply(this, arguments);
|
8210
|
-
};
|
8211
8736
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
8212
8737
|
/**
|
8213
8738
|
* Toolbar module
|
8214
8739
|
*/
|
8215
|
-
var Toolbar
|
8740
|
+
var Toolbar = /** @__PURE__ @class */ (function () {
|
8216
8741
|
/**
|
8217
8742
|
* Constructor for the Toolbar module
|
8218
8743
|
*
|
@@ -8220,7 +8745,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8220
8745
|
* @param {IFileManager} parent - specifies the parent element.
|
8221
8746
|
* @private
|
8222
8747
|
*/
|
8223
|
-
function Toolbar
|
8748
|
+
function Toolbar(parent) {
|
8224
8749
|
this.default = ['Delete', 'Rename', 'Download', 'Cut', 'Copy', 'Paste'];
|
8225
8750
|
this.single = ['Delete', 'Rename', 'Download', 'Cut', 'Copy'];
|
8226
8751
|
this.multiple = ['Delete', 'Download', 'Cut', 'Copy', 'Refresh'];
|
@@ -8229,13 +8754,13 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8229
8754
|
this.render();
|
8230
8755
|
this.addEventListener();
|
8231
8756
|
}
|
8232
|
-
Toolbar
|
8757
|
+
Toolbar.prototype.render = function () {
|
8233
8758
|
var _this = this;
|
8234
8759
|
this.items = this.toolbarItemData(this.getItems(this.parent.toolbarSettings.items.map(function (item) { return item.trim(); })));
|
8235
8760
|
var eventArgs = { items: this.items };
|
8236
8761
|
this.parent.trigger('toolbarCreate', eventArgs, function (toolbarCreateArgs) {
|
8237
8762
|
_this.items = toolbarCreateArgs.items;
|
8238
|
-
_this.toolbarObj = new Toolbar({
|
8763
|
+
_this.toolbarObj = new Toolbar$1({
|
8239
8764
|
items: _this.items,
|
8240
8765
|
created: _this.toolbarCreateHandler.bind(_this),
|
8241
8766
|
overflowMode: 'Popup',
|
@@ -8248,7 +8773,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8248
8773
|
_this.toolbarObj.appendTo('#' + _this.parent.element.id + TOOLBAR_ID);
|
8249
8774
|
});
|
8250
8775
|
};
|
8251
|
-
Toolbar
|
8776
|
+
Toolbar.prototype.getItemIndex = function (item) {
|
8252
8777
|
var itemId = this.getId(item);
|
8253
8778
|
for (var i = 0; i < this.items.length; i++) {
|
8254
8779
|
if (this.items[i].id === itemId) {
|
@@ -8257,7 +8782,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8257
8782
|
}
|
8258
8783
|
return -1;
|
8259
8784
|
};
|
8260
|
-
Toolbar
|
8785
|
+
Toolbar.prototype.getItems = function (items) {
|
8261
8786
|
var currItems = items.slice();
|
8262
8787
|
if (this.parent.isDevice && this.parent.allowMultiSelection) {
|
8263
8788
|
currItems.push('SelectAll');
|
@@ -8268,13 +8793,12 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8268
8793
|
return currItems;
|
8269
8794
|
};
|
8270
8795
|
/* istanbul ignore next */
|
8271
|
-
Toolbar
|
8796
|
+
Toolbar.prototype.onClicked = function (args) {
|
8272
8797
|
var _this = this;
|
8273
8798
|
if (isNullOrUndefined(args.item) || !args.item.id) {
|
8274
8799
|
return;
|
8275
8800
|
}
|
8276
8801
|
var tool = args.item.id.substr((this.parent.element.id + '_tb_').length);
|
8277
|
-
// eslint-disable-next-line
|
8278
8802
|
var details;
|
8279
8803
|
if (tool === 'refresh' || tool === 'newfolder' || tool === 'upload') {
|
8280
8804
|
details = [getPathObject(this.parent)];
|
@@ -8354,7 +8878,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8354
8878
|
}
|
8355
8879
|
});
|
8356
8880
|
};
|
8357
|
-
Toolbar
|
8881
|
+
Toolbar.prototype.toolbarCreateHandler = function () {
|
8358
8882
|
var _this = this;
|
8359
8883
|
if (!isNullOrUndefined(select('#' + this.getId('SortBy'), this.parent.element))) {
|
8360
8884
|
var items = [
|
@@ -8439,7 +8963,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8439
8963
|
}
|
8440
8964
|
this.parent.refreshLayout();
|
8441
8965
|
};
|
8442
|
-
Toolbar
|
8966
|
+
Toolbar.prototype.updateSortByButton = function () {
|
8443
8967
|
if (this.buttonObj) {
|
8444
8968
|
var items = this.buttonObj.items;
|
8445
8969
|
for (var itemCount = 0; itemCount < items.length; itemCount++) {
|
@@ -8469,10 +8993,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8469
8993
|
}
|
8470
8994
|
}
|
8471
8995
|
};
|
8472
|
-
Toolbar
|
8996
|
+
Toolbar.prototype.getPupupId = function (id) {
|
8473
8997
|
return this.parent.element.id + '_ddl_' + id.toLowerCase();
|
8474
8998
|
};
|
8475
|
-
Toolbar
|
8999
|
+
Toolbar.prototype.layoutChange = function (args) {
|
8476
9000
|
if (this.parent.view === 'Details') {
|
8477
9001
|
if (args.item.id === this.getPupupId('large')) {
|
8478
9002
|
updateLayout(this.parent, 'LargeIcons');
|
@@ -8484,7 +9008,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8484
9008
|
}
|
8485
9009
|
}
|
8486
9010
|
};
|
8487
|
-
Toolbar
|
9011
|
+
Toolbar.prototype.toolbarItemData = function (data) {
|
8488
9012
|
var items = [];
|
8489
9013
|
var mode = 'Both';
|
8490
9014
|
if (this.parent.isMobile) {
|
@@ -8577,7 +9101,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8577
9101
|
break;
|
8578
9102
|
}
|
8579
9103
|
if (this.parent.toolbarItems.length > 0 && propItem) {
|
8580
|
-
var mergedItems =
|
9104
|
+
var mergedItems = Object.assign({}, item, propItem);
|
8581
9105
|
items.push(mergedItems);
|
8582
9106
|
}
|
8583
9107
|
else {
|
@@ -8586,7 +9110,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8586
9110
|
}
|
8587
9111
|
return items;
|
8588
9112
|
};
|
8589
|
-
Toolbar
|
9113
|
+
Toolbar.prototype.getItemModel = function (propItem) {
|
8590
9114
|
var item = {};
|
8591
9115
|
if (propItem.id) {
|
8592
9116
|
item.id = propItem.id;
|
@@ -8641,10 +9165,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8641
9165
|
}
|
8642
9166
|
return item;
|
8643
9167
|
};
|
8644
|
-
Toolbar
|
9168
|
+
Toolbar.prototype.getId = function (id) {
|
8645
9169
|
return this.parent.element.id + '_tb_' + id.toLowerCase();
|
8646
9170
|
};
|
8647
|
-
Toolbar
|
9171
|
+
Toolbar.prototype.addEventListener = function () {
|
8648
9172
|
this.parent.on(modelChanged, this.onPropertyChanged, this);
|
8649
9173
|
this.parent.on(selectionChanged, this.onSelectionChanged, this);
|
8650
9174
|
this.parent.on(layoutChange, this.onLayoutChange, this);
|
@@ -8653,7 +9177,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8653
9177
|
this.parent.on(destroy, this.destroy, this);
|
8654
9178
|
this.parent.on(sortByChange, this.updateSortByButton, this);
|
8655
9179
|
};
|
8656
|
-
Toolbar
|
9180
|
+
Toolbar.prototype.reRenderToolbar = function (e) {
|
8657
9181
|
var _this = this;
|
8658
9182
|
var itemsToProcess = [];
|
8659
9183
|
if (this.parent.toolbarItems.length > 0) {
|
@@ -8683,7 +9207,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8683
9207
|
});
|
8684
9208
|
}
|
8685
9209
|
};
|
8686
|
-
Toolbar
|
9210
|
+
Toolbar.prototype.onSelectionChanged = function () {
|
8687
9211
|
this.hideStatus();
|
8688
9212
|
this.hideItems(this.single, true);
|
8689
9213
|
this.hideItems(this.selection, false);
|
@@ -8708,7 +9232,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8708
9232
|
this.toolbarObj.hideItem(ele.parentElement, false);
|
8709
9233
|
}
|
8710
9234
|
};
|
8711
|
-
Toolbar
|
9235
|
+
Toolbar.prototype.hideItems = function (tools, toHide) {
|
8712
9236
|
for (var i = 0; i < tools.length; i++) {
|
8713
9237
|
var ele = select('#' + this.getId(tools[i]), this.parent.element);
|
8714
9238
|
if (ele) {
|
@@ -8716,19 +9240,19 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8716
9240
|
}
|
8717
9241
|
}
|
8718
9242
|
};
|
8719
|
-
Toolbar
|
9243
|
+
Toolbar.prototype.hideStatus = function () {
|
8720
9244
|
var ele = select('#' + this.getId('Selection'), this.toolbarObj.element);
|
8721
9245
|
if (ele) {
|
8722
9246
|
this.toolbarObj.hideItem(ele.parentElement, true);
|
8723
9247
|
}
|
8724
9248
|
};
|
8725
|
-
Toolbar
|
9249
|
+
Toolbar.prototype.showPaste = function () {
|
8726
9250
|
this.hideItems(['Paste'], false);
|
8727
9251
|
};
|
8728
|
-
Toolbar
|
9252
|
+
Toolbar.prototype.hidePaste = function () {
|
8729
9253
|
this.hideItems(['Paste'], true);
|
8730
9254
|
};
|
8731
|
-
Toolbar
|
9255
|
+
Toolbar.prototype.onLayoutChange = function () {
|
8732
9256
|
if (this.layoutBtnObj) {
|
8733
9257
|
this.layoutBtnObj.iconCss = this.parent.view === 'Details' ? ICON_GRID : ICON_LARGE;
|
8734
9258
|
var items = this.layoutBtnObj.items;
|
@@ -8742,7 +9266,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8742
9266
|
}
|
8743
9267
|
}
|
8744
9268
|
};
|
8745
|
-
Toolbar
|
9269
|
+
Toolbar.prototype.removeEventListener = function () {
|
8746
9270
|
this.parent.off(modelChanged, this.onPropertyChanged);
|
8747
9271
|
this.parent.off(selectionChanged, this.onSelectionChanged);
|
8748
9272
|
this.parent.off(layoutChange, this.onLayoutChange);
|
@@ -8757,10 +9281,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8757
9281
|
* @returns {string} - returns module name.
|
8758
9282
|
* @private
|
8759
9283
|
*/
|
8760
|
-
Toolbar
|
9284
|
+
Toolbar.prototype.getModuleName = function () {
|
8761
9285
|
return 'toolbar';
|
8762
9286
|
};
|
8763
|
-
Toolbar
|
9287
|
+
Toolbar.prototype.onPropertyChanged = function (e) {
|
8764
9288
|
if (e.module !== this.getModuleName() && e.module !== 'common') {
|
8765
9289
|
/* istanbul ignore next */
|
8766
9290
|
return;
|
@@ -8787,7 +9311,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8787
9311
|
}
|
8788
9312
|
}
|
8789
9313
|
};
|
8790
|
-
Toolbar
|
9314
|
+
Toolbar.prototype.destroy = function () {
|
8791
9315
|
if (this.parent.isDestroyed) {
|
8792
9316
|
return;
|
8793
9317
|
}
|
@@ -8801,7 +9325,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8801
9325
|
this.toolbarObj.destroy();
|
8802
9326
|
this.parent.refreshLayout();
|
8803
9327
|
};
|
8804
|
-
Toolbar
|
9328
|
+
Toolbar.prototype.enableItems = function (items, isEnable) {
|
8805
9329
|
for (var i = 0; i < items.length; i++) {
|
8806
9330
|
var ele = select('#' + this.getId(items[i]), this.parent.element);
|
8807
9331
|
if (ele) {
|
@@ -8809,7 +9333,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
|
|
8809
9333
|
}
|
8810
9334
|
}
|
8811
9335
|
};
|
8812
|
-
return Toolbar
|
9336
|
+
return Toolbar;
|
8813
9337
|
}());
|
8814
9338
|
|
8815
9339
|
var Virtualization = /** @__PURE__ @class */ (function () {
|
@@ -8819,6 +9343,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8819
9343
|
}
|
8820
9344
|
/**
|
8821
9345
|
* Sets up UI virtualization for the large icon view.
|
9346
|
+
*
|
9347
|
+
* @returns {void}
|
8822
9348
|
*/
|
8823
9349
|
Virtualization.prototype.setUIVirtualization = function () {
|
8824
9350
|
// Get the current view data source
|
@@ -8844,6 +9370,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8844
9370
|
/**
|
8845
9371
|
* Sets the height of the top and bottom elements that are used for virtualization.
|
8846
9372
|
* These elements are used to give the appearance of an infinitely scrolling list.
|
9373
|
+
*
|
9374
|
+
* @returns {void}
|
8847
9375
|
*/
|
8848
9376
|
Virtualization.prototype.setUlElementHeight = function () {
|
8849
9377
|
// Calculate the number of items in the last row
|
@@ -8851,10 +9379,10 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8851
9379
|
(this.largeIconInstance.allItems.length - this.itemCount) % this.rowItemCount : this.rowItemCount;
|
8852
9380
|
// Create top and bottom elements
|
8853
9381
|
this.topElement = this.filemanagerInstance.createElement('div');
|
8854
|
-
this.topElement.classList.add(
|
9382
|
+
this.topElement.classList.add('e-virtual-top');
|
8855
9383
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement, this.largeIconInstance.element.firstElementChild.firstChild);
|
8856
9384
|
this.bottomElement = this.filemanagerInstance.createElement('div');
|
8857
|
-
this.bottomElement.classList.add(
|
9385
|
+
this.bottomElement.classList.add('e-virtual-bottom');
|
8858
9386
|
this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement, null);
|
8859
9387
|
// Get the margin value for list items
|
8860
9388
|
var marginValue = parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue('margin-top'), 10) +
|
@@ -8876,17 +9404,21 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8876
9404
|
};
|
8877
9405
|
/**
|
8878
9406
|
* Calculates the number of items to display in the list based on the available width and height.
|
8879
|
-
*
|
8880
|
-
* @
|
9407
|
+
*
|
9408
|
+
* @param {number} dataSourceLength The length of the data source.
|
9409
|
+
* @returns {number} The number of items to display.
|
8881
9410
|
*/
|
8882
9411
|
Virtualization.prototype.getItemCount = function (dataSourceLength) {
|
8883
9412
|
// Get the margin values for list items
|
8884
9413
|
var widthMargin = parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-right'), 10) +
|
8885
9414
|
parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue('margin-left'), 10);
|
8886
9415
|
// Calculate the number of items that can fit in a single row
|
8887
|
-
this.rowItemCount =
|
9416
|
+
this.rowItemCount =
|
9417
|
+
Math.floor(parseFloat(formatUnit(this.largeIconInstance.element.firstElementChild.clientWidth)) /
|
9418
|
+
(this.itemList[0].offsetWidth + widthMargin));
|
8888
9419
|
// Calculate the number of items that can fit in the available height
|
8889
|
-
var itemCount = this.rowItemCount *
|
9420
|
+
var itemCount = this.rowItemCount *
|
9421
|
+
(Math.round(parseFloat(formatUnit(this.largeIconInstance.element.clientHeight)) / this.itemList[0].offsetHeight));
|
8890
9422
|
// If the calculated item count is greater than the data source length, set the item count to the data source length
|
8891
9423
|
if (itemCount > dataSourceLength) {
|
8892
9424
|
itemCount = dataSourceLength;
|
@@ -8895,7 +9427,9 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8895
9427
|
};
|
8896
9428
|
/**
|
8897
9429
|
* Wires or un wires the scroll event for the list element.
|
8898
|
-
*
|
9430
|
+
*
|
9431
|
+
* @param {boolean} destroy - Set `true` to unwire the scroll event.
|
9432
|
+
* @returns {void}
|
8899
9433
|
*/
|
8900
9434
|
Virtualization.prototype.wireScrollEvent = function (destroy) {
|
8901
9435
|
if (!destroy) {
|
@@ -8910,6 +9444,9 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8910
9444
|
/**
|
8911
9445
|
* Handles the scroll event for the list element.
|
8912
9446
|
* This method updates the top and bottom elements and the displayed items based on the scroll position.
|
9447
|
+
*
|
9448
|
+
* @returns {void}
|
9449
|
+
* @private
|
8913
9450
|
*/
|
8914
9451
|
Virtualization.prototype.onVirtualUiScroll = function () {
|
8915
9452
|
var _a;
|
@@ -8947,13 +9484,16 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8947
9484
|
this.scrollPosition = scroll;
|
8948
9485
|
// Update the list of items and the items property of the largeIconInstance
|
8949
9486
|
this.largeIconInstance.itemList = Array.prototype.slice.call(selectAll('.' + LIST_ITEM, this.largeIconInstance.element));
|
9487
|
+
this.itemCount = this.itemCount !== this.largeIconInstance.itemList.length ? this.largeIconInstance.itemList.length : this.itemCount;
|
8950
9488
|
this.largeIconInstance.items = this.largeIconInstance.allItems.slice(this.renderedCount -
|
8951
9489
|
this.itemCount, this.renderedCount);
|
8952
9490
|
};
|
8953
9491
|
/**
|
8954
9492
|
* Calculates the current scroll position of the list element.
|
8955
|
-
*
|
8956
|
-
* @
|
9493
|
+
*
|
9494
|
+
* @param {number} startingHeight The starting height from which to calculate the scroll position.
|
9495
|
+
* @returns {number} The current scroll position.
|
9496
|
+
* @private
|
8957
9497
|
*/
|
8958
9498
|
Virtualization.prototype.getscrollerHeight = function (startingHeight) {
|
8959
9499
|
// If the scroll position is less than or equal to the starting height, return 0.
|
@@ -8963,8 +9503,11 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8963
9503
|
};
|
8964
9504
|
/**
|
8965
9505
|
* This method updates the displayed items and the selection based on the scroll direction.
|
8966
|
-
*
|
8967
|
-
* @param
|
9506
|
+
*
|
9507
|
+
* @param {number} listDiff The number of rows to update.
|
9508
|
+
* @param {boolean} isScrollingDown If set to true, the scroll direction is downward.
|
9509
|
+
* @returns {void}
|
9510
|
+
* @private
|
8968
9511
|
*/
|
8969
9512
|
Virtualization.prototype.onNormalScroll = function (listDiff, isScrollingDown) {
|
8970
9513
|
// Update the displayed items
|
@@ -8974,7 +9517,10 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
8974
9517
|
};
|
8975
9518
|
/**
|
8976
9519
|
* Updates the items in the large icons view.
|
8977
|
-
*
|
9520
|
+
*
|
9521
|
+
* @param {boolean} isScrollingDown - If set to true, the scroll direction is downward.
|
9522
|
+
* @returns {void}
|
9523
|
+
* @private
|
8978
9524
|
*/
|
8979
9525
|
Virtualization.prototype.updateUI = function (isScrollingDown) {
|
8980
9526
|
var _this = this;
|
@@ -9048,6 +9594,8 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
9048
9594
|
};
|
9049
9595
|
/**
|
9050
9596
|
* Destroys the component.
|
9597
|
+
*
|
9598
|
+
* @returns {void}
|
9051
9599
|
*/
|
9052
9600
|
Virtualization.prototype.destroy = function () {
|
9053
9601
|
// If the file manager has already been destroyed, return immediately
|
@@ -9062,10 +9610,6 @@ var Virtualization = /** @__PURE__ @class */ (function () {
|
|
9062
9610
|
return Virtualization;
|
9063
9611
|
}());
|
9064
9612
|
|
9065
|
-
/**
|
9066
|
-
* File Manager actions modules
|
9067
|
-
*/
|
9068
|
-
|
9069
9613
|
/**
|
9070
9614
|
* NavigationPane module
|
9071
9615
|
*/
|
@@ -9112,10 +9656,8 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9112
9656
|
if (!isNullOrUndefined(this.treeObj)) {
|
9113
9657
|
return;
|
9114
9658
|
}
|
9115
|
-
// eslint-disable-next-line
|
9116
9659
|
var rootData = getValue(this.parent.pathId[0], this.parent.feParent);
|
9117
9660
|
setValue('_fm_icon', 'e-fe-folder', rootData);
|
9118
|
-
// eslint-disable-next-line
|
9119
9661
|
var attr = {};
|
9120
9662
|
var id = getValue('id', rootData);
|
9121
9663
|
if (!isNullOrUndefined(id)) {
|
@@ -9187,7 +9729,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9187
9729
|
this.parent.activeElements = [dragLi];
|
9188
9730
|
this.parent.dragNodes = [];
|
9189
9731
|
getModule(this.parent, dragLi);
|
9190
|
-
// eslint-disable-next-line
|
9191
9732
|
this.parent.dragData = this.getTreeData(dragLi);
|
9192
9733
|
this.parent.dragPath = this.getDragPath(dragLi, this.parent.dragData[0].name);
|
9193
9734
|
this.parent.dragNodes.push(this.parent.dragData[0].name);
|
@@ -9211,19 +9752,20 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9211
9752
|
};
|
9212
9753
|
this.parent.trigger('fileLoad', eventArgs);
|
9213
9754
|
};
|
9214
|
-
// eslint-disable-next-line
|
9215
9755
|
NavigationPane.prototype.addChild = function (files, target, prevent) {
|
9216
|
-
// eslint-disable-next-line
|
9217
9756
|
var directories = getDirectories(files);
|
9218
|
-
|
9219
|
-
|
9757
|
+
var targetDirectory = this.getTreeData(target);
|
9758
|
+
if (directories.length > 0 && targetDirectory.length > 0 &&
|
9759
|
+
(directories[0].filterPath == null ||
|
9760
|
+
isNullOrUndefined(targetDirectory[0])
|
9761
|
+
&& targetDirectory[0].filterPath == null
|
9762
|
+
|| directories[0].filterPath !==
|
9763
|
+
targetDirectory[0].filterPath)) {
|
9220
9764
|
var length_1 = 0;
|
9221
|
-
// eslint-disable-next-line
|
9222
9765
|
var folders = directories;
|
9223
9766
|
while (length_1 < directories.length) {
|
9224
|
-
// eslint-disable-next-line
|
9225
|
-
folders[length_1]._fm_icon = 'e-fe-folder';
|
9226
|
-
// eslint-disable-next-line
|
9767
|
+
// eslint-disable-next-line camelcase
|
9768
|
+
folders[parseInt(length_1.toString(), 10)]._fm_icon = 'e-fe-folder';
|
9227
9769
|
var attr = {};
|
9228
9770
|
var id = getValue('id', folders[length_1]);
|
9229
9771
|
if (!isNullOrUndefined(id)) {
|
@@ -9240,21 +9782,20 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9240
9782
|
var element = select('[data-uid="' + target + '"]', this.treeObj.element);
|
9241
9783
|
var childElements = select('ul', element);
|
9242
9784
|
if (isNullOrUndefined(childElements)) {
|
9243
|
-
// eslint-disable-next-line
|
9244
9785
|
this.treeObj.addNodes(directories, target, null, prevent);
|
9245
9786
|
}
|
9246
9787
|
}
|
9247
9788
|
};
|
9248
9789
|
// Node Selecting event handler
|
9249
9790
|
NavigationPane.prototype.onNodeSelecting = function (args) {
|
9250
|
-
if (!args.isInteracted && !this.isRightClick &&
|
9791
|
+
if (!args.isInteracted && !this.isRightClick &&
|
9792
|
+
!this.isSameNodeClicked && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
|
9251
9793
|
this.restrictSelecting = false;
|
9252
9794
|
this.isNodeClickCalled = false;
|
9253
9795
|
return;
|
9254
9796
|
}
|
9255
9797
|
if (!this.renameParent) {
|
9256
9798
|
this.parent.activeModule = 'navigationpane';
|
9257
|
-
// eslint-disable-next-line
|
9258
9799
|
var nodeData = this.getTreeData(getValue('id', args.nodeData));
|
9259
9800
|
if (args.node.getAttribute('data-uid') !== this.parent.pathId[this.parent.pathId.length - 1] && !this.isRightClick && !this.isNodeClickCalled || this.isSameNodeClicked) {
|
9260
9801
|
this.isNodeClickCalled = false;
|
@@ -9273,7 +9814,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9273
9814
|
this.isNodeClickCalled = true;
|
9274
9815
|
this.isSameNodeClicked = false;
|
9275
9816
|
this.previousSelected = this.treeObj.selectedNodes;
|
9276
|
-
this.treeObj.selectedNodes = [args.node.getAttribute(
|
9817
|
+
this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
|
9277
9818
|
}
|
9278
9819
|
}
|
9279
9820
|
else if (this.previousSelected[0] !== args.node.getAttribute('data-uid')) {
|
@@ -9285,7 +9826,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9285
9826
|
// Opens the folder while clicking open context menu item in the treeview.
|
9286
9827
|
NavigationPane.prototype.openFileOnContextMenuClick = function (node) {
|
9287
9828
|
var data = this.treeObj.getTreeData(node);
|
9288
|
-
// eslint-disable-next-line
|
9289
9829
|
this.parent.selectedItems = [];
|
9290
9830
|
this.parent.itemData = data;
|
9291
9831
|
this.activeNode = node;
|
@@ -9314,7 +9854,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9314
9854
|
}
|
9315
9855
|
this.activeNode = args.node;
|
9316
9856
|
this.parent.activeModule = 'navigationpane';
|
9317
|
-
// eslint-disable-next-line
|
9318
9857
|
var nodeData = this.getTreeData(getValue('id', args.nodeData));
|
9319
9858
|
this.parent.selectedItems = [];
|
9320
9859
|
this.parent.itemData = nodeData;
|
@@ -9339,7 +9878,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9339
9878
|
this.isPathDragged = this.isRenameParent = this.isRightClick = this.isSameNodeClicked = false;
|
9340
9879
|
};
|
9341
9880
|
/* istanbul ignore next */
|
9342
|
-
// eslint-disable-next-line
|
9343
9881
|
NavigationPane.prototype.onPathDrag = function (args) {
|
9344
9882
|
this.isPathDragged = true;
|
9345
9883
|
this.selectResultNode(args[0]);
|
@@ -9350,6 +9888,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9350
9888
|
return;
|
9351
9889
|
}
|
9352
9890
|
if (args.node.querySelector('.' + LIST_ITEM) === null) {
|
9891
|
+
this.isNodeExpandCalled = true;
|
9353
9892
|
var text = getValue('text', args.nodeData);
|
9354
9893
|
var id = args.node.getAttribute('data-id');
|
9355
9894
|
var isId = isNullOrUndefined(id) ? false : true;
|
@@ -9360,7 +9899,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9360
9899
|
this.parent.itemData = this.getTreeData(getValue('id', args.nodeData));
|
9361
9900
|
this.parent.pathId.push(getValue('id', args.nodeData));
|
9362
9901
|
read(this.parent, nodeExpand, path);
|
9363
|
-
this.isNodeExpandCalled = true;
|
9364
9902
|
}
|
9365
9903
|
};
|
9366
9904
|
/* istanbul ignore next */
|
@@ -9400,7 +9938,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9400
9938
|
};
|
9401
9939
|
NavigationPane.prototype.onPathChanged = function (args) {
|
9402
9940
|
this.parent.isCut = false;
|
9403
|
-
// eslint-disable-next-line
|
9404
9941
|
var currFiles = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feFiles);
|
9405
9942
|
if (this.expandNodeTarget === 'add') {
|
9406
9943
|
var sNode = select('[data-uid="' + this.treeObj.selectedNodes[0] + '"]', this.treeObj.element);
|
@@ -9505,14 +10042,12 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9505
10042
|
this.renameParent = null;
|
9506
10043
|
}
|
9507
10044
|
else {
|
9508
|
-
// eslint-disable-next-line
|
9509
10045
|
var resultData = [];
|
9510
10046
|
if (this.parent.hasId) {
|
9511
10047
|
resultData = new DataManager(this.treeObj.getTreeData()).
|
9512
10048
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
9513
10049
|
}
|
9514
10050
|
else {
|
9515
|
-
// eslint-disable-next-line
|
9516
10051
|
var nData = new DataManager(this.treeObj.getTreeData()).
|
9517
10052
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', this.parent.renameText, false));
|
9518
10053
|
if (nData.length > 0) {
|
@@ -9533,16 +10068,13 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9533
10068
|
this.updateTree(args);
|
9534
10069
|
}
|
9535
10070
|
else {
|
9536
|
-
// eslint-disable-next-line
|
9537
10071
|
var data = this.treeObj.getTreeData();
|
9538
|
-
// eslint-disable-next-line
|
9539
10072
|
var resultData = [];
|
9540
10073
|
if (this.parent.hasId) {
|
9541
10074
|
resultData = new DataManager(data).
|
9542
10075
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
9543
10076
|
}
|
9544
10077
|
else {
|
9545
|
-
// eslint-disable-next-line
|
9546
10078
|
var nData = new DataManager(data).
|
9547
10079
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', this.parent.currentItemText, false));
|
9548
10080
|
if (nData.length > 0) {
|
@@ -9598,7 +10130,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9598
10130
|
}
|
9599
10131
|
this.treeObj.removeNodes(moveNames);
|
9600
10132
|
};
|
9601
|
-
// eslint-disable-next-line
|
9602
10133
|
NavigationPane.prototype.getMoveNames = function (files, flag, path) {
|
9603
10134
|
var moveNames = [];
|
9604
10135
|
for (var i = 0; i < files.length; i++) {
|
@@ -9611,7 +10142,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9611
10142
|
name_2 = path.substring(index + 1);
|
9612
10143
|
path = path.substring(0, index + 1);
|
9613
10144
|
}
|
9614
|
-
// eslint-disable-next-line
|
9615
10145
|
var resultData = new DataManager(this.treeObj.getTreeData()).
|
9616
10146
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', name_2, false));
|
9617
10147
|
for (var j = 0; j < resultData.length; j++) {
|
@@ -9638,16 +10168,13 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9638
10168
|
this.treeObj.removeNodes(moveNames);
|
9639
10169
|
};
|
9640
10170
|
/* istanbul ignore next */
|
9641
|
-
// eslint-disable-next-line
|
9642
10171
|
NavigationPane.prototype.selectResultNode = function (resultObj) {
|
9643
10172
|
if (!this.parent.hasId) {
|
9644
10173
|
var path = getValue('filterPath', resultObj);
|
9645
10174
|
var itemname = getValue('name', resultObj);
|
9646
|
-
// eslint-disable-next-line
|
9647
10175
|
var data = new DataManager(this.treeObj.getTreeData()).
|
9648
10176
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', itemname, false));
|
9649
10177
|
if (data.length > 0) {
|
9650
|
-
// eslint-disable-next-line
|
9651
10178
|
var resultData = new DataManager(data).
|
9652
10179
|
executeLocal(new Query().where('filterPath', 'equal', path, false));
|
9653
10180
|
if (resultData.length > 0) {
|
@@ -9669,14 +10196,12 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9669
10196
|
this.parent.isDropEnd = !this.parent.isPasteError;
|
9670
10197
|
};
|
9671
10198
|
NavigationPane.prototype.onpasteEnd = function (args) {
|
9672
|
-
// eslint-disable-next-line
|
9673
10199
|
var resultData = [];
|
9674
10200
|
if (this.parent.hasId) {
|
9675
10201
|
resultData = new DataManager(this.treeObj.getTreeData()).
|
9676
10202
|
executeLocal(new Query().where('id', 'equal', getValue('id', args.cwd), false));
|
9677
10203
|
}
|
9678
10204
|
else {
|
9679
|
-
// eslint-disable-next-line
|
9680
10205
|
var nData = new DataManager(this.treeObj.getTreeData()).
|
9681
10206
|
executeLocal(new Query().where(this.treeObj.fields.text, 'equal', getValue('name', args.cwd), false));
|
9682
10207
|
if (nData.length > 0) {
|
@@ -9698,6 +10223,9 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9698
10223
|
};
|
9699
10224
|
/* istanbul ignore next */
|
9700
10225
|
NavigationPane.prototype.checkDropPath = function (args) {
|
10226
|
+
if (isFileSystemData(this.parent) && this.parent.path === this.parent.dropPath || this.parent.targetModule === 'navigationpane') {
|
10227
|
+
return;
|
10228
|
+
}
|
9701
10229
|
if (this.parent.hasId) {
|
9702
10230
|
this.parent.isDropEnd = !this.parent.isPasteError;
|
9703
10231
|
readDropPath(this.parent);
|
@@ -9716,8 +10244,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9716
10244
|
this.updateItemData();
|
9717
10245
|
}
|
9718
10246
|
this.moveNames = [];
|
9719
|
-
|
9720
|
-
var obj = this.parent.isDragDrop ? this.parent.dragData : this.parent.actionRecords;
|
10247
|
+
var obj = this.parent.isDragDrop || isFileSystemData(this.parent) ? this.parent.dragData : this.parent.actionRecords;
|
9721
10248
|
for (var i = 0; i < obj.length; i++) {
|
9722
10249
|
if (getValue('isFile', obj[i]) === false) {
|
9723
10250
|
this.moveNames.push(getValue('_fm_id', obj[i]));
|
@@ -9797,12 +10324,10 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9797
10324
|
/* istanbul ignore next */
|
9798
10325
|
NavigationPane.prototype.onDetailsInit = function () {
|
9799
10326
|
if (this.parent.activeModule === this.getModuleName()) {
|
9800
|
-
// eslint-disable-next-line
|
9801
10327
|
var dataobj = this.getTreeData(this.treeObj.selectedNodes[0]);
|
9802
10328
|
this.parent.itemData = dataobj;
|
9803
10329
|
}
|
9804
10330
|
};
|
9805
|
-
// eslint-disable-next-line
|
9806
10331
|
NavigationPane.prototype.onMenuItemData = function (args) {
|
9807
10332
|
if (this.parent.activeModule === this.getModuleName()) {
|
9808
10333
|
var liEle = closest(args.target, 'li');
|
@@ -9900,7 +10425,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9900
10425
|
break;
|
9901
10426
|
case 'f2':
|
9902
10427
|
if (this.parent.selectedItems.length === 0) {
|
9903
|
-
// eslint-disable-next-line
|
9904
10428
|
var data = this.getTreeData(this.treeObj.selectedNodes[0])[0];
|
9905
10429
|
if (!hasEditAccess(data)) {
|
9906
10430
|
createDeniedDialog(this.parent, data, permissionEdit);
|
@@ -9913,9 +10437,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9913
10437
|
break;
|
9914
10438
|
}
|
9915
10439
|
};
|
9916
|
-
// eslint-disable-next-line
|
9917
10440
|
NavigationPane.prototype.getTreeData = function (args) {
|
9918
|
-
// eslint-disable-next-line
|
9919
10441
|
var data = this.treeObj.getTreeData(args);
|
9920
10442
|
for (var i = 0; i < data.length; i++) {
|
9921
10443
|
if (isNullOrUndefined(getValue('hasChild', data[i]))) {
|
@@ -9929,7 +10451,6 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9929
10451
|
this.parent.currentItemText = getValue('name', this.parent.itemData[0]);
|
9930
10452
|
};
|
9931
10453
|
NavigationPane.prototype.updateItemData = function () {
|
9932
|
-
// eslint-disable-next-line
|
9933
10454
|
var data = this.getTreeData(this.treeObj.selectedNodes[0])[0];
|
9934
10455
|
this.parent.itemData = [data];
|
9935
10456
|
this.parent.isFile = false;
|
@@ -9951,6 +10472,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
|
|
9951
10472
|
return NavigationPane;
|
9952
10473
|
}());
|
9953
10474
|
|
10475
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
9954
10476
|
/**
|
9955
10477
|
* DetailsView module
|
9956
10478
|
*/
|
@@ -9977,7 +10499,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
9977
10499
|
this.isNameWidth = false;
|
9978
10500
|
this.pasteOperation = false;
|
9979
10501
|
this.uploadOperation = false;
|
9980
|
-
Grid.Inject(Resize, ContextMenu$
|
10502
|
+
Grid.Inject(Resize, ContextMenu$2, Sort, VirtualScroll);
|
9981
10503
|
this.parent = parent;
|
9982
10504
|
this.element = select('#' + this.parent.element.id + GRID_ID, this.parent.element);
|
9983
10505
|
this.addEventListener();
|
@@ -10024,7 +10546,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10024
10546
|
showSpinner(this.parent.element);
|
10025
10547
|
if (this.parent.view === 'Details') {
|
10026
10548
|
removeClass([this.parent.element], MULTI_SELECT);
|
10027
|
-
// eslint-disable-next-line
|
10028
10549
|
var items = getSortedData(this.parent, args.files);
|
10029
10550
|
this.checkNameWidth();
|
10030
10551
|
var columns = this.getColumns();
|
@@ -10065,8 +10586,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10065
10586
|
width: '100%',
|
10066
10587
|
height: (this.parent.enableVirtualization) ? this.getGridHeight() : 'auto',
|
10067
10588
|
beforeCopy: function (args) { args.cancel = true; },
|
10068
|
-
|
10069
|
-
load: function (args) {
|
10589
|
+
load: function () {
|
10070
10590
|
this.focusModule.destroy();
|
10071
10591
|
},
|
10072
10592
|
locale: this.parent.locale
|
@@ -10084,18 +10604,18 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10084
10604
|
}
|
10085
10605
|
};
|
10086
10606
|
DetailsView.prototype.reactTemplateRender = function (args) {
|
10087
|
-
this.parent[
|
10607
|
+
this.parent['portals'] = args;
|
10088
10608
|
if (this.parent.portals && this.parent.toolbarModule && this.parent.toolbarModule.toolbarObj &&
|
10089
10609
|
this.parent.toolbarModule.toolbarObj.portals) {
|
10090
|
-
this.parent[
|
10610
|
+
this.parent['portals'] = this.parent['portals'].concat(this.parent.toolbarModule.toolbarObj.portals);
|
10091
10611
|
}
|
10092
|
-
this.parent.notify('renderReactTemplate', this.parent[
|
10093
|
-
this.parent[
|
10612
|
+
this.parent.notify('renderReactTemplate', this.parent['portals']);
|
10613
|
+
this.parent['renderReactTemplates']();
|
10094
10614
|
};
|
10095
10615
|
/**
|
10096
10616
|
* Gets the grid height.
|
10097
10617
|
*
|
10098
|
-
* @returns The grid height.
|
10618
|
+
* @returns {number} - The grid height.
|
10099
10619
|
* @private
|
10100
10620
|
*/
|
10101
10621
|
DetailsView.prototype.getGridHeight = function () {
|
@@ -10173,7 +10693,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10173
10693
|
return "<span class=\"e-fe-icon " + data._fm_iconClass + "\"></span>";
|
10174
10694
|
}), allowResizing: false, allowSorting: true, customAttributes: { class: 'e-fe-grid-icon' },
|
10175
10695
|
headerTemplate: initializeCSPTemplate(function () {
|
10176
|
-
return
|
10696
|
+
return '<span class=\'e-fe-icon e-fe-folder\'></span>';
|
10177
10697
|
})
|
10178
10698
|
};
|
10179
10699
|
columns.unshift(icon);
|
@@ -10232,7 +10752,8 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10232
10752
|
}
|
10233
10753
|
}
|
10234
10754
|
if (!this.parent.showFileExtension && getValue('isFile', args.data)) {
|
10235
|
-
var
|
10755
|
+
var text = getValue('name', args.data);
|
10756
|
+
var textEle = args.row.querySelector('[title= "' + text + '"]');
|
10236
10757
|
if (textEle) {
|
10237
10758
|
var name_1 = getValue('name', args.data);
|
10238
10759
|
var type = getValue('type', args.data);
|
@@ -10266,7 +10787,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10266
10787
|
var dateEle = args.row.querySelector('.e-fe-date');
|
10267
10788
|
var intl = new Internationalization(this.parent.locale);
|
10268
10789
|
var columns = this.parent.detailsViewSettings.columns;
|
10269
|
-
// eslint-disable-next-line
|
10270
10790
|
var format = void 0;
|
10271
10791
|
for (var i = 0; i < columns.length; i++) {
|
10272
10792
|
if (columns[i].field === 'dateModified') {
|
@@ -10302,7 +10822,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10302
10822
|
var len = rows.length;
|
10303
10823
|
this.sortSelectedNodes = [];
|
10304
10824
|
while (len > 0) {
|
10305
|
-
// eslint-disable-next-line
|
10306
10825
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
10307
10826
|
this.sortSelectedNodes.push(getValue(this.parent.hasId ? 'id' : 'name', data));
|
10308
10827
|
len--;
|
@@ -10322,8 +10841,9 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10322
10841
|
showSpinner(this.parent.element);
|
10323
10842
|
var nameColumn = this.parent.detailsViewSettings.columns.find(function (column) { return column.field === _this.parent.sortBy; });
|
10324
10843
|
if (nameColumn && !('sortComparer' in nameColumn)) {
|
10325
|
-
|
10326
|
-
|
10844
|
+
var items = getSortedData(this.parent, (this.parent.enableVirtualization)
|
10845
|
+
? args.result
|
10846
|
+
: this.gridObj.dataSource);
|
10327
10847
|
args.result = items;
|
10328
10848
|
}
|
10329
10849
|
};
|
@@ -10332,7 +10852,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10332
10852
|
this.createDragObj();
|
10333
10853
|
if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization) ||
|
10334
10854
|
((this.parent.selectedItems.length !== 0 && this.parent.enableVirtualization &&
|
10335
|
-
this.element.querySelector('.e-content').scrollTop
|
10855
|
+
this.element.querySelector('.e-content').scrollTop === 0))) {
|
10336
10856
|
this.selectRecords(this.parent.selectedItems);
|
10337
10857
|
}
|
10338
10858
|
if (this.isPasteOperation === true) {
|
@@ -10405,7 +10925,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10405
10925
|
this.isLoaded = false;
|
10406
10926
|
};
|
10407
10927
|
DetailsView.prototype.selectRecords = function (nodes) {
|
10408
|
-
// eslint-disable-next-line
|
10409
10928
|
var gridRecords = this.gridObj.getCurrentViewRecords();
|
10410
10929
|
var sRecords = [];
|
10411
10930
|
for (var i = 0, len = gridRecords.length; i < len; i++) {
|
@@ -10413,7 +10932,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10413
10932
|
if (nodes.indexOf(node) !== -1) {
|
10414
10933
|
sRecords.push(i);
|
10415
10934
|
}
|
10416
|
-
else if (!this.parent.showFileExtension && node.includes('.')) {
|
10935
|
+
else if (!this.parent.showFileExtension && !this.parent.hasId && node.includes('.')) {
|
10417
10936
|
var Str2 = node.split('.').slice(0, -1).join('.');
|
10418
10937
|
if (nodes.indexOf(Str2) !== -1) {
|
10419
10938
|
sRecords.push(i);
|
@@ -10425,18 +10944,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10425
10944
|
this.addFocus(this.gridObj.selectedRowIndex);
|
10426
10945
|
}
|
10427
10946
|
};
|
10428
|
-
// eslint-disable-next-line
|
10429
10947
|
DetailsView.prototype.addSelection = function (data) {
|
10430
|
-
// eslint-disable-next-line
|
10431
10948
|
var items = this.gridObj.getCurrentViewRecords();
|
10432
|
-
// eslint-disable-next-line
|
10433
10949
|
var rData = [];
|
10434
10950
|
if (this.parent.hasId) {
|
10435
10951
|
rData = new DataManager(items).
|
10436
10952
|
executeLocal(new Query().where('id', 'equal', this.parent.renamedId, false));
|
10437
10953
|
}
|
10438
10954
|
else {
|
10439
|
-
// eslint-disable-next-line
|
10440
10955
|
var nData = new DataManager(items).
|
10441
10956
|
executeLocal(new Query().where('name', 'equal', getValue('name', data), false));
|
10442
10957
|
if (nData.length > 0) {
|
@@ -10454,7 +10969,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10454
10969
|
this.gridObj.sortModule.sortColumn(this.parent.sortBy, this.parent.sortOrder);
|
10455
10970
|
}
|
10456
10971
|
else {
|
10457
|
-
// eslint-disable-next-line
|
10458
10972
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
10459
10973
|
}
|
10460
10974
|
if (this.element.querySelector('.e-content').scrollTop !== 0) {
|
@@ -10551,10 +11065,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10551
11065
|
var len = this.gridObj.columns.length;
|
10552
11066
|
var columnData = JSON.parse(JSON.stringify(this.gridObj.columns));
|
10553
11067
|
if (columnData[len - 1].field && columnData[len - 1].field !== 'filterPath' && !this.parent.isMobile) {
|
10554
|
-
var pathColumn
|
11068
|
+
var pathColumn = {
|
10555
11069
|
field: 'filterPath', headerText: getLocaleText(this.parent, 'Path'), minWidth: 180, width: 'auto'
|
10556
11070
|
};
|
10557
|
-
this.gridObj.columns.push(pathColumn
|
11071
|
+
this.gridObj.columns.push(pathColumn);
|
10558
11072
|
this.adjustWidth(this.gridObj.columns, 'filterPath');
|
10559
11073
|
this.adjustWidth(this.gridObj.columns, 'name');
|
10560
11074
|
this.isColumnRefresh = true;
|
@@ -10562,7 +11076,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10562
11076
|
}
|
10563
11077
|
};
|
10564
11078
|
DetailsView.prototype.checkEmptyDiv = function (args) {
|
10565
|
-
// eslint-disable-next-line
|
10566
11079
|
var items = getSortedData(this.parent, args.files);
|
10567
11080
|
if (items.length === 0 && !isNullOrUndefined(this.element.querySelector('.' + GRID_VIEW))) {
|
10568
11081
|
createEmptyElement(this.parent, this.element, args);
|
@@ -10579,21 +11092,18 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10579
11092
|
};
|
10580
11093
|
DetailsView.prototype.onOpenInit = function () {
|
10581
11094
|
if (this.parent.activeModule === 'detailsview') {
|
10582
|
-
// eslint-disable-next-line
|
10583
11095
|
var data = this.gridObj.getSelectedRecords()[0];
|
10584
11096
|
this.openContent(data);
|
10585
11097
|
}
|
10586
11098
|
};
|
10587
11099
|
DetailsView.prototype.DblClickEvents = function (args) {
|
10588
11100
|
this.gridObj.selectRows([args.rowIndex]);
|
10589
|
-
// eslint-disable-next-line
|
10590
11101
|
var data;
|
10591
11102
|
if (args.rowData) {
|
10592
11103
|
data = JSON.parse(JSON.stringify(args.rowData));
|
10593
11104
|
this.openContent(data);
|
10594
11105
|
}
|
10595
11106
|
};
|
10596
|
-
// eslint-disable-next-line
|
10597
11107
|
DetailsView.prototype.openContent = function (data) {
|
10598
11108
|
var _this = this;
|
10599
11109
|
if (!hasReadAccess(data)) {
|
@@ -10690,7 +11200,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10690
11200
|
this.gridObj.sortColumn('name', this.parent.sortOrder);
|
10691
11201
|
}
|
10692
11202
|
else {
|
10693
|
-
// eslint-disable-next-line
|
10694
11203
|
this.gridObj.dataSource = getSortedData(this.parent, this.gridObj.dataSource);
|
10695
11204
|
}
|
10696
11205
|
this.parent.notify(sortByChange, {});
|
@@ -10879,7 +11388,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10879
11388
|
this.parent.off(updateSelectionData, this.onUpdateSelectionData);
|
10880
11389
|
};
|
10881
11390
|
DetailsView.prototype.onActionFailure = function () { this.interaction = true; };
|
10882
|
-
// eslint-disable-next-line
|
10883
11391
|
DetailsView.prototype.onMenuItemData = function (args) {
|
10884
11392
|
if (this.parent.activeModule === this.getModuleName()) {
|
10885
11393
|
this.parent.itemData = [this.gridObj.getRowInfo(args.target).rowData];
|
@@ -10920,7 +11428,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
10920
11428
|
getModule(this.parent, dragLi);
|
10921
11429
|
this.parent.activeElements = [];
|
10922
11430
|
this.parent.dragData = [];
|
10923
|
-
// eslint-disable-next-line
|
10924
11431
|
this.parent.dragData = this.gridObj.getSelectedRecords();
|
10925
11432
|
var dragRow;
|
10926
11433
|
if (this.parent.dragData.length === 0 && dragLi) {
|
@@ -11009,16 +11516,13 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11009
11516
|
DetailsView.prototype.onDropInit = function (args) {
|
11010
11517
|
if (this.parent.targetModule === this.getModuleName()) {
|
11011
11518
|
/* istanbul ignore next */
|
11012
|
-
// eslint-disable-next-line
|
11013
11519
|
var cwdData = getValue(this.parent.pathId[this.parent.pathId.length - 1], this.parent.feParent);
|
11014
11520
|
if (!args.target.closest('tr')) {
|
11015
11521
|
this.parent.dropPath = this.parent.path;
|
11016
11522
|
this.parent.dropData = cwdData;
|
11017
11523
|
}
|
11018
11524
|
else {
|
11019
|
-
// eslint-disable-next-line
|
11020
11525
|
var info = null;
|
11021
|
-
// eslint-disable-next-line
|
11022
11526
|
info = this.gridObj.getRowInfo(args.target).rowData;
|
11023
11527
|
this.parent.dropPath = info.isFile ? this.parent.path : getFullPath(this.parent, info, this.parent.path);
|
11024
11528
|
this.parent.dropData = info.isFile ? cwdData : info;
|
@@ -11120,7 +11624,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11120
11624
|
this.parent.currentItemText = getValue('name', args.data);
|
11121
11625
|
}
|
11122
11626
|
else if (len > 0) {
|
11123
|
-
// eslint-disable-next-line
|
11124
11627
|
var data = this.gridObj.getRowsObject()[rows[len - 1]].data;
|
11125
11628
|
this.parent.currentItemText = getValue('name', data);
|
11126
11629
|
}
|
@@ -11150,7 +11653,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11150
11653
|
};
|
11151
11654
|
DetailsView.prototype.selectedRecords = function () {
|
11152
11655
|
this.parent.setProperties({ selectedItems: [] }, true);
|
11153
|
-
// eslint-disable-next-line
|
11154
11656
|
var selectedRecords = this.gridSelectNodes();
|
11155
11657
|
var selectSize = 0;
|
11156
11658
|
while (selectSize < selectedRecords.length) {
|
@@ -11214,28 +11716,27 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11214
11716
|
EventHandler.remove(this.parent.element, 'focusout', this.onBlur);
|
11215
11717
|
};
|
11216
11718
|
DetailsView.prototype.wireClickEvent = function (toBind) {
|
11719
|
+
var _this = this;
|
11217
11720
|
if (toBind) {
|
11218
|
-
// eslint-disable-next-line
|
11219
|
-
var proxy_1 = this;
|
11220
11721
|
var ele = this.gridObj.getContent();
|
11221
11722
|
this.clickObj = new Touch(ele, {
|
11222
11723
|
tap: function (eve) {
|
11223
11724
|
if (eve.tapCount === 1 && eve.originalEvent.target.classList.contains('e-content')) {
|
11224
|
-
|
11725
|
+
_this.onClearAllInit();
|
11225
11726
|
}
|
11226
11727
|
},
|
11227
11728
|
tapHold: function (e) {
|
11228
|
-
if (
|
11729
|
+
if (_this.parent.isDevice) {
|
11229
11730
|
e.originalEvent.preventDefault();
|
11230
|
-
if (
|
11231
|
-
setValue('enableSelectMultiTouch',
|
11232
|
-
addClass([
|
11731
|
+
if (_this.parent.allowMultiSelection) {
|
11732
|
+
setValue('enableSelectMultiTouch', _this.parent.allowMultiSelection, _this.gridObj.selectionModule);
|
11733
|
+
addClass([_this.parent.element], MULTI_SELECT);
|
11233
11734
|
}
|
11234
11735
|
var target = e.originalEvent.target;
|
11235
11736
|
if (target) {
|
11236
11737
|
var row = closest(target, '.' + ROW);
|
11237
|
-
var index =
|
11238
|
-
|
11738
|
+
var index = _this.gridObj.getRows().indexOf(row);
|
11739
|
+
_this.gridObj.selectRow(index);
|
11239
11740
|
}
|
11240
11741
|
}
|
11241
11742
|
}
|
@@ -11279,7 +11780,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11279
11780
|
parseInt(this.getFocusedItem().getAttribute('data-rowindex'), 10) : null;
|
11280
11781
|
};
|
11281
11782
|
/* istanbul ignore next */
|
11282
|
-
// eslint:disable-next-line
|
11283
11783
|
DetailsView.prototype.keydownHandler = function (e) {
|
11284
11784
|
if (!this.isRendered) {
|
11285
11785
|
return;
|
@@ -11318,26 +11818,20 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11318
11818
|
case 'ctrlD':
|
11319
11819
|
e.preventDefault();
|
11320
11820
|
break;
|
11321
|
-
default:
|
11322
|
-
break;
|
11323
11821
|
}
|
11324
11822
|
};
|
11325
11823
|
/* istanbul ignore next */
|
11326
|
-
// eslint:disable-next-line
|
11327
11824
|
DetailsView.prototype.keyupHandler = function (e) {
|
11328
11825
|
if (!this.isRendered) {
|
11329
11826
|
return;
|
11330
11827
|
}
|
11331
11828
|
e.preventDefault();
|
11332
11829
|
var action = e.action;
|
11333
|
-
// eslint-disable-next-line
|
11334
11830
|
var gridItems = getSortedData(this.parent, this.gridObj.dataSource);
|
11335
11831
|
var gridLength = gridItems.length;
|
11336
|
-
var focItem = this.getFocusedItem();
|
11337
11832
|
var focIndex = this.getFocusedItemIndex();
|
11338
11833
|
var selIndex = this.gridObj.selectedRowIndex;
|
11339
11834
|
var selRowIndeces = this.gridObj.getSelectedRowIndexes();
|
11340
|
-
// eslint-disable-next-line
|
11341
11835
|
var rowData;
|
11342
11836
|
var firstItem;
|
11343
11837
|
var lastItem;
|
@@ -11367,7 +11861,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11367
11861
|
}
|
11368
11862
|
rowData = this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data;
|
11369
11863
|
if (rowData) {
|
11370
|
-
// eslint-disable-next-line
|
11371
11864
|
var data = JSON.parse(JSON.stringify(rowData));
|
11372
11865
|
this.openContent(data);
|
11373
11866
|
}
|
@@ -11484,14 +11977,12 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11484
11977
|
break;
|
11485
11978
|
}
|
11486
11979
|
};
|
11487
|
-
// eslint-disable-next-line
|
11488
11980
|
DetailsView.prototype.gridSelectNodes = function () {
|
11489
11981
|
return this.gridObj.getSelectedRecords();
|
11490
11982
|
};
|
11491
11983
|
DetailsView.prototype.doDownload = function () {
|
11492
11984
|
if (this.parent.selectedItems.length !== 0) {
|
11493
11985
|
this.parent.itemData = this.gridObj.getSelectedRecords();
|
11494
|
-
// eslint-disable-next-line
|
11495
11986
|
var items = this.parent.itemData;
|
11496
11987
|
for (var i = 0; i < items.length; i++) {
|
11497
11988
|
if (!hasDownloadAccess(items[i])) {
|
@@ -11505,7 +11996,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11505
11996
|
DetailsView.prototype.performDelete = function () {
|
11506
11997
|
if (this.parent.selectedItems && this.parent.selectedItems.length > 0) {
|
11507
11998
|
this.parent.itemData = this.gridObj.getSelectedRecords();
|
11508
|
-
// eslint-disable-next-line
|
11509
11999
|
var items = this.parent.itemData;
|
11510
12000
|
for (var i = 0; i < items.length; i++) {
|
11511
12001
|
if (!hasEditAccess(items[i])) {
|
@@ -11523,11 +12013,9 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11523
12013
|
}
|
11524
12014
|
};
|
11525
12015
|
DetailsView.prototype.updateRenameData = function () {
|
11526
|
-
// eslint-disable-next-line
|
11527
12016
|
var data = this.gridSelectNodes()[0];
|
11528
12017
|
updateRenamingData(this.parent, data);
|
11529
12018
|
};
|
11530
|
-
// eslint-disable-next-line
|
11531
12019
|
DetailsView.prototype.shiftMoveMethod = function (gridItems, selIndex, focIndex, selRowIndeces, e) {
|
11532
12020
|
if (!this.parent.allowMultiSelection) {
|
11533
12021
|
this.moveFunction(gridItems, e, selIndex);
|
@@ -11545,7 +12033,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11545
12033
|
}
|
11546
12034
|
}
|
11547
12035
|
};
|
11548
|
-
// eslint-disable-next-line
|
11549
12036
|
DetailsView.prototype.moveFunction = function (selectedItems, e, rowIndex) {
|
11550
12037
|
if (!isNullOrUndefined(this.getFocusedItem()) && this.parent.allowMultiSelection) {
|
11551
12038
|
if (e.action === 'moveDown') {
|
@@ -11592,7 +12079,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11592
12079
|
this.gridObj.selectRow(selIndex);
|
11593
12080
|
}
|
11594
12081
|
};
|
11595
|
-
// eslint-disable-next-line
|
11596
12082
|
DetailsView.prototype.ctrlMoveFunction = function (items, e, rowIndex) {
|
11597
12083
|
var nextItem;
|
11598
12084
|
if (!isNullOrUndefined(this.getFocusedItem())) {
|
@@ -11611,7 +12097,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11611
12097
|
}
|
11612
12098
|
this.addFocus(nextItem);
|
11613
12099
|
};
|
11614
|
-
// eslint-disable-next-line
|
11615
12100
|
DetailsView.prototype.checkRowsKey = function (items, indexValue, focIndex, e) {
|
11616
12101
|
if (this.gridObj.checkAllRows === 'Uncheck' || this.gridObj.checkAllRows === 'Intermediate') {
|
11617
12102
|
if (e.action !== 'csHome' && e.action !== 'csEnd') {
|
@@ -11735,7 +12220,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11735
12220
|
}
|
11736
12221
|
return check;
|
11737
12222
|
};
|
11738
|
-
// eslint-disable-next-line
|
11739
12223
|
DetailsView.prototype.shiftSelectedItem = function (selIndex, selRowIndexes, gridItems, e) {
|
11740
12224
|
if (selIndex === -1) {
|
11741
12225
|
this.gridObj.selectRow(0);
|
@@ -11784,7 +12268,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11784
12268
|
}
|
11785
12269
|
}
|
11786
12270
|
};
|
11787
|
-
// eslint-disable-next-line
|
11788
12271
|
DetailsView.prototype.onMethodCall = function (e) {
|
11789
12272
|
if (this.parent.view !== 'Details') {
|
11790
12273
|
return;
|
@@ -11817,17 +12300,14 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11817
12300
|
break;
|
11818
12301
|
}
|
11819
12302
|
};
|
11820
|
-
// eslint-disable-next-line
|
11821
12303
|
DetailsView.prototype.getRecords = function (nodes) {
|
11822
|
-
// eslint-disable-next-line
|
11823
12304
|
var gridRecords = this.gridObj.getCurrentViewRecords();
|
11824
|
-
// eslint-disable-next-line
|
11825
12305
|
var records = [];
|
11826
12306
|
var hasFilter = (this.parent.breadcrumbbarModule.searchObj.element.value !== '' || this.parent.isFiltered) ? true : false;
|
11827
|
-
var filter
|
12307
|
+
var filter = this.parent.hasId ? 'id' : 'name';
|
11828
12308
|
if (this.parent.hasId || !hasFilter) {
|
11829
12309
|
for (var i = 0, len = gridRecords.length; i < len; i++) {
|
11830
|
-
if (nodes.indexOf(getValue(filter
|
12310
|
+
if (nodes.indexOf(getValue(filter, gridRecords[i])) !== -1) {
|
11831
12311
|
records.push(gridRecords[i]);
|
11832
12312
|
}
|
11833
12313
|
}
|
@@ -11848,12 +12328,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11848
12328
|
this.performDelete();
|
11849
12329
|
return;
|
11850
12330
|
}
|
11851
|
-
// eslint-disable-next-line
|
11852
12331
|
var records = this.getRecords(ids);
|
11853
12332
|
if (records.length === 0) {
|
11854
12333
|
return;
|
11855
12334
|
}
|
11856
|
-
// eslint-disable-next-line
|
11857
12335
|
var data = [];
|
11858
12336
|
var newIds = [];
|
11859
12337
|
for (var i = 0; i < records.length; i++) {
|
@@ -11867,12 +12345,10 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11867
12345
|
this.doDownload();
|
11868
12346
|
return;
|
11869
12347
|
}
|
11870
|
-
// eslint-disable-next-line
|
11871
12348
|
var dRecords = this.getRecords(ids);
|
11872
12349
|
if (dRecords.length === 0) {
|
11873
12350
|
return;
|
11874
12351
|
}
|
11875
|
-
// eslint-disable-next-line
|
11876
12352
|
var data = [];
|
11877
12353
|
var newIds = [];
|
11878
12354
|
for (var i = 0; i < dRecords.length; i++) {
|
@@ -11885,7 +12361,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11885
12361
|
if (isNullOrUndefined(id)) {
|
11886
12362
|
return;
|
11887
12363
|
}
|
11888
|
-
// eslint-disable-next-line
|
11889
12364
|
var records = this.getRecords([id]);
|
11890
12365
|
if (records.length > 0) {
|
11891
12366
|
this.openContent(records[0]);
|
@@ -11897,7 +12372,6 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11897
12372
|
this.performRename();
|
11898
12373
|
return;
|
11899
12374
|
}
|
11900
|
-
// eslint-disable-next-line
|
11901
12375
|
var records = this.getRecords([id]);
|
11902
12376
|
if (records.length > 0) {
|
11903
12377
|
updateRenamingData(this.parent, records[0]);
|
@@ -11917,21 +12391,5 @@ var DetailsView = /** @__PURE__ @class */ (function () {
|
|
11917
12391
|
return DetailsView;
|
11918
12392
|
}());
|
11919
12393
|
|
11920
|
-
|
11921
|
-
* File Manager layout modules
|
11922
|
-
*/
|
11923
|
-
|
11924
|
-
/**
|
11925
|
-
* File Manager pop-up modules
|
11926
|
-
*/
|
11927
|
-
|
11928
|
-
/**
|
11929
|
-
* File Manager modules
|
11930
|
-
*/
|
11931
|
-
|
11932
|
-
/**
|
11933
|
-
* File Manager all modules
|
11934
|
-
*/
|
11935
|
-
|
11936
|
-
export { AjaxSettings, defaultToolbarItems, ToolbarSettings, ToolbarItem, 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, read, createFolder, filter, rename, paste, Delete, GetDetails, Search, Download, sortComparer, updatePath, getPath, getPathId, getPathNames, getParents, generatePath, removeActive, activeElement, addBlur, removeBlur, getModule, searchWordHandler, updateLayout, getTargetModule, refresh, openAction, getPathObject, copyFiles, cutFiles, fileType, getImageUrl, getFullPath, getName, getSortedData, getObject, createEmptyElement, getDirectories, setNodeId, setDateObject, getLocaleText, getCssClass, sortbyClickHandler, getSortField, setNextPath, openSearchFolder, pasteHandler, validateSubFolder, dropHandler, getParentPath, getDirectoryPath, doPasteUpdate, readDropPath, getDuplicateData, createVirtualDragElement, dragStopHandler, dragStartHandler, dragCancel, removeDropTarget, removeItemClass, scrollHandler, draggingHandler, objectToString, getItemName, updateRenamingData, doRename, doDownload, doDeleteFiles, doDownloadFiles, createDeniedDialog, getAccessClass, hasReadAccess, hasEditAccess, hasContentAccess, hasUploadAccess, hasDownloadAccess, createNewFolder, uploadItem };
|
12394
|
+
export { ACTIVE, ALT_DIALOG_ID, AjaxSettings, BLUR, BREADCRUMBBAR_ID, BREADCRUMBS, BreadCrumbBar, CB_WRAP, CHECK, CHECK_SELECT, CLONE, COLLAPSED, CONTENT_ID, CONTEXT_MENU_ID, CONTROL, Column, ContextMenu, ContextMenuSettings, DETAILS_LABEL, DIALOG_ID, DISPLAY_NONE, DROP_FILE, DROP_FOLDER, Delete, DetailsView, DetailsViewSettings, Download, EMPTY, EMPTY_CONTENT, EMPTY_INNER_CONTENT, ERROR_CONTENT, EXTN_DIALOG_ID, FILTER, FOCUS, FOCUSED, FOLDER, FRAME, FULLROW, FileManager, GRID_CONTENT, GRID_HEADER, GRID_ID, GRID_VIEW, GetDetails, HEADER_CHECK, HOVER, ICONS, ICON_BREADCRUMB, ICON_CLEAR, ICON_COLLAPSIBLE, ICON_COPY, ICON_CUT, ICON_DELETE, ICON_DETAILS, ICON_DOWNLOAD, ICON_DROP_IN, ICON_DROP_OUT, ICON_GRID, ICON_IMAGE, ICON_LARGE, ICON_MUSIC, ICON_NEWFOLDER, ICON_NO_DROP, ICON_OPEN, ICON_OPTIONS, ICON_PASTE, ICON_REFRESH, ICON_RENAME, ICON_SELECTALL, ICON_SHORTBY, ICON_UPLOAD, ICON_VIDEO, ICON_VIEW, IMG_DIALOG_ID, LARGEICON_ID, LARGE_EMPTY_FOLDER, LARGE_EMPTY_FOLDER_TWO, LARGE_ICON, LARGE_ICONS, LARGE_ICON_FOLDER, LAYOUT, LAYOUT_CONTENT, LAYOUT_ID, LIST_ITEM, LIST_PARENT, LIST_TEXT, LargeIconsView, MENU_ICON, MENU_ITEM, MOBILE, MOB_POPUP, MULTI_SELECT, NAVIGATION, NAVIGATION_ID, NavigationPane, NavigationPaneSettings, OVERLAY, RETRY_DIALOG_ID, RETRY_ID, ROOT, ROOT_POPUP, ROW, ROWCELL, RTL, SEARCH_ID, SELECTED_ITEMS, SORTBY_ID, SPLITTER_ID, SPLIT_BAR, STATUS, SUBMENU_ICON, Search, SearchSettings, TB_ITEM, TB_OPTION_DOT, TB_OPTION_TICK, TEMPLATE_CELL, TEXT_CONTENT, TOOLBAR_ID, TREE_ID, TREE_VIEW, Toolbar, ToolbarItem, ToolbarSettings, UPLOAD_DIALOG_ID, UPLOAD_ID, UploadSettings, VALUE, VIEW_ID, Virtualization, actionFailure, activeElement, addBlur, afterRequest, beforeDelete, beforeDownload, beforeRequest, clearAllInit, clearPathInit, closePopup, columnArray, copyFiles, createDeniedDialog, createDialog, createEmptyElement, createEnd, createExtDialog, createFolder, createImageDialog, createNewFolder, createVirtualDragElement, cutCopyInit, cutEnd, cutFiles, defaultToolbarItems, deleteEnd, deleteInit, destroy, detailsInit, doDeleteFiles, doDownload, doDownloadFiles, doPasteUpdate, doRename, download, downloadInit, dragCancel, dragEnd, dragHelper, dragStartHandler, dragStopHandler, dragging, draggingHandler, dropHandler, dropInit, dropPath, fileItems, fileType, filter, filterEnd, finalizeEnd, folderItems, generatePath, getAccessClass, getAccessDetails, getCssClass, getDirectories, getDirectoryPath, getDuplicateData, getFullPath, getImageUrl, getItemName, getLocaleText, getModule, getName, getObject, getParentPath, getParents, getPath, getPathId, getPathNames, getPathObject, getSortField, getSortedData, getTargetModule, hasContentAccess, hasDownloadAccess, hasEditAccess, hasReadAccess, hasUploadAccess, hideLayout, hidePaste, initialEnd, isFile, isFileSystemData, layoutChange, layoutItems, layoutRefresh, menuItemData, methodCall, modelChanged, nodeExpand, objectToString, openAction, openEnd, openInit, openSearchFolder, paste, pasteEnd, pasteHandler, pasteInit, pathChanged, pathColumn, pathDrag, permissionCopy, permissionDownload, permissionEdit, permissionEditContents, permissionRead, permissionUpload, read, readDropPath, refresh, refreshEnd, removeActive, removeBlur, removeDropTarget, removeItemClass, rename, renameEnd, renameEndParent, renameInit, resizeEnd, scrollHandler, search, searchTextChange, searchWordHandler, selectAllInit, selectedData, selectionChanged, setDateObject, setNextPath, setNodeId, showPaste, skipUpload, sortByChange, sortColumn, sortComparer, sortbyClickHandler, splitterResize, treeSelect, updateLayout, updatePath, updateRenamingData, updateSelectionData, updateTreeSelection, upload, uploadItem, validateSubFolder };
|
11937
12395
|
//# sourceMappingURL=ej2-filemanager.es5.js.map
|